code
stringlengths
3
1.01M
repo_name
stringlengths
5
116
path
stringlengths
3
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
3
1.01M
#include "compat/coot-sysdep.h" #include <GraphMol/GraphMol.h> #include <boost/python.hpp> using namespace boost::python; #define HAVE_GSL #include <ideal/simple-restraint.hh> #include <coot-utils/coot-coord-utils.hh> #include <lidia-core/rdkit-interface.hh> #include "py-restraints.hh" #include "restraints-private.hh" // for bond-order conversion #include "mmff-restraints.hh" namespace coot { RDKit::ROMol *regularize(RDKit::ROMol &r); RDKit::ROMol *regularize_with_dict(RDKit::ROMol &r, PyObject *py_restraints, const std::string &comp_id); // This tries to get a residue from the dictionary using the // model_Cartn of the dict_atoms. If that is not available, return // a molecule with atoms that do not have positions. RDKit::ROMol *rdkit_mol_chem_comp_pdbx(const std::string &chem_comp_dict_file_name, const std::string &comp_id); RDKit::ROMol *hydrogen_transformations(const RDKit::ROMol &r); RDKit::ROMol *mogulify(const RDKit::ROMol &r); // delete // mmff_b_a_restraints_container_t *mmff_bonds_and_angles(RDKit::ROMol &mol_in); // fiddle with mol void delocalize_guanidinos(RDKit::RWMol *mol); } BOOST_PYTHON_MODULE(pyrogen_boost) { def("regularize", coot::regularize, return_value_policy<manage_new_object>()); def("regularize_with_dict", coot::regularize_with_dict, return_value_policy<manage_new_object>()); def("rdkit_mol_chem_comp_pdbx", coot::rdkit_mol_chem_comp_pdbx, return_value_policy<manage_new_object>()); def("hydrogen_transformations", coot::hydrogen_transformations, return_value_policy<manage_new_object>()); def("mogulify", coot::mogulify, return_value_policy<manage_new_object>()); def("mmff_bonds_and_angles", coot::mmff_bonds_and_angles, return_value_policy<manage_new_object>()); class_<coot::mmff_bond_restraint_info_t>("mmff_bond_restraint_info_t") .def("get_idx_1", &coot::mmff_bond_restraint_info_t::get_idx_1) .def("get_idx_2", &coot::mmff_bond_restraint_info_t::get_idx_2) .def("get_type", &coot::mmff_bond_restraint_info_t::get_type) .def("get_resting_bond_length", &coot::mmff_bond_restraint_info_t::get_resting_bond_length) .def("get_sigma", &coot::mmff_bond_restraint_info_t::get_sigma) ; class_<coot::mmff_angle_restraint_info_t>("mmff_angle_restraint_info_t") .def("get_idx_1", &coot::mmff_angle_restraint_info_t::get_idx_1) .def("get_idx_2", &coot::mmff_angle_restraint_info_t::get_idx_2) .def("get_idx_3", &coot::mmff_angle_restraint_info_t::get_idx_3) .def("get_resting_angle", &coot::mmff_angle_restraint_info_t::get_resting_angle) .def("get_sigma", &coot::mmff_angle_restraint_info_t::get_sigma) ; // established coot class, works with atom names though - so not useful ATM. class_<coot::dict_bond_restraint_t>("dict_bond_restraint_t") .def("atom_id_1", &coot::dict_bond_restraint_t::atom_id_1) .def("atom_id_2", &coot::dict_bond_restraint_t::atom_id_2) .def("type", &coot::dict_bond_restraint_t::type) .def("value_dist", &coot::dict_bond_restraint_t::value_dist) .def("value_esd", &coot::dict_bond_restraint_t::value_esd) ; class_<coot::mmff_b_a_restraints_container_t>("mmff_b_a_restraints_container_t") .def("bonds_size", &coot::mmff_b_a_restraints_container_t::bonds_size) .def("angles_size", &coot::mmff_b_a_restraints_container_t::angles_size) .def("get_bond", &coot::mmff_b_a_restraints_container_t::get_bond) .def("get_angle", &coot::mmff_b_a_restraints_container_t::get_angle) ; } RDKit::ROMol* coot::mogulify(const RDKit::ROMol &mol) { RDKit::RWMol rw(mol); coot::mogulify_mol(rw); RDKit::ROMol *ro = new RDKit::ROMol(rw); return ro; } RDKit::ROMol * coot::regularize(RDKit::ROMol &mol_in) { RDKit::ROMol *m = new RDKit::ROMol(mol_in); return m; } RDKit::ROMol * coot::regularize_with_dict(RDKit::ROMol &mol_in, PyObject *restraints_py, const std::string &comp_id) { coot::dictionary_residue_restraints_t dict_restraints = monomer_restraints_from_python(restraints_py); RDKit::RWMol *m = new RDKit::RWMol(mol_in); mmdb::Residue *residue_p = make_residue(mol_in, 0, comp_id); if (! residue_p) { std::cout << "WARNING:: bad residue " << std::endl; } else { // deep copy residue and add to new molecule. mmdb::Manager *cmmdbmanager = util::create_mmdbmanager_from_residue(residue_p); mmdb::Residue *new_residue_p = coot::util::get_first_residue(cmmdbmanager); mmdb::PPAtom residue_atoms = 0; int n_residue_atoms; new_residue_p->GetAtomTable(residue_atoms, n_residue_atoms); std::cout << "------------------ simple_refine() called from " << "restraints-boost.cc:regularize_with_dict()" << std::endl; simple_refine(new_residue_p, cmmdbmanager, dict_restraints); std::cout << "------------------ simple_refine() finished" << std::endl; int iconf = 0; update_coords(m, iconf, new_residue_p); } return static_cast<RDKit::ROMol *>(m); } RDKit::ROMol * coot::rdkit_mol_chem_comp_pdbx(const std::string &chem_comp_dict_file_name, const std::string &comp_id) { RDKit::ROMol *mol = new RDKit::ROMol; coot::protein_geometry geom; geom.set_verbose(false); int read_number = 0; geom.init_refmac_mon_lib(chem_comp_dict_file_name, read_number); bool idealized = false; idealized = true; // 20150622 - so that we pick up the coords of OXT in 01Y bool try_autoload_if_needed = false; mmdb::Residue *r = geom.get_residue(comp_id, idealized, try_autoload_if_needed); std::pair<bool, dictionary_residue_restraints_t> rest = geom.get_monomer_restraints(comp_id); if (rest.first) { if (r) { // makes a 3d conformer // 20140618: This was false - now try true so that it processes 110 (i.e. no more // valence error). // 20141115: But if this is true, then 313 fails to find C-OC single or // double bonds (it should be deloc - it's a carboxylate) // try { // experimental value - for Friday. // bool undelocalize = false; // bool undelocalize = true; RDKit::RWMol mol_rw = coot::rdkit_mol(r, rest.second, "", undelocalize); RDKit::ROMol *m = new RDKit::ROMol(mol_rw); RDKit::MolOps::assignStereochemistry(*m, false, true, true); // Here test that the propety mmcif_chiral_volume_sign has // been set on atoms of mol_rw and m // if (false) { for (unsigned int iat=0; iat<m->getNumAtoms(); iat++) { RDKit::ATOM_SPTR at_p = (*m)[iat]; try { std::string name; std::string cv; at_p->getProp("name", name); at_p->getProp("mmcif_chiral_volume_sign", cv); std::cout << "m: name " << name << " " << cv << std::endl; } catch (const KeyErrorException &err) { std::cout << "m: no name or cv " << std::endl; } try { std::string cip; at_p->getProp("_CIPCode", cip); std::cout << "m: cip-code " << cip << std::endl; } catch (const KeyErrorException &err) { } } } // debug. OK, so the bond orders are undelocalized here. // debug_rdkit_molecule(&mol_rw); return m; } catch (const std::runtime_error &rte) { std::cout << "ERROR:: " << rte.what() << std::endl; } } else { // Are you here unexpectedly? That's because the input cif dictionary doesn't have // _chem_comp_atom.x{yz} or model_Cartn_x{yz} or pdbx_model_Cartn_x{yz}_ideal for // the given comp_id. // std::cout << "INFO:: No 3d coords in dictionary : using 2d from dictionary bonds and angles." << std::endl; // makes a 2d conformer // Bleugh. We deal with mol vs m badly here. // RDKit::RWMol mol_rw = coot::rdkit_mol(rest.second); RDKit::MolOps::sanitizeMol(mol_rw); RDKit::ROMol *m = new RDKit::ROMol(mol_rw); bool canon_orient = false; bool clear_confs = false; RDDepict::compute2DCoords(*m, NULL, canon_orient, clear_confs, 10, 20); delete mol; return m; } } return mol; } RDKit::ROMol * coot::hydrogen_transformations(const RDKit::ROMol &mol) { debug_rdkit_molecule(&mol); RDKit::RWMol *r = new RDKit::RWMol(mol); RDKit::ROMol *query_cooh = RDKit::SmartsToMol("[C^2](=O)O[H]"); RDKit::ROMol *query_n = RDKit::SmartsToMol("[N^3;H2]"); std::vector<RDKit::MatchVectType> matches_cooh; std::vector<RDKit::MatchVectType> matches_n; bool recursionPossible = true; bool useChirality = true; bool uniquify = true; // Note that we get the atom indexing using mol, but we change the // molecule r (I hope that the atoms are equivalently indexed). int matched_cooh = RDKit::SubstructMatch(mol,*query_cooh,matches_cooh,uniquify,recursionPossible, useChirality); int matched_n = RDKit::SubstructMatch(mol,*query_n, matches_n, uniquify,recursionPossible, useChirality); // delete atoms after they have all been identified otherwise the indexing goes haywire. // std::vector<RDKit::Atom *> atoms_to_be_deleted; if (true) // this is useful info (at the moment at least) std::cout << "Hydrogen_transformations:" << "\n number of COOH matches: " << matches_cooh.size() << "\n number of NH2 matches: " << matches_n.size() << "\n"; if (true) { // debugging for (unsigned int imatch_cooh=0; imatch_cooh<matches_cooh.size(); imatch_cooh++) { std::cout << "INFO:: Removable hydrogen COOH matches: "; for (unsigned int i=0; i<matches_cooh[imatch_cooh].size(); i++) { std::cout << " [" << matches_cooh[imatch_cooh][i].first << ": " << matches_cooh[imatch_cooh][i].second << "]"; } std::cout << std::endl; } } for (unsigned int imatch_cooh=0; imatch_cooh<matches_cooh.size(); imatch_cooh++) { RDKit::ATOM_SPTR at_c = (*r)[matches_cooh[imatch_cooh][0].second]; RDKit::ATOM_SPTR at_o1 = (*r)[matches_cooh[imatch_cooh][1].second]; RDKit::ATOM_SPTR at_o2 = (*r)[matches_cooh[imatch_cooh][2].second]; RDKit::ATOM_SPTR at_h = (*r)[matches_cooh[imatch_cooh][3].second]; std::string at_c_name, at_o1_name, at_o2_name, at_h_name; at_c->setProp( "atom_type", "C"); at_o1->setProp("atom_type", "OC"); at_o2->setProp("atom_type", "OC"); RDKit::Bond *bond_1 = r->getBondBetweenAtoms(at_c.get()->getIdx(), at_o1.get()->getIdx()); RDKit::Bond *bond_2 = r->getBondBetweenAtoms(at_c.get()->getIdx(), at_o2.get()->getIdx()); RDKit::Bond *bond_3 = r->getBondBetweenAtoms(at_h.get()->getIdx(), at_o2.get()->getIdx()); if (bond_1) { if (bond_2) { // We can't make the bonds deloc in combination with a // setting of the formal charge on the at_o2 because // molecule then fails the Oxygen atom valence test in // sanitization. // bond_1->setBondType(RDKit::Bond::ONEANDAHALF); bond_2->setBondType(RDKit::Bond::ONEANDAHALF); } } // at_o2->setFormalCharge(-1); // not if the bonds are deloc/ONEANDAHALF. if (bond_3) r->removeBond(at_o2.get()->getIdx(), at_h.get()->getIdx()); else std::cout << "DEBUG:: hydrogen_transformations(): no bond_3 (O-H bond) found!" << std::endl; atoms_to_be_deleted.push_back(at_h.get()); } for (unsigned int imatch_n=0; imatch_n<matches_n.size(); imatch_n++) { unsigned int n_idx = matches_n[imatch_n][0].second; RDKit::ATOM_SPTR at_n = (*r)[n_idx]; unsigned int degree = at_n->getDegree(); at_n->setFormalCharge(+1); if (false) { // debugging std::string name; at_n->getProp("name", name); std::cout << "debug:: N-atom idx " << n_idx << " " << name << " has degree " << degree << std::endl; } if (degree == 4) { // it has its 2 hydrogens already at_n->setProp("atom_type", "NT2"); // also set to NT3 by SMARTS match in pyrogen.py } if (degree == 3) { at_n->setProp("atom_type", "NT3"); // also set to NT3 by SMARTS match in pyrogen.py // add a hydrogen atom and a bond to the nitrogen. // RDKit::Atom *new_h_at = new RDKit::Atom(1); // we want to find the idx of this added H, so we do that by // keeping hold of the pointer (otherwise the atom gets copied // on addAtom() and we lose the handle on the new H atom in the // molecule). bool updateLabel=true; bool takeOwnership=true; r->addAtom(new_h_at, updateLabel, takeOwnership); unsigned int h_idx = new_h_at->getIdx(); if (h_idx != n_idx) { r->addBond(n_idx, h_idx, RDKit::Bond::SINGLE); } else { std::cout << "OOOPs: bad indexing on adding an amine H " << h_idx << std::endl; } } } for(unsigned int idel=0; idel<atoms_to_be_deleted.size(); idel++) r->removeAtom(atoms_to_be_deleted[idel]); remove_phosphate_hydrogens(r, true); remove_sulphate_hydrogens (r, true); // debug if (false) std::cout << "DEBUG:: hydrogen_transformations calling sanitizeMol() " << std::endl; // do we neet to sanitize? Yes, we do because we go on to minimize this molecule RDKit::MolOps::sanitizeMol(*r); if (false) std::cout << "DEBUG:: hydrogen_transformations back from sanitizeMol() " << std::endl; // delocalize_guanidinos(r); // not yet. RDKit::ROMol *ro_mol = new RDKit::ROMol(*r); if (0) std::cout << "hydrogen_transformations returns mol: " << RDKit::MolToSmiles(*ro_mol) << std::endl; delete r; return ro_mol; } void coot::delocalize_guanidinos(RDKit::RWMol *mol) { RDKit::ROMol *query = RDKit::SmartsToMol("N[C^2](=N)N"); std::vector<RDKit::MatchVectType> matches; bool recursionPossible = true; bool useChirality = true; bool uniquify = true; // Note that we get the atom indexing using mol, but we change the // molecule r (I hope that the atoms are equivalently indexed). int matched = RDKit::SubstructMatch(*mol,*query,matches,uniquify,recursionPossible, useChirality); if (1) // this is useful info (at the moment at least) std::cout << " delocalize guanidinos matches: " << matches.size() << "\n"; for (unsigned int imatch=0; imatch<matches.size(); imatch++) { std::cout << "INFO:: guanidino hydrogen exchanges matches: "; for (unsigned int i=0; i<matches[imatch].size(); i++) { std::cout << " [" << matches[imatch][i].first << ": " << matches[imatch][i].second << "]"; } std::cout << std::endl; } for (unsigned int imatch=0; imatch<matches.size(); imatch++) { RDKit::ATOM_SPTR at_n1 = (*mol)[matches[imatch][0].second]; RDKit::ATOM_SPTR at_c = (*mol)[matches[imatch][1].second]; RDKit::ATOM_SPTR at_n2 = (*mol)[matches[imatch][2].second]; RDKit::ATOM_SPTR at_n3 = (*mol)[matches[imatch][3].second]; std::cout << "INFO:: C hybridisation " << at_c->getHybridization() << std::endl; RDKit::Bond *bond_1 = mol->getBondBetweenAtoms(at_c.get()->getIdx(), at_n1.get()->getIdx()); RDKit::Bond *bond_2 = mol->getBondBetweenAtoms(at_c.get()->getIdx(), at_n2.get()->getIdx()); RDKit::Bond *bond_3 = mol->getBondBetweenAtoms(at_c.get()->getIdx(), at_n3.get()->getIdx()); std::cout << "INFO:: C hybridisation " << at_c->getHybridization() << std::endl; if (bond_2) { if (bond_3) { at_n1->setHybridization(RDKit::Atom::SP2); at_c->setHybridization(RDKit::Atom::SP2); bond_2->setBondType(RDKit::Bond::ONEANDAHALF); bond_3->setBondType(RDKit::Bond::ONEANDAHALF); std::cout << "deloced bonds 2 and 3" << std::endl; // if (bond_1) { std::cout << "deloced bond 1 " << std::endl; bond_1->setBondType(RDKit::Bond::ONEANDAHALF); } } } } }
jlec/coot
pyrogen/restraints-boost.cc
C++
gpl-3.0
16,181
/* * Orbit, a versatile image analysis software for biological image-based quantification. * Copyright (C) 2009 - 2018 Idorsia Pharmaceuticals Ltd., Hegenheimermattweg 91, CH-4123 Allschwil, Switzerland. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ package com.actelion.research.orbit.imageAnalysis.modules.mihc; import com.actelion.research.orbit.imageAnalysis.dal.localImage.NDPISReaderOrbit; import com.actelion.research.orbit.imageAnalysis.dal.localImage.NDPIUtils; import loci.common.services.ServiceFactory; import loci.formats.gui.BufferedImageReader; import loci.formats.meta.IMetadata; import loci.formats.services.OMEXMLService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.imageio.ImageIO; import java.awt.image.BufferedImage; import java.io.File; import java.util.Arrays; public class MihcTest { private static final Logger logger = LoggerFactory.getLogger(MihcTest.class); public static void main(String[] args) throws Exception { String fn = "D:\\pic\\Hamamatsu\\fl8\\6188205.ndpis"; fn = "D:\\pic\\Hamamatsu\\fl5ome\\test3.ndpis"; int tx = 0; int ty = 0; NDPISReaderOrbit reader = new NDPISReaderOrbit(); reader.setFlattenedResolutions(false); BufferedImageReader bir = new BufferedImageReader(reader); MihcConfigData confData = new MihcConfigData(); reader.setId(fn); double[] gains = NDPIUtils.getExposureTimesGain(reader); logger.info("gains: "+ Arrays.toString(gains)); reader.close(); MihcConfig mihcConfig = new MihcConfig(confData.channelNames4HT,confData.Asn4,confData.normGain4); mihcConfig.saveConfig("d:/conf.xml"); // MultiplexImageReader mir = new MultiplexImageReader(bir,conf.channelNames6, conf.filterNewXeon6, conf.normGain6, gains); MultiplexImageReader mir = new MultiplexImageReader(bir,mihcConfig,gains); ServiceFactory factory = new ServiceFactory(); OMEXMLService service = factory.getInstance(OMEXMLService.class); IMetadata meta = service.createOMEXMLMetadata(); mir.setMetadataStore(meta); mir.setId(fn); System.out.println("image dimensions: "+reader.getSizeX()+","+reader.getSizeY()); System.out.println("channel name: "+meta.getChannelName(mir.getSeries(),0)); // for (int c=0; c<reader.getSizeC(); c++) { // long startt = System.currentTimeMillis(); // BufferedImage img = mir.openImage(c, 100, 300, 2000, 2000); // long usedt = System.currentTimeMillis()-startt; // System.out.println("used time for channel "+c+": "+usedt); // } BufferedImage img = mir.openImage(2, 1000, 1000, 1000, 1000); ImageIO.write(img,"png",new File("d:/test.png")); reader.close(); } }
mstritt/orbit-image-analysis
src/main/java/com/actelion/research/orbit/imageAnalysis/modules/mihc/MihcTest.java
Java
gpl-3.0
3,479
<?php /** * OpenEyes * * (C) Moorfields Eye Hospital NHS Foundation Trust, 2008-2011 * (C) OpenEyes Foundation, 2011-2013 * This file is part of OpenEyes. * OpenEyes is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. * OpenEyes is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * You should have received a copy of the GNU General Public License along with OpenEyes in a file titled COPYING. If not, see <http://www.gnu.org/licenses/>. * * @package OpenEyes * @link http://www.openeyes.org.uk * @author OpenEyes <info@openeyes.org.uk> * @copyright Copyright (c) 2008-2011, Moorfields Eye Hospital NHS Foundation Trust * @copyright Copyright (c) 2011-2013, OpenEyes Foundation * @license http://www.gnu.org/licenses/gpl-3.0.html The GNU General Public License V3.0 */ class TextField extends BaseCWidget { public $name; public $htmlOptions; public $links=array(); }
zendawg/OpenEyes
protected/widgets/TextField.php
PHP
gpl-3.0
1,231
/******************************************************************************* * Copyright (c) 2015 Contributors. * All rights reserved. This program and the accompanying materials are made available under * the terms of the GNU Lesser General Public * License v3.0 which accompanies this distribution, and is available at * http://www.gnu.org/licenses/lgpl.html ******************************************************************************/ package hr.caellian.core.versionControl; import java.net.URL; import java.util.Optional; /** * Class used to store and handle version data. * * @author Caellian */ public class VersionData implements Comparable<VersionData> { public final Version version; public final Optional<String> name; public final Optional<String> changelog; public final Optional<URL> downloadLink; public VersionData(Version version) { this(version, Optional.<String>empty(), Optional.<String>empty(), Optional.<URL>empty()); } public VersionData(Version version, Optional<String> name, Optional<String> changelog, Optional<URL> downloadLink) { this.version = version; this.name = name; this.changelog = changelog; this.downloadLink = downloadLink; } @SuppressWarnings("NullableProblems") @Override public int compareTo(VersionData other) { return this.version.major - other.version.major == 0 ? (this.version.minor - other.version.minor == 0 ? (this.version.patch - other.version.patch == 0 ? 0 : (this.version.patch - other.version.patch)) : (this.version.minor - other.version.minor)) : (this.version.major - other.version.major); } }
Caellian/CaellianCore
src/main/java/hr/caellian/core/versionControl/VersionData.java
Java
gpl-3.0
1,616
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head prefix="og: http://ogp.me/ns# dc: http://purl.org/dc/terms/"> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="//oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="//oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]--> <title>Fan page: D.S. Tanner</title> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"> <!-- Optional theme --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous"> <style type="text/css"> #top{ width: 100%; float: left; } #place{ width: 100%; float: left; } #address{ width: 15%; float: left; } #sgvzl{ width: 80%; float: left; } #credits{ width: 100%; float: left; clear: both; } #location-marker{ width: 1em; } #male-glyph{ width: 1em; } </style> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript" id="sgvzlr_script" src="http://mgskjaeveland.github.io/sgvizler/v/0.6/sgvizler.min.js"></script> <script type="text/javascript"> sgvizler .defaultEndpointURL("http://bibfram.es/fuseki/cobra/query"); //// Leave this as is. Ready, steady, go! $(document).ready(sgvizler.containerDrawAll); </script> <!-- Latest compiled and minified JavaScript --> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script> <meta name="title" content="D.S. Tanner"> <meta property="dc:title" content="D.S. Tanner"> <meta property="og:title" content="D.S. Tanner"> <meta name="author" content="D.S. Tanner"> <meta name="dc:creator" content="D.S. Tanner"> </head> <body prefix="cbo: http://comicmeta.org/cbo/ dc: http://purl.org/dc/elements/1.1/ dcterms: http://purl.org/dc/terms/ foaf: http://xmlns.com/foaf/0.1/ oa: http://www.w3.org/ns/oa# rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# schema: http://schema.org/ skos: http://www.w3.org/2004/02/skos/core# xsd: http://www.w3.org/2001/XMLSchema#"> <div id="wrapper" class="container" about="http://ivmooc-cobra2.github.io/resources/fan/2630" typeof="http://comicmeta.org/cbo/Fan"> <div id="top"> <h1> <span property="http://schema.org/name">D.S. Tanner</span> </h1> <dl> <dt> <label for="http://comicmeta.org/cbo/Fan"> <span>type</span> </label> </dt> <dd> <span>http://comicmeta.org/cbo/Fan</span> </dd> </dl> <dl> <dt> <label for="http://schema.org/name"> <span> <a href="http://schema.org/name">name</a> </span> </label> </dt> <dd> <span property="http://schema.org/name">D.S. Tanner</span> </dd> </dl> </div> <div id="place" rel="http://schema.org/address" resource="http://ivmooc-cobra2.github.io/resources/place/2464" typeof="http://schema.org/Place"> <h2>Location <a href="http://ivmooc-cobra2.github.io/resources/place/2464"> <img id="location-marker" src="/static/resources/img/location.svg" alt="location marker glyph"> </a> </h2> <div id="address" rel="http://schema.org/address" typeof="http://schema.org/PostalAddress" resource="http://ivmooc-cobra2.github.io/resources/place/2464/address"> <dl> <dt> <label for="http://schema.org/streetAddress"> <span> <a href="http://schema.org/streetAddress">Street address</a> </span> </label> </dt> <dd> <span property="http://schema.org/streetAddress">170 Blenheim Dr.</span> </dd> </dl> <dl> <dt> <label for="http://schema.org/addressLocality"> <span> <a href="http://schema.org/addressLocality">Address locality</a> </span> </label> </dt> <dd> <span property="http://schema.org/addressLocality">Ottawa 7</span> </dd> </dl> <dl> <dt> <label for="http://schema.org/addressRegion"> <span> <a href="http://schema.org/addressRegion">Address region</a> </span> </label> </dt> <dd> <span property="http://schema.org/addressRegion">ON</span> </dd> </dl> <dl> <dt> <label for="http://schema.org/postalCode"> <span> <a href="http://schema.org/postalCode">Postal code</a> </span> </label> </dt> <dd> <span property="http://schema.org/postalCode">NULL</span> </dd> </dl> <dl> <dt> <label for="http://schema.org/addressCountry"> <span> <a href="http://schema.org/addressCountry">Address country</a> </span> </label> </dt> <dd> <span property="http://schema.org/addressCountry">CA</span> </dd> </dl> </div> <div id="sgvzl" data-sgvizler-endpoint="http://bibfram.es/fuseki/cobra/query" data-sgvizler-query="PREFIX dc: <http://purl.org/dc/elements/1.1/&gt; &#xA;PREFIX cbo: <http://comicmeta.org/cbo/&gt; &#xA;PREFIX foaf: <http://xmlns.com/foaf/0.1/&gt;&#xA;PREFIX schema: <http://schema.org/&gt;&#xA;SELECT ?lat ?long &#xA;WHERE {&#xA; ?fan schema:address ?Place .&#xA; ?Place schema:geo ?Geo .&#xA; ?Geo schema:latitude ?lat .&#xA; ?Geo schema:longitude ?long .&#xA; FILTER(?fan = <http://ivmooc-cobra2.github.io/resources/fan/2630&gt;)&#xA;}" data-sgvizler-chart="google.visualization.GeoChart" data-sgvizler-loglevel="2" style="width:800px; height:400px;"></div> </div> <div id="letter" rel="http://purl.org/dc/elements/1.1/creator" resource="http://ivmooc-cobra2.github.io/resources/letter/2951"> <dl> <dt> <label for="http://schema.org/streetAddress"> <span> <a href="http://schema.org/streetAddress">Street address</a> </span> </label> </dt> <dd> <span property="http://schema.org/streetAddress">170 Blenheim Dr.</span> </dd> </dl> </div> <div id="credits">Icons made by <a href="http://www.flaticon.com/authors/simpleicon" title="SimpleIcon">SimpleIcon</a> from <a href="http://www.flaticon.com" title="Flaticon">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a> </div> </div> </body> </html>
Timathom/timathom.github.io
discovery/resources/fan/2630/index.html
HTML
gpl-3.0
8,213
// // Author: Shervin Aflatooni // #pragma once #include <glm/glm.hpp> struct Vertex { glm::vec3 position; glm::vec2 texCoord; glm::vec3 normal; glm::vec3 tangent; Vertex(const glm::vec3& position, const glm::vec2& texCoord = glm::vec2(0, 0), const glm::vec3& normal = glm::vec3(0, 0, 0), const glm::vec3& tangent = glm::vec3(0, 0, 0)) { this->position = position; this->texCoord = texCoord; this->normal = normal; this->tangent = tangent; } };
Shervanator/Engine
src/engine/Vertex.h
C
gpl-3.0
483
#!/bin/bash # $Id: refillchroot.sh,v 1.3 2010/06/04 02:51:03 zyt Exp $ # 重新制作 chroot 目录到 TO 指定的那一步 # 用执行的时间换空间 # OPS 的次序是按过程而定,不能随便改变,只能随过程而变 TO=0 OPS="0 1 2 3" if [ "$1" != "" ]; then TO=$1; fi rm chroot/* -rf for i in $OPS; do case "$i" in "0" ) bash crt_0.sh ;; "1" ) bash install.sh ;; "2" ) bash rmact.sh ;; "3" ) bash addtar.sh ;; esac if [ "$TO" = "$i" ]; then echo "本次从 0 状态直到 $TO 状态" break fi done exit # End of file
LucencyLiu/tool
shell/hongqi2000/workshop/refillchroot.sh
Shell
gpl-3.0
579
from django.contrib import admin from iitem_database.models import Item, ItemClass, Area, Creature, Drops, Found, UserItems, ItemReview admin.site.register(Item) admin.site.register(ItemClass) admin.site.register(Area) admin.site.register(Creature) admin.site.register(Drops) admin.site.register(Found) admin.site.register(UserItems) admin.site.register(ItemReview)
svilaa/item_database
item_database/iitem_database/admin.py
Python
gpl-3.0
366
/* * Copyright (c) 2016 OBiBa. All rights reserved. * * This program and the accompanying materials * are made available under the terms of the GNU Public License v3.0. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.obiba.mica.config; import org.obiba.mica.config.locale.AngularCookieLocaleResolver; import org.springframework.boot.bind.RelaxedPropertyResolver; import org.springframework.context.EnvironmentAware; import org.springframework.context.MessageSource; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.support.ReloadableResourceBundleMessageSource; import org.springframework.core.env.Environment; import org.springframework.web.servlet.LocaleResolver; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.i18n.LocaleChangeInterceptor; @Configuration public class LocaleConfiguration extends WebMvcConfigurerAdapter implements EnvironmentAware { private RelaxedPropertyResolver propertyResolver; @Override public void setEnvironment(Environment environment) { propertyResolver = new RelaxedPropertyResolver(environment, "spring.messageSource."); } @Bean(name = "localeResolver") public LocaleResolver localeResolver() { AngularCookieLocaleResolver cookieLocaleResolver = new AngularCookieLocaleResolver(); cookieLocaleResolver.setCookieName("NG_TRANSLATE_LANG_KEY"); return cookieLocaleResolver; } @Bean public MessageSource messageSource() { ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource(); messageSource.setBasename("classpath:/i18n/messages"); messageSource.setDefaultEncoding("UTF-8"); messageSource.setCacheSeconds(propertyResolver.getProperty("cacheSeconds", Integer.class, 1)); return messageSource; } @Override public void addInterceptors(InterceptorRegistry registry) { LocaleChangeInterceptor localeChangeInterceptor = new LocaleChangeInterceptor(); localeChangeInterceptor.setParamName("language"); registry.addInterceptor(localeChangeInterceptor); } }
apruden/mica2
mica-webapp/src/main/java/org/obiba/mica/config/LocaleConfiguration.java
Java
gpl-3.0
2,373
--- title: "BJP और RSS ने गांधी का नाम लिया ये कांग्रेस के विचारों की विजय है: अशोक गहलोत" layout: item category: ["india"] date: 2019-10-02T06:18:01.591Z image: 1569997081590gehlot-congress-gandhi-bjp-rss-victory.jpg --- <p>जयपुर: मुख्यमंत्री अशोक गहलोत ने मंगलवार को कहा कि आरएसएस, भाजपा तथा उसके नेताओं द्वारा आज महात्मा गांधी का नाम लिया जाना गांधी और कांग्रेस के विचारों की विजय है। उन्होंने कहा, &#39;आरएसएस, भाजपा और उनके नेताओं को गांधी का नाम लेना पड़ रहा है, यह हमारी नीतियों, कार्यक्रमों और सिंद्वातों की विजय है।&#39; वह महात्मा गांधी के 150वें जयंती वर्ष के अवसर पर राजस्थान प्रदेश कांग्रेस कमेटी के विशेष अधिवेशन को संबोधित कर रहे थे। उन्होंने कहा कि आजादी के बाद आज देश जिस स्थिति में गुजर रहा है, वह चिंता का विषय है। लोकतंत्र खतरे में है। पूरे देश में भय और हिंसा का माहौल है।</p> <p>भाजपा और आरएसएस पर निशाना साधते हुए उन्होंने कहा, &#39;मैं उन लोगों को कहना चाहूंगा कि खाली जबान से नाम लेने से काम नहीं चलेगा। आपके दिल में क्या है, दिमाग में क्या है, वह स्पष्ट करो। अगर दिल और दिमाग में यह महसूस किया है कि हमने गलती की.. हम आजादी से पहले गांधी को पहचान नहीं पाए..जब हम लोग मुखबिरी करते थे अंग्रेजों के साथ..स्वतंत्रता सेनानियों को फंसाते थे। प्रधानमंत्री नरेंद्र मोदी और आरएसएस के लोगों को देश से यह माफी मांगनी चाहिए कि हम पहचान नहीं पाए थे महात्मा गांधी को। बिना महात्मा गांधी के देश और दुनिया का काम नहीं चल सकता है।&#39; </p> <p>गहलोत ने कहा कि आज देश और दुनिया में अशांति का माहौल है। हिंसा का माहौल है। इस देश में जैसा माहौल बनाया गया 2014 के बाद में, वह आप सब के सामने है। उन्होंने कहा कि कांग्रेस ने 70 साल तक देश में लोकतंत्र कायम रखा और उसे मजबूत किया तथा यह उसी की देन है कि पूरे विश्व में आज इस देश का मान और सम्मान है। </p> <p>प्रधानमंत्री मोदी की हालिया अमेरिका यात्रा का जिक्र करते हुए गहलोत ने कहा, &#39;अभी प्रधानमंत्री मोदी अमेरिका में बता रहे थे कि सात पाप गांधी जी ने बताए थे। अब उनको याद आ रहे हैं 70 साल के बाद....बहुत जोश से बोल रहे थे जैसे कि हिन्दुस्तान के लोगों को मालूम ही नहीं है कि मैं नई खोज लेकर आया हूं..सात पाप।&#39; उन्होंने कहा कि मोदी वहां बोल रहे थे...अगली सरकार ट्रंप सरकार..अगर ट्रंप नहीं जीता तो अमेरिका से क्या संबंध रहेंगे हमारे..कभी सोचा आपने...कोई प्रधानमंत्री बोल सकता है इस प्रकार से कि अगली सरकार ट्रंप सरकार?</p> <p>गहलोत ने कहा, &#39;इसलिये मैंने चुनाव के दौरान कहा था कि बॉलीवुड में कोई अभिनेता जिस प्रकार से एक्टिंग करता है फिल्मों में, जहां सच्चाई कुछ नहीं होती है... उसी ढंग से मोदी जी हैं, सच्चाई कुछ नहीं है। वहीं, सच्चाई कांग्रेस के पक्ष में है..सच्चाई राहुल गांधी के साथ है। मोदी अभिनेता के रूप में अच्छी बात बोलते हैं, भाषण अच्छा देते हैं, लेकिन भाषण देने से पेट नहीं भरता है। नौकरियां जा रही हैं।&#39;</p>
InstantKhabar/_source
_source/news/2019-10-02-gehlot-congress-gandhi-bjp-rss-victory.html
HTML
gpl-3.0
6,240
% !TEX root = ../team-report.tex % ERA-Großpraktikum: Team Bericht -- Organisatorisches (Vision) \subsubsection{Die Vision} \label{team:orga-plan-vision} \vspace{-0.2cm} In den ersten sechs bis acht Wochen des Großpraktikumszeitraums beschäftigte sich die Gruppe mit der Ausarbeitung eines groben Grundrisses für die Architektur des Simulators, mit der Gewöhnung an die notwendigen Technologien für die Implementierung sowie mit der Definition einer Vision und eines Zeitplanes. Die Vision war primär von zwei Quellen beeinflusst. Zum einen waren dies unsere eigenen Erfahrungen als Studierende in der Vorlesung \emph{Einführung in die Rechnerarchitektur} (ERA). Da jeder von uns gerade erst in derselben Situation wie unsere zukünftigen Kunden gesessen hatte, konnten wir natürlich leicht spezifizieren, was uns und unseren Kommilitonen beim Erlernen der maschinennahen Programmierung und Assemblersprachen geholfen hätte. Zum anderen hatten wir durch den bereits existierenden und von uns in ERA genutzten Simulator einen Referenzpunkt für die Entwicklung von \erasim{}. Wir konnten analysieren, welche Aspekte von Jasmin uns geholfen hatten, konnten aber insbesondere auch jene Features nennen, welche uns an Jasmin nicht gefielen und deren Verbesserung als Ziel für \erasim{} festlegen. Die Überlegungen dieser ersten Phase verfestigten sich schließlich in den folgenden langfristigen Zielen: \begin{senumerate}{-0.45cm} \item Die Funktionen von \erasim{} sollten eine Übermenge jener von Jasmin sein. Das bedeutet, dass sämtliche Aufgaben aus früheren Zentralübungen, Klausuren und Tutorübungen (soweit in RISC-V übersetzbar) in unserem Simulator ausführbar sein sollten. \item Der Simulator soll zwar primär für die Lehre gedacht, jedoch nicht durch diese beschränkt sein. Auch weitere Einsatzgebiete, wie die Forschung, sollten, zumindest durch Erweiterungen der Grundversion, offen bleiben. Eine Grundanforderung hierfür war es, echte RISC-V Programme ausführen zu können. \item Als Voraussetzung für (2) sollte der Simulator nicht \emph{zeilen}-, sondern \emph{address}basiert sein. Das bedeutet, dass Marken Adressen im Speicher und nicht Zeilen im Text referenzieren sollten. Hierfür müssten Instruktionen auch in den Speicher assembliert werden. \item Als wohl wichtigste Eigenschaft sollte \erasim{}, im Vergleich zu Jasmin, nicht nur für einen bestimmten Befehlssatz wie x86 oder ARM implementiert sein, sondern für beliebige Architekturen erweiterbar bleiben. \vspace{-0.4cm} \end{senumerate}
TUM-LRR/era-gp-sim
docs/reports/final/team-report/orga/vision.tex
TeX
gpl-3.0
2,574
/** * */ package edu.wisc.cs.will.Boosting.EM; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.NoSuchElementException; import java.util.Set; import edu.wisc.cs.will.Boosting.Common.SRLInference; import edu.wisc.cs.will.Boosting.MLN.MLNInference; import edu.wisc.cs.will.Boosting.RDN.JointModelSampler; import edu.wisc.cs.will.Boosting.RDN.JointRDNModel; import edu.wisc.cs.will.Boosting.RDN.RegressionRDNExample; import edu.wisc.cs.will.Boosting.RDN.SingleModelSampler; import edu.wisc.cs.will.Boosting.RDN.WILLSetup; import edu.wisc.cs.will.DataSetUtils.Example; import edu.wisc.cs.will.FOPC.Literal; import edu.wisc.cs.will.FOPC.PredicateName; import edu.wisc.cs.will.Utils.ProbDistribution; import edu.wisc.cs.will.Utils.Utils; /** * Class to store one world state * @author tkhot * */ public class HiddenLiteralState { /** * Hash maps from predicate name to literals and their assignments in this world state * Can't rely on the "sampledState" within each example as that may keep changing. * Used Integer instead of Boolean. For multi-class examples, it indicates the index of * the class label. */ private Map<String, List<RegressionRDNExample>> predNameToLiteralMap; private Map<String, List<Integer>> predNameToAssignMap; // Cache the string representation of literal to assignment map; private Map<String, Integer> literalRepToAssignMap = null; private Map<String, ProbDistribution> literalRepToCondDistrMap = null; private List<Literal> trueFacts = null; private List<Literal> falseFacts = null; private double statePseudoProbability = 1; public HiddenLiteralState(List<RegressionRDNExample> groundLits) { predNameToLiteralMap = new HashMap<String, List<RegressionRDNExample>>(); for (RegressionRDNExample lit : groundLits) { String predName = lit.predicateName.name; if (!predNameToLiteralMap.containsKey(predName)) { predNameToLiteralMap.put(predName, new ArrayList<RegressionRDNExample>()); } predNameToLiteralMap.get(predName).add(lit); } initAssignment(); } public HiddenLiteralState(Map<String, List<RegressionRDNExample>> jointExamples, Map<String, List<Integer>> assignment) { predNameToLiteralMap = new HashMap<String, List<RegressionRDNExample>>(jointExamples); predNameToAssignMap = new HashMap<String, List<Integer>>(assignment); } public HiddenLiteralState(Map<String, List<RegressionRDNExample>> jointExamples) { predNameToLiteralMap = new HashMap<String, List<RegressionRDNExample>>(jointExamples); initAssignment(); } public void addNewExamplesFromState(HiddenLiteralState newState) { for (String newPred : newState.predNameToLiteralMap.keySet()) { if (!this.predNameToLiteralMap.containsKey(newPred)) { this.predNameToLiteralMap.put(newPred, new ArrayList<RegressionRDNExample>()); this.predNameToAssignMap.put(newPred, new ArrayList<Integer>()); } List<RegressionRDNExample> newExamples = newState.predNameToLiteralMap.get(newPred); for (int i = 0; i < newExamples.size(); i++) { this.predNameToLiteralMap.get(newPred).add(newExamples.get(i)); this.predNameToAssignMap.get(newPred).add(newState.predNameToAssignMap.get(newPred).get(i)); } } } public void initAssignment() { predNameToAssignMap = new HashMap<String, List<Integer>>(); for (String predName : predNameToLiteralMap.keySet()) { for (RegressionRDNExample lit : predNameToLiteralMap.get(predName)) { if (!predNameToAssignMap.containsKey(predName)) { predNameToAssignMap.put(predName, new ArrayList<Integer>()); } predNameToAssignMap.get(predName).add(lit.getSampledValue()); } } } public String toPrettyString() { StringBuilder sb = new StringBuilder(); for (String predName : predNameToLiteralMap.keySet()) { for (int i = 0; i < predNameToLiteralMap.get(predName).size(); i++) { sb.append(predNameToLiteralMap.get(predName).get(i).toPrettyString("")); sb.append(":"); sb.append(predNameToAssignMap.get(predName).get(i)); sb.append("\n"); } } return sb.toString(); } /** * Mainly for debugging * @return */ public double percentOfTrues() { long numTrue = 0; long total = 0; for (String key : predNameToAssignMap.keySet()) { for (Integer val : predNameToAssignMap.get(key)) { if (val == 1) { numTrue++; } total++; } } return (double)numTrue/(double)total; } public HiddenLiteralState marginalizeOutPredicate(String predicate) { HiddenLiteralState marginState = new HiddenLiteralState(this.predNameToLiteralMap, this.predNameToAssignMap); marginState.predNameToLiteralMap.remove(predicate); marginState.predNameToAssignMap.remove(predicate); return marginState; } @Override public int hashCode() { return getStringRep().hashCode(); } @Override public boolean equals(Object obj) { if (obj == null) { return false;} if (! (obj instanceof HiddenLiteralState)) { return false; } HiddenLiteralState other = (HiddenLiteralState)obj; String otherRep = other.getStringRep(); String rep = this.getStringRep(); return otherRep.equals(rep); } public String getStringRep() { // Generate string that can uniquely determine this world state // Note we assume that all world states use the same order of literals for a given predicate StringBuilder rep = new StringBuilder(); for (String key : predNameToAssignMap.keySet()) { rep.append(key +":"); /*for (Boolean bool : predNameToAssignMap.get(key)) { rep.append(bool?"1":"0"); }*/ for (Integer val : predNameToAssignMap.get(key)) { rep.append(val); } rep.append("."); } return rep.toString(); } public Set<String> getPredicates() { return predNameToLiteralMap.keySet(); } public void buildLiteralToAssignMap() { literalRepToAssignMap = new HashMap<String, Integer>(); for (String predName : predNameToLiteralMap.keySet()) { for (int i = 0; i < predNameToLiteralMap.get(predName).size(); i++) { String litRep = predNameToLiteralMap.get(predName).get(i).toPrettyString(""); Integer assign = predNameToAssignMap.get(predName).get(i); literalRepToAssignMap.put(litRep, assign); } } } public Integer getAssignment(Example eg) { // Compare string rep String egRep = eg.toString(); if (literalRepToAssignMap != null) { if (literalRepToAssignMap.get(egRep) == null) { Utils.waitHere("Example: " + eg + " not stored in cached worldState"); } return literalRepToAssignMap.get(egRep); } String pred = eg.predicateName.name; List<RegressionRDNExample> litList = predNameToLiteralMap.get(pred); for (int i = 0; i < litList.size(); i++) { String thisRep = ((Example)litList.get(i)).toString(); if (egRep.equals(thisRep)) { return predNameToAssignMap.get(pred).get(i); /*if (predNameToAssignMap.get(pred).get(i)) { return true; } else { return 0; }*/ } } Utils.waitHere("Example: " + eg + " not stored in worldState"); return 0; } /*public boolean isTrue(Example eg) { // Compare string rep String egRep = eg.toString(); if (literalRepToAssignMap != null) { if (literalRepToAssignMap.get(egRep) == null) { Utils.waitHere("Example: " + eg + " not stored in cached worldState"); } return literalRepToAssignMap.get(egRep) == Boolean.TRUE; } String pred = eg.predicateName.name; List<RegressionRDNExample> litList = predNameToLiteralMap.get(pred); for (int i = 0; i < litList.size(); i++) { String thisRep = ((Example)litList.get(i)).toString(); if (egRep.equals(thisRep)) { if (predNameToAssignMap.get(pred).get(i)) { return true; } else { return false; } } } Utils.waitHere("Example: " + eg + " not stored in worldState"); return false; }*/ public Iterable<Literal> getPosExamples() { return new ExampleIterable(this, 1); } public Iterable<Literal> getNegExamples() { return new ExampleIterable(this, 0); } public static class ExampleIterable implements Iterable<Literal> { HiddenLiteralState state; Integer match; public ExampleIterable(HiddenLiteralState state, Integer match) { this.state = state; this.match = match; } @Override public Iterator<Literal> iterator() { return new ExampleIterator(state, match); } } public static class ExampleIterator implements Iterator<Literal> { Iterator<String> predKeyIterator; String currentPred; int exampleIndex; HiddenLiteralState state; Integer matchState; boolean gotoNext; public ExampleIterator(HiddenLiteralState state, Integer match) { this.state = state; matchState = match; predKeyIterator = state.predNameToLiteralMap.keySet().iterator(); currentPred = predKeyIterator.next(); exampleIndex = -1; gotoNext = true; } @Override public boolean hasNext() { // Already called hasNext if (!gotoNext) { return currentPred != null; } else { if (updateToNextMatchingLiteral()) { gotoNext = false; return true; } else { gotoNext = false; return false; } } } public boolean updateToNextMatchingLiteral() { // hasNext has already updated the index for the next literal. if (!gotoNext) { return true; } do { List<RegressionRDNExample> egs = state.predNameToLiteralMap.get(currentPred); for (int i = exampleIndex+1; i < egs.size(); i++) { if (egs.get(i).isHasRegressionVector()) { // Mutli-class examples always stored as positive examples if (matchState == 1) { exampleIndex = i; return true; } } else { if (state.predNameToAssignMap.get(currentPred).get(i) == matchState) { exampleIndex = i; return true; } } } exampleIndex = -1; if (predKeyIterator.hasNext()) { currentPred = predKeyIterator.next(); } else { currentPred = null; } } while(currentPred != null); return false; } @Override public Literal next() { if (updateToNextMatchingLiteral()) { gotoNext = true; return state.predNameToLiteralMap.get(currentPred).get(exampleIndex); } throw new NoSuchElementException(); } @Override public void remove() { state.predNameToLiteralMap.get(currentPred).remove(exampleIndex); state.predNameToAssignMap.get(currentPred).remove(exampleIndex); } } public void buildExampleToCondProbMap(WILLSetup setup, JointRDNModel jtModel) { if (literalRepToAssignMap == null) { Utils.error("Make sure to call buildLiteralToAssignMap before this method call"); } literalRepToCondDistrMap = new HashMap<String, ProbDistribution>(); statePseudoProbability = 1; SRLInference.updateFactsFromState(setup, this); for (String predName : predNameToLiteralMap.keySet()) { SRLInference sampler = null; if (setup.useMLNs) { sampler = new MLNInference(setup, jtModel); } else { // Since we are only calculating the conditional probabilities given all the other assignments // to the hidden states as facts, we do not need to worry about recursion (last arg). sampler= new SingleModelSampler(jtModel.get(predName), setup, jtModel, false); } List<RegressionRDNExample> literalList = predNameToLiteralMap.get(predName); // Create a new list since we modify the example probabilities List<RegressionRDNExample> newList = new ArrayList<RegressionRDNExample>(); for (RegressionRDNExample rex : literalList) { newList.add(new RegressionRDNExample(rex)); } sampler.getProbabilities(newList); for (RegressionRDNExample newRex : newList) { ProbDistribution distr = newRex.getProbOfExample(); /*if (newRex.predicateName.name.contains("thal")) { if (!distr.isHasDistribution()) { Utils.waitHere("TEMP: Expected multi class example: " + newRex.toString()); } }*/ String rep = newRex.toPrettyString(""); literalRepToCondDistrMap.put(rep, distr); if (!literalRepToAssignMap.containsKey(rep)) { Utils.error("No assignment for: " + rep); } statePseudoProbability *= distr.probOfTakingValue(literalRepToAssignMap.get(rep)); //System.out.println(statePseudoProbability); //if (statePseudoProbability == 0.0) { Utils.waitHere("Zero state prob after " + rep + " with " + distr + " for " + literalRepToAssignMap.get(rep)); } } } } public void updateStateFacts(WILLSetup setup) { trueFacts = new ArrayList<Literal>(); falseFacts=new ArrayList<Literal>(); for (Literal posEx : getPosExamples()) { if (posEx.predicateName.name.startsWith(WILLSetup.multiclassPredPrefix)) { RegressionRDNExample mcRex = (RegressionRDNExample)posEx; int maxVec = mcRex.getOutputVector().length; int assign = getAssignment((Example)posEx); if (assign < 0 || assign >= maxVec) { Utils.waitHere("Assignment: " + assign + " not within bound: " + maxVec);} for (int i = 0; i < maxVec; i++) { Example eg = setup.getMulticlassHandler().createExampleFromClass(mcRex, i); if (i == assign) { trueFacts.add(eg); if (setup.allowRecursion) { Literal lit = setup.getHandler().getLiteral(setup.getHandler().getPredicateName( WILLSetup.recursivePredPrefix + eg.predicateName.name), eg.getArguments()); trueFacts.add(lit); } } else { falseFacts.add(eg); if (setup.allowRecursion) { Literal lit = setup.getHandler().getLiteral(setup.getHandler().getPredicateName( WILLSetup.recursivePredPrefix + eg.predicateName.name), eg.getArguments()); falseFacts.add(lit); } } } } else { trueFacts.add(posEx); if (setup.allowRecursion) { Literal lit = setup.getHandler().getLiteral(setup.getHandler().getPredicateName( WILLSetup.recursivePredPrefix + posEx.predicateName.name), posEx.getArguments()); trueFacts.add(lit); } } } for (Literal negEx : getNegExamples()) { falseFacts.add(negEx); if (setup.allowRecursion) { Literal lit = setup.getHandler().getLiteral(setup.getHandler().getPredicateName( WILLSetup.recursivePredPrefix + negEx.predicateName.name), negEx.getArguments()); falseFacts.add(lit); } } } /** * @return the statePseudoProbability */ public double getStatePseudoProbability() { return statePseudoProbability; } /** * @param statePseudoProbability the statePseudoProbability to set */ public void setStatePseudoProbability(double statePseudoProbability) { this.statePseudoProbability = statePseudoProbability; } public ProbDistribution getConditionalDistribution(Literal ex) { String rep = ex.toPrettyString(""); if (literalRepToCondDistrMap == null) { Utils.error("Conditional distribution not set."); } if (!literalRepToCondDistrMap.containsKey(rep)) { Utils.error("Example: " + rep + " unseen in the hidden state"); } return literalRepToCondDistrMap.get(rep); } public static void statePredicateDifference(HiddenLiteralState lastState, HiddenLiteralState newState, Set<PredicateName> modifiedPredicates, String target) { if (newState == null) { Utils.waitHere("newState not expected to be null. Will not update the facts."); return; } if (newState.trueFacts == null) { Utils.error("Expected the true facts for this state to be built."); } for (Literal addLit : newState.trueFacts) { // We know its modified, no need to check it. if (modifiedPredicates.contains(addLit.predicateName)) { continue; } // Do not add facts for the target predicate if (addLit.predicateName.name.equals(target)) { continue; } if (lastState == null) { modifiedPredicates.add(addLit.predicateName); } else { boolean addThisLit = true; String addLitRep = addLit.toString(); for (Literal oldStateLit : lastState.trueFacts) { // If true in the last state, no need to add if (oldStateLit.toString().equals(addLitRep)) { addThisLit = false; break; } } if (addThisLit) { modifiedPredicates.add(addLit.predicateName); } } } for (Literal rmLit : newState.falseFacts) { // We know its modified, no need to check it. if (modifiedPredicates.contains(rmLit.predicateName)) { continue; } // Do not rm facts for the target predicate if (rmLit.predicateName.name.equals(target)) { continue; } if (lastState == null) { modifiedPredicates.add(rmLit.predicateName); } else { boolean rmThisLit = true; String rmLitRep = rmLit.toString(); for (Literal oldStateLit : lastState.falseFacts) { // If true in the last state, no need to add if (oldStateLit.toString().equals(rmLitRep)) { rmThisLit = false; break; } } if (rmThisLit) { modifiedPredicates.add(rmLit.predicateName); } } } } /** * Returns the examples that need to be added/removed from the fact base to move from * lastState to newstate * @param lastState Old assignment of facts * @param newState New assignment of facts * @param addExamples Facts to be added * @param rmExamples Facts to be removed */ public static void stateDifference(HiddenLiteralState lastState, HiddenLiteralState newState, List<Literal> addExamples, List<Literal> rmExamples, String target) { if (newState == null) { Utils.waitHere("newState not expected to be null. Will not update the facts."); return; } if (newState.trueFacts == null) { Utils.error("Expected the true facts for this state to be built."); } for (Literal addLit : newState.trueFacts) { // Do not add facts for the target predicate if (addLit.predicateName.name.equals(target)) { rmExamples.add(addLit); continue; } if (lastState == null) { addExamples.add(addLit); } else { boolean addThisLit = true; String addLitRep = addLit.toString(); for (Literal oldStateLit : lastState.trueFacts) { // If true in the last state, no need to add if (oldStateLit.toString().equals(addLitRep)) { addThisLit = false; break; } } if (addThisLit) { addExamples.add(addLit); } } } // If no last state, not sure which facts are true. Hence remove all // Actually might be faster to remove all the lits rather than check the last state // if (lastState == null) { rmExamples.addAll(newState.falseFacts); // } else { // // Since there can be many false facts in newstate, only check for the ones that were true in the last state // for (Literal rmLit : lastState.trueFacts) { // String rmLitRep = rmLit.toString(); // boolean rmThisLit = true; // // } // } // } // for (String predName : newState.predNameToLiteralMap.keySet()) { // int index = 0; // for (Literal literal : newState.predNameToLiteralMap.get(predName)) { // int newAssignment = newState.predNameToAssignMap.get(predName).get(index); // if (lastState != null) { // // Debugging // Literal lastStateLiteral = lastState.predNameToLiteralMap.get(predName).get(index); // if (lastStateLiteral.toString().equals(literal.toString())) { // Utils.error("Example mismatch between world states. LastState example: " + lastStateLiteral + ". NewState example: " + literal); // } // int lastAssignment = lastState.predNameToAssignMap.get(predName).get(index); // // Need to add/remove this example, if mismatch in assignment // if (lastAssignment != newAssignment) { // // } // } // // index++; // } // } // } }
boost-starai/BoostSRL
code/src/edu/wisc/cs/will/Boosting/EM/HiddenLiteralState.java
Java
gpl-3.0
20,273
#include "appDrawer.h" #include "clock.h" #include "fileManager.h" #include "game.h" #include "homeMenu.h" #include "language.h" #include "lockScreen.h" #include "powerMenu.h" #include "screenshot.h" #include "settingsMenu.h" #include "utils.h" void appDrawerUnload() { sf2d_free_texture(backdrop); sf2d_free_texture(ic_launcher_clock); sf2d_free_texture(ic_launcher_filemanager); sf2d_free_texture(ic_launcher_gallery); sf2d_free_texture(ic_launcher_game); } int appDrawer() { struct appDrawerFontColor fontColor2; FILE * file = fopen(appDrawerFontColorPath, "r"); fscanf(file, "%d %d %d", &fontColor2.r, &fontColor2.g, &fontColor2.b); fclose(file); if (DARK == 1) { load_PNG(backdrop, "/3ds/Cyanogen3DS/system/settings/Dark/backdropDark.png"); fontColor = WHITE; } else { load_PNG(backdrop, backdropPath); fontColor = RGBA8(fontColor2.r, fontColor2.g, fontColor2.b, 255); } load_PNG(ic_launcher_clock, clockPath); load_PNG(ic_launcher_filemanager, fmPath); load_PNG(ic_launcher_gallery, galleryPath); load_PNG(ic_launcher_game, gamePath); setBilinearFilter(1, ic_launcher_clock); setBilinearFilter(1,ic_launcher_filemanager); setBilinearFilter(1, ic_launcher_gallery); setBilinearFilter(1, ic_launcher_game); sf2d_set_clear_color(RGBA8(0, 0, 0, 0)); while (aptMainLoop()) { hidScanInput(); u32 kDown = hidKeysDown(); sf2d_start_frame(switchDisplay(screenDisplay), GFX_LEFT); sf2d_draw_texture(background, 0, 0); if (screenDisplay == 1) sf2d_draw_texture_scale(backdrop, 0, 24, 0.8, 1.0); else sf2d_draw_texture(backdrop, 0, 24); if (cursor(20, 65, 45, 90)) sf2d_draw_texture_scale(ic_launcher_browser, 20, 40, 1.1, 1.1); else sf2d_draw_texture(ic_launcher_browser, 25, 45); sftd_draw_textf(robotoS12, 23, 100, fontColor, 12, "%s", lang_appDrawer[language][0]); if (cursor(95, 140, 45, 90)) sf2d_draw_texture_scale(ic_launcher_clock, 95, 40, 1.1, 1.1); else sf2d_draw_texture(ic_launcher_clock, 100, 45); sftd_draw_textf(robotoS12, 103, 100, fontColor, 12, "%s", lang_appDrawer[language][1]); if (cursor(170, 215, 45, 90)) sf2d_draw_texture_scale(ic_launcher_filemanager, 170, 40, 1.1, 1.1); else sf2d_draw_texture(ic_launcher_filemanager, 175, 45); sftd_draw_textf(robotoS12, 172, 100, fontColor, 12, "%s", lang_appDrawer[language][2]); if (cursor(245, 290, 45, 90)) sf2d_draw_texture_scale(ic_launcher_gallery, 245, 40, 1.1, 1.1); else sf2d_draw_texture(ic_launcher_gallery, 250, 45); sftd_draw_textf(robotoS12, 252, 100, fontColor, 12, "%s", lang_appDrawer[language][3]); if (screenDisplay == 0) { if (cursor(320, 365, 45, 90)) sf2d_draw_texture_scale(ic_launcher_game, 320, 40, 1.1, 1.1); else sf2d_draw_texture(ic_launcher_game, 325, 45); sftd_draw_textf(robotoS12, 330, 100, fontColor, 12, "%s", lang_appDrawer[language][4]); if (cursor(20, 65, 125, 170)) sf2d_draw_texture_scale(ic_launcher_messenger, 20, 120, 1.1, 1.1); else sf2d_draw_texture(ic_launcher_messenger, 25, 125); sftd_draw_textf(robotoS12, 21, 180, fontColor, 12, "%s", lang_appDrawer[language][5]); if (cursor(95, 140, 125, 170)) sf2d_draw_texture_scale(ic_launcher_apollo, 95, 120, 1.1, 1.1); else sf2d_draw_texture(ic_launcher_apollo, 100, 125); sftd_draw_textf(robotoS12, 103, 180, fontColor, 12, "%s", lang_appDrawer[language][6]); if (cursor(170, 215, 125, 170)) sf2d_draw_texture_scale(ic_launcher_settings, 170, 120, 1.1, 1.1); else sf2d_draw_texture(ic_launcher_settings, 175, 125); sftd_draw_textf(robotoS12, 172, 180, fontColor, 12, "%s", lang_appDrawer[language][7]); digitalTime(352, 2, 0); batteryStatus(300, 2, 0); //androidQuickSettings(); } else if (screenDisplay == 1) { if (cursor(20, 65, 125, 170)) sf2d_draw_texture_scale(ic_launcher_game, 20, 120, 1.1, 1.1); else sf2d_draw_texture(ic_launcher_game, 25, 125); sftd_draw_textf(robotoS12, 26, 180, fontColor, 12, "%s", lang_appDrawer[language][4]); if (cursor(95, 140, 125, 170)) sf2d_draw_texture_scale(ic_launcher_messenger, 95, 120, 1.1, 1.1); else sf2d_draw_texture(ic_launcher_messenger, 100, 125); sftd_draw_textf(robotoS12, 90, 180, fontColor, 12, "%s", lang_appDrawer[language][5]); if (cursor(170, 215, 125, 170)) sf2d_draw_texture_scale(ic_launcher_apollo, 170, 120, 1.1, 1.1); else sf2d_draw_texture(ic_launcher_apollo, 175, 125); sftd_draw_textf(robotoS12, 180, 180, fontColor, 12, "%s", lang_appDrawer[language][6]); if (cursor(245, 290, 125, 170)) sf2d_draw_texture_scale(ic_launcher_settings, 245, 120, 1.1, 1.1); else sf2d_draw_texture(ic_launcher_settings, 250, 125); sftd_draw_textf(robotoS12, 250, 180, fontColor, 12, "%s", lang_appDrawer[language][7]); } cursorController(); sf2d_end_frame(); switchDisplayModeOn(1); navbarControls(0); if (kDown & KEY_Y) powerMenu(); if (kDown & KEY_L) lockScreen(); if ((cursor(170, 215, 45, 90)) && (kDown & KEY_A)) { if (experimentalF == 1) { appDrawerUnload(); fileManager(); } } else if ((cursor(320, 365, 45, 90)) && (kDown & KEY_A)) { /*if (experimentalF == 1) { appDrawerUnload(); launch3DSX("/3ds/killerman_ghost_buster/killerman_ghost_buster.3dsx"); }*/ } else if ((cursor(170, 215, 125, 170)) && (kDown & KEY_A)) { appDrawerUnload(); settingsMenu(); } if (kDown & KEY_B) { appDrawerUnload(); home(); //Returns to home screen } if (touch(44, 119, 201, 240) && (kDown & KEY_TOUCH)) home(); captureScreenshot(); sf2d_swapbuffers(); } appDrawerUnload(); return 0; }
joel16/Cyanogen3DS
source/appDrawer.c
C
gpl-3.0
5,953
.include "ppu.h" .include "sprite.h" .include "tablecall.h" .ifdef MMC .if MMC == 3 .include "../mmc/mmc3.h" .endif .endif .dataseg .extrn ppu:ppu_state .extrn sprites:byte .ifdef MMC .if MMC == 3 .extrn chr_banks:byte .extrn irq_count:byte .endif .endif in_nmi .byte frame_count .byte main_cycle .byte .public frame_count .public main_cycle .codeseg .public nmi .extrn flush_ppu_buffer:proc .extrn read_joypad:proc .ifndef NO_JOYPAD1 .extrn read_joypad1:proc .endif .ifndef NO_SOUND .extrn update_sound:proc .endif .extrn table_call:proc .extrn update_timers:proc nmi: sei pha ; preserve A txa pha ; preserve X tya pha ; preserve Y lda ppu.ctrl1 sta PPU_CTRL1_REG lda in_nmi bne skip_nmi ; skip the next part if the frame couldn't ; finish before the NMI was triggered inc in_nmi inc frame_count jsr flush_ppu_buffer ; update PPU control register 0 lda ppu.ctrl0 sta PPU_CTRL0_REG ; update scroll registers lda PPU_STATUS_REG ; reset H/V scroll flip flop lda ppu.scroll_x sta PPU_SCROLL_REG lda ppu.scroll_y sta PPU_SCROLL_REG ; perform sprite DMA lda #0 sta SPRITE_ADDR_REG ; reset SPR-RAM address lda #>sprites sta SPRITE_DMA_REG .ifdef MMC .if MMC == 3 ; set CHR banks ldx #$05 - stx MMC3_CTRL_REG lda chr_banks,x sta MMC3_PAGE_REG dex bpl - ; set up IRQ if requested lda irq_count beq + sta MMC3_IRQ_COUNTER_REG sta MMC3_IRQ_LATCH_REG sta MMC3_IRQ_ENABLE_REG + .endif .endif ; read joypad(s) jsr read_joypad .ifndef NO_JOYPAD1 jsr read_joypad1 .endif .ifndef NO_SOUND jsr update_sound .endif ; update timers jsr update_timers jsr go_main_cycle dec in_nmi ; = 0, NMI done skip_nmi: pla tay ; restore Y pla tax ; restore X pla ; restore A rti go_main_cycle: lda main_cycle jsr table_call .include "maincycletable.asm" .end
ddribin/kents-nes-stuff
src/shared/common/nmi.asm
Assembly
gpl-3.0
2,260
/*-- Author: W3layouts Author URL: http://w3layouts.com License: Creative Commons Attribution 3.0 Unported License URL: http://creativecommons.org/licenses/by/3.0/ --*/ /*--reset--*/ html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,dl,dt,dd,ol,nav ul,nav li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline;} article, aside, details, figcaption, figure,footer, header, hgroup, menu, nav, section {display: block;} ol,ul{list-style:none;margin:0px;padding:0px;} blockquote,q{quotes:none;} blockquote:before,blockquote:after,q:before,q:after{content:'';content:none;} table{border-collapse:collapse;border-spacing:0;} /*--start editing from here--*/ a{text-decoration:none;} .txt-rt{text-align:right;}/* text align right */ .txt-lt{text-align:left;}/* text align left */ .txt-center{text-align:center;}/* text align center */ .float-rt{float:right;}/* float right */ .float-lt{float:left;}/* float left */ .clear{clear:both;}/* clear float */ .pos-relative{position:relative;}/* Position Relative */ .pos-absolute{position:absolute;}/* Position Absolute */ .vertical-base{ vertical-align:baseline;}/* vertical align baseline */ .vertical-top{ vertical-align:top;}/* vertical align top */ nav.vertical ul li{ display:block;}/* vertical menu */ nav.horizontal ul li{ display: inline-block;}/* horizontal menu */ img{max-width:100%;} /*--end reset--*/ body { margin:0; font-family: 'Hind Siliguri', sans-serif; } h1,h2,h3,h4,h5,h6,input,p,a,select,button,textarea,label{ margin:0; font-family: 'Hind Siliguri', sans-serif; } body a{ -webkit-transition:0.5s all; -moz-transition:0.5s all; -o-transition:0.5s all; -ms-transition:0.5s all; transition:0.5s all; text-decoration: none; } input[type="button"],input[type="submit"],input[type="text"]{ transition:0.5s all; -webkit-transition:0.5s all; -moz-transition:0.5s all; -o-transition:0.5s all; -ms-transition:0.5s all; } h1,h2,h3,h4,h5,h6{ margin:0; } p { margin: 0; line-height: 2; color: #fff; font-size:1em; } ul{ margin:0; padding:0; } label{ margin:0; } .text-center { text-align: center; } .bg-agileinfo { background:url(../images/1.jpg)no-repeat center; background-size: cover; background-attachment: fixed; } .agile-header { text-align:center; margin:2% auto; } h1.agile-head { font-size: 3em; text-transform: uppercase; color: #fff; font-weight: 500; padding-top: 0.5em; letter-spacing: 3px; } .container-w3 { width: 52%; margin: 2em auto; } .content1-w3layouts { margin: 0 auto; } .content1-w3layouts img{ display:block; margin:0 auto; } .content1-w3layouts p{ margin: 2em 0 0; } .content2-w3-agileits { text-align:center; } /*-- social-icons --*/ ul.w3-links li { margin: 0 0.5em; display: inline-block; } ul.w3-links { margin-top: 0; } ul.w3-links li a i.fa { color: #fff; font-size: 1em; line-height: 2.2em; text-align: center; transition: all 0.5s ease-in-out; -webkit-transition: all 0.5s ease-in-out; -moz-transition: all 0.5s ease-in-out; -o-transition: all 0.5s ease-in-out; -ms-transition: all 0.5s ease-in-out; width: 36px; height: 36px; border-radius: 50%; -webkit-border-radius: 50%; -o-border-radius: 50%; -moz-border-radius: 50%; -ms-border-radius: 50%; border: 2px solid #fff; } ul.w3-links li a i.fa:hover { color: #fdd02b; border:2px dotted #7ab5ed;; transform:scale(1.2); } .wthree-social-icons { margin: 2em 0 0; text-align: center; } a { display: inline-block; } /*-- //social-icons --*/ .agile-info-form input.email { width: 30%; padding: 0.8em 1em; color: #fff; font-size: 0.9em; outline: none; background: #0b7dd6; border: none; } .agile-info-form input[type="submit"] { border: none; outline: none; padding: 0.8em 2em; cursor: pointer; color:#fff; background:rgba(0, 9, 11,0.5); font-size:0.9em; border:none; text-transform: capitalize; letter-spacing:1px; } .agile-info-form input.email:hover { background:#022b40; } .agile-info-form input.email{ transition:0.5s all; -webkit-transition:0.5s all; -moz-transition:0.5s all; -o-transition:0.5s all; -ms-transition:0.5s all; } ::-webkit-input-placeholder { color: #fff; } :-moz-placeholder { /* Firefox 18- */ color: fff; } ::-moz-placeholder { /* Firefox 19+ */ color: #fff; } :-ms-input-placeholder { color:#fff; } .agile-info-form input[type="submit"]:hover { background:#0386cf; border:none; transition:all 0.8s ease-in-out; } .agileits-w3layouts-copyright p { color: #fff; font-size: 1em; margin-bottom:1em; } .agileits-w3layouts-copyright a{ color: #fff; } .agileits-w3layouts-copyright a:hover{ color: #fdc719; } .hero { padding: 0 3em; margin:0 auto; } .demo-2 .main-title { font-weight: normal; font-size: 8em; padding-left: 10px; text-shadow: 2px 2px 4px rgba(0,0,0,0.4); } /* -- Responsive code -- */ @media screen and (max-width: 1366px){ .container-w3 { width: 56%; } } @media screen and (max-width: 1366px){ } @media screen and (max-width: 1080px){ .container-w3 { width: 63%; } } @media screen and (max-width: 1024px){ .container-w3 { width: 64%; } } @media screen and (max-width: 991px){ .container-w3 { width: 66%; } } @media screen and (max-width: 900px){ .container-w3 { width: 73%; } } @media screen and (max-width: 800px){ } @media screen and (max-width: 736px){ .agile-info-form input.email { width: 33%; } } @media screen and (max-width: 667px){ h1.agile-head { letter-spacing: 2px; } } @media screen and (max-width: 640px){ h1.agile-head { font-size: 2.9em; } } @media screen and (max-width: 600px){ .container-w3 { width: 76%; } .agile-info-form input.email { width: 37%; } h1.agile-head { font-size: 2.7em; } } @media screen and (max-width: 568px){ } @media screen and (max-width: 480px){ .agile-info-form input.email { width: 43%; } .demo-2 .main-title { } .content1-w3layouts img { width: 27%; } } @media screen and (max-width: 414px){ h1.agile-head { font-size: 2.4em; } .container-w3 { margin: 1em auto; } .agile-info-form input.email { width: 50%; margin: 0 0 0.5em; } .content1-w3layouts p { margin: 1em 0 0; } } @media screen and (max-width: 384px){ } @media screen and (max-width: 375px){ .agile-info-form input.email { margin: 0 0 0.5em; } .agileits-w3layouts-copyright p { padding: 0 1em; } } @media screen and (max-width: 320px){ .agile-info-form input.email { width: 65%; } .agileits-w3layouts-copyright p { font-size: 1em; } h1.agile-head { font-size: 2.3em; } } /* -- //Responsive code -- */
emilianobilli/backend
dam/cawas/static/web/css/style.css
CSS
gpl-3.0
6,980
/* * Copyright (C) 2005-2012 BetaCONCEPT Limited * * This file is part of Astroboa. * * Astroboa is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Astroboa is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with Astroboa. If not, see <http://www.gnu.org/licenses/>. */ package org.betaconceptframework.astroboa.portal.resource; import java.util.List; /** * @author Gregory Chomatas (gchomatas@betaconcept.com) * @author Savvas Triantafyllou (striantafyllou@betaconcept.com) * */ public class ResourceResponse<T,P extends ResourceContext> { private List<T> resourceRepresentation; private P resourceContext; public List<T> getResourceRepresentation() { return resourceRepresentation; } public void setResourceRepresentation(List<T> resourceRepresentation) { this.resourceRepresentation = resourceRepresentation; } public P getResourceContext() { return resourceContext; } public void setResourceContext(P resourceContext) { this.resourceContext = resourceContext; } /** * Convenient method which returns the first resource found in resource representation * or null if none is found * @return */ public T getFirstResource(){ if (resourceRepresentation != null && resourceRepresentation.size()>0){ return resourceRepresentation.get(0); } return null; } }
BetaCONCEPT/astroboa
astroboa-portal-commons/src/main/java/org/betaconceptframework/astroboa/portal/resource/ResourceResponse.java
Java
gpl-3.0
1,795
<?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * The class representing a Controller of MVC design pattern. * * PHP versions 4 and 5 * * LICENSE: This source file is subject to version 3.01 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_01.txt If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category HTML * @package HTML_QuickForm_Controller * @author Alexey Borzov <avb@php.net> * @author Bertrand Mansion <bmansion@mamasam.com> * @copyright 2003-2009 The PHP Group * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version SVN: $Id: Controller.php 289084 2009-10-02 06:53:09Z avb $ * @link http://pear.php.net/package/HTML_QuickForm_Controller */ /** * The class representing a page of a multipage form. */ require_once 'HTML/QuickForm/Page.php'; /** * The class representing a Controller of MVC design pattern. * * This class keeps track of pages and (default) action handlers for the form, * it manages keeping the form values in session, setting defaults and * constants for the form as a whole and getting its submit values. * * Generally you don't need to subclass this. * * @category HTML * @package HTML_QuickForm_Controller * @author Alexey Borzov <avb@php.net> * @author Bertrand Mansion <bmansion@mamasam.com> * @version Release: 1.0.10 */ class HTML_QuickForm_Controller { /** * Contains the pages (HTML_QuickForm_Page objects) of the miultipage form * @var array */ var $_pages = array(); /** * Contains the mapping of actions to corresponding HTML_QuickForm_Action objects * @var array */ var $_actions = array(); /** * Name of the form, used to store the values in session * @var string */ var $_name; /** * Whether the form is modal * @var bool */ var $_modal = true; /** * The action extracted from HTTP request: array('page', 'action') * @var array */ var $_actionName = null; /** * Class constructor. * * Sets the form name and modal/non-modal behaviuor. Different multipage * forms should have different names, as they are used to store form * values in session. Modal forms allow passing to the next page only when * all of the previous pages are valid. * * @access public * @param string form name * @param bool whether the form is modal */ function HTML_QuickForm_Controller($name, $modal = true) { $this->_name = $name; $this->_modal = $modal; } /** * Returns a reference to a session variable containing the form-page * values and pages' validation status. * * This is a "low-level" method, use exportValues() if you want just to * get the form's values. * * @access public * @param bool If true, then reset the container: clear all default, constant and submitted values * @return array */ function &container($reset = false) { $name = '_' . $this->_name . '_container'; if (!isset($_SESSION[$name]) || $reset) { $_SESSION[$name] = array( 'defaults' => array(), 'constants' => array(), 'values' => array(), 'valid' => array() ); } foreach (array_keys($this->_pages) as $pageName) { if (!isset($_SESSION[$name]['values'][$pageName])) { $_SESSION[$name]['values'][$pageName] = array(); $_SESSION[$name]['valid'][$pageName] = null; } } return $_SESSION[$name]; } /** * Processes the request. * * This finds the current page, the current action and passes the action * to the page's handle() method. * * @access public * @throws PEAR_Error */ function run() { // the names of the action and page should be saved $this->_actionName = $this->getActionName(); list($page, $action) = $this->_actionName; return $this->_pages[$page]->handle($action); } /** * Registers a handler for a specific action. * * @access public * @param string name of the action * @param HTML_QuickForm_Action the handler for the action */ function addAction($actionName, &$action) { $this->_actions[$actionName] =& $action; } /** * Adds a new page to the form * * @access public * @param HTML_QuickForm_Page */ function addPage(&$page) { $page->controller =& $this; $this->_pages[$page->getAttribute('id')] =& $page; } /** * Returns a page * * @access public * @param string Name of a page * @return HTML_QuickForm_Page A reference to the page * @throws PEAR_Error */ function &getPage($pageName) { if (!isset($this->_pages[$pageName])) { return PEAR::raiseError('HTML_QuickForm_Controller: Unknown page "' . $pageName . '"'); } return $this->_pages[$pageName]; } /** * Handles an action. * * This will be called if the page itself does not have a handler * to a specific action. The method also loads and uses default handlers * for common actions, if specific ones were not added. * * @access public * @param HTML_QuickForm_Page The page that failed to handle the action * @param string Name of the action * @throws PEAR_Error */ function handle(&$page, $actionName) { if (isset($this->_actions[$actionName])) { return $this->_actions[$actionName]->perform($page, $actionName); } switch ($actionName) { case 'next': case 'back': case 'submit': case 'display': case 'jump': include_once 'HTML/QuickForm/Action/' . ucfirst($actionName) . '.php'; $className = 'HTML_QuickForm_Action_' . $actionName; $this->_actions[$actionName] =& new $className(); return $this->_actions[$actionName]->perform($page, $actionName); break; default: return PEAR::raiseError('HTML_QuickForm_Controller: Unhandled action "' . $actionName . '" in page "' . $page->getAttribute('id') . '"'); } // switch } /** * Checks whether the form is modal. * * @access public * @return bool */ function isModal() { return $this->_modal; } /** * Checks whether the pages of the controller are valid * * @access public * @param string If set, check only the pages before (not including) that page * @return bool * @throws PEAR_Error */ function isValid($pageName = null) { $data =& $this->container(); foreach (array_keys($this->_pages) as $key) { if (isset($pageName) && $pageName == $key) { return true; } elseif (!$data['valid'][$key]) { // We should handle the possible situation when the user has never // seen a page of a non-modal multipage form if (!$this->isModal() && null === $data['valid'][$key]) { $page =& $this->_pages[$key]; // Fix for bug #8687: the unseen page was considered // submitted, so defaults for checkboxes and multiselects // were not used. Shouldn't break anything since this flag // will be reset right below in loadValues(). $page->_flagSubmitted = false; // Use controller's defaults and constants, if present $this->applyDefaults($key); $page->isFormBuilt() or $page->BuildForm(); // We use defaults and constants as if they were submitted $data['values'][$key] = $page->exportValues(); $page->loadValues($data['values'][$key]); // Is the page now valid? if (PEAR::isError($valid = $page->validate())) { return $valid; } $data['valid'][$key] = $valid; if (true === $valid) { continue; } } return false; } } return true; } /** * Returns the name of the page before the given. * * @access public * @param string * @return string */ function getPrevName($pageName) { $prev = null; foreach (array_keys($this->_pages) as $key) { if ($key == $pageName) { return $prev; } $prev = $key; } } /** * Returns the name of the page after the given. * * @access public * @param string * @return string */ function getNextName($pageName) { $prev = null; foreach (array_keys($this->_pages) as $key) { if ($prev == $pageName) { return $key; } $prev = $key; } return null; } /** * Finds the (first) invalid page * * @access public * @return string Name of an invalid page */ function findInvalid() { $data =& $this->container(); foreach (array_keys($this->_pages) as $key) { if (!$data['valid'][$key]) { return $key; } } return null; } /** * Extracts the names of the current page and the current action from * HTTP request data. * * @access public * @return array first element is page name, second is action name */ function getActionName() { if (is_array($this->_actionName)) { return $this->_actionName; } $names = array_map('preg_quote', array_keys($this->_pages)); $regex = '/^_qf_(' . implode('|', $names) . ')_(.+?)(_x)?$/'; foreach (array_keys($_REQUEST) as $key) { if (preg_match($regex, $key, $matches)) { return array($matches[1], $matches[2]); } } if (isset($_REQUEST['_qf_default'])) { $matches = explode(':', $_REQUEST['_qf_default'], 2); if (isset($this->_pages[$matches[0]])) { return $matches; } } reset($this->_pages); return array(key($this->_pages), 'display'); } /** * Initializes default form values. * * @access public * @param array default values * @param mixed filter(s) to apply to default values * @throws PEAR_Error */ function setDefaults($defaultValues = null, $filter = null) { if (is_array($defaultValues)) { $data =& $this->container(); return $this->_setDefaultsOrConstants($data['defaults'], $defaultValues, $filter); } } /** * Initializes constant form values. * These values won't get overridden by POST or GET vars * * @access public * @param array constant values * @param mixed filter(s) to apply to constant values * @throws PEAR_Error */ function setConstants($constantValues = null, $filter = null) { if (is_array($constantValues)) { $data =& $this->container(); return $this->_setDefaultsOrConstants($data['constants'], $constantValues, $filter); } } /** * Adds new values to defaults or constants array * * @access private * @param array array to add values to (either defaults or constants) * @param array values to add * @param mixed filters to apply to new values * @throws PEAR_Error */ function _setDefaultsOrConstants(&$values, $newValues, $filter = null) { if (isset($filter)) { if (is_array($filter) && (2 != count($filter) || !is_callable($filter))) { foreach ($filter as $val) { if (!is_callable($val)) { return PEAR::raiseError(null, QUICKFORM_INVALID_FILTER, null, E_USER_WARNING, "Callback function does not exist in QuickForm_Controller::_setDefaultsOrConstants()", 'HTML_QuickForm_Error', true); } else { $newValues = $this->_arrayMapRecursive($val, $newValues); } } } elseif (!is_callable($filter)) { return PEAR::raiseError(null, QUICKFORM_INVALID_FILTER, null, E_USER_WARNING, "Callback function does not exist in QuickForm_Controller::_setDefaultsOrConstants()", 'HTML_QuickForm_Error', true); } else { $newValues = $this->_arrayMapRecursive($val, $newValues); } } $values = HTML_QuickForm::arrayMerge($values, $newValues); } /** * Recursively applies the callback function to the value * * @param mixed Callback function * @param mixed Value to process * @access private * @return mixed Processed values */ function _arrayMapRecursive($callback, $value) { if (!is_array($value)) { return call_user_func($callback, $value); } else { $map = array(); foreach ($value as $k => $v) { $map[$k] = $this->_arrayMapRecursive($callback, $v); } return $map; } } /** * Sets the default values for the given page * * @access public * @param string Name of a page */ function applyDefaults($pageName) { $data =& $this->container(); if (!empty($data['defaults'])) { $this->_pages[$pageName]->setDefaults($data['defaults']); } if (!empty($data['constants'])) { $this->_pages[$pageName]->setConstants($data['constants']); } } /** * Returns the form's values * * @access public * @param string name of the page, if not set then returns values for all pages * @return array */ function exportValues($pageName = null) { $data =& $this->container(); $values = array(); if (isset($pageName)) { $pages = array($pageName); } else { $pages = array_keys($data['values']); } foreach ($pages as $page) { // skip elements representing actions foreach ($data['values'][$page] as $key => $value) { if (0 !== strpos($key, '_qf_')) { if (isset($values[$key]) && is_array($value)) { $values[$key] = HTML_QuickForm::arrayMerge($values[$key], $value); } else { $values[$key] = $value; } } } } return $values; } /** * Returns the element's value * * @access public * @param string name of the page * @param string name of the element in the page * @return mixed value for the element */ function exportValue($pageName, $elementName) { $data =& $this->container(); return isset($data['values'][$pageName][$elementName])? $data['values'][$pageName][$elementName]: null; } } ?>
andresfcebas/ScoyW3
lib/pear/HTML/QuickForm/Controller.php
PHP
gpl-3.0
16,270
package com.prisch.sbm.stubs; import javax.xml.bind.JAXBElement; import javax.xml.bind.annotation.*; import javax.xml.datatype.XMLGregorianCalendar; import java.math.BigInteger; /** * <p>Java class for ItemLink complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="ItemLink"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="id" type="{http://www.w3.org/2001/XMLSchema}integer" minOccurs="0"/> * &lt;element name="itemID" type="{urn:sbmappservices72}ItemIdentifier" minOccurs="0"/> * &lt;element name="linkType" type="{urn:sbmappservices72}ItemLink-Type"/> * &lt;element name="modificationDateTime" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/> * &lt;element name="accessType" type="{urn:sbmappservices72}Attachment-Access-Type"/> * &lt;element name="extendedData" type="{urn:sbmappservices72}ExtendedData" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ItemLink", propOrder = { "id", "itemID", "linkType", "modificationDateTime", "accessType", "extendedData" }) public class ItemLink { protected BigInteger id; @XmlElementRef(name = "itemID", namespace = "urn:sbmappservices72", type = JAXBElement.class, required = false) protected JAXBElement<ItemIdentifier> itemID; @XmlElement(required = true, defaultValue = "DEFAULT-ITEM-LINK") @XmlSchemaType(name = "string") protected ItemLinkType linkType; @XmlSchemaType(name = "dateTime") protected XMLGregorianCalendar modificationDateTime; @XmlElement(required = true, defaultValue = "ATTACHACCESS-DEFAULT") @XmlSchemaType(name = "string") protected AttachmentAccessType accessType; @XmlElementRef(name = "extendedData", namespace = "urn:sbmappservices72", type = JAXBElement.class, required = false) protected JAXBElement<ExtendedData> extendedData; /** * Gets the value of the id property. * * @return * possible object is * {@link BigInteger } * */ public BigInteger getId() { return id; } /** * Sets the value of the id property. * * @param value * allowed object is * {@link BigInteger } * */ public void setId(BigInteger value) { this.id = value; } /** * Gets the value of the itemID property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link ItemIdentifier }{@code >} * */ public JAXBElement<ItemIdentifier> getItemID() { return itemID; } /** * Sets the value of the itemID property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link ItemIdentifier }{@code >} * */ public void setItemID(JAXBElement<ItemIdentifier> value) { this.itemID = value; } /** * Gets the value of the linkType property. * * @return * possible object is * {@link ItemLinkType } * */ public ItemLinkType getLinkType() { return linkType; } /** * Sets the value of the linkType property. * * @param value * allowed object is * {@link ItemLinkType } * */ public void setLinkType(ItemLinkType value) { this.linkType = value; } /** * Gets the value of the modificationDateTime property. * * @return * possible object is * {@link XMLGregorianCalendar } * */ public XMLGregorianCalendar getModificationDateTime() { return modificationDateTime; } /** * Sets the value of the modificationDateTime property. * * @param value * allowed object is * {@link XMLGregorianCalendar } * */ public void setModificationDateTime(XMLGregorianCalendar value) { this.modificationDateTime = value; } /** * Gets the value of the accessType property. * * @return * possible object is * {@link AttachmentAccessType } * */ public AttachmentAccessType getAccessType() { return accessType; } /** * Sets the value of the accessType property. * * @param value * allowed object is * {@link AttachmentAccessType } * */ public void setAccessType(AttachmentAccessType value) { this.accessType = value; } /** * Gets the value of the extendedData property. * * @return * possible object is * {@link JAXBElement }{@code <}{@link ExtendedData }{@code >} * */ public JAXBElement<ExtendedData> getExtendedData() { return extendedData; } /** * Sets the value of the extendedData property. * * @param value * allowed object is * {@link JAXBElement }{@code <}{@link ExtendedData }{@code >} * */ public void setExtendedData(JAXBElement<ExtendedData> value) { this.extendedData = value; } }
PriscH/SlackAgent
client/src/main/java/com/prisch/sbm/stubs/ItemLink.java
Java
gpl-3.0
5,445
--- title: "अखिलेश सरकार यूपी के लिए अभिशाप : केशव प्रसाद मौर्य" layout: item category: ["politics"] date: 2017-02-02T12:16:18.233Z image: 1486037778232keshav.jpg --- <p>लखनऊ: दलितों और व्यापारियों पर अत्याचार का सिलसिला बढ़ता जा रहा है। प्रदेश के मुख्यमंत्री अखिलेश यादव कुशासन व भ्रष्टाचार के खिलाफ जनता को गुमराह करने के लिए मंच से लगातार झूठ फैला रहे हैं। सरकारी संसाधनों की लूट, कमीशनखोरी और खैरात बांटने वाली हवाहवाई योजनाओं का ऐलान करने वाले मुख्यमंत्री अखिलेश यादव की प्रवृति व कार्यशैली इस प्रदेश की जनता के लिए अभिशाप है।</p> <p>प्रदेश अध्यक्ष केशव प्रसाद मौर्य ने अखिलेश यादव से सवाल किया कि अखिलेश सरकार ने सरकारी नौकरियों में भ्रष्टाचार व भाई-भतीजावाद चलाने की खुलेआम छूट क्यों दी थी? लोक सेवा आयोग, उच्चतर शिक्षा चयन आयोग जैसी तमाम भर्ती संस्थाओं के अध्यक्षों की नियुक्ति में योग्यता को दरकिनार कर भाई-भतीजावाद क्यों चलाया गया और इन आयोगों की भर्तियों में भ्रष्टाचार कर प्रदेश के योग्य व काबिल युवाओं को नौकरी से क्यों वंचित रखा गया? ग्राम विकास अधिकारी व अन्य पदों के लिए की गई भर्तियों में जाति विशेष के अभ्यर्थियों का चयन होना क्या अखिलेश सरकार के संरक्षण में भ्रष्टाचार का सूचक नहीं है? अखिलेश सरकार को बताना होगा कि भ्रष्टाचार के कारण सरकारी नौकरियों में ‘जुगाड़’ से विशेष अभ्यर्थियों के चयन से हताश व निराश प्रदेश के प्रदेश के शिक्षित व योग्य अभ्यर्थियों के साथ हुए अन्याय पर उनकी चुप्पी क्यों है?</p> <p>श्री मौर्य ने अखिलेश यादव से प्रश्न किया कि प्रदेश के लोगों को बिजली नहीं मिल रही है। शिक्षा व्यवस्था बदहाल है। राजधानी के किंग जार्ज मेडिकल कॉलेज, जहां प्रदेश भर से लोग इलाज के लिए आते हैं, तक में चिकित्सा सुविधाओं का अकाल है। प्रदेश के सरकारी अस्पतालों में लोग दवा व इलाज के अभाव में मर रहे हैं। रोजाना सरकारी अस्पतालों में चिकित्सा सुविधाओं, आक्सीजन सिलेंडरों की कमी से मरीजों के परेशान होने की खबरें आ रही हैं। लेकिन अखिलेश सरकार केवल अपनी सत्ता की चिंता में नाटक करती रही और लोगों का ध्यान समस्याओं से हटाने की कोशिश करती रही। सरकार की नाकामियों से त्रस्त जनता की परेशानी दूर करने के लिए अखिलेश ने पूरे कार्यकाल में कदम क्यों नहीं उठाए? श्री मौर्य ने आगे कहा कि भाजपा ही भ्रष्टाचारमुक्त, भयमुक्त प्रदेश के निर्माण में सक्षम है ताकि दलितों, व्यापारियों और आम नागरिकों के खिलाफ अत्याचार की घटनाएं रोकी जा सके। 1 लाख करोड़ के खनन घोटाले के आरोपी के क्षेत्र से विधानसभा चुनाव का आगाज भ्रष्टाचार पोषक सपा ऐजेण्डे को जनता के सामने उजागर कर चुका है। उन्होंने कहा कि जनता को खैरात नहीं चाहिए, बल्कि उन्हें सुरक्षा, रोजगार और स्वाभिमान और सम्मान चाहिए। भारतीय जनता पार्टी एक मात्र ऐसे पार्टी है जो समाज के अंतिम व्यक्ति के स्वाभिमान की रक्षा करती है तथा उसे स्वावलम्बी बनाने की ओर अग्रसर है। </p> <p>उन्होंने कहा कि सपा के विकास के कार्यक्रम केवल परिवार व गुंडों, दबंगों तथा सत्ता के दलालों के विकास के लिए है। अखिलेश के साढे चार साल के कार्यकाल में प्रदेश में केवल कमीशनखोरी के काम हुए, अखिलेश के काबीना मंत्री शिवपाल यादव ने इसे सार्वजनिक रूप से स्वीकार किया है। भ्रष्टाचार व कमीशनखोरी की दुर्गन्ध वाला अधूरा एक्सप्रेस हाइवे, लैपटाप वितरण आदि से जनता का भला नहीं हुआ। उन्होंने कहा कि मुख्यमंत्री अखिलेश यादव ने प्रधानमंत्री नरेंद्र मोदी द्वारा आम जनता का जीवन स्तर और सम्मान बढ़ाने वाली योजनाओं को प्रदेश में क्रियान्वित ही नहीं होने दिया। भाजपा की सरकार आएगी तो राज्य में अखिलेश द्वारा रोके गए मोदी सरकार के जनकल्याणकारी कार्यक्रमों को मजबूती से लागू कर भयमुक्त वातावरण, सुशासन और पारदर्शी कार्यप्रणाली देगी। </p>
InstantKhabar/_source
_source/news/2017-02-02-keshav.html
HTML
gpl-3.0
8,233
//------------------------------------------------------------------------------ // <auto-generated> // Dieser Code wurde von einem Tool generiert. // Laufzeitversion:4.0.30319.34014 // // Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn // der Code erneut generiert wird. // </auto-generated> //------------------------------------------------------------------------------ using UnityEngine; namespace AssemblyCSharp { public class GravityRandomizer : MonoBehaviour { public Vector3 PosRange; public Vector3 NegRange; public void OnTriggerEnter(Collider otherColl) { Vector3 randomGrav = new Vector3 (Random.Range (NegRange.x, PosRange.x), Random.Range (NegRange.y, PosRange.y), Random.Range (NegRange.z, PosRange.z)); GravitySingleton.Instance.currentGravity = randomGrav; } public void OnTriggerExit(Collider otherColl) { GravitySingleton.Instance.currentGravity = GravitySingleton.DEFAULT_GRAVITY; } } }
katzensaft/haarpo
HAARPO/Assets/Source/BuggedPhysic/Gravity/GravityRandomizer.cs
C#
gpl-3.0
1,002
#!/sw/bin/python2.7 import sys sys.path.append("..") from ucnacore.PyxUtils import * from math import * from ucnacore.LinFitter import * #from UCNAUtils import * from bisect import bisect from calib.FieldMapGen import * def clip_function(y,rho,h,R): sqd = sqrt(rho**2-y**2) if sqd==0: sqd = 1e-10 return h*rho**2/R*atan(y/sqd)+2*sqd/(3*R)*(3*h*y/2+rho**2-y**2) def survival_fraction(h,rho,R): d = R-h if d < -rho: return 1 if h <= -rho: return 0 c1 = 0 if d < rho: sqd = sqrt(rho**2-d**2) c1 = pi/2*rho**2-d*sqd-rho**2*atan(d/sqd) return ( c1 + clip_function(min(h,rho),rho,h,R) - clip_function(max(h-R,-rho),rho,h,R))/(pi*rho**2) def radial_clip_function(r,rho,h,R): return r**2*(3*h-2*r)/(6*R**2) def radial_survival_fraction(h,rho,R): d = h-R if d > rho: return 1 if h <= 0: return 0 c1 = 0 if d > 0: c1 = (h-R)**2 return ( c1 + radial_clip_function(min(h,rho),rho,h,R) - radial_clip_function(max(d,0),rho,h,R) )/(rho**2) class rot3: def __init__(self,t1,t2,t3,s=1.0): self.c1,self.s1 = cos(t1),sin(t1) self.c2,self.s2 = cos(t2),sin(t2) self.c3,self.s3 = cos(t3),sin(t3) self.s = s def __call__(self,(x,y,z)): x,y = self.c1*x+self.s1*y,self.c1*y-self.s1*x y,z = self.c2*y+self.s2*z,self.c2*z-self.s2*y z,x = self.c3*z+self.s3*x,self.c3*x-self.s3*z return self.s*x,self.s*y,self.s*z class path3d: def __init__(self): self.pts = [] self.sty = [] self.endsty = [] self.breakunder = False self.nopatch = False def addpt(self,(x,y,z),s=1): self.pts.append((x*s,y*s,z*s)) def apply(self,transf): self.pts = [transf(xyz) for xyz in self.pts] def finish(self): self.p = path.path() self.p.append(path.moveto(self.pts[0][0],self.pts[0][1])) for g in self.pts[1:]: self.p.append(path.lineto(g[0],g[1])) self.patchpts = [] self.underpts = [] def nearestpt(self,(x,y)): d0 = 1e20 n = None for i in range(len(self.pts)): d1 = (self.pts[i][0]-x)**2+(self.pts[i][1]-y)**2 if d1 < d0: d0 = d1 n = i return n def znear(self,(x,y)): return self.pts[self.nearestpt((x,y))][2] def znearc(self,c): x,y = self.p.at(c) x,y = 100*x.t,100*y.t return self.znear((x,y)) def addPatch(self,c,z): self.patchpts.append((c,z)) def drawto(self,cnvs): cnvs.stroke(self.p,self.sty) def interleave(p3d1,p3d2): print "Finding intersection points..." is1,is2 = p3d1.p.intersect(p3d2.p) print "determining patch z..." assert len(is1)==len(is2) for i in range(len(is1)): z1 = p3d1.znearc(is1[i]) z2 = p3d2.znearc(is2[i]) if z1>z2: p3d1.addPatch(is1[i],z1) p3d2.underpts.append(is2[i]) else: p3d2.addPatch(is2[i],z2) p3d1.underpts.append(is1[i]) print "done." def drawInterleaved(c,ps): print "Drawing base curves..." for p in ps: p.p = p.p.normpath() if p.breakunder: splits = [] for s in p.underpts: splits += [s-p.breakunder*0.5,s+p.breakunder*0.5] psplit = p.p.split(splits) for seg in psplit[0::2]: c.stroke(seg,p.sty) else: c.stroke(p.p,p.sty+p.endsty) print "Preparing patches..." patches = [] for (pn,p) in enumerate(ps): if p.nopatch: continue p.patchpts.sort() splits = [] for s in p.patchpts: splits += [s[0]-0.05,s[0]+0.05] psplit = p.p.split(splits) patches += [ (patch[1],pn,psplit[2*n+1]) for n,patch in enumerate(p.patchpts) ] patches.sort() print "Patching intersections..." for p in patches: c.stroke(p[2],ps[p[1]].sty) print "Done." def fieldPath(fmap,z0,z1,c,cmax,npts=50): pfield = path3d() for z in unifrange(z0,z1,npts): Bdens = c/sqrt(fmap(z)+0.0001) if abs(Bdens) < cmax: pfield.addpt((0,Bdens,z)) return pfield def larmor_unif(fT,theta,KE,t): b = electron_beta(KE) z = t*b*cos(theta)*3e8 # m r = 3.3e-6*b*(KE+511)*sin(theta)/fT # m f = 2.8e10*fT # Hz return r*cos(2*pi*f*t),r*sin(2*pi*f*t),z def larmor_step(p,pt2_per_B,fT): nu = 2.8e10*fT*2*pi # angular frequency, Hz pt = sqrt(fT*pt2_per_B) # transverse momentum component, keV if p<=pt: return 0,nu pl = sqrt(p**2-pt**2) # longitudinal momentum, keV vz = pl/sqrt(p*p+511*511)*3e8; # z velocity, m/s return vz,nu def larmorPath(fmap,p,pt2_per_B,z0,z1,dt,theta=0): lpath = path3d() z = z0 vz = 1 while z0 <= z <= z1 and vz>0: fT = fmap(z) # magnetic field, T r = 3.3e-6*sqrt(pt2_per_B/fT) # larmor radius, m lpath.addpt((r*cos(theta),r*sin(theta),z)) # step to next point vz,nu = larmor_step(p,pt2_per_B,fmap(z)) theta += nu*dt z += vz*dt return lpath def plot_larmor_trajectory(): fmap = fieldMap() fmap.addFlat(-1.0,0.01,1.0) fmap.addFlat(0.015,1.0,0.6) #fmap.addFlat(-1.0,0.01,0.6) #fmap.addFlat(0.08,1.0,1.0) fT = fmap(0) theta = 1.4 KE = 511. #rot = rot3(0,0.0,-pi/2-0.2,500) rot = rot3(0,0.0,-pi/2+0.2,500) tm = 1e-9 doFinal = True plarmor = larmorPath(fmap,500,495**2/fmap(0),0,0.02,5e-13,3*pi/4) plarmor.apply(rot) #plarmor.sty = [style.linewidth.thick,rgb.red] plarmor.sty = [style.linewidth.thick] plarmor.endsty = [deco.earrow()] plarmor.finish() x0,y0 = plarmor.p.at(plarmor.p.begin()) fieldlines = [] w = 0.0025 cmagf = canvas.canvas() for o in unifrange(-w,w,20): pf = fieldPath(fmap,-0.002,0.022,o,1.02*w) if len(pf.pts) < 10: continue pf.apply(rot) pf.finish() pf.breakunder = 0.07 pf.nopatch = True #pf.sty=[style.linewidth.thin,rgb.blue] pf.sty=[style.linewidth.thin] # field line color/style fieldlines.append(pf) pf.drawto(cmagf) if doFinal: interleave(plarmor,pf) #cmagf.stroke(path.circle(x0,y0,0.07),[deco.filled([rgb.green])]) cmagf.stroke(path.circle(x0,y0,0.07),[deco.filled([rgb.white]),style.linewidth.Thick]) cmagf.writetofile("/Users/michael/Desktop/Bfield.pdf") c = canvas.canvas() if doFinal: drawInterleaved(c,[plarmor,]+fieldlines) else: plarmor.drawto(c) for pf in fieldlines: pf.drawto(c) #c.stroke(path.circle(x0,y0,0.07),[deco.filled([rgb.green])]) c.stroke(path.circle(x0,y0,0.07),[deco.filled([rgb.white]),style.linewidth.Thick]) c.writetofile("/Users/michael/Desktop/larmor_spiral.pdf") def plot_spectrometer_field(): fmap = fieldMap() fmap.addFlat(-3,-2.8,0.01) fmap.addFlat(-2.3,-2.1,0.6) fmap.addFlat(-1.6,1.6,1.0) fmap.addFlat(2.1,2.3,0.6) fmap.addFlat(2.8,3,0.01) rot = rot3(0.0,0.0,-pi/2.,10.) w = 0.25 cmagf = canvas.canvas() for o in unifrange(-w,w,20): pf = fieldPath(fmap,-2.6,2.6,o,w,400) pf.apply(rot) #if len(pf.pts) < 10: # continue pf.finish() #pf.sty=[style.linewidth.thin,rgb.blue] pf.sty=[style.linewidth.thin] # field line color/style pf.drawto(cmagf) cmagf.writetofile("/Users/michael/Desktop/Bfield.pdf") def larmor_clipping_plot(): gSurv=graph.graphxy(width=20,height=10, x=graph.axis.lin(title="Source offset [mm]"), y=graph.axis.lin(title="",min=0,max=1), key = graph.key.key(pos="bl")) gSurv.texrunner.set(lfs='foils17pt') rho = 1.5 h0 = 9.5 gdat = [ [h0-h,survival_fraction(h,rho,2*3.3),survival_fraction(h,rho,2*3.3/2)] for h in unifrange(h0-10,h0,100) ] gdat = [ g+[0.5*(g[2]<=1e-3)+(g[2]>1e-3)*(g[1]/(g[2]+1e-6)),] for g in gdat] gSurv.plot(graph.data.points(gdat,x=1,y=3,title="500keV line survival"),[graph.style.line([style.linewidth.Thick,rgb.blue])]) gSurv.plot(graph.data.points(gdat,x=1,y=2,title="1MeV line survival"),[graph.style.line([style.linewidth.Thick,rgb.red])]) gSurv.plot(graph.data.points(gdat,x=1,y=4,title="1MeV:500keV survival ratio"),[graph.style.line([style.linewidth.Thick])]) gSurv.writetofile("/Users/michael/Desktop/survival_%g.pdf"%rho) def radial_clipping_plot(): gSurv=graph.graphxy(width=20,height=10, x=graph.axis.lin(title="Source spot radius [mm]",min=0,max=9.5), y=graph.axis.lin(title="",min=0,max=1), key = graph.key.key(pos="bl")) gSurv.texrunner.set(lfs='foils17pt') h = 9.5 gdat = [ [rho,radial_survival_fraction(h,rho,3.3),radial_survival_fraction(h,rho,3.3/2.0)] for rho in unifrange(0.,9.5,200) ] gdat = [ g+[0.5*(g[2]<=1e-3)+(g[2]>1e-3)*(g[1]/(g[2]+1e-6)),] for g in gdat] gSurv.plot(graph.data.points(gdat,x=1,y=3,title="500keV line survival"),[graph.style.line([style.linewidth.Thick,rgb.blue])]) gSurv.plot(graph.data.points(gdat,x=1,y=2,title="1MeV line survival"),[graph.style.line([style.linewidth.Thick,rgb.red])]) gSurv.plot(graph.data.points(gdat,x=1,y=4,title="1MeV:500keV survival ratio"),[graph.style.line([style.linewidth.Thick])]) gSurv.writetofile("/Users/michael/Desktop/survival_radial.pdf") if __name__ == "__main__": #larmor_clipping_plot() #radial_clipping_plot() #plot_larmor_trajectory() plot_spectrometer_field()
UCNA/main
Scripts/plotters/LarmorClipping.py
Python
gpl-3.0
8,636
<?php if (!isset($conn)) { include "./logic/connectToDatabase.php"; } if (!isset($_SESSION)) { session_start(); } $loggedIn = false; if (isset($_SESSION['email'])) { $loggedIn = true; } include('./languages/german.php'); ?> <!DOCTYPE html> <html lang="de"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> <title><?php echo $string_title_first . $string_title_home; ?></title> <?php include 'header.php'; ?> </head> <body> <?php include 'navbar.php'; ?> <div class="mycontainer"> <?php include('./logic/alertSwitch.php'); $row_count = 0; foreach ($conn->query('SELECT UMID, name, date, trailerLink, workerUUID, bookedCards, emergencyWorkerUUID FROM movies ORDER BY date') as $item) { $UMID = $item[0]; $movieName = $item[1]; $movieDate = $item[2]; $movieTrailerLink = $item[3]; $workerUUID = $item[4]; $bookedCards = $item[5]; $emergencyWorkerUUID = $item[6]; $workerName = null; $movieHasWorker = false; $emergencyWorkerName = null; $movieHasEmergencyWorker = false; $movieAlreadyShowed = false; $availableCards = 20 - $bookedCards; $date = DateTime::createFromFormat('Y-m-d', $movieDate); $currentDate = date('Y-m-d'); $formattedDate = $date->format('D, d M Y'); $del = ""; $delend = ""; if (isset($workerUUID)) { foreach ($conn->query('SELECT firstname, surname, UUID FROM users WHERE UUID=' . $workerUUID) as $users) { $workerName = $users[0] . ' ' . $users[1]; $movieHasWorker = true; break; } } if (isset($emergencyWorkerUUID)) { foreach ($conn->query('SELECT firstname, surname, UUID FROM users WHERE UUID=' . $emergencyWorkerUUID) as $users) { $emergencyWorkerName = $users[0] . ' ' . $users[1]; $movieHasEmergencyWorker = true; break; } } if ($currentDate > $item['date']) { $del = "<del>"; $delend = "</del>"; $movieAlreadyShowed = true; } if ($row_count == 0) { echo '<div class="row">'; } echo ' <div class="col-xs-12 col-sm-12 col-md-3 col-lg-3"> <div class="panel panel-default"> <div class="panel-heading" style="font-size: 20px">' . $del . $movieName . $delend . '</div> <div class="panel-body"> <ul class="list-group"> <li class="list-group-item"> <div class="row"> <div class="col-xs-6 col-sm-6 col-md-5 col-lg-5">' . $string_home_date . '</div> <div class="col-xs-6 col-sm-6 col-md-7 col-lg-7">' . $formattedDate . '</div> </div> </li> <li class="list-group-item"> <div class="row"> <div class="col-xs-6 col-sm-6 col-md-5 col-lg-5">' . $string_home_trailer . '</div> <div class="col-xs-6 col-sm-6 col-md-7 col-lg-7"> <a href="' . $movieTrailerLink . '" target="_blank" data-toggle="tooltip" data-placement="top" title="' . $string_home_trailer_button_tooltip . '"> <button type="button" class="btn btn-info"> <span class="glyphicon glyphicon-new-window"></span> </button> </a> </div> </div> </li> <li class="list-group-item"> <div class="row"> <div class="col-xs-6 col-sm-6 col-md-5 col-lg-5">' . $string_home_cardService . '</div> '; //If movie has NO worker, you should be possible to get in touch and if you aren't logged in you see that there is no worker if (!$movieHasWorker) { echo ' <div class="col-xs-6 col-sm-6 col-md-7 col-lg-7"> '; if ($loggedIn) { if ($movieAlreadyShowed) { echo ' <button class="btn btn-info disabled" data-toggle="tooltip" data-placement="bottom" title="' . $string_home_cardService_button_tooltip_already_showed . '">' . $string_home_cardService_button_text . '</button>'; } else { echo '<a href="#modal_getNormalWorkerInTouch" data-toggle="tooltip" data-placement="bottom" title="' . $string_home_cardService_button_tooltip . '"> <button class="btn btn-primary" data-toggle="modal" data-target="#modal_getNormalWorkerInTouch" data-movie-id="' . $item[0] . '" data-movie-name="' . $item[1] . '">' . $string_home_cardService_button_text . '</button></a>'; } } else { echo $string_home_cardService_no_one_assigned; } echo ' </div> '; //If movie has worker the name is displayed and if you are logged in and the worker is you you can cancel it } else { echo ' <div class="col-xs-6 col-sm-6 col-md-7 col-lg-7">' . $workerName; if ($loggedIn) { if ($workerUUID == $_SESSION['UUID']) { echo ' <a href="#modal_cancelNormalWorkerGetInTouchWithMovie" data-toggle="tooltip" data-placement="right" title="' . $string_home_cardService_remove_button_tooltip . '"> <button class="btn btn-default" data-toggle="modal" data-target="#modal_cancelNormalWorkerGetInTouchWithMovie" data-movie-id="' . $UMID . '" data-movie-name="' . $movieName . '"> <span class="glyphicon glyphicon-remove"></span> </button> </a>'; } } echo ' </div> '; } echo ' </div> </li> <li class="list-group-item"> <div class="row"> <div class="col-xs-6 col-sm-6 col-md-5 col-lg-5">' . $string_home_emergencyCardService . '</div> '; //If movie has NO emergency Worker, you should be possible to get in touch and if you aren't logged in you see that there is no worker if (!$movieHasEmergencyWorker) { echo ' <div class="col-xs-6 col-sm-6 col-md-7 col-lg-7"> '; if ($loggedIn) { if ($movieAlreadyShowed) { echo ' <button class="btn btn-info disabled" data-toggle="tooltip" data-placement="bottom" title="' . $string_home_cardService_button_tooltip_already_showed . '">' . $string_home_cardService_button_text . '</button>'; } else { echo '<a href="#modal_getEmergencyWorkerInTouch" data-toggle="tooltip" data-placement="bottom" title="' . $string_home_emergencyCardService_button_tooltip . '"> <button class="btn btn-primary" data-toggle="modal" data-target="#modal_getEmergencyWorkerInTouch" data-movie-id="' . $item[0] . '" data-movie-name="' . $item[1] . '">' . $string_home_cardService_button_text . ' </button> </a>'; } } else { echo $string_home_cardService_no_one_assigned; } echo ' </div> '; //If movie has worker the is displayed and if you are logged in and the worker is you you will cancel it } else { echo ' <div class="col-xs-6 col-sm-6 col-md-7 col-lg-7">' . $emergencyWorkerName; if ($loggedIn) { if ($emergencyWorkerUUID == $_SESSION['UUID']) { echo ' <a href="#modal_cancelEmergencyWorkerGetInTouchWithMovie" data-toggle="tooltip" data-placement="right" title="' . $string_home_cardService_remove_button_tooltip . '"> <button class="btn btn-default" data-toggle="modal" data-target="#modal_cancelEmergencyWorkerGetInTouchWithMovie" data-movie-id="' . $UMID . '" data-movie-name="' . $movieName . '"> <span class="glyphicon glyphicon-remove"></span> </button> </a>'; } } echo ' </div> '; } echo ' </div> </li> '; if (!$movieAlreadyShowed) { echo ' <li class="list-group-item"> <div class="row"> <div class="col-xs-6 col-sm-6 col-md-5 col-lg-5">' . $string_home_available_cards . '</div> <div class="col-xs-6 col-sm-6 col-md-7 col-lg-7">' . $availableCards . '</div> </div> </li> '; } if ($loggedIn) { $userHasBookedForThisMovie = false; foreach ($conn->query('SELECT UBID, count FROM bookings WHERE UUID=' . $_SESSION['UUID'] . ' AND UMID=' . $item[0] . ';') as $bookings) { $UBID = $bookings[0]; $userBookedCardsCount = $bookings[1]; $userHasBookedForThisMovie = true; break; } if ($userHasBookedForThisMovie && isset($userBookedCardsCount) && !$movieAlreadyShowed) echo ' <li class="list-group-item"> <div class="row"> <div class="col-xs-6 col-sm-6 col-md-5 col-lg-5">' . $string_home_booked_cards . '</div> <div class="col-xs-6 col-sm-6 col-md-7 col-lg-7">' . $userBookedCardsCount . '</div> </div> </li> '; } echo ' </ul> </div> <div class="panel-footer"> '; if ($loggedIn) { if ($availableCards == 0) { echo '<button class="btn btn-danger disabled" data-toggle="tooltip" data-placement="bottom" title="' . $string_home_booking_fully_booked_tooltip . '">' . $string_home_booking_fully_booked . '</button>'; } else if ($movieAlreadyShowed) { echo '<button class="btn btn-danger disabled" data-toggle="tooltip" data-placement="bottom" title="' . $string_home_booking_already_been_shown_tooltip . '">' . $string_home_booking_already_been_shown . '</button>'; } else { echo '<a href="#modal_bookCards" class="btn btn-success" data-toggle="modal" data-target="#modal_bookCards" data-movie-id="' . $item[0] . '" data-availablecards="' . $availableCards . '">' . $string_home_booking . '</a>'; } if (isset($userHasBookedForThisMovie)) { if ($userHasBookedForThisMovie) { echo '<a href="#modal_cancelBookedCards" class="btn btn-warning" data-toggle="modal" data-target="#modal_cancelBookedCards" data-movie-id="' . $item[0] . '" data-movie-name="' . $item[1] . '" style="float: right">' . $string_home_cancel_booking . '</a>'; $UBID = null; } } } else { echo '<a href="#" data-toggle="tooltip" data-placement="bottom" title="' . $string_home_booking_tooltip . '"> <button type="button" class="btn btn-success" data-toggle="modal" data-target="#modal_login">' . $string_home_booking . '</button> </a>'; } echo ' </div> </div> </div> '; if ($row_count == 3) { echo '</div>'; $row_count = 0; } else { $row_count++; } } //If there aren't enough movies for a row, the foreach would be interrupted and the last div wouldn't be ended if ($row_count != 3) { echo '</div>'; } ?> </div> <div class="modal fade" id="modal_bookCards" role="dialog"> <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title" id="modal_bookCards_availableCardsHEAD"></h4> </div> <form action="./logic/booking/bookCards.php" method="POST"> <div class="modal-body"> <input type="text" name="UMID" hidden value=""/> <div class="alert alert-info"> <?php echo $string_home_modal_book_cards_alert; ?> </div> <div class="form-group"> <label for="inputCount"><?php echo $string_home_modal_book_cards_number_of_cards; ?></label> <div class="input-group"> <span class="input-group-addon"><i class="glyphicon glyphicon-play"></i></span> <input required type="text" class="form-control" id="inputCount" name="inputCount" placeholder="1" min="0" max="20" onchange="checkValue()" autofocus> </div> </div> <div id="maxinput" hidden></div> <b id="modal_bookCards_availableCardsDIV"></b> </div> <div class="modal-footer"> <button type="button" class="btn btn-danger" data-dismiss="modal"><?php echo $string_cancel; ?></button> <button type="submit" class="btn btn-success" autofocus><?php echo $string_home_modal_book_cards_button_success; ?></button> </div> </form> </div> </div> </div> <div class="modal fade" id="modal_getNormalWorkerInTouch"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title" id="modal_getNormalWorkerInTouch_movieNameHEAD"></h4> </div> <form method="POST" action="./logic/worker/getNormalWorkerInTouchWithMovie.php"> <div class="modal-body"> <input type="text" name="UMID" hidden value=""/> <div class="alert alert-info"> <?php echo $string_home_modal_get_in_touch_alert; ?> </div> </div> <div class="modal-footer"> <button type="reset" class="btn btn-danger" data-dismiss="modal"><?php echo $string_cancel; ?></button> <button type="submit" class="btn btn-success"><?php echo $string_home_modal_get_in_touch_button_success; ?></button> </div> </form> </div> </div> </div> <div class="modal fade" id="modal_getEmergencyWorkerInTouch"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title" id="modal_getEmergencyWorkerInTouch_movieNameHEAD"></h4> </div> <form method="POST" action="./logic/worker/getEmergencyWorkerInTouchWithMovie.php"> <div class="modal-body"> <input type="text" name="UMID" hidden value=""/> <div class="alert alert-info"> <?php echo $string_home_modal_get_in_touch_alert; ?> </div> </div> <div class="modal-footer"> <button type="reset" class="btn btn-danger" data-dismiss="modal"><?php echo $string_cancel; ?></button> <button type="submit" class="btn btn-success"><?php echo $string_home_modal_get_in_touch_button_success; ?></button> </div> </form> </div> </div> </div> <div class="modal fade" id="modal_cancelNormalWorkerGetInTouchWithMovie"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title" id="modal_cancelNormalWorkerGetInTouch_movieNameHEAD"></h4> </div> <form method="POST" action="./logic/worker/cancelNormalWorkerGetInTouchWithMovie.php"> <input type="text" name="UMID" hidden value=""/> <div class="modal-footer"> <button type="reset" class="btn btn-danger" data-dismiss="modal"><?php echo $string_cancel; ?></button> <button type="submit" class="btn btn-success"><?php echo $string_home_modal_cancel_get_in_touch_button_success; ?></button> </div> </form> </div> </div> </div> <div class="modal fade" id="modal_cancelEmergencyWorkerGetInTouchWithMovie"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title" id="modal_cancelEmergencyWorkerGetInTouch_movieNameHEAD"></h4> </div> <form method="POST" action="./logic/worker/cancelEmergencyWorkerGetInTouchWithMovie.php"> <input type="text" name="UMID" hidden value=""/> <div class="modal-footer"> <button type="reset" class="btn btn-danger" data-dismiss="modal"><?php echo $string_cancel; ?></button> <button type="submit" class="btn btn-success"><?php echo $string_home_modal_cancel_get_in_touch_button_success; ?></button> </div> </form> </div> </div> </div> <div class="modal fade" id="modal_cancelBookedCards"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title" id="modal_cancelBooking_movieNameHEAD"></h4> </div> <form method="POST" action="./logic/booking/cancelBookedCards.php"> <div class="modal-body"> <input type="text" name="UMID" hidden value=""> <div class="alert alert-info"> <?php echo $string_home_modal_cancel_booked_cards_alert; ?> </div> </div> <div class="modal-footer"> <button type="reset" class="btn btn-danger" data-dismiss="modal"><?php echo $string_cancel; ?></button> <button type="submit" class="btn btn-success"><?php echo $string_home_modal_cancel_booked_cards_button_success; ?></button> </div> </form> </div> </div> </div> <?php include 'endScripts.php'; ?> <script> $('#modal_bookCards').on('show.bs.modal', function (e) { var movieId = $(e.relatedTarget).data('movie-id'); $(e.currentTarget).find('input[name="UMID"]').val(movieId); var avcards = $(e.relatedTarget).data('availablecards'); document.getElementById('modal_bookCards_availableCardsDIV').innerText = "<?php echo $string_home_modal_book_cards_available_cards; ?>" + avcards; document.getElementById('modal_bookCards_availableCardsHEAD').innerText = "<?php echo $string_home_modal_book_cards_title; ?>" + avcards; document.getElementById('inputCount').setAttribute('max', "" + avcards); document.getElementById('maxinput').innerText = "" + avcards; }); $('#modal_getNormalWorkerInTouch').on('show.bs.modal', function (e) { var movieId = $(e.relatedTarget).data('movie-id'); $(e.currentTarget).find('input[name="UMID"]').val(movieId); var movieName = $(e.relatedTarget).data('movie-name'); document.getElementById('modal_getNormalWorkerInTouch_movieNameHEAD').innerText = "<?php echo $string_home_modal_get_in_touch_title_1; ?>" + movieName + "<?php echo $string_home_modal_get_in_touch_title_2; ?>"; }); $('#modal_getEmergencyWorkerInTouch').on('show.bs.modal', function (e) { var movieId = $(e.relatedTarget).data('movie-id'); $(e.currentTarget).find('input[name="UMID"]').val(movieId); var movieName = $(e.relatedTarget).data('movie-name'); document.getElementById('modal_getEmergencyWorkerInTouch_movieNameHEAD').innerText = "<?php echo $string_home_modal_get_in_touch_title_1; ?>" + movieName + "<?php echo $string_home_modal_get_in_touch_title_2; ?>"; }); $('#modal_cancelNormalWorkerGetInTouchWithMovie').on('show.bs.modal', function (e) { var movieId = $(e.relatedTarget).data('movie-id'); $(e.currentTarget).find('input[name="UMID"]').val(movieId); var movieName = $(e.relatedTarget).data('movie-name'); document.getElementById('modal_cancelNormalWorkerGetInTouch_movieNameHEAD').innerText = "<?php echo $string_home_modal_cancel_get_in_touch_title_1; ?>" + movieName + "<?php echo $string_home_modal_cancel_get_in_touch_title_2; ?>"; }); $('#modal_cancelEmergencyWorkerGetInTouchWithMovie').on('show.bs.modal', function (e) { var movieId = $(e.relatedTarget).data('movie-id'); $(e.currentTarget).find('input[name="UMID"]').val(movieId); var movieName = $(e.relatedTarget).data('movie-name'); document.getElementById('modal_cancelEmergencyWorkerGetInTouch_movieNameHEAD').innerText = "<?php echo $string_home_modal_cancel_get_in_touch_title_1; ?>" + movieName + "<?php echo $string_home_modal_cancel_get_in_touch_title_2; ?>"; }); $('#modal_cancelBookedCards').on('show.bs.modal', function (e) { var movieId = $(e.relatedTarget).data('movie-id'); $(e.currentTarget).find('input[name="UMID"]').val(movieId); var movieName = $(e.relatedTarget).data('movie-name'); document.getElementById('modal_cancelBooking_movieNameHEAD').innerText = "<?php echo $string_home_modal_cancel_booked_cards_title_1; ?>" + movieName + "<?php echo $string_home_modal_cancel_booked_cards_title_2; ?>"; }); function checkValue() { var max = parseInt(document.getElementById('maxinput').innerText); var value = document.getElementById("inputCount").value; if (value > max) { document.getElementById("inputCount").value = max; } if (value < 1) { document.getElementById("inputCount").value = 1; } } </script> </body> </html>
Dafnik/ticketsys-bootstrap
index.php
PHP
gpl-3.0
24,328
angular.module('resource', ['ngResource', 'app']) // service for Items .factory('Item', ['$http', '$resource', 'HostSvc', function($http, $resource, HostSvc) { /* Item is an Object in IPFS terms For a context, the Item stores the following { "Data": ...name of context, "Links": [ {"Name": ...page name, "Hash": ...hash of page} ] } For a page, the Item stores the following { "Data": ...content of page in markdown, "Links": [ {"Name": ...datestamp of previous version, "Hash": ...hash of previous context} ] } */ var Item = $resource(HostSvc.getHostUrl() + 'get/:hash', {hash:'@hash'}, { get: { method: 'POST', cache: true }, save: { method: 'POST', headers: { 'Content-Type': 'multipart/form-data; boundary=a831rwxi1a3gzaorw1w2z49dlsor' }, transformRequest: function (data) { return '--a831rwxi1a3gzaorw1w2z49dlsor\nContent-Type: application/json\n\n' + angular.toJson(data) + '\n\n--a831rwxi1a3gzaorw1w2z49dlsor--'; }, url: HostSvc.getHostUrl() + 'put/' } }); return Item; }]) .config(['$resourceProvider', function($resourceProvider) { $resourceProvider.defaults.stripTrailingSlashes = false; }]) ;
jamescarlyle/ipfs-wiki
js/resource.js
JavaScript
gpl-3.0
1,173
/* * This file is part of RadPlanBio * * Copyright (C) 2013-2019 RPB Team * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package de.dktk.dd.rpb.api.v1.webdav; import de.dktk.dd.rpb.api.support.BaseService; import net.java.dev.webdav.jaxrs.methods.PROPFIND; import net.java.dev.webdav.jaxrs.xml.elements.*; import net.java.dev.webdav.jaxrs.xml.properties.CreationDate; import net.java.dev.webdav.jaxrs.xml.properties.DisplayName; import net.java.dev.webdav.jaxrs.xml.properties.GetLastModified; import org.apache.log4j.Logger; import org.springframework.stereotype.Component; import javax.ws.rs.*; import javax.ws.rs.core.Context; import javax.ws.rs.core.UriInfo; import javax.ws.rs.ext.Providers; import java.util.*; import java.util.Collection; import static java.util.Collections.singletonList; import static javax.ws.rs.core.Response.Status.OK; import static net.java.dev.webdav.jaxrs.Headers.*; import static net.java.dev.webdav.jaxrs.ResponseStatus.MULTI_STATUS; import static net.java.dev.webdav.jaxrs.xml.properties.ResourceType.COLLECTION; /** * Service handling WebDAV requests to access RPB data */ @Component @Path("/v1/webdav") public class WebDavService extends BaseService { //region Finals private static final Logger log = Logger.getLogger(WebDavService.class); //endregion //region Resources //region OPTIONS @OPTIONS public final javax.ws.rs.core.Response options() { return javax.ws.rs.core.Response.noContent() .header(DAV, "1, 2") .header("Allow", "PROPFIND,OPTIONS") .build(); } //endregion //region PROPFIND @PROPFIND public final javax.ws.rs.core.Response propfind( @Context final UriInfo uriInfo, @DefaultValue(DEPTH_INFINITY) @HeaderParam(DEPTH) final String depth, @Context final Providers providers) { // Make sure that webDav URL ends with slash String webDavUrl = uriInfo.getRequestUri().toString(); if (!webDavUrl.endsWith("/")) { webDavUrl += "/"; } // Root folder final Response rootFolder = new Response( new HRef(webDavUrl), null, null, null, new PropStat( new Prop( new DisplayName("RPB-WebDAV"), new CreationDate(new Date()), new GetLastModified(new Date()), COLLECTION ), new Status((javax.ws.rs.core.Response.StatusType) OK) ) ); // This is the top level return root folder if (depth.equals(DEPTH_0)) { log.debug("PROPFIND: rootFolder"); return javax.ws.rs.core.Response.status(MULTI_STATUS).entity(new MultiStatus(rootFolder)).build(); } // Otherwise expand final Collection<Response> responses = new LinkedList<>(singletonList(rootFolder)); Response studiesFolder = new Response( new HRef(webDavUrl + "studies"), null, null, null, new PropStat( new Prop( new DisplayName("studies"), new CreationDate(new Date()), new GetLastModified(new Date()), COLLECTION ), new Status((javax.ws.rs.core.Response.StatusType) OK) ) ); responses.add(studiesFolder); return javax.ws.rs.core.Response.status(MULTI_STATUS).entity(new MultiStatus(responses.toArray(new Response[0]))).build(); } //endregion //endregion }
ddRPB/rpb
radplanbio-portal/src/main/java/de/dktk/dd/rpb/api/v1/webdav/WebDavService.java
Java
gpl-3.0
4,293
/*************************************************************************** * Copyright 2013 CertiVox IOM Ltd. * * This file is part of CertiVox MIRACL Crypto SDK. * * The CertiVox MIRACL Crypto SDK provides developers with an * extensive and efficient set of cryptographic functions. * For further information about its features and functionalities please * refer to http://www.certivox.com * * * The CertiVox MIRACL Crypto SDK is free software: you can * redistribute it and/or modify it under the terms of the * GNU Affero General Public License as published by the * Free Software Foundation, either version 3 of the License, * or (at your option) any later version. * * * The CertiVox MIRACL Crypto SDK is distributed in the hope * that it will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Affero General Public License for more details. * * * You should have received a copy of the GNU Affero General Public * License along with CertiVox MIRACL Crypto SDK. * If not, see <http://www.gnu.org/licenses/>. * * You can be released from the requirements of the license by purchasing * a commercial license. Buying such a license is mandatory as soon as you * develop commercial activities involving the CertiVox MIRACL Crypto SDK * without disclosing the source code of your own applications, or shipping * the CertiVox MIRACL Crypto SDK with a closed source product. * * ***************************************************************************/ /* * Implementation of the AES-GCM Encryption/Authentication * * Some restrictions.. * 1. Only for use with AES * 2. Returned tag is always 128-bits. Truncate at your own risk. * 3. The order of function calls must follow some rules * * Typical sequence of calls.. * 1. call gcm_init * 2. call gcm_add_header any number of times, as long as length of header is multiple of 16 bytes (block size) * 3. call gcm_add_header one last time with any length of header * 4. call gcm_add_cipher any number of times, as long as length of cipher/plaintext is multiple of 16 bytes * 5. call gcm_add_cipher one last time with any length of cipher/plaintext * 6. call gcm_finish to extract the tag. * * See http://www.mindspring.com/~dmcgrew/gcm-nist-6.pdf */ #include <stdlib.h> #include <string.h> #include "miracl.h" #define NB 4 #define MR_WORD mr_unsign32 static MR_WORD pack(const MR_BYTE *b) { /* pack bytes into a 32-bit Word */ return ((MR_WORD)b[0]<<24)|((MR_WORD)b[1]<<16)|((MR_WORD)b[2]<<8)|(MR_WORD)b[3]; } static void unpack(MR_WORD a,MR_BYTE *b) { /* unpack bytes from a word */ b[3]=MR_TOBYTE(a); b[2]=MR_TOBYTE(a>>8); b[1]=MR_TOBYTE(a>>16); b[0]=MR_TOBYTE(a>>24); } static void precompute(gcm *g,MR_BYTE *H) { /* precompute small 2k bytes gf2m table of x^n.H */ int i,j; MR_WORD *last,*next,b; for (i=j=0;i<NB;i++,j+=4) g->table[0][i]=pack((MR_BYTE *)&H[j]); for (i=1;i<128;i++) { next=g->table[i]; last=g->table[i-1]; b=0; for (j=0;j<NB;j++) {next[j]=b|(last[j])>>1; b=last[j]<<31;} if (b) next[0]^=0xE1000000; /* irreducible polynomial */ } } static void gf2mul(gcm *g) { /* gf2m mul - Z=H*X mod 2^128 */ int i,j,m,k; MR_WORD P[4]; MR_BYTE b; P[0]=P[1]=P[2]=P[3]=0; j=8; m=0; for (i=0;i<128;i++) { b=(g->stateX[m]>>(--j))&1; if (b) for (k=0;k<NB;k++) P[k]^=g->table[i][k]; if (j==0) { j=8; m++; if (m==16) break; } } for (i=j=0;i<NB;i++,j+=4) unpack(P[i],(MR_BYTE *)&g->stateX[j]); } static void gcm_wrap(gcm *g) { /* Finish off GHASH */ int i,j; MR_WORD F[4]; MR_BYTE L[16]; /* convert lengths from bytes to bits */ F[0]=(g->lenA[0]<<3)|(g->lenA[1]&0xE0000000)>>29; F[1]=g->lenA[1]<<3; F[2]=(g->lenC[0]<<3)|(g->lenC[1]&0xE0000000)>>29; F[3]=g->lenC[1]<<3; for (i=j=0;i<NB;i++,j+=4) unpack(F[i],(MR_BYTE *)&L[j]); for (i=0;i<16;i++) g->stateX[i]^=L[i]; gf2mul(g); } void gcm_init(gcm* g,int nk,char *key,int niv,char *iv) { /* iv size niv is usually 12 bytes (96 bits). AES key size nk can be 16,24 or 32 bytes */ int i; MR_BYTE H[16]; for (i=0;i<16;i++) {H[i]=0; g->stateX[i]=0;} aes_init(&(g->a),MR_ECB,nk,key,iv); aes_ecb_encrypt(&(g->a),H); /* E(K,0) */ precompute(g,H); g->lenA[0]=g->lenC[0]=g->lenA[1]=g->lenC[1]=0; if (niv==12) { for (i=0;i<12;i++) g->a.f[i]=iv[i]; unpack((MR_WORD)1,(MR_BYTE *)&(g->a.f[12])); /* initialise IV */ for (i=0;i<16;i++) g->Y_0[i]=g->a.f[i]; } else { g->status=GCM_ACCEPTING_CIPHER; gcm_add_cipher(g,0,iv,niv,NULL); /* GHASH(H,0,IV) */ gcm_wrap(g); for (i=0;i<16;i++) {g->a.f[i]=g->stateX[i];g->Y_0[i]=g->a.f[i];g->stateX[i]=0;} g->lenA[0]=g->lenC[0]=g->lenA[1]=g->lenC[1]=0; } g->status=GCM_ACCEPTING_HEADER; } BOOL gcm_add_header(gcm* g,char *header,int len) { /* Add some header. Won't be encrypted, but will be authenticated. len is length of header */ int i,j=0; if (g->status!=GCM_ACCEPTING_HEADER) return FALSE; while (j<len) { for (i=0;i<16 && j<len;i++) { g->stateX[i]^=header[j++]; g->lenA[1]++; if (g->lenA[1]==0) g->lenA[0]++; } gf2mul(g); } if (len%16!=0) g->status=GCM_ACCEPTING_CIPHER; return TRUE; } BOOL gcm_add_cipher(gcm *g,int mode,char *plain,int len,char *cipher) { /* Add plaintext to extract ciphertext, or visa versa, depending on mode. len is length of plaintext/ciphertext. Note this file combines GHASH() functionality with encryption/decryption */ int i,j=0; MR_WORD counter; MR_BYTE B[16]; if (g->status==GCM_ACCEPTING_HEADER) g->status=GCM_ACCEPTING_CIPHER; if (g->status!=GCM_ACCEPTING_CIPHER) return FALSE; while (j<len) { if (cipher!=NULL) { counter=pack((MR_BYTE *)&(g->a.f[12])); counter++; unpack(counter,(MR_BYTE *)&(g->a.f[12])); /* increment counter */ for (i=0;i<16;i++) B[i]=g->a.f[i]; aes_ecb_encrypt(&(g->a),B); /* encrypt it */ } for (i=0;i<16 && j<len;i++) { if (cipher==NULL) g->stateX[i]^=plain[j++]; else { if (mode==GCM_ENCRYPTING) cipher[j]=plain[j]^B[i]; if (mode==GCM_DECRYPTING) plain[j]=cipher[j]^B[i]; g->stateX[i]^=cipher[j++]; } g->lenC[1]++; if (g->lenC[1]==0) g->lenC[0]++; } gf2mul(g); } if (len%16!=0) g->status=GCM_NOT_ACCEPTING_MORE; return TRUE; } void gcm_finish(gcm *g,char *tag) { /* Finish off GHASH and extract tag (MAC) */ int i; gcm_wrap(g); /* extract tag */ if (tag!=NULL) { aes_ecb_encrypt(&(g->a),g->Y_0); /* E(K,Y0) */ for (i=0;i<16;i++) g->Y_0[i]^=g->stateX[i]; for (i=0;i<16;i++) {tag[i]=g->Y_0[i];g->Y_0[i]=g->stateX[i]=0;} } g->status=GCM_FINISHED; aes_end(&(g->a)); } /* // Compile with // cl /O2 mrgcm.c mraes.c static void hex2bytes(char *hex,char *bin) { int i; char v; int len=strlen(hex); for (i = 0; i < len/2; i++) { char c = hex[2*i]; if (c >= '0' && c <= '9') { v = c - '0'; } else if (c >= 'A' && c <= 'F') { v = c - 'A' + 10; } else if (c >= 'a' && c <= 'f') { v = c - 'a' + 10; } else { v = 0; } v <<= 4; c = hex[2*i + 1]; if (c >= '0' && c <= '9') { v += c - '0'; } else if (c >= 'A' && c <= 'F') { v += c - 'A' + 10; } else if (c >= 'a' && c <= 'f') { v += c - 'a' + 10; } else { v = 0; } bin[i] = v; } } int main() { int i; char* KT="feffe9928665731c6d6a8f9467308308"; char* MT="d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39"; char* HT="feedfacedeadbeeffeedfacedeadbeefabaddad2"; // char* NT="cafebabefacedbaddecaf888"; // Tag should be 5bc94fbc3221a5db94fae95ae7121a47 char* NT="9313225df88406e555909c5aff5269aa6a7a9538534f7da1e4c303d2a318a728c3c0c95156809539fcf0e2429a6b525416aedbf5a0de6a57a637b39b"; // Tag should be 619cc5aefffe0bfa462af43c1699d050 int len=strlen(MT)/2; int lenH=strlen(HT)/2; int lenK=strlen(KT)/2; int lenIV=strlen(NT)/2; char T[16]; // Tag char K[32]; // AES Key char H[64]; // Header - to be included in Authentication, but not encrypted char N[100]; // IV - Initialisation vector char M[100]; // Plaintext to be encrypted/authenticated char C[100]; // Ciphertext char P[100]; // Recovered Plaintext gcm g; hex2bytes(MT, M); hex2bytes(HT, H); hex2bytes(NT, N); hex2bytes(KT, K); printf("Plaintext=\n"); for (i=0;i<len;i++) printf("%02x",(unsigned char)M[i]); printf("\n"); gcm_init(&g,lenK,K,lenIV,N); gcm_add_header(&g,H,lenH); gcm_add_cipher(&g,GCM_ENCRYPTING,M,len,C); gcm_finish(&g,T); printf("Ciphertext=\n"); for (i=0;i<len;i++) printf("%02x",(unsigned char)C[i]); printf("\n"); printf("Tag=\n"); for (i=0;i<16;i++) printf("%02x",(unsigned char)T[i]); printf("\n"); gcm_init(&g,lenK,K,lenIV,N); gcm_add_header(&g,H,lenH); gcm_add_cipher(&g,GCM_DECRYPTING,P,len,C); gcm_finish(&g,T); printf("Plaintext=\n"); for (i=0;i<len;i++) printf("%02x",(unsigned char)P[i]); printf("\n"); printf("Tag=\n"); for (i=0;i<16;i++) printf("%02x",(unsigned char)T[i]); printf("\n"); } */
FlexCOS/code
src/main/mod_miracl_7.0.0/mrgcm.c
C
gpl-3.0
10,449
// -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/FinalState.hh" namespace Rivet { /// @brief Add a short analysis description here class CLEOC_2005_I693873 : public Analysis { public: /// Constructor DEFAULT_RIVET_ANALYSIS_CTOR(CLEOC_2005_I693873); /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { // Initialise and register projections declare(FinalState(), "FS"); // Book histograms book(_npipi, "TMP/npipi"); book(_nKK, "TMP/nKK"); book(_nppbar, "TMP/nppbar"); } /// Perform the per-event analysis void analyze(const Event& event) { const FinalState& fs = apply<FinalState>(event, "FS"); map<long,int> nCount; int ntotal(0); for (const Particle& p : fs.particles()) { nCount[p.pid()] += 1; ++ntotal; } if(ntotal!=2) vetoEvent; if(nCount[211]==1 && nCount[-211]==1) _npipi->fill(); else if(nCount[321]==1 && nCount[-321]==1) _nKK->fill(); else if(nCount[2212]==1 && nCount[-2212]==1) _nppbar->fill(); } /// Normalise histograms etc., after the run void finalize() { for(unsigned int ix=1;ix<4;++ix) { double sigma = 0., error = 0.; if(ix==1) { sigma = _npipi->val(); error = _npipi->err(); } else if(ix==2) { sigma = _nKK->val(); error = _nKK->err(); } else if(ix==3) { sigma = _nppbar->val(); error = _nppbar->err(); } sigma *= crossSection()/ sumOfWeights() /picobarn; error *= crossSection()/ sumOfWeights() /picobarn; Scatter2D temphisto(refData(1, 1, ix)); Scatter2DPtr mult; book(mult, 1, 1, ix); for (size_t b = 0; b < temphisto.numPoints(); b++) { const double x = temphisto.point(b).x(); pair<double,double> ex = temphisto.point(b).xErrs(); pair<double,double> ex2 = ex; if(ex2.first ==0.) ex2. first=0.0001; if(ex2.second==0.) ex2.second=0.0001; if (inRange(sqrtS()/GeV, x-ex2.first, x+ex2.second)) { mult->addPoint(x, sigma, ex, make_pair(error,error)); } else { mult->addPoint(x, 0., ex, make_pair(0.,.0)); } } } } //@} /// @name Histograms //@{ CounterPtr _npipi,_nKK,_nppbar; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(CLEOC_2005_I693873); }
hep-mirrors/rivet
analyses/pluginCESR/CLEOC_2005_I693873.cc
C++
gpl-3.0
2,369
## ## Author: jpms ## Version: $Id$ ## package msu4; use Exporter(); use strict; #use warnings; use Data::Dumper; use POSIX; require UTILS; # Must use require, to get INC updated import UTILS qw( &get_progname &get_progpath &exit_ok &exit_err &exit_quit ); require IDGEN; # Must use require, to get INC updated import IDGEN qw( &num_id &gen_id &set_id ); require CLUTILS; import CLUTILS; require CLSET; import CLSET; require CARD; import CARD; BEGIN { @msu4::ISA = ('Exporter'); @msu4::EXPORT_OK = qw( &run_msu ); } our $progname = ''; our $strpref = ''; our $cnffile = ''; our $outfile = ''; our $xxtmpfile = ''; our $dbgfile = ''; our $corefile = ''; our $logfile = ''; our $opts = ''; our $inpfile = ''; our $timeout = ''; # Additional data structures our %blockvs = (); our @coreset = (); ################################################################################ # Main msuncore script ################################################################################ sub run_msu() { # Unique interface with msuncore front-end my $ds = shift; $progname = $ds->{PROGNAME}; $strpref = $ds->{STRPREF}; $cnffile = $ds->{CNFFILE}; $outfile = $ds->{OUTFILE}; $xxtmpfile = $ds->{TMPFILE}; $dbgfile = $ds->{DBGFILE}; $corefile = $ds->{COREFILE}; $logfile = $ds->{LOGFILE}; $inpfile = $ds->{INPFILE}; $timeout = $ds->{TIMEOUT}; $opts = $ds->{OPTS}; if (${$opts}{d}) { print Dumper($ds); } if (!defined(${$opts}{e})) { ${$opts}{e} = 'b'; } else { if (${$opts}{e} ne 'c' && ${$opts}{e} ne 'e') { &exit_err("Unavailable cardinality constraint encoding option\n"); } } &msu4_algorithm(); } sub msu4_algorithm() { # actual algorithm being run if (${$opts}{d}) { open (DBGF, ">$dbgfile") || &exit_err("Unable to open log file $dbgfile\n"); } # 2. Load CNF formula my $clset = CLSET->new(); $clset->parse($inpfile); my $nvars = $clset->numvars; my $ncls = $clset->numcls; if (${$opts}{d}) { print DBGF "VARS: $nvars -- CLS: $ncls\n"; my $nid = &IDGEN::num_id(); print DBGF "IDGEN ids: $nid\n"; } &UTILS::report_item("Number of clauses", $ncls); &exit_err("This is a stub for alg 4...\n"); my $ndcores = 0; my $mxub = $ncls; my $mxlb = 0; # 3. First loop: remove disjoint cores while (1) { if (${$opts}{d} || ${$opts}{v}) { my $niter = $ndcores+1; print "Running 1st loop iteration $niter...\n"; if (${$opts}{d}) { print DBGF "1ST LOOP ITERATION $niter...\n"; } } # 3.1 Run mscore (either get core or solution) my $outcome = &compute_and_remove_core($clset); if ($outcome == 0) { ++$ndcores; } elsif ($outcome == 1) { if ($ndcores == 0) { my $msg = 'Instance is SAT. Computed maxsat solution'; &UTILS::report_item($msg, $ncls); &finishup(); exit; } last; } else { print "No LB/UB data\nCputime limit exceeded\n"; exit(1); } } my $ncs = $#coreset + 1; print "Number of cores: $ncs\n"; my $tub = $ncls - $ncs; print "Current upper bound: $tub\n"; # 4. Compute blocking vars & setup initial clause set of blocked cls &compute_blocking_vars(\@coreset, \%blockvs); my $blkclset = CLSET->new(); # where blocked clauses are stored &init_block_clause_set($clset, \@coreset, \%blockvs); my $nbvlb = $ndcores; # Lower bound on blocking vars that must take value 1 # 5. Second loop: increase card constr while (1) { # 5.1. Generate clause set with CNF encoding of card constraint my $cardset = &gen_card_constraint(\%blockvs, $nbvlb); if (${$opts}{d} || ${$opts}{v}) { my $niter = ($nbvlb - $ndcores)+1; print "Running 2nd loop iteration $niter...\n"; if (${$opts}{d}) { print DBGF "2ND LOOP ITERATION $niter...\n"; } } my $clmset = CLMSET->new(); # create clause multiset $clmset->add_clset($clset); # cls remaining in clause set $clmset->add_clset($blkclset); # cls w/ blocking vars $clmset->add_clset($cardset); # encoding of card constraint my $outcome = &run_sat_solver($clmset); if ($outcome == 0) { $nbvlb++; # Find original clauses in core my $coreref = &parse_core_file($corefile); if (${$opts}{d}) { $"="\n"; print DBGF "CORE:\n@{$coreref}\n"; $"=' '; } my $initref = &get_initial_clauses($coreref, $clset); if (${$opts}{d}) { $"="\n";print DBGF "INIT CLS:\n@{$initref}\n";$"=' '; } &extract_init_clauses($initref, $clset); &add_blocking_vars($initref, $blkclset); } elsif ($outcome == 1) { &UTILS::report_item("Number of block vars", $nbvlb); &UTILS::report_item("Computed maxsat solution", $ncls - $nbvlb); &finishup(); exit; } else { $mxub = $ncls-$nbvlb; &UTILS::report_item("Lower bound for maxsat solution", $mxlb); &UTILS::report_item("Upper bound for maxsat solution", $mxub); print "Cputime limit exceeded\n"; &finishup(); exit; } } } ################################################################################ # Auxiliary functions ################################################################################ sub finishup() { if (!${$opts}{c}) { system("rm -f $cnffile $outfile $xxtmpfile $corefile"); } if (${$opts}{d} && !${$opts}{c}) { close DBGF;system("rm -f $dbgfile $logfile"); } } # Run SAT solver on clause multiset sub run_sat_solver() { my ($clmset) = @_; my $outcome = -1; # 1. Generate CNF file from clset $clmset->write_dimacs($cnffile); # 2. Invoke mscore my $csh_cmd = "./mscore $cnffile $outfile"; ##print "CSH_CMD: $csh_cmd\n"; if (${$opts}{T} ne '') { my $time_limit = &available_time(${$opts}{T}); `csh -f -c "limit cputime $time_limit; $csh_cmd" >& $xxtmpfile`; } else { `csh -f -c "$csh_cmd" >& $xxtmpfile`; } # 3. Parse output file and get outcome my ($outcome, $assign) = &parse_sat_outfile($outfile, $xxtmpfile); if (${$opts}{d}) { print "Outcome: $outcome\n"; } return $outcome; # 2nd arg is ref to data structure } # Run SAT solver on clause set to compute unsat core, if one exists sub compute_and_remove_core() { my ($clset) = @_; my $outcome = -1; # 1. Generate CNF file from clset $clset->write_dimacs($cnffile); # 2. Invoke mscore my $csh_cmd = "./mscore $cnffile $outfile"; ##print "CSH_CMD: $csh_cmd\n"; if (${$opts}{T} ne '') { my $time_limit = &available_time(); `csh -f -c "limit cputime $time_limit; $csh_cmd" >& $xxtmpfile`; } else { `csh -f -c "$csh_cmd" >& $xxtmpfile`; } # 3. Parse output file and get outcome my ($outcome, $assign) = &parse_sat_outfile($outfile, $xxtmpfile); # 3.1 If SAT, compute set of blocking vars and return it if ($outcome == 0) { if (${$opts}{d}) { print DBGF "Instance is UNSAT\n"; } # 3.2.1 Parse computed unsat core my $coreref = &compute_core($corefile, $clset); &extract_core_fromclset($coreref, $clset); if (${$opts}{d}) { $"="\n"; print DBGF "CORE:\n@{$coreref}\n";$"=' '; } push @coreset, $coreref; # add core to set of cores } elsif (${$opts}{d} && $outcome == 1) { print DBGF "Instance is SAT; Moving to next phase...\n"; } if (!${$opts}{c}) { system("rm -f $cnffile $outfile $xxtmpfile $corefile"); } return $outcome; } sub parse_sat_outfile() { my ($fname, $tname) = @_; my $abort = 0; my $outcome = -1; my $assign = ''; open (TMPF, "<$tname") || &exit_err("Unable to open TMP output file\n"); while(<TMPF>) { if (m/Cputime limit exceeded/) { $abort = 1; last; } } close TMPF; if (!$abort) { open (SATF, "<$fname") || &exit_err("Unable to open SAT output file\n"); while(<SATF>) { chomp; if (m/UNSAT/) { $outcome = 0; last; } elsif (m/SAT/) { $outcome = 1; } else { $assign = $_; last; } } if ($outcome < 0) { &exit_err("Invalid SAT solver outcome??\n"); } close SATF; } return ($outcome, $assign); } # Compute unsat core; can apply cl filt sub compute_core() { my ($corefile, $clset) = @_; my $coreref = &parse_core_file($corefile); if (${$opts}{d}) { $"="\n"; print DBGF "CORE:\n@{$coreref}\n"; $"=' '; "Num cls in core: $#{$coreref}\n"; } return $coreref; } # Compute all clauses in unsat core sub parse_core_file() { my $corefile = shift; my @corecls = (); open (COREF, "<$corefile") || &exit_err("Unable to open core file $corefile\n"); while(<COREF>) { chomp; next if (m/^c /); next if (m/p cnf/); my @clits = split('\s+'); if ($clits[0] eq '') { shift @clits; } if ($clits[$#clits] eq '') { pop @clits; } my $nclref = &CLUTILS::clsig(\@clits); push @corecls, $nclref; } if (${$opts}{d}) { $" = "\n"; print DBGF "CORECLS: @corecls\n"; $" = ' '; } close COREF; return \@corecls; } sub extract_core_fromclset() { my ($coreref, $clset) = @_; # ref to array; object $clset->del_cl_set($coreref); } sub compute_blocking_vars() { # Identify set of bocking vars my ($coreref, $blockvs) = @_; # ref to array, ref to array if (${$opts}{d}) { my $ncs = $#{$coreref} + 1; print DBGF "Number of cores: $ncs\n"; } foreach my $core (@{$coreref}) { if (${$opts}{d}) { print DBGF "cls in core: $#{$core}\n"; } my $corecls = $#{$core}+1; # number of cls in core; for (my $i=0; $i<$corecls; ++$i) { my $nid = &IDGEN::gen_id(); ${$blockvs}{$nid} = 1; } } if (${$opts}{d}) { my @bvs = keys %{$blockvs}; print DBGF "Blocking vars: @bvs\n"; } } sub init_block_clause_set() { my ($bclset, $coreref, $blockvs) = @_; # object, ref to array, ref to hash my @auxbvs = keys %{$blockvs}; # get array of block vars from keys of hash if (${$opts}{d}) { print DBGF "Aux block vars: @auxbvs\n"; } foreach my $core (@{$coreref}) { my $corecls = $#{$core}+1; # number of cls in core; foreach my $corecl (@{$core}) { my $clits = &CLUTILS::cllits($corecl); if (${$opts}{d}) { print DBGF "CL LITS:: @{$clits}\n"; } my $nbv = pop @auxbvs; push @{$clits}, $nbv; push @{$clits}, 0; # terminate w/ 0 if (${$opts}{d}) { print DBGF "CL LITS:: @{$clits}\n"; } my $clsig = &CLUTILS::clsig($clits); $bclset->add_cl($clsig, 'BLOCK'); if (${$opts}{d}) { print DBGF "Adding new cl: $clsig\n"; } } } } # Get original clauses in core, i.e. w/o blocking vars sub get_initial_clauses() { my ($coreref, $clset) = @_; my @initcls = (); foreach my $cl (@{$coreref}) { if ($clset->lkup_cl($cl)) { # If clause still exists in original clset push @initcls, $cl; if (${$opts}{d}) { print DBGF "$cl status is init\n"; } } elsif (${$opts}{d}) { print DBGF "$cl status is *not* init\n"; } } return \@initcls; } # Extract init cls form clause set sub extract_init_clauses() { my ($initref, $clset) = @_; # ref to array; object foreach my $cl (@{$initref}) { $clset->del_cl($cl); } } # Add blocking vars to set of original clauses sub add_blocking_vars() { my ($origcls, $bclset) = @_; foreach my $cl (@{$origcls}) { my $clits = &CLUTILS::cllits($cl); if (${$opts}{d}) { print DBGF "CL LITS:: @{$clits}\n"; } my $nid = &IDGEN::gen_id(); $blockvs{$nid} = 1; # register as blocking var push @{$clits}, $nid; push @{$clits}, 0; # terminate w/ 0 if (${$opts}{d}) { print DBGF "CL LITS:: @{$clits}\n"; } my $clsig = &CLUTILS::clsig($clits); $bclset->add_cl($clsig, 'BLOCK'); if (${$opts}{d}) { print DBGF "Adding new cl: $clsig\n"; } } } # Generate cardinality constraint sub gen_card_constraint() { my ($bvref, $tval) = @_; my @auxbvs = keys %{$bvref}; my $cardset = CLSET->new(); if (${$opts}{d}) { print DBGF "Generating card set for @auxbvs w/ rhs $tval\n"; } my $clstr = &CARD::gen_atmostN(\@auxbvs, $tval); my @newcls = split("\n", $clstr); for(my $i=0; $i<=$#newcls; $i++) { my @clits = split('\s+', $newcls[$i]); $newcls[$i] = &CLUTILS::clsig(\@clits); } if (${$opts}{d}) { $"=', '; print DBGF "NEW CLS:\n@newcls\n"; $"=' '; } $cardset->add_cl_set(\@newcls, 'AUX'); return $cardset; } END { } 1; # jpms ###############################################################################
pmatos/maxsatzilla
solvers/msuncore/src/msu4.pm
Perl
gpl-3.0
12,227
//#if defined(SEQUENCEDIAGRAM) //@#$LPS-SEQUENCEDIAGRAM:GranularityType:Package // $Id: SequenceDiagramRenderer.java 127 2010-09-25 22:23:13Z marcusvnac $ // Copyright (c) 1996-2007 The Regents of the University of California. All // Rights Reserved. Permission to use, copy, modify, and distribute this // software and its documentation without fee, and without a written // agreement is hereby granted, provided that the above copyright notice // and this paragraph appear in all copies. This software program and // documentation are copyrighted by The Regents of the University of // California. The software program and documentation are supplied "AS // IS", without any accompanying services from The Regents. The Regents // does not warrant that the operation of the program will be // uninterrupted or error-free. The end-user understands that the program // was developed for research purposes and is advised not to rely // exclusively on the program for any reason. IN NO EVENT SHALL THE // UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, // SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, // ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF // THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF // SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE // PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF // CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, // UPDATES, ENHANCEMENTS, OR MODIFICATIONS. package org.argouml.uml.diagram.sequence.ui; import java.awt.Rectangle; import java.util.Map; //#if defined(LOGGING) //@#$LPS-LOGGING:GranularityType:Import //@#$LPS-LOGGING:Localization:NestedIfdef-SEQUENCEDIAGRAM import org.apache.log4j.Logger; //#endif import org.argouml.model.Model; import org.argouml.uml.CommentEdge; import org.argouml.uml.diagram.ArgoDiagram; import org.argouml.uml.diagram.DiagramSettings; import org.argouml.uml.diagram.UmlDiagramRenderer; import org.argouml.uml.diagram.static_structure.ui.FigComment; import org.argouml.uml.diagram.static_structure.ui.FigEdgeNote; import org.tigris.gef.base.Layer; import org.tigris.gef.base.LayerPerspective; import org.tigris.gef.graph.GraphModel; import org.tigris.gef.presentation.FigEdge; import org.tigris.gef.presentation.FigNode; /** * This class renders a sequence diagram. * * * @author 5eichler */ public class SequenceDiagramRenderer extends UmlDiagramRenderer { private static final long serialVersionUID = -5460387717430613088L; //#if defined(LOGGING) //@#$LPS-LOGGING:GranularityType:Field //@#$LPS-LOGGING:Localization:NestedIfdef-SEQUENCEDIAGRAM /** * Logger. */ private static final Logger LOG = Logger.getLogger(SequenceDiagramRenderer.class); //#endif /* * @see org.tigris.gef.graph.GraphNodeRenderer#getFigNodeFor( * org.tigris.gef.graph.GraphModel, org.tigris.gef.base.Layer, * java.lang.Object, java.util.Map) */ public FigNode getFigNodeFor(GraphModel gm, Layer lay, Object node, Map styleAttributes) { FigNode result = null; assert lay instanceof LayerPerspective; ArgoDiagram diag = (ArgoDiagram) ((LayerPerspective) lay).getDiagram(); DiagramSettings settings = diag.getDiagramSettings(); if (Model.getFacade().isAClassifierRole(node)) { result = new FigClassifierRole(node); // result = new FigClassifierRole(node, (Rectangle) null, settings); } else if (Model.getFacade().isAComment(node)) { result = new FigComment(node, (Rectangle) null, settings); } //#if defined(LOGGING) //@#$LPS-LOGGING:GranularityType:Statement //@#$LPS-LOGGING:Localization:BeforeReturn //@#$LPS-LOGGING:Localization:NestedIfdef-SEQUENCEDIAGRAM LOG.debug("SequenceDiagramRenderer getFigNodeFor " + result); //#endif return result; } /* * @see org.tigris.gef.graph.GraphEdgeRenderer#getFigEdgeFor( * org.tigris.gef.graph.GraphModel, org.tigris.gef.base.Layer, * java.lang.Object, java.util.Map) */ public FigEdge getFigEdgeFor(GraphModel gm, Layer lay, Object edge, Map styleAttributes) { FigEdge figEdge = null; assert lay instanceof LayerPerspective; ArgoDiagram diag = (ArgoDiagram) ((LayerPerspective) lay).getDiagram(); DiagramSettings settings = diag.getDiagramSettings(); if (edge instanceof CommentEdge) { figEdge = new FigEdgeNote(edge, settings); } else { figEdge = getFigEdgeFor(edge, styleAttributes); } lay.add(figEdge); return figEdge; } /* * @see org.tigris.gef.graph.GraphEdgeRenderer#getFigEdgeFor( * org.tigris.gef.graph.GraphModel, org.tigris.gef.base.Layer, * java.lang.Object, java.util.Map) */ @Override public FigEdge getFigEdgeFor(Object edge, Map styleAttributes) { if (edge == null) { throw new IllegalArgumentException("A model edge must be supplied"); } if (Model.getFacade().isAMessage(edge)) { Object action = Model.getFacade().getAction(edge); FigEdge result = null; if (Model.getFacade().isACallAction(action)) { result = new FigCallActionMessage(edge); } else if (Model.getFacade().isAReturnAction(action)) { result = new FigReturnActionMessage(edge); } else if (Model.getFacade().isADestroyAction(action)) { result = new FigDestroyActionMessage(edge); } else if (Model.getFacade().isACreateAction(action)) { result = new FigCreateActionMessage(edge); } return result; } throw new IllegalArgumentException("Failed to construct a FigEdge for " + edge); } } //#endif
ckaestne/LEADT
workspace/argouml_critics/argouml-app/src/org/argouml/uml/diagram/sequence/ui/SequenceDiagramRenderer.java
Java
gpl-3.0
6,319
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><title>R: Tools for Parsing and Generating XML Within R and S-Plus</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <h1> Tools for Parsing and Generating XML Within R and S-Plus <img class="toplogo" src="../../../doc/html/logo.jpg" alt="[R logo]" /> </h1> <hr/> <div style="text-align: center;"> <a href="../../../doc/html/packages.html"><img class="arrow" src="../../../doc/html/left.jpg" alt="[Up]" /></a> <a href="../../../doc/html/index.html"><img class="arrow" src="../../../doc/html/up.jpg" alt="[Top]" /></a> </div><h2>Documentation for package &lsquo;XML&rsquo; version 3.98-1.3</h2> <ul><li><a href="../DESCRIPTION">DESCRIPTION file</a>.</li> </ul> <h2>Help Pages</h2> <p style="text-align: center;"> <a href="#A">A</a> <a href="#C">C</a> <a href="#D">D</a> <a href="#E">E</a> <a href="#F">F</a> <a href="#G">G</a> <a href="#H">H</a> <a href="#I">I</a> <a href="#L">L</a> <a href="#M">M</a> <a href="#N">N</a> <a href="#O">O</a> <a href="#P">P</a> <a href="#R">R</a> <a href="#S">S</a> <a href="#T">T</a> <a href="#U">U</a> <a href="#X">X</a> <a href="#misc">misc</a> </p> <h2><a name="A">-- A --</a></h2> <table width="100%"> <tr><td style="width: 25%;"><a href="addChildren.html">addAttributes</a></td> <td>Add child nodes to an XML node</td></tr> <tr><td style="width: 25%;"><a href="addChildren.html">addAttributes-method</a></td> <td>Add child nodes to an XML node</td></tr> <tr><td style="width: 25%;"><a href="addChildren.html">addChildren</a></td> <td>Add child nodes to an XML node</td></tr> <tr><td style="width: 25%;"><a href="addChildren.html">addChildren-method</a></td> <td>Add child nodes to an XML node</td></tr> <tr><td style="width: 25%;"><a href="addNode.html">addNode</a></td> <td>Add a node to a tree</td></tr> <tr><td style="width: 25%;"><a href="addNode.html">addNode.XMLHashTree</a></td> <td>Add a node to a tree</td></tr> <tr><td style="width: 25%;"><a href="addSibling.html">addSibling</a></td> <td>Manipulate sibling XML nodes</td></tr> <tr><td style="width: 25%;"><a href="append.XMLNode.html">append.XMLNode</a></td> <td>Add children to an XML node</td></tr> <tr><td style="width: 25%;"><a href="append.XMLNode.html">append.xmlNode</a></td> <td>Add children to an XML node</td></tr> <tr><td style="width: 25%;"><a href="asXMLNode.html">asXMLNode</a></td> <td>Converts non-XML node objects to XMLTextNode objects</td></tr> <tr><td style="width: 25%;"><a href="asXMLTreeNode.html">asXMLTreeNode</a></td> <td>Convert a regular XML node to one for use in a "flat" tree</td></tr> </table> <h2><a name="C">-- C --</a></h2> <table width="100%"> <tr><td style="width: 25%;"><a href="catalogs.html">catalogAdd</a></td> <td>Manipulate XML catalog contents</td></tr> <tr><td style="width: 25%;"><a href="catalogs.html">catalogClearTable</a></td> <td>Manipulate XML catalog contents</td></tr> <tr><td style="width: 25%;"><a href="catalogs.html">catalogDump</a></td> <td>Manipulate XML catalog contents</td></tr> <tr><td style="width: 25%;"><a href="catalogs.html">catalogLoad</a></td> <td>Manipulate XML catalog contents</td></tr> <tr><td style="width: 25%;"><a href="catalogResolve.html">catalogResolve</a></td> <td>Look up an element via the XML catalog mechanism</td></tr> <tr><td style="width: 25%;"><a href="Doctype.html">coerce-method</a></td> <td>Constructor for DTD reference</td></tr> <tr><td style="width: 25%;"><a href="XMLCodeFile-class.html">coerce-method</a></td> <td>Simple classes for identifying an XML document containing R code</td></tr> <tr><td style="width: 25%;"><a href="XMLInternalDocument.html">coerce-method</a></td> <td>Class to represent reference to C-level data structure for an XML document</td></tr> <tr><td style="width: 25%;"><a href="XMLNode-class.html">coerce-method</a></td> <td>Classes to describe an XML node object.</td></tr> <tr><td style="width: 25%;"><a href="asXMLNode.html">coerce-method</a></td> <td>Converts non-XML node objects to XMLTextNode objects</td></tr> <tr><td style="width: 25%;"><a href="coerce.html">coerce-method</a></td> <td>Transform between XML representations</td></tr> <tr><td style="width: 25%;"><a href="newXMLDoc.html">coerce-method</a></td> <td>Create internal XML node or document object</td></tr> <tr><td style="width: 25%;"><a href="parseURI.html">coerce-method</a></td> <td>Parse a URI string into its elements</td></tr> <tr><td style="width: 25%;"><a href="readHTMLTable.html">coerce-method</a></td> <td>Read data from one or more HTML tables</td></tr> <tr><td style="width: 25%;"><a href="saveXML.html">coerce-method</a></td> <td>Output internal XML Tree</td></tr> <tr><td style="width: 25%;"><a href="schema-class.html">coerce-method</a></td> <td>Classes for working with XML Schema</td></tr> <tr><td style="width: 25%;"><a href="xmlNamespaceDefinitions.html">coerce-method</a></td> <td>Get definitions of any namespaces defined in this XML node</td></tr> <tr><td style="width: 25%;"><a href="xmlSearchNs.html">coerce-method</a></td> <td>Find a namespace definition object by searching ancestor nodes</td></tr> <tr><td style="width: 25%;"><a href="xmlValue.html">coerce-method</a></td> <td>Extract or set the contents of a leaf XML node</td></tr> <tr><td style="width: 25%;"><a href="SAXMethods.html">comment.SAX</a></td> <td>Generic Methods for SAX callbacks</td></tr> <tr><td style="width: 25%;"><a href="SAXMethods.html">comment.SAX-method</a></td> <td>Generic Methods for SAX callbacks</td></tr> <tr><td style="width: 25%;"><a href="xmlParseDoc.html">COMPACT</a></td> <td>Parse an XML document with options controlling the parser.</td></tr> <tr><td style="width: 25%;"><a href="compareXMLDocs.html">compareXMLDocs</a></td> <td>Indicate differences between two XML documents</td></tr> </table> <h2><a name="D">-- D --</a></h2> <table width="100%"> <tr><td style="width: 25%;"><a href="docName.html">docName</a></td> <td>Accessors for name of XML document</td></tr> <tr><td style="width: 25%;"><a href="docName.html">docName-method</a></td> <td>Accessors for name of XML document</td></tr> <tr><td style="width: 25%;"><a href="docName.html">docName&lt;-</a></td> <td>Accessors for name of XML document</td></tr> <tr><td style="width: 25%;"><a href="docName.html">docName&lt;--method</a></td> <td>Accessors for name of XML document</td></tr> <tr><td style="width: 25%;"><a href="Doctype.html">Doctype</a></td> <td>Constructor for DTD reference</td></tr> <tr><td style="width: 25%;"><a href="Doctype-class.html">Doctype-class</a></td> <td>Class to describe a reference to an XML DTD</td></tr> <tr><td style="width: 25%;"><a href="xmlParseDoc.html">DTDATTR</a></td> <td>Parse an XML document with options controlling the parser.</td></tr> <tr><td style="width: 25%;"><a href="dtdElement.html">dtdElement</a></td> <td>Gets the definition of an element or entity from a DTD.</td></tr> <tr><td style="width: 25%;"><a href="dtdElementValidEntry.html">dtdElementValidEntry</a></td> <td>Determines whether an XML element allows a particular type of sub-element.</td></tr> <tr><td style="width: 25%;"><a href="dtdElementValidEntry.html">dtdElementValidEntry.character</a></td> <td>Determines whether an XML element allows a particular type of sub-element.</td></tr> <tr><td style="width: 25%;"><a href="dtdElementValidEntry.html">dtdElementValidEntry.XMLElementContent</a></td> <td>Determines whether an XML element allows a particular type of sub-element.</td></tr> <tr><td style="width: 25%;"><a href="dtdElementValidEntry.html">dtdElementValidEntry.XMLElementDef</a></td> <td>Determines whether an XML element allows a particular type of sub-element.</td></tr> <tr><td style="width: 25%;"><a href="dtdElementValidEntry.html">dtdElementValidEntry.XMLOrContent</a></td> <td>Determines whether an XML element allows a particular type of sub-element.</td></tr> <tr><td style="width: 25%;"><a href="dtdElementValidEntry.html">dtdElementValidEntry.XMLSequenceContent</a></td> <td>Determines whether an XML element allows a particular type of sub-element.</td></tr> <tr><td style="width: 25%;"><a href="dtdElement.html">dtdEntity</a></td> <td>Gets the definition of an element or entity from a DTD.</td></tr> <tr><td style="width: 25%;"><a href="dtdIsAttribute.html">dtdIsAttribute</a></td> <td>Query if a name is a valid attribute of a DTD element.</td></tr> <tr><td style="width: 25%;"><a href="xmlParseDoc.html">DTDLOAD</a></td> <td>Parse an XML document with options controlling the parser.</td></tr> <tr><td style="width: 25%;"><a href="xmlParseDoc.html">DTDVALID</a></td> <td>Parse an XML document with options controlling the parser.</td></tr> <tr><td style="width: 25%;"><a href="dtdValidElement.html">dtdValidElement</a></td> <td>Determines whether an XML tag is valid within another.</td></tr> </table> <h2><a name="E">-- E --</a></h2> <table width="100%"> <tr><td style="width: 25%;"><a href="SAXMethods.html">endElement.SAX</a></td> <td>Generic Methods for SAX callbacks</td></tr> <tr><td style="width: 25%;"><a href="SAXMethods.html">endElement.SAX-method</a></td> <td>Generic Methods for SAX callbacks</td></tr> <tr><td style="width: 25%;"><a href="ensureNamespace.html">ensureNamespace</a></td> <td>Ensure that the node has a definition for particular XML namespaces</td></tr> <tr><td style="width: 25%;"><a href="SAXMethods.html">entityDeclaration.SAX</a></td> <td>Generic Methods for SAX callbacks</td></tr> <tr><td style="width: 25%;"><a href="SAXMethods.html">entityDeclaration.SAX-method</a></td> <td>Generic Methods for SAX callbacks</td></tr> <tr><td style="width: 25%;"><a href="schema-class.html">ExternalReference-class</a></td> <td>Classes for working with XML Schema</td></tr> </table> <h2><a name="F">-- F --</a></h2> <table width="100%"> <tr><td style="width: 25%;"><a href="findXInclude.html">findXInclude</a></td> <td>Find the XInclude node associated with an XML node</td></tr> <tr><td style="width: 25%;"><a href="readHTMLTable.html">FormattedInteger-class</a></td> <td>Read data from one or more HTML tables</td></tr> <tr><td style="width: 25%;"><a href="readHTMLTable.html">FormattedNumber-class</a></td> <td>Read data from one or more HTML tables</td></tr> <tr><td style="width: 25%;"><a href="free.html">free</a></td> <td>Release the specified object and clean up its memory usage</td></tr> <tr><td style="width: 25%;"><a href="free.html">free-method</a></td> <td>Release the specified object and clean up its memory usage</td></tr> </table> <h2><a name="G">-- G --</a></h2> <table width="100%"> <tr><td style="width: 25%;"><a href="genericSAXHandlers.html">genericSAXHandlers</a></td> <td>SAX generic callback handler list</td></tr> <tr><td style="width: 25%;"><a href="getChildrenStrings.html">getChildrenStrings</a></td> <td>Get the individual</td></tr> <tr><td style="width: 25%;"><a href="xmlNamespaceDefinitions.html">getDefaultNamespace</a></td> <td>Get definitions of any namespaces defined in this XML node</td></tr> <tr><td style="width: 25%;"><a href="getEncoding.html">getEncoding</a></td> <td>Determines the encoding for an XML document or node</td></tr> <tr><td style="width: 25%;"><a href="getEncoding.html">getEncoding-method</a></td> <td>Determines the encoding for an XML document or node</td></tr> <tr><td style="width: 25%;"><a href="getHTMLLinks.html">getHTMLExternalFiles</a></td> <td>Get links or names of external files in HTML document</td></tr> <tr><td style="width: 25%;"><a href="getHTMLLinks.html">getHTMLLinks</a></td> <td>Get links or names of external files in HTML document</td></tr> <tr><td style="width: 25%;"><a href="getLineNumber.html">getLineNumber</a></td> <td>Determine the location - file &amp; line number of an (internal) XML node</td></tr> <tr><td style="width: 25%;"><a href="getLineNumber.html">getNodeLocation</a></td> <td>Determine the location - file &amp; line number of an (internal) XML node</td></tr> <tr><td style="width: 25%;"><a href="getLineNumber.html">getNodePosition</a></td> <td>Determine the location - file &amp; line number of an (internal) XML node</td></tr> <tr><td style="width: 25%;"><a href="getNodeSet.html">getNodeSet</a></td> <td>Find matching nodes in an internal XML tree/DOM</td></tr> <tr><td style="width: 25%;"><a href="getRelativeURL.html">getRelativeURL</a></td> <td>Compute name of URL relative to a base URL</td></tr> <tr><td style="width: 25%;"><a href="addSibling.html">getSibling</a></td> <td>Manipulate sibling XML nodes</td></tr> <tr><td style="width: 25%;"><a href="getXIncludes.html">getXIncludes</a></td> <td>Find the documents that are XInclude'd in an XML document</td></tr> <tr><td style="width: 25%;"><a href="getXMLErrors.html">getXMLErrors</a></td> <td>Get XML/HTML document parse errors</td></tr> </table> <h2><a name="H">-- H --</a></h2> <table width="100%"> <tr><td style="width: 25%;"><a href="XMLInternalDocument.html">HTMLInternalDocument-class</a></td> <td>Class to represent reference to C-level data structure for an XML document</td></tr> <tr><td style="width: 25%;"><a href="xmlTreeParse.html">htmlParse</a></td> <td>XML Parser</td></tr> <tr><td style="width: 25%;"><a href="xmlTreeParse.html">htmlTreeParse</a></td> <td>XML Parser</td></tr> <tr><td style="width: 25%;"><a href="xmlParseDoc.html">HUGE</a></td> <td>Parse an XML document with options controlling the parser.</td></tr> </table> <h2><a name="I">-- I --</a></h2> <table width="100%"> <tr><td style="width: 25%;"><a href="isXMLString.html">isXMLString</a></td> <td>Facilities for working with XML strings</td></tr> </table> <h2><a name="L">-- L --</a></h2> <table width="100%"> <tr><td style="width: 25%;"><a href="length.XMLNode.html">length.XMLNode</a></td> <td>Determine the number of children in an XMLNode object.</td></tr> <tr><td style="width: 25%;"><a href="libxmlVersion.html">libxmlFeatures</a></td> <td>Query the version and available features of the libxml library.</td></tr> <tr><td style="width: 25%;"><a href="schema-class.html">libxmlTypeTable-class</a></td> <td>Classes for working with XML Schema</td></tr> <tr><td style="width: 25%;"><a href="libxmlVersion.html">libxmlVersion</a></td> <td>Query the version and available features of the libxml library.</td></tr> </table> <h2><a name="M">-- M --</a></h2> <table width="100%"> <tr><td style="width: 25%;"><a href="makeClassTemplate.html">makeClassTemplate</a></td> <td>Create S4 class definition based on XML node(s)</td></tr> <tr><td style="width: 25%;"><a href="getNodeSet.html">matchNamespaces</a></td> <td>Find matching nodes in an internal XML tree/DOM</td></tr> </table> <h2><a name="N">-- N --</a></h2> <table width="100%"> <tr><td style="width: 25%;"><a href="schema-class.html">names-method</a></td> <td>Classes for working with XML Schema</td></tr> <tr><td style="width: 25%;"><a href="names.XMLNode.html">names.XMLNode</a></td> <td>Get the names of an XML nodes children.</td></tr> <tr><td style="width: 25%;"><a href="newXMLDoc.html">newHTMLDoc</a></td> <td>Create internal XML node or document object</td></tr> <tr><td style="width: 25%;"><a href="newXMLDoc.html">newXMLCDataNode</a></td> <td>Create internal XML node or document object</td></tr> <tr><td style="width: 25%;"><a href="newXMLDoc.html">newXMLCommentNode</a></td> <td>Create internal XML node or document object</td></tr> <tr><td style="width: 25%;"><a href="newXMLDoc.html">newXMLDoc</a></td> <td>Create internal XML node or document object</td></tr> <tr><td style="width: 25%;"><a href="newXMLDoc.html">newXMLDTDNode</a></td> <td>Create internal XML node or document object</td></tr> <tr><td style="width: 25%;"><a href="newXMLNamespace.html">newXMLNamespace</a></td> <td>Add a namespace definition to an XML node</td></tr> <tr><td style="width: 25%;"><a href="newXMLDoc.html">newXMLNode</a></td> <td>Create internal XML node or document object</td></tr> <tr><td style="width: 25%;"><a href="newXMLDoc.html">newXMLPINode</a></td> <td>Create internal XML node or document object</td></tr> <tr><td style="width: 25%;"><a href="newXMLDoc.html">newXMLTextNode</a></td> <td>Create internal XML node or document object</td></tr> <tr><td style="width: 25%;"><a href="xmlParseDoc.html">NOBASEFIX</a></td> <td>Parse an XML document with options controlling the parser.</td></tr> <tr><td style="width: 25%;"><a href="xmlParseDoc.html">NOBLANKS</a></td> <td>Parse an XML document with options controlling the parser.</td></tr> <tr><td style="width: 25%;"><a href="xmlParseDoc.html">NOCDATA</a></td> <td>Parse an XML document with options controlling the parser.</td></tr> <tr><td style="width: 25%;"><a href="xmlParseDoc.html">NODICT</a></td> <td>Parse an XML document with options controlling the parser.</td></tr> <tr><td style="width: 25%;"><a href="xmlParseDoc.html">NOENT</a></td> <td>Parse an XML document with options controlling the parser.</td></tr> <tr><td style="width: 25%;"><a href="xmlParseDoc.html">NOERROR</a></td> <td>Parse an XML document with options controlling the parser.</td></tr> <tr><td style="width: 25%;"><a href="xmlParseDoc.html">NONET</a></td> <td>Parse an XML document with options controlling the parser.</td></tr> <tr><td style="width: 25%;"><a href="xmlParseDoc.html">NOWARNING</a></td> <td>Parse an XML document with options controlling the parser.</td></tr> <tr><td style="width: 25%;"><a href="xmlParseDoc.html">NOXINCNODE</a></td> <td>Parse an XML document with options controlling the parser.</td></tr> <tr><td style="width: 25%;"><a href="xmlParseDoc.html">NSCLEAN</a></td> <td>Parse an XML document with options controlling the parser.</td></tr> </table> <h2><a name="O">-- O --</a></h2> <table width="100%"> <tr><td style="width: 25%;"><a href="xmlParseDoc.html">OLD10</a></td> <td>Parse an XML document with options controlling the parser.</td></tr> <tr><td style="width: 25%;"><a href="xmlParseDoc.html">OLDSAX</a></td> <td>Parse an XML document with options controlling the parser.</td></tr> </table> <h2><a name="P">-- P --</a></h2> <table width="100%"> <tr><td style="width: 25%;"><a href="parseDTD.html">parseDTD</a></td> <td>Read a Document Type Definition (DTD)</td></tr> <tr><td style="width: 25%;"><a href="parseURI.html">parseURI</a></td> <td>Parse a URI string into its elements</td></tr> <tr><td style="width: 25%;"><a href="parseXMLAndAdd.html">parseXMLAndAdd</a></td> <td>Parse XML content and add it to a node</td></tr> <tr><td style="width: 25%;"><a href="xmlParseDoc.html">PEDANTIC</a></td> <td>Parse an XML document with options controlling the parser.</td></tr> <tr><td style="width: 25%;"><a href="readHTMLTable.html">Percent-class</a></td> <td>Read data from one or more HTML tables</td></tr> <tr><td style="width: 25%;"><a href="print.html">print.XMLAttributeDef</a></td> <td>Methods for displaying XML objects</td></tr> <tr><td style="width: 25%;"><a href="print.html">print.XMLCDataNode</a></td> <td>Methods for displaying XML objects</td></tr> <tr><td style="width: 25%;"><a href="print.html">print.XMLComment</a></td> <td>Methods for displaying XML objects</td></tr> <tr><td style="width: 25%;"><a href="print.html">print.XMLElementContent</a></td> <td>Methods for displaying XML objects</td></tr> <tr><td style="width: 25%;"><a href="print.html">print.XMLElementDef</a></td> <td>Methods for displaying XML objects</td></tr> <tr><td style="width: 25%;"><a href="print.html">print.XMLEntity</a></td> <td>Methods for displaying XML objects</td></tr> <tr><td style="width: 25%;"><a href="print.html">print.XMLEntityRef</a></td> <td>Methods for displaying XML objects</td></tr> <tr><td style="width: 25%;"><a href="print.html">print.XMLNode</a></td> <td>Methods for displaying XML objects</td></tr> <tr><td style="width: 25%;"><a href="print.html">print.XMLOrContent</a></td> <td>Methods for displaying XML objects</td></tr> <tr><td style="width: 25%;"><a href="print.html">print.XMLProcessingInstruction</a></td> <td>Methods for displaying XML objects</td></tr> <tr><td style="width: 25%;"><a href="print.html">print.XMLSequenceContent</a></td> <td>Methods for displaying XML objects</td></tr> <tr><td style="width: 25%;"><a href="print.html">print.XMLTextNode</a></td> <td>Methods for displaying XML objects</td></tr> <tr><td style="width: 25%;"><a href="SAXMethods.html">processingInstruction.SAX</a></td> <td>Generic Methods for SAX callbacks</td></tr> <tr><td style="width: 25%;"><a href="SAXMethods.html">processingInstruction.SAX-method</a></td> <td>Generic Methods for SAX callbacks</td></tr> <tr><td style="width: 25%;"><a href="processXInclude.html">processXInclude</a></td> <td>Perform the XInclude substitutions</td></tr> <tr><td style="width: 25%;"><a href="processXInclude.html">processXInclude.list</a></td> <td>Perform the XInclude substitutions</td></tr> <tr><td style="width: 25%;"><a href="processXInclude.html">processXInclude.XMLInternalDocument</a></td> <td>Perform the XInclude substitutions</td></tr> <tr><td style="width: 25%;"><a href="processXInclude.html">processXInclude.XMLInternalElement</a></td> <td>Perform the XInclude substitutions</td></tr> </table> <h2><a name="R">-- R --</a></h2> <table width="100%"> <tr><td style="width: 25%;"><a href="readHTMLList.html">readHTMLList</a></td> <td>Read data in an HTML list or all lists in a document</td></tr> <tr><td style="width: 25%;"><a href="readHTMLList.html">readHTMLList-method</a></td> <td>Read data in an HTML list or all lists in a document</td></tr> <tr><td style="width: 25%;"><a href="readHTMLTable.html">readHTMLTable</a></td> <td>Read data from one or more HTML tables</td></tr> <tr><td style="width: 25%;"><a href="readHTMLTable.html">readHTMLTable-method</a></td> <td>Read data from one or more HTML tables</td></tr> <tr><td style="width: 25%;"><a href="readKeyValueDB.html">readKeyValueDB</a></td> <td>Read an XML property-list style document</td></tr> <tr><td style="width: 25%;"><a href="readKeyValueDB.html">readKeyValueDB-method</a></td> <td>Read an XML property-list style document</td></tr> <tr><td style="width: 25%;"><a href="readSolrDoc.html">readSolrDoc</a></td> <td>Read the data from a Solr document</td></tr> <tr><td style="width: 25%;"><a href="readSolrDoc.html">readSolrDoc-method</a></td> <td>Read the data from a Solr document</td></tr> <tr><td style="width: 25%;"><a href="xmlParseDoc.html">RECOVER</a></td> <td>Parse an XML document with options controlling the parser.</td></tr> <tr><td style="width: 25%;"><a href="addChildren.html">removeAttributes</a></td> <td>Add child nodes to an XML node</td></tr> <tr><td style="width: 25%;"><a href="addChildren.html">removeAttributes-method</a></td> <td>Add child nodes to an XML node</td></tr> <tr><td style="width: 25%;"><a href="addChildren.html">removeChildren</a></td> <td>Add child nodes to an XML node</td></tr> <tr><td style="width: 25%;"><a href="addChildren.html">removeNodes</a></td> <td>Add child nodes to an XML node</td></tr> <tr><td style="width: 25%;"><a href="addChildren.html">removeNodes.list</a></td> <td>Add child nodes to an XML node</td></tr> <tr><td style="width: 25%;"><a href="addChildren.html">removeNodes.XMLInternalNode</a></td> <td>Add child nodes to an XML node</td></tr> <tr><td style="width: 25%;"><a href="addChildren.html">removeNodes.XMLNodeList</a></td> <td>Add child nodes to an XML node</td></tr> <tr><td style="width: 25%;"><a href="addChildren.html">removeNodes.XMLNodeSet</a></td> <td>Add child nodes to an XML node</td></tr> <tr><td style="width: 25%;"><a href="removeXMLNamespaces.html">removeXMLNamespaces</a></td> <td>Remove namespace definitions from a XML node or document</td></tr> <tr><td style="width: 25%;"><a href="removeXMLNamespaces.html">removeXMLNamespaces-method</a></td> <td>Remove namespace definitions from a XML node or document</td></tr> <tr><td style="width: 25%;"><a href="addChildren.html">replaceNodes</a></td> <td>Add child nodes to an XML node</td></tr> <tr><td style="width: 25%;"><a href="XMLNode-class.html">RXMLNode-class</a></td> <td>Classes to describe an XML node object.</td></tr> </table> <h2><a name="S">-- S --</a></h2> <table width="100%"> <tr><td style="width: 25%;"><a href="saveXML.html">saveXML</a></td> <td>Output internal XML Tree</td></tr> <tr><td style="width: 25%;"><a href="saveXML.html">saveXML-method</a></td> <td>Output internal XML Tree</td></tr> <tr><td style="width: 25%;"><a href="saveXML.html">saveXML.XMLInternalDocument</a></td> <td>Output internal XML Tree</td></tr> <tr><td style="width: 25%;"><a href="saveXML.html">saveXML.XMLInternalDOM</a></td> <td>Output internal XML Tree</td></tr> <tr><td style="width: 25%;"><a href="saveXML.html">saveXML.XMLInternalNode</a></td> <td>Output internal XML Tree</td></tr> <tr><td style="width: 25%;"><a href="saveXML.html">saveXML.XMLNode</a></td> <td>Output internal XML Tree</td></tr> <tr><td style="width: 25%;"><a href="saveXML.html">saveXML.XMLOutputStream</a></td> <td>Output internal XML Tree</td></tr> <tr><td style="width: 25%;"><a href="xmlParseDoc.html">SAX1</a></td> <td>Parse an XML document with options controlling the parser.</td></tr> <tr><td style="width: 25%;"><a href="SAXState-class.html">SAXState-class</a></td> <td>A virtual base class defining methods for SAX parsing</td></tr> <tr><td style="width: 25%;"><a href="schema-class.html">SchemaAttributeGroupTable-class</a></td> <td>Classes for working with XML Schema</td></tr> <tr><td style="width: 25%;"><a href="schema-class.html">SchemaAttributeTable-class</a></td> <td>Classes for working with XML Schema</td></tr> <tr><td style="width: 25%;"><a href="schema-class.html">SchemaElementTable-class</a></td> <td>Classes for working with XML Schema</td></tr> <tr><td style="width: 25%;"><a href="schema-class.html">SchemaNotationTable-class</a></td> <td>Classes for working with XML Schema</td></tr> <tr><td style="width: 25%;"><a href="schema-class.html">SchemaTypeTable-class</a></td> <td>Classes for working with XML Schema</td></tr> <tr><td style="width: 25%;"><a href="xmlSchemaValidate.html">schemaValidationErrorHandler</a></td> <td>Validate an XML document relative to an XML schema</td></tr> <tr><td style="width: 25%;"><a href="setXMLNamespace.html">setXMLNamespace</a></td> <td>Set the name space on a node</td></tr> <tr><td style="width: 25%;"><a href="XMLAttributes-class.html">show-method</a></td> <td>Class '"XMLAttributes"'</td></tr> <tr><td style="width: 25%;"><a href="schema-class.html">show-method</a></td> <td>Classes for working with XML Schema</td></tr> <tr><td style="width: 25%;"><a href="XMLCodeFile-class.html">source-method</a></td> <td>Simple classes for identifying an XML document containing R code</td></tr> <tr><td style="width: 25%;"><a href="SAXMethods.html">startElement.SAX</a></td> <td>Generic Methods for SAX callbacks</td></tr> <tr><td style="width: 25%;"><a href="SAXMethods.html">startElement.SAX-method</a></td> <td>Generic Methods for SAX callbacks</td></tr> <tr><td style="width: 25%;"><a href="supportsExpat.html">supportsExpat</a></td> <td>Determines which native XML parsers are being used.</td></tr> <tr><td style="width: 25%;"><a href="supportsExpat.html">supportsLibxml</a></td> <td>Determines which native XML parsers are being used.</td></tr> </table> <h2><a name="T">-- T --</a></h2> <table width="100%"> <tr><td style="width: 25%;"><a href="SAXMethods.html">text.SAX</a></td> <td>Generic Methods for SAX callbacks</td></tr> <tr><td style="width: 25%;"><a href="SAXMethods.html">text.SAX-method</a></td> <td>Generic Methods for SAX callbacks</td></tr> <tr><td style="width: 25%;"><a href="toHTML.html">toHTML</a></td> <td>Create an HTML representation of the given R object, using internal C-level nodes</td></tr> <tr><td style="width: 25%;"><a href="toHTML.html">toHTML-method</a></td> <td>Create an HTML representation of the given R object, using internal C-level nodes</td></tr> <tr><td style="width: 25%;"><a href="toString.html">toString.XMLNode</a></td> <td>Creates string representation of XML node</td></tr> </table> <h2><a name="U">-- U --</a></h2> <table width="100%"> <tr><td style="width: 25%;"><a href="parseURI.html">URI-class</a></td> <td>Parse a URI string into its elements</td></tr> </table> <h2><a name="X">-- X --</a></h2> <table width="100%"> <tr><td style="width: 25%;"><a href="xmlParseDoc.html">XINCLUDE</a></td> <td>Parse an XML document with options controlling the parser.</td></tr> <tr><td style="width: 25%;"><a href="isXMLString.html">xml</a></td> <td>Facilities for working with XML strings</td></tr> <tr><td style="width: 25%;"><a href="XMLInternalDocument.html">XMLAbstractDocument-class</a></td> <td>Class to represent reference to C-level data structure for an XML document</td></tr> <tr><td style="width: 25%;"><a href="XMLNode-class.html">XMLAbstractNode-class</a></td> <td>Classes to describe an XML node object.</td></tr> <tr><td style="width: 25%;"><a href="xmlParent.html">xmlAncestors</a></td> <td>Get parent node of XMLInternalNode or ancestor nodes</td></tr> <tr><td style="width: 25%;"><a href="xmlApply.html">xmlApply</a></td> <td>Applies a function to each of the children of an XMLNode</td></tr> <tr><td style="width: 25%;"><a href="xmlApply.html">xmlApply.XMLDocument</a></td> <td>Applies a function to each of the children of an XMLNode</td></tr> <tr><td style="width: 25%;"><a href="xmlApply.html">xmlApply.XMLDocumentContent</a></td> <td>Applies a function to each of the children of an XMLNode</td></tr> <tr><td style="width: 25%;"><a href="xmlApply.html">xmlApply.XMLNode</a></td> <td>Applies a function to each of the children of an XMLNode</td></tr> <tr><td style="width: 25%;"><a href="XMLNode-class.html">XMLAttributeDeclNode-class</a></td> <td>Classes to describe an XML node object.</td></tr> <tr><td style="width: 25%;"><a href="XMLAttributes-class.html">XMLAttributes-class</a></td> <td>Class '"XMLAttributes"'</td></tr> <tr><td style="width: 25%;"><a href="xmlAttributeType.html">xmlAttributeType</a></td> <td>The type of an XML attribute for element from the DTD</td></tr> <tr><td style="width: 25%;"><a href="xmlAttrs.html">xmlAttrs</a></td> <td>Get the list of attributes of an XML node.</td></tr> <tr><td style="width: 25%;"><a href="xmlAttrs.html">xmlAttrs.XMLElementDef</a></td> <td>Get the list of attributes of an XML node.</td></tr> <tr><td style="width: 25%;"><a href="xmlAttrs.html">xmlAttrs.XMLInternalNode</a></td> <td>Get the list of attributes of an XML node.</td></tr> <tr><td style="width: 25%;"><a href="xmlAttrs.html">xmlAttrs.XMLNode</a></td> <td>Get the list of attributes of an XML node.</td></tr> <tr><td style="width: 25%;"><a href="xmlAttrs.html">xmlAttrs&lt;-</a></td> <td>Get the list of attributes of an XML node.</td></tr> <tr><td style="width: 25%;"><a href="xmlAttrs.html">xmlAttrs&lt;-,XMLInternalNode</a></td> <td>Get the list of attributes of an XML node.</td></tr> <tr><td style="width: 25%;"><a href="xmlAttrs.html">xmlAttrs&lt;-,XMLNode</a></td> <td>Get the list of attributes of an XML node.</td></tr> <tr><td style="width: 25%;"><a href="xmlAttrs.html">xmlAttrs&lt;--method</a></td> <td>Get the list of attributes of an XML node.</td></tr> <tr><td style="width: 25%;"><a href="xmlNode.html">xmlCDataNode</a></td> <td>Create an XML node</td></tr> <tr><td style="width: 25%;"><a href="xmlChildren.html">xmlChildren</a></td> <td>Gets the sub-nodes within an XMLNode object.</td></tr> <tr><td style="width: 25%;"><a href="xmlChildren.html">xmlChildren.XMLInternalDocument</a></td> <td>Gets the sub-nodes within an XMLNode object.</td></tr> <tr><td style="width: 25%;"><a href="xmlChildren.html">xmlChildren.XMLInternalNode</a></td> <td>Gets the sub-nodes within an XMLNode object.</td></tr> <tr><td style="width: 25%;"><a href="xmlChildren.html">xmlChildren.XMLNode</a></td> <td>Gets the sub-nodes within an XMLNode object.</td></tr> <tr><td style="width: 25%;"><a href="xmlChildren.html">xmlChildren&lt;-</a></td> <td>Gets the sub-nodes within an XMLNode object.</td></tr> <tr><td style="width: 25%;"><a href="xmlChildren.html">xmlChildren&lt;--method</a></td> <td>Gets the sub-nodes within an XMLNode object.</td></tr> <tr><td style="width: 25%;"><a href="xmlCleanNamespaces.html">xmlCleanNamespaces</a></td> <td>Remove redundant namespaces on an XML document</td></tr> <tr><td style="width: 25%;"><a href="xmlClone.html">xmlClone</a></td> <td>Create a copy of an internal XML document or node</td></tr> <tr><td style="width: 25%;"><a href="xmlClone.html">xmlClone-method</a></td> <td>Create a copy of an internal XML document or node</td></tr> <tr><td style="width: 25%;"><a href="XMLCodeFile-class.html">XMLCodeDoc-class</a></td> <td>Simple classes for identifying an XML document containing R code</td></tr> <tr><td style="width: 25%;"><a href="XMLCodeFile-class.html">xmlCodeFile</a></td> <td>Simple classes for identifying an XML document containing R code</td></tr> <tr><td style="width: 25%;"><a href="XMLCodeFile-class.html">XMLCodeFile-class</a></td> <td>Simple classes for identifying an XML document containing R code</td></tr> <tr><td style="width: 25%;"><a href="xmlNode.html">xmlCommentNode</a></td> <td>Create an XML node</td></tr> <tr><td style="width: 25%;"><a href="xmlContainsEntity.html">xmlContainsElement</a></td> <td>Checks if an entity is defined within a DTD.</td></tr> <tr><td style="width: 25%;"><a href="xmlContainsEntity.html">xmlContainsEntity</a></td> <td>Checks if an entity is defined within a DTD.</td></tr> <tr><td style="width: 25%;"><a href="xmlSerializeHook.html">xmlDeserializeHook</a></td> <td>Functions that help serialize and deserialize XML internal objects</td></tr> <tr><td style="width: 25%;"><a href="newXMLDoc.html">xmlDoc</a></td> <td>Create internal XML node or document object</td></tr> <tr><td style="width: 25%;"><a href="XMLNode-class.html">XMLDocumentFragNode-class</a></td> <td>Classes to describe an XML node object.</td></tr> <tr><td style="width: 25%;"><a href="XMLNode-class.html">XMLDocumentNode-class</a></td> <td>Classes to describe an XML node object.</td></tr> <tr><td style="width: 25%;"><a href="XMLNode-class.html">XMLDocumentTypeNode-class</a></td> <td>Classes to describe an XML node object.</td></tr> <tr><td style="width: 25%;"><a href="xmlDOMApply.html">xmlDOMApply</a></td> <td>Apply function to nodes in an XML tree/DOM.</td></tr> <tr><td style="width: 25%;"><a href="XMLNode-class.html">XMLDTDNode-class</a></td> <td>Classes to describe an XML node object.</td></tr> <tr><td style="width: 25%;"><a href="xmlElementsByTagName.html">xmlElementsByTagName</a></td> <td>Retrieve the children of an XML node with a specific tag name</td></tr> <tr><td style="width: 25%;"><a href="xmlElementSummary.html">xmlElementSummary</a></td> <td>Frequency table of names of elements and attributes in XML content</td></tr> <tr><td style="width: 25%;"><a href="XMLNode-class.html">XMLEntityDeclNode-class</a></td> <td>Classes to describe an XML node object.</td></tr> <tr><td style="width: 25%;"><a href="xmlStructuredStop.html">xmlErrorCumulator</a></td> <td>Condition/error handler functions for XML parsing</td></tr> <tr><td style="width: 25%;"><a href="xmlEventHandler.html">xmlEventHandler</a></td> <td>Default handlers for the SAX-style event XML parser</td></tr> <tr><td style="width: 25%;"><a href="xmlEventParse.html">xmlEventParse</a></td> <td>XML Event/Callback element-wise Parser</td></tr> <tr><td style="width: 25%;"><a href="xmlFlatListTree.html">xmlFlatListTree</a></td> <td>Constructors for trees stored as flat list of nodes with information about parents and children.</td></tr> <tr><td style="width: 25%;"><a href="xmlGetAttr.html">xmlGetAttr</a></td> <td>Get the value of an attribute in an XML node</td></tr> <tr><td style="width: 25%;"><a href="xmlHandler.html">xmlHandler</a></td> <td>Example XML Event Parser Handler Functions</td></tr> <tr><td style="width: 25%;"><a href="xmlFlatListTree.html">xmlHashTree</a></td> <td>Constructors for trees stored as flat list of nodes with information about parents and children.</td></tr> <tr><td style="width: 25%;"><a href="XMLNode-class.html">XMLInternalCDataNode-class</a></td> <td>Classes to describe an XML node object.</td></tr> <tr><td style="width: 25%;"><a href="XMLNode-class.html">XMLInternalCommentNode-class</a></td> <td>Classes to describe an XML node object.</td></tr> <tr><td style="width: 25%;"><a href="XMLInternalDocument.html">XMLInternalDocument-class</a></td> <td>Class to represent reference to C-level data structure for an XML document</td></tr> <tr><td style="width: 25%;"><a href="XMLNode-class.html">XMLInternalElementNode-class</a></td> <td>Classes to describe an XML node object.</td></tr> <tr><td style="width: 25%;"><a href="XMLNode-class.html">XMLInternalNode-class</a></td> <td>Classes to describe an XML node object.</td></tr> <tr><td style="width: 25%;"><a href="XMLNode-class.html">XMLInternalPINode-class</a></td> <td>Classes to describe an XML node object.</td></tr> <tr><td style="width: 25%;"><a href="XMLNode-class.html">XMLInternalTextNode-class</a></td> <td>Classes to describe an XML node object.</td></tr> <tr><td style="width: 25%;"><a href="xmlTreeParse.html">xmlInternalTreeParse</a></td> <td>XML Parser</td></tr> <tr><td style="width: 25%;"><a href="xmlName.html">xmlName</a></td> <td>Extraces the tag name of an XMLNode object.</td></tr> <tr><td style="width: 25%;"><a href="xmlName.html">xmlName.XMLComment</a></td> <td>Extraces the tag name of an XMLNode object.</td></tr> <tr><td style="width: 25%;"><a href="xmlName.html">xmlName.XMLInternalNode</a></td> <td>Extraces the tag name of an XMLNode object.</td></tr> <tr><td style="width: 25%;"><a href="xmlName.html">xmlName.XMLNode</a></td> <td>Extraces the tag name of an XMLNode object.</td></tr> <tr><td style="width: 25%;"><a href="xmlName.html">xmlName&lt;-</a></td> <td>Extraces the tag name of an XMLNode object.</td></tr> <tr><td style="width: 25%;"><a href="xmlNamespace.html">xmlNamespace</a></td> <td>Retrieve the namespace value of an XML node.</td></tr> <tr><td style="width: 25%;"><a href="xmlNamespace.html">XMLNamespace-class</a></td> <td>Retrieve the namespace value of an XML node.</td></tr> <tr><td style="width: 25%;"><a href="xmlNamespace.html">xmlNamespace.character</a></td> <td>Retrieve the namespace value of an XML node.</td></tr> <tr><td style="width: 25%;"><a href="xmlNamespace.html">xmlNamespace.XMLInternalNode</a></td> <td>Retrieve the namespace value of an XML node.</td></tr> <tr><td style="width: 25%;"><a href="xmlNamespace.html">xmlNamespace.XMLNode</a></td> <td>Retrieve the namespace value of an XML node.</td></tr> <tr><td style="width: 25%;"><a href="xmlNamespace.html">xmlNamespace&lt;-</a></td> <td>Retrieve the namespace value of an XML node.</td></tr> <tr><td style="width: 25%;"><a href="xmlNamespace.html">xmlNamespace&lt;--method</a></td> <td>Retrieve the namespace value of an XML node.</td></tr> <tr><td style="width: 25%;"><a href="XMLNode-class.html">XMLNamespaceDeclNode-class</a></td> <td>Classes to describe an XML node object.</td></tr> <tr><td style="width: 25%;"><a href="xmlNamespaceDefinitions.html">xmlNamespaceDefinitions</a></td> <td>Get definitions of any namespaces defined in this XML node</td></tr> <tr><td style="width: 25%;"><a href="XMLNode-class.html">XMLNamespaceDefinitions-class</a></td> <td>Classes to describe an XML node object.</td></tr> <tr><td style="width: 25%;"><a href="xmlNamespaceDefinitions.html">xmlNamespaces</a></td> <td>Get definitions of any namespaces defined in this XML node</td></tr> <tr><td style="width: 25%;"><a href="xmlNamespaceDefinitions.html">xmlNamespaces&lt;-</a></td> <td>Get definitions of any namespaces defined in this XML node</td></tr> <tr><td style="width: 25%;"><a href="xmlNamespaceDefinitions.html">xmlNamespaces&lt;--method</a></td> <td>Get definitions of any namespaces defined in this XML node</td></tr> <tr><td style="width: 25%;"><a href="xmlTreeParse.html">xmlNativeTreeParse</a></td> <td>XML Parser</td></tr> <tr><td style="width: 25%;"><a href="xmlNode.html">xmlNode</a></td> <td>Create an XML node</td></tr> <tr><td style="width: 25%;"><a href="XMLNode-class.html">XMLNode-class</a></td> <td>Classes to describe an XML node object.</td></tr> <tr><td style="width: 25%;"><a href="xmlOutput.html">xmlOutputBuffer</a></td> <td>XML output streams</td></tr> <tr><td style="width: 25%;"><a href="xmlOutput.html">xmlOutputDOM</a></td> <td>XML output streams</td></tr> <tr><td style="width: 25%;"><a href="xmlParent.html">xmlParent</a></td> <td>Get parent node of XMLInternalNode or ancestor nodes</td></tr> <tr><td style="width: 25%;"><a href="xmlParent.html">xmlParent-method</a></td> <td>Get parent node of XMLInternalNode or ancestor nodes</td></tr> <tr><td style="width: 25%;"><a href="xmlParent.html">xmlParent.XMLInternalNode</a></td> <td>Get parent node of XMLInternalNode or ancestor nodes</td></tr> <tr><td style="width: 25%;"><a href="addChildren.html">xmlParent&lt;-</a></td> <td>Add child nodes to an XML node</td></tr> <tr><td style="width: 25%;"><a href="xmlTreeParse.html">xmlParse</a></td> <td>XML Parser</td></tr> <tr><td style="width: 25%;"><a href="xmlParseDoc.html">xmlParseDoc</a></td> <td>Parse an XML document with options controlling the parser.</td></tr> <tr><td style="width: 25%;"><a href="xmlParserContextFunction.html">xmlParserContextFunction</a></td> <td>Identifies function as expecting an xmlParserContext argument</td></tr> <tr><td style="width: 25%;"><a href="isXMLString.html">xmlParseString</a></td> <td>Facilities for working with XML strings</td></tr> <tr><td style="width: 25%;"><a href="xmlNode.html">xmlPINode</a></td> <td>Create an XML node</td></tr> <tr><td style="width: 25%;"><a href="xmlRoot.html">xmlRoot</a></td> <td>Get the top-level XML node.</td></tr> <tr><td style="width: 25%;"><a href="xmlRoot.html">xmlRoot.HTMLDocument</a></td> <td>Get the top-level XML node.</td></tr> <tr><td style="width: 25%;"><a href="xmlRoot.html">xmlRoot.XMLDocument</a></td> <td>Get the top-level XML node.</td></tr> <tr><td style="width: 25%;"><a href="xmlRoot.html">xmlRoot.XMLDocumentContent</a></td> <td>Get the top-level XML node.</td></tr> <tr><td style="width: 25%;"><a href="xmlRoot.html">xmlRoot.XMLDocumentRoot</a></td> <td>Get the top-level XML node.</td></tr> <tr><td style="width: 25%;"><a href="xmlRoot.html">xmlRoot.XMLInternalDocument</a></td> <td>Get the top-level XML node.</td></tr> <tr><td style="width: 25%;"><a href="xmlRoot.html">xmlRoot.XMLInternalDOM</a></td> <td>Get the top-level XML node.</td></tr> <tr><td style="width: 25%;"><a href="xmlApply.html">xmlSApply</a></td> <td>Applies a function to each of the children of an XMLNode</td></tr> <tr><td style="width: 25%;"><a href="xmlApply.html">xmlSApply.XMLDocument</a></td> <td>Applies a function to each of the children of an XMLNode</td></tr> <tr><td style="width: 25%;"><a href="xmlApply.html">xmlSApply.XMLDocumentContent</a></td> <td>Applies a function to each of the children of an XMLNode</td></tr> <tr><td style="width: 25%;"><a href="xmlApply.html">xmlSApply.XMLNode</a></td> <td>Applies a function to each of the children of an XMLNode</td></tr> <tr><td style="width: 25%;"><a href="schema-class.html">xmlSchemaAttributeGroupRef-class</a></td> <td>Classes for working with XML Schema</td></tr> <tr><td style="width: 25%;"><a href="schema-class.html">xmlSchemaAttributeRef-class</a></td> <td>Classes for working with XML Schema</td></tr> <tr><td style="width: 25%;"><a href="schema-class.html">xmlSchemaElementRef-class</a></td> <td>Classes for working with XML Schema</td></tr> <tr><td style="width: 25%;"><a href="schema-class.html">xmlSchemaNotationRef-class</a></td> <td>Classes for working with XML Schema</td></tr> <tr><td style="width: 25%;"><a href="xmlTreeParse.html">xmlSchemaParse</a></td> <td>XML Parser</td></tr> <tr><td style="width: 25%;"><a href="schema-class.html">xmlSchemaRef-class</a></td> <td>Classes for working with XML Schema</td></tr> <tr><td style="width: 25%;"><a href="schema-class.html">xmlSchemaTypeRef-class</a></td> <td>Classes for working with XML Schema</td></tr> <tr><td style="width: 25%;"><a href="xmlSchemaValidate.html">xmlSchemaValidate</a></td> <td>Validate an XML document relative to an XML schema</td></tr> <tr><td style="width: 25%;"><a href="xmlSearchNs.html">xmlSearchNs</a></td> <td>Find a namespace definition object by searching ancestor nodes</td></tr> <tr><td style="width: 25%;"><a href="xmlSerializeHook.html">xmlSerializeHook</a></td> <td>Functions that help serialize and deserialize XML internal objects</td></tr> <tr><td style="width: 25%;"><a href="xmlSize.html">xmlSize</a></td> <td>The number of sub-elements within an XML node.</td></tr> <tr><td style="width: 25%;"><a href="xmlSize.html">xmlSize.default</a></td> <td>The number of sub-elements within an XML node.</td></tr> <tr><td style="width: 25%;"><a href="xmlSize.html">xmlSize.XMLDocument</a></td> <td>The number of sub-elements within an XML node.</td></tr> <tr><td style="width: 25%;"><a href="xmlSize.html">xmlSize.XMLNode</a></td> <td>The number of sub-elements within an XML node.</td></tr> <tr><td style="width: 25%;"><a href="xmlSource.html">xmlSource</a></td> <td>Source the R code, examples, etc. from an XML document</td></tr> <tr><td style="width: 25%;"><a href="xmlSource.html">xmlSource-method</a></td> <td>Source the R code, examples, etc. from an XML document</td></tr> <tr><td style="width: 25%;"><a href="xmlSource.html">xmlSourceFunctions</a></td> <td>Source the R code, examples, etc. from an XML document</td></tr> <tr><td style="width: 25%;"><a href="xmlSource.html">xmlSourceFunctions-method</a></td> <td>Source the R code, examples, etc. from an XML document</td></tr> <tr><td style="width: 25%;"><a href="xmlSource.html">xmlSourceSection</a></td> <td>Source the R code, examples, etc. from an XML document</td></tr> <tr><td style="width: 25%;"><a href="xmlSource.html">xmlSourceSection-method</a></td> <td>Source the R code, examples, etc. from an XML document</td></tr> <tr><td style="width: 25%;"><a href="xmlSource.html">xmlSourceThread</a></td> <td>Source the R code, examples, etc. from an XML document</td></tr> <tr><td style="width: 25%;"><a href="xmlSource.html">xmlSourceThread-method</a></td> <td>Source the R code, examples, etc. from an XML document</td></tr> <tr><td style="width: 25%;"><a href="xmlStopParser.html">xmlStopParser</a></td> <td>Terminate an XML parser</td></tr> <tr><td style="width: 25%;"><a href="isXMLString.html">XMLString-class</a></td> <td>Facilities for working with XML strings</td></tr> <tr><td style="width: 25%;"><a href="xmlStructuredStop.html">xmlStructuredStop</a></td> <td>Condition/error handler functions for XML parsing</td></tr> <tr><td style="width: 25%;"><a href="xmlNode.html">xmlTextNode</a></td> <td>Create an XML node</td></tr> <tr><td style="width: 25%;"><a href="xmlToDataFrame.html">xmlToDataFrame</a></td> <td>Extract data from a simple XML document</td></tr> <tr><td style="width: 25%;"><a href="xmlToDataFrame.html">xmlToDataFrame-method</a></td> <td>Extract data from a simple XML document</td></tr> <tr><td style="width: 25%;"><a href="xmlToList.html">xmlToList</a></td> <td>Convert an XML node/document to a more R-like list</td></tr> <tr><td style="width: 25%;"><a href="xmlToS4.html">xmlToS4</a></td> <td>General mechanism for mapping an XML node to an S4 object</td></tr> <tr><td style="width: 25%;"><a href="xmlToS4.html">xmlToS4-method</a></td> <td>General mechanism for mapping an XML node to an S4 object</td></tr> <tr><td style="width: 25%;"><a href="xmlTree.html">xmlTree</a></td> <td>An internal, updatable DOM object for building XML trees</td></tr> <tr><td style="width: 25%;"><a href="XMLNode-class.html">XMLTreeNode-class</a></td> <td>Classes to describe an XML node object.</td></tr> <tr><td style="width: 25%;"><a href="xmlTreeParse.html">xmlTreeParse</a></td> <td>XML Parser</td></tr> <tr><td style="width: 25%;"><a href="xmlValue.html">xmlValue</a></td> <td>Extract or set the contents of a leaf XML node</td></tr> <tr><td style="width: 25%;"><a href="xmlValue.html">xmlValue.XMLCDataNode</a></td> <td>Extract or set the contents of a leaf XML node</td></tr> <tr><td style="width: 25%;"><a href="xmlValue.html">xmlValue.XMLComment</a></td> <td>Extract or set the contents of a leaf XML node</td></tr> <tr><td style="width: 25%;"><a href="xmlValue.html">xmlValue.XMLNode</a></td> <td>Extract or set the contents of a leaf XML node</td></tr> <tr><td style="width: 25%;"><a href="xmlValue.html">xmlValue.XMLProcessingInstruction</a></td> <td>Extract or set the contents of a leaf XML node</td></tr> <tr><td style="width: 25%;"><a href="xmlValue.html">xmlValue.XMLTextNode</a></td> <td>Extract or set the contents of a leaf XML node</td></tr> <tr><td style="width: 25%;"><a href="xmlValue.html">xmlValue&lt;-</a></td> <td>Extract or set the contents of a leaf XML node</td></tr> <tr><td style="width: 25%;"><a href="xmlValue.html">xmlValue&lt;--method</a></td> <td>Extract or set the contents of a leaf XML node</td></tr> <tr><td style="width: 25%;"><a href="XMLNode-class.html">XMLXIncludeEndNode-class</a></td> <td>Classes to describe an XML node object.</td></tr> <tr><td style="width: 25%;"><a href="getXIncludes.html">xmlXIncludes</a></td> <td>Find the documents that are XInclude'd in an XML document</td></tr> <tr><td style="width: 25%;"><a href="XMLNode-class.html">XMLXIncludeStartNode-class</a></td> <td>Classes to describe an XML node object.</td></tr> <tr><td style="width: 25%;"><a href="getNodeSet.html">xpathApply</a></td> <td>Find matching nodes in an internal XML tree/DOM</td></tr> <tr><td style="width: 25%;"><a href="getNodeSet.html">xpathSApply</a></td> <td>Find matching nodes in an internal XML tree/DOM</td></tr> </table> <h2><a name="misc">-- misc --</a></h2> <table width="100%"> <tr><td style="width: 25%;"><a href="schema-class.html">$-method</a></td> <td>Classes for working with XML Schema</td></tr> <tr><td style="width: 25%;"><a href="schema-class.html">$&lt;--method</a></td> <td>Classes for working with XML Schema</td></tr> <tr><td style="width: 25%;"><a href="SAXMethods.html">.InitSAXMethods</a></td> <td>Generic Methods for SAX callbacks</td></tr> <tr><td style="width: 25%;"><a href="XMLAttributes-class.html">[-method</a></td> <td>Class '"XMLAttributes"'</td></tr> <tr><td style="width: 25%;"><a href="xmlSubset.html">[.XMLNode</a></td> <td>Convenience accessors for the children of XMLNode objects.</td></tr> <tr><td style="width: 25%;"><a href="AssignXMLNode.html">[&lt;-.XMLNode</a></td> <td>Assign sub-nodes to an XML node</td></tr> <tr><td style="width: 25%;"><a href="XMLCodeFile-class.html">[[-method</a></td> <td>Simple classes for identifying an XML document containing R code</td></tr> <tr><td style="width: 25%;"><a href="xmlSubset.html">[[.XMLDocumentContent</a></td> <td>Convenience accessors for the children of XMLNode objects.</td></tr> <tr><td style="width: 25%;"><a href="xmlSubset.html">[[.XMLInternalElementNode</a></td> <td>Convenience accessors for the children of XMLNode objects.</td></tr> <tr><td style="width: 25%;"><a href="xmlSubset.html">[[.XMLNode</a></td> <td>Convenience accessors for the children of XMLNode objects.</td></tr> <tr><td style="width: 25%;"><a href="AssignXMLNode.html">[[&lt;-.XMLNode</a></td> <td>Assign sub-nodes to an XML node</td></tr> </table> </body></html>
patocarranza/CanReg-dbProcessor
R/library/XML/html/00Index.html
HTML
gpl-3.0
51,357
namespace TaleOfTwoWastelands.Progress { public interface IInstallStatus : IInstallStatusUpdate { void Finish(); } }
jzebedee/ttwinstaller
Installer/Progress/IInstallStatus.cs
C#
gpl-3.0
127
package itaf.mobile.app.ui; import itaf.framework.base.dto.WsPageResult; import itaf.framework.merchant.dto.BzDistStatementDto; import itaf.mobile.app.R; import itaf.mobile.app.services.TaskService; import itaf.mobile.app.task.netreader.DistStatementAcceptTask; import itaf.mobile.app.task.netreader.DistStatementRejectTask; import itaf.mobile.app.task.netreader.MerchantDistStatementPagerTask; import itaf.mobile.app.third.pull.PullToRefreshBase; import itaf.mobile.app.third.pull.PullToRefreshBase.OnLastItemVisibleListener; import itaf.mobile.app.third.pull.PullToRefreshBase.OnRefreshListener; import itaf.mobile.app.third.pull.PullToRefreshListView; import itaf.mobile.app.ui.adapter.AbstractBaseAdapter; import itaf.mobile.app.ui.base.BaseUIActivity; import itaf.mobile.app.ui.base.UIRefresh; import itaf.mobile.app.util.OnClickListenerHelper; import itaf.mobile.app.util.ToastHelper; import itaf.mobile.core.app.AppApplication; import itaf.mobile.core.utils.DateUtil; import itaf.mobile.core.utils.StringHelper; import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.text.format.DateUtils; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.Button; import android.widget.ListView; import android.widget.TextView; /** * 配送结算批次详情 * * * @author XINXIN * * @UpdateDate 2014年9月15日 */ public class DistStatementItem extends BaseUIActivity implements UIRefresh { // 返回 private Button btn_dsi_back; // 已发起结清 private Button btn_dsi_processing; // 已完结结算 private Button btn_dsi_processed; // 金额小计 private TextView tv_dsi_receivable_amount; // 金额小计 private TextView tv_dsi_refund_amount; private PullToRefreshListView plv_dsi_content; private DistStatementAdapter adapter; private List<BzDistStatementDto> adapterContent = new ArrayList<BzDistStatementDto>(); private int currentIndex = 0; private int totalCount; private Long statementStatus = BzDistStatementDto.STATUS_PROCESSING; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.dist_statement_item); initPageAttribute(); initListView(); addMerchantDistStatementPagerTask(); } private void initPageAttribute() { btn_dsi_back = (Button) this.findViewById(R.id.btn_dsi_back); btn_dsi_back.setOnClickListener(OnClickListenerHelper .finishActivity(DistStatementItem.this)); btn_dsi_processing = (Button) this .findViewById(R.id.btn_dsi_processing); btn_dsi_processing.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { currentIndex = 0; statementStatus = BzDistStatementDto.STATUS_PROCESSING; addMerchantDistStatementPagerTask(); } }); btn_dsi_processed = (Button) this.findViewById(R.id.btn_dsi_processed); btn_dsi_processed.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { currentIndex = 0; statementStatus = BzDistStatementDto.STATUS_PROCESSED; addMerchantDistStatementPagerTask(); } }); tv_dsi_receivable_amount = (TextView) this .findViewById(R.id.tv_dsi_receivable_amount); tv_dsi_refund_amount = (TextView) this .findViewById(R.id.tv_dsi_refund_amount); } private void initListView() { plv_dsi_content = (PullToRefreshListView) this .findViewById(R.id.plv_dsi_content); plv_dsi_content.setShowIndicator(false);// 取消箭头 adapter = new DistStatementAdapter(DistStatementItem.this, adapterContent); plv_dsi_content.setAdapter(adapter); plv_dsi_content.setOnRefreshListener(new OnRefreshListener<ListView>() { @Override public void onRefresh(PullToRefreshBase<ListView> refreshView) { String label = DateUtils.formatDateTime( getApplicationContext(), System.currentTimeMillis(), DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_ABBREV_ALL); // Update the LastUpdatedLabel refreshView.getLoadingLayoutProxy().setLastUpdatedLabel(label); currentIndex = 0; addMerchantDistStatementPagerTask(); } }); plv_dsi_content .setOnLastItemVisibleListener(new OnLastItemVisibleListener() { @Override public void onLastItemVisible() { if (currentIndex < totalCount) { addMerchantDistStatementPagerTask(); } } }); } private void addMerchantDistStatementPagerTask() { HashMap<String, Object> queryMap = new HashMap<String, Object>(); queryMap.put(MerchantDistStatementPagerTask.TP_KEY_BZ_DIST_COMPANY_ID, AppApplication.getInstance().getSessionUser().getId()); queryMap.put(MerchantDistStatementPagerTask.TP_KEY_STATEMENT_STATUS, statementStatus); Map<String, Object> params = new HashMap<String, Object>(); params.put(MerchantDistStatementPagerTask.TP_QUERY_MAP, queryMap); params.put(MerchantDistStatementPagerTask.TP_CURRENT_INDEX, currentIndex); params.put(MerchantDistStatementPagerTask.TP_PAGE_SIZE, this.getPageSize()); TaskService.addTask(new MerchantDistStatementPagerTask( DistStatementItem.this, params)); showProgressDialog(PD_LOADING); } private void addDistStatementAcceptTask(Long bzDistStatementId) { Map<String, Object> params = new HashMap<String, Object>(); params.put(DistStatementAcceptTask.TP_BZ_DIST_COMPANY_ID, AppApplication.getInstance().getSessionUser().getId()); params.put(DistStatementAcceptTask.TP_BZ_DIST_STATEMENT_ID, bzDistStatementId); TaskService.addTask(new DistStatementAcceptTask(DistStatementItem.this, params)); showProgressDialog(PD_LOADING); } private void addDistStatementRejectTask(Long bzDistStatementId) { Map<String, Object> params = new HashMap<String, Object>(); params.put(DistStatementRejectTask.TP_BZ_DIST_COMPANY_ID, AppApplication.getInstance().getSessionUser().getId()); params.put(DistStatementRejectTask.TP_BZ_DIST_STATEMENT_ID, bzDistStatementId); TaskService.addTask(new DistStatementRejectTask(DistStatementItem.this, params)); showProgressDialog(PD_LOADING); } @SuppressWarnings("unchecked") @Override public void refresh(Object... args) { dismissProgressDialog(); int taskId = (Integer) args[0]; if (MerchantDistStatementPagerTask.getTaskId() == taskId) { if (args[1] == null) { plv_dsi_content.onRefreshComplete(); return; } WsPageResult<BzDistStatementDto> result = (WsPageResult<BzDistStatementDto>) args[1]; if (WsPageResult.STATUS_ERROR.equals(result.getStatus())) { if (StringHelper.isEmpty(result.getErrorMsg())) { ToastHelper.showToast(this, "加载异常"); } else { ToastHelper.showToast(this, result.getErrorMsg()); } plv_dsi_content.onRefreshComplete(); return; } if (currentIndex == 0) { adapterContent.clear(); } tv_dsi_receivable_amount.setText(StringHelper .bigDecimalToRmb((BigDecimal) result.getParams().get( "receivableAmount"))); tv_dsi_refund_amount.setText(StringHelper .bigDecimalToRmb((BigDecimal) result.getParams().get( "refundAmount"))); totalCount = result.getTotalCount(); currentIndex = result.getCurrentIndex() + getPageSize(); adapterContent.addAll(result.getContent()); adapter.notifyDataSetChanged(); plv_dsi_content.onRefreshComplete(); } else if (DistStatementAcceptTask.getTaskId() == taskId) { if (args[1] == null) { return; } WsPageResult<BzDistStatementDto> result = (WsPageResult<BzDistStatementDto>) args[1]; if (WsPageResult.STATUS_ERROR.equals(result.getStatus())) { if (StringHelper.isEmpty(result.getErrorMsg())) { ToastHelper.showToast(this, "接受失败!"); } else { ToastHelper.showToast(this, result.getErrorMsg()); } return; } currentIndex = 0; addMerchantDistStatementPagerTask(); } else if (DistStatementRejectTask.getTaskId() == taskId) { if (args[1] == null) { return; } WsPageResult<BzDistStatementDto> result = (WsPageResult<BzDistStatementDto>) args[1]; if (WsPageResult.STATUS_ERROR.equals(result.getStatus())) { if (StringHelper.isEmpty(result.getErrorMsg())) { ToastHelper.showToast(this, "拒绝失败!"); } else { ToastHelper.showToast(this, result.getErrorMsg()); } return; } currentIndex = 0; addMerchantDistStatementPagerTask(); } } class DistStatementAdapter extends AbstractBaseAdapter { private List<BzDistStatementDto> listItems;// 数据集合 private LayoutInflater listContainer;// 视图容器 class ListItemView { // 自定义控件集合 TextView tv_dsia_statement_serial_no; Button btn_dsia_reject; Button btn_dsia_accept; TextView tv_dsia_dist_company_name; TextView tv_dsia_statement_time; TextView tv_dsia_merchant_receivable_amount; TextView tv_dsia_merchant_received_amount; } /** * 实例化Adapter * * @param context * @param data * @param resource */ public DistStatementAdapter(Context context, List<BzDistStatementDto> data) { this.listContainer = LayoutInflater.from(context); // 创建视图容器并设置上下文 this.listItems = data; } public int getCount() { return listItems.size(); } public Object getItem(int position) { return this.listItems.get(position); } public long getItemId(int position) { return position; } /** * ListView Item设置 */ public View getView(int position, View convertView, ViewGroup parent) { // 自定义视图 ListItemView listItemView = null; if (convertView == null) { // 获取list_item布局文件的视图 convertView = listContainer.inflate( R.layout.dist_statement_item_adapter, parent, false); listItemView = new ListItemView(); listItemView.tv_dsia_statement_serial_no = (TextView) convertView .findViewById(R.id.tv_dsia_statement_serial_no); listItemView.btn_dsia_reject = (Button) convertView .findViewById(R.id.btn_dsia_reject); listItemView.btn_dsia_accept = (Button) convertView .findViewById(R.id.btn_dsia_accept); listItemView.tv_dsia_dist_company_name = (TextView) convertView .findViewById(R.id.tv_dsia_dist_company_name); listItemView.tv_dsia_statement_time = (TextView) convertView .findViewById(R.id.tv_dsia_statement_time); listItemView.tv_dsia_merchant_receivable_amount = (TextView) convertView .findViewById(R.id.tv_dsia_merchant_receivable_amount); listItemView.tv_dsia_merchant_received_amount = (TextView) convertView .findViewById(R.id.tv_dsia_merchant_received_amount); // 设置控件集到convertView convertView.setTag(listItemView); } else { listItemView = (ListItemView) convertView.getTag(); } // 设置文字和图片 final BzDistStatementDto target = (BzDistStatementDto) listItems .get(position); listItemView.tv_dsia_statement_serial_no.setText(StringHelper .trimToEmpty(target.getStatementSerialNo())); listItemView.tv_dsia_statement_serial_no .setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(); intent.putExtra( MerchantDistStatementDetail.AP_BZ_DIST_STATEMENT_ID, target.getId()); intent.setClass(DistStatementItem.this, MerchantDistStatementDetail.class); startActivity(intent); } }); if (statementStatus.equals(BzDistStatementDto.STATUS_PROCESSING)) { listItemView.btn_dsia_reject.setVisibility(View.VISIBLE); listItemView.btn_dsia_accept.setVisibility(View.VISIBLE); } else { listItemView.btn_dsia_reject.setVisibility(View.GONE); listItemView.btn_dsia_accept.setVisibility(View.GONE); } listItemView.btn_dsia_reject .setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { addDistStatementRejectTask(target.getId()); } }); listItemView.btn_dsia_accept .setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { addDistStatementAcceptTask(target.getId()); } }); listItemView.tv_dsia_dist_company_name .setText(StringHelper.trimToEmpty(target .getBzDistCompanyDto().getCompanyName())); listItemView.tv_dsia_statement_time.setText(DateUtil .formatDate(target.getStatementTime())); listItemView.tv_dsia_merchant_receivable_amount .setText(StringHelper.bigDecimalToRmb(target .getMerchantReceivableAmount())); listItemView.tv_dsia_merchant_received_amount.setText(StringHelper .bigDecimalToRmb(target.getMerchantReceivedAmount())); return convertView; } } }
zpxocivuby/freetong_mobile
ItafMobileApp/src/itaf/mobile/app/ui/DistStatementItem.java
Java
gpl-3.0
12,889
/* RetroArch - A frontend for libretro. * Copyright (C) 2010-2014 - Hans-Kristian Arntzen * * RetroArch is free software: you can redistribute it and/or modify it under the terms * of the GNU General Public License as published by the Free Software Found- * ation, either version 3 of the License, or (at your option) any later version. * * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with RetroArch. * If not, see <http://www.gnu.org/licenses/>. */ #ifndef SHADER_PARSE_H #define SHADER_PARSE_H #include <boolean.h> #include <file/config_file.h> #include "../state_tracker.h" #include <retro_miscellaneous.h> #ifdef __cplusplus extern "C" { #endif #ifndef GFX_MAX_SHADERS #define GFX_MAX_SHADERS 16 #endif #ifndef GFX_MAX_TEXTURES #define GFX_MAX_TEXTURES 8 #endif #ifndef GFX_MAX_VARIABLES #define GFX_MAX_VARIABLES 64 #endif #ifndef GFX_MAX_PARAMETERS #define GFX_MAX_PARAMETERS 64 #endif enum rarch_shader_type { RARCH_SHADER_NONE = 0, RARCH_SHADER_CG, RARCH_SHADER_HLSL, RARCH_SHADER_GLSL }; enum gfx_scale_type { RARCH_SCALE_INPUT = 0, RARCH_SCALE_ABSOLUTE, RARCH_SCALE_VIEWPORT }; enum { RARCH_FILTER_UNSPEC = 0, RARCH_FILTER_LINEAR, RARCH_FILTER_NEAREST }; enum gfx_wrap_type { RARCH_WRAP_BORDER = 0, /* Kinda deprecated, but keep as default. Will be translated to EDGE in GLES. */ RARCH_WRAP_DEFAULT = RARCH_WRAP_BORDER, RARCH_WRAP_EDGE, RARCH_WRAP_REPEAT, RARCH_WRAP_MIRRORED_REPEAT }; struct gfx_fbo_scale { enum gfx_scale_type type_x; enum gfx_scale_type type_y; float scale_x; float scale_y; unsigned abs_x; unsigned abs_y; bool fp_fbo; bool srgb_fbo; bool valid; }; struct gfx_shader_parameter { char id[64]; char desc[64]; float current; float minimum; float initial; float maximum; float step; }; struct gfx_shader_pass { struct { char path[PATH_MAX]; struct { char *vertex; // Dynamically allocated. Must be free'd. char *fragment; // Dynamically allocated. Must be free'd. } string; } source; char alias[64]; struct gfx_fbo_scale fbo; unsigned filter; enum gfx_wrap_type wrap; unsigned frame_count_mod; bool mipmap; }; struct gfx_shader_lut { char id[64]; char path[PATH_MAX]; unsigned filter; enum gfx_wrap_type wrap; bool mipmap; }; /* This is pretty big, shouldn't be put on the stack. * Avoid lots of allocation for convenience. */ struct gfx_shader { enum rarch_shader_type type; bool modern; /* Only used for XML shaders. */ char prefix[64]; unsigned passes; struct gfx_shader_pass pass[GFX_MAX_SHADERS]; unsigned luts; struct gfx_shader_lut lut[GFX_MAX_TEXTURES]; struct gfx_shader_parameter parameters[GFX_MAX_PARAMETERS]; unsigned num_parameters; unsigned variables; struct state_tracker_uniform_info variable[GFX_MAX_VARIABLES]; char script_path[PATH_MAX]; char *script; /* Dynamically allocated. Must be free'd. Only used by XML. */ char script_class[512]; }; bool gfx_shader_read_conf_cgp(config_file_t *conf, struct gfx_shader *shader); void gfx_shader_write_conf_cgp(config_file_t *conf, struct gfx_shader *shader); void gfx_shader_resolve_relative(struct gfx_shader *shader, const char *ref_path); bool gfx_shader_resolve_parameters(config_file_t *conf, struct gfx_shader *shader); enum rarch_shader_type gfx_shader_parse_type(const char *path, enum rarch_shader_type fallback); #ifdef __cplusplus } #endif #endif
SuperrSonic/RA-SS
gfx/shader/shader_parse.h
C
gpl-3.0
3,848
package se.esss.litterbox.its.archivergwt.client.googleplots; import com.google.gwt.user.client.ui.HorizontalPanel; import com.googlecode.gwt.charts.client.ChartLoader; import com.googlecode.gwt.charts.client.ChartPackage; import com.googlecode.gwt.charts.client.ColumnType; import com.googlecode.gwt.charts.client.DataTable; import com.googlecode.gwt.charts.client.corechart.ScatterChart; import com.googlecode.gwt.charts.client.corechart.ScatterChartOptions; import com.googlecode.gwt.charts.client.options.HAxis; import com.googlecode.gwt.charts.client.options.VAxis; public class ScatterPlotPanel extends HorizontalPanel { private ScatterChart scatterChart; private DataTable dataTable; private ScatterChartOptions options; private ChartLoader chartLoader; private ChartRunnable chartRunnable; private int numPts; private int numTraces; private String title; private String xaxisLabel; private String yaxisLabel; private String[] legend; private double[][] xaxisData; private double[][] yaxisData; private String plotWidth; private String plotHeight; private boolean loaded = false; public int getNumPts() {return numPts;} public int getNumTraces() {return numTraces;} public String getTitle() {return title;} public String getHaxisLabel() {return xaxisLabel;} public String getYaxisLabel() {return yaxisLabel;} public String[] getLegend() {return legend;} public double[][] getXaxisData() {return xaxisData;} public double[][] getYaxisData() {return yaxisData;} public String getPlotWidth() {return plotWidth;} public String getPlotHeight() {return plotHeight;} public boolean isLoaded() {return loaded;} public void setXaxisData(double[][] xaxisData) {this.xaxisData = xaxisData;} public void setYaxisData(double[][] yaxisData) {this.yaxisData = yaxisData;} public ScatterPlotPanel(int numPts, int numTraces, String title, String xaxisLabel, String yaxisLabel, String[] legend, String plotWidth, String plotHeight) { loaded = false; this.numPts = numPts; this.numTraces = numTraces; this.title = title; this.xaxisLabel = xaxisLabel; this.yaxisLabel = yaxisLabel; this.plotWidth = plotWidth; this.plotHeight = plotHeight; this.legend = legend; xaxisData = new double[numTraces][numPts]; yaxisData = new double[numTraces][numPts]; for (int itrace = 0; itrace < numTraces; ++itrace) for (int ii = 0; ii < numPts; ++ii) { yaxisData[itrace][ii] = 0; xaxisData[itrace][ii] = 0; } } public void initialize() { loaded = false; chartLoader = new ChartLoader(ChartPackage.CORECHART); chartRunnable = new ChartRunnable(this); chartLoader.loadApi(chartRunnable); } private void setup() { // Prepare the data dataTable = DataTable.create(); dataTable.addColumn(ColumnType.NUMBER, xaxisLabel); for (int ii = 0; ii < numTraces; ++ii) dataTable.addColumn(ColumnType.NUMBER, legend[ii]); dataTable.addRows(numPts * numTraces); // Set options options = ScatterChartOptions.create(); options.setBackgroundColor("#f0f0f0"); options.setFontName("Tahoma"); options.setTitle(title); options.setHAxis(HAxis.create(xaxisLabel)); options.setVAxis(VAxis.create(yaxisLabel)); } public void draw() { for (int itrace = 0; itrace < numTraces; ++itrace) { for (int ii = 0; ii < numPts; ++ii) { dataTable.setValue(ii + itrace * numPts, 0, xaxisData[itrace][ii]); dataTable.setValue(ii + itrace * numPts, itrace + 1, yaxisData[itrace][ii]); } } scatterChart.draw(dataTable, options); } private static class ChartRunnable implements Runnable { ScatterPlotPanel timeLinePlotPanel; private ChartRunnable(ScatterPlotPanel timeLinePlotPanel) { this.timeLinePlotPanel = timeLinePlotPanel; } @Override public void run() { timeLinePlotPanel.scatterChart = new ScatterChart(); timeLinePlotPanel.add(timeLinePlotPanel.scatterChart); timeLinePlotPanel.setup(); timeLinePlotPanel.draw(); timeLinePlotPanel.scatterChart.setWidth(timeLinePlotPanel.plotWidth); timeLinePlotPanel.scatterChart.setHeight(timeLinePlotPanel.plotHeight); timeLinePlotPanel.loaded = true; } } }
se-esss-litterbox/ess-its
ItsArchiverGwt/src/se/esss/litterbox/its/archivergwt/client/googleplots/ScatterPlotPanel.java
Java
gpl-3.0
4,134
# wypjq.github.io
wypjq/wypjq.github.io
README.md
Markdown
gpl-3.0
17
#pragma once #include <stdbool.h> #include <service.h> /*typedef enum timer_event_type_t { SCENE, COMMAND } timer_event_type_t; typedef struct timer_info_t { char* name; char* event_name; bool singleshot; timer_event_type_t event_type; uint32_t timeout; uint32_t ticks_left; } timer_info_t;*/ typedef struct timer_info_t { char* name; int timer_id; int event_id; } timer_info_t; extern bool timer_enabled; extern variant_stack_t* timer_list; extern int DT_TIMER; //service_t* self; void timer_delete_timer(void* arg);
sharky76/zwave-automation-engine
services/Timer/timer_config.h
C
gpl-3.0
592
li.logbuttons{ background-color: #18BC9C; color: white; border-color: #18BC9C; } .loginfo{ color: white; } .tile-progress { background-color: #303641; color: #fff; } .tile-progress { background: #00a65b; color: #fff; margin-bottom: 20px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; -webkit-background-clip: padding-box; -moz-background-clip: padding; background-clip: padding-box; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } .tile-progress .tile-header { padding: 15px 20px; padding-bottom: 40px; } .tile-progress .tile-progressbar { height: 2px; background: rgba(0,0,0,0.18); margin: 0; } .tile-progress .tile-progressbar span { background: #fff; } .tile-progress .tile-progressbar span { display: block; background: #fff; width: 0; height: 100%; -webkit-transition: all 1.5s cubic-bezier(0.230,1.000,0.320,1.000); -moz-transition: all 1.5s cubic-bezier(0.230,1.000,0.320,1.000); -o-transition: all 1.5s cubic-bezier(0.230,1.000,0.320,1.000); transition: all 1.5s cubic-bezier(0.230,1.000,0.320,1.000); } .tile-progress .tile-footer { padding: 20px; text-align: right; background: rgba(0,0,0,0.1); -webkit-border-radius: 0 0 3px 3px; -webkit-background-clip: padding-box; -moz-border-radius: 0 0 3px 3px; -moz-background-clip: padding; border-radius: 0 0 3px 3px; background-clip: padding-box; -webkit-border-radius: 0 0 3px 3px; -moz-border-radius: 0 0 3px 3px; border-radius: 0 0 3px 3px; } .tile-progress.tile-red { background-color: #f56954; color: #fff; } .tile-progress { background-color: #18BC9C; color: #fff; } .tile-progress.tile-blue { background-color: #0073b7; color: #fff; } .tile-progress.tile-aqua { background-color: #00c0ef; color: #fff; } .tile-progress.tile-green { background-color: #00a65a; color: #fff; } .tile-progress.tile-cyan { background-color: #00b29e; color: #fff; } .tile-progress.tile-purple { background-color: #ba79cb; color: #fff; } .tile-progress.tile-pink { background-color: #ec3b83; color: #fff; }
TudorGh/seedbox
public/css/style.css
CSS
gpl-3.0
2,019
# # Authors: Roy Dragseth (roy.dragseth@cc.uit.no) # Bas van der Vlies (basv@sara.nl) # # SVN INFO: # $Id$ # """ Usage: from PBSQuery import PBSQuery This class gets the info from the pbs_server via the pbs.py module for the several batch objects. All get..() functions return an dictionary with id as key and batch object as value There are four batch objects: - server - queue - job - node Each object can be handled as an dictionary and has several member functions. The second parameter is an python list and can be used if you are only interested in certain resources, see example There are the following functions for PBSQuery: job - getjob(job_id, attributes=<default is all>) getjobs(attributes=<default is all>) node - getnode(node_id, attributes=<default is all>) getnodes(attributes=<default is all>) queue - getqueue(queue_id, attributes=<default is all>) getqueues(attributes=<default is all>) server - get_serverinfo(attributes=<default is all>) Here is an example how to use the module: from PBSQuery import PBSQuery p = PBSQuery() nodes = p.getnodes() for name,node in nodes.items(): print name if node.is_free(): print node, node['state'] l = [ 'state', 'np' ] nodes = p.getnodes(l) for name,node in nodes.items(): print node, node['state'] The parameter 'attributes' is an python list of resources that you are interested in, eg: only show state of nodes l = list() l.append('state') nodes = p.getnodes(l) """ import pbs import UserDict import string import sys import re import types class PBSError(Exception): def __init__(self, msg=''): self.msg = msg Exception.__init__(self, msg) def __repr__(self): return self.msg __str__ = __repr__ class PBSQuery: # a[key] = value, key and value are data type string # OLD_DATA_STRUCTURE = False def __init__(self, server=None): if not server: self.server = pbs.pbs_default() else: self.server = server self._connect() ## this is needed for getjob a jobid is made off: # sequence_number.server (is not self.server) # self.job_server_id = list(self.get_serverinfo())[0] self._disconnect() def _connect(self): """Connect to the PBS/Torque server""" self.con = pbs.pbs_connect(self.server) if self.con < 0: str = "Could not make a connection with %s\n" %(self.server) raise PBSError(str) def _disconnect(self): """Close the PBS/Torque connection""" pbs.pbs_disconnect(self.con) self.attribs = 'NULL' def _list_2_attrib(self, list): """Convert a python list to an attrib list suitable for pbs""" self.attribs = pbs.new_attrl( len(list) ) i = 0 for attrib in list: # So we can user Resource attrib = attrib.split('.') self.attribs[i].name = attrib[0] i = i + 1 def _pbsstr_2_list(self, str, delimiter): """Convert a string to a python list and use delimiter as spit char""" l = sting.splitfields(str, delimiter) if len(l) > 1: return l def _list_2_dict(self, l, class_func): """ Convert a pbsstat function list to a class dictionary, The data structure depends on the function new_data_structure(). Default data structure is: class[key] = value, Where key and value are of type string Future release, can be set by new_data_structure(): - class[key] = value where value can be: 1. a list of values of type string 2. a dictionary with as list of values of type string. If values contain a '=' character eg: print node['np'] >> [ '2' ] print node['status']['arch'] >> [ 'x86_64' ] """ self.d = {} for item in l: new = class_func() self.d[item.name] = new new.name = item.name for a in item.attribs: if self.OLD_DATA_STRUCTURE: if a.resource: key = '%s.%s' %(a.name, a.resource) else: key = '%s' %(a.name) new[key] = a.value else: values = string.split(a.value, ',') sub_dict = string.split(a.value, '=') # We must creat sub dicts, only for specified # key values # if a.name in ['status', 'Variable_List']: for v in values: tmp_l = v.split('=') ## Support for multiple EVENT mesages in format [key=value:]+ # format eg: message=EVENT:sample.time=1288864220.003,EVENT:kernel=upgrade,cputotals.user=0 # message=ERROR <text> # if tmp_l[0] in ['message']: if tmp_l[1].startswith('EVENT:'): tmp_d = dict() new['event'] = class_func(tmp_d) message_list = v.split(':') for event_type in message_list[1:]: tmp_l = event_type.split('=') new['event'][ tmp_l[0] ] = tmp_l[1:] else: ## ERROR message # new['error'] = tmp_l [1:] elif tmp_l[0].startswith('EVENT:'): message_list = v.split(':') for event_type in message_list[1:]: tmp_l = event_type.split('=') new['event'][ tmp_l[0] ] = tmp_l[1:] else: ## Check if we already added the key # if new.has_key(a.name): new[a.name][ tmp_l[0] ] = tmp_l[1:] else: tmp_d = dict() tmp_d[ tmp_l[0] ] = tmp_l[1:] new[a.name] = class_func(tmp_d) else: ## Check if it is a resource type variable, eg: # - Resource_List.(nodes, walltime, ..) # if a.resource: if new.has_key(a.name): new[a.name][a.resource] = values else: tmp_d = dict() tmp_d[a.resource] = values new[a.name] = class_func(tmp_d) else: # Simple value # new[a.name] = values self._free(l) def _free(self, memory): """ freeing up used memmory """ pbs.pbs_statfree(memory) def _statserver(self, attrib_list=None): """Get the server config from the pbs server""" if attrib_list: self._list_2_attrib(attrib_list) else: self.attribs = 'NULL' self._connect() serverinfo = pbs.pbs_statserver(self.con, self.attribs, 'NULL') self._disconnect() self._list_2_dict(serverinfo, server) def get_serverinfo(self, attrib_list=None): self._statserver(attrib_list) return self.d def _statqueue(self, queue_name='', attrib_list=None): """Get the queue config from the pbs server""" if attrib_list: self._list_2_attrib(attrib_list) else: self.attribs = 'NULL' self._connect() queues = pbs.pbs_statque(self.con, queue_name, self.attribs, 'NULL') self._disconnect() self._list_2_dict(queues, queue) def getqueue(self, name, attrib_list=None): self._statqueue(name, attrib_list) try: return self.d[name] except KeyError, detail: return self.d def getqueues(self, attrib_list=None): self._statqueue('', attrib_list) return self.d def _statnode(self, select='', attrib_list=None, property=None): """Get the node config from the pbs server""" if attrib_list: self._list_2_attrib(attrib_list) else: self.attribs = 'NULL' if property: select = ':%s' %(property) self._connect() nodes = pbs.pbs_statnode(self.con, select, self.attribs, 'NULL') self._disconnect() self._list_2_dict(nodes, node) def getnode(self, name, attrib_list=None): self._statnode(name, attrib_list) try: return self.d[name] except KeyError, detail: return self.d def getnodes(self, attrib_list=None): self._statnode('', attrib_list) return self.d def getnodes_with_property(self, property, attrib_list=None): self._statnode('', attrib_list, property) return self.d def _statjob(self, job_name='', attrib_list=None): """Get the job config from the pbs server""" if attrib_list: self._list_2_attrib(attrib_list) else: self.attribs = 'NULL' self._connect() jobs = pbs.pbs_statjob(self.con, job_name, self.attribs, 'NULL') self._disconnect() self._list_2_dict(jobs, job) def getjob(self, name, attrib_list=None): ## To make sure we use the full name of a job; Changes a name # like 1234567 into 1234567.job_server_id # if len(name.split('.')) == 1 : name = name.split('.')[0] + "." + self.job_server_id self._statjob(name, attrib_list) try: return self.d[name] except KeyError, detail: return self.d def getjobs(self, attrib_list=None): self._statjob('', attrib_list) return self.d def get_server_name(self): return self.server def new_data_structure(self): """ Use the new data structure. Is now the default """ self.OLD_DATA_STRUCTURE = False def old_data_structure(self): """ Use the old data structure. This function is obselete and will be removed in a future release """ self.OLD_DATA_STRUCTURE = True class _PBSobject(UserDict.UserDict): TRUE = 1 FALSE = 0 def __init__(self, dictin = None): UserDict.UserDict.__init__(self) self.name = None if dictin: if dictin.has_key('name'): self.name = dictin['name'] del dictin['name'] self.data = dictin def get_value(self, key): if self.has_key(key): return self[key] else: return None def __repr__(self): return repr(self.data) def __str__(self): return str(self.data) def __getattr__(self, name): """ override the class attribute get method. Return the value from the Userdict """ try: return self.data[name] except KeyError: error = 'Attribute key error: %s' %(name) raise PBSError(error) ## Disabled for this moment, BvdV 16 July 2010 # #def __setattr__(self, name, value): # """ # override the class attribute set method only when the UserDict # has set its class attribute # """ # if self.__dict__.has_key('data'): # self.data[name] = value # else: # self.__dict__[name] = value def __iter__(self): return iter(self.data.keys()) def uniq(self, list): """Filter out unique items of a list""" uniq_items = {} for item in list: uniq_items[item] = 1 return uniq_items.keys() def return_value(self, key): """Function that returns a value independent of new or old data structure""" if isinstance(self[key], types.ListType): return self[key][0] else: return self[key] class job(_PBSobject): """PBS job class""" def is_running(self): value = self.return_value('job_state') if value == 'Q': return self.TRUE else: return self.FALSE def get_nodes(self, unique=None): """ Returns a list of the nodes which run this job format: * exec_host: gb-r10n14/5+gb-r10n14/4+gb-r10n14/3+gb-r10n14/2+gb-r10n14/1+gb-r10n14/0 * split on '+' and if uniq is set split on '/' """ nodes = self.get_value('exec_host') if isinstance(nodes, str): if nodes: nodelist = string.split(nodes,'+') if not unique: return nodelist else: l = list() for n in nodelist: t = string.split(n,'/') if t[0] not in l: l.append(t[0]) return l else: return list() else: l = list() for n in nodes: nlist = string.split(n,'+') if unique: for entry in nlist: t = string.split(entry,'/') if t[0] not in l: l.append(t[0]) else: l += nlist return l class node(_PBSobject): """PBS node class""" def is_free(self): """Check if node is free""" value = self.return_value('state') if value == 'free': return self.TRUE else: return self.FALSE def has_job(self): """Does the node run a job""" try: a = self['jobs'] return self.TRUE except KeyError, detail: return self.FALSE def get_jobs(self, unique=None): """Returns a list of the currently running job-id('s) on the node""" jobs = self.get_value('jobs') if jobs: if isinstance(jobs, str): jlist = re.compile('[^\\ /]\\d+[^/.]').findall( jobs ) if not unique: return jlist else: return self.uniq(jlist) else: job_re = re.compile('^(?:\d+/)?(.+)') l = list() if unique: for j in jobs: jobstr = job_re.findall(j.strip())[0] if jobstr not in l: l.append(jobstr) return l else: return jobs return list() class queue(_PBSobject): """PBS queue class""" def is_enabled(self): value = self.return_value('enabled') if value == 'True': return self.TRUE else: return self.FALSE def is_execution(self): value = self.return_value('queue_type') if value == 'Execution': return self.TRUE else: return self.FALSE class server(_PBSobject): """PBS server class""" def get_version(self): return self.get_value('pbs_version') def main(): p = PBSQuery() serverinfo = p.get_serverinfo() for server in serverinfo.keys(): print server, ' version: ', serverinfo[server].get_version() for resource in serverinfo[server].keys(): print '\t ', resource, ' = ', serverinfo[server][resource] queues = p.getqueues() for queue in queues.keys(): print queue if queues[queue].is_execution(): print '\t ', queues[queue] if queues[queue].has_key('acl_groups'): print '\t acl_groups: yes' else: print '\t acl_groups: no' jobs = p.getjobs() for name,job in jobs.items(): if job.is_running(): print job l = ['state'] nodes = p.getnodes(l) for name,node in nodes.items(): if node.is_free(): print node if __name__ == "__main__": main()
VPAC/pbs_python
src/PBSQuery.py
Python
gpl-3.0
17,223
function remoteMathService(cb) { var one, two; //queue our promises to resolve after they actually execute Promise.all([callOneService,callTwoService]).then(responses => { one = responses[0]; two = responses[1]; //maintained the existing logic with the callback return cb(undefined, one + two); }, function(err){ console.log("error happened"); }); } //make our service calls promises, so they can resolve asynchronously //uncomment the console.logs to see the order in which these Promises //get executed const callOneService = new Promise(resolve => { setTimeout(function() { //console.log("in func 1"); resolve(1); }, 1000); } ) const callTwoService = new Promise(resolve => { setTimeout(function() { //console.log("in func 2"); resolve(2); }, 1500); }) //returns a promise that we can tie into either as a service return or for testing remoteMathService(function(err, answer) { if (err) console.log("error ", err); if (answer !== 3) { console.log("wrong answer", answer); return new Promise(resolve =>{ resolve("wrong answer"); }); } else { console.log("correct"); return new Promise(resolve =>{ resolve("correct"); }); } });
JoshuaDEdwards/RHStuff
Exercise1/remoteMathService.js
JavaScript
gpl-3.0
1,181
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '/home/yc/code/calibre/calibre/src/calibre/gui2/preferences/look_feel.ui' # # Created: Thu Oct 25 16:54:55 2012 # by: PyQt4 UI code generator 4.8.5 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: _fromUtf8 = lambda s: s class Ui_Form(object): def setupUi(self, Form): Form.setObjectName(_fromUtf8("Form")) Form.resize(820, 519) Form.setWindowTitle(_("Form")) self.gridLayout_2 = QtGui.QGridLayout(Form) self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) self.tabWidget = QtGui.QTabWidget(Form) self.tabWidget.setObjectName(_fromUtf8("tabWidget")) self.tab = QtGui.QWidget() self.tab.setObjectName(_fromUtf8("tab")) self.gridLayout_9 = QtGui.QGridLayout(self.tab) self.gridLayout_9.setObjectName(_fromUtf8("gridLayout_9")) self.label_7 = QtGui.QLabel(self.tab) self.label_7.setText(_("Choose &language (requires restart):")) self.label_7.setObjectName(_fromUtf8("label_7")) self.gridLayout_9.addWidget(self.label_7, 2, 0, 1, 1) self.opt_language = QtGui.QComboBox(self.tab) self.opt_language.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToMinimumContentsLengthWithIcon) self.opt_language.setMinimumContentsLength(20) self.opt_language.setObjectName(_fromUtf8("opt_language")) self.gridLayout_9.addWidget(self.opt_language, 2, 1, 1, 1) self.opt_systray_icon = QtGui.QCheckBox(self.tab) self.opt_systray_icon.setText(_("Enable system &tray icon (needs restart)")) self.opt_systray_icon.setObjectName(_fromUtf8("opt_systray_icon")) self.gridLayout_9.addWidget(self.opt_systray_icon, 3, 0, 1, 1) self.label_17 = QtGui.QLabel(self.tab) self.label_17.setText(_("User Interface &layout (needs restart):")) self.label_17.setObjectName(_fromUtf8("label_17")) self.gridLayout_9.addWidget(self.label_17, 1, 0, 1, 1) self.opt_gui_layout = QtGui.QComboBox(self.tab) self.opt_gui_layout.setMaximumSize(QtCore.QSize(250, 16777215)) self.opt_gui_layout.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToMinimumContentsLengthWithIcon) self.opt_gui_layout.setMinimumContentsLength(20) self.opt_gui_layout.setObjectName(_fromUtf8("opt_gui_layout")) self.gridLayout_9.addWidget(self.opt_gui_layout, 1, 1, 1, 1) self.opt_disable_animations = QtGui.QCheckBox(self.tab) self.opt_disable_animations.setToolTip(_("Disable all animations. Useful if you have a slow/old computer.")) self.opt_disable_animations.setText(_("Disable &animations")) self.opt_disable_animations.setObjectName(_fromUtf8("opt_disable_animations")) self.gridLayout_9.addWidget(self.opt_disable_animations, 3, 1, 1, 1) self.opt_disable_tray_notification = QtGui.QCheckBox(self.tab) self.opt_disable_tray_notification.setText(_("Disable &notifications in system tray")) self.opt_disable_tray_notification.setObjectName(_fromUtf8("opt_disable_tray_notification")) self.gridLayout_9.addWidget(self.opt_disable_tray_notification, 4, 0, 1, 1) self.opt_show_splash_screen = QtGui.QCheckBox(self.tab) self.opt_show_splash_screen.setText(_("Show &splash screen at startup")) self.opt_show_splash_screen.setObjectName(_fromUtf8("opt_show_splash_screen")) self.gridLayout_9.addWidget(self.opt_show_splash_screen, 4, 1, 1, 1) self.groupBox_2 = QtGui.QGroupBox(self.tab) self.groupBox_2.setTitle(_("&Toolbar")) self.groupBox_2.setObjectName(_fromUtf8("groupBox_2")) self.gridLayout_8 = QtGui.QGridLayout(self.groupBox_2) self.gridLayout_8.setObjectName(_fromUtf8("gridLayout_8")) self.opt_toolbar_icon_size = QtGui.QComboBox(self.groupBox_2) self.opt_toolbar_icon_size.setObjectName(_fromUtf8("opt_toolbar_icon_size")) self.gridLayout_8.addWidget(self.opt_toolbar_icon_size, 0, 1, 1, 1) self.label_5 = QtGui.QLabel(self.groupBox_2) self.label_5.setText(_("&Icon size:")) self.label_5.setObjectName(_fromUtf8("label_5")) self.gridLayout_8.addWidget(self.label_5, 0, 0, 1, 1) self.opt_toolbar_text = QtGui.QComboBox(self.groupBox_2) self.opt_toolbar_text.setObjectName(_fromUtf8("opt_toolbar_text")) self.gridLayout_8.addWidget(self.opt_toolbar_text, 1, 1, 1, 1) self.label_8 = QtGui.QLabel(self.groupBox_2) self.label_8.setText(_("Show &text under icons:")) self.label_8.setObjectName(_fromUtf8("label_8")) self.gridLayout_8.addWidget(self.label_8, 1, 0, 1, 1) self.gridLayout_9.addWidget(self.groupBox_2, 7, 0, 1, 2) spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.gridLayout_9.addItem(spacerItem, 8, 0, 1, 1) self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) self.label_2 = QtGui.QLabel(self.tab) self.label_2.setText(_("Interface font:")) self.label_2.setObjectName(_fromUtf8("label_2")) self.horizontalLayout.addWidget(self.label_2) self.font_display = QtGui.QLineEdit(self.tab) self.font_display.setReadOnly(True) self.font_display.setObjectName(_fromUtf8("font_display")) self.horizontalLayout.addWidget(self.font_display) self.gridLayout_9.addLayout(self.horizontalLayout, 6, 0, 1, 1) self.change_font_button = QtGui.QPushButton(self.tab) self.change_font_button.setText(_("Change &font (needs restart)")) self.change_font_button.setObjectName(_fromUtf8("change_font_button")) self.gridLayout_9.addWidget(self.change_font_button, 6, 1, 1, 1) self.label_widget_style = QtGui.QLabel(self.tab) self.label_widget_style.setText(_("User interface &style (needs restart):")) self.label_widget_style.setObjectName(_fromUtf8("label_widget_style")) self.gridLayout_9.addWidget(self.label_widget_style, 0, 0, 1, 1) self.opt_ui_style = QtGui.QComboBox(self.tab) self.opt_ui_style.setObjectName(_fromUtf8("opt_ui_style")) self.gridLayout_9.addWidget(self.opt_ui_style, 0, 1, 1, 1) self.opt_book_list_tooltips = QtGui.QCheckBox(self.tab) self.opt_book_list_tooltips.setText(_("Show &tooltips in the book list")) self.opt_book_list_tooltips.setObjectName(_fromUtf8("opt_book_list_tooltips")) self.gridLayout_9.addWidget(self.opt_book_list_tooltips, 5, 0, 1, 1) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(_fromUtf8(I("lt.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.tabWidget.addTab(self.tab, icon, _fromUtf8("")) self.tab_4 = QtGui.QWidget() self.tab_4.setObjectName(_fromUtf8("tab_4")) self.gridLayout_12 = QtGui.QGridLayout(self.tab_4) self.gridLayout_12.setObjectName(_fromUtf8("gridLayout_12")) self.label_3 = QtGui.QLabel(self.tab_4) self.label_3.setText(_("Note that <b>comments</b> will always be displayed at the end, regardless of the position you assign here.")) self.label_3.setWordWrap(True) self.label_3.setObjectName(_fromUtf8("label_3")) self.gridLayout_12.addWidget(self.label_3, 2, 1, 1, 1) self.opt_use_roman_numerals_for_series_number = QtGui.QCheckBox(self.tab_4) self.opt_use_roman_numerals_for_series_number.setText(_("Use &Roman numerals for series")) self.opt_use_roman_numerals_for_series_number.setChecked(True) self.opt_use_roman_numerals_for_series_number.setObjectName(_fromUtf8("opt_use_roman_numerals_for_series_number")) self.gridLayout_12.addWidget(self.opt_use_roman_numerals_for_series_number, 0, 1, 1, 1) self.groupBox = QtGui.QGroupBox(self.tab_4) self.groupBox.setTitle(_("Select displayed metadata")) self.groupBox.setObjectName(_fromUtf8("groupBox")) self.gridLayout_3 = QtGui.QGridLayout(self.groupBox) self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3")) self.df_up_button = QtGui.QToolButton(self.groupBox) self.df_up_button.setToolTip(_("Move up")) icon1 = QtGui.QIcon() icon1.addPixmap(QtGui.QPixmap(_fromUtf8(I("arrow-up.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.df_up_button.setIcon(icon1) self.df_up_button.setObjectName(_fromUtf8("df_up_button")) self.gridLayout_3.addWidget(self.df_up_button, 0, 1, 1, 1) self.df_down_button = QtGui.QToolButton(self.groupBox) self.df_down_button.setToolTip(_("Move down")) icon2 = QtGui.QIcon() icon2.addPixmap(QtGui.QPixmap(_fromUtf8(I("arrow-down.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.df_down_button.setIcon(icon2) self.df_down_button.setObjectName(_fromUtf8("df_down_button")) self.gridLayout_3.addWidget(self.df_down_button, 2, 1, 1, 1) self.field_display_order = QtGui.QListView(self.groupBox) self.field_display_order.setAlternatingRowColors(True) self.field_display_order.setObjectName(_fromUtf8("field_display_order")) self.gridLayout_3.addWidget(self.field_display_order, 0, 0, 3, 1) spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.gridLayout_3.addItem(spacerItem1, 1, 1, 1, 1) self.gridLayout_12.addWidget(self.groupBox, 2, 0, 2, 1) self.hboxlayout = QtGui.QHBoxLayout() self.hboxlayout.setObjectName(_fromUtf8("hboxlayout")) self.label = QtGui.QLabel(self.tab_4) self.label.setText(_("Default author link template:")) self.label.setObjectName(_fromUtf8("label")) self.hboxlayout.addWidget(self.label) self.opt_default_author_link = QtGui.QLineEdit(self.tab_4) self.opt_default_author_link.setToolTip(_("<p>Enter a template to be used to create a link for\n" "an author in the books information dialog. This template will\n" "be used when no link has been provided for the author using\n" "Manage Authors. You can use the values {author} and\n" "{author_sort}, and any template function.")) self.opt_default_author_link.setObjectName(_fromUtf8("opt_default_author_link")) self.hboxlayout.addWidget(self.opt_default_author_link) self.gridLayout_12.addLayout(self.hboxlayout, 0, 0, 1, 1) self.opt_bd_show_cover = QtGui.QCheckBox(self.tab_4) self.opt_bd_show_cover.setText(_("Show &cover in the book details panel")) self.opt_bd_show_cover.setObjectName(_fromUtf8("opt_bd_show_cover")) self.gridLayout_12.addWidget(self.opt_bd_show_cover, 1, 0, 1, 2) icon3 = QtGui.QIcon() icon3.addPixmap(QtGui.QPixmap(_fromUtf8(I("book.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.tabWidget.addTab(self.tab_4, icon3, _fromUtf8("")) self.tab_2 = QtGui.QWidget() self.tab_2.setObjectName(_fromUtf8("tab_2")) self.gridLayout_10 = QtGui.QGridLayout(self.tab_2) self.gridLayout_10.setObjectName(_fromUtf8("gridLayout_10")) self.opt_categories_using_hierarchy = EditWithComplete(self.tab_2) self.opt_categories_using_hierarchy.setToolTip(_("A comma-separated list of categories in which items containing\n" "periods are displayed in the tag browser trees. For example, if\n" "this box contains \'tags\' then tags of the form \'Mystery.English\'\n" "and \'Mystery.Thriller\' will be displayed with English and Thriller\n" "both under \'Mystery\'. If \'tags\' is not in this box,\n" "then the tags will be displayed each on their own line.")) self.opt_categories_using_hierarchy.setObjectName(_fromUtf8("opt_categories_using_hierarchy")) self.gridLayout_10.addWidget(self.opt_categories_using_hierarchy, 3, 2, 1, 3) self.label_9 = QtGui.QLabel(self.tab_2) self.label_9.setText(_("Tags browser category &partitioning method:")) self.label_9.setObjectName(_fromUtf8("label_9")) self.gridLayout_10.addWidget(self.label_9, 0, 0, 1, 2) self.opt_tags_browser_partition_method = QtGui.QComboBox(self.tab_2) self.opt_tags_browser_partition_method.setToolTip(_("Choose how tag browser subcategories are displayed when\n" "there are more items than the limit. Select by first\n" "letter to see an A, B, C list. Choose partitioned to\n" "have a list of fixed-sized groups. Set to disabled\n" "if you never want subcategories")) self.opt_tags_browser_partition_method.setObjectName(_fromUtf8("opt_tags_browser_partition_method")) self.gridLayout_10.addWidget(self.opt_tags_browser_partition_method, 0, 2, 1, 1) self.label_10 = QtGui.QLabel(self.tab_2) self.label_10.setText(_("&Collapse when more items than:")) self.label_10.setObjectName(_fromUtf8("label_10")) self.gridLayout_10.addWidget(self.label_10, 0, 3, 1, 1) self.opt_tags_browser_collapse_at = QtGui.QSpinBox(self.tab_2) self.opt_tags_browser_collapse_at.setToolTip(_("If a Tag Browser category has more than this number of items, it is divided\n" "up into subcategories. If the partition method is set to disable, this value is ignored.")) self.opt_tags_browser_collapse_at.setMaximum(10000) self.opt_tags_browser_collapse_at.setObjectName(_fromUtf8("opt_tags_browser_collapse_at")) self.gridLayout_10.addWidget(self.opt_tags_browser_collapse_at, 0, 4, 1, 1) spacerItem2 = QtGui.QSpacerItem(690, 252, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.gridLayout_10.addItem(spacerItem2, 5, 0, 1, 5) self.label_8111 = QtGui.QLabel(self.tab_2) self.label_8111.setText(_("Categories not to partition:")) self.label_8111.setObjectName(_fromUtf8("label_8111")) self.gridLayout_10.addWidget(self.label_8111, 1, 2, 1, 1) self.opt_tag_browser_dont_collapse = EditWithComplete(self.tab_2) self.opt_tag_browser_dont_collapse.setToolTip(_("A comma-separated list of categories that are not to\n" "be partitioned even if the number of items is larger than\n" "the value shown above. This option can be used to\n" "avoid collapsing hierarchical categories that have only\n" "a few top-level elements.")) self.opt_tag_browser_dont_collapse.setObjectName(_fromUtf8("opt_tag_browser_dont_collapse")) self.gridLayout_10.addWidget(self.opt_tag_browser_dont_collapse, 1, 3, 1, 2) self.opt_show_avg_rating = QtGui.QCheckBox(self.tab_2) self.opt_show_avg_rating.setText(_("Show &average ratings in the tags browser")) self.opt_show_avg_rating.setChecked(True) self.opt_show_avg_rating.setObjectName(_fromUtf8("opt_show_avg_rating")) self.gridLayout_10.addWidget(self.opt_show_avg_rating, 2, 0, 1, 5) self.label_81 = QtGui.QLabel(self.tab_2) self.label_81.setText(_("Categories with &hierarchical items:")) self.label_81.setObjectName(_fromUtf8("label_81")) self.gridLayout_10.addWidget(self.label_81, 3, 0, 1, 1) self.opt_tag_browser_old_look = QtGui.QCheckBox(self.tab_2) self.opt_tag_browser_old_look.setText(_("Use &alternating row colors in the Tag Browser")) self.opt_tag_browser_old_look.setObjectName(_fromUtf8("opt_tag_browser_old_look")) self.gridLayout_10.addWidget(self.opt_tag_browser_old_look, 4, 0, 1, 5) icon4 = QtGui.QIcon() icon4.addPixmap(QtGui.QPixmap(_fromUtf8(I("tags.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.tabWidget.addTab(self.tab_2, icon4, _fromUtf8("")) self.tab_3 = QtGui.QWidget() self.tab_3.setObjectName(_fromUtf8("tab_3")) self.gridLayout_11 = QtGui.QGridLayout(self.tab_3) self.gridLayout_11.setObjectName(_fromUtf8("gridLayout_11")) self.opt_separate_cover_flow = QtGui.QCheckBox(self.tab_3) self.opt_separate_cover_flow.setText(_("Show cover &browser in a separate window (needs restart)")) self.opt_separate_cover_flow.setObjectName(_fromUtf8("opt_separate_cover_flow")) self.gridLayout_11.addWidget(self.opt_separate_cover_flow, 0, 0, 1, 2) self.label_6 = QtGui.QLabel(self.tab_3) self.label_6.setText(_("&Number of covers to show in browse mode (needs restart):")) self.label_6.setObjectName(_fromUtf8("label_6")) self.gridLayout_11.addWidget(self.label_6, 1, 0, 1, 1) self.opt_cover_flow_queue_length = QtGui.QSpinBox(self.tab_3) self.opt_cover_flow_queue_length.setObjectName(_fromUtf8("opt_cover_flow_queue_length")) self.gridLayout_11.addWidget(self.opt_cover_flow_queue_length, 1, 1, 1, 1) spacerItem3 = QtGui.QSpacerItem(690, 283, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.gridLayout_11.addItem(spacerItem3, 4, 0, 1, 2) self.opt_cb_fullscreen = QtGui.QCheckBox(self.tab_3) self.opt_cb_fullscreen.setText(_("When showing cover browser in separate window, show it &fullscreen")) self.opt_cb_fullscreen.setObjectName(_fromUtf8("opt_cb_fullscreen")) self.gridLayout_11.addWidget(self.opt_cb_fullscreen, 2, 0, 1, 2) self.fs_help_msg = QtGui.QLabel(self.tab_3) self.fs_help_msg.setStyleSheet(_fromUtf8("margin-left: 1.5em")) self.fs_help_msg.setText(_("You can press the %s keys to toggle full screen mode.")) self.fs_help_msg.setWordWrap(True) self.fs_help_msg.setObjectName(_fromUtf8("fs_help_msg")) self.gridLayout_11.addWidget(self.fs_help_msg, 3, 0, 1, 2) icon5 = QtGui.QIcon() icon5.addPixmap(QtGui.QPixmap(_fromUtf8(I("cover_flow.png"))), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.tabWidget.addTab(self.tab_3, icon5, _fromUtf8("")) self.gridLayout_2.addWidget(self.tabWidget, 0, 0, 1, 1) self.label_7.setBuddy(self.opt_language) self.label_17.setBuddy(self.opt_gui_layout) self.label_5.setBuddy(self.opt_toolbar_icon_size) self.label_8.setBuddy(self.opt_toolbar_text) self.label_2.setBuddy(self.font_display) self.label_widget_style.setBuddy(self.opt_ui_style) self.label.setBuddy(self.opt_default_author_link) self.label_9.setBuddy(self.opt_tags_browser_partition_method) self.label_10.setBuddy(self.opt_tags_browser_collapse_at) self.label_8111.setBuddy(self.opt_tag_browser_dont_collapse) self.label_81.setBuddy(self.opt_categories_using_hierarchy) self.label_6.setBuddy(self.opt_cover_flow_queue_length) self.retranslateUi(Form) self.tabWidget.setCurrentIndex(0) QtCore.QMetaObject.connectSlotsByName(Form) def retranslateUi(self, Form): self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _("Main Interface")) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), _("Book Details")) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _("Tag Browser")) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), _("Cover Browser")) from calibre.gui2.complete2 import EditWithComplete
yeyanchao/calibre
src/calibre/gui2/preferences/look_feel_ui.py
Python
gpl-3.0
19,303
<?php /** * This file is part of a FireGento e.V. module. * * This FireGento e.V. module is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version 3 as * published by the Free Software Foundation. * * This script is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * PHP version 5 * * @category FireGento * @package FireGento_MageSetup * @author FireGento Team <team@firegento.com> * @copyright 2013-2015 FireGento Team (http://www.firegento.com) * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) */ /** * Observer class * * @category FireGento * @package FireGento_MageSetup * @author FireGento Team <team@firegento.com> */ class FireGento_MageSetup_Model_Observer { const CONFIG_GOOGLE_ANALYTICS_IP_ANONYMIZATION = 'google/analytics/ip_anonymization'; /** * Add "Visible on Checkout Review on Front-end" Option to Attribute Settings * * Event: <adminhtml_catalog_product_attribute_edit_prepare_form> * * @param Varien_Event_Observer $observer Observer * @return FireGento_MageSetup_Model_Observer Observer */ public function addIsVisibleOnCheckoutOption(Varien_Event_Observer $observer) { $event = $observer->getEvent(); $form = $event->getForm(); $fieldset = $form->getElement('front_fieldset'); $source = Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray(); $fieldset->addField( 'is_visible_on_checkout', 'select', array( 'name' => 'is_visible_on_checkout', 'label' => Mage::helper('magesetup')->__('Visible in Checkout'), 'title' => Mage::helper('magesetup')->__('Visible in Checkout'), 'values' => $source, ) ); return $this; } /** * Filters all agreements * * Filters all agreements against the Magento template filter. This enables the Magento * administrator define a cms static block as the content of the checkout agreements.. * * Event: <core_block_abstract_to_html_before> * * @param Varien_Event_Observer $observer Observer * @return FireGento_MageSetup_Model_Observer Observer */ public function filterAgreements(Varien_Event_Observer $observer) { $block = $observer->getEvent()->getBlock(); if ($block->getType() == 'checkout/agreements') { if ($agreements = $block->getAgreements()) { $agreements->setOrder('position', Varien_Data_Collection::SORT_ORDER_ASC); $collection = new Varien_Data_Collection(); foreach ($agreements as $agreement) { $agreement->setData('content', $this->_filterString($agreement->getData('content'))); $agreement->setData('checkbox_text', $this->_filterString($agreement->getData('checkbox_text'))); $collection->addItem($agreement); } $observer->getEvent()->getBlock()->setAgreements($collection); } } return $this; } /** * Calls the Magento template filter to transform {{block type="cms/block" block_id="xyz"}} * into the specific html code * * @param string $string Agreement to filter * @return string Processed String */ protected function _filterString($string) { $processor = Mage::getModel('cms/template_filter'); $string = $processor->filter($string); return $string; } /** * Auto-Generates the meta information of a product. * Event: <catalog_product_save_before> * * @param Varien_Event_Observer $observer Observer * @return FireGento_MageSetup_Model_Observer Observer */ public function autogenerateMetaInformation(Varien_Event_Observer $observer) { /* @var $product Mage_Catalog_Model_Product */ $product = $observer->getEvent()->getProduct(); if ($product->getData('meta_autogenerate') == 1) { // Set Meta Title $product->setMetaTitle($product->getName()); // Set Meta Keywords $keywords = $this->_getCategoryKeywords($product, $product->getStoreId()); if (!empty($keywords)) { if (mb_strlen($keywords) > 255) { $remainder = ''; $keywords = Mage::helper('core/string')->truncate($keywords, 255, '', $remainder, false); } $product->setMetaKeyword($keywords); } // Set Meta Description $description = $product->getShortDescription(); if (empty($description)) { $description = $product->getDescription(); } if (empty($description)) { $description = $keywords; } $description = strip_tags($description); if (mb_strlen($description) > 255) { $remainder = ''; $description = Mage::helper('core/string')->truncate($description, 255, '...', $remainder, false); } $product->setMetaDescription($description); } return $this; } /** * Get the categories of the current product * * @param Mage_Catalog_Model_Product $product Product * @return array Categories */ protected function _getCategoryKeywords($product, $storeid = 0) { $categories = $product->getCategoryIds(); $categoryArr = $this->_fetchCategoryNames($categories, $storeid); $keywords = $this->_buildKeywords($categoryArr); return $keywords; } /** * Fetches all category names via category path; adds first the assigned * categories and second all categories via path. * * @param array $categories Category Ids * @return array Categories */ protected function _fetchCategoryNames($categories, $storeid=0) { $return = array( 'assigned' => array(), 'path' => array() ); $storeRootCategoryId = Mage::app()->getStore($storeid)->getRootCategoryId(); foreach ($categories as $categoryId) { // Check if category was already added if (array_key_exists($categoryId, $return['assigned']) || array_key_exists($categoryId, $return['path']) ) { return; } /* @var $category Mage_Catalog_Model_Category */ $category = Mage::getModel('catalog/category')->setStoreId($storeid)->load($categoryId); $path = $category->getPath(); $pathIds = explode('/', $path); // Fetch path ids and remove the first two (base and root category) $categorySuperRootCategoryId = array_shift($pathIds); $categoryRootCategoryId = array_shift($pathIds); // use category names only if root category id matches if ($categoryRootCategoryId == $storeRootCategoryId || 0 == $storeid) { $return['assigned'][$categoryId] = $category->getName(); // Fetch the names from path categories if (count($pathIds) > 0) { foreach ($pathIds as $pathId) { if (!array_key_exists($pathId, $return['assigned']) && !array_key_exists($pathId, $return['path']) ) { /* @var $pathCategory Mage_Catalog_Model_Category */ $pathCategory = Mage::getModel('catalog/category')->setStoreId($storeid)->load($pathId); $return['path'][$pathId] = $pathCategory->getName(); } } } } } return $return; } /** * Processes the category array and generates a string * * @param array $categoryTypes Categories * @return string Keywords */ protected function _buildKeywords($categoryTypes) { if (!$categoryTypes) { return ''; } $keywords = array(); foreach ($categoryTypes as $categories) { $keywords[] = trim(implode(', ', $categories), ', '); } return trim(implode(', ', $keywords), ', '); } /** * Add "Required" and "Visible on Custom Creation" Option to Checkout Agreements * * Event: <adminhtml_block_html_before> * * @param Varien_Event_Observer $observer Observer * @return FireGento_MageSetup_Model_Observer Observer */ public function addOptionsForAgreements(Varien_Event_Observer $observer) { $block = $observer->getEvent()->getBlock(); if ($block instanceof Mage_Adminhtml_Block_Checkout_Agreement_Edit_Form) { $helper = Mage::helper('magesetup'); $form = $block->getForm(); /** @var Varien_Data_Form_Element_Fieldset $fieldset */ $fieldset = $form->getElement('base_fieldset'); $form->getElement('content')->setRequired(false); $fieldset->addField('is_required', 'select', array( 'label' => $helper->__('Required'), 'title' => $helper->__('Required'), 'note' => $helper->__('Display Checkbox on Frontend'), 'name' => 'is_required', 'required' => true, 'options' => array( '1' => $helper->__('Yes'), '0' => $helper->__('No'), ), )); $fieldset->addField('agreement_type', 'select', array( 'label' => $helper->__('Display on'), 'title' => $helper->__('Display on'), 'note' => $helper->__('Require Confirmation on Customer Registration and/or Checkout'), 'name' => 'agreement_type', 'required' => true, 'options' => Mage::getSingleton('magesetup/source_agreementType')->getOptionArray(), )); $fieldset->addField('revocation_product_type', 'select', array( 'label' => $helper->__('Display for following Revocation Product Types'), 'title' => $helper->__('Display for following Revocation Product Types'), 'note' => $helper->__('Will only be displayed if at least one product of the selected type is in cart'), 'name' => 'revocation_product_type', 'required' => false, 'options' => Mage::getSingleton('magesetup/source_revocationProductType')->getOptionArray(), )); if (!$fieldset->getElements()->searchById('position')) { $fieldset->addField('position', 'text', array( 'label' => $helper->__('Position'), 'title' => $helper->__('Position'), 'name' => 'position', 'value' => '0', 'required' => true, 'class' => 'validate-zero-or-greater', )); } Mage::dispatchEvent('magesetup_adminhtml_checkout_agreement_edit_form', array( 'form' => $form, 'fieldset' => $fieldset, )); $model = Mage::registry('checkout_agreement'); $form->setValues($model->getData()); $block->setForm($form); } return $this; } /** * Get required agreements on custom registration * * @return array Customer agreement ids */ protected function _getCustomerCreateAgreements() { $ids = Mage::getModel('checkout/agreement')->getCollection() ->addStoreFilter(Mage::app()->getStore()->getId()) ->addFieldToFilter('is_active', 1) ->addFieldToFilter('agreement_type', array('in' => array( FireGento_MageSetup_Model_Source_AgreementType::AGREEMENT_TYPE_CUSTOMER, FireGento_MageSetup_Model_Source_AgreementType::AGREEMENT_TYPE_BOTH, )))// Only get Required Elements ->getAllIds(); return $ids; } /** * Check if there are required agreements for the customer registration * and validate them if applicable. * * Event: <controller_action_predispatch_customer_account_createpost> * * @param Varien_Event_Observer $observer Observer */ public function customerCreatePreDispatch(Varien_Event_Observer $observer) { $controller = $observer->getEvent()->getControllerAction(); if (!$this->requiredAgreementsAccepted($controller)) { $session = Mage::getSingleton('customer/session'); $session->addException( new Mage_Customer_Exception('Cannot create customer: agreements not confirmed'), Mage::helper('magesetup')->__('Agreements not confirmed.') ); $controller->getResponse()->setRedirect(Mage::getUrl('*/*/create', array('_secure' => true))); $controller->setFlag( $controller->getRequest()->getActionName(), Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true ); } } private function requiredAgreementsAccepted($controller) { $requiredAgreements = $this->_getCustomerCreateAgreements(); if (!is_array($requiredAgreements)) { return false; } elseif (is_array($requiredAgreements) && count($requiredAgreements) === 0) { return true; } $postedAgreements = $controller->getRequest()->getPost('agreement', array()); if (!is_array($postedAgreements)) { return false; } $postedAgreements = array_keys($postedAgreements); $diff = array_diff($requiredAgreements, $postedAgreements); if ($diff) { return false; } return true; } /** * add product attributes to quote items collection * * @magentoEvent sales_quote_config_get_product_attributes * * @param Varien_Event_Observer $observer Observer */ public function addProductAttributesToQuoteItems(Varien_Event_Observer $observer) { $cacheTag = 'magesetup_quote_attributes'; if (Mage::app()->useCache('eav') && Mage::app()->loadCache($cacheTag)) { foreach (explode(',', Mage::app()->loadCache($cacheTag)) as $_cacheRow) { $observer->getAttributes()->setData($_cacheRow, ''); } } else { $collection = Mage::getResourceModel('catalog/product_attribute_collection') ->setItemObjectClass('catalog/resource_eav_attribute') ->addFieldToFilter('additional_table.is_visible_on_checkout', 1); $attrList = array(); foreach ($collection as $_attribute) { $attrList[] = $_attribute->getAttributeCode(); $observer->getAttributes()->setData($_attribute->getAttributeCode(), ''); } Mage::app()->saveCache(implode(',', $attrList), $cacheTag, array('eav'), false); } } /** * Compatibility for Magento < 1.9 * * @magentoEvent core_block_abstract_to_html_after * * @param Varien_Event_Observer $observer Observer */ public function setGAAnonymizerCode(Varien_Event_Observer $observer) { $block = $observer->getEvent()->getBlock(); if ($block instanceof Mage_GoogleAnalytics_Block_Ga && version_compare(Mage::getVersion(), '1.9', '<=')) { $transport = $observer->getEvent()->getTransport(); $html = $transport->getHtml(); if (!Mage::getStoreConfigFlag(self::CONFIG_GOOGLE_ANALYTICS_IP_ANONYMIZATION)) { return; } $matches = array(); $setAccountExpression = '/_gaq\.push\(\[\'_setAccount\', \'[a-zA-Z0-9-_]+\'\]\);\n/'; $append = '_gaq.push([\'_gat._anonymizeIp\']);'; if (preg_match_all($setAccountExpression, $html, $matches) && count($matches) && count($matches[0])) { $html = preg_replace($setAccountExpression, $matches[0][0] . $append . "\n", $html); } $transport->setHtml($html); } } }
firegento/firegento-magesetup
src/app/code/community/FireGento/MageSetup/Model/Observer.php
PHP
gpl-3.0
16,769
package me.desht.pneumaticcraft.common.progwidgets; import me.desht.pneumaticcraft.common.ai.IDroneBase; import me.desht.pneumaticcraft.common.entity.living.EntityDrone; import me.desht.pneumaticcraft.common.item.ItemPlastic; import me.desht.pneumaticcraft.lib.Textures; import net.minecraft.entity.ai.EntityAIBase; import net.minecraft.util.ResourceLocation; public class ProgWidgetStandby extends ProgWidget { @Override public boolean hasStepInput() { return true; } @Override public Class<? extends IProgWidget> returnType() { return null; } @Override public Class<? extends IProgWidget>[] getParameters() { return null; } @Override public String getWidgetString() { return "standby"; } @Override public int getCraftingColorIndex() { return ItemPlastic.LIME; } @Override public WidgetDifficulty getDifficulty() { return WidgetDifficulty.EASY; } @Override public ResourceLocation getTexture() { return Textures.PROG_WIDGET_STANDBY; } @Override public EntityAIBase getWidgetAI(IDroneBase drone, IProgWidget widget) { return new DroneAIStandby((EntityDrone) drone); } public static class DroneAIStandby extends EntityAIBase { private final EntityDrone drone; public DroneAIStandby(EntityDrone drone) { this.drone = drone; } @Override public boolean shouldExecute() { drone.setStandby(true); return false; } } }
desht/pnc-repressurized
src/main/java/me/desht/pneumaticcraft/common/progwidgets/ProgWidgetStandby.java
Java
gpl-3.0
1,576
/** System Interrupts Generated Driver File @Company: Microchip Technology Inc. @File Name: pin_manager.h @Summary: This is the generated manager file for the MPLAB(c) Code Configurator device. This manager configures the pins direction, initial state, analog setting. The peripheral pin select, PPS, configuration is also handled by this manager. @Description: This source file provides implementations for MPLAB(c) Code Configurator interrupts. Generation Information : Product Revision : MPLAB(c) Code Configurator - 4.26 Device : PIC24FJ256GA702 The generated drivers are tested against the following: Compiler : XC16 1.31 MPLAB : MPLAB X 3.60 Copyright (c) 2013 - 2015 released Microchip Technology Inc. All rights reserved. Microchip licenses to you the right to use, modify, copy and distribute Software only when embedded on a Microchip microcontroller or digital signal controller that is integrated into your product or third party product (pursuant to the sublicense terms in the accompanying license agreement). You should refer to the license agreement accompanying this Software for additional information regarding your rights and obligations. SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS. */ #ifndef _PIN_MANAGER_H #define _PIN_MANAGER_H /** Section: Includes */ #include <xc.h> /** Section: Device Pin Macros */ /** @Summary Sets the GPIO pin, RA0, high using LATA0. @Description Sets the GPIO pin, RA0, high using LATA0. @Preconditions The RA0 must be set to an output. @Returns None. @Param None. @Example <code> // Set RA0 high (1) POTEN_SetHigh(); </code> */ #define POTEN_SetHigh() _LATA0 = 1 /** @Summary Sets the GPIO pin, RA0, low using LATA0. @Description Sets the GPIO pin, RA0, low using LATA0. @Preconditions The RA0 must be set to an output. @Returns None. @Param None. @Example <code> // Set RA0 low (0) POTEN_SetLow(); </code> */ #define POTEN_SetLow() _LATA0 = 0 /** @Summary Toggles the GPIO pin, RA0, using LATA0. @Description Toggles the GPIO pin, RA0, using LATA0. @Preconditions The RA0 must be set to an output. @Returns None. @Param None. @Example <code> // Toggle RA0 POTEN_Toggle(); </code> */ #define POTEN_Toggle() _LATA0 ^= 1 /** @Summary Reads the value of the GPIO pin, RA0. @Description Reads the value of the GPIO pin, RA0. @Preconditions None. @Returns None. @Param None. @Example <code> uint16_t portValue; // Read RA0 postValue = POTEN_GetValue(); </code> */ #define POTEN_GetValue() _RA0 /** @Summary Configures the GPIO pin, RA0, as an input. @Description Configures the GPIO pin, RA0, as an input. @Preconditions None. @Returns None. @Param None. @Example <code> // Sets the RA0 as an input POTEN_SetDigitalInput(); </code> */ #define POTEN_SetDigitalInput() _TRISA0 = 1 /** @Summary Configures the GPIO pin, RA0, as an output. @Description Configures the GPIO pin, RA0, as an output. @Preconditions None. @Returns None. @Param None. @Example <code> // Sets the RA0 as an output POTEN_SetDigitalOutput(); </code> */ #define POTEN_SetDigitalOutput() _TRISA0 = 0 /** Section: Function Prototypes */ /** @Summary Configures the pin settings of the PIC24FJ256GA702 The peripheral pin select, PPS, configuration is also handled by this manager. @Description This is the generated manager file for the MPLAB(c) Code Configurator device. This manager configures the pins direction, initial state, analog setting. The peripheral pin select, PPS, configuration is also handled by this manager. @Preconditions None. @Returns None. @Param None. @Example <code> void SYSTEM_Initialize(void) { // Other initializers are called from this function PIN_MANAGER_Initialize(); } </code> */ void PIN_MANAGER_Initialize(void); #endif
artnavsegda/picnavsegda
mplabx/mcc/pic24fj256ga702/adc.X/mcc_generated_files/pin_manager.h
C
gpl-3.0
5,268
# coding:utf-8 """ Author : qbeenslee Created : 2014/12/12 """ import re # 客户端ID号 CLIENT_ID = "TR5kVmYeMEh9M" ''' 传输令牌格式 加密方式$迭代次数$盐$结果串 举个栗子: ====start==== md5$23$YUXQ_-2GfwhzVpt5IQWp$3ebb6e78bf7d0c1938578855982e2b1c ====end==== ''' MATCH_PWD = r"md5\$(\d\d)\$([a-zA-Z0-9_\-]{20})\$([a-f0-9]{32})" REMATCH_PWD = re.compile(MATCH_PWD) # 支持的上传文件格式 SUPPORT_IMAGE_TYPE_LIST = ['image/gif', 'image/jpeg', 'image/png', 'image/bmp', 'image/x-png', 'application/octet-stream'] # 最大上传大小 MAX_UPLOAD_FILE_SIZE = 10485760 # 10*1024*1024 =10M # 最小上传尺寸 MIN_IMAGE_SIZE = {'w': 10, 'h': 10} MAX_IMAGE_SIZE = {'w': 4000, 'h': 4000} # 图片裁剪的尺寸(THUMBNAIL) THUMB_SIZE_SMALL = {'w': 100, 'h': 100, 'thumb': 's'} THUMB_SIZE_NORMAL = {'w': 480, 'h': 480, 'thumb': 'n'} THUMB_SIZE_LARGE = {'w': 3000, 'h': 3000, 'thumb': 'l'} THUMB_SIZE_ORIGIN = {'w': 0, 'h': 0, 'thumb': 'r'} MAX_SHARE_DESCRIPTION_SIZE = 140 NOW_ANDROID_VERSION_CODE = 7 NOW_VERSION_DOWNLOAD_URL = "/static/download/nepenthes-beta0.9.3.apk" MAX_RAND_EMAIL_CODE = 99999 MIN_RAND_EMAIL_CODE = 10000 # 定位精度 PRECISION = 12 LOACTION_PRECISION = 4 PAGE_SIZE = 10
qbeenslee/Nepenthes-Server
config/configuration.py
Python
gpl-3.0
1,315
package de.ssmits.hibernateEavModel.persistence.core.eav; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.util.ArrayList; import java.util.Calendar; import java.util.List; import java.util.Locale; import java.util.Random; import java.util.UUID; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; import de.ssmits.hibernateEavModel.persistence.core.eav.dataObjects.EavObject; import de.ssmits.hibernateEavModel.persistence.core.eav.dataObjects.Employee; import de.ssmits.hibernateEavModel.persistence.core.eav.dataObjects.JunitTestObject; import de.ssmits.hibernateEavModel.persistence.core.entity.CoreAttribute; import de.ssmits.hibernateEavModel.persistence.core.entity.CoreEntity; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("classpath:spring/applicationContext-bootstrap.xml") @Transactional public class EavStoreManagerTest { @Autowired private EavFactory eavFactory; private static JunitTestObject testObject; private static Employee testEmployee; @Before public void createTestRecords() throws Exception { testObject = new JunitTestObject(1, Calendar.getInstance(), true, "EAV JUNIT TEST OBJECT"); testEmployee = new Employee("Ray", "Charles", "ray.charles@example.org", Locale.US, "+1 404 123 567"); } @After public void deleteTestRecords() throws Exception { testObject = null; testEmployee = null; } @Test public void testImportGenericObject_JpaTestObject() throws Exception { CoreEntity entity = this.eavFactory.getEavStoreManager().importGenericObject(testObject).getEntity(); assertNotNull(entity); assertEquals(4, entity.getAttributeValuePairs().size()); } @Test public void testImportGenericObject_Employee() throws Exception { CoreEntity entity = this.eavFactory.getEavStoreManager().importGenericObject(testEmployee).getEntity(); assertNotNull(entity); assertEquals(5, entity.getAttributeValuePairs().size()); } @Test public void testImportGenericObject_JpaEntity() throws Exception { CoreEntity entity = this.eavFactory.getEavStoreManager().importGenericObject(testObject).getEntity(); assertNotNull(entity); CoreEntity entityWithJpaObject = this.eavFactory.getEavStoreManager().importGenericObject(entity).getEntity(); assertNotNull(entityWithJpaObject); // TODO: Implement more tests to verify its correctly persisted into the eav store } @Test public void testReconstructObjectFromEav() throws Exception { EavObject eavObj = this.eavFactory.getEavStoreManager().importGenericObject(testObject); assertNotNull("Assuming test object was successfully imported into the eav store.", eavObj); JunitTestObject reconstructedObject = (JunitTestObject) this.eavFactory.getEavStoreManager().reconstructObjectFromEav(eavObj); assertEquals(testObject.getId(), reconstructedObject.getId()); assertEquals(testObject.getDate(), reconstructedObject.getDate()); assertEquals(testObject.getIsActive(), reconstructedObject.getIsActive()); assertEquals(testObject.getLabel(), reconstructedObject.getLabel()); } @Test public void testReconstructObjectFromEav_Employee() throws Exception { EavObject eavObj = this.eavFactory.getEavStoreManager().importGenericObject(testEmployee); assertNotNull("Assuming test object was successfully imported into the eav store.", eavObj); Employee reconstructedObject = (Employee) this.eavFactory.getEavStoreManager().reconstructObjectFromEav(eavObj); assertNotNull("Assuming reconstructed object is not null.", reconstructedObject); assertEquals(testEmployee.getFirstname(), reconstructedObject.getFirstname()); assertEquals(testEmployee.getLastname(), reconstructedObject.getLastname()); assertEquals(testEmployee.getEmail(), reconstructedObject.getEmail()); assertEquals(testEmployee.getLanguage(), reconstructedObject.getLanguage()); assertEquals(testEmployee.getPhoneNumber(), reconstructedObject.getPhoneNumber()); } @Test public void testReconstructObjectFromEav_JunitTestObject() throws Exception { EavObject eavObj = this.eavFactory.getEavStoreManager().importGenericObject(testObject); assertNotNull("Assuming test object was successfully imported into the eav store.", eavObj); JunitTestObject reconstructedObject = (JunitTestObject) this.eavFactory.getEavStoreManager().reconstructObjectFromEav(eavObj); assertNotNull("Assuming reconstructed object is not null.", reconstructedObject); assertEquals(testObject.getId(), reconstructedObject.getId()); assertEquals(testObject.getDate(), reconstructedObject.getDate()); assertEquals(testObject.getIsActive(), reconstructedObject.getIsActive()); assertEquals(testObject.getLabel(), reconstructedObject.getLabel()); } @Test public void testFindOneById() throws Exception { final EavObject eavObj = this.eavFactory.getEavStoreManager().importGenericObject(testEmployee); assertNotNull("Assuming test object was successfully imported into the eav store.", eavObj); final EavObject searchResult = this.eavFactory.getEavStoreManager().findOneById(eavObj.getId()); assertNotNull("Assuming persisted eav object has been found.", searchResult); assertEquals("Assuming eav entity id equals test entity id", eavObj.getId(), searchResult.getId()); } @Test public void testFindAll() throws Exception { final EavObject eavObj = this.eavFactory.getEavStoreManager().importGenericObject(testEmployee); assertNotNull("Assuming test object was successfully imported into the eav store.", eavObj); final List<EavObject> searchResult = this.eavFactory.getEavStoreManager().findAll(); assertNotNull("Expecting search result to be not null", searchResult); assertEquals("Assuming eav store contains 1 object.", 1, searchResult.size()); assertEquals("Assuming eav entity id equals test entity id", eavObj.getId(), searchResult.get(0).getId()); } @Test public void testFindByType() throws Exception { final EavObject eavObj = this.eavFactory.getEavStoreManager().importGenericObject(testEmployee); assertNotNull("Assuming test object was successfully imported into the eav store.", eavObj); final List<EavObject> searchResult = this.eavFactory.getEavStoreManager().findByType(testEmployee.getClass()); assertNotNull("Expecting search result to be not null", searchResult); assertEquals("Assuming eav store contains 1 object.", 1, searchResult.size()); assertEquals("Assuming eav entity id equals test entity id", eavObj.getId(), searchResult.get(0).getId()); assertEquals("Expecting classes to be equal", eavObj.getType(), searchResult.get(0).getType()); } @Test public void testFindByAttribute() throws Exception { final EavObject eavObj = this.eavFactory.getEavStoreManager().importGenericObject(testObject); assertNotNull("Assuming test object was successfully imported into the eav store.", eavObj); CoreAttribute testAttribute = null; for (CoreAttribute attribute : eavObj.getAttributes().keySet()) { testAttribute = attribute; break; } final List<EavObject> searchResult = this.eavFactory.getEavStoreManager().findByAttribute(testAttribute); assertNotNull("Expecting search result to be not null", searchResult); assertTrue("Expecting result object contains test attribute", searchResult.get(0).getAttributes().containsKey(testAttribute)); } @Test public void testFindByAttributeAndValue() throws Exception { final EavObject eavObj = this.eavFactory.getEavStoreManager().importGenericObject(testObject); assertNotNull("Assuming test object was successfully imported into the eav store.", eavObj); for (CoreAttribute attribute : eavObj.getAttributes().keySet()) { final Object attributeValue = eavObj.getAttributes().get(attribute); final List<EavObject> searchResult = this.eavFactory.getEavStoreManager().findByAttributeAndValue(attribute, attributeValue); assertNotNull("Expecting search result to be not null", searchResult); assertEquals("Expecting CoreEntity id to be equal", eavObj.getEntity().getId(), searchResult.get(0).getEntity().getId()); assertEquals( "Expecting attribute/value pair to match test objects attribute/value pair", eavObj.getAttributes().get(attribute), searchResult.get(0).getAttributes().get(attribute) ); } } @Test public void testFindByAttributeAndValue_recordCount_1K() throws Exception { List<EavObject> testObjects = new ArrayList<EavObject>(); // Generate 1K test records for (int i=1; i<=1000; i++) { testObjects.add( this.eavFactory.getEavStoreManager().importGenericObject( new JunitTestObject( new Random().nextInt(), Calendar.getInstance(), true, "JUNIT TEST OBJECT " + UUID.randomUUID().toString() ) ) ); } // define attribute/value pair to search for CoreAttribute testAttribute = null; Object testValue = null; for (CoreAttribute attr : testObjects.get(596).getAttributes().keySet()) { testAttribute = attr; testValue = testObjects.get(596).getAttributes().get(attr); break; } List<EavObject> searchResult = this.eavFactory.getEavStoreManager().findByAttributeAndValue(testAttribute, testValue); assertNotNull(searchResult); assertEquals(1, searchResult.size()); assertTrue(searchResult.get(0).getAttributes().containsKey(testAttribute)); assertEquals(testValue, searchResult.get(0).getAttributes().get(testAttribute)); } }
ssmits/JavaExperiments
HibernateEavModel/src/test/java/de/ssmits/hibernateEavModel/persistence/core/eav/EavStoreManagerTest.java
Java
gpl-3.0
9,994
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://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.4"/> <title>Xortify Honeypot Cloud Services: E:/Packages/xortify server/htdocs/include/xsd/legacy/spiderstat.php Source File</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/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </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 style="padding-left: 0.5em;"> <div id="projectname">Xortify Honeypot Cloud Services &#160;<span id="projectnumber">4.11</span> </div> <div id="projectbrief">This project allow any mid level PHP Developer to incorportate Xortify Honeypot</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.4 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Related&#160;Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File&#160;List</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Pages</a></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 id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="dir_885cc87fac2d91e269af0a5a959fa5f6.html">E:</a></li><li class="navelem"><a class="el" href="dir_370194428f404877ed129766ba2a60c8.html">Packages</a></li><li class="navelem"><a class="el" href="dir_a56c19072b1e5327a29fdaaef2369079.html">xortify server</a></li><li class="navelem"><a class="el" href="dir_986b603a083ad29d335eb299a442a13f.html">htdocs</a></li><li class="navelem"><a class="el" href="dir_22c74226e082a9c2f494c636a11784d4.html">include</a></li><li class="navelem"><a class="el" href="dir_9331266285eb3a6a9baae89ad06ba446.html">xsd</a></li><li class="navelem"><a class="el" href="dir_3efdec382a97f98085b027a387587332.html">legacy</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">spiderstat.php</div> </div> </div><!--header--> <div class="contents"> <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;&lt;?php</div> <div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment">/* Provide XSD for function</span></div> <div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment"> * spiderstat_xsd()</span></div> <div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="comment"> *</span></div> <div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="comment"> * @subpackage plugin</span></div> <div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="comment"> *</span></div> <div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="comment"> * @return array</span></div> <div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="comment"> */</span></div> <div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="keyword">function</span> spiderstat_xsd(){</div> <div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; $xsd = array();</div> <div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; $i=0;</div> <div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; $data = array();</div> <div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; $data[] = array(<span class="stringliteral">&quot;name&quot;</span> =&gt; <span class="stringliteral">&quot;username&quot;</span>, <span class="stringliteral">&quot;type&quot;</span> =&gt; <span class="stringliteral">&quot;string&quot;</span>);</div> <div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; $data[] = array(<span class="stringliteral">&quot;name&quot;</span> =&gt; <span class="stringliteral">&quot;password&quot;</span>, <span class="stringliteral">&quot;type&quot;</span> =&gt; <span class="stringliteral">&quot;string&quot;</span>); </div> <div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; $datab=array();</div> <div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160; $datab[] = array(<span class="stringliteral">&quot;name&quot;</span> =&gt; <span class="stringliteral">&quot;uri&quot;</span>, <span class="stringliteral">&quot;type&quot;</span> =&gt; <span class="stringliteral">&quot;string&quot;</span>);</div> <div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160; $datab[] = array(<span class="stringliteral">&quot;name&quot;</span> =&gt; <span class="stringliteral">&quot;useragent&quot;</span>, <span class="stringliteral">&quot;type&quot;</span> =&gt; <span class="stringliteral">&quot;string&quot;</span>);</div> <div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; $datab[] = array(<span class="stringliteral">&quot;name&quot;</span> =&gt; <span class="stringliteral">&quot;netaddy&quot;</span>, <span class="stringliteral">&quot;type&quot;</span> =&gt; <span class="stringliteral">&quot;string&quot;</span>);</div> <div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; $datab[] = array(<span class="stringliteral">&quot;name&quot;</span> =&gt; <span class="stringliteral">&quot;ip&quot;</span>, <span class="stringliteral">&quot;type&quot;</span> =&gt; <span class="stringliteral">&quot;string&quot;</span>);</div> <div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; $datab[] = array(<span class="stringliteral">&quot;name&quot;</span> =&gt; <span class="stringliteral">&quot;server-ip&quot;</span>, <span class="stringliteral">&quot;type&quot;</span> =&gt; <span class="stringliteral">&quot;string&quot;</span>);</div> <div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; $datab[] = array(<span class="stringliteral">&quot;name&quot;</span> =&gt; <span class="stringliteral">&quot;when&quot;</span>, <span class="stringliteral">&quot;type&quot;</span> =&gt; <span class="stringliteral">&quot;string&quot;</span>);</div> <div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; $datab[] = array(<span class="stringliteral">&quot;name&quot;</span> =&gt; <span class="stringliteral">&quot;sitename&quot;</span>, <span class="stringliteral">&quot;type&quot;</span> =&gt; <span class="stringliteral">&quot;string&quot;</span>);</div> <div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; $datab[] = array(<span class="stringliteral">&quot;name&quot;</span> =&gt; <span class="stringliteral">&quot;robot-id&quot;</span>, <span class="stringliteral">&quot;type&quot;</span> =&gt; <span class="stringliteral">&quot;string&quot;</span>);</div> <div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; $datab[] = array(<span class="stringliteral">&quot;name&quot;</span> =&gt; <span class="stringliteral">&quot;robot-name&quot;</span>, <span class="stringliteral">&quot;type&quot;</span> =&gt; <span class="stringliteral">&quot;string&quot;</span>);</div> <div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; $data[] = array(<span class="stringliteral">&quot;items&quot;</span> =&gt; array(<span class="stringliteral">&quot;statistic&quot;</span> =&gt; $datab, <span class="stringliteral">&quot;objname&quot;</span> =&gt; <span class="stringliteral">&quot;statistic&quot;</span>));</div> <div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; $xsd[<span class="stringliteral">&#39;request&#39;</span>][$i][<span class="stringliteral">&#39;items&#39;</span>][<span class="stringliteral">&#39;data&#39;</span>] = $data;</div> <div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; $xsd[<span class="stringliteral">&#39;request&#39;</span>][$i][<span class="stringliteral">&#39;items&#39;</span>][<span class="stringliteral">&#39;objname&#39;</span>] = <span class="stringliteral">&#39;data&#39;</span>; </div> <div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; </div> <div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; $xsd[<span class="stringliteral">&#39;response&#39;</span>][] = array(<span class="stringliteral">&quot;name&quot;</span> =&gt; <span class="stringliteral">&quot;ban_made&quot;</span>, <span class="stringliteral">&quot;type&quot;</span> =&gt; <span class="stringliteral">&quot;boolean&quot;</span>);</div> <div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; $xsd[<span class="stringliteral">&#39;response&#39;</span>][] = array(<span class="stringliteral">&quot;name&quot;</span> =&gt; <span class="stringliteral">&quot;made&quot;</span>, <span class="stringliteral">&quot;type&quot;</span> =&gt; <span class="stringliteral">&quot;integer&quot;</span>);</div> <div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <span class="keywordflow">return</span> $xsd;</div> <div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;}</div> <div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;</div> <div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;</div> <div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;<span class="comment">/* Provide WSDL for function</span></div> <div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;<span class="comment"> * spiderstat_wsdl()</span></div> <div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;<span class="comment"> *</span></div> <div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;<span class="comment"> * @subpackage plugin</span></div> <div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;<span class="comment"> *</span></div> <div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;<span class="comment"> * @return array</span></div> <div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;<span class="comment"> */</span></div> <div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;<span class="keyword">function</span> spiderstat_wsdl(){</div> <div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;</div> <div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;}</div> <div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;</div> <div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;<span class="comment">/* Provide WSDL Service for function</span></div> <div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;<span class="comment"> * spiderstat_wsdl_service()</span></div> <div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;<span class="comment"> *</span></div> <div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;<span class="comment"> * @subpackage plugin</span></div> <div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;<span class="comment"> *</span></div> <div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;<span class="comment"> * @return array</span></div> <div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;<span class="comment"> */</span></div> <div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;<span class="keyword">function</span> spiderstat_wsdl_service(){</div> <div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;</div> <div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;}</div> <div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;</div> <div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;</div> <div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;?&gt;</div> </div><!-- fragment --></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Tue Jul 23 2013 21:59:56 for Xortify Honeypot Cloud Services by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.4 </small></address> </body> </html>
labscoop/xortify
azure/docs/html/include_2xsd_2legacy_2spiderstat_8php_source.html
HTML
gpl-3.0
15,870
class A; 15; end; class A; 15; end class A; def foo; 15; end; end; a = A.new; puts a.foo puts 1; puts 2 while true; puts 1; end class A; def foo; end; def asd; end; end class A; def foo; 15; end; def asd; end; end module A; def foo; end; end case a; when 0; puts 1; when 1; puts 2; end
KDE/kdev-ruby
parser/tools/tests/semicolon.rb
Ruby
gpl-3.0
286
/* Include these * #include <stdlib.h> or <stddef.h> * #include <stdint.h> * #include <spar/core.h> * #include <nitlib/list.h> * #include "../vm/vm.h" */ struct nnn_prog { size_t size; int parsed; struct nnn_expr *expr; struct nnn_expr *stack; }; struct nnn_expr { struct nit_list next; enum ntwt_token type; size_t size; size_t line; union { uint32_t integer; double decimal; char *string; char op_code; } dat; }; struct nnn_expr * nnn_expr_get(struct nnn_prog *prog, struct spar_lexinfo *info, struct spar_token *token);
Uladox/nitwit
shared/asm/nnn_expr.h
C
gpl-3.0
556
#!/bin/sh #if [ `id -u` != 0 ] ; then # printf "\n\nPlease run with root permission!\n\n" # return 127 #fi #./update_fstab.sh BASEPKG="automake zlib1g-dev bison texinfo libtool autoconf pkgconf zip mime-support shared-mime-info desktop-file-utils" BASEPKG_ALL="" YESNOCMD="" SCOWPWRCMD="" BUILDARCH=`uname -m` PLATOS=$(cat /etc/os-release | grep -ri - -e "ID") if [ `printf "$PLATOS" | grep -ri - -e "raspbian" | wc -l` -gt 0 ] ; then SCOWPWRCMD="apt-get" YESNOCMD="-qy" if [ "$INSTALL_BASE_LIBS" = "yes" ] ; then BASEPKG="libgtk2.0-0 libprotobuf17 libprotobuf-c1 libconfig9 libboost-system1.67.0 liblog4cpp5v5 libopus0 libspeexdsp1 portaudio19-dev mime-support shared-mime-info desktop-file-utils" fi BASEPKG="libssl1.0-dev "$BASEPKG #sudo add-apt-repository ppa:openjdk-r/ppa -y #sudo apt-get update $YESNOCMD #sudo apt-get install openjdk-8-jdk $YESNOCMD #sudo dpkg --add-architecture i386 #apt-get update $YESNOCMD echo raspbian elif [ `printf "$PLATOS" | grep -ri - -e "ubuntu" | wc -l` -gt 0 ] ; then SCOWPWRCMD="apt-get" YESNOCMD="-qy" BASEPKG_ALL="libssl-dev help2man $BASEPKG" #sudo apt-get update $YESNOCMD #sudo apt-get install openjdk-8-jdk $YESNOCMD #sudo dpkg --add-architecture i386 #apt-get update $YESNOCMD echo ubuntu fi sudo $SCOWPWRCMD $YESNOCMD update sudo $SCOWPWRCMD $YESNOCMD install $BASEPKG_ALL #umask 022 if [ ! -d "/system/urus" ] || [ ! -e "/etc/profile.d/urusprofile.sh" ] ; then #export URUSINFSTAB=$(grep -sri /etc/fstab -e "/system/urus" | wc -l) #if [ "$URUSINFSTAB" != 0 ] ; then # printf "URUS bind are present on /etc/fstab\n" #else sudo mkdir -p /system/urus sudo chown $USER:$USER -R /system sudo sh -c 'printf "#!/bin/sh\n" > /etc/profile.d/urusprofile.sh' #printf "\n$(pwd)/system /system/urus none bind\n" >> /etc/fstab #sed -i "1i export PATH=/system/urus/bin:"$"PATH" /etc/profile #sed -i "1i export LD_LIBRARY_PATH=/system/urus/lib:"$"LD_LIBRARY_PATH" /etc/profile #sed -i "1i export ACLOCAL_FLAGS=-I/system/urus/share/aclocal:"$"ACLOCAL_FLAGS" /etc/profile #printf "export ACLOCAL_FLAGS=-I/system/urus/share/aclocal:"$"ACLOCAL_FLAGS\n" >> /etc/profile.d/urusprofile.sh #printf "export LD_LIBRARY_PATH=/system/urus/lib:"$"LD_LIBRARY_PATH\n" >> ~/.profile sudo sh -c 'printf "export PATH=/system/urus/bin:\$PATH\n" >> /etc/profile.d/urusprofile.sh' #sudo sh -c 'printf /system/urus/'$BUILDARCH'-pc-linux-gnu/lib\n" >> /etc/ld.so.conf.d/$BUILDARCH-urus-linux-gnu.conf' sudo sh -c 'printf "/system/urus/lib\n" >> /etc/ld.so.conf.d/'$BUILDARCH'-urus-linux-gnu.conf' #printf "URUS path bind INSTALLED! on /etc/fstab\n" #fi #mount /system/urus . /etc/profile.d/urusprofile.sh if [ -e ~/.profile ] ; then . ~/.profile fi echo "Done" else echo "File structure present" fi
UrusTeam/urus_buildroot
install_deps.sh
Shell
gpl-3.0
2,921
/**************************************************************************** ** ** Copyright (C) 2016 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QmlLive tool. ** ** $QT_BEGIN_LICENSE:GPL-QTAS$ ** Commercial License Usage ** Licensees holding valid commercial Qt Automotive Suite licenses may use ** this file in accordance with the commercial license agreement provided ** with the Software or, alternatively, in accordance with the terms ** contained in a written agreement between you and The Qt Company. For ** licensing terms and conditions see https://www.qt.io/terms-conditions. ** For further information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 or (at your option) any later version ** approved by the KDE Free Qt Foundation. The licenses are as published by ** the Free Software Foundation and appearing in the file LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ** SPDX-License-Identifier: GPL-3.0 ** ****************************************************************************/ #ifndef QMLLIVELIB_H #define QMLLIVELIB_H #include "qmllive_global.h" class QMLLIVESHARED_EXPORT QmlLive { public: QmlLive(); }; #endif // QMLLIVELIB_H
sailfish-sdk/qmllive
src/qmllive.h
C
gpl-3.0
1,540
/** * */ package com.abm.mainet.common.service; import java.util.ArrayList; import java.util.List; import javax.annotation.Resource; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.abm.mainet.common.constant.MainetConstants; import com.abm.mainet.common.dao.IApplicationStatusRepository; import com.abm.mainet.common.domain.ApplicationStatusEntity; import com.abm.mainet.common.dto.ApplicationDetail; import com.abm.mainet.common.dto.ApplicationStatusRequestVO; import com.abm.mainet.common.integration.dto.WebServiceResponseDTO; /** * @author vishnu.jagdale * */ @Service public class ApplicationStatusService implements IApplicationStatusService{ @Resource IApplicationStatusRepository ApplicationStatusRepository; /* (non-Javadoc) * @see com.abm.mainetsource.applicaitonstatus.service.IApplicationStatusService#getApplicationStatusList() */ @Override public List<ApplicationStatusEntity> getApplicationStatusList() { // TODO Auto-generated method stub return ApplicationStatusRepository.getApplicationStatusList(); } @Override public List<WebServiceResponseDTO> validateInput(ApplicationStatusRequestVO requestDTO, String flag) throws RuntimeException { // TODO Auto-generated method stub WebServiceResponseDTO wsResponseDTO = null; List<WebServiceResponseDTO> wsResponseList = new ArrayList<WebServiceResponseDTO>(); for(int i=0;i<requestDTO.getAppDetailList().size();i++) { ApplicationDetail appDetail=requestDTO.getAppDetailList().get(i); if (appDetail.getApmApplicationId() == null || appDetail.getApmApplicationId() == MainetConstants.CommonConstant.ZERO_LONG) { wsResponseDTO = new WebServiceResponseDTO(); wsResponseDTO.setErrorCode(MainetConstants.InputError.ERROR_CODE); wsResponseDTO.setErrorMsg(MainetConstants.InputError.APPLICATION_NO_NOT_FOUND); wsResponseList.add(wsResponseDTO); } if (appDetail.getOrgId() == null || appDetail.getOrgId() == MainetConstants.CommonConstant.ZERO_LONG) { wsResponseDTO = new WebServiceResponseDTO(); wsResponseDTO.setErrorCode(MainetConstants.InputError.ERROR_CODE); wsResponseDTO.setErrorMsg(MainetConstants.InputError.ORGID_NOT_FOUND); wsResponseList.add(wsResponseDTO); } if (appDetail.getServiceId() == null || appDetail.getServiceId() == MainetConstants.CommonConstant.ZERO_LONG) { wsResponseDTO = new WebServiceResponseDTO(); wsResponseDTO.setErrorCode(MainetConstants.InputError.ERROR_CODE); wsResponseDTO.setErrorMsg(MainetConstants.InputError.SERVICE_ID_NOT_FOUND); wsResponseList.add(wsResponseDTO); } if(appDetail.getApmStatus() == null || MainetConstants.CommonConstant.BLANK.equals(appDetail.getApmStatus().trim())){ wsResponseDTO = new WebServiceResponseDTO(); wsResponseDTO.setErrorCode(MainetConstants.InputError.ERROR_CODE); wsResponseDTO.setErrorMsg(MainetConstants.InputError.Application_Status_Not_Found); wsResponseList.add(wsResponseDTO); } } return wsResponseList; } public List<WebServiceResponseDTO> validateInputWithoutOrganisation(ApplicationStatusRequestVO requestDTO, String flag) throws RuntimeException { // TODO Auto-generated method stub WebServiceResponseDTO wsResponseDTO = null; List<WebServiceResponseDTO> wsResponseList = new ArrayList<WebServiceResponseDTO>(); for(int i=0;i<requestDTO.getAppDetailList().size();i++) { int j=0; ApplicationDetail appDetail=requestDTO.getAppDetailList().get(i); if (appDetail.getApmApplicationId() == null || appDetail.getApmApplicationId() == MainetConstants.CommonConstant.ZERO_LONG) { wsResponseDTO = new WebServiceResponseDTO(); wsResponseDTO.setErrorCode(MainetConstants.InputError.ERROR_CODE); wsResponseDTO.setErrorMsg(MainetConstants.InputError.APPLICATION_NO_NOT_FOUND); wsResponseList.add(wsResponseDTO); j++; System.out.println("----appDetail.getApmApplicationId()------"+appDetail.getApmApplicationId() +"gggg"+j+"888"+i); } if (appDetail.getServiceId() == null || appDetail.getServiceId() == MainetConstants.CommonConstant.ZERO_LONG) { wsResponseDTO = new WebServiceResponseDTO(); wsResponseDTO.setErrorCode(MainetConstants.InputError.ERROR_CODE); wsResponseDTO.setErrorMsg(MainetConstants.InputError.SERVICE_ID_NOT_FOUND); wsResponseList.add(wsResponseDTO); System.out.println("----appDetail.SERVICE_ID_NOT_FOUND()------"+appDetail.getApmApplicationId()); } } return wsResponseList; } @Override @Transactional public List<ApplicationDetail> getApplicationStatusListOpenForUser(ApplicationStatusRequestVO requestDTO) throws RuntimeException { // TODO Auto-generated method stub List<ApplicationStatusEntity> appStsEntityList = ApplicationStatusRepository.getApplicationStatusListOpenForUser(requestDTO); List<ApplicationDetail> appListDetail = requestDTO.getAppDetailList(); List<ApplicationDetail> appListDetailResponse = new ArrayList<ApplicationDetail>(); ApplicationDetail appDetailResponse =null; if(appStsEntityList != null) for(int i=0;i<appStsEntityList.size();i++) { ApplicationStatusEntity appStsEntity = null; ApplicationDetail appDetail = null; appDetailResponse = new ApplicationDetail(); appStsEntity = appStsEntityList.get(i); appDetailResponse.setApmApplicationId(appStsEntity.getApmApplicationId()); appDetailResponse.setOrgId(appStsEntity.getOrgId()); appDetailResponse.setApmStatus(appStsEntity.getApmStatus()); appDetailResponse.setServiceId(appStsEntity.getServiceId()); appListDetailResponse.add(appDetailResponse); } /*if(appListDetailResponse!=null) System.out.println("--appListDetailResponse---"+appListDetailResponse.size());*/ System.out.println("--appListDetail---"+appListDetail); return appListDetailResponse; } @Override @Transactional public List<ApplicationDetail> getApplicationStatusDetail(ApplicationStatusRequestVO requestDTO) throws RuntimeException { // TODO Auto-generated method stub List<ApplicationStatusEntity> appStsEntityList = ApplicationStatusRepository.getApplicationStatusDetail(requestDTO); List<ApplicationDetail> appListDetail = requestDTO.getAppDetailList(); List<ApplicationDetail> appListDetailResponse = new ArrayList<ApplicationDetail>(); ApplicationDetail appDetailResponse =null; if(appStsEntityList != null) for(int i=0;i<appStsEntityList.size();i++) { ApplicationStatusEntity appStsEntity = null; ApplicationDetail appDetail = null; appDetailResponse = new ApplicationDetail(); appStsEntity = appStsEntityList.get(i); appDetailResponse.setApmApplicationId(appStsEntity.getApmApplicationId()); appDetailResponse.setOrgId(appStsEntity.getOrgId()); appDetailResponse.setApmStatus(appStsEntity.getApmStatus()); appDetailResponse.setServiceId(appStsEntity.getServiceId()); appDetailResponse.setApmServiceName(appStsEntity.getApmServiceName()); appDetailResponse.setApmApplicationDate(appStsEntity.getApmApplicationDate()); appDetailResponse.setApmApplicationNameEng(appStsEntity.getApmApplicationNameEng()); appListDetailResponse.add(appDetailResponse); } /*if(appListDetailResponse!=null) System.out.println("--appListDetailResponse---"+appListDetailResponse.size());*/ System.out.println("--appListDetail---"+appListDetail); return appListDetailResponse; } }
abmindiarepomanager/ABMOpenMainet
Mainet1.0/MainetServiceParent/MainetServiceCommon/src/main/java/com/abm/mainet/common/service/ApplicationStatusService.java
Java
gpl-3.0
7,583
# Overview ![logo](../logo.png) Chinese documents: [Overview](../zh) Demo: [Demo Video](https://youtu.be/UhnbvLA0SMo) Github: [MoeNotes](https://github.com/dtysky/MoeNotes) Download: [Download](https://github.com/dtysky/MoeNotes/releases) # Introduction MoeNotes is a dairy software, unlike Onenote, Leanote, it's running locally, and the problem is solved is "local demonstration", used to provide a Onenote like experience at manage your dairy categories. THe app uses markdown is it's editing language, all notes will be saved as .md file locally instead of database, user can choose how these files are synchronized independent of platforms. It supports sorting articles by dragging them around. Besides, it has 'live preview', 'read' and 'write' three modes, exporting to pdf or html file, and themes can be switched or customized. Since it's based on web, it can be easily extended. ![preview-main](../preview-main.jpg) ![preview-books](../preview-books.jpg) ![preview-export](../preview-export.jpg) ## Folder Normal user - [Quick Start](./QuickStart.md) - [Theme PreDefined](./Theme-PreDefine.md) Advanced user - [Customize Theme](./Theme-Advance.md) Developer - [Environment](./Development-Environment.md) - [Grunt Tasks](./Development-Tasks.md) - [Core Libs](./Development-Cores.md) - [React Components](./Development-Components.md) - [Unit Test](./Development-UnitTests.md) Thanks - [Used tool and materials](./Thanks.md) ## License Copyright © 2015, 戴天宇, Tianyu Dai (dtysky<dtysky@outlook.com>). All Rights Reserved. This project is free software and released under the GNU General Public License (GPL V3).
dtysky/MoeNotes
doc/en/README.md
Markdown
gpl-3.0
1,669
#include <Algorithms/ZernikeCoefficient.h> #include <vtkMath.h> #include <vtkIdList.h> #include <MeshData.h> #include <data_type.h> #include <vector> namespace sqi { namespace alg { using namespace std; using namespace lq; ZernikeCoefficient::ZernikeCoefficient() { timer_ = vtkSmartPointer<vtkTimerLog>::New(); } ZernikeCoefficient::~ZernikeCoefficient() { } void ZernikeCoefficient::CalZernikeCoeff(const std::vector<std::vector<double> > &height_map, const double bound[], std::vector<std::vector<double> > &zernike_coeff) { double left_bottom[3] = {bound[0], bound[2], bound[4]}; double right_top[3] = {bound[1], bound[3], bound[5]}; float diagonal_len = sqrt(vtkMath::Distance2BetweenPoints(left_bottom, right_top)); float rect_edge = (2.5 * diagonal_len) / 100.0f; if(!lq::is_zero(mesh_data_->RadiusRatio(), 1e-6)) rect_edge /= mesh_data_->RadiusRatio(); float radius = rect_edge / 2.0f; float e = rect_edge / 16; vector<PolarCoord> grid_polar;//Obtain polar coordinate of 16 x 16 grid for(int i = 0; i < 256; ++i) { int k = i / 16 - 7; int j = i % 16 - 7; vcg::Point3d center(0.0f, 0.0f, 0.0f); vcg::Point3d p(0.0f, 0.0f, 0.0f); vcg::Point3d dir1(0.0, 1.0f, 0.0f); vcg::Point3d dir2(1.0f, 0.0f, 0.0f); double y_dist = (static_cast<double>(k) - 0.5) * e; double x_dist = (static_cast<double>(j) - 0.5) * e; p += dir1 * y_dist; p += dir2 * x_dist; double rho = vcg::Distance<double>(center, p); double theta = 0.0f; if(lq::is_larger(rho, radius)) { grid_polar.push_back(PolarCoord()); continue; } if(k > 0) theta = atan(y_dist / x_dist); else if(j <= 0) theta = atan(y_dist / x_dist) - PI; else if(j > 0) theta = atan(y_dist / x_dist) + PI; grid_polar.push_back(PolarCoord(rho, theta)); } vector<func_ptr> radial_poly; zernike_coeff.resize(height_map.size()); PushRadialPolyFunc(radial_poly); for(int i = 0; i < height_map.size(); ++i) { int cnt = 0; //25 Zerniker polynomials for(int p = 0; p <= 8; ++p) for(int q = 0; q <= p; ++q) { double real = 0.0f; double imaginary = 0.0f; if(((p - q) & 1) == 0) { for(int j = 0; j < height_map[i].size(); ++j) { if(lq::equal(height_map[i][j], -1.0f)) continue; double rho = grid_polar[j].rho; double theta = grid_polar[j].theta; double poly = radial_poly[cnt](rho); real += poly * cos(static_cast<double>(q) * theta) * height_map[i][j]; imaginary += poly * sin(static_cast<double>(q) * theta) * height_map[i][j]; } double coeff = (static_cast<double>(p) + 1.0f) / PI; real *= coeff; imaginary *= coeff; double z = sqrt(real * real + imaginary * imaginary); zernike_coeff[i].push_back(z); ++cnt; } } } SurfaceDescriptor::WriteFile(zernike_coeff, "ZernikeCoeff.txt"); } void ZernikeCoefficient::CalZernikeCoeff(const std::vector<std::vector<double> > &height_map, const double rect_edge, std::vector<std::vector<double> > &zernike_coeff) { float e = rect_edge / 16; float radius = rect_edge / 2.0f; vector<PolarCoord> grid_polar;//Obtain polar coordinate of 16 x 16 grid for(int i = 0; i < 256; ++i) { int k = i / 16 - 7; int j = i % 16 - 7; vcg::Point3d center(0.0f, 0.0f, 0.0f); vcg::Point3d p(0.0f, 0.0f, 0.0f); vcg::Point3d dir1(0.0, 1.0f, 0.0f); vcg::Point3d dir2(1.0f, 0.0f, 0.0f); double y_dist = (static_cast<double>(k) - 0.5) * e; double x_dist = (static_cast<double>(j) - 0.5) * e; p += dir1 * y_dist; p += dir2 * x_dist; double rho = vcg::Distance<double>(center, p); double theta = 0.0f; if(lq::is_larger(rho, radius)) { grid_polar.push_back(PolarCoord()); continue; } if(k > 0) theta = atan(y_dist / x_dist); else if(j <= 0) theta = atan(y_dist / x_dist) - PI; else if(j > 0) theta = atan(y_dist / x_dist) + PI; grid_polar.push_back(PolarCoord(rho, theta)); } vector<func_ptr> radial_poly; zernike_coeff.resize(height_map.size()); PushRadialPolyFunc(radial_poly); for(int i = 0; i < height_map.size(); ++i) { int cnt = 0; //25 Zerniker polynomials for(int p = 0; p <= 8; ++p) for(int q = 0; q <= p; ++q) { double real = 0.0f; double imaginary = 0.0f; if(((p - q) & 1) == 0) { for(int j = 0; j < height_map[i].size(); ++j) { if(lq::equal(height_map[i][j], -1.0f)) continue; double rho = grid_polar[j].rho; double theta = grid_polar[j].theta; double poly = radial_poly[cnt](rho); real += poly * cos(static_cast<double>(q) * theta) * height_map[i][j]; imaginary += poly * sin(static_cast<double>(q) * theta) * height_map[i][j]; } double coeff = (static_cast<double>(p) + 1.0f) / PI; real *= coeff; imaginary *= coeff; double z = sqrt(real * real + imaginary * imaginary); zernike_coeff[i].push_back(z); ++cnt; } } } SurfaceDescriptor::WriteFile(zernike_coeff, "ZernikeCoeff.txt"); } void ZernikeCoefficient::CalZernikeCoeffWithGaussianWeight(meshdata::VertexIterator vi_begin, vtkSmartPointer<vtkKdTreePointLocator>& kd_tree, const std::vector<std::vector<double> > &height_map, const double bound[6], double neigh_radius, std::vector<std::vector<double> > &zer_coeff_gauss) { if(kd_tree == NULL) return; cout << "[#Info]Search radius : " << neigh_radius << endl; timer_->StartTimer(); vector<vector<double> > zernike_coeff(height_map.size()); CalZernikeCoeff(height_map, bound, zernike_coeff); zer_coeff_gauss.resize(height_map.size(), vector<double>(25, 0.0f)); for(int i = 0; i < height_map.size(); ++i) { vtkSmartPointer<vtkIdList> idx_list = vtkSmartPointer<vtkIdList>::New(); meshdata::VertexIterator vi = vi_begin + i; double ref_point[3] = {vi->cP()[0], vi->cP()[1], vi->cP()[2]}; kd_tree->FindPointsWithinRadius(neigh_radius, ref_point, idx_list); double denominator = 0.0f; double numerator_coeff = 0.0f; meshdata::VertexIterator vi2; for(size_t j = 0; j < idx_list->GetNumberOfIds(); ++j) { int v2_idx = idx_list->GetId(j); vi2 = vi_begin + v2_idx; double dist_square = vcg::SquaredDistance<float>(vi->P(), vi2->P()); numerator_coeff = -1.0f * (dist_square / (2.0f * neigh_radius * neigh_radius)); numerator_coeff = exp(numerator_coeff); for(int k = 0; k < zernike_coeff[v2_idx].size(); ++k) zer_coeff_gauss[i][k] += zernike_coeff[v2_idx][k] * numerator_coeff; denominator += numerator_coeff; } DivVector<double>(zer_coeff_gauss[i], denominator); } SurfaceDescriptor::WriteFile(zer_coeff_gauss, "ZernikeCoeffGauss.txt"); timer_->StopTimer(); cout << "[#Info]Zerniker coeff with gaussian tree cost vtk timer's time is : " << timer_->GetElapsedTime() << endl; } ////calculate zernike radial polynomial //double CalRadialPolyP0Q0(double rho) //{ // return 1; //} //double CalRadialPolyP1Q1(double rho) //{ // return rho; //} //double CalRadialPolyP2Q0(double rho) //{ // return (2.0f * rho * rho - 1.0f); //} //double CalRadialPolyP2Q2(double rho) //{ // return rho * rho; //} //double CalRadialPolyP3Q1(double rho) //{ // double rho_square = rho * rho; // return (rho * (3.0 * rho_square - 1.0)); //} //double CalRadialPolyP3Q3(double rho) //{ // return rho * rho * rho; //} //double CalRadialPolyP4Q0(double rho) //{ // double rho_square = rho * rho; // return (6.0 * rho_square * (rho_square - 1.0)); //} //double CalRadialPolyP4Q2(double rho) //{ // double rho_square = rho * rho; // return rho_square * (4.0 * rho_square - 3.0f); //} //double CalRadialPolyP4Q4(double rho) //{ // return std::pow(rho, 4.0f); //} //double CalRadialPolyP5Q1(double rho) //{ // double rho_cube = std::pow(rho, 3); // return (2.0 * rho_cube * (5.0 * rho * rho - 6.8) + 3.0 * rho); //} //double CalRadialPolyP5Q3(double rho) //{ // double rho_square = rho * rho; // return (rho_square * rho * (5.0f * rho_square - 4.0f)); //} //double CalRadialPolyP5Q5(double rho) //{ // return std::pow(rho, 5.0f); //} //double CalRadialPolyP6Q0(double rho) //{ // double rho_square = rho * rho; // return 10.0 * rho_square * rho_square * (2.0f * rho_square - 3.0f) + // 12.0f * rho_square - 1.0f; //} //double CalRadialPolyP6Q2(double rho) //{ // double rho_square = rho * rho; // return (5.0f * rho_square * rho_square * ( 3.0f * rho_square) + 6 * rho_square); //} //double CalRadialPolyP6Q4(double rho) //{ // double rho_square = rho * rho; // return (rho_square * rho_square * (6 * rho_square - 5.0f)); //} //double CalRadialPolyP6Q6(double rho) //{ // return std::pow(rho, 6.0f); //} //double CalRadialPolyP7Q1(double rho) //{ // double rho_square = rho * rho; // return (5.0f * rho_square * rho * (7.0f * rho_square * rho_square - // 12.0f * rho_square + 6.0f) - 4.0f * rho); //} //double CalRadialPolyP7Q3(double rho) //{ // double rho_square = rho * rho; // return (rho_square * rho * (10 - 30 * rho_square + 21 * rho_square * rho_square)); //} //double CalRadialPolyP7Q5(double rho) //{ // double rho_five = std::pow(rho, 5); // return rho_five * (7 * rho * rho - 6); //} //double CalRadialPolyP7Q7(double rho) //{ // return std::pow(rho, 7); //} //double CalRadialPolyP8Q0(double rho) //{ // double rho_square = rho * rho; // double rho_four = rho_square * rho_square; // return (1 - 20 * rho_square + 10 * rho_four * (9 - 14 * rho_square + 7 * rho_four)); //} //double CalRadialPolyP8Q2(double rho) //{ // double rho_square = rho * rho; // double rho_four = rho_square * rho_square; // return (rho_four * (60 - 105 * rho_square + 56 * rho_four) - 10 * rho_square); //} //double CalRadialPolyP8Q4(double rho) //{ // double rho_square = rho * rho; // double rho_four = rho_square * rho_square; // return (rho_four * (15 - 42 * rho_square + 28 * rho_four)); //} //double CalRadialPolyP8Q6(double rho) //{ // double rho_six = pow(rho, 6); // return (rho_six * (8 * rho * rho - 7)); //} //double CalRadialPolyP8Q8(double rho) //{ // return std::pow(rho, 8); //} void ZernikeCoefficient::PushRadialPolyFunc(std::vector<func_ptr> &radial_poly) { SurfaceDescriptor::PushRadialPolyFunc(radial_poly); // radial_poly.push_back(CalRadialPolyP0Q0); // radial_poly.push_back(CalRadialPolyP1Q1); // radial_poly.push_back(CalRadialPolyP2Q0); // radial_poly.push_back(CalRadialPolyP2Q2); // radial_poly.push_back(CalRadialPolyP3Q1); // radial_poly.push_back(CalRadialPolyP3Q3); // radial_poly.push_back(CalRadialPolyP4Q0); // radial_poly.push_back(CalRadialPolyP4Q2); // radial_poly.push_back(CalRadialPolyP4Q4); // radial_poly.push_back(CalRadialPolyP5Q1); // radial_poly.push_back(CalRadialPolyP5Q3); // radial_poly.push_back(CalRadialPolyP5Q5); // radial_poly.push_back(CalRadialPolyP6Q0); // radial_poly.push_back(CalRadialPolyP6Q2); // radial_poly.push_back(CalRadialPolyP6Q4); // radial_poly.push_back(CalRadialPolyP6Q6); // radial_poly.push_back(CalRadialPolyP7Q1); // radial_poly.push_back(CalRadialPolyP7Q3); // radial_poly.push_back(CalRadialPolyP7Q5); // radial_poly.push_back(CalRadialPolyP7Q7); // radial_poly.push_back(CalRadialPolyP8Q0); // radial_poly.push_back(CalRadialPolyP8Q2); // radial_poly.push_back(CalRadialPolyP8Q4); // radial_poly.push_back(CalRadialPolyP8Q6); // radial_poly.push_back(CalRadialPolyP8Q8); } } }
liquancsp/SurfaceQualityInspection
src/VTK/Algorithms/ZernikeCoefficient.cpp
C++
gpl-3.0
12,163
{% extends "base.html" %} {% block page-title %}Website Under Construction - Scorp{% endblock %} {% block page-content %} <!--============================================= Under Construction Page ============================================= --> <section class="overlay-01 under-construction bg-20 wrapper-table"> <div class="valign-center"> <div class="container"> <div class="intro text-center"> <!--<div class="logo"> <a class="inline-block" href="#"> <img class="img-responsive center-block" alt="" src="/assets/images/logos/1-w.png"> </a> </div>--> <h2>Under Heavy Construction...</h2> <h5>please check back soon</h5> </div> </div> </div> </section> {% endblock %}
saeidscorp/site
resources/templates/under-construction.html
HTML
gpl-3.0
936
/* * This file is protected by Copyright. Please refer to the COPYRIGHT file * distributed with this source distribution. * * This file is part of GNUHAWK. * * GNUHAWK is free software: you can redistribute it and/or modify is under the * terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * GNUHAWK is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see http://www.gnu.org/licenses/. */ #ifndef file_descriptor_sink_s_GH_BLOCK_H #define file_descriptor_sink_s_GH_BLOCK_H #include <gr_component.h> #include <gr_file_descriptor_sink.h> typedef GHComponent< gr_file_descriptor_sink > GnuHawkBlock; #endif
RedhawkSDR/integration-gnuhawk
components/file_descriptor_sink_s/cpp/file_descriptor_sink_s_GnuHawkBlock.h
C
gpl-3.0
1,044
extern main(); extern flag_data_return[]; extern outport(); ctcss(int fdSer) { int opcode, n, tx_mode; float ctcss_user_value; float ctcss_freq[34] = {67, 71.9, 77.0, 82.5, 88.5, 94.8, 100, 103.5, 107.2, 110.9, 114.8, 118.8, 123, 127.3, 131.8, 136.5, 141.3, 146.2, 151.4, 156.7, 162.2, 167.9, 173.8, 179.9, 186.2, 192.8, 203.5, 210.7, 218.1, 225.7, 233.6, 241.8, 250.3, 9}; int ctcss_byte[34] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x31}; rd_flags(fdSer); tx_mode = (flag_data_return[3] >> 7) && 0x01; if (tx_mode == 1) { printf("Cannot change CTCSS tone while transmitting!!!\n"); return; } opcode = 0x90; n = 0; printf("Enter in Hz, the CTCSS [PL] tone -> "); scanf("%f",&ctcss_user_value); while (ctcss_user_value != ctcss_freq[n]) { n = n+1; } /* * The only way I could figure out how to do this is to have the user * input the number, read it in as float and traverse an array until * the numbers match. The corresponding value in ctcss_byte is the * byte the radio will understand as a valid CTCSS frequency. I put * an extra, "bogus" number on the end so that any time n = 34 or 33 * (the 34th or 33rd value in ctcss_freq) that means that the while * statement failed to match the value in the array, thus the value is * invalid. When the if statement finds n = 34 or n = 33, the function * returns, indicating a failure. * Other methods did not work, this one does so it shall be this way. */ if (n == 34 || n == 33) { printf("Invalid value!!!\n"); return; } outport(fdSer, ctcss_byte[n], ctcss_byte[n], ctcss_byte[n], ctcss_byte[n], opcode); printf("n = %d.\n", n); }
R03LTjuh/KG0CQ-s-yaesu-program
ctcss.c
C
gpl-3.0
1,880
/* Test of u16_strnlen() function. Copyright (C) 2010-2014 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* Written by Bruno Haible <bruno@clisp.org>, 2010. */ #include <config.h> #include "unistr.h" #include "zerosize-ptr.h" #include "macros.h" #define UNIT uint16_t #define U_STRNLEN u16_strnlen #include "test-strnlen.h" int main () { /* Simple string. */ { /* "Grüß Gott. Здравствуйте! x=(-b±sqrt(b²-4ac))/(2a) 日本語,中文,한글" */ static const uint16_t input[] = { 'G', 'r', 0x00FC, 0x00DF, ' ', 'G', 'o', 't', 't', '.', ' ', 0x0417, 0x0434, 0x0440, 0x0430, 0x0432, 0x0441, 0x0442, 0x0432, 0x0443, 0x0439, 0x0442, 0x0435, '!', ' ', 'x', '=', '(', '-', 'b', 0x00B1, 's', 'q', 'r', 't', '(', 'b', 0x00B2, '-', '4', 'a', 'c', ')', ')', '/', '(', '2', 'a', ')', ' ', ' ', 0x65E5, 0x672C, 0x8A9E, ',', 0x4E2D, 0x6587, ',', 0xD55C, 0xAE00, 0 }; check (input, SIZEOF (input)); } /* String with characters outside the BMP. */ { static const uint16_t input[] = { '-', '(', 0xD835, 0xDD1E, 0x00D7, 0xD835, 0xDD1F, ')', '=', 0xD835, 0xDD1F, 0x00D7, 0xD835, 0xDD1E, 0 }; check (input, SIZEOF (input)); } return 0; }
Distrotech/coreutils
gnulib/tests/unistr/test-u16-strnlen.c
C
gpl-3.0
1,881
declared in [MTDataKV](MTDataKV.hpp.md) ~~~ { .cpp } template<> bool MTDataKV::_kvpair::get(MTCoordinates & _out) const { if (_t != t_kvpair::MTCoordinates) { return false; } _out = *(MTCoordinates*)_v; return true; } template<> bool MTDataKV::_kvpair::get(MTVector & _out) const { if (_t != t_kvpair::MTVector) { return false; } _out = *(MTVector*)_v; return true; } template<> bool MTDataKV::_kvpair::get(MTMatrix & _out) const { if (_t != t_kvpair::MTMatrix) { return false; } _out = *(MTMatrix*)_v; return true; } template<> bool MTDataKV::_kvpair::get(MTMatrix44 & _out) const { if (_t != t_kvpair::MTMatrix44) { return false; } _out = *(MTMatrix44*)_v; return true; } template<> bool MTDataKV::_kvpair::get(MTMatrix53 & _out) const { if (_t != t_kvpair::MTMatrix53) { return false; } _out = *(MTMatrix53*)_v; return true; } template<> bool MTDataKV::_kvpair::get(double & _out) const { if (_t != t_kvpair::REAL) { return false; } _out = *(double*)_v; return true; } template<> bool MTDataKV::_kvpair::get(float & _out) const { if (_t != t_kvpair::REAL) { return false; } _out = *(double*)_v; return true; } template<> bool MTDataKV::_kvpair::get(int & _out) const { if (_t != t_kvpair::INT) { return false; } _out = *(int64_t*)_v; return true; } template<> bool MTDataKV::_kvpair::get(long & _out) const { if (_t != t_kvpair::INT) { return false; } _out = *(int64_t*)_v; return true; } template<> bool MTDataKV::_kvpair::get(std::string & _out) const { if (_t != t_kvpair::STR) { return false; } _out = *(std::string*)_v; return true; } template<> bool MTDataKV::_kvpair::get(MTResidue * & _out) const { if (_t != t_kvpair::MTResidue) { return false; } _out = (MTResidue*)_v; return true; } template<> bool MTDataKV::_kvpair::get(MTChain * & _out) const { if (_t != t_kvpair::MTChain) { return false; } _out = (MTChain*)_v; return true; } template<> bool MTDataKV::_kvpair::get(MTStructure * & _out) const { if (_t != t_kvpair::MTStructure) { return false; } _out = (MTStructure*)_v; return true; } template<> bool MTDataKV::_kvpair::get(MTAtom * & _out) const { if (_t != t_kvpair::MTAtom) { return false; } _out = (MTAtom*)_v; return true; } std::string MTDataKV::toString() const { int i=0; std::ostringstream ss; ss << "["; for (auto const & e : _kvmap) { if (i>0) { ss << " "; } ss << "'" << e.first << "' = " << e.second << std::endl; i++; } ss << "]"; return ss.str(); } template <typename T> bool MTDataKV::get(std::string const & k, T & v) const { auto it = _kvmap.find(k); if (it == _kvmap.cend()) { return false; } return it->second.get(v); } template bool MTDataKV::get(std::string const & k, MTCoordinates & v) const; template bool MTDataKV::get(std::string const & k, MTVector & v) const; template bool MTDataKV::get(std::string const & k, MTMatrix & v) const; template bool MTDataKV::get(std::string const & k, MTMatrix44 & v) const; template bool MTDataKV::get(std::string const & k, MTMatrix53 & v) const; template bool MTDataKV::get(std::string const & k, double & v) const; template bool MTDataKV::get(std::string const & k, float & v) const; template bool MTDataKV::get(std::string const & k, int & v) const; template bool MTDataKV::get(std::string const & k, long & v) const; template bool MTDataKV::get(std::string const & k, std::string & v) const; template bool MTDataKV::get(std::string const & k, MTResidue * & v) const; template bool MTDataKV::get(std::string const & k, MTChain * & v) const; template bool MTDataKV::get(std::string const & k, MTStructure * & v) const; template bool MTDataKV::get(std::string const & k, MTAtom * & v) const; template <typename T> bool MTDataKV::set(std::string const & k, T const & v) { auto it = _kvmap.find(k); if (it != _kvmap.cend()) { return false; } auto p = _kvmap.emplace(k, v); return p.second; } template bool MTDataKV::set(std::string const & k, MTCoordinates const & v); template bool MTDataKV::set(std::string const & k, MTVector const & v); template bool MTDataKV::set(std::string const & k, MTMatrix const & v); template bool MTDataKV::set(std::string const & k, MTMatrix44 const & v); template bool MTDataKV::set(std::string const & k, MTMatrix53 const & v); template bool MTDataKV::set(std::string const & k, double const & v); template bool MTDataKV::set(std::string const & k, float const & v); template bool MTDataKV::set(std::string const & k, int const & v); template bool MTDataKV::set(std::string const & k, long const & v); template bool MTDataKV::set(std::string const & k, std::string const & v); template bool MTDataKV::set(std::string const & k, MTAtom * const & v); template bool MTDataKV::set(std::string const & k, MTResidue * const & v); template bool MTDataKV::set(std::string const & k, MTChain * const & v); template bool MTDataKV::set(std::string const & k, MTStructure * const & v); bool MTDataKV::set(std::string const & k, char const * v) { return set(k, std::string(v)); } bool MTDataKV::set(std::string const & k, bool v) { return set(k, int(v)); } bool MTDataKV::unset(std::string const & k) { auto it = _kvmap.find(k); if (it == _kvmap.end()) { return false; } _kvmap.erase(it); return true; } bool MTDataKV::has(std::string const & k) const { auto const it = _kvmap.find(k); if (it == _kvmap.cend()) { return false; } return true; } ~~~
CodiePP/libmoltalk
Code/Cpp/MTDataKV_access.cpp.md
Markdown
gpl-3.0
5,382
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL'; # CREATE DATABASE DROP SCHEMA IF EXISTS consult; CREATE SCHEMA consult; USE consult; CREATE TABLE address ( address_id INTEGER NOT NULL AUTO_INCREMENT, line1 VARCHAR(50) NOT NULL, line2 VARCHAR(50) NULL, city VARCHAR(50) NOT NULL, region VARCHAR(50) NOT NULL, country VARCHAR(50) NOT NULL, postal_code VARCHAR(50) NOT NULL, CONSTRAINT address_pk PRIMARY KEY ( address_id ) )ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE consultant_status ( status_id CHAR NOT NULL, description VARCHAR(50) NOT NULL, CONSTRAINT consultant_status_pk PRIMARY KEY ( status_id ) )ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE consultant ( consultant_id INTEGER NOT NULL AUTO_INCREMENT, status_id CHAR NOT NULL, email VARCHAR(50) NOT NULL, password VARCHAR(50) NOT NULL, hourly_rate DECIMAL(6,2) NOT NULL, billable_hourly_rate DECIMAL(6,2) NOT NULL, hire_date DATE NULL, recruiter_id INTEGER NULL, resume LONG VARCHAR NULL, CONSTRAINT consultant_pk PRIMARY KEY ( consultant_id ) )ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE client ( client_name VARCHAR(50) NOT NULL, client_department_number SMALLINT NOT NULL, billing_address INTEGER NOT NULL, contact_email VARCHAR(50) NULL, contact_password VARCHAR(50) NULL, CONSTRAINT client_pk PRIMARY KEY ( client_name, client_department_number ) )ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE recruiter ( recruiter_id INTEGER NOT NULL AUTO_INCREMENT, email VARCHAR(50) NOT NULL, password VARCHAR(50) NOT NULL, client_name VARCHAR(50) NULL, client_department_number SMALLINT NULL, CONSTRAINT recruiter_pk PRIMARY KEY ( recruiter_id ) )ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE project ( client_name VARCHAR(50) NOT NULL, client_department_number SMALLINT NOT NULL, project_name VARCHAR(50) NOT NULL, contact_email VARCHAR(50) NULL, contact_password VARCHAR(50) NULL, CONSTRAINT project_pk PRIMARY KEY ( client_name, client_department_number, project_name ) )ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE project_consultant ( client_name VARCHAR(50) NOT NULL, client_department_number SMALLINT NOT NULL, project_name VARCHAR(50) NOT NULL, consultant_id INTEGER NOT NULL, CONSTRAINT project_consultant_pk PRIMARY KEY ( client_name, client_department_number, project_name, consultant_id ) )ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE billable ( billable_id BIGINT NOT NULL AUTO_INCREMENT, consultant_id INTEGER NOT NULL, client_name VARCHAR(50) NOT NULL, client_department_number SMALLINT NOT NULL, project_name VARCHAR(50) NOT NULL, start_date TIMESTAMP NULL, end_date TIMESTAMP NULL, hours SMALLINT NOT NULL, hourly_rate DECIMAL(6,2) NOT NULL, billable_hourly_rate DECIMAL(6,2) NOT NULL, description VARCHAR(50) NULL, artifacts TEXT NULL, CONSTRAINT billable_pk PRIMARY KEY ( billable_id ) )ENGINE=InnoDB DEFAULT CHARSET=utf8; ALTER TABLE consultant ADD CONSTRAINT consultant_fk_consultant_status FOREIGN KEY ( status_id ) REFERENCES consultant_status ( status_id ); ALTER TABLE consultant ADD CONSTRAINT consultant_fk_recruiter FOREIGN KEY ( recruiter_id ) REFERENCES recruiter ( recruiter_id ); ALTER TABLE client ADD CONSTRAINT client_fk_address FOREIGN KEY ( billing_address ) REFERENCES address ( address_id ); ALTER TABLE client ADD CONSTRAINT client_uk_billing_address UNIQUE ( billing_address ); ALTER TABLE recruiter ADD CONSTRAINT recruiter_fk_client FOREIGN KEY ( client_name, client_department_number ) REFERENCES client ( client_name, client_department_number ); ALTER TABLE project ADD CONSTRAINT project_fk_client FOREIGN KEY ( client_name, client_department_number ) REFERENCES client ( client_name, client_department_number ); ALTER TABLE project_consultant ADD CONSTRAINT project_consultant_fk_project FOREIGN KEY ( client_name, client_department_number, project_name ) REFERENCES project ( client_name, client_department_number, project_name ); ALTER TABLE project_consultant ADD CONSTRAINT project_consultant_fk_consultant FOREIGN KEY ( consultant_id ) REFERENCES consultant ( consultant_id ); ALTER TABLE billable ADD CONSTRAINT billable_fk_consultant FOREIGN KEY ( consultant_id ) REFERENCES consultant ( consultant_id ); ALTER TABLE billable ADD CONSTRAINT billable_fk_project FOREIGN KEY ( client_name, client_department_number, project_name ) REFERENCES project ( client_name, client_department_number, project_name ); SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; # INSERT DATA TO DATABASE USE consult; SET AUTOCOMMIT=0; INSERT INTO address (line1, line2, city, region, country, postal_code) VALUES ('100 Data Street', 'Suite 432', 'San Francisco', 'California', 'USA', '94103'); INSERT INTO client (client_name, client_department_number, billing_address, contact_email, contact_password) VALUES ('Big Data Corp.', 2000, 1, 'accounting@bigdatacorp.com', 'accounting'); INSERT INTO project (client_name, client_department_number, project_name, contact_email, contact_password) VALUES ('Big Data Corp.', 2000, 'Secret Project', 'project.manager@bigdatacorp.com', 'project.manager'); INSERT INTO recruiter (email, password, client_name, client_department_number) VALUES ('bob@jsfcrudconsultants.com', 'bob', 'Big Data Corp.', 2000); INSERT INTO consultant_status (status_id, description) VALUES ('A', 'Active'); INSERT INTO consultant (status_id, email, password, hourly_rate, billable_hourly_rate, hire_date, recruiter_id) VALUES ('A', 'janet.smart@jsfcrudconsultants.com', 'janet.smart', 80, 120, '2007-2-15', 1); INSERT INTO project_consultant (client_name, client_department_number, project_name, consultant_id) VALUES ('Big Data Corp.', 2000, 'Secret Project', 1); INSERT INTO billable (consultant_id, client_name, client_department_number, project_name, start_date, end_date, hours, hourly_rate, billable_hourly_rate, description) VALUES (1, 'Big Data Corp.', 2000, 'Secret Project', '2008-10-13 00:00:00.0', '2008-10-17 00:00:00.0', 40, 80, 120, 'begin gathering requirements'); INSERT INTO billable (consultant_id, client_name, client_department_number, project_name, start_date, end_date, hours, hourly_rate, billable_hourly_rate, description) VALUES (1, 'Big Data Corp.', 2000, 'Secret Project', '2008-10-20 00:00:00.0', '2008-10-24 00:00:00.0', 40, 80, 120, 'finish gathering requirements'); COMMIT; SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
denlap007/maestro
core/src/main/resources/testCases/crudApp/dataTier/create-db-insert-data.sql
SQL
gpl-3.0
6,632
// KeyLocation_as.cpp: ActionScript "KeyLocation" class, for Gnash. // // Copyright (C) 2009, 2010 Free Software Foundation, Inc. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #include "ui/KeyLocation_as.h" #include "log.h" #include "fn_call.h" #include "Global_as.h" #include "smart_ptr.h" // for boost intrusive_ptr #include "builtin_function.h" // need builtin_function #include "GnashException.h" // for ActionException namespace gnash { // Forward declarations namespace { as_value keylocation_ctor(const fn_call& fn); void attachKeyLocationInterface(as_object& o); void attachKeyLocationStaticInterface(as_object& o); } // extern (used by Global.cpp) void keylocation_class_init(as_object& where, const ObjectURI& uri) { registerBuiltinClass(where, keylocation_ctor, attachKeyLocationInterface, attachKeyLocationStaticInterface, uri); } namespace { void attachKeyLocationInterface(as_object& /*o*/) { } void attachKeyLocationStaticInterface(as_object& /*o*/) { } as_value keylocation_ctor(const fn_call& /*fn*/) { return as_value(); } } // anonymous namespace } // gnash namespace // local Variables: // mode: C++ // indent-tabs-mode: t // End:
atheerabed/gnash-fork
libcore/asobj/flash/ui/KeyLocation_as.cpp
C++
gpl-3.0
1,875
/** * Copyright (C) 2015 https://github.com/sndnv * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef NETWORKMANAGER_H #define NETWORKMANAGER_H #include <vector> #include <string> #include <deque> #include <boost/thread/mutex.hpp> #include <boost/unordered_map.hpp> #include "../Common/Types.h" #include "../Utilities/FileLogger.h" #include "../Utilities/ThreadPool.h" #include "../SecurityManagement/Crypto/Handlers.h" #include "../SecurityManagement/Crypto/LocalAuthenticationDataStore.h" #include "../SecurityManagement/SecurityManager.h" #include "../SecurityManagement/Types/SecurityTokens.h" #include "../SecurityManagement/Types/SecurityRequests.h" #include "../SecurityManagement/Types/Exceptions.h" #include "../SecurityManagement/Interfaces/Securable.h" #include "../DatabaseManagement/DatabaseManager.h" #include "../SessionManagement/SessionManager.h" #include "../SessionManagement/Types/Types.h" #include "../SessionManagement/Types/Exceptions.h" #include "../DatabaseManagement/Types/Types.h" #include "../DatabaseManagement/Containers/DeviceDataContainer.h" #include "../InstructionManagement/Interfaces/InstructionSource.h" #include "../InstructionManagement/Interfaces/InstructionTarget.h" #include "Types/Types.h" #include "Types/Containers.h" #include "../EntityManagement/Interfaces/DatabaseLoggingSource.h" #include "CommandConverter.h" #include "CommandConnectionsHandler.h" #include "DataConnectionsHandler.h" #include "InitialConnectionsHandler.h" #include "ConnectionDataStore.h" #include "Connections/Connection.h" #include "Connections/ConnectionManager.h" #include "../InstructionManagement/Sets/NetworkManagerInstructionSet.h" //Exceptions using SecurityManagement_Types::InvalidAuthorizationTokenException; //Networking using NetworkManagement_Handlers::CommandConverter; using NetworkManagement_Handlers::InitialConnectionsHandler; using NetworkManagement_Handlers::DataConnectionsHandler; using NetworkManagement_Handlers::CommandConnectionsHandler; using NetworkManagement_Handlers::ConnectionDataStore; using NetworkManagement_Connections::Connection; using NetworkManagement_Connections::ConnectionPtr; using NetworkManagement_Connections::ConnectionManager; using NetworkManagement_Connections::ConnectionManagerPtr; using NetworkManagement_Types::ConnectionManagerID; using NetworkManagement_Types::INVALID_CONNECTION_MANAGER_ID; using NetworkManagement_Types::RawConnectionID; using NetworkManagement_Types::ConnectionID; using NetworkManagement_Types::INVALID_CONNECTION_ID; using NetworkManagement_Types::ConnectionSetupState; using NetworkManagement_Types::TransientConnectionID; using NetworkManagement_Types::INVALID_TRANSIENT_CONNECTION_ID; using NetworkManagement_Types::PendingDataConnectionConfig; using NetworkManagement_Types::PendingDataConnectionConfigPtr; using NetworkManagement_Types::NewDeviceConnectionParameters; using NetworkManagement_Types::PendingInitConnectionConfig; using NetworkManagement_Types::PendingInitConnectionConfigPtr; using NetworkManagement_Types::ActiveConnectionData; using NetworkManagement_Types::ActiveConnectionDataPtr; using NetworkManagement_Types::StatCounter; using NetworkManagement_Types::CommandID; using NetworkManagement_Types::INVALID_COMMAND_ID; //Common using Common_Types::LogSeverity; using Common_Types::UserID; using Common_Types::DeviceID; using Common_Types::INVALID_USER_ID; using Common_Types::INVALID_DEVICE_ID; //Security using SecurityManagement_Crypto::SaltGenerator; using SecurityManagement_Crypto::SymmetricCryptoDataContainerPtr; using SecurityManagement_Crypto::RSACryptoDataContainerPtr; using SecurityManagement_Crypto::ECDHCryptoDataContainer; using SecurityManagement_Crypto::ECDHCryptoDataContainerPtr; using SecurityManagement_Crypto::AsymmetricCryptoHandler; using SecurityManagement_Crypto::AsymmetricCryptoHandlerPtr; using SecurityManagement_Crypto::SymmetricCryptoHandler; using SecurityManagement_Crypto::SymmetricCryptoHandlerPtr; using SecurityManagement_Crypto::LocalAuthenticationDataStore; using SecurityManagement_Types::TokenID; using SecurityManagement_Types::INVALID_TOKEN_ID; using SecurityManagement_Types::AuthorizationTokenPtr; using SecurityManagement_Types::PlaintextData; using SecurityManagement_Types::CiphertextData; using SecurityManagement_Types::AsymmetricCipherType; using SecurityManagement_Types::SymmetricCipherType; using SecurityManagement_Types::AuthenticatedSymmetricCipherModeType; using SecurityManagement_Types::KeyExchangeType; //Sessions using SessionManagement_Types::InternalSessionID; using SessionManagement_Types::INVALID_INTERNAL_SESSION_ID; //Instructions using InstructionManagement_Sets::InstructionBasePtr; using InstructionManagement_Types::InstructionSetType; using InstructionManagement_Sets::InstructionSetPtr; using InstructionManagement_Types::NetworkManagerAdminInstructionType; using InstructionManagement_Types::NetworkManagerUserInstructionType; using InstructionManagement_Types::NetworkManagerStateInstructionType; using InstructionManagement_Types::NetworkManagerConnectionLifeCycleInstructionType; using InstructionManagement_Types::NetworkManagerConnectionBridgingInstructionType; namespace SyncServer_Core { //<editor-fold defaultstate="collapsed" desc="Instruction Targets"> /** * Class for enabling support for multiple instruction sets by a single target. */ class NetworkManagerAdminInstructionTarget : public InstructionManagement_Interfaces::InstructionTarget<NetworkManagerAdminInstructionType> { public: virtual ~NetworkManagerAdminInstructionTarget() {} InstructionManagement_Types::InstructionSetType getType() const override { return InstructionManagement_Types::InstructionSetType::NETWORK_MANAGER_ADMIN; } }; /** * Class for enabling support for multiple instruction sets by a single target. */ class NetworkManagerUserInstructionTarget : public InstructionManagement_Interfaces::InstructionTarget<NetworkManagerUserInstructionType> { public: virtual ~NetworkManagerUserInstructionTarget() {} InstructionManagement_Types::InstructionSetType getType() const override { return InstructionManagement_Types::InstructionSetType::NETWORK_MANAGER_USER; } }; /** * Class for enabling support for multiple instruction sets by a single target. */ class NetworkManagerStateInstructionTarget : public InstructionManagement_Interfaces::InstructionTarget<NetworkManagerStateInstructionType> { public: virtual ~NetworkManagerStateInstructionTarget() {} InstructionManagement_Types::InstructionSetType getType() const override { return InstructionManagement_Types::InstructionSetType::NETWORK_MANAGER_STATE; } }; /** * Class for enabling support for multiple instruction sets by a single target. */ class NetworkManagerConnectionLifeCycleInstructionTarget : public InstructionManagement_Interfaces::InstructionTarget<NetworkManagerConnectionLifeCycleInstructionType> { public: virtual ~NetworkManagerConnectionLifeCycleInstructionTarget() {} InstructionManagement_Types::InstructionSetType getType() const override { return InstructionManagement_Types::InstructionSetType::NETWORK_MANAGER_CONNECTION_LIFE_CYCLE; } }; /** * Class for enabling support for multiple instruction sets by a single target. */ class NetworkManagerConnectionBridgingInstructionTarget : public InstructionManagement_Interfaces::InstructionTarget<NetworkManagerConnectionBridgingInstructionType> { public: virtual ~NetworkManagerConnectionBridgingInstructionTarget() {} InstructionManagement_Types::InstructionSetType getType() const override { return InstructionManagement_Types::InstructionSetType::NETWORK_MANAGER_CONNECTION_BRIDGING; } }; //</editor-fold> /** * Class for managing networking-related activities. * * Handles serialization/parsing, compression/decompression, * encryption/decryption and all connection setup processes. */ class NetworkManager final : public SecurityManagement_Interfaces::Securable, public NetworkManagerAdminInstructionTarget, public NetworkManagerUserInstructionTarget, public NetworkManagerStateInstructionTarget, public NetworkManagerConnectionLifeCycleInstructionTarget, public NetworkManagerConnectionBridgingInstructionTarget, public InstructionManagement_Interfaces::InstructionSource, public EntityManagement_Interfaces::DatabaseLoggingSource { public: /** Parameters structure for holding <code>NetworkManager</code> configuration data. */ struct NetworkManagerParameters { /** Number of threads to create in the network handling thread pool. */ unsigned int networkThreadPoolSize; /** Number of threads to create in the instruction handling thread pool. */ unsigned int instructionsThreadPoolSize; /** Reference to a database manager instance. */ DatabaseManager & databaseManager; /** Reference to a security manager instance. */ SecurityManager & securityManager; /** Reference to a session manager instance. */ SessionManager & sessionManager; /** Reference to a local authentication data store. */ LocalAuthenticationDataStore & authenticationStore; /** Parameters for the 'INIT' connections handler. */ InitialConnectionsHandler::InitialConnectionsHandlerParameters initConnectionsParams; /** Parameters for the 'COMMAND' connections handler. */ CommandConnectionsHandler::CommandConnectionsHandlerParameters commandConnectionsParams; /** Parameters for the 'DATA' connections handler. */ DataConnectionsHandler::DataConnectionsHandlerParameters dataConnectionsParams; /** Time to wait before setting a 'COMMAND' connection setup as failed (in seconds). */ Seconds commandConnectionSetupTimeout; /** Time to wait before setting a 'DATA' connection setup as failed (in seconds). */ Seconds dataConnectionSetupTimeout; /** Time to wait before setting an 'INIT' connection setup as failed (in seconds). */ Seconds initConnectionSetupTimeout; /** Time to wait before dropping a 'COMMAND' connection due to inactivity (in seconds). */ Seconds commandConnectionInactivityTimeout; /** Time to wait before dropping a 'DATA' connection due to inactivity (in seconds). */ Seconds dataConnectionInactivityTimeout; /** Time to wait before discarding pending connection data (in seconds). */ Seconds pendingConnectionDataDiscardTimeout; /** Time to wait for a 'DATA' connection setup to be initiated (in seconds). */ Seconds expectedDataConnectionTimeout; /** Time to wait for an 'INIT' connection setup to be initiated (in seconds). */ Seconds expectedInitConnectionTimeout; }; /** * Constructs a new network manager object with the specified configuration. * * * @param params the manager configuration * @param debugLogger pointer to an initialised <code>FileLogger</code> (if any) */ NetworkManager(const NetworkManagerParameters & params, Utilities::FileLoggerPtr debugLogger = Utilities::FileLoggerPtr()); /** * Stops all networking activity and clears all related data. */ ~NetworkManager(); NetworkManager() = delete; NetworkManager(const NetworkManager&) = delete; NetworkManager& operator=(const NetworkManager&) = delete; void postAuthorizationToken(const AuthorizationTokenPtr token) override; SecurityManagement_Types::SecurableComponentType getComponentType() const override { return SecurityManagement_Types::SecurableComponentType::NETWORK_MANAGER; } bool registerInstructionSet(InstructionSetPtr<NetworkManagerAdminInstructionType> set) const override; bool registerInstructionSet(InstructionSetPtr<NetworkManagerUserInstructionType> set) const override; bool registerInstructionSet(InstructionSetPtr<NetworkManagerStateInstructionType> set) const override; bool registerInstructionSet(InstructionSetPtr<NetworkManagerConnectionLifeCycleInstructionType> set) const override; bool registerInstructionSet(InstructionSetPtr<NetworkManagerConnectionBridgingInstructionType> set) const override; bool registerInstructionHandler(const std::function<void(InstructionBasePtr, AuthorizationTokenPtr)> handler) override { if(!processInstruction) { processInstruction = handler; return true; } else { logMessage(LogSeverity::Error, "(registerInstructionHandler) >" " The instruction handler has already been set."); return false; } } std::vector<InstructionSetType> getRequiredInstructionSetTypes() override { return std::vector<InstructionManagement_Types::InstructionSetType>( { InstructionManagement_Types::InstructionSetType::NETWORK_MANAGER_CONNECTION_LIFE_CYCLE }); } std::string getSourceName() const override { return "NetworkManager"; } bool registerLoggingHandler(const std::function<void(LogSeverity, const std::string &)> handler) override { if(!dbLogHandler) { dbLogHandler = handler; return true; } else { logMessage(LogSeverity::Error, "(registerLoggingHandler) >" " The database logging handler has already been set."); return false; } } //<editor-fold defaultstate="collapsed" desc="Handlers - Connection Managers"> /** * Starts a new connection manager with the supplied parameters. * * @param params the new connection manager configuration * @return the ID associated with the new manager */ ConnectionManagerID startConnectionManager(ConnectionManager::ConnectionManagerParameters params); /** * Stops the connection manager with the specified ID. * * @param id the ID of the manager to be stopped * @param type the type of the manager */ void stopConnectionManager(ConnectionManagerID id, ConnectionType type); /** * Stops the initial connection manager with the specified ID. * * @param id the ID of the manager to be stopped */ void stopInitConnectionManager(ConnectionManagerID id); /** * Stops the command connection manager with the specified ID. * * @param id the ID of the manager to be stopped */ void stopCommandConnectionManager(ConnectionManagerID id); /** * Stops the data connection manager with the specified ID. * * @param id the ID of the manager to be stopped */ void stopDataConnectionManager(ConnectionManagerID id); //</editor-fold> /** * Sends the supplied instruction to the specified device using * the specified manager. * * @param managerID the manager to use for the connection * (if no connection is active) * @param device the ID of the target device * @param instruction the instruction to be sent */ void sendInstruction( const ConnectionManagerID managerID, const DeviceID device, const InstructionBasePtr instruction); /** * Sends the supplied plaintext data to the specified device over * the specified connection. * * Note: Not fully supported. * * @param device the ID of the target device * @param connection the ID of the connection to be used * @param data the data to be sent */ void sendData( const DeviceID device, const ConnectionID connection, const PlaintextData & data) { dataConnections.sendData(device, connection, data); ++dataSent; throw std::logic_error("NetworkManager::sendData() >" " Operation not fully supported."); } /** * Retrieves a new transient connection ID. * * @return the requested ID */ TransientConnectionID getNewTransientID() { return ++lastTransientID; } StatCounter getCommandsReceived() const { return commandsReceived; } StatCounter getCommandsSent() const { return commandsSent; } StatCounter getConnectionsInitiated() const { return connectionsInitiated; } StatCounter getConnectionsReceived() const { return connectionsReceived; } StatCounter getDataReceived() const { return dataReceived; } StatCounter getDataSent() const { return dataSent; } StatCounter getSetupsCompleted() const { return setupsCompleted; } StatCounter getSetupsFailed() const { return setupsFailed; } StatCounter getSetupsPartiallyCompleted() const { return setupsPartiallyCompleted; } StatCounter getSetupsStarted() const { return setupsStarted; } unsigned long getInstructionsProcessed() const { return instructionsProcessed; } unsigned long getInstructionsReceived() const { return instructionsReceived; } private: Utilities::ThreadPool networkingThreadPool; //thread pool for networking tasks Utilities::ThreadPool instructionsThreadPool; //thread pool for processing instructions Utilities::FileLoggerPtr debugLogger; //logger for debugging std::function<void (LogSeverity, const std::string &)> dbLogHandler; //database log handler //Required Managers DatabaseManager & databaseManager; SecurityManager & securityManager; SessionManager & sessionManager; LocalAuthenticationDataStore & authenticationStore; //Connection Management Data boost::mutex connectionManagementDataMutex; ConnectionManagerID lastManagerID = INVALID_CONNECTION_MANAGER_ID; boost::unordered_map<ConnectionManagerID, ConnectionManagerPtr> dataConnectionManagers; boost::unordered_map<ConnectionManagerID, ConnectionManagerPtr> commandConnectionManagers; boost::unordered_map<ConnectionManagerID, ConnectionManagerPtr> initConnectionManagers; //Connection Data ConnectionDataStore dataStore; boost::mutex pendingConnectionsMutex; boost::unordered_map<ConnectionID, ConnectionSetupState> pendingConnections; boost::mutex activeDataConnectionsMutex; boost::unordered_map<DeviceID, boost::unordered_map<ConnectionID, ActiveConnectionDataPtr>> activeDataConnections; boost::mutex activeCommandConnectionsMutex; boost::unordered_map<DeviceID, ActiveConnectionDataPtr> activeCommandConnections; boost::unordered_map<DeviceID, std::deque<InstructionBasePtr>> pendingDeviceInstructions; //Connection Handlers CommandConverter converter; InitialConnectionsHandler initConnections; CommandConnectionsHandler commandConnections; DataConnectionsHandler dataConnections; boost::signals2::connection onCommandDataReceivedEventConnection; boost::signals2::connection onCommandConnectionEstablishedEventConnection; boost::signals2::connection onCommandConnectionEstablishmentFailedEventConnection; boost::signals2::connection onDataReceivedEventConnection; boost::signals2::connection onDataConnectionEstablishedEventConnection; boost::signals2::connection onDataConnectionEstablishmentFailedEventConnection; boost::signals2::connection onSetupCompletedEventConnection; boost::signals2::connection onSetupFailedEventConnection; //Connection Counters std::atomic<ConnectionID> lastConnectionID{INVALID_CONNECTION_ID}; std::atomic<TransientConnectionID> lastTransientID{INVALID_TRANSIENT_CONNECTION_ID}; //Timeout Settings Seconds commandConnectionSetupTimeout; Seconds dataConnectionSetupTimeout; Seconds initConnectionSetupTimeout; Seconds commandConnectionInactivityTimeout; Seconds dataConnectionInactivityTimeout; Seconds pendingConnectionDataDiscardTimeout; Seconds expectedDataConnectionTimeout; Seconds expectedInitConnectionTimeout; //Stats std::atomic<StatCounter> dataSent; std::atomic<StatCounter> dataReceived; std::atomic<StatCounter> commandsSent; std::atomic<StatCounter> commandsReceived; std::atomic<StatCounter> connectionsInitiated; std::atomic<StatCounter> connectionsReceived; std::atomic<StatCounter> setupsStarted; std::atomic<StatCounter> setupsCompleted; std::atomic<StatCounter> setupsPartiallyCompleted; std::atomic<StatCounter> setupsFailed; //<editor-fold defaultstate="collapsed" desc="Handlers - Connection Setup"> /** * Initiates a device setup process. * * @param managerID ID of the manager to be used for the connection * @param initAddress target device 'INIT' IP address * @param initPort target device 'INIT' IP port * @param sharedPassword secret shared between both peers * @param remotePeerType type of the remote peer * @param remotePeerID device ID for the remote peer (as identified by the local system) * @param transientID transient ID associated with the setup * @throw invalid_argument if the specified manager could not be found */ void initiateDeviceSetupProcess( const ConnectionManagerID managerID, const IPAddress initAddress, const IPPort initPort, const std::string & sharedPassword, const PeerType remotePeerType, const DeviceID remotePeerID, const TransientConnectionID transientID); /** * Prepares the required data for an expected device setup process. * * @param sharedPassword secret shared between both peers * @param remotePeerType type of the remote peer * @param remotePeerID device ID for the remote peer (as identified by the local system) * @param transientID transient ID associated with the setup */ void waitForDeviceSetupProcess( const std::string & sharedPassword, const PeerType remotePeerType, const DeviceID remotePeerID, const TransientConnectionID transientID); /** * Initiates a command connection setup. * * @param managerID ID of the manager to be used for the connection * @param targetDevice target device ID * @throw invalid_argument if the specified manager could not be found */ void initiateCommandConnection( const ConnectionManagerID managerID, const DeviceID targetDevice); /** * Initiates a data connection setup. * * Note: All connection setup data is always encrypted. * * @param managerID ID of the manager to be used for the connection * @param transientID transient connection ID associated with the setup * @param data target device data * @param crypto crypto data for the connection setup process * (and, if configured, for the subsequent data transfers) * @param encrypt denotes whether encryption should be enabled * @param compress denotes whether compression should be enabled * @throw invalid_argument if the specified manager could not be found */ void initiateDataConnection( const ConnectionManagerID managerID, const TransientConnectionID transientID, DeviceDataContainerPtr data, SymmetricCryptoHandlerPtr crypto, bool encrypt, bool compress); /** * Prepares the required data for an expected data connection setup process. * * @param transientID transient connection ID associated with the setup * @param data target device data * @param crypto crypto data for the connection setup process * (and, if configured, for the subsequent data transfers) * @param encrypt denotes whether encryption should be enabled * @param compress denotes whether compression should be enabled */ void waitForDataConnection( const TransientConnectionID transientID, DeviceDataContainerPtr data, SymmetricCryptoHandlerPtr crypto, bool encrypt, bool compress); //</editor-fold> //<editor-fold defaultstate="collapsed" desc="Handlers - Misc"> /** * Loads data for the specified device into the data store. * * @param targetDevice the ID of the device to have its data * retrieved and stored in the data store * @return the data associated with the device */ DeviceDataContainerPtr loadCommandConnectionDeviceData(const DeviceID targetDevice); /** * Retrieves pending instructions based on their command IDs. * * Note: Used for setting their results (as returned by remote peers). * * @param connectionData active connection data * @param commandID command ID associated with the instruction (during serialization) * @throw runtime_error if the requested instruction could not be found * @return the requested instruction */ InstructionBasePtr retrievePendingInstruction( ActiveConnectionDataPtr connectionData, const CommandID commandID); /** * Adds a new task into the instructions thread pool for processing * (waiting for) the result from an instruction sent to a remote peer. * * @param deviceID the ID of the device associated with the instruction * @param responseSerializationFunction response serialization function */ void enqueueRemoteInstructionResultProcessing( const DeviceID deviceID, std::function<const PlaintextData (void)> responseSerializationFunction); /** * Sets the state of the specified connection. * * @param id the ID of the connection * @param state the new connection state */ void setPendingConnectionState(const ConnectionID id, ConnectionSetupState state); //</editor-fold> //<editor-fold defaultstate="collapsed" desc="Handlers - Timeouts"> /** * Timeout handler for pending connections. * * Fired by thread pool when timeout expires. * * @param id connection ID * @param connection connection pointer */ void pendingConnectionTimeoutHandler( const ConnectionID id, ConnectionPtr connection); /** * Timeout handler for active connections. * * Closes connections that have not had any recent activity. * * @param connectionData active connection data * @param lastEventsCount the number of event when the handler was last run */ void activeConnectionTimeoutHandler( ActiveConnectionDataPtr connectionData, const StatCounter lastEventsCount); /** * Timeout handler for discarding pending device instructions. * * @param device the ID of the associated device */ void pendingDeviceInstructionsDiscardTimeoutHandler(const DeviceID device); /** * Timeout handler for discarding pending 'INIT' connection data. * * @param transientID associated transient connection ID */ void initConnectionDataDiscardTimeoutHandler( const TransientConnectionID transientID); /** * Timeout handler for discarding pending 'COMMAND' connection data. * * @param device associated device ID */ void commandConnectionDataDiscardTimeoutHandler(const DeviceID device); /** * Timeout handler for discarding pending 'DATA' connection data. * * @param device associated device ID * @param transientID associated transient connection ID */ void dataConnectionDataDiscardTimeoutHandler( const DeviceID device, const TransientConnectionID transientID); //</editor-fold> //<editor-fold defaultstate="collapsed" desc="Handlers - Connection Setup Results"> /** * Event handler for processing established 'COMMAND' connections. * * @param deviceID the ID of the device associated with the connection * @param connectionID the ID of the connection */ void onCommandConnectionEstablishedHandler( const DeviceID deviceID, const ConnectionID connectionID); /** * Event handler for processing failed 'COMMAND' connections. * * @param deviceID the ID of the device associated with the connection * @param connectionID the ID of the connection */ void onCommandConnectionEstablishmentFailedHandler( const DeviceID deviceID, const ConnectionID connectionID); /** * Event handler for processing established 'DATA' connections. * * @param deviceID the ID of the device associated with the connection * @param connectionID the ID of the connection * @param transientID the transient ID associated with the connection */ void onDataConnectionEstablishedHandler( const DeviceID deviceID, const ConnectionID connectionID, const TransientConnectionID transientID); /** * Event handler for processing failed 'DATA' connections. * * @param deviceID the ID of the device associated with the connection * @param connectionID the ID of the connection * @param transientID the transient ID associated with the connection */ void onDataConnectionEstablishmentFailedHandler( const DeviceID deviceID, const ConnectionID connectionID, const TransientConnectionID transientID); /** * Event handler for processing completed 'INIT' processes. * * @param connectionID the ID of the connection * @param deviceID the ID of the device associated with the connection * @param transientID the transient ID associated with the connection * @param deviceConfig device configuration data */ void onInitSetupCompletedHandler( const ConnectionID connectionID, const DeviceID deviceID, const TransientConnectionID transientID, const NewDeviceConnectionParameters & deviceConfig); /** * Event handler for processing failed 'INIT' processes. * * @param connectionID the ID of the connection * @param transientID the transient ID associated with the connection */ void onInitSetupFailedHandler( const ConnectionID connectionID, const TransientConnectionID transientID); //</editor-fold> //<editor-fold defaultstate="collapsed" desc="Handlers - Closed Connections"> /** * Event handler for processing termination of established 'COMMAND' connections. * * @param deviceID the ID of the device associated with the connection * @param connectionID the ID of the connection */ void onEstablishedCommandConnectionClosed( const DeviceID deviceID, const ConnectionID connectionID); /** * Event handler for processing termination of established 'DATA' connections. * * @param deviceID the ID of the device associated with the connection * @param connectionID the ID of the connection */ void onEstablishedDataConnectionClosed( const DeviceID deviceID, const ConnectionID connectionID); //</editor-fold> //<editor-fold defaultstate="collapsed" desc="Handlers - Data Received"> /** * Event handler for processing received 'COMMAND' data. * * @param deviceID the ID of the device associated with the connection * @param data the received plaintext data */ void onCommandDataReceivedHandler( const DeviceID deviceID, const PlaintextData data); /** * Event handler for processing received 'DATA' data. * * Note: Not supported. * * @param deviceID the ID of the device associated with the connection * @param connectionID the ID of the connection * @param data the received plaintext data */ void onDataReceivedHandler( const DeviceID deviceID, const ConnectionID connectionID, const PlaintextData data) { ++dataReceived; throw std::logic_error("NetworkManager::onDataReceivedHandler() >" " Operation not supported."); } //</editor-fold> //<editor-fold defaultstate="collapsed" desc="Handlers - Connection Managers"> /** * Event handler for newly created connections (local and remote). * * @param connection connection pointer * @param initiation denotes which peer initiated the connection * @param managerID associated manager ID */ void onConnectionCreatedHandler( ConnectionPtr connection, ConnectionInitiation initiation, ConnectionManagerID managerID); /** * Event handler for failed local connection initiations. * * @param error the error that was encountered during initiation * @param managerID associated manager ID */ void onConnectionInitiationFailedHandler( const boost::system::error_code & error, ConnectionManagerID managerID); //</editor-fold> /** * Retrieves a new connection ID. * * @return the requested ID */ ConnectionID getNewConnectionID() { return ++lastConnectionID; } //Instruction Management boost::mutex instructionDataMutex; //instruction data mutex boost::unordered_map<TokenID, AuthorizationTokenPtr> authorizationTokens; //expected authorization tokens unsigned long instructionsReceived; //number of instructions received by manager unsigned long instructionsProcessed; //number of instructions processed by manager //function for sending instructions to system components std::function< void(InstructionManagement_Sets::InstructionBasePtr, SecurityManagement_Types::AuthorizationTokenPtr) > processInstruction; /** * Sets an exception with the specified message in the supplied * instruction's promise. * * Note: Always sets <code>std::runtime_error</code> exception. * * @param message the message for the exception * @param instruction the instruction in which the exception is to be set */ void throwInstructionException( const std::string & message, InstructionPtr<NetworkManagerConnectionLifeCycleInstructionType> instruction) { try { boost::throw_exception(std::runtime_error(message)); } catch(const std::runtime_error &) { instruction->getPromise().set_exception(boost::current_exception()); return; } } //<editor-fold defaultstate="collapsed" desc="Handlers - Instructions"> void lifeCycleOpenDataConnectionHandler( InstructionPtr<NetworkManagerConnectionLifeCycleInstructionType> instruction); void lifeCycleOpenInitConnectionHandler( InstructionPtr<NetworkManagerConnectionLifeCycleInstructionType> instruction); //Instruction Handlers Function Binds std::function<void(InstructionPtr<NetworkManagerConnectionLifeCycleInstructionType>)> lifeCycleOpenDataConnectionHandlerBind = boost::bind(&NetworkManager::lifeCycleOpenDataConnectionHandler, this, _1); std::function<void(InstructionPtr<NetworkManagerConnectionLifeCycleInstructionType>)> lifeCycleOpenInitConnectionHandlerBind = boost::bind(&NetworkManager::lifeCycleOpenInitConnectionHandler, this, _1); //</editor-fold> /** * Verifies the supplied authentication token. * * Note: The token is removed the the list of expected authorization tokens * * @param token the token to be verified * * @throw InvalidAuthorizationTokenException if an invalid token is encountered */ void verifyAuthorizationToken(AuthorizationTokenPtr token); /** * Logs the specified message, if the database log handler is set. * * Note: If a debugging file logger is assigned, the message is sent to it. * * @param severity the severity associated with the message/event * @param message the message to be logged */ void logMessage(LogSeverity severity, const std::string & message) const { if(dbLogHandler) dbLogHandler(severity, message); if(debugLogger) debugLogger->logMessage(Utilities::FileLogSeverity::Debug, "NetworkManager " + message); } }; } #endif /* NETWORKMANAGER_H */
sndnv/Syn
Server/src/main/NetworkManagement/NetworkManager.h
C
gpl-3.0
43,036
package models; import java.io.*; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import org.apache.jena.iri.impl.Main; //import org.json.XML; import org.openjena.riot.RiotException; import com.hp.hpl.jena.util.FileManager; import com.hp.hpl.jena.vocabulary.DC; import com.hp.hpl.jena.vocabulary.RDF; import com.hp.hpl.jena.vocabulary.RDFS; import com.hp.hpl.jena.vocabulary.OWL; import com.hp.hpl.jena.ontology.DatatypeProperty; import com.hp.hpl.jena.ontology.ObjectProperty; import com.hp.hpl.jena.ontology.OntClass; import com.hp.hpl.jena.ontology.OntDocumentManager; import com.hp.hpl.jena.ontology.OntModel; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.rdf.model.Resource; import com.hp.hpl.jena.sparql.vocabulary.FOAF; /** * Classe permettant de décrire l'ontologie UpYourMood créée par nos soins. * @author BURC Pierre, DUPLOUY Olivier, KISIALIOVA Katsiaryna, SEGUIN Tristan * */ public class OntologyDescription { private OntModel m=null; /** * Constructeur permettant de créer notre modèle pour décrire notre ontologie. */ public OntologyDescription(){ m = ModelFactory.createOntologyModel (); } /** * * @return le modèle sous le format "RDF/XML-ABBREV", consultable sous le lien "Notre ontologie". */ public String OwlDescription(){ constructionOfOWLOntology(); OutputStream out = new ByteArrayOutputStream(); m.write (out,"RDF/XML-ABBREV"); return out.toString(); } /** * Méthode qui ajoute au modèle toutes les informations nécessaires pour décrire notre ontologie. */ private void constructionOfOWLOntology(){ /**************************************************************************************************************** **************************************************************************************************************** **************************************** AJOUT DES CLASSES ***************************************************** **************************************************************************************************************** ****************************************************************************************************************/ // Music OntClass MusicClass = m.createClass(OntologyUpYourMood.getUymMusic()); MusicClass.addLabel("Music Class", "en"); MusicClass.addComment("A Super class of Musics info", "en"); // User OntClass UserClass = m.createClass(OntologyUpYourMood.getUymUser()); UserClass.addLabel("User Class", "en"); UserClass.addComment("A Super class of user's info", "en"); // WordConnotation OntClass WordConnotationClass = m.createClass(OntologyUpYourMood.getUymWordConnotation()); WordConnotationClass.addLabel("Word-Connotation Class","en"); WordConnotationClass.addComment("A Super class of Word-Connotation info", "en"); // Album OntClass AlbumClass = m.createClass(OntologyUpYourMood.getUymMusic()+"album"); AlbumClass.addLabel("Album Class","en"); AlbumClass.addComment("Title of the Album that containing the Music", "en"); // Artist OntClass ArtistClass = m.createClass(OntologyUpYourMood.getUymMusic()+"artist"); ArtistClass.addLabel("Artist Class","en"); ArtistClass.addComment("Name of the artist who composed the music", "en"); // AlbumCover OntClass AlbumCoverClass = m.createClass(OntologyUpYourMood.getUymMusic()+"albumcover"); AlbumCoverClass.addLabel("AlbumCover Class","en"); AlbumCoverClass.addComment("AlbumCover of the Album", "en"); // Title OntClass TitleClass = m.createClass(OntologyUpYourMood.getUymMusic()+"title"); TitleClass.addLabel("Title Class","en"); TitleClass.addComment("Title of the Music", "en"); // MusicaExperience OntClass MusicalExperienceClass = m.createClass(OntologyUpYourMood.getUymMusic()+"musicalexperience"); MusicalExperienceClass.addLabel("MusicalExperience Class","en"); MusicalExperienceClass.addComment("A MusicalExperience groups the Music that the User is listening and the associated word / connotation ", "en"); //Color OntClass ColorClass = m.createClass(OntologyUpYourMood.getUymColor()); ColorClass.addLabel("Color Class","en"); ColorClass.addComment("A Color describes the Music that the User has chosen for", "en"); /**************************************************************************************************************** **************************************************************************************************************** **************************************** AJOUT DES PROPRIETES ************************************************** **************************************************************************************************************** ****************************************************************************************************************/ // foaf:knows ObjectProperty foafKnows = m.createObjectProperty(FOAF.getURI()+"knows"); // hasListen ObjectProperty hasListen = m.createObjectProperty(OntologyUpYourMood.getUymUser()+"hasListen"); hasListen.addRange(MusicClass); hasListen.addDomain(UserClass); hasListen.addLabel("A User has listen a music", "en"); hasListen.addComment("Link a Music resource to a User", "en"); hasListen.addSuperProperty(foafKnows); // isConnoted ObjectProperty isConnoted = m.createObjectProperty(OntologyUpYourMood.getUymWordConnotation()+"isConnoted"); isConnoted.addRange(WordConnotationClass); isConnoted.addDomain(WordConnotationClass); isConnoted.addLabel("A word is connoted positively or negatively ", "en"); isConnoted.addComment("Link a connotation Literal to a word", "en"); // isAssociatedBy ObjectProperty isAssociatedBy = m.createObjectProperty(OntologyUpYourMood.getUymWordConnotation()+"isAssociatedBy"); isAssociatedBy.addRange(WordConnotationClass); isAssociatedBy.addDomain(MusicClass); isAssociatedBy.addLabel("A word is associate to a Music by a User", "en"); isAssociatedBy.addComment("??", "en"); // isRelatedTo ObjectProperty isRelatedTo = m.createObjectProperty(NiceTag.getURI()+"isRelatedTo"); // makesMeFeel ObjectProperty makesMeFeel = m.createObjectProperty(OntologyUpYourMood.getUymMusic()+"makesMeFeel"); makesMeFeel.addRange(WordConnotationClass); makesMeFeel.addDomain(MusicClass); makesMeFeel.addLabel("a Music provokes emotions to a User", "en"); makesMeFeel.addComment("Link a User Resource to a Music", "en"); makesMeFeel.addSuperProperty(isRelatedTo); // dc:title ObjectProperty dcTitle = m.createObjectProperty(DC.getURI()+"title"); // albumTitle ObjectProperty albumTitle = m.createObjectProperty(OntologyUpYourMood.getUymMusic()+"albumTitle"); albumTitle.addRange(AlbumClass); albumTitle.addDomain(MusicClass); albumTitle.addLabel("a Music is in an Album", "en"); albumTitle.addComment("Link a Album Resource to a Music", "en"); albumTitle.addSuperProperty(dcTitle); // hasMusicalExperience ObjectProperty hasMusicalExperience = m.createObjectProperty(OntologyUpYourMood.getUymUser()+"hasMusicalExperience"); hasMusicalExperience.addRange(MusicalExperienceClass); hasMusicalExperience.addDomain(UserClass); hasMusicalExperience.addLabel("A User has an Musical Experience", "en"); hasMusicalExperience.addComment("Link a MusicalExperience Resource to a User", "en"); // songTitle ObjectProperty songTitle = m.createObjectProperty(OntologyUpYourMood.getUymMusic()+"songTitle"); songTitle.addRange(TitleClass); songTitle.addDomain(MusicClass); songTitle.addLabel("A Music has a Title", "en"); songTitle.addComment("Link a Title Resource to a Music", "en"); songTitle.addSuperProperty(dcTitle); // isColoredBy ObjectProperty isColoredBy = m.createObjectProperty(OntologyUpYourMood.getUymMusic()+"isColoredBy"); isColoredBy.addRange(ColorClass); isColoredBy.addDomain(MusicClass); isColoredBy.addLabel("A Music has an Assosiated Color", "en"); isColoredBy.addComment("Link a Color Resource to a Music", "en"); // givenBy ObjectProperty givenBy = m.createObjectProperty(OntologyUpYourMood.getUymUser() + "givenBy"); givenBy.addRange(UserClass); givenBy.addDomain(ColorClass); givenBy.addLabel("A Color was given by User", "en"); givenBy.addComment("Link a Color Resource to a User", "en"); // isSelected ObjectProperty isSelected = m.createObjectProperty(OntologyUpYourMood.getUymColor() + "isSelected"); isSelected.addIsDefinedBy(RDFS.Literal); isSelected.addRange(ColorClass); isSelected.addDomain(ColorClass); isSelected.addLabel("A Color was given by User * times", "en"); isSelected.addComment("Describe a Color Resource for some Music and some User", "en"); // hasValue ObjectProperty hasValue = m.createObjectProperty(OntologyUpYourMood.getUymColor() + "hasValue"); hasValue.addIsDefinedBy(RDFS.Literal); hasValue.addRange(ColorClass); hasValue.addDomain(ColorClass); hasValue.addLabel("A Color was value html/css", "en"); hasValue.addComment("Describe a Color Resource by his html/css identificateur", "en"); // DC.creator ObjectProperty creator = m.createObjectProperty(DC.getURI()+"creator"); creator.addRange(ArtistClass); creator.addDomain(MusicClass); creator.addLabel("A Music is made by an Artist ( Use of the Property DC:creator )", "en"); creator.addComment("Link a Artist Resource to a Music", "en"); // FOAF:depiction ObjectProperty foafDepiction = m.createObjectProperty(FOAF.getURI()+"depiction"); foafDepiction.addRange(AlbumCoverClass); foafDepiction.addDomain(MusicClass); foafDepiction.addLabel("A Music has an AlbumCover ( Use of the Property FOAF:depiction )", "en"); foafDepiction.addComment("Link a AlbumCover Resource to a Music", "en"); } /*private void ajouterPrefixe(){ m.setNsPrefix("rdf", RDF.getURI()); m.setNsPrefix("rdfs", RDFS.getURI()); m.setNsPrefix("foaf", FOAF.getURI()); m.setNsPrefix("dc", DC.getURI()); m.setNsPrefix("uym", OntologyUpYourMood.getUym()); }*/ public static void main(String args[]){ OntologyDescription ds = new OntologyDescription(); ds.OwlDescription(); } }
lodacom/UpYourMood
app/models/OntologyDescription.java
Java
gpl-3.0
10,196
--- title: "उन्नाव रेप केस : पीड़िता ने डीएम पर लगाया परिवार को होटल में 'कैद' करने का आरोप" layout: item category: ["UP"] date: 2018-04-11T07:39:45.971Z --- <p>उन्नाव: उन्नाव गैंगरेप पीड़िता ने जिला प्रशासन पर गंभीर आरोप लगाते हुए कहा है कि उसे और उसके परिवार को होटल के एक कमरे में कैद कर दिया गया है. पीड़िता का आरोप है कि उसे पीने के लिए पानी तक मुहैया नहीं कराया जा रहा है. पीड़िता के चाचा का भी आरोप है कि परिवार को एक होटल में नजरबंद करके रखा गया है. परिवार को मुख्यमंत्री योगी आदित्यनाथ से भी मिलने नहीं दिया जा रहा है.</p> <p>उन्नाव रेप पीड़िता ने डीएम पर आरोप लगाते हुए कहा, “मैं मुख्यमंत्री योगी अदित्यनाथ से अपील करती हूं कि मुझे इंसाफ दिलाया जाए. डीएम ने मुझे होटल के एक कमरे में बंद कर दिया है. मुझे यहां पीने के लिए पानी भी नहीं दिया जा रहा है. मैं बस इतना ही चाहती हूं की दोषियों को सजा मिले.”</p> <p>दरअसल, बीजेपी विधायक के डर से पीड़िता परिवार गांव नहीं लौटना चाहता. जिसके बाद पूरे परिवार को उन्नाव के होटल में रखा गया है. डीएम रवि कुमार एनजी का कहना है कि परिवार की सुरक्षा को देखते हुए उन्हें सरकारी गेस्ट हाउस में रखा गया है. हालांकि पीड़िता और उसके चाचा का आरोप है कि उन्हें होटल के कमरे में नजरबन्द कर दिया गया है. पानी मांगने पर कहा जाता है बोतल लेकर भर लाओ. लेकिन पानी है ही नहीं.</p> <p>पीड़िता का कहना है कि उसके पिता की तो हत्या कर दी गई. अब बचे हुए चाचा को भी ये लोग मार देंगे. उसका कहना है कि उसे आर्थिक मदद नहीं चाहिए. बस न्याय चाहिए.</p> <p>गौरतलब है कि इस मामले में बीजेपी विधायक कुलदीप सिंह सेंगर के भाई अतुल सिंह को पीड़िता के पिता की हत्या के मामले में गिरफ्तार कर जेल भेजा जा चुका है. हालांकि विधायक पर अभी तक कोई कार्रवाई नहीं की गई है. वहीं मुख्यमंत्री के निर्देश पर जांच के लिए एसआईटी गठित कर दी गई है. सीएम ने एसआईटी से आज शाम तक रिपोर्ट देने का निर्देश दिया है.</p> <p>इस बीच आरोपी विधायक कुलदीप सिंह सेंगर की पत्नी ने भी बुधवार को डीजीपी ओपी सिंह से मुलाक़ात कर पति के लिए इन्साफ की गुहार लगाई. उन्होंने कहा मैं यहां पर पति के लिए न्याय की गुहार लगाने आई हूं.</p>
InstantKhabar/_source
_source/news/2018-04-11-unnaw.html
HTML
gpl-3.0
4,644
# -*- coding: utf-8 -*- # generated from catkin/cmake/template/__init__.py.in # keep symbol table as clean as possible by deleting all unnecessary symbols from os import path as os_path from sys import path as sys_path from pkgutil import extend_path __extended_path = "/home/pi/Documents/desenvolvimentoRos/src/tf2_ros/src".split(";") for p in reversed(__extended_path): sys_path.insert(0, p) del p del sys_path __path__ = extend_path(__path__, __name__) del extend_path __execfiles = [] for p in __extended_path: src_init_file = os_path.join(p, __name__ + '.py') if os_path.isfile(src_init_file): __execfiles.append(src_init_file) else: src_init_file = os_path.join(p, __name__, '__init__.py') if os_path.isfile(src_init_file): __execfiles.append(src_init_file) del src_init_file del p del os_path del __extended_path for __execfile in __execfiles: with open(__execfile, 'r') as __fh: exec(__fh.read()) del __fh del __execfile del __execfiles
UnbDroid/robomagellan
Codigos/Raspberry/desenvolvimentoRos/devel/lib/python2.7/dist-packages/tf2_ros/__init__.py
Python
gpl-3.0
1,035
Puppet module for nullmailer ============================ Nullmailer is useful in situations where you have machines but do not wish to configure them with a full email service (mail transfer agent, MTA). Particularly to send email about local activity to a centralised place. By default, the module will configure things to be sent, via SMTP, to the machine: smtp.$::domain and then to the address: root@$::domain i.e. given $::domain is 'example.com', mail would be sent to root@example.com via SMTP to smtp.example.com This may require you to configure your SMTP server to accept incoming email from various machines. NOTE: /etc/mailname must be set to a reasonable value. This module will, by default, set it to $::fqdn Basic usage ----------- class {'nullmailer': } To configure who will receive all email: class {'nullmailer': adminaddr => "puppet-rockstar@example.com" } Or to change the machine where email is sent to: class {'nullmailer': remoterelay => "elsewhere.example.com" } When modifying these parameters, please ensure the value is in double quotes. Other things to modify are listed in the init.pp file Advanced usage --------------- nullmailer is also able to use a remote relay which is on a different port, requires authentication, etc. As the combination of options will vary widely between various setups, instead a 'remoteopts' variable is provided. class {'nullmailer': remoteopts => "--port=2525" } Send to port 2525 instead of port 25 class {'nullmailer': remoteopts => "--user=foo --pass=bar" } Other available options (for Nullmailer 1.10+) are: - --port, set the port number of the remote host to connect to - --user, set the user name to be used for authentication - --pass, set the password for authentication - --auth-login, use AUTH LOGIN instead of auto-detecting in SMTP - --ssl, Connect using SSL (on port 465 instead) (1.10+) - --starttls, use STARTTLS command (1.10+) - --x509cafile, Certificate authority trust file (1.10+) - --x509crlfile, Certificate revocation list file (1.10+) - --x509fmtdef, X.509 files are in DER format (1.10+) - --insecure, Do not abort if server certificate fails validation (1.10+) Another use case might be *not* rewriting, or even having, a specific admin address to send email to. In this case, set adminaddr to the magic value of an empty string, like so; class {'nullmailer': adminaddr => '', } With things set up like this the remoterelay decides what addresses will be rewritten rather than all of them being rewritten at the client prior to sending. Notes ----- nullmailer is capable of handling multiple remote SMTP servers for delivery. If this is your setup, this module will not work out of the box for you. Contributors ------------ * [Anand Kumria](https://github.com/akumria) ([@akumria](https://twitter.com/akumria)) * [Callum Macdonald](https://github.com/chmac) * [Arne Schwabe](https://githib.com/schwabe) * [Klaus Ethgen](https://github.com/mowgli) * [Udo Waechter](https://github.com/zoide) * [David Schmitt](https://github.com/DavidS) Copyright and License --------------------- Copyright 2012-2013 [Linuxpeak](https://www.linuxpeak.com/) Pty Ltd. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
akumria/puppet-nullmailer
README.md
Markdown
gpl-3.0
3,879
/* $APPASERVER_HOME/utility/piece_quote_comma.c */ /* --------------------------------------------- */ /* Freely available software: see Appaserver.org */ /* --------------------------------------------- */ #include <stdio.h> #include <stdlib.h> #include "piece.h" #include "timlib.h" int main( int argc, char **argv ) { char buffer[ 65536 ]; char offset_str[ 128 ]; char component[ 4096 ]; char *offset_list_string; int offset, i; char destination_delimiter = ','; if ( argc < 2 ) { fprintf( stderr, "Usage: %s offset_1[,...,offset_n] [destination_delimiter]\n", argv[ 0 ] ); exit( 1 ); } offset_list_string = argv[ 1 ]; if ( argc == 3 ) destination_delimiter = *argv[ 2 ]; while( get_line( buffer, stdin ) ) { if ( *offset_list_string ) { for( i = 0; piece( offset_str, ',', offset_list_string, i ); i++ ) { offset = atoi( offset_str ); if ( offset < 0 ) { fprintf( stderr, "ERROR in :%s: Offset (%d) is less than zero\n", argv[ 0 ], offset ); exit( 1 ); } if ( !piece_quote_comma( component, buffer, offset ) ) { fprintf( stderr, "Warning %s: piece_quote_comma(%d) failed with [%s]\n", argv[ 0 ], offset, buffer ); } else { if ( i == 0 ) printf( "%s", component ); else printf( "%c%s", destination_delimiter, component ); } } } else { for( offset = 0 ; ; offset++ ) { if ( !piece_quote_comma( component, buffer, offset ) ) { break; } else { if ( offset == 0 ) printf( "%s", component ); else printf( "%c%s", destination_delimiter, component ); } } } printf( "\n" ); } return 0; }
timhriley/appaserver
utility/piece_quote_comma.c
C
gpl-3.0
1,810
<?php /* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2003 Eric Seigne <erics@rycks.com> * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2013 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** * \file htdocs/contact/list.php * \ingroup societe * \brief Page to list all contacts */ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; $langs->load("companies"); $langs->load("suppliers"); // Security check $contactid = GETPOST('id','int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'contact', $contactid,''); $search_lastname=GETPOST("search_lastname"); $search_firstname=GETPOST("search_firstname"); $search_societe=GETPOST("search_societe"); $search_poste=GETPOST("search_poste"); $search_phone=GETPOST("search_phone"); $search_phoneper=GETPOST("search_phoneper"); $search_phonepro=GETPOST("search_phonepro"); $search_phonemob=GETPOST("search_phonemob"); $search_fax=GETPOST("search_fax"); $search_email=GETPOST("search_email"); $search_priv=GETPOST("search_priv"); $type=GETPOST("type"); $view=GETPOST("view"); $sall=GETPOST("contactname"); $sortfield = GETPOST('sortfield', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha'); $page = GETPOST('page', 'int'); $userid=GETPOST('userid','int'); $begin=GETPOST('begin'); if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="p.lastname"; if ($page < 0) { $page = 0; } $limit = $conf->liste_limit; $offset = $limit * $page; $langs->load("companies"); $titre = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("ListOfContacts") : $langs->trans("ListOfContactsAddresses")); if ($type == "c" || $type=="p") { $titre.=' ('.$langs->trans("ThirdPartyCustomers").')'; $urlfiche="fiche.php"; } else if ($type == "f") { $titre.=' ('.$langs->trans("ThirdPartySuppliers").')'; $urlfiche="fiche.php"; } else if ($type == "o") { $titre.=' ('.$langs->trans("OthersNotLinkedToThirdParty").')'; $urlfiche=""; } if (GETPOST('button_removefilter')) { $search_lastname=""; $search_firstname=""; $search_societe=""; $search_poste=""; $search_phone=""; $search_phoneper=""; $search_phonepro=""; $search_phonemob=""; $search_fax=""; $search_email=""; $search_priv=""; $sall=""; } if ($search_priv < 0) $search_priv=''; /* * View */ $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:M&oacute;dulo_Empresas'); $form=new Form($db); $sql = "SELECT s.rowid as socid, s.nom as name,"; $sql.= " p.rowid as cidp, p.lastname as lastname, p.firstname, p.poste, p.email,"; $sql.= " p.phone, p.phone_mobile, p.fax, p.fk_pays, p.priv, p.tms,"; $sql.= " cp.code as country_code"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as cp ON cp.rowid = p.fk_pays"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc"; if (!$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; $sql.= ' WHERE p.entity IN ('.getEntity('societe', 1).')'; if (!$user->rights->societe->client->voir && !$socid) //restriction { $sql .= " AND (sc.fk_user = " .$user->id." OR p.fk_soc IS NULL)"; } if (! empty($userid)) // propre au commercial { $sql .= " AND p.fk_user_creat=".$db->escape($userid); } // Filter to exclude not owned private contacts if ($search_priv != '0' && $search_priv != '1') { $sql .= " AND (p.priv='0' OR (p.priv='1' AND p.fk_user_creat=".$user->id."))"; } else { if ($search_priv == '0') $sql .= " AND p.priv='0'"; if ($search_priv == '1') $sql .= " AND (p.priv='1' AND p.fk_user_creat=".$user->id.")"; } if ($search_lastname) // filter on lastname { $sql .= " AND p.lastname LIKE '%".$db->escape($search_lastname)."%'"; } if ($search_firstname) // filter on firstname { $sql .= " AND p.firstname LIKE '%".$db->escape($search_firstname)."%'"; } if ($search_societe) // filtre sur la societe { $sql .= " AND s.nom LIKE '%".$db->escape($search_societe)."%'"; } if (strlen($search_poste)) // filtre sur la societe { $sql .= " AND p.poste LIKE '%".$db->escape($search_poste)."%'"; } if (strlen($search_phone)) { $sql .= " AND (p.phone LIKE '%".$db->escape($search_phone)."%' OR p.phone_perso LIKE '%".$db->escape($search_phone)."%' OR p.phone_mobile LIKE '%".$db->escape($search_phone)."%')"; } if (strlen($search_phoneper)) { $sql .= " AND p.phone LIKE '%".$db->escape($search_phoneper)."%'"; } if (strlen($search_phonepro)) { $sql .= " AND p.phone_perso LIKE '%".$db->escape($search_phonepro)."%'"; } if (strlen($search_phonemob)) { $sql .= " AND p.phone_mobile LIKE '%".$db->escape($search_phonemob)."%'"; } if (strlen($search_fax)) { $sql .= " AND p.fax LIKE '%".$db->escape($search_fax)."%'"; } if (strlen($search_email)) // filtre sur l'email { $sql .= " AND p.email LIKE '%".$db->escape($search_email)."%'"; } if ($type == "o") // filtre sur type { $sql .= " AND p.fk_soc IS NULL"; } else if ($type == "f") // filtre sur type { $sql .= " AND s.fournisseur = 1"; } else if ($type == "c") // filtre sur type { $sql .= " AND s.client IN (1, 3)"; } else if ($type == "p") // filtre sur type { $sql .= " AND s.client IN (2, 3)"; } if ($sall) { // For natural search $scrit = explode(' ', $sall); foreach ($scrit as $crit) { $sql .= " AND (p.lastname LIKE '%".$db->escape($crit)."%' OR p.firstname LIKE '%".$db->escape($crit)."%' OR p.email LIKE '%".$db->escape($crit)."%')"; } } if (! empty($socid)) { $sql .= " AND s.rowid = ".$socid; } // Count total nb of records $nbtotalofrecords = 0; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); } // Add order and limit if($view == "recent") { $sql.= " ORDER BY p.datec DESC "; $sql.= " ".$db->plimit($conf->liste_limit+1, $offset); } else { $sql.= " ORDER BY $sortfield $sortorder "; $sql.= " ".$db->plimit($conf->liste_limit+1, $offset); } //print $sql; dol_syslog("contact/list.php sql=".$sql); $result = $db->query($sql); if ($result) { $contactstatic=new Contact($db); $param ='&begin='.urlencode($begin).'&view='.urlencode($view).'&userid='.urlencode($userid).'&contactname='.urlencode($sall); $param.='&type='.urlencode($type).'&view='.urlencode($view).'&search_lastname='.urlencode($search_lastname).'&search_firstname='.urlencode($search_firstname).'&search_societe='.urlencode($search_societe).'&search_email='.urlencode($search_email); if ($search_priv == '0' || $search_priv == '1') $param.="&search_priv=".urlencode($search_priv); $num = $db->num_rows($result); $i = 0; print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords); print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="view" value="'.$view.'">'; print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; if ($sall) { print $langs->trans("Filter")." (".$langs->trans("Lastname").", ".$langs->trans("Firstname")." ".$langs->trans("or")." ".$langs->trans("EMail")."): ".$sall; } print '<table class="liste" width="100%">'; // Ligne des titres print '<tr class="liste_titre">'; print_liste_field_titre($langs->trans("Lastname"),$_SERVER["PHP_SELF"],"p.lastname", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"p.firstname", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("PostOrFunction"),$_SERVER["PHP_SELF"],"p.poste", $begin, $param, '', $sortfield,$sortorder); if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("Phone"),$_SERVER["PHP_SELF"],"p.phone", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("PhoneMobile"),$_SERVER["PHP_SELF"],"p.phone_mob", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("Fax"),$_SERVER["PHP_SELF"],"p.fax", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"p.email", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("DateModificationShort"),$_SERVER["PHP_SELF"],"p.tms", $begin, $param, 'align="center"', $sortfield,$sortorder); print_liste_field_titre($langs->trans("ContactVisibility"),$_SERVER["PHP_SELF"],"p.priv", $begin, $param, 'align="center"', $sortfield,$sortorder); print '<td class="liste_titre">&nbsp;</td>'; print "</tr>\n"; // Ligne des champs de filtres print '<tr class="liste_titre">'; print '<td class="liste_titre">'; print '<input class="flat" type="text" name="search_lastname" size="9" value="'.$search_lastname.'">'; print '</td>'; print '<td class="liste_titre">'; print '<input class="flat" type="text" name="search_firstname" size="9" value="'.$search_firstname.'">'; print '</td>'; print '<td class="liste_titre">'; print '<input class="flat" type="text" name="search_poste" size="9" value="'.$search_poste.'">'; print '</td>'; if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { print '<td class="liste_titre">'; print '<input class="flat" type="text" name="search_societe" size="9" value="'.$search_societe.'">'; print '</td>'; } print '<td class="liste_titre">'; print '<input class="flat" type="text" name="search_phonepro" size="8" value="'.$search_phonepro.'">'; print '</td>'; print '<td class="liste_titre">'; print '<input class="flat" type="text" name="search_phonemob" size="8" value="'.$search_phonemob.'">'; print '</td>'; print '<td class="liste_titre">'; print '<input class="flat" type="text" name="search_fax" size="8" value="'.$search_fax.'">'; print '</td>'; print '<td class="liste_titre">'; print '<input class="flat" type="text" name="search_email" size="8" value="'.$search_email.'">'; print '</td>'; print '<td class="liste_titre">&nbsp;</td>'; print '<td class="liste_titre" align="center">'; $selectarray=array('0'=>$langs->trans("ContactPublic"),'1'=>$langs->trans("ContactPrivate")); print $form->selectarray('search_priv',$selectarray,$search_priv,1); print '</td>'; print '<td class="liste_titre" align="right">'; print '<input type="image" value="button_search" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; print '&nbsp; '; print '<input type="image" value="button_removefilter" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/searchclear.png" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">'; print '</td>'; print '</tr>'; $var=True; while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); $var=!$var; print "<tr $bc[$var]>"; // Name print '<td valign="middle">'; $contactstatic->lastname=$obj->lastname; $contactstatic->firstname=''; $contactstatic->id=$obj->cidp; print $contactstatic->getNomUrl(1,'',20); print '</td>'; // Firstname print '<td>'.dol_trunc($obj->firstname,20).'</td>'; // Function print '<td>'.dol_trunc($obj->poste,20).'</td>'; // Company if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { print '<td>'; if ($obj->socid) { print '<a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'; print img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->name,20).'</a>'; } else { print '&nbsp;'; } print '</td>'; } // Phone print '<td>'.dol_print_phone($obj->phone,$obj->country_code,$obj->cidp,$obj->socid,'AC_TEL').'</td>'; // Phone mobile print '<td>'.dol_print_phone($obj->phone_mobile,$obj->country_code,$obj->cidp,$obj->socid,'AC_TEL').'</td>'; // Fax print '<td>'.dol_print_phone($obj->fax,$obj->country_code,$obj->cidp,$obj->socid,'AC_TEL').'</td>'; // EMail print '<td>'.dol_print_email($obj->email,$obj->cidp,$obj->socid,'AC_EMAIL',18).'</td>'; // Date print '<td align="center">'.dol_print_date($db->jdate($obj->tms),"day").'</td>'; // Private/Public print '<td align="center">'.$contactstatic->LibPubPriv($obj->priv).'</td>'; // Links Add action and Export vcard print '<td align="right">'; print '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&amp;backtopage=1&amp;contactid='.$obj->cidp.'&amp;socid='.$obj->socid.'">'.img_object($langs->trans("AddAction"),"action").'</a>'; print ' &nbsp; '; print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/contact/vcard.php?id='.$obj->cidp.'">'; print img_picto($langs->trans("VCard"),'vcard.png').' '; print '</a></td>'; print "</tr>\n"; $i++; } print "</table>"; print '</form>'; if ($num > $limit) print_barre_liste('', $page, $_SERVER["PHP_SELF"], '&amp;begin='.$begin.'&amp;view='.$view.'&amp;userid='.$userid, $sortfield, $sortorder, '', $num, $nbtotalofrecords, ''); $db->free($result); } else { dol_print_error($db); } print '<br>'; llxFooter(); $db->close(); ?>
jcntux/Dolibarr
htdocs/contact/list.php
PHP
gpl-3.0
15,009
/** * This file is part of veraPDF Parser, a module of the veraPDF project. * Copyright (c) 2015, veraPDF Consortium <info@verapdf.org> * All rights reserved. * <p> * veraPDF Parser is free software: you can redistribute it and/or modify * it under the terms of either: * <p> * The GNU General public license GPLv3+. * You should have received a copy of the GNU General Public License * along with veraPDF Parser as the LICENSE.GPL file in the root of the source * tree. If not, see http://www.gnu.org/licenses/ or * https://www.gnu.org/licenses/gpl-3.0.en.html. * <p> * The Mozilla Public License MPLv2+. * You should have received a copy of the Mozilla Public License along with * veraPDF Parser as the LICENSE.MPL file in the root of the source tree. * If a copy of the MPL was not distributed with this file, you can obtain one at * http://mozilla.org/MPL/2.0/. */ package org.verapdf.pd.font; import org.verapdf.as.ASAtom; import org.verapdf.cos.COSBase; import org.verapdf.cos.COSObjType; import org.verapdf.cos.COSObject; import org.verapdf.cos.COSStream; import org.verapdf.pd.PDObject; import org.verapdf.pd.font.stdmetrics.StandardFontMetrics; import java.util.Iterator; import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; /** * Represents font descriptor. * * @author Sergey Shemyakov */ public class PDFontDescriptor extends PDObject { private static final Logger LOGGER = Logger.getLogger(PDFontDescriptor.class.getCanonicalName()); private final Long flags; private static final int FIXED_PITCH_BIT = 1; private static final int SERIF_BIT = 2; private static final int SYMBOLIC_BIT = 3; private static final int SCRIPT_BIT = 4; private static final int NONSYMBOLIC_BIT = 6; private static final int ITALIC_BIT = 7; private static final int ALL_CAP_BIT = 17; private static final int SMALL_CAP_BIT = 18; private static final int FORCE_BOLD_BIT = 19; private static final Double DEFAULT_LEADING = new Double(0); private static final Double DEFAULT_XHEIGHT = new Double(0); private static final Double DEFAULT_STEM_H = new Double(0); private static final Double DEFAULT_WIDTH = new Double(0); // values private String fontName; private String fontFamily; private ASAtom fontStretch; private Double fontWeight; private Boolean isFixedPitch; private Boolean isSerif; private Boolean isSymbolic; private Boolean isScript; private Boolean isNonSymblic; private Boolean isItalic; private Boolean isAllCap; private Boolean isSmallCup; private Boolean isForceBold; private double[] fontBoundingBox; private Double italicAngle; private Double ascent; private Double descent; private Double leading; private Double capHeight; private Double xHeight; private Double stemV; private Double stemH; private Double avgWidth; private Double maxWidth; private Double missingWidth; private String charSet; public PDFontDescriptor(COSObject obj) { super(obj); flags = getFlags(); fontName = (getFontName() == null ? "" : getFontName().getValue()); if (flags == null) { LOGGER.log(Level.FINE, "Font descriptor for font " + fontName + " doesn't contain flags."); } } /** * @return a collection of flags defining various characteristics of the * font. */ public Long getFlags() { return getIntegerKey(ASAtom.FLAGS); } /** * @return the PostScript name of the font. */ public ASAtom getFontName() { return getNameKey(ASAtom.FONT_NAME); } /** * @return a byte string specifying the preferred font family name. */ public String getFontFamily() { if (fontFamily == null) { fontFamily = getStringKey(ASAtom.FONT_FAMILY); } return fontFamily; } /** * @return the font stretch value. */ public ASAtom getFontStretch() { if (fontStretch == null) { fontStretch = getNameKey(ASAtom.FONT_STRETCH); } return fontStretch; } /** * @return the weight (thickness) component of the fully-qualified font name * or font specifier. */ public Double getFontWeight() { if (fontWeight == null) { fontWeight = getRealKey(ASAtom.FONT_WEIGHT); } return fontWeight; } /** * @return true if all glyphs have the same width. */ public boolean isFixedPitch() { if (isFixedPitch == null) { isFixedPitch = isFlagBitOn(FIXED_PITCH_BIT); } return isFixedPitch; } /** * @return true if glyphs have serifs, which are short strokes drawn at an * angle on the top and bottom of glyph stems. */ public boolean isSerif() { if (isSerif == null) { isSerif = isFlagBitOn(SERIF_BIT); } return isSerif; } /** * @return true if font contains glyphs outside the Adobe standard Latin * character set. */ public boolean isSymbolic() { if (isSymbolic == null) { isSymbolic = isFlagBitOn(SYMBOLIC_BIT); } return isSymbolic; } /** * @return true if glyphs resemble cursive handwriting. */ public boolean isScript() { if (isScript == null) { isScript = isFlagBitOn(SCRIPT_BIT); } return isScript; } /** * @return true if font uses the Adobe standard Latin character set or a * subset of it. */ public boolean isNonsymbolic() { if (isNonSymblic == null) { isNonSymblic = isFlagBitOn(NONSYMBOLIC_BIT); } return isNonSymblic; } /** * @return true if glyphs have dominant vertical strokes that are slanted. */ public boolean isItalic() { if (isItalic == null) { isItalic = isFlagBitOn(ITALIC_BIT); } return isItalic; } /** * @return true if font contains no lowercase letters; typically used for * display purposes, such as for titles or headlines. */ public boolean isAllCap() { if (isAllCap == null) { isAllCap = isFlagBitOn(ALL_CAP_BIT); } return isAllCap; } /** * @return true if font contains both uppercase and lowercase letters. */ public boolean isSmallCap() { if (isSmallCup == null) { isSmallCup = isFlagBitOn(SMALL_CAP_BIT); } return isSmallCup; } /** * @return true if bold glyphs shall be painted with extra pixels even at * very small text sizes by a conforming reader. */ public boolean isForceBold() { if (isForceBold == null) { isForceBold = isFlagBitOn(FORCE_BOLD_BIT); } return isForceBold; } private boolean isFlagBitOn(int bit) { return flags != null && (flags.intValue() & (1 << (bit - 1))) != 0; } /** * @return a rectangle, expressed in the glyph coordinate system, that shall * specify the font bounding box. */ public double[] getFontBoundingBox() { if (fontBoundingBox == null) { COSBase bbox = this.getObject().getKey(ASAtom.FONT_BBOX).get(); if (bbox != null && bbox.getType() == COSObjType.COS_ARRAY && bbox.size() == 4) { double[] res = new double[4]; for (int i = 0; i < 4; ++i) { COSObject obj = bbox.at(i); if (obj.getType().isNumber()) { res[i] = obj.getReal(); } else { LOGGER.log(Level.FINE, "Font bounding box array for font " + fontName + " contains " + obj.getType()); return null; } } fontBoundingBox = res; } else { LOGGER.log(Level.FINE, "Font bounding box array for font " + fontName + " is not an array of 4 elements"); return null; } } return fontBoundingBox; } /** * @return the angle, expressed in degrees counterclockwise from the * vertical, of the dominant vertical strokes of the font. */ public Double getItalicAngle() { if (italicAngle == null) { italicAngle = getRealKey(ASAtom.ITALIC_ANGLE); } return italicAngle; } /** * @return the maximum height above the baseline reached by glyphs in this * font. */ public Double getAscent() { if (ascent == null) { ascent = getRealKey(ASAtom.ASCENT); } return ascent; } /** * @return the maximum depth below the baseline reached by glyphs in this * font. */ public Double getDescent() { if (descent == null) { descent = getRealKey(ASAtom.DESCENT); } return descent; } /** * @return the spacing between baselines of consecutive lines of text. */ public Double getLeading() { if (leading == null) { Double res = getRealKey(ASAtom.LEADING); leading = res == null ? DEFAULT_LEADING : res; } return leading; } /** * @return the vertical coordinate of the top of flat capital letters, * measured from the baseline. */ public Double getCapHeight() { if (capHeight == null) { capHeight = getRealKey(ASAtom.CAP_HEIGHT); } return capHeight; } /** * @return the font’s x height: the vertical coordinate of the top of flat * nonascending lowercase letters (like the letter x), measured from the * baseline, in fonts that have Latin characters. */ public Double getXHeight() { if (xHeight == null) { Double res = getRealKey(ASAtom.XHEIGHT); xHeight = res == null ? DEFAULT_XHEIGHT : res; } return xHeight; } /** * @return the thickness, measured horizontally, of the dominant vertical * stems of glyphs in the font. */ public Double getStemV() { if (stemV == null) { stemV = getRealKey(ASAtom.STEM_V); } return stemV; } /** * @return the thickness, measured vertically, of the dominant horizontal * stems of glyphs in the font. */ public Double getStemH() { if (stemH == null) { Double res = getRealKey(ASAtom.STEM_H); stemH = res == null ? DEFAULT_STEM_H : res; } return stemH; } /** * @return the average width of glyphs in the font. */ public Double getAvgWidth() { if (avgWidth == null) { Double res = getRealKey(ASAtom.AVG_WIDTH); avgWidth = res == null ? DEFAULT_WIDTH : res; } return avgWidth; } /** * @return the maximum width of glyphs in the font. */ public Double getMaxWidth() { if (maxWidth == null) { Double res = getRealKey(ASAtom.MAX_WIDTH); maxWidth = res == null ? DEFAULT_WIDTH : res; } return maxWidth; } /** * @return the width to use for character codes whose widths are not * specified in a font dictionary’s Widths array. */ public Double getMissingWidth() { if (missingWidth == null) { Double res = getRealKey(ASAtom.MISSING_WIDTH); missingWidth = res == null ? DEFAULT_WIDTH : res; } return missingWidth; } /** * @return a string listing the character names defined in a font subset. */ public String getCharSet() { if (charSet == null) { charSet = getStringKey(ASAtom.CHAR_SET); } return charSet; } /** * @return a stream containing a Type 1 font program. */ public COSStream getFontFile() { return getCOSStreamWithCheck(ASAtom.FONT_FILE); } /** * @return a stream containing a TrueType font program. */ public COSStream getFontFile2() { return getCOSStreamWithCheck(ASAtom.FONT_FILE2); } /** * @return a stream containing a font program whose format is specified by * the Subtype entry in the stream dictionary. */ public COSStream getFontFile3() { return getCOSStreamWithCheck(ASAtom.FONT_FILE3); } public boolean canParseFontFile(ASAtom key) { return this.knownKey(key) && getCOSStreamWithCheck(key) != null; } private COSStream getCOSStreamWithCheck(ASAtom key) { COSObject res = getKey(key); if (res.getType() == COSObjType.COS_STREAM) { return (COSStream) res.getDirectBase(); } else { return null; } } public void setFontName(ASAtom fontName) { if (fontName != null) { this.fontName = fontName.getValue(); this.setNameKey(ASAtom.FONT_NAME, fontName); } } public void setFontFamily(String fontFamily) { this.fontFamily = fontFamily; } public void setFontStretch(ASAtom fontStretch) { this.fontStretch = fontStretch; } public void setFontWeight(Double fontWeight) { this.fontWeight = fontWeight; } public void setFixedPitch(Boolean fixedPitch) { isFixedPitch = fixedPitch; } public void setSerif(Boolean serif) { isSerif = serif; } public void setSymbolic(Boolean symbolic) { isSymbolic = symbolic; } public void setScript(Boolean script) { isScript = script; } public void setNonSymblic(Boolean nonSymblic) { isNonSymblic = nonSymblic; } public void setItalic(Boolean italic) { isItalic = italic; } public void setAllCap(Boolean allCap) { isAllCap = allCap; } public void setSmallCup(Boolean smallCup) { isSmallCup = smallCup; } public void setForceBold(Boolean forceBold) { isForceBold = forceBold; } public void setFontBoundingBox(double[] fontBoundingBox) { this.fontBoundingBox = fontBoundingBox; } public void setItalicAngle(Double italicAngle) { this.italicAngle = italicAngle; } public void setAscent(Double ascent) { this.ascent = ascent; } public void setDescent(Double descent) { this.descent = descent; } public void setLeading(Double leading) { this.leading = leading; } public void setCapHeight(Double capHeight) { this.capHeight = capHeight; } public void setxHeight(Double xHeight) { this.xHeight = xHeight; } public void setStemV(Double stemV) { this.stemV = stemV; } public void setStemH(Double stemH) { this.stemH = stemH; } public void setAvgWidth(Double avgWidth) { this.avgWidth = avgWidth; } public void setMaxWidth(Double maxWidth) { this.maxWidth = maxWidth; } public void setMissingWidth(Double missingWidth) { this.missingWidth = missingWidth; } public void setCharSet(String charSet) { this.charSet = charSet; } public static PDFontDescriptor getDescriptorFromMetrics(StandardFontMetrics sfm) { PDFontDescriptor res = new PDFontDescriptor(new COSObject()); boolean isSymbolic = "FontSpecific".equals(sfm.getEncodingScheme()); res.fontName = sfm.getFontName(); res.setFontName(ASAtom.getASAtom(sfm.getFontName())); res.fontFamily = sfm.getFamilyName(); res.fontBoundingBox = sfm.getFontBBox(); res.isSymbolic = isSymbolic; res.isNonSymblic = !isSymbolic; res.charSet = sfm.getCharSet(); res.capHeight = sfm.getCapHeight(); res.xHeight = sfm.getXHeight(); res.descent = sfm.getDescend(); res.ascent = sfm.getAscend(); res.italicAngle = sfm.getItalicAngle(); double totalWidth = 0; int glyphNum = 0; Iterator<Map.Entry<String, Integer>> widthsIterator = sfm.getWidthsIterator(); while(widthsIterator.hasNext()) { Integer width = widthsIterator.next().getValue(); if (width != null && width > 0) { totalWidth += width; glyphNum++; } } if (glyphNum != 0) { res.avgWidth = totalWidth / glyphNum; } return res; } }
shem-sergey/veraPDF-pdflib
src/main/java/org/verapdf/pd/font/PDFontDescriptor.java
Java
gpl-3.0
16,683
var FitoTab = Class.create(); FitoTab.prototype = { element: null, options: {}, trs: [], bgcolors: [], choosed_colors: [], allchecked: false, initialize: function(element) { var element = $(element); try { var options = { element: element, hoverColor: '#FFFFCC', selectedColor: '#FFFFCC', trIDPrefix: 'tr' }; if (arguments[1]) Object.extend(options, arguments[1] || {}); this.options = options; } catch(err){ }; if (element && element.tagName == "TABLE") { this.trs = element.getElementsByTagName("tr"); } }, create: function() { if (!this.options.element) return false; callerObj = this; for (var i=0; i < this.trs.length; i++) { var tr = this.trs[i]; if (tr.id.indexOf(this.options.trIDPrefix) == 0) { var id = parseInt(tr.id.replace(this.options.trIDPrefix + '_', '')); this.bgcolors[id] = tr.style.backgroundColor; // // Over table row // tr.onmouseover = function(e) { var id = parseInt(this.id.replace(callerObj.options.trIDPrefix + '_', '')); if (!callerObj.choosed_colors[id]) { this.style.backgroundColor = callerObj.options.hoverColor; } }; // // Out table row // tr.onmouseout = function(e) { var id = parseInt(this.id.replace(callerObj.options.trIDPrefix + '_', '')); if (!callerObj.choosed_colors[id]) { this.style.backgroundColor = callerObj.bgcolors[id]; } }; // // Click check box // tr.onclick = function(e) { var event = (e || window.event); var element = (event.originalTarget || event.srcElement); if (element.tagName == "INPUT" && element.type == "checkbox") { var id = parseInt(this.id.replace(callerObj.options.trIDPrefix + '_', '')); this.style.backgroundColor = (element.checked) ? callerObj.options.selectedColor : callerObj.bgcolors[id]; callerObj.choosed_colors[id] = (element.checked) ? callerObj.options.selectedColor : null; } }; } } }, checkall: function() { if (!this.options.element) return false; var checked = (this.allchecked) ? false : true; this.allchecked = checked; for (var i=0; i < this.trs.length; i++) { var tr = this.trs[i]; if (tr.id.indexOf(this.options.trIDPrefix) == 0) { var inputs = tr.getElementsByTagName('input'); if (inputs[0].type == "checkbox" && inputs[0].disabled == true) continue; var id = parseInt(tr.id.replace(this.options.trIDPrefix + '_', '')); tr.style.backgroundColor = (checked) ? this.options.selectedColor : this.bgcolors[id]; this.choosed_colors[id] = (checked) ? this.options.selectedColor : null; } } }, SetColor: function(id) { try { $(this.trIDPrefix + '_' + id).style.backgroundColor = this.bgcolors[id]; } catch (err) { } }, setup: function() { this.options.prototype = { alternative: '_Webta_Settings' }; if (arguments[0]) Object.extend(this.options, arguments[0] || {}); if (!this.options.element) { this.options.element = $(this.options.alternative); var settings = true; } if (!this.options.element) return false; try { var tab = this.options.element; var rowHeight = 20; var Head = tab.getElementsByTagName("thead")[0]; var Body = tab.getElementsByTagName("tbody")[0]; var _tempPos = Position.cumulativeOffset(tab); var tabOffsetLeft = _tempPos[0]; var tabOffsetTop = _tempPos[1]; var tabHeight = this.GetWindowHeight() - tabOffsetTop - 55; // // set cells height // var cmlt = 0; for (var i = 0; i < tab.rows.length - 1; i++) { if (!i) { tab.rows[0].style.height = "10px"; tab.rows[0].style.padding = 0; } else { tab.rows[i].style.height = rowHeight + "px"; } cmlt += tab.rows[i].offsetHeight; } try { tab.rows[tab.rows.length - 1].style.height = tabHeight - cmlt + "px"; } catch (err2) { } finally { var wHead = (!settings) ? Head.offsetHeight : tab.rows[0].offsetHeight; var lastRow = tab.rows[tab.rows.length - 2]; var firstRow = tab.rows[1]; var w = 0; var lastNum = lastRow.cells.length - 1; for (var i = 0; i < firstRow.cells.length; i++) { firstRow.cells[i].style.borderTop = '1px solid #A2BBDD'; } for (var i = 1; i < tab.rows.length; i++) { if ((i % 2 == 0) && !settings && tab.rows[i].style.backgroundColor == "") { tab.rows[i].style.backgroundColor = '#F9FAFF'; } if (tab.rows[i].cells[0].className.indexOf("Part") == -1) tab.rows[i].cells[0].style.borderLeft = '1px solid #A2BBDD'; } if (settings) return false; for (var i = 0; i < lastRow.cells.length; i++) { w += lastRow.cells[i].offsetWidth; if ((lastNum > i && lastRow.cells[i+1].className == "Item") || (settings && !i)) { try { if ($("separator_" + i)) { $("separator_" + i).parentNode.removeChild($("separator_" + i)); } } catch (err) {} var div = document.createElement("div"); div.id = "separator_" + i; div.className = "vrule gutter"; div.style.left = tabOffsetLeft + w - 3 + 'px'; div.style.top = tabOffsetTop + wHead + 'px'; div.style.height = tab.offsetHeight - wHead - 1 + 'px'; document.body.appendChild(div); } } } } catch (err) {} }, GetWindowHeight: function() { return (window.innerHeight != undefined) ? window.innerHeight : document.documentElement.clientHeight; } }
DicsyDel/epp-drs
app/www/js/class.Tweaker.js
JavaScript
gpl-3.0
5,605
<?php session_start(); ?>
McAsulys/McAsulysDev
myfb/config/header.php
PHP
gpl-3.0
26
namespace rtg.world.biome.realistic.vanilla { using System; using generic.pixel; using generic.init; using generic.world.biome; using generic.world.chunk; using rtg.api.config; using rtg.api.util; using rtg.api.util.noise; using rtg.api.world; using rtg.world.gen.surface; using rtg.world.gen.terrain; public class RealisticBiomeVanillaSavannaM : RealisticBiomeVanillaBase { public static Biome biome = Biomes.MUTATED_SAVANNA; public static Biome river = Biomes.RIVER; public RealisticBiomeVanillaSavannaM() : base(biome, river) { this.noLakes = true; } override public void initConfig() { this.getConfig().ALLOW_LOGS = true; this.getConfig().SURFACE_MIX_PIXEL = 0; this.getConfig().SURFACE_MIX_PIXEL_META = 0; } override public TerrainBase initTerrain() { return new TerrainVanillaSavannaM(); } public class TerrainVanillaSavannaM : TerrainBase { public TerrainVanillaSavannaM() { } override public float generateNoise(RTGWorld rtgWorld, int x, int y, float border, float river) { return terrainGrasslandMountains(x, y, rtgWorld.simplex, rtgWorld.cell, river, 4f, 90f, 67f); } } override public SurfaceBase initSurface() { return new SurfaceVanillaSavannaM(config, Pixels.GRASS, Pixels.DIRT, 0f, 1.5f, 60f, 65f, 1.5f, PixelUtil.getStateDirt(1)); } override public Biome beachBiome() { return this.beachBiome(Biomes.BEACHES); } public class SurfaceVanillaSavannaM : SurfaceBase { private float min; private float sCliff = 1.5f; private float sHeight = 60f; private float sStrength = 65f; private float cCliff = 1.5f; private Pixel mixPixel; public SurfaceVanillaSavannaM(BiomeConfig config, Pixel top, Pixel fill, float minCliff, float stoneCliff, float stoneHeight, float stoneStrength, float clayCliff, Pixel mix) : base(config, top, fill) { min = minCliff; sCliff = stoneCliff; sHeight = stoneHeight; sStrength = stoneStrength; cCliff = clayCliff; mixPixel = this.getConfigPixel(config.SURFACE_MIX_PIXEL, config.SURFACE_MIX_PIXEL_META, mix); } override public void paintTerrain(Chunk primer, int i, int j, int x, int z, int depth, RTGWorld rtgWorld, float[] noise, float river, Biome[] _base) { Random rand = rtgWorld.rand; OpenSimplexNoise simplex = rtgWorld.simplex; float c = CliffCalculator.calc(x, z, noise); int cliff = 0; bool m = false; Pixel b; for (int k = 255; k > -1; k--) { b = primer.getPixelState(x, k, z).getPixel(); if (b == Pixels.AIR) { depth = -1; } else if (b == Pixels.STONE) { depth++; float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { cliff = 1; } if (c > cCliff) { cliff = 2; } if (cliff == 1) { if (rand.Next(3) == 0) { primer.setPixelState(x, k, z, hcCobble(rtgWorld, i, j, x, z, k)); } else { primer.setPixelState(x, k, z, hcStone(rtgWorld, i, j, x, z, k)); } } else if (cliff == 2) { if (depth > -1 && depth < 2) { if (rand.Next(3) == 0) { primer.setPixelState(x, k, z, hcCobble(rtgWorld, i, j, x, z, k)); } else { primer.setPixelState(x, k, z, hcStone(rtgWorld, i, j, x, z, k)); } } else if (depth < 10) { primer.setPixelState(x, k, z, hcStone(rtgWorld, i, j, x, z, k)); } } else { if (k > 74) { if (depth == 0) { if (rand.Next(5) == 0) { primer.setPixelState(x, k, z, mixPixel); } else { primer.setPixelState(x, k, z, topPixel); } } else if (depth < 4) { primer.setPixelState(x, k, z, fillerPixel); } } else if (depth == 0 && k > 61) { int r = (int)((k - 62) / 2f); if (rand.Next(r + 2) == 0) { primer.setPixelState(x, k, z, Pixels.GRASS); } else if (rand.Next((int)(r / 2f) + 2) == 0) { primer.setPixelState(x, k, z, mixPixel); } else { primer.setPixelState(x, k, z, topPixel); } } else if (depth < 4) { primer.setPixelState(x, k, z, fillerPixel); } } } } } } } }
Safebox36/RTG-Unity
Project RTG Unity/Assets/RTG Unity/world/biome/realistic/vanilla/RealisticBiomeVanillaSavannaM.cs
C#
gpl-3.0
7,065
/* * ElementExtracter.cpp * * Created on: 02/28/14 * Author: Ardavon Falls * Copyright: (c)2012 Ardavon Falls * * This file is part of xsd-tools. * * xsd-tools is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * xsd-tools is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Xsd-Tools. If not, see <http://www.gnu.org/licenses/>. */ #include "./src/XSDParser/Elements/Element.hpp" #include "./src/XSDParser/Elements/Schema.hpp" #include "./src/XSDParser/Elements/Annotation.hpp" #include "./src/XSDParser/Elements/SimpleType.hpp" #include "./src/XSDParser/Elements/ComplexType.hpp" #include "./src/XSDParser/Elements/Group.hpp" #include "./src/XSDParser/Elements/Include.hpp" #include "./src/Processors/ElementExtracter.hpp" using namespace std; using namespace Processors; using namespace XSD::Elements; ElementExtracter::ElementExtracter() : LuaProcessorBase(NULL), m_elementLst() { } ElementExtracter::ElementExtracter(const ElementExtracter& rProcessor) : LuaProcessorBase(rProcessor), m_elementLst(rProcessor.m_elementLst) {} /* virtual */ ElementExtracter::~ElementExtracter() { m_elementLst.clear(); } const ElementExtracter::ElementLst& ElementExtracter::Extract(const Schema& rDocRoot) { ProcessSchema(&rDocRoot); return m_elementLst; } /* virtual */ void ElementExtracter::ProcessSchema(const Schema* pNode) { /* different iterator accross the schema children */ std::unique_ptr<Node> pChildNode(pNode->FirstChild()); if (NULL != pChildNode.get()) { do { if (XSD_ISELEMENT(pChildNode.get(), Element) || XSD_ISELEMENT(pChildNode.get(), Annotation) || XSD_ISELEMENT(pChildNode.get(), Include) || XSD_ISELEMENT(pChildNode.get(), SimpleType) || XSD_ISELEMENT(pChildNode.get(), ComplexType) || XSD_ISELEMENT(pChildNode.get(), Group)) { pChildNode->ParseElement(*this); } } while (NULL != (pChildNode = std::unique_ptr<Node>(pChildNode->NextSibling())).get()); } } /* virtual */ void ElementExtracter::ProcessElement(const Element* pNode) { m_elementLst.push_back(new Element(*pNode)); } /* virtual */ void ElementExtracter::ProcessInclude(const Include* pNode) { const Schema * pSchema = pNode->QuerySchema(); pSchema->ParseChildren(*this); }
Ardy123/xsd-tools
src/Processors/ElementExtracter.cpp
C++
gpl-3.0
2,692
<?php /************************* Coppermine Photo Gallery ************************ Copyright (c) 2003-2016 Coppermine Dev Team v1.0 originally written by Gregory Demar This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation. ******************************************** Coppermine version: 1.6.03 $HeadURL$ **********************************************/ $base = array( 0x00 => 'Ji ', 'Zhi ', 'Gua ', 'Ken ', 'Che ', 'Ti ', 'Ti ', 'Fu ', 'Chong ', 'Xie ', 'Bian ', 'Die ', 'Kun ', 'Duan ', 'Xiu ', 'Xiu ', 0x10 => 'He ', 'Yuan ', 'Bao ', 'Bao ', 'Fu ', 'Yu ', 'Tuan ', 'Yan ', 'Hui ', 'Bei ', 'Chu ', 'Lu ', 'Ena ', 'Hitoe ', 'Yun ', 'Da ', 0x20 => 'Gou ', 'Da ', 'Huai ', 'Rong ', 'Yuan ', 'Ru ', 'Nai ', 'Jiong ', 'Suo ', 'Ban ', 'Tun ', 'Chi ', 'Sang ', 'Niao ', 'Ying ', 'Jie ', 0x30 => 'Qian ', 'Huai ', 'Ku ', 'Lian ', 'Bao ', 'Li ', 'Zhe ', 'Shi ', 'Lu ', 'Yi ', 'Die ', 'Xie ', 'Xian ', 'Wei ', 'Biao ', 'Cao ', 0x40 => 'Ji ', 'Jiang ', 'Sen ', 'Bao ', 'Xiang ', 'Chihaya ', 'Pu ', 'Jian ', 'Zhuan ', 'Jian ', 'Zui ', 'Ji ', 'Dan ', 'Za ', 'Fan ', 'Bo ', 0x50 => 'Xiang ', 'Xin ', 'Bie ', 'Rao ', 'Man ', 'Lan ', 'Ao ', 'Duo ', 'Gui ', 'Cao ', 'Sui ', 'Nong ', 'Chan ', 'Lian ', 'Bi ', 'Jin ', 0x60 => 'Dang ', 'Shu ', 'Tan ', 'Bi ', 'Lan ', 'Pu ', 'Ru ', 'Zhi ', NULL, 'Shu ', 'Wa ', 'Shi ', 'Bai ', 'Xie ', 'Bo ', 'Chen ', 0x70 => 'Lai ', 'Long ', 'Xi ', 'Xian ', 'Lan ', 'Zhe ', 'Dai ', 'Tasuki ', 'Zan ', 'Shi ', 'Jian ', 'Pan ', 'Yi ', 'Ran ', 'Ya ', 'Xi ', 0x80 => 'Xi ', 'Yao ', 'Feng ', 'Tan ', NULL, 'Biao ', 'Fu ', 'Ba ', 'He ', 'Ji ', 'Ji ', 'Jian ', 'Guan ', 'Bian ', 'Yan ', 'Gui ', 0x90 => 'Jue ', 'Pian ', 'Mao ', 'Mi ', 'Mi ', 'Mie ', 'Shi ', 'Si ', 'Zhan ', 'Luo ', 'Jue ', 'Mi ', 'Tiao ', 'Lian ', 'Yao ', 'Zhi ', 0xA0 => 'Jun ', 'Xi ', 'Shan ', 'Wei ', 'Xi ', 'Tian ', 'Yu ', 'Lan ', 'E ', 'Du ', 'Qin ', 'Pang ', 'Ji ', 'Ming ', 'Ying ', 'Gou ', 0xB0 => 'Qu ', 'Zhan ', 'Jin ', 'Guan ', 'Deng ', 'Jian ', 'Luo ', 'Qu ', 'Jian ', 'Wei ', 'Jue ', 'Qu ', 'Luo ', 'Lan ', 'Shen ', 'Di ', 0xC0 => 'Guan ', 'Jian ', 'Guan ', 'Yan ', 'Gui ', 'Mi ', 'Shi ', 'Zhan ', 'Lan ', 'Jue ', 'Ji ', 'Xi ', 'Di ', 'Tian ', 'Yu ', 'Gou ', 0xD0 => 'Jin ', 'Qu ', 'Jiao ', 'Jiu ', 'Jin ', 'Cu ', 'Jue ', 'Zhi ', 'Chao ', 'Ji ', 'Gu ', 'Dan ', 'Zui ', 'Di ', 'Shang ', 'Hua ', 0xE0 => 'Quan ', 'Ge ', 'Chi ', 'Jie ', 'Gui ', 'Gong ', 'Hong ', 'Jie ', 'Hun ', 'Qiu ', 'Xing ', 'Su ', 'Ni ', 'Ji ', 'Lu ', 'Zhi ', 0xF0 => 'Zha ', 'Bi ', 'Xing ', 'Hu ', 'Shang ', 'Gong ', 'Zhi ', 'Xue ', 'Chu ', 'Xi ', 'Yi ', 'Lu ', 'Jue ', 'Xi ', 'Yan ', 'Xi ', );
coppermine-gallery/cpg1.6.x
include/transliteration/x89.php
PHP
gpl-3.0
2,730
/* Author: Chet Gnegy chetgnegy@gmail.com UnitGenerator.cpp This file the UnitGenerator class. This class is used as modules for input and effects. */ #include "UnitGenerator.h" // Default values int UnitGenerator::sample_rate = 44100; int UnitGenerator::buffer_length = 512; float interpolate(float *array, int length, double index); double interpolate(double *array, int length, double index); // #--------------Unit Generator Base Classes ----------------# void UnitGenerator::set_audio_settings(int bl, int sr){ UnitGenerator::buffer_length = bl; UnitGenerator::sample_rate = sr; DigitalFilter::set_sample_rate(sr); } // Allows user to set the generic parameters, bounds must already be set void UnitGenerator::set_params(double p1, double p2){ param1_ = clamp(p1, 1); param2_ = clamp(p2, 2); } // Allows entire buffers to be processed at once double *UnitGenerator::process_buffer(double *buffer, int length){ if (length != ugen_buffer_size_) printf("Buffer size mismatch! Input: %d internal: %d\n", length, ugen_buffer_size_); for (int i = 0; i < length; ++i){ ugen_buffer_[i] = tick(buffer[i]); } return ugen_buffer_; } // The absolute average of the samples in the buffer. Used to // calculate brightness double UnitGenerator::buffer_energy(){ double sum = 0; for (int i = 0; i < ugen_buffer_size_; ++i){ sum += fabs(ugen_buffer_[i]); } return sum / (1.0 * ugen_buffer_size_); } // Gets the FFT of the unit generator's current buffer void UnitGenerator::buffer_fft(int full_length, complex *out){ if (full_length != ugen_buffer_size_) printf("FFT Buffer size mismatch! Input: %d internal: %d\n", full_length, ugen_buffer_size_); complex *complex_arr_ = new complex[ugen_buffer_size_]; for (int i = 0; i < ugen_buffer_size_; ++i){ complex_arr_[i] = ugen_buffer_[i]; } CFFT::Forward(complex_arr_, out, full_length); for (int i = 0; i < ugen_buffer_size_; ++i){ out[i] = out[i] * 0.5 * (1 + cos(6.2831853 * i/(ugen_buffer_size_-1))); } delete[] complex_arr_; } // Scales the input to the range 0 - 1, requires maximum // and minimum parameters to be set double UnitGenerator::get_normalized_param(int param){ if (param == 1){ return (param1_-min_param1_)/(max_param1_ - min_param1_); } return (param2_-min_param2_)/(max_param2_ - min_param2_); } // Sets the input using the range 0 - 1, requires maximum // and minimum parameters to be set void UnitGenerator::set_normalized_param(double param1, double param2){ set_params( (1-param1)*min_param1_+(param1)*max_param1_, (1-param2)*min_param2_+(param2)*max_param2_); } // Sets the bounds on the parameters of the ugen void UnitGenerator::set_limits(double min1, double max1, double min2, double max2){ min_param1_ = min1; min_param2_ = min2; max_param1_ = max1; max_param2_ = max2; } // Uses the specified minimum and maximum bounds to restrict parameter to // valid range double UnitGenerator::clamp(double param_in, int which){ double min_param, max_param; if (which == 1){max_param = max_param1_;min_param = min_param1_;} else{max_param = max_param2_;min_param = min_param2_;} param_in = param_in > max_param ? max_param : param_in; return param_in < min_param ? min_param : param_in; } const char *UnitGenerator::report_param(int which){ std::stringstream s; if (which == 1 & report_param1_ != NULL) { if ((int)*report_param1_ == *report_param1_) sprintf(param1_str_, "%d",(int)(*report_param1_)); else sprintf(param1_str_, "%.3f",*report_param1_); return param1_str_; } else if (report_param2_ != NULL) { if ((int)(*report_param2_) == *report_param2_) sprintf(param2_str_, "%d",(int)(*report_param2_)); else sprintf(param2_str_, "%.3f",*report_param2_); return param2_str_; } return ""; } void UnitGenerator::define_printouts(double *report_param1, const char *p1_units, double *report_param2, const char *p2_units){ report_param1_ = report_param1; report_param2_ = report_param2; param1_units_ = p1_units; param2_units_ = p2_units; } // #------------ Midi Unit Generator Classes --------------# // Adds a single note to the instruent's play list void MidiUnitGenerator::play_note(int MIDI_Pitch, int velocity){ myCW_->play_note(MIDI_Pitch, velocity); } // Searches for a note of the same pitch and stops it. void MidiUnitGenerator::stop_note(int MIDI_Pitch){ myCW_->stop_note(MIDI_Pitch); } // Gets the next sample from the instrument double MidiUnitGenerator::tick(){ return myCW_->tick(); } UGenState *MidiUnitGenerator::save_state(){ MidiInputState *s = new MidiInputState(); s->buffer_length_ = ugen_buffer_size_; s->buffer_ = new double[s->buffer_length_]; for (int i = 0; i < s->buffer_length_; ++i){ s->buffer_[i] = ugen_buffer_[i]; } return s; } void MidiUnitGenerator::recall_state(UGenState *state){ MidiInputState *s = static_cast<MidiInputState *>(state); if (s->buffer_length_ == ugen_buffer_size_){ for (int i = 0; i < s->buffer_length_; ++i){ ugen_buffer_[i] = s->buffer_[i]; } } else printf("Mismatched buffer size (MidiUnitGenerator::Recall_State)\n"); delete state; } MidiInputState::~MidiInputState(){delete[] buffer_;} // #------------Unit Generator Inherited Classes --------------# Input::Input(){ name_ = "Input"; param1_name_ = "Volume"; param2_name_ = "Not Used"; set_limits(0, 10, 0, 1); set_params(1, 0); define_printouts(&param1_, "", NULL, ""); ugen_buffer_size_ = UnitGenerator::buffer_length; ugen_buffer_ = new double[ugen_buffer_size_]; for (int i = 0; i < ugen_buffer_size_; i++){ ugen_buffer_[i] = 0; } current_index_ = 0; current_value_ = 0; } Input::~Input(){} // Pulls the current sample out of the buffer and advances the read index double Input::tick(double in){ double out = ugen_buffer_[current_index_]; current_index_ = (current_index_ + 1) % ugen_buffer_size_; return param1_*out; } // Sets the sample at the current index in the buffer void Input::set_sample(double val){ ugen_buffer_[current_index_] = val; } // Sets the entire buffer void Input::set_buffer(double buffer[], int length){ if (length != ugen_buffer_size_) { printf("Resizing input buffer\n"); ugen_buffer_size_ = length; delete[] ugen_buffer_; ugen_buffer_ = new double[ugen_buffer_size_]; } for (int i = 0; i < length; ++i){ ugen_buffer_[i] = buffer[i]; } // Reset read buffer current_index_ = 0; } UGenState* Input::save_state(){ InputState *s = new InputState(); s->buffer_length_ = ugen_buffer_size_; s->buffer_ = new double[s->buffer_length_]; for (int i = 0; i < s->buffer_length_; ++i){ s->buffer_[i] = ugen_buffer_[i]; } return s; } void Input::recall_state(UGenState *state){ InputState *s = static_cast<InputState *>(state); if (s->buffer_length_ == ugen_buffer_size_){ for (int i = 0; i < s->buffer_length_; ++i){ ugen_buffer_[i] = s->buffer_[i]; } } else printf("Mismatched buffer size (Input::Recall_State)\n"); delete state; } InputState::~InputState(){delete[] buffer_;} /* The sine wave listens to the midi controller param1 = attack (seconds) param2 = sustain (seconds) */ Sine::Sine(double p1, double p2){ name_ = "Sine"; param1_name_ = "Attack"; param2_name_ = "Sustain"; myCW_ = new ClassicWaveform("sine", UnitGenerator::sample_rate); set_limits(0.05, 10, 0.05, 10); define_printouts(&param1_, "s", &param2_, "s"); set_params(p1, p2); ugen_buffer_size_ = UnitGenerator::buffer_length; ugen_buffer_ = new double[ugen_buffer_size_]; for (int i = 0; i < ugen_buffer_size_; i++){ ugen_buffer_[i] = 0; } } Sine::~Sine(){ delete myCW_; } // casts the parameters to ints and restricts them to a certain value void Sine::set_params(double p1, double p2){ param1_ = clamp(p1, 1); param2_ = clamp(p2, 2); myCW_->set_attack(param1_); myCW_->set_sustain(param2_); } /* The square wave listens to the midi controller param1 = attack param2 = sustain */ Square::Square(double p1, double p2){ name_ = "Square"; param1_name_ = "Attack"; param2_name_ = "Sustain"; myCW_ = new ClassicWaveform("square", UnitGenerator::sample_rate); set_limits(0.05, 10, 0.05, 10); set_params(p1, p2); define_printouts(&param1_, "s", &param2_, "s"); ugen_buffer_size_ = UnitGenerator::buffer_length; ugen_buffer_ = new double[ugen_buffer_size_]; for (int i = 0; i < ugen_buffer_size_; i++){ ugen_buffer_[i] = 0; } } Square::~Square(){ delete myCW_; } // Processes a single sample in the unit generator // casts the parameters to ints and restricts them to a certain value void Square::set_params(double p1, double p2){ param1_ = clamp(p1, 1); param2_ = clamp(p2, 2); myCW_->set_attack(param1_); myCW_->set_sustain(param2_); } /* The tri wave listens to the midi controller param1 = attack param2 = sustain */ Tri::Tri(double p1, double p2){ name_ = "Tri"; param1_name_ = "Attack"; param2_name_ = "Sustain"; myCW_ = new ClassicWaveform("tri", UnitGenerator::sample_rate); set_limits(0.05, 10, 0.05, 10); set_params(p1, p2); define_printouts(&param1_, "s", &param2_, "s"); ugen_buffer_size_ = UnitGenerator::buffer_length; ugen_buffer_ = new double[ugen_buffer_size_]; for (int i = 0; i < ugen_buffer_size_; i++){ ugen_buffer_[i] = 0; } } Tri::~Tri(){ delete myCW_; } // casts the parameters to ints and restricts them to a certain value void Tri::set_params(double p1, double p2){ param1_ = clamp(p1, 1); param2_ = clamp(p2, 2); myCW_->set_attack(param1_); myCW_->set_sustain(param2_); } /* The saw wave listens to the midi controller param1 = attack param2 = sustain */ Saw::Saw(double p1, double p2){ name_ = "Saw"; param1_name_ = "Attack"; param2_name_ = "Sustain"; myCW_ = new ClassicWaveform("saw", UnitGenerator::sample_rate); set_limits(0.05, 10, 0.05, 10); set_params(p1, p2); define_printouts(&param1_, "s", &param2_, "s"); ugen_buffer_size_ = UnitGenerator::buffer_length; ugen_buffer_ = new double[ugen_buffer_size_]; for (int i = 0; i < ugen_buffer_size_; i++){ ugen_buffer_[i] = 0; } } Saw::~Saw(){ delete myCW_; } // casts the parameters to ints and restricts them to a certain value void Saw::set_params(double p1, double p2){ param1_ = clamp(p1, 1); param2_ = clamp(p2, 2); myCW_->set_attack(param1_); myCW_->set_sustain(param2_); } /* The bitcrusher effect quantizes and downsamples the input param1 = bits (casted to an int) param2 = downsampling factor */ BitCrusher::BitCrusher(int p1, int p2){ name_ = "BitCrusher"; param1_name_ = "Bits"; param2_name_ = "Downsampling Factor"; set_limits(2, 16, 1, 16); set_params(p1, p2); define_printouts(&param1_, "", &param2_, "x"); sample_ = 0; sample_count_ = 0; ugen_buffer_size_ = UnitGenerator::buffer_length; ugen_buffer_ = new double[ugen_buffer_size_]; for (int i = 0; i < ugen_buffer_size_; i++){ ugen_buffer_[i] = 0; } } BitCrusher::~BitCrusher(){} // Processes a single sample in the unit generator double BitCrusher::tick(double in){ //Downsampling ++sample_count_; if (sample_count_ >= param2_){ sample_count_ = 0; //Quantization sample_ = quantize(in); } return sample_; } // casts the parameters to ints and restricts them to a certain value void BitCrusher::set_params(double p1, double p2){ param1_ = clamp(floor(p1), 1); param2_ = clamp(floor(p2), 2); } //Quantizes the double to the number of bits specified by param1 double BitCrusher::quantize(double in){ if (param1_ == 1) return in; return round(in * pow(2.0, param1_)) / pow(2.0, param1_); } UGenState* BitCrusher::save_state(){ BitCrusherState *s = new BitCrusherState(); s->sample_count_ = sample_count_; s->sample_ = sample_; return s; } void BitCrusher::recall_state(UGenState *state){ BitCrusherState *s = static_cast<BitCrusherState *>(state); sample_count_ = s->sample_count_; sample_ = s->sample_; delete state; } /* The chorus effect delays the signal by a variable amount param1 = rate of the chorus LFO param2 = depth of the chorus effect */ Chorus::Chorus(double p1, double p2){ name_ = "Chorus"; param1_name_ = "Rate"; param2_name_ = "Depth"; sample_rate_ = UnitGenerator::sample_rate; set_limits(0, 1, 0, 1); set_params(p1, p2); define_printouts(&report_hz_, "Hz", &param2_, ""); buffer_size_ = ceil((kMaxDelay + kDelayCenter)*sample_rate_); //Makes an empty buffer buffer_ = new double[buffer_size_]; for (int i = 0; i < buffer_size_; ++i) buffer_[i] = 0; sample_count_ = 0; buf_write_ = 0; ugen_buffer_size_ = UnitGenerator::buffer_length; ugen_buffer_ = new double[ugen_buffer_size_]; for (int i = 0; i < ugen_buffer_size_; i++){ ugen_buffer_[i] = 0; } } Chorus::~Chorus(){ delete[] buffer_; } // Processes a single sample in the unit generator // Jon Dattorro - Part 2: Delay-Line Modulation and Chorus // https://ccrma.stanford.edu/~dattorro/EffectDesignPart2.pdf double Chorus::tick(double in){ double blend = 0.7071;//1.0; double feedback = 0.7071; double feedforward = 1.0; //feedback double buf_fb = buf_write_ - sample_rate_ * kDelayCenter + buffer_size_; buf_fb = fmod(buf_fb, buffer_size_); //feedforward double buf_read = buf_write_ - sample_rate_ * ( kDelayCenter + depth_* sin(rate_hz_ * sample_count_)) + buffer_size_; buf_read = fmod(buf_read,buffer_size_); buffer_[buf_write_] = in - feedback * interpolate(buffer_, buffer_size_, buf_fb); double output = feedforward * interpolate(buffer_, buffer_size_, buf_read) + blend * buffer_[buf_write_]; //Wrap variables to prevent out-of-bounds/overflow ++sample_count_; if (rate_hz_ * sample_count_ > 6.2831853) { sample_count_ = fmod(sample_count_, 6.2831853/rate_hz_); } ++buf_write_; buf_write_ %= buffer_size_; return output; } // restricts parameters to range (0,1) and calculates other parameters, // including the rate in Hz and the max delay change void Chorus::set_params(double p1, double p2){ param1_ = clamp(p1, 1); p1 = (kMaxFreq-kMinFreq) * pow( param1_, 4) + kMinFreq; //sets the rate of the chorusing report_hz_ = p1; rate_hz_ = 6.2831853 / (1.0 * sample_rate_) * p1; param2_ = clamp(p2, 2); depth_ = kMaxDelay * param2_; } UGenState* Chorus::save_state(){ ChorusState *s = new ChorusState(); s->buf_write_ = buf_write_; s->buffer_size_ = buffer_size_; s->sample_count_ = sample_count_; s->buffer_ = new double[s->buffer_size_]; for (int i = 0; i < s->buffer_size_; ++i){ s->buffer_[i] = buffer_[i]; } return s; } void Chorus::recall_state(UGenState *state){ ChorusState *s = static_cast<ChorusState *>(state); if (buffer_size_ == s->buffer_size_){ buf_write_ = s->buf_write_; buffer_size_ = s->buffer_size_; sample_count_ = s->sample_count_; for (int i = 0; i < s->buffer_size_; ++i){ buffer_[i] = s->buffer_[i]; } } else { printf("Mismatched buffer size (Chorus::Recall_State)\n"); } delete state; } /* The delay effect plays the signal back some time later param1 = time in seconds until delay repeats param2 = amount of feedback in delay buffer */ Delay::Delay(double p1, double p2){ name_ = "Delay"; param1_name_ = "Time"; param2_name_ = "Feedback"; sample_rate_ = UnitGenerator::sample_rate; set_limits(0.01, 2, 0, 1); define_printouts(&param1_, "s", &param2_, ""); param1_ = p1; param2_ = p2; max_buffer_size_= ceil(sample_rate_ * max_param1_); buffer_size_ = sample_rate_ * param1_; //Makes an empty buffer buffer_ = new float[max_buffer_size_]; for (int i = 0; i < max_buffer_size_; ++i) buffer_[i] = 0; buf_write_ = 0; ugen_buffer_size_ = UnitGenerator::buffer_length; ugen_buffer_ = new double[ugen_buffer_size_]; for (int i = 0; i < ugen_buffer_size_; i++){ ugen_buffer_[i] = 0; } } Delay::~Delay(){ delete[] buffer_; } // Processes a single sample in the unit generator double Delay::tick(double in){ float buf_read = fmod(buf_write_ - buffer_size_ + max_buffer_size_, max_buffer_size_); float read_sample = interpolate(buffer_, max_buffer_size_, buf_read); buffer_[buf_write_] = in + param2_ * read_sample; double out = in + read_sample; ++buf_write_; buf_write_ %= max_buffer_size_; return out; } void Delay::set_params(double p1, double p2){ param1_ = clamp(p1, 1); //Reallocates delay buffer buffer_size_ = ceil(sample_rate_ * param1_); param2_ = clamp(p2, 2); } UGenState* Delay::save_state(){ DelayState *s = new DelayState(); s->buf_write_ = buf_write_; s->buffer_size_ = buffer_size_; s->buffer_ = new float[s->buffer_size_]; for (int i = 0; i < s->buffer_size_; ++i){ s->buffer_[i] = buffer_[i]; } return s; } void Delay::recall_state(UGenState *state){ DelayState *s = static_cast<DelayState *>(state); if (buffer_size_ == s->buffer_size_){ buf_write_ = s->buf_write_; buffer_size_ = s->buffer_size_; for (int i = 0; i < s->buffer_size_; ++i){ buffer_[i] = s->buffer_[i]; } } else { printf("Mismatched buffer size (Delay::Recall_State)\n"); } delete state; } /* The distortion effect clips the input to a specified level param1 = pre clip gain param2 = clipping level */ Distortion::Distortion(double p1, double p2){ name_ = "Distortion"; param1_name_ = "Pre-gain"; param2_name_ = "Post-gain"; set_limits(1, 100, 0, 5); set_params(p1, p2); define_printouts(&param1_, "", &param2_, ""); ugen_buffer_size_ = UnitGenerator::buffer_length; ugen_buffer_ = new double[ugen_buffer_size_]; for (int i = 0; i < ugen_buffer_size_; i++){ ugen_buffer_[i] = 0; } f_ = new DigitalLowpassFilter(1000,1,1); f_->calculate_coefficients(); inv_ = f_->create_inverse(); } Distortion::~Distortion(){ delete f_; delete inv_; } // Processes a single sample in the unit generator double Distortion::tick(double in){ double gain_adj = f_->dc_gain(); double offset = 0.00;//4; //in = f_->tick(in).re() / gain_adj; in = param1_ * in + offset; double out = 0; // Cubic transfer function if (in > 1) out = 2/3.0; else if (in < -1) out = -2/3.0; else out = in - pow(in, 3)/3.0; out -= offset - pow(offset, 3)/3.0; //out = inv_->tick(out).re() * gain_adj; return param2_ * out; } UGenState* Distortion::save_state(){ DistortionState *s = new DistortionState(); s->f_state_ = f_->get_state(); s->inv_state_ = inv_->get_state(); return s; } void Distortion::recall_state(UGenState *state){ DistortionState *s = static_cast<DistortionState *>(state); f_->set_state(s->f_state_); inv_->set_state(s->inv_state_); delete state; } /* A second order high or low pass filter param1 = cutoff frequency param2 = Q */ Filter::Filter(double p1, double p2){ name_ = "Filter"; param1_name_ = "Cutoff Frequency"; param2_name_ = "Q"; set_limits(100, 10000, 1, 10); define_printouts(&param1_, "Hz", &param2_, ""); param1_ = clamp(p1, 1); param2_ = clamp(p2, 2); f_ = new DigitalLowpassFilter(param1_, param2_, 1); f_->calculate_coefficients(); f2_ = new DigitalLowpassFilter(param1_, param2_, 1); f2_->calculate_coefficients(); currently_lowpass_ = true; ugen_buffer_size_ = UnitGenerator::buffer_length; ugen_buffer_ = new double[ugen_buffer_size_]; for (int i = 0; i < ugen_buffer_size_; i++){ ugen_buffer_[i] = 0; } } Filter::~Filter(){ delete f_; delete f2_; } // Processes a single sample in the unit generator double Filter::tick(double in){ double factor = 1; if (currently_lowpass_) factor = 1/f_->dc_gain(); else factor = 1/f_->hf_gain(); return factor * f2_->tick(factor * f_->tick(in)).re(); } // Tells the filter to change parameters void Filter::set_params(double p1, double p2){ param1_ = clamp(p1, 1); param2_ = clamp(p2, 2); f_->change_parameters(param1_, param2_, 1); f2_->change_parameters(param1_, param2_, 1); } // The filter can be either high or low pass. // True for lowpass, False for highpass void Filter::set_lowpass(bool lowpass){ if (lowpass && !currently_lowpass_){ delete f_; delete f2_; f_ = new DigitalLowpassFilter(param1_, param2_, 1); f2_ = new DigitalLowpassFilter(param1_, param2_, 1); f_->calculate_coefficients(); f2_->calculate_coefficients(); currently_lowpass_ = !currently_lowpass_; } else if (!lowpass && currently_lowpass_){ delete f_; delete f2_; f_ = new DigitalHighpassFilter(param1_, param2_, 1); f2_ = new DigitalHighpassFilter(param1_, param2_, 1); f_->calculate_coefficients(); f2_->calculate_coefficients(); currently_lowpass_ = !currently_lowpass_; } } UGenState* Filter::save_state(){ FilterState *s = new FilterState(); s->f_state_ = f_->get_state(); s->currently_lowpass_ = currently_lowpass_; return s; } void Filter::recall_state(UGenState *state){ FilterState *s = static_cast<FilterState *>(state); f_->set_state(s->f_state_); currently_lowpass_ = s->currently_lowpass_; delete state; } /* A second order bandpass filter param1 = cutoff frequency param2 = Q */ Bandpass::Bandpass(double p1, double p2){ name_ = "Bandpass"; param1_name_ = "Cutoff Frequency"; param2_name_ = "Q"; set_limits(100, 10000, 1, 10); define_printouts(&param1_, "Hz", &param2_, ""); param1_ = p1; param2_ = p2; f_ = new DigitalBandpassFilter(param1_, param2_, 1); f_->calculate_coefficients(); ugen_buffer_size_ = UnitGenerator::buffer_length; ugen_buffer_ = new double[ugen_buffer_size_]; for (int i = 0; i < ugen_buffer_size_; i++){ ugen_buffer_[i] = 0; } } Bandpass::~Bandpass(){} // Processes a single sample in the unit generator double Bandpass::tick(double in){ return f_->tick(in).re(); } void Bandpass::set_params(double p1, double p2){ param1_ = clamp(p1, 1); param2_ = clamp(p2, 2); f_->change_parameters(param1_, param2_, 1); } UGenState* Bandpass::save_state(){ BandpassState *s = new BandpassState(); s->f_state_ = f_->get_state(); return s; } void Bandpass::recall_state(UGenState *state){ BandpassState *s = static_cast<BandpassState *>(state); f_->set_state(s->f_state_); delete state; } /* The delay effect plays the signal back some time later param1 = time in seconds until delay repeats param2 = amount of feedback in delay buffer */ Granular::Granular(double p1, double p2){ name_ = "Granular"; param1_name_ = "Granule Length"; param2_name_ = "Density"; sample_rate_ = UnitGenerator::sample_rate; set_limits(30, 10000, 0.01, 1); define_printouts(&param1_, "samples", &param2_, ""); param1_ = p1; param2_ = p2; buffer_size_= ceil(sample_rate_); //Makes an empty buffer buffer_ = new double[buffer_size_]; for (int i = 0; i < buffer_size_; ++i) buffer_[i] = 0; buf_write_ = 0; ugen_buffer_size_ = UnitGenerator::buffer_length; ugen_buffer_ = new double[ugen_buffer_size_]; for (int i = 0; i < ugen_buffer_size_; i++){ ugen_buffer_[i] = 0; } } Granular::~Granular(){ delete[] buffer_; } // Processes a single sample in the unit generator double Granular::tick(double in){ buffer_[buf_write_] = in; if (rand()%static_cast<int>(1000*(1.01-param2_)) == 0 && granules_.size() < 10){ Granule g; g.win_length = static_cast<int>(param1_); g.start = buf_write_ - (rand() % (buffer_size_ - g.win_length) - g.win_length); g.start = (g.start + buffer_size_)%buffer_size_; g.end = (g.start + g.win_length + buffer_size_) % buffer_size_; g.at = 0; //std::cout << g.start << " " << g.end << " " << buf_write_ << std::endl; granules_.push_back(g); } double sum = 0; double window,window_length; int this_sample; std::vector<Granule>::iterator it = granules_.begin(); while (it != granules_.end()){ this_sample = (it->start + it->at)%buffer_size_; if (it->end == (it->start + it->at)%buffer_size_ ){ it = granules_.erase(it); } else{ window = 0.5 * (1 - cos(6.2831853 * (++(it->at))/it->win_length)); sum += buffer_[this_sample] * window; ++it; } } ++buf_write_; buf_write_ %= buffer_size_; return sum; } void Granular::set_params(double p1, double p2){ param1_ = clamp(round(p1), 1); param2_ = clamp(p2, 2); } UGenState* Granular::save_state(){ GranularState *s = new GranularState(); s->buf_write_ = buf_write_; s->buffer_size_ = buffer_size_; s->granules_ = granules_; s->buffer_ = new double[s->buffer_size_]; for (int i = 0; i < s->buffer_size_; ++i){ s->buffer_[i] = buffer_[i]; } return s; } void Granular::recall_state(UGenState *state){ GranularState *s = static_cast<GranularState *>(state); if (buffer_size_ == s->buffer_size_){ buf_write_ = s->buf_write_; buffer_size_ = s->buffer_size_; granules_ = s->granules_; for (int i = 0; i < s->buffer_size_; ++i){ buffer_[i] = s->buffer_[i]; } } else { printf("Mismatched buffer size (Granular::Recall_State)\n"); } delete state; } /* The looper effect keeps a section of the input in a buffer and loops it back param1 = beats per minute param2 = number of beats */ Looper::Looper(){ name_ = "Looper"; param1_name_ = "BPM"; param2_name_ = "Number of Beats"; //declare float buffer sample_rate_ = UnitGenerator::sample_rate; set_limits(60, 250, 1, 60); define_printouts(&param1_, "BPM", &param2_, "Beats"); param1_ = 120; param2_ = 16; params_set_ = false; buf_write_ = 0; buf_read_ = 0; this_beat_ = 0; beat_count_ = 0; start_counter_ = 4; // Sets initial state of module counting_down_ = false; is_recording_ = false; has_recording_ = false; ugen_buffer_size_ = UnitGenerator::buffer_length; ugen_buffer_ = new double[ugen_buffer_size_]; for (int i = 0; i < ugen_buffer_size_; i++){ ugen_buffer_[i] = 0; } buffer_ = NULL; click_data.first = 0; click_data.second = 0; } Looper::~Looper(){ //destroy float buffer if (params_set_) delete[] buffer_; } // Processes a single sample in the unit generator double Looper::tick(double in){ if (!params_set_) return 0; //Keeps track of beats ++beat_count_; if (beat_count_ > 60 * sample_rate_ / param1_) { pulse(); beat_count_ = 0; if (counting_down_ || is_recording_)return 1; } //Stores the current input if (is_recording_){ buffer_[buf_write_] = in; ++buf_write_; } //Plays back the recording else if (has_recording_){ double fadeout = 1; //Fades near the edges if (buf_read_ < 10){ fadeout = buf_read_/10.0; } if (buffer_size_ - buf_read_ < 10){ fadeout = (buffer_size_ - buf_read_)/10.0; } double out = buffer_[buf_read_] * fadeout; ++buf_read_; buf_read_ %= buffer_size_; return out; } return 0; } void Looper::set_params(double a, double b){ if (is_recording_ || counting_down_ || has_recording_) return; param1_= round(a); param2_ = round(b); } void Looper::pulse(){ //printf("Pulse! %d\n",this_beat_); if (counting_down_){ if (pulsefnc!=NULL) pulsefnc(data, this_beat_); this_beat_ = (this_beat_ - 1); if (this_beat_ < 0){ this_beat_ = 0; start_recording(); } } else { this_beat_ = (this_beat_+1);//count either way //tells it when to stop if ((is_recording_ || has_recording_) && pulsefnc!=NULL){ pulsefnc(data, -100); } if (this_beat_ == round(param2_)){ this_beat_ = 0; if (is_recording_){ stop_recording(); if (pulsefnc!=NULL) pulsefnc(data, -4); } } } } // Starts counting down beats until recording starts void Looper::start_countdown(){ if (!params_set_){ buffer_size_ = ceil(60* sample_rate_ * param2_ / param1_); //Makes empty buffer buffer_ = new float[buffer_size_]; } for (int i = 0; i < buffer_size_; ++i) { buffer_[i] = 0; } params_set_ = true; this_beat_ = start_counter_; beat_count_ = 0; is_recording_ = false; has_recording_ = false; counting_down_ = true; } // Sets the number of count in beats void Looper::set_start_counter(int num){ if (counting_down_) return; start_counter_ = num; } // Gets the number of count in beats int Looper::get_start_counter(){ return start_counter_; } // Cue Loop to start playing void Looper::start_recording(){ this_beat_ = 0; buf_write_ = 0; is_recording_ = true; has_recording_ = false; counting_down_ = false; } // Cue Loop to start playing void Looper::stop_recording(){ //printf("Playing Back! \n"); this_beat_ = 0; buf_read_ = 0; is_recording_ = false; has_recording_ = true; counting_down_ = false; } UGenState* Looper::save_state(){ LooperState *s = new LooperState(); s->buf_write_ = buf_write_; s->buf_read_ = buf_read_; s->buffer_size_ = buffer_size_; s->this_beat_ = this_beat_; s->beat_count_ = beat_count_; s->start_counter_ = start_counter_; if (buffer_ != NULL){ s->buffer_ = new float[s->buffer_size_]; for (int i = 0; i < s->buffer_size_; ++i){ s->buffer_[i] = buffer_[i]; } } else s->buffer_ = NULL; return s; } void Looper::recall_state(UGenState *state){ LooperState *s = static_cast<LooperState *>(state); if (buffer_size_ == s->buffer_size_){ buf_write_ = s->buf_write_; buf_read_ = s->buf_read_; buffer_size_ = s->buffer_size_; this_beat_ = s->this_beat_; beat_count_ = s->beat_count_; start_counter_ = s->start_counter_; if (s->buffer_ != NULL){ for (int i = 0; i < s->buffer_size_; ++i){ buffer_[i] = s->buffer_[i]; } } } else { printf("Mismatched buffer size (Looper::Recall_State)\n"); } delete state; } /* A ring modulator. Multiplies the input by a sinusoid param1 = frequency param2 = Not Used */ RingMod::RingMod(double p1, double p2){ name_ = "RingMod"; param1_name_ = "Frequency"; param2_name_ = "Not Used"; sample_rate_ = UnitGenerator::sample_rate; set_limits(0, 1, 0, 1); set_params(p1, p2); define_printouts(&report_hz_, "Hz", NULL, ""); sample_count_ = 0; ugen_buffer_size_ = UnitGenerator::buffer_length; ugen_buffer_ = new double[ugen_buffer_size_]; for (int i = 0; i < ugen_buffer_size_; i++){ ugen_buffer_[i] = 0; } } RingMod::~RingMod(){} // Processes a single sample in the unit generator double RingMod::tick(double in){ double out = in * sin(rate_hz_ * sample_count_); //Wrap variables to prevent out-of-bounds/overflow ++sample_count_; if (rate_hz_ * sample_count_ > 6.2831853) { sample_count_ = fmod(sample_count_, 6.2831853/rate_hz_); } return out; } void RingMod::set_params(double p1, double p2){ param1_ = clamp(p1, 1); param2_ = clamp(p2, 2); // Non linear scaling p1 = (kMaxFreq - kMinFreq) * pow( param1_, 4) + kMinFreq; report_hz_ = p1; rate_hz_ = 6.2831853 / (1.0 * sample_rate_) * p1; } UGenState* RingMod::save_state(){ RingModState *s = new RingModState(); s->sample_count_ = sample_count_; return s; } void RingMod::recall_state(UGenState *state){ RingModState *s = static_cast<RingModState *>(state); sample_count_ = s->sample_count_; delete state; } /* The reverb effect convolves the signal with an impulse response param1 = room size param2 = damping */ const int Reverb::kCombDelays[] = {1116,1188,1356,1277,1422,1491,1617,1557}; const int Reverb::kAllPassDelays[] = {225, 556, 441, 341}; Reverb::Reverb(double p1, double p2){ name_ = "Reverb"; param1_name_ = "Room Size"; param2_name_ = "Damping"; set_limits(0, 1, 0, 1); define_printouts(&param1_, "", &param2_, ""); param1_ = p1; param2_ = p2; // Comb filtering fb_ = new FilterBank(); for (int i = 0; i < 8; ++i){ FilteredFeedbackCombFilter *k = new FilteredFeedbackCombFilter(kCombDelays[i], param1_, param2_); fb_->add_filter(k); } // Allpass filtering for (int i = 0; i < 4; ++i){ aaf_.push_back(new AllpassApproximationFilter(kAllPassDelays[i], 0.5)); } ugen_buffer_size_ = UnitGenerator::buffer_length; ugen_buffer_ = new double[ugen_buffer_size_]; for (int i = 0; i < ugen_buffer_size_; i++){ ugen_buffer_[i] = 0; } } Reverb::~Reverb(){ std::list<AllpassApproximationFilter *>::iterator it; it = aaf_.begin(); // Deletes all filters while (aaf_.size() > 0 && it != aaf_.end()) { delete (*it); ++it; } delete fb_; } // Processes a single sample in the unit generator double Reverb::tick(double in){ // This should probably use 1/sqrt(8), but it's too loud as it is... complex sample = fb_->tick(.125*in); // Ticks each allpass std::list<AllpassApproximationFilter *>::iterator it; it = aaf_.begin(); while (aaf_.size() > 0 && it != aaf_.end()) { sample = (*it)->tick(sample); ++it; } return sample.re(); } void Reverb::set_params(double p1, double p2){ param1_ = clamp(p1, 1); param2_ = clamp(p2, 2); int i = 0; std::list<DigitalFilter *>::iterator it; it = fb_->filters_.begin(); while (fb_->filters_.size() > 0 && it != fb_->filters_.end()) { FilteredFeedbackCombFilter *apf = static_cast<FilteredFeedbackCombFilter *>(*it); apf->change_parameters(kCombDelays[i++], param1_, param2_); apf->sp_->change_parameters(param2_, 1 - param2_, 1.0); ++it; } } UGenState* Reverb::save_state(){ ReverbState *s = new ReverbState(); std::list<DigitalFilter *>::iterator it = fb_->filters_.begin(); int i = 0; s->comb_state_ = new DigitalFilterState*[8]; while (fb_->filters_.size() > 0 && it != fb_->filters_.end()) { s->comb_state_[i++] = (*it)->get_state(); ++it; } s->ap_state_ = new DigitalFilterState*[4]; std::list<AllpassApproximationFilter *>::iterator it2 = aaf_.begin(); i = 0; while (aaf_.size() > 0 && it2 != aaf_.end()) { s->ap_state_[i++] = (*it2)->get_state(); ++it2; } return s; } void Reverb::recall_state(UGenState *state){ ReverbState *s = static_cast<ReverbState *>(state); std::list<DigitalFilter *>::iterator it = fb_->filters_.begin(); int i = 0; while (fb_->filters_.size() > 0 && it != fb_->filters_.end()) { (*it)->set_state(s->comb_state_[i++]); ++it; } std::list<AllpassApproximationFilter *>::iterator it2 = aaf_.begin(); i = 0; while (aaf_.size() > 0 && it2 != aaf_.end()) { (*it2)->set_state(s->ap_state_[i++]); ++it2; } delete state; } /* The Tremolo effect modulates the amplitude of the signal param1 = rate param2 = depth */ Tremolo::Tremolo(double p1, double p2){ name_ = "Tremolo"; param1_name_ = "Rate"; param2_name_ = "Depth"; sample_rate_ = UnitGenerator::sample_rate; set_limits(0, 1, 0, 1); set_params(p1, p2); define_printouts(&report_hz_, "Hz", &param2_, ""); sample_count_ = 0; ugen_buffer_size_ = UnitGenerator::buffer_length; ugen_buffer_ = new double[ugen_buffer_size_]; for (int i = 0; i < ugen_buffer_size_; i++){ ugen_buffer_[i] = 0; } } Tremolo::~Tremolo(){} double Tremolo::tick(double in){ double out = in * ((1-param2_) + (param2_)*sin(rate_hz_ * sample_count_)); //Wrap variables to prevent out-of-bounds/overflow ++sample_count_; if (rate_hz_ * sample_count_ > 6.2831853) { sample_count_ = fmod(sample_count_, 6.2831853/rate_hz_); } return out; } // restricts parameters to range (0,1) and calculates other params void Tremolo::set_params(double p1, double p2){ param1_ = clamp(p1, 1); param2_ = clamp(p2, 2); // Non linear scaling p1 = (kMaxFreq - kMinFreq) * pow( param1_, 4) + kMinFreq; report_hz_ = p1; //sets the rate of the tremolo rate_hz_ = 6.2831853 / (1.0 * sample_rate_) * p1; } UGenState* Tremolo::save_state(){ TremoloState *s = new TremoloState(); s->sample_count_ = sample_count_; return s; } void Tremolo::recall_state(UGenState *state){ TremoloState *s = static_cast<TremoloState *>(state); sample_count_ = s->sample_count_; delete state; } // #-------Useful functions for sound buffer operations --------# // Gets the interpolated value between two samples of array double interpolate(double *array, int length, double index){ int trunc_index = static_cast<int>(floor(index)); double leftover = index-1.0*trunc_index; double sample_one = array[(trunc_index + length)%length]; double sample_two = array[(trunc_index + length + 1)%length]; double output = sample_one*(1-leftover) + sample_two*leftover; return output; } // Gets the interpolated value between two samples of array float interpolate(float *array, int length, double index){ int trunc_index = floor(index); float leftover = index-trunc_index; float sample_one = array[(trunc_index + length)%length]; float sample_two = array[(trunc_index + length + 1)%length]; return sample_one*(1-leftover) + sample_two*leftover; }
chetgnegy/CollideFx
include/audio/UnitGenerator.cpp
C++
gpl-3.0
37,011
<?php namespace Kharanenka\Helper; /** * Generate universal result answer * * Class ResultStore * @package Kharanenka\Helper * @author Andrey Kharanenka, kharanenka@gmail.com */ class ResultStore { /** @var bool Status of result (true|false) */ private $bStatus = true; /** @var mixed Data of result */ private $obData; /** @var string Error message */ private $sErrorMessage = null; /** @var string Error code */ private $sErrorCode = null; /** @var ResultStore */ private static $obThis = null; private function __construct() { } /** * @return ResultStore */ public static function getInstance() { if (empty(self::$obThis)) { self::$obThis = new ResultStore(); } return self::$obThis; } /** * Set data value and status of result in true * @param mixed $obData * @return ResultStore */ public function setData($obData) { $this->obData = $obData; return $this; } /** * Set data value and status of result in true * @param mixed $obData * @return ResultStore */ public function setTrue($obData = null) { $this->bStatus = true; $this->obData = $obData; return $this; } /** * Set data value and status of result in false * @param mixed $obData * @return ResultStore */ public function setFalse($obData = null) { $this->bStatus = false; $this->obData = $obData; return $this; } /** * Set error message value * @param string $sMessage * @return ResultStore */ public function setMessage($sMessage) { $this->sErrorMessage = $sMessage; return $this; } /** * Set error code value * @param string $sCode * @return ResultStore */ public function setCode($sCode) { $this->sErrorCode = $sCode; return $this; } /** * @return bool */ public function status() { return $this->bStatus; } /** * @return string */ public function message() { return $this->sErrorMessage; } /** * @return string */ public function code() { return $this->sErrorCode; } /** * @return mixed */ public function data() { return $this->obData; } /** * Get result array * @return array */ public function get() { $arResult = [ 'status' => $this->status(), 'data' => $this->data(), 'message' => $this->message(), 'code' => $this->code(), ]; return $arResult; } /** * Generate result JSON string * @return string */ public function getJSON() { return json_encode($this->get()); } }
kharanenka/result
src/Kharanenka/Helper/ResultStore.php
PHP
gpl-3.0
2,943
# PuppetModuleTask TODO: Delete this and describe your gem ## Installation Add this line to your application's Gemfile: ```ruby gem 'puppet_rake_tasks' ``` And then execute: $ bundle Or install it yourself as: $ gem install puppet_rake_tasks ## Usage ### Simple usage: 1. Add the ruby gem: `gem 'puppet_rake_tasks'` 2. Require the depchecker in your `Rakefile`: `require 'puppet_rake_tasks/depchecker'` 3. Create the task: `PuppetRakeTasks::DepChecker::Task.new` 4. Profit: `rake exec depcheck ### Advanced usage: Optionally, you can also configure the task: ```ruby require 'puppet_rake_tasks/depchecker' PuppetRakeTasks::DepChecker::Task.new do |checker| checker.fail_on_error = true checker.modulepath = [ 'site', 'modules' ] checker.ignore /.*/, { name: 'foo/bar', reason: :missing } end ``` ## Development After checking out the repo, run `bundler install` to install dependencies. Then, run `bundle exec rake spec` to run the tests. You can also run `bundle console` for an interactive prompt that will allow you to experiment. ## Contributing Bug reports and pull requests are welcome on [GitHub](https://github.com/vStone/puppet_rake_tasks). ## License The gem is available as open source under the terms of the [GPL-3 License](http://opensource.org/licenses/GPL-3.0).
vStone/puppet_rake_tasks
README.md
Markdown
gpl-3.0
1,322
/** * This file is part of Graylog. * * Graylog is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Graylog is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Graylog. If not, see <http://www.gnu.org/licenses/>. */ package org.graylog2.bootstrap; import com.google.common.collect.ImmutableMap; import com.google.common.util.concurrent.ServiceManager; import com.google.inject.Injector; import com.google.inject.Module; import com.google.inject.ProvisionException; import io.airlift.airline.Option; import org.graylog2.audit.AuditActor; import org.graylog2.audit.AuditEventSender; import org.graylog2.plugin.BaseConfiguration; import org.graylog2.plugin.ServerStatus; import org.graylog2.plugin.Tools; import org.graylog2.plugin.inputs.MessageInput; import org.graylog2.plugin.system.NodeId; import org.graylog2.shared.bindings.GenericBindings; import org.graylog2.shared.bindings.GenericInitializerBindings; import org.graylog2.shared.bindings.MessageInputBindings; import org.graylog2.shared.bindings.SchedulerBindings; import org.graylog2.shared.bindings.ServerStatusBindings; import org.graylog2.shared.bindings.SharedPeriodicalBindings; import org.graylog2.shared.bindings.ValidatorModule; import org.graylog2.shared.initializers.ServiceManagerListener; import org.graylog2.shared.security.SecurityBindings; import org.graylog2.shared.system.activities.Activity; import org.graylog2.shared.system.activities.ActivityWriter; import org.graylog2.shared.system.stats.SystemStatsModule; import org.jsoftbiz.utils.OS; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.LinkOption; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardOpenOption; import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import static org.graylog2.audit.AuditEventTypes.NODE_STARTUP_COMPLETE; import static org.graylog2.audit.AuditEventTypes.NODE_STARTUP_INITIATE; public abstract class ServerBootstrap extends CmdLineTool { private static final Logger LOG = LoggerFactory.getLogger(ServerBootstrap.class); public ServerBootstrap(String commandName, BaseConfiguration configuration) { super(commandName, configuration); this.commandName = commandName; } @Option(name = {"-p", "--pidfile"}, description = "File containing the PID of Graylog") private String pidFile = TMPDIR + FILE_SEPARATOR + "graylog.pid"; @Option(name = {"-np", "--no-pid-file"}, description = "Do not write a PID file (overrides -p/--pidfile)") private boolean noPidFile = false; protected abstract void startNodeRegistration(Injector injector); public String getPidFile() { return pidFile; } public boolean isNoPidFile() { return noPidFile; } @Override protected void beforeStart() { super.beforeStart(); // Do not use a PID file if the user requested not to if (!isNoPidFile()) { savePidFile(getPidFile()); } } @Override protected void startCommand() { final AuditEventSender auditEventSender = injector.getInstance(AuditEventSender.class); final NodeId nodeId = injector.getInstance(NodeId.class); final Map<String, Object> auditEventContext = ImmutableMap.of( "version", version.toString(), "java", Tools.getSystemInformation(), "node_id", nodeId.toString() ); auditEventSender.success(AuditActor.system(nodeId), NODE_STARTUP_INITIATE, auditEventContext); final OS os = OS.getOs(); LOG.info("Graylog {} {} starting up", commandName, version); LOG.info("JRE: {}", Tools.getSystemInformation()); LOG.info("Deployment: {}", configuration.getInstallationSource()); LOG.info("OS: {}", os.getPlatformName()); LOG.info("Arch: {}", os.getArch()); final ServerStatus serverStatus = injector.getInstance(ServerStatus.class); serverStatus.initialize(); startNodeRegistration(injector); final ActivityWriter activityWriter; final ServiceManager serviceManager; try { activityWriter = injector.getInstance(ActivityWriter.class); serviceManager = injector.getInstance(ServiceManager.class); } catch (ProvisionException e) { LOG.error("Guice error", e); annotateProvisionException(e); auditEventSender.failure(AuditActor.system(nodeId), NODE_STARTUP_INITIATE, auditEventContext); System.exit(-1); return; } catch (Exception e) { LOG.error("Unexpected exception", e); auditEventSender.failure(AuditActor.system(nodeId), NODE_STARTUP_INITIATE, auditEventContext); System.exit(-1); return; } Runtime.getRuntime().addShutdownHook(new Thread(injector.getInstance(shutdownHook()))); // propagate default size to input plugins MessageInput.setDefaultRecvBufferSize(configuration.getUdpRecvBufferSizes()); // Start services. final ServiceManagerListener serviceManagerListener = injector.getInstance(ServiceManagerListener.class); serviceManager.addListener(serviceManagerListener); try { serviceManager.startAsync().awaitHealthy(); } catch (Exception e) { try { serviceManager.stopAsync().awaitStopped(configuration.getShutdownTimeout(), TimeUnit.MILLISECONDS); } catch (TimeoutException timeoutException) { LOG.error("Unable to shutdown properly on time. {}", serviceManager.servicesByState()); } LOG.error("Graylog startup failed. Exiting. Exception was:", e); auditEventSender.failure(AuditActor.system(nodeId), NODE_STARTUP_INITIATE, auditEventContext); System.exit(-1); } LOG.info("Services started, startup times in ms: {}", serviceManager.startupTimes()); activityWriter.write(new Activity("Started up.", Main.class)); LOG.info("Graylog " + commandName + " up and running."); auditEventSender.success(AuditActor.system(nodeId), NODE_STARTUP_COMPLETE, auditEventContext); // Block forever. try { Thread.currentThread().join(); } catch (InterruptedException e) { return; } } protected void savePidFile(final String pidFile) { final String pid = Tools.getPID(); final Path pidFilePath = Paths.get(pidFile); pidFilePath.toFile().deleteOnExit(); try { if (pid == null || pid.isEmpty() || pid.equals("unknown")) { throw new Exception("Could not determine PID."); } Files.write(pidFilePath, pid.getBytes(StandardCharsets.UTF_8), StandardOpenOption.WRITE, StandardOpenOption.CREATE_NEW, LinkOption.NOFOLLOW_LINKS); } catch (Exception e) { LOG.error("Could not write PID file: " + e.getMessage(), e); System.exit(1); } } @Override protected List<Module> getSharedBindingsModules() { final List<Module> result = super.getSharedBindingsModules(); result.add(new GenericBindings()); result.add(new SecurityBindings()); result.add(new ServerStatusBindings(capabilities())); result.add(new ValidatorModule()); result.add(new SharedPeriodicalBindings()); result.add(new SchedulerBindings()); result.add(new GenericInitializerBindings()); result.add(new MessageInputBindings()); result.add(new SystemStatsModule(configuration.isDisableSigar())); return result; } protected void annotateProvisionException(ProvisionException e) { annotateInjectorExceptions(e.getErrorMessages()); throw e; } protected abstract Class<? extends Runnable> shutdownHook(); }
pdepaepe/graylog2-server
graylog2-server/src/main/java/org/graylog2/bootstrap/ServerBootstrap.java
Java
gpl-3.0
8,480
// Author: // Noah Ablaseau <nablaseau@hotmail.com> // // Copyright (c) 2017 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. using System; using OpenTK; using OpenTK.Graphics.OpenGL; using Color = System.Drawing.Color; using linerider.Rendering; using linerider.Game; namespace linerider.Tools { public class PencilTool : Tool { public override bool RequestsMousePrecision { get { return DrawingScenery; } } public override bool ShowSwatch { get { return true; } } public override bool NeedsRender { get { return DrawingScenery || Active; } } public bool Snapped = false; private bool _drawn; private Vector2d _start; private Vector2d _end; private float MINIMUM_LINE { get { return 6f / game.Track.Zoom; } } private bool _addflip = false; private Vector2d _mouseshadow; public bool DrawingScenery { get { return Swatch.Selected == LineType.Scenery; } } public override MouseCursor Cursor { get { return game.Cursors["pencil"]; } } public PencilTool() : base() { } public override void OnMouseDown(Vector2d pos) { Stop(); Active = true; if (EnableSnap) { var gamepos = ScreenToGameCoords(pos); using (var trk = game.Track.CreateTrackReader()) { var snap = TrySnapPoint(trk, gamepos, out bool snapped); if (snapped) { _start = snap; Snapped = true; } else { _start = gamepos; Snapped = false; } } } else { _start = ScreenToGameCoords(pos); Snapped = false; } _addflip = UI.InputUtils.Check(UI.Hotkey.LineToolFlipLine); _end = _start; game.Invalidate(); game.Track.UndoManager.BeginAction(); base.OnMouseDown(pos); } public override void OnChangingTool() { Stop(); _mouseshadow = Vector2d.Zero; } private void AddLine() { _drawn = true; using (var trk = game.Track.CreateTrackWriter()) { var added = CreateLine(trk, _start, _end, _addflip, Snapped, false); if (added is StandardLine) { game.Track.NotifyTrackChanged(); } } game.Invalidate(); } public override void OnMouseMoved(Vector2d pos) { if (Active) { _end = ScreenToGameCoords(pos); var diff = _end - _start; var len = diff.Length; if ((DrawingScenery && len >= MINIMUM_LINE) || (len >= MINIMUM_LINE * 2)) { AddLine(); _start = _end; Snapped = true;//we are now connected to the newest line } game.Invalidate(); } _mouseshadow = ScreenToGameCoords(pos); base.OnMouseMoved(pos); } public override void OnMouseUp(Vector2d pos) { game.Invalidate(); if (Active) { if (DrawingScenery && ScreenToGameCoords(pos) == _start) { AddLine(); _mouseshadow = ScreenToGameCoords(pos); } else { OnMouseMoved(pos); } Stop(); } base.OnMouseUp(pos); } public override void Render() { base.Render(); if (DrawingScenery && _mouseshadow != Vector2d.Zero && !game.Track.Playing) { GameRenderer.RenderRoundedLine(_mouseshadow, _mouseshadow, Color.FromArgb(100, 0x00, 0xCC, 0x00), 2f * Swatch.GreenMultiplier, false, false); } } public override void Cancel() { Stop(); } public override void Stop() { if (Active) { Active = false; if (_drawn) { game.Track.UndoManager.EndAction(); } else { game.Track.UndoManager.CancelAction(); } _drawn = false; } _mouseshadow = Vector2d.Zero; } } }
jealouscloud/linerider-advanced
src/Tools/PencilTool.cs
C#
gpl-3.0
5,945
/******************************************************************************* * Author: Nguyen Truong Duy ********************************************************************************/ /* Methodology: * + The comb can be divided into layers * + The first layer contains 1 only * The second layer contains 2 - 7. (6 numbers) * The third layer contains 8 - 19. (12 numbers) and so on. * * + Layer k (except the first layer k = 0) contains 6 * k numbers * The starting number of layer k (k >= 1) is 6 * (k - 1) * + Consider a layer [m ... m + 6k - 1] (k >= 1) * Then m has Maja coordinate (k - 1, 1) * + There are 4 important points: m + k - 1, m + 3k + 1, m + 4k - 1, m + 6k - 1 * + m + k - 1 has coordinate (0, k) * m + 4k - 1 has coordinate (0, -k) * m + 6k - 1 has coordinate (k, 0) * m + 3k - 1 has coordinate (-k, 0) * * + From m to m + 3k - 1, * - x decreases from k - 1 to -k (1 unit at a time) * x remains at -k once it reaches -k. * + From m + 3k - 1 to m + 6k - 1 * - x increases from -k to k (1 unit at a time) * x remains at k once it reaches k. * + From m + 6k - 1 down to m + 4k - 1, * - y decreases from 0 to -k (1 unit at a time) * y remains at -k once it reaches -k. * + From m + 4k - 1 down to m + k - 1, * - y increases -k to k (1 unit at a time) * y remains at k once it reaches k. * + From m + k - 1 down to m, * - y decreases from k to 1 (1 unit at a time) * * + So we can have a solution with O(n) pre-processing and O(1) per query */ #include <stdio.h> typedef struct { int x, y; } MajaCoord; const int MAX_NUM_VAL = 100000; void preComputeMapWiliToMajaCoord(MajaCoord mapWilliToMaja[]); int main(void) { MajaCoord mapWilliToMaja[MAX_NUM_VAL + 1]; preComputeMapWiliToMajaCoord(mapWilliToMaja); int willi; while(scanf("%d", &willi) > 0) { printf("%d %d\n", mapWilliToMaja[willi].x, mapWilliToMaja[willi].y); } return 0; } void preComputeMapWiliToMajaCoord(MajaCoord mapWilliToMaja[]) { mapWilliToMaja[1].x = 0; mapWilliToMaja[1].y = 0; int start = 2, layer = 1, numProcess, i, x, y, end; while(start <= MAX_NUM_VAL) { /* Process each layer */ /* Pass 1 */ end = start + 3 * layer - 1; x = layer; for(i = start; i <= end; i++) { if(x > -layer) x--; if(i <= MAX_NUM_VAL) mapWilliToMaja[i].x = x; } /* Pass 2 */ end = start + 6 * layer - 1; x = -layer - 1; for(i = start + 3 * layer - 1; i <= end; i++) { if(x < layer) x++; if(i <= MAX_NUM_VAL) mapWilliToMaja[i].x = x; } /* Pass 3 */ end = start + 4 * layer - 1; y = 1; for(i = start + 6 * layer - 1; i >= end; i--) { if(y > -layer) y--; if(i <= MAX_NUM_VAL) mapWilliToMaja[i].y = y; } /* Pass 4 */ end = start + layer - 1; y = -layer - 1; for(i = start + 4 * layer - 1; i >= end; i--) { if(y < layer) y++; if(i <= MAX_NUM_VAL) mapWilliToMaja[i].y = y; } /* Pass 5 */ end = start; y = layer + 1; for(i = start + layer - 1; i >= end; i--) { if(y > 1) y--; if(i <= MAX_NUM_VAL) mapWilliToMaja[i].y = y; } /* Go to the next layer */ start += 6 * layer; layer++; } }
shakil113/Uva-onlineJudge-solve
UVA10182.c
C
gpl-3.0
3,178
<?php // src/metadatamanipulators/AddContentdmData.php namespace mik\metadatamanipulators; use GuzzleHttp\Client; use \Monolog\Logger; /** * AddCdmItemInfo - Adds several types of data about objects being * migrated from CONTENTdm, specifically the output of the following * CONTENTdm web API requests for the current object: dmGetItemInfo * (JSON format), dmGetCompoundObjectInfo (if applicable) (XML format), * and GetParent (if applicable) (XML format). * * Note that this manipulator doesn't add the <extension> fragment, it * only populates it with data from CONTENTdm. The mappings file * must contain a row that adds the following element to your MODS: * '<extension><CONTENTdmData></CONTENTdmData></extension>', e.g., * null5,<extension><CONTENTdmData></CONTENTdmData></extension>. * * This metadata manipulator takes no configuration parameters. */ class AddContentdmData extends MetadataManipulator { /** * @var string $record_key - the unique identifier for the metadata * record being manipulated. */ private $record_key; /** * Create a new metadata manipulator Instance. */ public function __construct($settings = null, $paramsArray, $record_key) { parent::__construct($settings, $paramsArray, $record_key); $this->record_key = $record_key; $this->alias = $this->settings['METADATA_PARSER']['alias']; // Default Mac PHP setups may use Apple's Secure Transport // rather than OpenSSL, causing issues with CA verification. // Allow configuration override of CA verification at users own risk. if (isset($this->settings['SYSTEM']['verify_ca']) ){ if($this->settings['SYSTEM']['verify_ca'] == false){ $this->verifyCA = false; } } else { $this->verifyCA = true; } // Set up logger. $this->pathToLog = $this->settings['LOGGING']['path_to_manipulator_log']; $this->log = new \Monolog\Logger('config'); $this->logStreamHandler = new \Monolog\Handler\StreamHandler($this->pathToLog, Logger::INFO); $this->log->pushHandler($this->logStreamHandler); } /** * General manipulate wrapper method. * * @param string $input The XML fragment to be manipulated. We are only * interested in the <extension><CONTENTdmData> fragment added in the * MIK mappings file. * * @return string * One of the manipulated XML fragment, the original input XML if the * input is not the fragment we are interested in, or an empty string, * which as the effect of removing the empty <extension><CONTENTdmData> * fragement from our MODS (if there was an error, for example, we don't * want empty extension elements in our MODS documents). */ public function manipulate($input) { $dom = new \DomDocument(); $dom->loadxml($input, LIBXML_NSCLEAN); // Test to see if the current fragment is <extension><CONTENTdmData>. $xpath = new \DOMXPath($dom); $cdmdatas = $xpath->query("//extension/CONTENTdmData"); // There should only be one <CONTENTdmData> fragment in the incoming // XML. If there is 0 or more than 1, return the original. if ($cdmdatas->length === 1) { $contentdmdata = $cdmdatas->item(0); $alias = $dom->createElement('alias', $this->alias); $contentdmdata->appendChild($alias); $pointer = $dom->createElement('pointer', $this->record_key); $contentdmdata->appendChild($pointer); $timestamp = date("Y-m-d H:i:s"); // Add the <dmGetItemInfo> element. $dmGetItemInfo = $dom->createElement('dmGetItemInfo'); $now = $dom->createAttribute('timestamp'); $now->value = $timestamp; $dmGetItemInfo->appendChild($now); $mimetype = $dom->createAttribute('mimetype'); $mimetype->value = 'application/json'; $dmGetItemInfo->appendChild($mimetype); $source_url = $this->settings['METADATA_PARSER']['ws_url'] . 'dmGetItemInfo/' . $this->alias . '/' . $this->record_key . '/json'; $source = $dom->createAttribute('source'); $source->value = $source_url; $dmGetItemInfo->appendChild($source); $item_info = $this->getCdmData($this->alias, $this->record_key, 'dmGetItemInfo', 'json'); // CONTENTdm returns a 200 OK with its error messages, so we can't rely // on catching all 'errors' with the above try/catch block. Instead, we // check to see if the string 'dmcreated' (one of the metadata fields // returned for every object) is in the response body. If it's not, // assume CONTENTdm has returned an error of some sort, log it, and // return. if (!preg_match('/dmcreated/', $item_info)) { $this->log->addInfo("AddContentdmData", array('CONTENTdm internal error' => $item_info)); return ''; } // If the CONTENTdm metadata contains the CDATA end delimiter, log and return. if (preg_match('/\]\]>/', $item_info)) { $message = "CONTENTdm metadata for object " . $this->settings['METADATA_PARSER']['alias'] . '/' . $this->record_key . ' contains the CDATA end delimiter ]]>'; $this->log->addInfo("AddContentdmData", array('CONTENTdm metadata warning' => $message)); return ''; } // If we've made it this far, add the output of dmGetItemInfo to <CONTENTdmData> as // CDATA and return the modified XML fragment. if (strlen($item_info)) { $cdata = $dom->createCDATASection($item_info); $dmGetItemInfo->appendChild($cdata); $contentdmdata->appendChild($dmGetItemInfo); } // Add the <dmCompoundObjectInfo> element. $dmGetCompoundObjectInfo = $dom->createElement('dmGetCompoundObjectInfo'); $now = $dom->createAttribute('timestamp'); $now->value = $timestamp; $dmGetCompoundObjectInfo->appendChild($now); $mimetype = $dom->createAttribute('mimetype'); $mimetype->value = 'text/xml'; $dmGetCompoundObjectInfo->appendChild($mimetype); $source = $dom->createAttribute('source'); $source_url = $this->settings['METADATA_PARSER']['ws_url'] . 'dmGetCompoundObjectInfo/' . $this->alias . '/' . $this->record_key . '/xml'; $source->value = $source_url; $dmGetCompoundObjectInfo->appendChild($source); $compound_object_info = $this->getCdmData($this->alias, $this->record_key, 'dmGetCompoundObjectInfo', 'xml'); // Only add the <dmGetCompoundObjectInfo> element if the object is compound. if (strlen($compound_object_info) && preg_match('/<cpd>/', $compound_object_info)) { $cdata = $dom->createCDATASection($compound_object_info); $dmGetCompoundObjectInfo->appendChild($cdata); $contentdmdata->appendChild($dmGetCompoundObjectInfo); } // Add the <GetParent> element. $GetParent = $dom->createElement('GetParent'); $now = $dom->createAttribute('timestamp'); $now->value = $timestamp; $GetParent->appendChild($now); $mimetype = $dom->createAttribute('mimetype'); $mimetype->value = 'text/xml'; $GetParent->appendChild($mimetype); $source = $dom->createAttribute('source'); $source_url = $this->settings['METADATA_PARSER']['ws_url'] . 'GetParent/' . $this->alias . '/' . $this->record_key . '/xml'; $source->value = $source_url; $GetParent->appendChild($source); $parent_info = $this->getCdmData($this->alias, $this->record_key, 'GetParent', 'xml'); // Only add the <GetParent> element if the object has a parent // pointer of not -1. if (strlen($parent_info) && !preg_match('/\-1/', $parent_info)) { $cdata = $dom->createCDATASection($parent_info); $GetParent->appendChild($cdata); $contentdmdata->appendChild($GetParent); } return $dom->saveXML($dom->documentElement); } else { // If current fragment is not <extension><CONTENTdmData>, return it // unmodified. return $input; } } /** * Fetch the output of the CONTENTdm web API for the current object. * * @param string $alias * The CONTENTdm alias for the current object. * @param string $pointer * The CONTENTdm pointer for the current object. * @param string $cdm_api_function * The name of the CONTENTdm API function. * @param string $format * Either 'json' or 'xml'. * * @return stting * The output of the CONTENTdm API request, in the format specified. */ private function getCdmData($alias, $pointer, $cdm_api_function, $format) { // Use Guzzle to fetch the output of the call to dmGetItemInfo // for the current object. $url = $this->settings['METADATA_PARSER']['ws_url'] . $cdm_api_function . '/' . $this->alias . '/' . $pointer . '/' . $format; $client = new Client(); try { $response = $client->get($url, [$this->verifyCA]); } catch (Exception $e) { $this->log->addInfo("AddContentdmData", array('HTTP request error' => $e->getMessage())); return ''; } $output = $response->getBody(); return $output; } }
lsulibraries/mik
src/metadatamanipulators/AddContentdmData.php
PHP
gpl-3.0
9,913
#ifndef INCOMINGDATAPARSER_H #define INCOMINGDATAPARSER_H #include "core/player.h" #include "core/application.h" #include "remotecontrolmessages.pb.h" #include "remoteclient.h" class IncomingDataParser : public QObject { Q_OBJECT public: IncomingDataParser(Application* app); ~IncomingDataParser(); bool close_connection(); public slots: void Parse(const pb::remote::Message& msg); signals: void SendClementineInfo(); void SendFirstData(bool send_playlist_songs); void SendAllPlaylists(); void SendAllActivePlaylists(); void SendPlaylistSongs(int id); void Open(int id); void Close(int id); void GetLyrics(); void Love(); void Ban(); void Play(); void PlayPause(); void Pause(); void Stop(); void StopAfterCurrent(); void Next(); void Previous(); void SetVolume(int volume); void PlayAt(int i, Engine::TrackChangeFlags change, bool reshuffle); void SetActivePlaylist(int id); void ShuffleCurrent(); void SetRepeatMode(PlaylistSequence::RepeatMode mode); void SetShuffleMode(PlaylistSequence::ShuffleMode mode); void InsertUrls(int id, const QList<QUrl>& urls, int pos, bool play_now, bool enqueue); void RemoveSongs(int id, const QList<int>& indices); void SeekTo(int seconds); void SendSongs(const pb::remote::RequestDownloadSongs& request, RemoteClient* client); void ResponseSongOffer(RemoteClient* client, bool accepted); void SendLibrary(RemoteClient* client); void RateCurrentSong(double); private: Application* app_; bool close_connection_; void GetPlaylistSongs(const pb::remote::Message& msg); void ChangeSong(const pb::remote::Message& msg); void SetRepeatMode(const pb::remote::Repeat& repeat); void SetShuffleMode(const pb::remote::Shuffle& shuffle); void InsertUrls(const pb::remote::Message& msg); void RemoveSongs(const pb::remote::Message& msg); void ClientConnect(const pb::remote::Message& msg); void SendPlaylists(const pb::remote::Message& msg); void OpenPlaylist(const pb::remote::Message& msg); void ClosePlaylist(const pb::remote::Message& msg); void RateSong(const pb::remote::Message& msg); }; #endif // INCOMINGDATAPARSER_H
Shedward/Clementine-copy
src/networkremote/incomingdataparser.h
C
gpl-3.0
2,194
package com.fr.design.gui.itooltip; import javax.swing.JToolTip; public class MultiLineToolTip extends JToolTip { public MultiLineToolTip() { setUI(new MultiLineToolTipUI()); } }
fanruan/finereport-design
designer_base/src/com/fr/design/gui/itooltip/MultiLineToolTip.java
Java
gpl-3.0
197
<?php spl_autoload_extensions(".php"); // comma-separated list spl_autoload_register(); /** * A map of classname => filename for SPL autoloading. * * @package AuthorizeNet */ $baseDir = __DIR__ ; $libDir = $baseDir . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR; $sharedDir = $libDir . 'shared' . DIRECTORY_SEPARATOR; $vendorDir = APPPATH.'common/vendor'; return array( 'Doctrine\Common\Annotations\Annotation' => $vendorDir . '/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation.php', 'Doctrine\Common\Annotations\AnnotationException' => $vendorDir . '/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php', 'Doctrine\Common\Annotations\AnnotationReader' => $vendorDir . '/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php', 'Doctrine\Common\Annotations\AnnotationRegistry' => $vendorDir . '/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php', 'Doctrine\Common\Annotations\Annotation\Attribute' => $vendorDir . '/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attribute.php', 'Doctrine\Common\Annotations\Annotation\Attributes' => $vendorDir . '/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attributes.php', 'Doctrine\Common\Annotations\Annotation\Enum' => $vendorDir . '/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Enum.php', 'Doctrine\Common\Annotations\Annotation\IgnoreAnnotation' => $vendorDir . '/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php', 'Doctrine\Common\Annotations\Annotation\Required' => $vendorDir . '/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Required.php', 'Doctrine\Common\Annotations\Annotation\Target' => $vendorDir . '/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Target.php', 'Doctrine\Common\Annotations\CachedReader' => $vendorDir . '/doctrine/annotations/lib/Doctrine/Common/Annotations/CachedReader.php', 'Doctrine\Common\Annotations\DocLexer' => $vendorDir . '/doctrine/annotations/lib/Doctrine/Common/Annotations/DocLexer.php', 'Doctrine\Common\Annotations\DocParser' => $vendorDir . '/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php', 'Doctrine\Common\Annotations\FileCacheReader' => $vendorDir . '/doctrine/annotations/lib/Doctrine/Common/Annotations/FileCacheReader.php', 'Doctrine\Common\Annotations\IndexedReader' => $vendorDir . '/doctrine/annotations/lib/Doctrine/Common/Annotations/IndexedReader.php', 'Doctrine\Common\Annotations\PhpParser' => $vendorDir . '/doctrine/annotations/lib/Doctrine/Common/Annotations/PhpParser.php', 'Doctrine\Common\Annotations\Reader' => $vendorDir . '/doctrine/annotations/lib/Doctrine/Common/Annotations/Reader.php', 'Doctrine\Common\Annotations\SimpleAnnotationReader' => $vendorDir . '/doctrine/annotations/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php', 'Doctrine\Common\Annotations\TokenParser' => $vendorDir . '/doctrine/annotations/lib/Doctrine/Common/Annotations/TokenParser.php', 'Doctrine\Common\Lexer\AbstractLexer' => $vendorDir . '/doctrine/lexer/lib/Doctrine/Common/Lexer/AbstractLexer.php', 'Doctrine\Instantiator\Instantiator' => $vendorDir . '/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php', 'Doctrine\Instantiator\InstantiatorInterface' => $vendorDir . '/doctrine/instantiator/src/Doctrine/Instantiator/InstantiatorInterface.php', 'GoetasWebservices\Xsd\XsdToPhpRuntime\Jms\Handler\BaseTypesHandler' => $vendorDir . '/goetas-webservices/xsd2php-runtime/src/Jms/Handler/BaseTypesHandler.php', 'GoetasWebservices\Xsd\XsdToPhpRuntime\Jms\Handler\XmlSchemaDateHandler' => $vendorDir . '/goetas-webservices/xsd2php-runtime/src/Jms/Handler/XmlSchemaDateHandler.php', 'JMS\Parser\AbstractLexer' => $vendorDir . '/jms/parser-lib/src/JMS/Parser/AbstractLexer.php', 'JMS\Parser\AbstractParser' => $vendorDir . '/jms/parser-lib/src/JMS/Parser/AbstractParser.php', 'JMS\Parser\SimpleLexer' => $vendorDir . '/jms/parser-lib/src/JMS/Parser/SimpleLexer.php', 'JMS\Parser\SyntaxErrorException' => $vendorDir . '/jms/parser-lib/src/JMS/Parser/SyntaxErrorException.php', 'JMS\Serializer\AbstractVisitor' => $vendorDir . '/jms/serializer/AbstractVisitor.php', 'JMS\Serializer\ArrayTransformerInterface' => $vendorDir . '/jms/serializer/ArrayTransformerInterface.php', 'JMS\Serializer\Context' => $vendorDir . '/jms/serializer/Context.php', 'JMS\Serializer\ContextFactory\CallableContextFactory' => $vendorDir . '/jms/serializer/ContextFactory/CallableContextFactory.php', 'JMS\Serializer\ContextFactory\CallableDeserializationContextFactory' => $vendorDir . '/jms/serializer/ContextFactory/CallableDeserializationContextFactory.php', 'JMS\Serializer\ContextFactory\CallableSerializationContextFactory' => $vendorDir . '/jms/serializer/ContextFactory/CallableSerializationContextFactory.php', 'JMS\Serializer\ContextFactory\DefaultDeserializationContextFactory' => $vendorDir . '/jms/serializer/ContextFactory/DefaultDeserializationContextFactory.php', 'JMS\Serializer\ContextFactory\DefaultSerializationContextFactory' => $vendorDir . '/jms/serializer/ContextFactory/DefaultSerializationContextFactory.php', 'JMS\Serializer\ContextFactory\DeserializationContextFactoryInterface' => $vendorDir . '/jms/serializer/ContextFactory/DeserializationContextFactoryInterface.php', 'JMS\Serializer\ContextFactory\SerializationContextFactoryInterface' => $vendorDir . '/jms/serializer/ContextFactory/SerializationContextFactoryInterface.php', 'JMS\Serializer\DeserializationContext' => $vendorDir . '/jms/serializer/DeserializationContext.php', 'JMS\Serializer\GenericDeserializationVisitor' => $vendorDir . '/jms/serializer/GenericDeserializationVisitor.php', 'JMS\Serializer\GenericSerializationVisitor' => $vendorDir . '/jms/serializer/GenericSerializationVisitor.php', 'JMS\Serializer\GraphNavigator' => $vendorDir . '/jms/serializer/GraphNavigator.php', 'JMS\Serializer\JsonDeserializationVisitor' => $vendorDir . '/jms/serializer/JsonDeserializationVisitor.php', 'JMS\Serializer\JsonSerializationVisitor' => $vendorDir . '/jms/serializer/JsonSerializationVisitor.php', 'JMS\Serializer\SerializationContext' => $vendorDir . '/jms/serializer/SerializationContext.php', 'JMS\Serializer\Serializer' => $vendorDir . '/jms/serializer/Serializer.php', 'JMS\Serializer\SerializerBuilder' => $vendorDir . '/jms/serializer/SerializerBuilder.php', 'JMS\Serializer\SerializerInterface' => $vendorDir . '/jms/serializer/SerializerInterface.php', 'JMS\Serializer\TypeParser' => $vendorDir . '/jms/serializer/TypeParser.php', 'JMS\Serializer\VisitorInterface' => $vendorDir . '/jms/serializer/VisitorInterface.php', 'JMS\Serializer\XmlDeserializationVisitor' => $vendorDir . '/jms/serializer/XmlDeserializationVisitor.php', 'JMS\Serializer\XmlSerializationVisitor' => $vendorDir . '/jms/serializer/XmlSerializationVisitor.php', 'JMS\Serializer\YamlSerializationVisitor' => $vendorDir . '/jms/serializer/YamlSerializationVisitor.php', 'JMS\Serializer\Annotation\Accessor' => $vendorDir . '/jms/serializer/Annotation/Accessor.php', 'JMS\Serializer\Annotation\AccessorOrder' => $vendorDir . '/jms/serializer/Annotation/AccessorOrder.php', 'JMS\Serializer\Annotation\AccessType' => $vendorDir . '/jms/serializer/AccessType.php', 'JMS\Serializer\Annotation\Discriminator' => $vendorDir . '/jms/serializer/Annotation/Discriminator.php', 'JMS\Serializer\Annotation\Exclude' => $vendorDir . '/jms/serializer/Annotation/Exclude.php', 'JMS\Serializer\Annotation\ExclusionPolicy' => $vendorDir . '/jms/serializer/Annotation/ExclusionPolicy.php', 'JMS\Serializer\Annotation\Expose' => $vendorDir . '/jms/serializer/Annotation/Expose.php', 'JMS\Serializer\Annotation\Groups' => $vendorDir . '/jms/serializer/Annotation/Groups.php', 'JMS\Serializer\Annotation\HandlerCallback' => $vendorDir . '/jms/serializer/Annotation/HandlerCallback.php', 'JMS\Serializer\Annotation\Inline' => $vendorDir . '/jms/serializer/Annotation/Inline.php', 'JMS\Serializer\Annotation\MaxDepth' => $vendorDir . '/jms/serializer/Annotation/MaxDepth.php', 'JMS\Serializer\Annotation\PostDeserialize' => $vendorDir . '/jms/serializer/Annotation/PostDeserialize.php', 'JMS\Serializer\Annotation\PostSerialize' => $vendorDir . '/jms/serializer/Annotation/PostSerialize.php', 'JMS\Serializer\Annotation\PreSerialize' => $vendorDir . '/jms/serializer/Annotation/PreSerialize.php', 'JMS\Serializer\Annotation\ReadOnly' => $vendorDir . '/jms/serializer/Annotation/ReadOnly.php', 'JMS\Serializer\Annotation\SerializedName' => $vendorDir . '/jms/serializer/Annotation/SerializedName.php', 'JMS\Serializer\Annotation\Since' => $vendorDir . '/jms/serializer/Annotation/Since.php', 'JMS\Serializer\Annotation\Type' => $vendorDir . '/jms/serializer/Annotation/Type.php', 'JMS\Serializer\Annotation\Until' => $vendorDir . '/jms/serializer/Annotation/Until.php', 'JMS\Serializer\Annotation\Version' => $vendorDir . '/jms/serializer/Annotation/Version.php', 'JMS\Serializer\Annotation\VirtualProperty' => $vendorDir . '/jms/serializer/Annotation/VirtualProperty.php', 'JMS\Serializer\Annotation\XmlAttribute' => $vendorDir . '/jms/serializer/Annotation/XmlAttribute.php', 'JMS\Serializer\Annotation\XmlAttributeMap' => $vendorDir . '/jms/serializer/Annotation/XmlAttributeMap.php', 'JMS\Serializer\Annotation\XmlCollection' => $vendorDir . '/jms/serializer/Annotation/XmlCollection.php', 'JMS\Serializer\Annotation\XmlElement' => $vendorDir . '/jms/serializer/Annotation/XmlElement.php', 'JMS\Serializer\Annotation\XmlKeyValuePairs' => $vendorDir . '/jms/serializer/Annotation/XmlKeyValuePairs.php', 'JMS\Serializer\Annotation\XmlList' => $vendorDir . '/jms/serializer/Annotation/XmlList.php', 'JMS\Serializer\Annotation\XmlMap' => $vendorDir . '/jms/serializer/Annotation/XmlMap.php', 'JMS\Serializer\Annotation\XmlNamespace' => $vendorDir . '/jms/serializer/Annotation/XmlNamespace.php', 'JMS\Serializer\Annotation\XmlRoot' => $vendorDir . '/jms/serializer/Annotation/XmlRoot.php', 'JMS\Serializer\Annotation\XmlValue' => $vendorDir . '/jms/serializer/Annotation/XmlValue.php', 'JMS\Serializer\Builder\CallbackDriverFactory' => $vendorDir . '/jms/serializer/Builder/CallbackDriverFactory.php', 'JMS\Serializer\Builder\DefaultDriverFactory' => $vendorDir . '/jms/serializer/Builder/DefaultDriverFactory.php', 'JMS\Serializer\Builder\DriverFactoryInterface' => $vendorDir . '/jms/serializer/Builder/DriverFactoryInterface.php', 'JMS\Serializer\Construction\DoctrineObjectConstructor' => $vendorDir . '/jms/serializer/Construction/DoctrineObjectConstructor.php', 'JMS\Serializer\Construction\ObjectConstructorInterface' => $vendorDir . '/jms/serializer/Construction/ObjectConstructorInterface.php', 'JMS\Serializer\Construction\UnserializeObjectConstructor' => $vendorDir . '/jms/serializer/Construction/UnserializeObjectConstructor.php', 'JMS\Serializer\EventDispatcher\Event' => $vendorDir . '/jms/serializer/EventDispatcher/Event.php', 'JMS\Serializer\EventDispatcher\EventDispatcher' => $vendorDir . '/jms/serializer/EventDispatcher/EventDispatcher.php', 'JMS\Serializer\EventDispatcher\EventDispatcherInterface' => $vendorDir . '/jms/serializer/EventDispatcher/EventDispatcherInterface.php', 'JMS\Serializer\EventDispatcher\Events' => $vendorDir . '/jms/serializer/EventDispatcher/Events.php', 'JMS\Serializer\EventDispatcher\EventSubscriberInterface' => $vendorDir . '/jms/serializer/EventDispatcher/EventSubscriberInterface.php', 'JMS\Serializer\EventDispatcher\LazyEventDispatcher' => $vendorDir . '/jms/serializer/EventDispatcher/LazyEventDispatcher.php', 'JMS\Serializer\EventDispatcher\ObjectEvent' => $vendorDir . '/jms/serializer/EventDispatcher/ObjectEvent.php', 'JMS\Serializer\EventDispatcher\PreDeserializeEvent' => $vendorDir . '/jms/serializer/EventDispatcher/PreDeserializeEvent.php', 'JMS\Serializer\EventDispatcher\PreSerializeEvent' => $vendorDir . '/jms/serializer/EventDispatcher/PreSerializeEvent.php', 'JMS\Serializer\EventDispatcher\Subscriber\DoctrineProxySubscriber' => $vendorDir . '/jms/serializer/EventDispatcher/Subscriber/DoctrineProxySubscriber.php', 'JMS\Serializer\EventDispatcher\Subscriber\SymfonyValidatorSubscriber' => $vendorDir . '/jms/serializer/EventDispatcher/Subscriber/SymfonyValidatorSubscriber.php', 'JMS\Serializer\Exception\Exception' => $vendorDir . '/jms/serializer/Exception/Exception.php', 'JMS\Serializer\Exception\InvalidArgumentException' => $vendorDir . '/jms/serializer/Exception/InvalidArgumentException.php', 'JMS\Serializer\Exception\LogicException' => $vendorDir . '/jms/serializer/Exception/LogicException.php', 'JMS\Serializer\Exception\RuntimeException' => $vendorDir . '/jms/serializer/Exception/RuntimeException.php', 'JMS\Serializer\Exception\UnsupportedFormatException' => $vendorDir . '/jms/serializer/Exception/UnsupportedFormatException.php', 'JMS\Serializer\Exception\ValidationFailedException' => $vendorDir . '/jms/serializer/Exception/ValidationFailedException.php', 'JMS\Serializer\Exception\XmlErrorException' => $vendorDir . '/jms/serializer/Exception/XmlErrorException.php', 'JMS\Serializer\Exclusion\DepthExclusionStrategy' => $vendorDir . '/jms/serializer/Exclusion/DepthExclusionStrategy.php', 'JMS\Serializer\Exclusion\DisjunctExclusionStrategy' => $vendorDir . '/jms/serializer/Exclusion/DisjunctExclusionStrategy.php', 'JMS\Serializer\Exclusion\ExclusionStrategyInterface' => $vendorDir . '/jms/serializer/Exclusion/ExclusionStrategyInterface.php', 'JMS\Serializer\Exclusion\GroupsExclusionStrategy' => $vendorDir . '/jms/serializer/Exclusion/GroupsExclusionStrategy.php', 'JMS\Serializer\Exclusion\VersionExclusionStrategy' => $vendorDir . '/jms/serializer/Exclusion/VersionExclusionStrategy.php', 'JMS\Serializer\Handler\ArrayCollectionHandler' => $vendorDir . '/jms/serializer/Handler/ArrayCollectionHandler.php', 'JMS\Serializer\Handler\ConstraintViolationHandler' => $vendorDir . '/jms/serializer/Handler/ConstraintViolationHandler.php', 'JMS\Serializer\Handler\DateHandler' => $vendorDir . '/jms/serializer/Handler/DateHandler.php', 'JMS\Serializer\Handler\FormErrorHandler' => $vendorDir . '/jms/serializer/Handler/FormErrorHandler.php', 'JMS\Serializer\Handler\HandlerRegistry' => $vendorDir . '/jms/serializer/Handler/HandlerRegistry.php', 'JMS\Serializer\Handler\HandlerRegistryInterface' => $vendorDir . '/jms/serializer/Handler/HandlerRegistryInterface.php', 'JMS\Serializer\Handler\LazyHandlerRegistry' => $vendorDir . '/jms/serializer/Handler/LazyHandlerRegistry.php', 'JMS\Serializer\Handler\PhpCollectionHandler' => $vendorDir . '/jms/serializer/Handler/PhpCollectionHandler.php', 'JMS\Serializer\Handler\PropelCollectionHandler' => $vendorDir . '/jms/serializer/Handler/PropelCollectionHandler.php', 'JMS\Serializer\Handler\SubscribingHandlerInterface' => $vendorDir . '/jms/serializer/Handler/SubscribingHandlerInterface.php', 'JMS\Serializer\Metadata\ClassMetadata' => $vendorDir . '/jms/serializer/Metadata/ClassMetadata.php', 'JMS\Serializer\Metadata\PropertyMetadata' => $vendorDir . '/jms/serializer/Metadata/PropertyMetadata.php', 'JMS\Serializer\Metadata\StaticPropertyMetadata' => $vendorDir . '/jms/serializer/Metadata/StaticPropertyMetadata.php', 'JMS\Serializer\Metadata\VirtualPropertyMetadata' => $vendorDir . '/jms/serializer/Metadata/VirtualPropertyMetadata.php', 'JMS\Serializer\Metadata\Driver\AbstractDoctrineTypeDriver' => $vendorDir . '/jms/serializer/Metadata/Driver/AbstractDoctrineTypeDriver.php', 'JMS\Serializer\Metadata\Driver\AnnotationDriver' => $vendorDir . '/jms/serializer/Metadata/Driver/AnnotationDriver.php', 'JMS\Serializer\Metadata\Driver\DoctrinePHPCRTypeDriver' => $vendorDir . '/jms/serializer/Metadata/Driver/DoctrinePHPCRTypeDriver.php', 'JMS\Serializer\Metadata\Driver\DoctrineTypeDriver' => $vendorDir . '/jms/serializer/Metadata/Driver/DoctrineTypeDriver.php', 'JMS\Serializer\Metadata\Driver\PhpDriver' => $vendorDir . '/jms/serializer/Metadata/Driver/PhpDriver.php', 'JMS\Serializer\Metadata\Driver\XmlDriver' => $vendorDir . '/jms/serializer/Metadata/Driver/XmlDriver.php', 'JMS\Serializer\Metadata\Driver\YamlDriver' => $vendorDir . '/jms/serializer/Metadata/Driver/YamlDriver.php', 'JMS\Serializer\Naming\CacheNamingStrategy' => $vendorDir . '/jms/serializer/Naming/CacheNamingStrategy.php', 'JMS\Serializer\Naming\CamelCaseNamingStrategy' => $vendorDir . '/jms/serializer/Naming/CamelCaseNamingStrategy.php', 'JMS\Serializer\Naming\IdenticalPropertyNamingStrategy' => $vendorDir . '/jms/serializer/Naming/IdenticalPropertyNamingStrategy.php', 'JMS\Serializer\Naming\PropertyNamingStrategyInterface' => $vendorDir . '/jms/serializer/Naming/PropertyNamingStrategyInterface.php', 'JMS\Serializer\Naming\SerializedNameAnnotationStrategy' => $vendorDir . '/jms/serializer/Naming/SerializedNameAnnotationStrategy.php', 'JMS\Serializer\Twig\SerializerExtension' => $vendorDir . '/jms/serializer/Twig/SerializerExtension.php', 'JMS\Serializer\Util\Writer' => $vendorDir . '/jms/serializer/Util/Writer.php', 'Metadata\Cache\CacheInterface' => $vendorDir . '/jms/metadata/src/Metadata/Cache/CacheInterface.php', 'Metadata\Cache\DoctrineCacheAdapter' => $vendorDir . '/jms/metadata/src/Metadata/Cache/DoctrineCacheAdapter.php', 'Metadata\Cache\FileCache' => $vendorDir . '/jms/metadata/src/Metadata/Cache/FileCache.php', 'Metadata\ClassHierarchyMetadata' => $vendorDir . '/jms/metadata/src/Metadata/ClassHierarchyMetadata.php', 'Metadata\ClassMetadata' => $vendorDir . '/jms/metadata/src/Metadata/ClassMetadata.php', 'Metadata\Driver\AbstractFileDriver' => $vendorDir . '/jms/metadata/src/Metadata/Driver/AbstractFileDriver.php', 'Metadata\Driver\AdvancedDriverInterface' => $vendorDir . '/jms/metadata/src/Metadata/Driver/AdvancedDriverInterface.php', 'Metadata\Driver\AdvancedFileLocatorInterface' => $vendorDir . '/jms/metadata/src/Metadata/Driver/AdvancedFileLocatorInterface.php', 'Metadata\Driver\DriverChain' => $vendorDir . '/jms/metadata/src/Metadata/Driver/DriverChain.php', 'Metadata\Driver\DriverInterface' => $vendorDir . '/jms/metadata/src/Metadata/Driver/DriverInterface.php', 'Metadata\Driver\FileLocator' => $vendorDir . '/jms/metadata/src/Metadata/Driver/FileLocator.php', 'Metadata\Driver\FileLocatorInterface' => $vendorDir . '/jms/metadata/src/Metadata/Driver/FileLocatorInterface.php', 'Metadata\Driver\LazyLoadingDriver' => $vendorDir . '/jms/metadata/src/Metadata/Driver/LazyLoadingDriver.php', 'Metadata\AdvancedMetadataFactoryInterface' => $vendorDir . '/jms/metadata/src/Metadata/AdvancedMetadataFactoryInterface.php', 'Metadata\MergeableClassMetadata' => $vendorDir . '/jms/metadata/src/Metadata/MergeableClassMetadata.php', 'Metadata\MergeableInterface' => $vendorDir . '/jms/metadata/src/Metadata/MergeableInterface.php', 'Metadata\MetadataFactory' => $vendorDir . '/jms/metadata/src/Metadata/MetadataFactory.php', 'Metadata\MetadataFactoryInterface' => $vendorDir . '/jms/metadata/src/Metadata/MetadataFactoryInterface.php', 'Metadata\MethodMetadata' => $vendorDir . '/jms/metadata/src/Metadata/MethodMetadata.php', 'Metadata\NullMetadata' => $vendorDir . '/jms/metadata/src/Metadata/NullMetadata.php', 'Metadata\PropertyMetadata' => $vendorDir . '/jms/metadata/src/Metadata/PropertyMetadata.php', 'Metadata\Version' => $vendorDir . '/jms/metadata/src/Metadata/Version.php', 'PhpCollection\AbstractCollection' => $vendorDir . '/phpcollection/phpcollection/src/PhpCollection/AbstractCollection.php', 'PhpCollection\AbstractMap' => $vendorDir . '/phpcollection/phpcollection/src/PhpCollection/AbstractMap.php', 'PhpCollection\AbstractSequence' => $vendorDir . '/phpcollection/phpcollection/src/PhpCollection/AbstractSequence.php', 'PhpCollection\CollectionInterface' => $vendorDir . '/phpcollection/phpcollection/src/PhpCollection/CollectionInterface.php', 'PhpCollection\Map' => $vendorDir . '/phpcollection/phpcollection/src/PhpCollection/Map.php', 'PhpCollection\MapInterface' => $vendorDir . '/phpcollection/phpcollection/src/PhpCollection/MapInterface.php', 'PhpCollection\Sequence' => $vendorDir . '/phpcollection/phpcollection/src/PhpCollection/Sequence.php', 'PhpCollection\SequenceInterface' => $vendorDir . '/phpcollection/phpcollection/src/PhpCollection/SequenceInterface.php', 'PhpCollection\SortableInterface' => $vendorDir . '/phpcollection/phpcollection/src/PhpCollection/SortableInterface.php', 'PhpCollection\SortedSequence' => $vendorDir . '/phpcollection/phpcollection/src/PhpCollection/SortedSequence.php', 'PhpOption\LazyOption' => $vendorDir . '/phpoption/phpoption/src/PhpOption/LazyOption.php', 'PhpOption\None' => $vendorDir . '/phpoption/phpoption/src/PhpOption/None.php', 'PhpOption\Option' => $vendorDir . '/phpoption/phpoption/src/PhpOption/Option.php', 'PhpOption\Some' => $vendorDir . '/phpoption/phpoption/src/PhpOption/Some.php', 'Symfony\Component\Yaml\Yaml' => $vendorDir . '/symfony/yaml/Yaml.php', 'Symfony\Component\Yaml\Parser' => $vendorDir . '/symfony/yaml/Parser.php', 'Symfony\Component\Yaml\Inline' => $vendorDir . '/symfony/yaml/Inline.php', 'AuthorizeNetAIM' => $libDir . 'AuthorizeNetAIM.php', 'AuthorizeNetAIM_Response' => $libDir . 'AuthorizeNetAIM.php', 'AuthorizeNetARB' => $libDir . 'AuthorizeNetARB.php', 'AuthorizeNetARB_Response' => $libDir . 'AuthorizeNetARB.php', 'AuthorizeNetAddress' => $sharedDir . 'AuthorizeNetTypes.php', 'AuthorizeNetBankAccount' => $sharedDir . 'AuthorizeNetTypes.php', 'AuthorizeNetCIM' => $libDir . 'AuthorizeNetCIM.php', 'AuthorizeNetCIM_Response' => $libDir . 'AuthorizeNetCIM.php', 'AuthorizeNetCP' => $libDir . 'AuthorizeNetCP.php', 'AuthorizeNetCP_Response' => $libDir . 'AuthorizeNetCP.php', 'AuthorizeNetCreditCard' => $sharedDir . 'AuthorizeNetTypes.php', 'AuthorizeNetCustomer' => $sharedDir . 'AuthorizeNetTypes.php', 'AuthorizeNetDPM' => $libDir . 'AuthorizeNetDPM.php', 'AuthorizeNetException' => $sharedDir . 'AuthorizeNetException.php', 'AuthorizeNetLineItem' => $sharedDir . 'AuthorizeNetTypes.php', 'AuthorizeNetPayment' => $sharedDir . 'AuthorizeNetTypes.php', 'AuthorizeNetPaymentProfile' => $sharedDir . 'AuthorizeNetTypes.php', 'AuthorizeNetRequest' => $sharedDir . 'AuthorizeNetRequest.php', 'AuthorizeNetResponse' => $sharedDir . 'AuthorizeNetResponse.php', 'AuthorizeNetSIM' => $libDir . 'AuthorizeNetSIM.php', 'AuthorizeNetSIM_Form' => $libDir . 'AuthorizeNetSIM.php', 'AuthorizeNetSOAP' => $libDir . 'AuthorizeNetSOAP.php', 'AuthorizeNetTD' => $libDir . 'AuthorizeNetTD.php', 'AuthorizeNetTD_Response' => $libDir . 'AuthorizeNetTD.php', 'AuthorizeNetTransaction' => $sharedDir . 'AuthorizeNetTypes.php', 'AuthorizeNetXMLResponse' => $sharedDir . 'AuthorizeNetXMLResponse.php', 'AuthorizeNet_Subscription' => $sharedDir . 'AuthorizeNetTypes.php', 'AuthorizeNetGetSubscriptionList' => $sharedDir . 'AuthorizeNetTypes.php', 'AuthorizeNetSubscriptionListSorting' => $sharedDir . 'AuthorizeNetTypes.php', 'AuthorizeNetSubscriptionListPaging' => $sharedDir . 'AuthorizeNetTypes.php', // Following section contains the new controller model classes needed //Utils //'net\authorize\util\ObjectToXml' => $libDir . 'net/authorize/util/ObjectToXml.php', 'net\authorize\util\HttpClient' => $libDir . 'net/authorize/util/HttpClient.php', 'net\authorize\util\Helpers' => $libDir . 'net/authorize/util/Helpers.php', 'net\authorize\util\Log' => $libDir . 'net/authorize/util/Log.php', 'net\authorize\util\LogFactory' => $libDir . 'net/authorize/util/LogFactory.php', 'net\authorize\util\ANetSensitiveFields' => $libDir . 'net/authorize/util/ANetSensitiveFields.php', 'net\authorize\util\SensitiveTag' => $libDir . 'net/authorize/util/SensitiveTag.php', 'net\authorize\util\SensitiveDataConfigType' => $libDir . 'net/authorize/util/SensitiveDataConfigType.php', //constants 'net\authorize\api\constants\ANetEnvironment' => $libDir . 'net/authorize/api/constants/ANetEnvironment.php', //base classes 'net\authorize\api\controller\base\IApiOperation' => $libDir . 'net/authorize/api/controller/base/IApiOperation.php', 'net\authorize\api\controller\base\ApiOperationBase' => $libDir . 'net/authorize/api/controller/base/ApiOperationBase.php', //following are generated class mappings 'net\authorize\api\contract\v1\ANetApiRequestType' => $libDir . 'net/authorize/api/contract/v1/ANetApiRequestType.php', 'net\authorize\api\contract\v1\ANetApiResponseType' => $libDir . 'net/authorize/api/contract/v1/ANetApiResponseType.php', 'net\authorize\api\contract\v1\ARBCancelSubscriptionRequest' => $libDir . 'net/authorize/api/contract/v1/ARBCancelSubscriptionRequest.php', 'net\authorize\api\contract\v1\ARBCancelSubscriptionResponse' => $libDir . 'net/authorize/api/contract/v1/ARBCancelSubscriptionResponse.php', 'net\authorize\api\contract\v1\ARBCreateSubscriptionRequest' => $libDir . 'net/authorize/api/contract/v1/ARBCreateSubscriptionRequest.php', 'net\authorize\api\contract\v1\ARBCreateSubscriptionResponse' => $libDir . 'net/authorize/api/contract/v1/ARBCreateSubscriptionResponse.php', 'net\authorize\api\contract\v1\ARBGetSubscriptionListRequest' => $libDir . 'net/authorize/api/contract/v1/ARBGetSubscriptionListRequest.php', 'net\authorize\api\contract\v1\ARBGetSubscriptionListResponse' => $libDir . 'net/authorize/api/contract/v1/ARBGetSubscriptionListResponse.php', 'net\authorize\api\contract\v1\ARBGetSubscriptionListSortingType' => $libDir . 'net/authorize/api/contract/v1/ARBGetSubscriptionListSortingType.php', 'net\authorize\api\contract\v1\ARBGetSubscriptionRequest' => $libDir . 'net/authorize/api/contract/v1/ARBGetSubscriptionRequest.php', 'net\authorize\api\contract\v1\ARBGetSubscriptionResponse' => $libDir . 'net/authorize/api/contract/v1/ARBGetSubscriptionResponse.php', 'net\authorize\api\contract\v1\ARBGetSubscriptionStatusRequest' => $libDir . 'net/authorize/api/contract/v1/ARBGetSubscriptionStatusRequest.php', 'net\authorize\api\contract\v1\ARBGetSubscriptionStatusResponse' => $libDir . 'net/authorize/api/contract/v1/ARBGetSubscriptionStatusResponse.php', 'net\authorize\api\contract\v1\ARBSubscriptionMaskedType' => $libDir . 'net/authorize/api/contract/v1/ARBSubscriptionMaskedType.php', 'net\authorize\api\contract\v1\ARBSubscriptionType' => $libDir . 'net/authorize/api/contract/v1/ARBSubscriptionType.php', 'net\authorize\api\contract\v1\ARBUpdateSubscriptionRequest' => $libDir . 'net/authorize/api/contract/v1/ARBUpdateSubscriptionRequest.php', 'net\authorize\api\contract\v1\ARBUpdateSubscriptionResponse' => $libDir . 'net/authorize/api/contract/v1/ARBUpdateSubscriptionResponse.php', 'net\authorize\api\contract\v1\ArrayOfSettingType' => $libDir . 'net/authorize/api/contract/v1/ArrayOfSettingType.php', 'net\authorize\api\contract\v1\AuthenticateTestRequest' => $libDir . 'net/authorize/api/contract/v1/AuthenticateTestRequest.php', 'net\authorize\api\contract\v1\AuthenticateTestResponse' => $libDir . 'net/authorize/api/contract/v1/AuthenticateTestResponse.php', 'net\authorize\api\contract\v1\BankAccountMaskedType' => $libDir . 'net/authorize/api/contract/v1/BankAccountMaskedType.php', 'net\authorize\api\contract\v1\BankAccountType' => $libDir . 'net/authorize/api/contract/v1/BankAccountType.php', 'net\authorize\api\contract\v1\BatchDetailsType' => $libDir . 'net/authorize/api/contract/v1/BatchDetailsType.php', 'net\authorize\api\contract\v1\BatchStatisticType' => $libDir . 'net/authorize/api/contract/v1/BatchStatisticType.php', 'net\authorize\api\contract\v1\CardArtType' => $libDir . 'net/authorize/api/contract/v1/CardArtType.php', 'net\authorize\api\contract\v1\CcAuthenticationType' => $libDir . 'net/authorize/api/contract/v1/CcAuthenticationType.php', 'net\authorize\api\contract\v1\CreateCustomerPaymentProfileRequest' => $libDir . 'net/authorize/api/contract/v1/CreateCustomerPaymentProfileRequest.php', 'net\authorize\api\contract\v1\CreateCustomerPaymentProfileResponse' => $libDir . 'net/authorize/api/contract/v1/CreateCustomerPaymentProfileResponse.php', 'net\authorize\api\contract\v1\CreateCustomerProfileFromTransactionRequest' => $libDir . 'net/authorize/api/contract/v1/CreateCustomerProfileFromTransactionRequest.php', 'net\authorize\api\contract\v1\CreateCustomerProfileRequest' => $libDir . 'net/authorize/api/contract/v1/CreateCustomerProfileRequest.php', 'net\authorize\api\contract\v1\CreateCustomerProfileResponse' => $libDir . 'net/authorize/api/contract/v1/CreateCustomerProfileResponse.php', 'net\authorize\api\contract\v1\CreateCustomerProfileTransactionRequest' => $libDir . 'net/authorize/api/contract/v1/CreateCustomerProfileTransactionRequest.php', 'net\authorize\api\contract\v1\CreateCustomerProfileTransactionResponse' => $libDir . 'net/authorize/api/contract/v1/CreateCustomerProfileTransactionResponse.php', 'net\authorize\api\contract\v1\CreateCustomerShippingAddressRequest' => $libDir . 'net/authorize/api/contract/v1/CreateCustomerShippingAddressRequest.php', 'net\authorize\api\contract\v1\CreateCustomerShippingAddressResponse' => $libDir . 'net/authorize/api/contract/v1/CreateCustomerShippingAddressResponse.php', 'net\authorize\api\contract\v1\CreateProfileResponseType' => $libDir . 'net/authorize/api/contract/v1/CreateProfileResponseType.php', 'net\authorize\api\contract\v1\CreateTransactionRequest' => $libDir . 'net/authorize/api/contract/v1/CreateTransactionRequest.php', 'net\authorize\api\contract\v1\CreateTransactionResponse' => $libDir . 'net/authorize/api/contract/v1/CreateTransactionResponse.php', 'net\authorize\api\contract\v1\CreditCardMaskedType' => $libDir . 'net/authorize/api/contract/v1/CreditCardMaskedType.php', 'net\authorize\api\contract\v1\CreditCardSimpleType' => $libDir . 'net/authorize/api/contract/v1/CreditCardSimpleType.php', 'net\authorize\api\contract\v1\CreditCardTrackType' => $libDir . 'net/authorize/api/contract/v1/CreditCardTrackType.php', 'net\authorize\api\contract\v1\CreditCardType' => $libDir . 'net/authorize/api/contract/v1/CreditCardType.php', 'net\authorize\api\contract\v1\CustomerAddressExType' => $libDir . 'net/authorize/api/contract/v1/CustomerAddressExType.php', 'net\authorize\api\contract\v1\CustomerAddressType' => $libDir . 'net/authorize/api/contract/v1/CustomerAddressType.php', 'net\authorize\api\contract\v1\CustomerDataType' => $libDir . 'net/authorize/api/contract/v1/CustomerDataType.php', 'net\authorize\api\contract\v1\CustomerProfileIdType' => $libDir . 'net/authorize/api/contract/v1/CustomerProfileIdType.php', 'net\authorize\api\contract\v1\CustomerPaymentProfileBaseType' => $libDir . 'net/authorize/api/contract/v1/CustomerPaymentProfileBaseType.php', 'net\authorize\api\contract\v1\CustomerPaymentProfileExType' => $libDir . 'net/authorize/api/contract/v1/CustomerPaymentProfileExType.php', 'net\authorize\api\contract\v1\CustomerPaymentProfileListItemType' => $libDir . 'net/authorize/api/contract/v1/CustomerPaymentProfileListItemType.php', 'net\authorize\api\contract\v1\CustomerPaymentProfileMaskedType' => $libDir . 'net/authorize/api/contract/v1/CustomerPaymentProfileMaskedType.php', 'net\authorize\api\contract\v1\CustomerPaymentProfileSortingType' => $libDir . 'net/authorize/api/contract/v1/CustomerPaymentProfileSortingType.php', 'net\authorize\api\contract\v1\CustomerPaymentProfileType' => $libDir . 'net/authorize/api/contract/v1/CustomerPaymentProfileType.php', 'net\authorize\api\contract\v1\CustomerProfileBaseType' => $libDir . 'net/authorize/api/contract/v1/CustomerProfileBaseType.php', 'net\authorize\api\contract\v1\CustomerProfileExType' => $libDir . 'net/authorize/api/contract/v1/CustomerProfileExType.php', 'net\authorize\api\contract\v1\CustomerProfileMaskedType' => $libDir . 'net/authorize/api/contract/v1/CustomerProfileMaskedType.php', 'net\authorize\api\contract\v1\CustomerProfilePaymentType' => $libDir . 'net/authorize/api/contract/v1/CustomerProfilePaymentType.php', 'net\authorize\api\contract\v1\CustomerProfileSummaryType' => $libDir . 'net/authorize/api/contract/v1/CustomerProfileSummaryType.php', 'net\authorize\api\contract\v1\CustomerProfileType' => $libDir . 'net/authorize/api/contract/v1/CustomerProfileType.php', 'net\authorize\api\contract\v1\CustomerType' => $libDir . 'net/authorize/api/contract/v1/CustomerType.php', 'net\authorize\api\contract\v1\DecryptPaymentDataRequest' => $libDir . 'net/authorize/api/contract/v1/DecryptPaymentDataRequest.php', 'net\authorize\api\contract\v1\DecryptPaymentDataResponse' => $libDir . 'net/authorize/api/contract/v1/DecryptPaymentDataResponse.php', 'net\authorize\api\contract\v1\DeleteCustomerPaymentProfileRequest' => $libDir . 'net/authorize/api/contract/v1/DeleteCustomerPaymentProfileRequest.php', 'net\authorize\api\contract\v1\DeleteCustomerPaymentProfileResponse' => $libDir . 'net/authorize/api/contract/v1/DeleteCustomerPaymentProfileResponse.php', 'net\authorize\api\contract\v1\DeleteCustomerProfileRequest' => $libDir . 'net/authorize/api/contract/v1/DeleteCustomerProfileRequest.php', 'net\authorize\api\contract\v1\DeleteCustomerProfileResponse' => $libDir . 'net/authorize/api/contract/v1/DeleteCustomerProfileResponse.php', 'net\authorize\api\contract\v1\DeleteCustomerShippingAddressRequest' => $libDir . 'net/authorize/api/contract/v1/DeleteCustomerShippingAddressRequest.php', 'net\authorize\api\contract\v1\DeleteCustomerShippingAddressResponse' => $libDir . 'net/authorize/api/contract/v1/DeleteCustomerShippingAddressResponse.php', 'net\authorize\api\contract\v1\DriversLicenseMaskedType' => $libDir . 'net/authorize/api/contract/v1/DriversLicenseMaskedType.php', 'net\authorize\api\contract\v1\DriversLicenseType' => $libDir . 'net/authorize/api/contract/v1/DriversLicenseType.php', 'net\authorize\api\contract\v1\EmailSettingsType' => $libDir . 'net/authorize/api/contract/v1/EmailSettingsType.php', 'net\authorize\api\contract\v1\EncryptedTrackDataType' => $libDir . 'net/authorize/api/contract/v1/EncryptedTrackDataType.php', 'net\authorize\api\contract\v1\EnumCollection' => $libDir . 'net/authorize/api/contract/v1/EnumCollection.php', 'net\authorize\api\contract\v1\ErrorResponse' => $libDir . 'net/authorize/api/contract/v1/ErrorResponse.php', 'net\authorize\api\contract\v1\ExtendedAmountType' => $libDir . 'net/authorize/api/contract/v1/ExtendedAmountType.php', 'net\authorize\api\contract\v1\FDSFilterType' => $libDir . 'net/authorize/api/contract/v1/FDSFilterType.php', 'net\authorize\api\contract\v1\FingerPrintType' => $libDir . 'net/authorize/api/contract/v1/FingerPrintType.php', 'net\authorize\api\contract\v1\FraudInformationType.php' => $libDir . 'net/authorize/api/contract/v1/FraudInformationType.php', 'net\authorize\api\contract\v1\GetBatchStatisticsRequest' => $libDir . 'net/authorize/api/contract/v1/GetBatchStatisticsRequest.php', 'net\authorize\api\contract\v1\GetBatchStatisticsResponse' => $libDir . 'net/authorize/api/contract/v1/GetBatchStatisticsResponse.php', 'net\authorize\api\contract\v1\GetCustomerPaymentProfileListRequest' => $libDir . 'net/authorize/api/contract/v1/GetCustomerPaymentProfileListRequest.php', 'net\authorize\api\contract\v1\GetCustomerPaymentProfileListResponse' => $libDir . 'net/authorize/api/contract/v1/GetCustomerPaymentProfileListResponse.php', 'net\authorize\api\contract\v1\GetCustomerPaymentProfileRequest' => $libDir . 'net/authorize/api/contract/v1/GetCustomerPaymentProfileRequest.php', 'net\authorize\api\contract\v1\GetCustomerPaymentProfileResponse' => $libDir . 'net/authorize/api/contract/v1/GetCustomerPaymentProfileResponse.php', 'net\authorize\api\contract\v1\GetCustomerProfileIdsRequest' => $libDir . 'net/authorize/api/contract/v1/GetCustomerProfileIdsRequest.php', 'net\authorize\api\contract\v1\GetCustomerProfileIdsResponse' => $libDir . 'net/authorize/api/contract/v1/GetCustomerProfileIdsResponse.php', 'net\authorize\api\contract\v1\GetCustomerProfileRequest' => $libDir . 'net/authorize/api/contract/v1/GetCustomerProfileRequest.php', 'net\authorize\api\contract\v1\GetCustomerProfileResponse' => $libDir . 'net/authorize/api/contract/v1/GetCustomerProfileResponse.php', 'net\authorize\api\contract\v1\GetCustomerShippingAddressRequest' => $libDir . 'net/authorize/api/contract/v1/GetCustomerShippingAddressRequest.php', 'net\authorize\api\contract\v1\GetCustomerShippingAddressResponse' => $libDir . 'net/authorize/api/contract/v1/GetCustomerShippingAddressResponse.php', 'net\authorize\api\contract\v1\GetHostedPaymentPageRequest.php' => $libDir . 'net/authorize/api/contract/v1/GetHostedPaymentPageRequest.php', 'net\authorize\api\contract\v1\GetHostedPaymentPageResponse.php' => $libDir . 'net/authorize/api/contract/v1/GetHostedPaymentPageResponse.php', 'net\authorize\api\contract\v1\GetHostedProfilePageRequest' => $libDir . 'net/authorize/api/contract/v1/GetHostedProfilePageRequest.php', 'net\authorize\api\contract\v1\GetHostedProfilePageResponse' => $libDir . 'net/authorize/api/contract/v1/GetHostedProfilePageResponse.php', 'net\authorize\api\contract\v1\GetMerchantDetailsRequest.php' => $libDir . 'net/authorize/api/contract/v1/GetMerchantDetailsRequest.php', 'net\authorize\api\contract\v1\GetMerchantDetailsResponse.php' => $libDir . 'net/authorize/api/contract/v1/GetMerchantDetailsResponse.php', 'net\authorize\api\contract\v1\GetSettledBatchListRequest' => $libDir . 'net/authorize/api/contract/v1/GetSettledBatchListRequest.php', 'net\authorize\api\contract\v1\GetSettledBatchListResponse' => $libDir . 'net/authorize/api/contract/v1/GetSettledBatchListResponse.php', 'net\authorize\api\contract\v1\GetTransactionDetailsRequest' => $libDir . 'net/authorize/api/contract/v1/GetTransactionDetailsRequest.php', 'net\authorize\api\contract\v1\GetTransactionDetailsResponse' => $libDir . 'net/authorize/api/contract/v1/GetTransactionDetailsResponse.php', 'net\authorize\api\contract\v1\GetTransactionListRequest' => $libDir . 'net/authorize/api/contract/v1/GetTransactionListRequest.php', 'net\authorize\api\contract\v1\GetTransactionListResponse' => $libDir . 'net/authorize/api/contract/v1/GetTransactionListResponse.php', 'net\authorize\api\contract\v1\GetUnsettledTransactionListRequest' => $libDir . 'net/authorize/api/contract/v1/GetUnsettledTransactionListRequest.php', 'net\authorize\api\contract\v1\GetUnsettledTransactionListResponse' => $libDir . 'net/authorize/api/contract/v1/GetUnsettledTransactionListResponse.php', 'net\authorize\api\contract\v1\HeldTransactionRequestType.php' => $libDir . 'net/authorize/api/contract/v1/HeldTransactionRequestType.php', 'net\authorize\api\contract\v1\ImpersonationAuthenticationType' => $libDir . 'net/authorize/api/contract/v1/ImpersonationAuthenticationType.php', 'net\authorize\api\contract\v1\IsAliveRequest' => $libDir . 'net/authorize/api/contract/v1/IsAliveRequest.php', 'net\authorize\api\contract\v1\IsAliveResponse' => $libDir . 'net/authorize/api/contract/v1/IsAliveResponse.php', 'net\authorize\api\contract\v1\KeyBlockType' => $libDir . 'net/authorize/api/contract/v1/KeyBlockType.php', 'net\authorize\api\contract\v1\KeyManagementSchemeType' => $libDir . 'net/authorize/api/contract/v1/KeyManagementSchemeType.php', 'net\authorize\api\contract\v1\KeyValueType' => $libDir . 'net/authorize/api/contract/v1/KeyValueType.php', 'net\authorize\api\contract\v1\LineItemType' => $libDir . 'net/authorize/api/contract/v1/LineItemType.php', 'net\authorize\api\contract\v1\LogoutRequest' => $libDir . 'net/authorize/api/contract/v1/LogoutRequest.php', 'net\authorize\api\contract\v1\LogoutResponse' => $libDir . 'net/authorize/api/contract/v1/LogoutResponse.php', 'net\authorize\api\contract\v1\MerchantAuthenticationType' => $libDir . 'net/authorize/api/contract/v1/MerchantAuthenticationType.php', 'net\authorize\api\contract\v1\MerchantContactType' => $libDir . 'net/authorize/api/contract/v1/MerchantContactType.php', 'net\authorize\api\contract\v1\MessagesType' => $libDir . 'net/authorize/api/contract/v1/MessagesType.php', 'net\authorize\api\contract\v1\MobileDeviceLoginRequest' => $libDir . 'net/authorize/api/contract/v1/MobileDeviceLoginRequest.php', 'net\authorize\api\contract\v1\MobileDeviceLoginResponse' => $libDir . 'net/authorize/api/contract/v1/MobileDeviceLoginResponse.php', 'net\authorize\api\contract\v1\MobileDeviceRegistrationRequest' => $libDir . 'net/authorize/api/contract/v1/MobileDeviceRegistrationRequest.php', 'net\authorize\api\contract\v1\MobileDeviceRegistrationResponse' => $libDir . 'net/authorize/api/contract/v1/MobileDeviceRegistrationResponse.php', 'net\authorize\api\contract\v1\MobileDeviceType' => $libDir . 'net/authorize/api/contract/v1/MobileDeviceType.php', 'net\authorize\api\contract\v1\NameAndAddressType' => $libDir . 'net/authorize/api/contract/v1/NameAndAddressType.php', 'net\authorize\api\contract\v1\OpaqueDataType' => $libDir . 'net/authorize/api/contract/v1/OpaqueDataType.php', 'net\authorize\api\contract\v1\OrderExType' => $libDir . 'net/authorize/api/contract/v1/OrderExType.php', 'net\authorize\api\contract\v1\OrderType' => $libDir . 'net/authorize/api/contract/v1/OrderType.php', 'net\authorize\api\contract\v1\PagingType' => $libDir . 'net/authorize/api/contract/v1/PagingType.php', 'net\authorize\api\contract\v1\PaymentDetailsType' => $libDir . 'net/authorize/api/contract/v1/PaymentDetailsType.php', 'net\authorize\api\contract\v1\PaymentMaskedType' => $libDir . 'net/authorize/api/contract/v1/PaymentMaskedType.php', 'net\authorize\api\contract\v1\PaymentProfileType' => $libDir . 'net/authorize/api/contract/v1/PaymentProfileType.php', 'net\authorize\api\contract\v1\PaymentScheduleType' => $libDir . 'net/authorize/api/contract/v1/PaymentScheduleType.php', 'net\authorize\api\contract\v1\PaymentSimpleType' => $libDir . 'net/authorize/api/contract/v1/PaymentSimpleType.php', 'net\authorize\api\contract\v1\PaymentType' => $libDir . 'net/authorize/api/contract/v1/PaymentType.php', 'net\authorize\api\contract\v1\PayPalType' => $libDir . 'net/authorize/api/contract/v1/PayPalType.php', 'net\authorize\api\contract\v1\PermissionType' => $libDir . 'net/authorize/api/contract/v1/PermissionType.php', 'net\authorize\api\contract\v1\ProcessorType.php' => $libDir . 'net/authorize/api/contract/v1/ProcessorType.php', 'net\authorize\api\contract\v1\ProfileTransactionType' => $libDir . 'net/authorize/api/contract/v1/ProfileTransactionType.php', 'net\authorize\api\contract\v1\ProfileTransAmountType' => $libDir . 'net/authorize/api/contract/v1/ProfileTransAmountType.php', 'net\authorize\api\contract\v1\ProfileTransAuthCaptureType' => $libDir . 'net/authorize/api/contract/v1/ProfileTransAuthCaptureType.php', 'net\authorize\api\contract\v1\ProfileTransAuthOnlyType' => $libDir . 'net/authorize/api/contract/v1/ProfileTransAuthOnlyType.php', 'net\authorize\api\contract\v1\ProfileTransCaptureOnlyType' => $libDir . 'net/authorize/api/contract/v1/ProfileTransCaptureOnlyType.php', 'net\authorize\api\contract\v1\ProfileTransOrderType' => $libDir . 'net/authorize/api/contract/v1/ProfileTransOrderType.php', 'net\authorize\api\contract\v1\ProfileTransPriorAuthCaptureType' => $libDir . 'net/authorize/api/contract/v1/ProfileTransPriorAuthCaptureType.php', 'net\authorize\api\contract\v1\ProfileTransRefundType' => $libDir . 'net/authorize/api/contract/v1/ProfileTransRefundType.php', 'net\authorize\api\contract\v1\ProfileTransVoidType' => $libDir . 'net/authorize/api/contract/v1/ProfileTransVoidType.php', 'net\authorize\api\contract\v1\ReturnedItemType' => $libDir . 'net/authorize/api/contract/v1/ReturnedItemType.php', 'net\authorize\api\contract\v1\SearchCriteriaCustomerProfileType' => $libDir . 'net/authorize/api/contract/v1/SearchCriteriaCustomerProfileType.php', 'net\authorize\api\contract\v1\SendCustomerTransactionReceiptRequest' => $libDir . 'net/authorize/api/contract/v1/SendCustomerTransactionReceiptRequest.php', 'net\authorize\api\contract\v1\SendCustomerTransactionReceiptResponse' => $libDir . 'net/authorize/api/contract/v1/SendCustomerTransactionReceiptResponse.php', 'net\authorize\api\contract\v1\SettingType' => $libDir . 'net/authorize/api/contract/v1/SettingType.php', 'net\authorize\api\contract\v1\SolutionType' => $libDir . 'net/authorize/api/contract/v1/SolutionType.php', 'net\authorize\api\contract\v1\SubscriptionCustomerProfileType' => $libDir . 'net/authorize/api/contract/v1/SubscriptionCustomerProfileType.php', 'net\authorize\api\contract\v1\SubscriptionDetailType' => $libDir . 'net/authorize/api/contract/v1/SubscriptionDetailType.php', 'net\authorize\api\contract\v1\SubscriptionPaymentType' => $libDir . 'net/authorize/api/contract/v1/SubscriptionPaymentType.php', 'net\authorize\api\contract\v1\TokenMaskedType' => $libDir . 'net/authorize/api/contract/v1/TokenMaskedType.php', 'net\authorize\api\contract\v1\TransactionDetailsType' => $libDir . 'net/authorize/api/contract/v1/TransactionDetailsType.php', 'net\authorize\api\contract\v1\TransactionListSortingType.php' => $libDir . 'net/authorize/api/contract/v1/TransactionListSortingType.php', 'net\authorize\api\contract\v1\TransactionRequestType' => $libDir . 'net/authorize/api/contract/v1/TransactionRequestType.php', 'net\authorize\api\contract\v1\TransactionResponseType' => $libDir . 'net/authorize/api/contract/v1/TransactionResponseType.php', 'net\authorize\api\contract\v1\TransactionSummaryType' => $libDir . 'net/authorize/api/contract/v1/TransactionSummaryType.php', 'net\authorize\api\contract\v1\TransRetailInfoType' => $libDir . 'net/authorize/api/contract/v1/TransRetailInfoType.php', 'net\authorize\api\contract\v1\UpdateCustomerPaymentProfileRequest' => $libDir . 'net/authorize/api/contract/v1/UpdateCustomerPaymentProfileRequest.php', 'net\authorize\api\contract\v1\UpdateCustomerPaymentProfileResponse' => $libDir . 'net/authorize/api/contract/v1/UpdateCustomerPaymentProfileResponse.php', 'net\authorize\api\contract\v1\UpdateCustomerProfileRequest' => $libDir . 'net/authorize/api/contract/v1/UpdateCustomerProfileRequest.php', 'net\authorize\api\contract\v1\UpdateCustomerProfileResponse' => $libDir . 'net/authorize/api/contract/v1/UpdateCustomerProfileResponse.php', 'net\authorize\api\contract\v1\UpdateCustomerShippingAddressRequest' => $libDir . 'net/authorize/api/contract/v1/UpdateCustomerShippingAddressRequest.php', 'net\authorize\api\contract\v1\UpdateCustomerShippingAddressResponse' => $libDir . 'net/authorize/api/contract/v1/UpdateCustomerShippingAddressResponse.php', 'net\authorize\api\contract\v1\UpdateHeldTransactionRequest.php' => $libDir . 'net/authorize/api/contract/v1/UpdateHeldTransactionRequest.php', 'net\authorize\api\contract\v1\UpdateHeldTransactionResponse.php' => $libDir . 'net/authorize/api/contract/v1/UpdateHeldTransactionResponse.php', 'net\authorize\api\contract\v1\UpdateSplitTenderGroupRequest' => $libDir . 'net/authorize/api/contract/v1/UpdateSplitTenderGroupRequest.php', 'net\authorize\api\contract\v1\UpdateSplitTenderGroupResponse' => $libDir . 'net/authorize/api/contract/v1/UpdateSplitTenderGroupResponse.php', 'net\authorize\api\contract\v1\UserFieldType' => $libDir . 'net/authorize/api/contract/v1/UserFieldType.php', 'net\authorize\api\contract\v1\ValidateCustomerPaymentProfileRequest' => $libDir . 'net/authorize/api/contract/v1/ValidateCustomerPaymentProfileRequest.php', 'net\authorize\api\contract\v1\ValidateCustomerPaymentProfileResponse' => $libDir . 'net/authorize/api/contract/v1/ValidateCustomerPaymentProfileResponse.php', 'net\authorize\api\contract\v1\KeyManagementSchemeType\DUKPTAType' => $libDir . 'net/authorize/api/contract/v1/KeyManagementSchemeType/DUKPTAType.php', 'net\authorize\api\contract\v1\KeyManagementSchemeType\DUKPTAType\DeviceInfoAType' => $libDir . 'net/authorize/api/contract/v1/KeyManagementSchemeType/DUKPTAType/DeviceInfoAType.php', 'net\authorize\api\contract\v1\KeyManagementSchemeType\DUKPTAType\EncryptedDataAType' => $libDir . 'net/authorize/api/contract/v1/KeyManagementSchemeType/DUKPTAType/EncryptedDataAType.php', 'net\authorize\api\contract\v1\KeyManagementSchemeType\DUKPTAType\ModeAType' => $libDir . 'net/authorize/api/contract/v1/KeyManagementSchemeType/DUKPTAType/ModeAType.php', 'net\authorize\api\contract\v1\MessagesType\MessageAType' => $libDir . 'net/authorize/api/contract/v1/MessagesType/MessageAType.php', 'net\authorize\api\contract\v1\PaymentScheduleType\IntervalAType' => $libDir . 'net/authorize/api/contract/v1/PaymentScheduleType/IntervalAType.php', 'net\authorize\api\contract\v1\TransactionRequestType\UserFieldsAType' => $libDir . 'net/authorize/api/contract/v1/TransactionRequestType/UserFieldsAType.php', 'net\authorize\api\contract\v1\TransactionResponseType\ErrorsAType' => $libDir . 'net/authorize/api/contract/v1/TransactionResponseType/ErrorsAType.php', 'net\authorize\api\contract\v1\TransactionResponseType\MessagesAType' => $libDir . 'net/authorize/api/contract/v1/TransactionResponseType/MessagesAType.php', 'net\authorize\api\contract\v1\TransactionResponseType\PrePaidCardAType' => $libDir . 'net/authorize/api/contract/v1/TransactionResponseType/PrePaidCardAType.php', 'net\authorize\api\contract\v1\TransactionResponseType\SecureAcceptanceAType' => $libDir . 'net/authorize/api/contract/v1/TransactionResponseType/SecureAcceptanceAType.php', 'net\authorize\api\contract\v1\TransactionResponseType\SplitTenderPaymentsAType' => $libDir . 'net/authorize/api/contract/v1/TransactionResponseType/SplitTenderPaymentsAType.php', 'net\authorize\api\contract\v1\TransactionResponseType\UserFieldsAType' => $libDir . 'net/authorize/api/contract/v1/TransactionResponseType/UserFieldsAType.php', 'net\authorize\api\contract\v1\TransactionResponseType\ErrorsAType\ErrorAType' => $libDir . 'net/authorize/api/contract/v1/TransactionResponseType/ErrorsAType/ErrorAType.php', 'net\authorize\api\contract\v1\TransactionResponseType\MessagesAType\MessageAType' => $libDir . 'net/authorize/api/contract/v1/TransactionResponseType/MessagesAType/MessageAType.php', 'net\authorize\api\contract\v1\TransactionResponseType\SplitTenderPaymentsAType\SplitTenderPaymentAType' => $libDir . 'net/authorize/api/contract/v1/TransactionResponseType/SplitTenderPaymentsAType/SplitTenderPaymentAType.php', 'net\authorize\api\contract\v1\GetAUJobSummaryRequest' => $libDir . 'net/authorize/api/contract/v1/getAUJobSummaryRequest.php', 'net\authorize\api\contract\v1\GetAUJobSummaryResponse' => $libDir . 'net/authorize/api/contract/v1/GetAUJobSummaryResponse.php', 'net\authorize\api\contract\v1\GetAUJobDetailsRequest' => $libDir . 'net/authorize/api/contract/v1/GetAUJobDetailsRequest.php', 'net\authorize\api\contract\v1\GetAUJobDetailsResponse' => $libDir . 'net/authorize/api/contract/v1/GetAUJobDetailsResponse.php', 'net\authorize\api\contract\v1\AuDeleteType' => $libDir . 'net/authorize/api/contract/v1/AuDeleteType.php', 'net\authorize\api\contract\v1\AuDetailsType' => $libDir . 'net/authorize/api/contract/v1/AuDetailsType.php', 'net\authorize\api\contract\v1\AuResponseType' => $libDir . 'net/authorize/api/contract/v1/AuResponseType.php', 'net\authorize\api\contract\v1\AuUpdateType' => $libDir . 'net/authorize/api/contract/v1/AuUpdateType.php', 'net\authorize\api\contract\v1\ListOfAUDetailsType' => $libDir . 'net/authorize/api/contract/v1/ListOfAUDetailsType.php', 'net\authorize\api\contract\v1\EmvTagType' => $libDir . 'net/authorize/api/contract/v1/EmvTagType.php', 'net\authorize\api\contract\v1\PaymentEmvType' => $libDir . 'net/authorize/api/contract/v1/PaymentEmvType.php', //Controllers 'net\authorize\api\controller\ARBCancelSubscriptionController' => $libDir . 'net/authorize/api/controller/ARBCancelSubscriptionController.php', 'net\authorize\api\controller\ARBCreateSubscriptionController' => $libDir . 'net/authorize/api/controller/ARBCreateSubscriptionController.php', 'net\authorize\api\controller\ARBGetSubscriptionController' => $libDir . 'net/authorize/api/controller/ARBGetSubscriptionController.php', 'net\authorize\api\controller\ARBGetSubscriptionListController' => $libDir . 'net/authorize/api/controller/ARBGetSubscriptionListController.php', 'net\authorize\api\controller\ARBGetSubscriptionStatusController' => $libDir . 'net/authorize/api/controller/ARBGetSubscriptionStatusController.php', 'net\authorize\api\controller\ARBUpdateSubscriptionController' => $libDir . 'net/authorize/api/controller/ARBUpdateSubscriptionController.php', 'net\authorize\api\controller\AuthenticateTestController' => $libDir . 'net/authorize/api/controller/AuthenticateTestController.php', 'net\authorize\api\controller\CreateCustomerPaymentProfileController' => $libDir . 'net/authorize/api/controller/CreateCustomerPaymentProfileController.php', 'net\authorize\api\controller\CreateCustomerProfileController' => $libDir . 'net/authorize/api/controller/CreateCustomerProfileController.php', 'net\authorize\api\controller\CreateCustomerProfileFromTransactionController' => $libDir . 'net/authorize/api/controller/CreateCustomerProfileFromTransactionController.php', 'net\authorize\api\controller\CreateCustomerProfileTransactionController' => $libDir . 'net/authorize/api/controller/CreateCustomerProfileTransactionController.php', 'net\authorize\api\controller\CreateCustomerShippingAddressController' => $libDir . 'net/authorize/api/controller/CreateCustomerShippingAddressController.php', 'net\authorize\api\controller\CreateTransactionController' => $libDir . 'net/authorize/api/controller/CreateTransactionController.php', 'net\authorize\api\controller\DecryptPaymentDataController' => $libDir . 'net/authorize/api/controller/DecryptPaymentDataController.php', 'net\authorize\api\controller\DeleteCustomerPaymentProfileController' => $libDir . 'net/authorize/api/controller/DeleteCustomerPaymentProfileController.php', 'net\authorize\api\controller\DeleteCustomerProfileController' => $libDir . 'net/authorize/api/controller/DeleteCustomerProfileController.php', 'net\authorize\api\controller\DeleteCustomerShippingAddressController' => $libDir . 'net/authorize/api/controller/DeleteCustomerShippingAddressController.php', 'net\authorize\api\controller\GetBatchStatisticsController' => $libDir . 'net/authorize/api/controller/GetBatchStatisticsController.php', 'net\authorize\api\controller\GetCustomerPaymentProfileController' => $libDir . 'net/authorize/api/controller/GetCustomerPaymentProfileController.php', 'net\authorize\api\controller\GetCustomerPaymentProfileListController' => $libDir . 'net/authorize/api/controller/GetCustomerPaymentProfileListController.php', 'net\authorize\api\controller\GetCustomerProfileController' => $libDir . 'net/authorize/api/controller/GetCustomerProfileController.php', 'net\authorize\api\controller\GetCustomerProfileIdsController' => $libDir . 'net/authorize/api/controller/GetCustomerProfileIdsController.php', 'net\authorize\api\controller\GetCustomerShippingAddressController' => $libDir . 'net/authorize/api/controller/GetCustomerShippingAddressController.php', 'net\authorize\api\controller\GetHostedPaymentPageController' => $libDir . 'net/authorize/api/controller/GetHostedPaymentPageController.php', 'net\authorize\api\controller\GetHostedProfilePageController' => $libDir . 'net/authorize/api/controller/GetHostedProfilePageController.php', 'net\authorize\api\controller\GetMerchantDetailsController' => $libDir . 'net/authorize/api/controller/GetMerchantDetailsController.php', 'net\authorize\api\controller\GetSettledBatchListController' => $libDir . 'net/authorize/api/controller/GetSettledBatchListController.php', 'net\authorize\api\controller\GetTransactionDetailsController' => $libDir . 'net/authorize/api/controller/GetTransactionDetailsController.php', 'net\authorize\api\controller\GetTransactionListController' => $libDir . 'net/authorize/api/controller/GetTransactionListController.php', 'net\authorize\api\controller\GetUnsettledTransactionListController' => $libDir . 'net/authorize/api/controller/GetUnsettledTransactionListController.php', 'net\authorize\api\controller\IsAliveController' => $libDir . 'net/authorize/api/controller/IsAliveController.php', 'net\authorize\api\controller\LogoutController' => $libDir . 'net/authorize/api/controller/LogoutController.php', 'net\authorize\api\controller\MobileDeviceLoginController' => $libDir . 'net/authorize/api/controller/MobileDeviceLoginController.php', 'net\authorize\api\controller\MobileDeviceRegistrationController' => $libDir . 'net/authorize/api/controller/MobileDeviceRegistrationController.php', 'net\authorize\api\controller\SendCustomerTransactionReceiptController' => $libDir . 'net/authorize/api/controller/SendCustomerTransactionReceiptController.php', 'net\authorize\api\controller\UpdateCustomerPaymentProfileController' => $libDir . 'net/authorize/api/controller/UpdateCustomerPaymentProfileController.php', 'net\authorize\api\controller\UpdateCustomerProfileController' => $libDir . 'net/authorize/api/controller/UpdateCustomerProfileController.php', 'net\authorize\api\controller\UpdateCustomerShippingAddressController' => $libDir . 'net/authorize/api/controller/UpdateCustomerShippingAddressController.php', 'net\authorize\api\controller\UpdateHeldTransactionController' => $libDir . 'net/authorize/api/controller/UpdateHeldTransactionController.php', 'net\authorize\api\controller\UpdateSplitTenderGroupController' => $libDir . 'net/authorize/api/controller/UpdateSplitTenderGroupController.php', 'net\authorize\api\controller\ValidateCustomerPaymentProfileController' => $libDir . 'net/authorize/api/controller/ValidateCustomerPaymentProfileController.php', 'net\authorize\api\controller\GetAUJobDetailsController' => $libDir . 'net/authorize/api/controller/GetAUJobDetailsController.php', 'net\authorize\api\controller\GetAUJobSummaryController' => $libDir . 'net/authorize/api/controller/GetAUJobSummaryController.php' );
kotsios5/common
vendor/authorize/classmap.php
PHP
gpl-3.0
59,484
/* Copyright (c) 2001-2011, The HSQL Development Group * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * Neither the name of the HSQL Development Group nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG, * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.hsqldb; import org.hsqldb.HsqlNameManager.HsqlName; import org.hsqldb.error.Error; import org.hsqldb.error.ErrorCode; import org.hsqldb.index.Index; import org.hsqldb.lib.ArrayUtil; import org.hsqldb.navigator.RowIterator; import org.hsqldb.persist.PersistentStore; import org.hsqldb.types.Type; /** * The base of all HSQLDB table implementations. * * @author Fred Toussi (fredt@users dot sourceforge.net) * @version 2.2.7 * @since 1.7.2 */ public class TableBase { // types of table public static final int INFO_SCHEMA_TABLE = 1; public static final int SYSTEM_SUBQUERY = 2; public static final int TEMP_TABLE = 3; public static final int MEMORY_TABLE = 4; public static final int CACHED_TABLE = 5; public static final int TEMP_TEXT_TABLE = 6; public static final int TEXT_TABLE = 7; public static final int VIEW_TABLE = 8; public static final int RESULT_TABLE = 9; public static final int TRANSITION_TABLE = 10; public static final int FUNCTION_TABLE = 11; public static final int SYSTEM_TABLE = 12; public static final int CHANGE_SET_TABLE = 13; // public static final int SCOPE_STATEMENT = 21; public static final int SCOPE_TRANSACTION = 22; public static final int SCOPE_SESSION = 23; public static final int SCOPE_FULL = 24; // public PersistentStore store; public int persistenceScope; public long persistenceId; // columns in table int[] primaryKeyCols; // column numbers for primary key Type[] primaryKeyTypes; int[] primaryKeyColsSequence; // {0,1,2,...} // // Index[] indexList; // first index is the primary key index public Database database; int[] bestRowIdentifierCols; // column set for best index boolean bestRowIdentifierStrict; // true if it has no nullable column int[] bestIndexForColumn; // index of the 'best' index for each column Index bestIndex; // the best index overall - null if there is no user-defined index Index fullIndex; // index on all columns boolean[] colNotNull; // nullability Type[] colTypes; // types of columns protected int columnCount; // int tableType; protected boolean isReadOnly; protected boolean isTemp; protected boolean isCached; protected boolean isText; boolean isView; protected boolean isWithDataSource; public boolean isSessionBased; protected boolean isSchemaBased; protected boolean isLogged; private boolean isTransactional = true; boolean hasLobColumn; long dataTimestamp; // TableBase() {} // public TableBase(Session session, Database database, int scope, int type, Type[] colTypes) { tableType = type; persistenceScope = scope; isSessionBased = true; persistenceId = database.persistentStoreCollection.getNextId(); this.database = database; this.colTypes = colTypes; columnCount = colTypes.length; primaryKeyCols = new int[]{}; primaryKeyTypes = new Type[]{}; indexList = new Index[0]; createPrimaryIndex(primaryKeyCols, primaryKeyTypes, null); } public TableBase duplicate() { TableBase copy = new TableBase(); copy.tableType = tableType; copy.persistenceScope = persistenceScope; copy.isSessionBased = isSessionBased; copy.persistenceId = database.persistentStoreCollection.getNextId(); copy.database = database; copy.colTypes = colTypes; copy.columnCount = columnCount; copy.primaryKeyCols = primaryKeyCols; copy.primaryKeyTypes = primaryKeyTypes; copy.indexList = indexList; return copy; } public final int getTableType() { return tableType; } public long getPersistenceId() { return persistenceId; } int getId() { return 0; } public final boolean onCommitPreserve() { return persistenceScope == TableBase.SCOPE_SESSION; } public final RowIterator rowIterator(Session session) { PersistentStore store = getRowStore(session); return getPrimaryIndex().firstRow(session, store); } public final RowIterator rowIterator(PersistentStore store) { return getPrimaryIndex().firstRow(store); } public final int getIndexCount() { return indexList.length; } public final Index getPrimaryIndex() { return indexList.length > 0 ? indexList[0] : null; } public final Type[] getPrimaryKeyTypes() { return primaryKeyTypes; } public final boolean hasPrimaryKey() { return !(primaryKeyCols.length == 0); } public final int[] getPrimaryKey() { return primaryKeyCols; } /** * Returns an array of Type indicating the SQL type of the columns */ public final Type[] getColumnTypes() { return colTypes; } /** * Returns an index on all the columns */ public Index getFullIndex() { return fullIndex; } /** * Returns the Index object at the given index */ public final Index getIndex(int i) { return indexList[i]; } /** * Returns the indexes */ public final Index[] getIndexList() { return indexList; } /** * Returns empty boolean array. */ public final boolean[] getNewColumnCheckList() { return new boolean[getColumnCount()]; } /** * Returns the count of all visible columns. */ public int getColumnCount() { return columnCount; } /** * Returns the count of all columns. */ public final int getDataColumnCount() { return colTypes.length; } public boolean isTransactional() { return isTransactional; } public void setTransactional(boolean value) { isTransactional = value; } /** * This method is called whenever there is a change to table structure and * serves two porposes: (a) to reset the best set of columns that identify * the rows of the table (b) to reset the best index that can be used * to find rows of the table given a column value. * * (a) gives most weight to a primary key index, followed by a unique * address with the lowest count of nullable columns. Otherwise there is * no best row identifier. * * (b) finds for each column an index with a corresponding first column. * It uses any type of visible index and accepts the one with the largest * column count. * * bestIndex is the user defined, primary key, the first unique index, or * the first non-unique index. NULL if there is no user-defined index. * */ public final void setBestRowIdentifiers() { int[] briCols = null; int briColsCount = 0; boolean isStrict = false; int nNullCount = 0; // ignore if called prior to completion of primary key construction if (colNotNull == null) { return; } bestIndex = null; bestIndexForColumn = new int[colTypes.length]; ArrayUtil.fillArray(bestIndexForColumn, -1); for (int i = 0; i < indexList.length; i++) { Index index = indexList[i]; int[] cols = index.getColumns(); int colsCount = index.getColumnCount(); if (colsCount == 0) { continue; } if (i == 0) { isStrict = true; } if (bestIndexForColumn[cols[0]] == -1) { bestIndexForColumn[cols[0]] = i; } else { Index existing = indexList[bestIndexForColumn[cols[0]]]; if (colsCount > existing.getColumns().length) { bestIndexForColumn[cols[0]] = i; } } if (!index.isUnique()) { if (bestIndex == null) { bestIndex = index; } continue; } int nnullc = 0; for (int j = 0; j < colsCount; j++) { if (colNotNull[cols[j]]) { nnullc++; } } if (bestIndex != null) { bestIndex = index; } if (nnullc == colsCount) { if (briCols == null || briColsCount != nNullCount || colsCount < briColsCount) { // nothing found before || // found but has null columns || // found but has more columns than this index briCols = cols; briColsCount = colsCount; nNullCount = colsCount; isStrict = true; } continue; } else if (isStrict) { continue; } else if (briCols == null || colsCount < briColsCount || nnullc > nNullCount) { // nothing found before || // found but has more columns than this index|| // found but has fewer not null columns than this index briCols = cols; briColsCount = colsCount; nNullCount = nnullc; } } if (briCols == null || briColsCount == briCols.length) { bestRowIdentifierCols = briCols; } else { bestRowIdentifierCols = ArrayUtil.arraySlice(briCols, 0, briColsCount); } bestRowIdentifierStrict = isStrict; if (indexList[0].getColumnCount() > 0) { bestIndex = indexList[0]; } } public final void createPrimaryIndex(int[] pkcols, Type[] pktypes, HsqlName name) { long id = database.persistentStoreCollection.getNextId(); Index newIndex = database.logger.newIndex(name, id, this, pkcols, null, null, pktypes, true, pkcols.length > 0, pkcols.length > 0, false); try { addIndex(newIndex); } catch (HsqlException e) {} } public final Index createAndAddIndexStructure(HsqlName name, int[] columns, boolean[] descending, boolean[] nullsLast, boolean unique, boolean constraint, boolean forward) { Index newindex = createIndexStructure(name, columns, descending, nullsLast, unique, constraint, forward); addIndex(newindex); return newindex; } final Index createIndexStructure(HsqlName name, int[] columns, boolean[] descending, boolean[] nullsLast, boolean unique, boolean constraint, boolean forward) { if (primaryKeyCols == null) { throw Error.runtimeError(ErrorCode.U_S0500, "createIndex"); } int s = columns.length; int[] cols = new int[s]; Type[] types = new Type[s]; for (int j = 0; j < s; j++) { cols[j] = columns[j]; types[j] = colTypes[cols[j]]; } long id = database.persistentStoreCollection.getNextId(); Index newIndex = database.logger.newIndex(name, id, this, cols, descending, nullsLast, types, false, unique, constraint, forward); return newIndex; } /** * Performs Table structure modification and changes to the index nodes * to remove a given index from a MEMORY or TEXT table. Not for PK index. * */ public void dropIndex(int todrop) { indexList = (Index[]) ArrayUtil.toAdjustedArray(indexList, null, todrop, -1); for (int i = 0; i < indexList.length; i++) { indexList[i].setPosition(i); } setBestRowIdentifiers(); if (store != null) { store.resetAccessorKeys(indexList); } } final void addIndex(Index index) { int i = 0; for (; i < indexList.length; i++) { Index current = indexList[i]; int order = index.getIndexOrderValue() - current.getIndexOrderValue(); if (order < 0) { break; } } indexList = (Index[]) ArrayUtil.toAdjustedArray(indexList, index, i, 1); for (i = 0; i < indexList.length; i++) { indexList[i].setPosition(i); } if (store != null) { try { store.resetAccessorKeys(indexList); } catch (HsqlException e) { indexList = (Index[]) ArrayUtil.toAdjustedArray(indexList, null, index.getPosition(), -1); for (i = 0; i < indexList.length; i++) { indexList[i].setPosition(i); } throw e; } } setBestRowIdentifiers(); } final void removeIndex(int position) { setBestRowIdentifiers(); } public final void setIndexes(Index[] indexes) { this.indexList = indexes; } public final Object[] getEmptyRowData() { return new Object[getDataColumnCount()]; } /** * Create new memory-resident index. For MEMORY and TEXT tables. */ public final Index createIndex(Session session, HsqlName name, int[] columns, boolean[] descending, boolean[] nullsLast, boolean unique, boolean constraint, boolean forward) { Index newIndex = createAndAddIndexStructure(name, columns, descending, nullsLast, unique, constraint, forward); return newIndex; } public void clearAllData(Session session) { PersistentStore store = getRowStore(session); store.removeAll(); } public void clearAllData(PersistentStore store) { store.removeAll(); } /** * @todo - this is wrong, as it returns true when table has no rows, * but not where it has rows that are not visible by session * Returns true if the table has any rows at all. */ public final boolean isEmpty(Session session) { if (getIndexCount() == 0) { return true; } PersistentStore store = getRowStore(session); return getIndex(0).isEmpty(store); } public PersistentStore getRowStore(Session session) { return store == null ? session.sessionData.persistentStoreCollection.getStore(this) : store; } public void setDataTimestamp(long timestamp) { // no op } }
ggorsontanguy/pocHSQLDB
hsqldb-2.2.9/hsqldb/src/org/hsqldb/TableBase.java
Java
gpl-3.0
17,056
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("e8")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("e8")] [assembly: AssemblyCopyright("Copyright © 2018")] [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("a52a6823-632b-49b0-923a-6a025f5adcbd")] // 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")]
ozanoner/myb
myp242/w1/e8/Properties/AssemblyInfo.cs
C#
gpl-3.0
1,375
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://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/html; charset=utf-8" /> <title>Aquo Events</title> <script src="../../../includes/xpath.js" type="text/javascript"></script> <script src="../../../includes/SpryData.js" type="text/javascript"></script> <script type="text/javascript"> <!-- var dsUpdate = new Spry.Data.XMLDataSet(null, "//update", { entityEncodeStrings: false }); function dsUpdateObserver(notificationType, ds, data) { if (notificationType == "onDataChanged" || notificationType == "onCurrentRowChanged") { var row = ds.getCurrentRow(); if (row) { for (var columnName in row) { if (columnName && !columnName.match(/^ds_/)) { var element = document.getElementById(columnName); if (element) Spry.Utils.setInnerHTML(element, row[columnName]); } } } } } dsUpdate.addObserver(dsUpdateObserver); function LoadURL(url) { // Convert our urls that load full pages, into urls // that load just the parts of the page that are different! // For this demo, we simply map .html to .xml, but you some // developers actually have scripts on the server side that // can serve up both full pages, and HTML fragments. For some // of these server side scripts you simply tack on an extra // query param to the URL that tells the server to give back // the HTML fragments instead of the full page, for example: // // url = url + "?frags=true"; url = url.replace(".html", ".xml"); dsUpdate.setURL(url); dsUpdate.loadData(); } --> </script> </head> <body> <p> <a href="data/AquoThon.html" onclick="LoadURL(this.href); return false;">Aquo-Thon</a> | <a href="data/AquoSwing.html" onclick="LoadURL(this.href); return false;">Aquo Swing</a> | <a href="data/AquoUltraMarathon.html" onclick="LoadURL(this.href); return false;">Aquo Ultra Marathon</a> | <a href="data/AquoExtremeSki.html" onclick="LoadURL(this.href); return false;">Aquo Extreme Ski</a> </p> <div id="event"> <h2 id="header">Aquo-Thon</h2> <div id="content"> <div class="location">Whistler, British Columbia</div> <div class="date">May 26th</div> <p class="description">Join us in Whistler as Extreme Mountain bikers take on the hills and curves of British Columbia.</p> <a href="#">directions...</a> </div> </div> </body> </html>
wasare/sistema-academico-eprotec
lib/Spry/articles/best_practices/samples/pe-08b.html
HTML
gpl-3.0
2,515
<?php namespace TYPO3\TYPO3CR\Command; /* * This file is part of the TYPO3.TYPO3CR package. * * (c) Contributors of the Neos Project - www.neos.io * * This package is Open Source Software. For the full copyright and license * information, please view the LICENSE file which was distributed with this * source code. */ use TYPO3\Flow\Annotations as Flow; use TYPO3\Flow\Cli\ConsoleOutput; use TYPO3\TYPO3CR\Domain\Model\NodeType; /** * An interface for plugins for the NodeCommandController */ interface NodeCommandControllerPluginInterface { /** * Returns a short description for the specific task the plugin solves for the specified command * * @param string $controllerCommandName Name of the command in question, for example "repair" * @return string A brief description / summary for the task this plugin is going to do */ public static function getSubCommandShortDescription($controllerCommandName); /** * Returns a piece of description for the specific task the plugin solves for the specified command * * @param string $controllerCommandName Name of the command in question, for example "repair" * @return string A piece of text to be included in the overall description of the node:xy command */ public static function getSubCommandDescription($controllerCommandName); /** * A method which runs the task implemented by the plugin for the given command * * @param string $controllerCommandName Name of the command in question, for example "repair" * @param ConsoleOutput $output An instance of ConsoleOutput which can be used for output or dialogues * @param NodeType $nodeType Only handle this node type (if specified) * @param string $workspaceName Only handle this workspace (if specified) * @param boolean $dryRun If TRUE, don't do any changes, just simulate what you would do * @param boolean $cleanup If FALSE, cleanup tasks are skipped * @return void */ public function invokeSubCommand($controllerCommandName, ConsoleOutput $output, NodeType $nodeType = null, $workspaceName = 'live', $dryRun = false, $cleanup = true); }
dimaip/neos-development-collection
TYPO3.TYPO3CR/Classes/TYPO3/TYPO3CR/Command/NodeCommandControllerPluginInterface.php
PHP
gpl-3.0
2,176
$(document).ready(function(){ "use strict"; /* Global Variables */ var window_w = $(window).width(); // Window Width var window_h = $(window).height(); // Window Height var window_s = $(window).scrollTop(); // Window Scroll Top var $html = $('html'); // HTML var $body = $('body'); // Body var $header = $('#header'); // Header var $footer = $('#footer'); // Footer // $("body").queryLoader2({ // backgroundColor: '#f2f4f9', // barColor: '#63b2f5', // barHeight: 4, // percentage:false, // deepSearch:true, // minimumTime:1000, // onComplete: function(){ // // $('.animate-onscroll').filter(function(index){ // // return this.offsetTop < (window_s + window_h); // // }).each(function(index, value){ // // var el = $(this); // var el_y = $(this).offset().top; // // if((window_s) > el_y){ // $(el).addClass('animated fadeInDown').removeClass('animate-onscroll'); // setTimeout(function(){ // $(el).css('opacity','1').removeClass('animated fadeInDown'); // },2000); // } // // }); // // } // }); // On Resize $(window).resize(function(){ window_w = $(window).width(); window_h = $(window).height(); window_s = $(window).scrollTop(); }); // On Scroll $(window).scroll(function(){ window_s = $(window).scrollTop(); }); /* Modernizr Fix */ var supportPerspective = Modernizr.testAllProps('perspective'); if(supportPerspective) $html.addClass('csstransforms3d'); else $html.addClass('notcsstransforms3d'); /* Main Functions */ /* Layout Options */ enableStickyHeader(); // Sticky Header enableFullWidth(); // Full Width Section enableTooltips(); // Tooltips //enableContentAnimation(); // Content Animation //enableSpecialCssEffects(); // CSS Animations enableBackToTop(); // Back to top button enableMobileNav(); // Mobile Navigation enableCustomInput(); // Custom Input Styles /* Sliders */ enableFlexSlider(); // FlexSlider enableOwlCarousel(); // Owl Carousel enableRevolutionSlider(); // Revolution Slider /* Social Media Feeds */ //enableFlickrFeed(); // Flickr Feed //enableInstagramFeed(); // Instagram Feed //enableTwitterFeed(); // Twitter Feed /* Elements */ //enableAccordions(); // Accordion //enableTabs(); // Tabs //enableAlertBoxes(); // Alert Boxes //enableProgressbars(); // Progress Bars //enableCustomAudio(); // Custom Audio Player //enableShoppingCart(); // Shopping Cart //enableSocialShare(); // Social Share Buttons /* Other Plugins */ //enableJackBox(); // JackBox Plugin //enableCalendar(); // Full Calendar //enableStarRating(); // Star Rating //enableMixItup(); // MixItUp (Filtering and Sorting) //enableProductSlider(); // ClouZoom Products Slider /* AJAX forms */ //enableContactForm(); // AJAX Contact Form //enableNewsletterForm(); // AJAX Newsletter Form /* ============================== */ /* FUNCTIONS */ /* ============================== */ /* Sticky Header */ function enableStickyHeader(){ var stickyHeader = $body.hasClass('sticky-header-on'); var resolution = 991; if($body.hasClass('tablet-sticky-header')) resolution = 767 if(stickyHeader && window_w > resolution){ $header.addClass('sticky-header'); var header_height = $header.innerHeight(); $body.css('padding-top', header_height+'px'); } $(window).scroll(function(){ animateHeader(); }); $(window).resize(function(){ animateHeader(); if(window_w < resolution){ $header.removeClass('sticky-header').removeClass('animate-header'); $body.css('padding-top', 0+'px'); }else{ $header.addClass('sticky-header'); var header_height = $header.innerHeight(); $body.css('padding-top', header_height+'px'); } }); function animateHeader(){ if(window_s>100){ $('#header.sticky-header').addClass('animate-header'); }else{ $('#header.sticky-header').removeClass('animate-header'); } } } function enableFullWidth(){ // Full Width Elements var $fullwidth_el = $('.full-width, .full-width-slider'); // Set Full Width on resize $(window).resize(function(){ setFullWidth(); }); // Fix Full Width at Window Load $(window).load(function(){ setFullWidth(); }); // Set Full Width Function function setFullWidth(){ $fullwidth_el.each(function(){ var element = $(this); // Reset Styles element.css('margin-left', ''); element.css('width', ''); if(!$body.hasClass('boxed-layout')){ var element_x = element.offset().left; // Set New Styles element.css('margin-left', -element_x+'px'); element.css('width', window_w+'px'); } }); } } /* Flex Slider */ function enableFlexSlider(){ // Main Flexslider $('.main-flexslider').flexslider({ animation: "slide", controlNav: false, prevText: "", nextText: "", }); // Banner Rotator $('.banner-rotator-flexslider').flexslider({ animation: "slide", controlNav: true, directionNav: false, prevText: "", nextText: "", }); // Portfolio Slideshow $('.portfolio-slideshow').flexslider({ animation: "fade", controlNav: false, slideshowSpeed: 4000, prevText: "", nextText: "", }); } /* Revolution Slider */ function enableRevolutionSlider(){ /* Revolution Slider */ $('.tp-banner').not('.full-width-revolution').revolution({ delay:9000, startwidth:1170, startheight:500, hideThumbs:10, navigationType:"none" }); /* Revolution Slider Fullwidth */ $('.tp-banner.full-width-revolution').revolution({ delay:9000, startwidth:1170, startheight:500, hideThumbs:10, navigationType:"none", fullWidth:"on", forceFullWidth:"on" }); } /* Owl Carousel */ function enableOwlCarousel(){ $('.owl-carousel').each(function(){ /* Number Of Items */ var max_items = $(this).attr('data-max-items'); var tablet_items = max_items; if(max_items > 1){ tablet_items = max_items - 1; } var mobile_items = 1; /* Initialize */ $(this).owlCarousel({ items:max_items, pagination : false, itemsDesktop : [1600,max_items], itemsDesktopSmall : [1170,max_items], itemsTablet: [991,tablet_items], itemsMobile: [767,mobile_items], slideSpeed:400 }); var owl = $(this).data('owlCarousel'); // Left Arrow $(this).parent().find('.carousel-arrows span.left-arrow').click(function(e){ owl.prev(); }); // Right Arrow $(this).parent().find('.carousel-arrows span.right-arrow').click(function(e){ owl.next(); }); }); } /* Tooltips */ function enableTooltips(){ // Tooltip on TOP $('.tooltip-ontop').tooltip({ placement: 'top' }); // Tooltip on BOTTOM $('.tooltip-onbottom').tooltip({ placement: 'bottom' }); // Tooltip on LEFT $('.tooltip-onleft').tooltip({ placement: 'left' }); // Tooltip on RIGHT $('.tooltip-onright').tooltip({ placement: 'right' }); } /* Flickr Feed */ function enableFlickrFeed(){ $('.flickr-feed').jflickrfeed({ limit: 6, qstrings: { id: '76745153@N04' }, itemTemplate: '<li>' + '<a href="{{link}}" target="_blank"><img src="{{image_s}}" alt="{{title}}" /></a>' + '</li>' }); } /* Instagram Feed */ function enableInstagramFeed(){ if($('#instagram-feed').length){ var instagram_feed = new Instafeed({ get: 'popular', clientId: '0ce2a8c0d92248cab8d2a9d024f7f3ca', target: 'instagram-feed', template: '<li><a target="_blank" href="{{link}}"><img src="{{image}}" /></a></li>', resolution: 'standard_resolution', limit: 6 }); instagram_feed.run(); } } /* Twitter Feed */ function enableTwitterFeed(){ /* Twitter WIdget */ $('.twitter-widget').tweet({ modpath: 'php/twitter/', count: 1, loading_text: 'Loading twitter feed...', }) /* Twitter Share Button */ !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs'); } /* Content Animation */ function enableContentAnimation(){ if($html.hasClass('cssanimations')){ $('.animate-onscroll').animate({opacity:0},0); $(window).load(function(){ $('.animate-onscroll').filter(function(index){ return this.offsetTop < (window_s + window_h); }).each(function(index, value){ var el = $(this); var el_y = $(this).offset().top; if((window_s) > el_y){ $(el).addClass('animated fadeInDown').removeClass('animate-onscroll').removeClass('animated fadeInDown'); } }); animateOnScroll(); }); $(window).resize(function(){ animateOnScroll(); }); $(window).scroll(function(){ animateOnScroll(); }); } // Start Animation When Element is scrolled function animateOnScroll(){ $('.animate-onscroll').filter(function(index){ return this.offsetTop < (window_s + window_h); }).each(function(index, value){ var el = $(this); var el_y = $(this).offset().top; if((window_s + window_h) > el_y){ setTimeout(function(){ $(el).addClass('animated fadeInDown'); setTimeout(function(){ $(el).removeClass('animate-onscroll'); }, 500); setTimeout(function(){ $(el).css('opacity','1').removeClass('animated fadeInDown'); },2000); },index*200); } }); } } /* Special CSS Effects */ function enableSpecialCssEffects(){ /* Sidebar Banner Hover Effect */ $('.banner').each(function(){ var new_icon = $(this).find('.icons').clone().addClass('icons-fadeout'); $(this).prepend($(new_icon)); }); /* Firefox Pricing Tables Height Fix */ $(window).load(function(){ fixPricingTables(); }); $(window).resize(function(){ fixPricingTables(); }); /* Fix Pricing Tables */ function fixPricingTables(){ $('.pricing-tables').each(function(){ $(this).find('.pricing-table').attr('style', ''); if(window_w > 767){ var pricing_tables_h = $(this).height(); $(this).find('.pricing-table').innerHeight(pricing_tables_h); } }); } /* Sorting Float Fix */ $(window).load(function(){ mediaSortFix(); }); $(window).resize(function(){ mediaSortFix(); }); function mediaSortFix(){ if(window_w > 767){ var media_item_height = 0; $('.media-items .mix').css('height',''); $('.media-items .mix').each(function(){ if($(this).height() > media_item_height) media_item_height = $(this).height(); }); $('.media-items .mix').height(media_item_height); }else{ $('.media-items .mix').css('height',''); } } } /* Back To Top Button */ function enableBackToTop(){ $('#button-to-top').hide(); /* Show/Hide button */ $(window).scroll(function(){ if(window_s > 100 && window_w > 991){ $('#button-to-top').fadeIn(300); }else{ $('#button-to-top').fadeOut(300); } }); $('#button-to-top').click(function(e){ e.preventDefault(); $('body,html').animate({scrollTop:0}, 600); }); } /* Mobile Navigation */ function enableMobileNav(){ /* Menu Button */ $('#menu-button').click(function(){ if(!$('#navigation').hasClass('navigation-opened')){ $('#navigation').slideDown(500).addClass('navigation-opened'); }else{ $('#navigation').slideUp(500).removeClass('navigation-opened'); } }); /* On Resize */ $(window).resize(function(){ if(window_w > 991){ $('#navigation').show().attr('style','').removeClass('navigation-opened'); } }); /* Dropdowns */ $('#navigation li').each(function(){ if($(this).find('ul').length > 0){ $(this).append('<div class="dropdown-button"></div>'); } }); $('#navigation .dropdown-button').click(function(){ $(this).parent().toggleClass('dropdown-opened').find('>ul').slideToggle(300); }); } /* Custom Input Styles */ function enableCustomInput(){ /* Chosen Select Box */ var config = { '.chosen-select' : {disable_search_threshold:10, width:'100%'} } for (var selector in config) { $(selector).chosen(config[selector]); } /* Numeric Input */ $('.numeric-input').each(function(){ $(this).wrap('<div class="numeric-input-holder"></div>'); $(this).parent().prepend('<div class="decrease-button"></div>'); $(this).parent().append('<div class="increase-button"></div>'); // Decrease Button $(this).parent().find('.decrease-button').click(function(){ var value = parseInt($(this).parent().find('.numeric-input').val()); value--; $(this).parent().find('.numeric-input').val(value); }); // Increase Button $(this).parent().find('.increase-button').click(function(){ var value = parseInt($(this).parent().find('.numeric-input').val()); value++; $(this).parent().find('.numeric-input').val(value); }); // Prevent Not A Number(NaN) Value $(this).keypress(function(e){ var value = parseInt(String.fromCharCode(e.which)); if(isNaN(value)){ e.preventDefault(); } }); }); } /* JackBox Plugin */ function enableJackBox(){ $(window).load(function(){ jQuery(".jackbox[data-group]").jackBox("init", { deepLinking: false }); }); } /* Accordions */ function enableAccordions(){ $('.accordions').each(function(){ // Set First Accordion As Active $(this).find('.accordion-content').hide(); if(!$(this).hasClass('toggles')){ $(this).find('.accordion:first-child').addClass('accordion-active'); $(this).find('.accordion:first-child .accordion-content').show(); } // Set Accordion Events $(this).find('.accordion-header').click(function(){ if(!$(this).parent().hasClass('accordion-active')){ // Close other accordions if(!$(this).parent().parent().hasClass('toggles')){ $(this).parent().parent().find('.accordion-active').removeClass('accordion-active').find('.accordion-content').slideUp(300); } // Open Accordion $(this).parent().addClass('accordion-active'); $(this).parent().find('.accordion-content').slideDown(300); }else{ // Close Accordion $(this).parent().removeClass('accordion-active'); $(this).parent().find('.accordion-content').slideUp(300); } }); }); /* Link Toggles */ $('.toggle-link').each(function(){ var target = $(this).attr('href'); $(target).hide(); $(this).click(function(e){ e.preventDefault(); var target = $(this).attr('href'); $(target).slideToggle(300); }); }); /* Payment Options Accordion */ $('.payment-options').each(function(){ $(this).find('.payment-content').hide(); $(this).find('input[type="radio"]:checked').parent().parent().addClass('active').find('.payment-content').show(); $(this).find('.payment-header').click(function(){ if($(this).find('input[type="radio"]').is(':checked')){ $(this).parent().parent().find('.payment-content').slideUp(300); $(this).parent().parent().find('li.active').removeClass('active'); $(this).parent().addClass('active').find('.payment-content').slideDown(300); } }); }); } /* Tabs */ function enableTabs(){ $('.tabs').each(function(){ // Set Active Tab $(this).find('.tab').hide(); $(this).find('.tab:first-child').show(); $(this).find('.tab-header ul li:first-child').addClass('active-tab'); // Prevent Default $(this).find('.tab-header li a').click(function(e){ e.preventDefault(); }); // Tab Navigation $(this).find('.tab-header li').click(function(){ var target = $(this).find('a').attr('href'); $(this).parent().parent().parent().find('.tab').fadeOut(200); $(this).parent().parent().parent().find(target).delay(200).fadeIn(200); $(this).parent().find('.active-tab').removeClass('active-tab'); $(this).addClass('active-tab'); }); }); } /* Alert Boxes */ function enableAlertBoxes(){ $('.alert-box .icons').click(function(){ $(this).parent().slideUp(300, function(){ $(this).remove(); }); }); } /* Progressbars */ function enableProgressbars(){ $('.progressbar').each(function(){ $(this).attr('data-current', 0); }); $(window).load(function(){ animateProgressBars(); }); $(window).scroll(function(){ animateProgressBars(); }); /* Animate Progress BArs */ function animateProgressBars(){ var pr_offset = window_h/8; $('.progressbar').each(function(){ var bar = $(this); var bar_y = $(bar).offset().top; if((bar_y < (window_s + window_h - pr_offset))){ barStartAnimation(bar); } }); /* Bar FillIn Animation */ function barStartAnimation(el){ var bar = el; var bar_progress = el.find('.progress-width'); var bar_percent = el.find('.progress-percent'); $(bar).addClass('progressbar-animating').addClass('progessbar-start'); $(bar_percent).fadeIn(200); var percent = parseInt($(bar).attr('data-percent')); var animationDuration = 2000; var intervalDuration = animationDuration / percent; var barInterval = setInterval(function(){ var current = $(bar).attr('data-current'); if(current <= percent){ $(bar_progress).css('width', current+'%'); $(bar_percent).text(current+'%'); current++; $(bar).attr('data-current', current); }else{ clearInterval(barInterval); $(bar).removeClass('progessbar-start'); } }, intervalDuration); } } } // Custom Audio Player function enableCustomAudio(){ $('audio').each(function(){ /* Setup Audio Player */ $(this).wrap('<div class="audio-player"></div>'); $(this).parent().append('<div class="audio-play-button"></div>'); // Play Button $(this).parent().append('<div class="audio-current-time">00:00</div>'); // Current Time $(this).parent().append('<div class="audio-progress" data-mousedown=""><div class="audio-progress-wrapper"><div class="audio-buffer-bar"></div><div class="audio-progress-bar"></div></div></div>'); // Progress bar $(this).parent().append('<div class="audio-time">00:00</div>'); // Time $(this).parent().append('<div class="audio-volume"><div class="volume-bar"><div class="audio-volume-progress"></div></div></div>'); // Volume /* Set Volume */ var audio_volume = 0.5; $(this)[0].volume = audio_volume; $(this).parent().find('.audio-volume-progress').css('width', (audio_volume*100)+'%'); /* Initialize */ $(this).bind('canplay', function(){ /* Set Track Time */ var audio_length = Math.floor($(this)[0].duration); var audio_length_m = Math.floor(audio_length/60); var audio_length_s = Math.floor(audio_length%60); if(audio_length_m < 10){ audio_length_m = '0'+audio_length_m; } if(audio_length_s < 10){ audio_length_s = '0'+audio_length_s; } audio_length = audio_length_m + ':' + audio_length_s; $(this).parent().find('.audio-time').text(audio_length); }); /* Play/Pause Button */ $(this).parent().find('.audio-play-button').click(function(){ if($(this).hasClass('pause')){ $(this).removeClass('pause'); $(this).parent().find('audio')[0].pause(); }else{ $(this).addClass('pause'); $(this).parent().find('audio')[0].play(); } }); /* Progress Bar */ $(this).bind('timeupdate', function(){ var audio = $(this)[0]; var progress_bar = $(this).parent().find('.audio-progress-bar'); var track_current = $(this).parent().find('.audio-current-time'); var audio_length = audio.duration; var audio_current = audio.currentTime /* Progress bar */ var progress = (audio_current / audio_length)*100; $(progress_bar).css('width', progress+'%'); /* Current Time */ var audio_current_m = Math.floor(audio_current/60); var audio_current_s = Math.floor(audio_current%60); if(audio_current_m < 10){ audio_current_m = '0'+audio_current_m; } if(audio_current_s < 10){ audio_current_s = '0'+audio_current_s; } audio_current = audio_current_m + ':' + audio_current_s; $(this).parent().find('.audio-current-time').text(audio_current); }); /* Progress Change */ $('.audio-progress-wrapper').mousedown(function(e){ $(this).attr('data-mousedown', 'true'); var audio_x = $(this).offset().left; var audio_w = $(this).width(); var mouse_x = e.pageX; var progress = (mouse_x - audio_x) / audio_w * 100; var track_length = $(this).parent().parent().find('audio')[0].duration; var update_time = track_length / (100 / progress); $(this).parent().parent().find('audio')[0].currentTime = update_time; }); $(document).mouseup(function(){ $('.audio-progress-wrapper').attr('data-mousedown', ''); $('.volume-bar').attr('data-mousedown', ''); }); $('.audio-progress-wrapper').mousemove(function(e){ if($(this).attr('data-mousedown') == 'true'){ var audio_x = $(this).offset().left; var audio_w = $(this).width(); var mouse_x = e.pageX; var progress = (mouse_x - audio_x) / audio_w * 100; var track_length = $(this).parent().parent().find('audio')[0].duration; var update_time = track_length / (100 / progress); $(this).parent().parent().find('audio')[0].currentTime = update_time; } }); /* Buffering Bar */ $(this).bind('progress', function(){ }); /* Volume Bar */ $(this).bind('volumechange', function(){ var audio = $(this)[0]; var volume_bar = $(this).parent().find('.audio-volume-progress'); var audio_volume = audio.volume; /* Volume Progress bar */ var progress = audio_volume*100; $(volume_bar).css('width', progress+'%'); if(audio_volume >= 0.5){ $(volume_bar).parent().parent().removeClass('volume-down').removeClass('volume-off'); } if(audio_volume < 0.5){ $(volume_bar).parent().parent().addClass('volume-down').removeClass('volume-off'); } if(audio_volume == 0){ $(volume_bar).parent().parent().addClass('volume-off'); } }); $('.volume-bar').mousedown(function(e){ $(this).attr('data-mousedown', 'true'); var audio_x = $(this).offset().left; var audio_w = $(this).width(); var mouse_x = e.pageX; var update_volume = (mouse_x - audio_x) / audio_w; $(this).parent().parent().find('audio')[0].volume = update_volume; }); $('.volume-bar').mousemove(function(e){ if($(this).attr('data-mousedown') == 'true'){ var audio_x = $(this).offset().left; var audio_w = $(this).width(); var mouse_x = e.pageX; var update_volume = (mouse_x - audio_x) / audio_w; $(this).parent().parent().find('audio')[0].volume = update_volume; } }); }); } /* Full Calendar */ function enableCalendar(){ /* Sidebar Calendar */ $('.sidebar-calendar').responsiveCalendar({ events: { "2014-03-03": {"number": 1, "class": "calendar-event", "url": "event-post-v1.php"}, "2014-03-05": {"number": 1, "class": "calendar-event", "url": "event-post-v1.php"}, "2014-03-08": {"number": 1, "class": "calendar-event", "url": "event-post-v1.php"}, "2014-03-12": {"number": 1, "class": "calendar-event", "url": "event-post-v1.php"}, "2014-03-18": {"number": 1, "class": "calendar-event", "url": "event-post-v1.php"}, "2014-03-22": {"number": 1, "class": "calendar-event", "url": "event-post-v1.php"}, } }); } /* MixItUp (Filtering and Sorting) */ function enableMixItup(){ // Mix It Up $('.media-items').mixItUp(); $('.shop-items').mixItUp(); /* Filtering Dropdown */ $('.filter-dropdown>li').click(function(){ $(this).parent().toggleClass('opened'); }); $('.filter-dropdown ul li').click(function(){ var value = $(this).text(); $(this).parent().find('.active-filter').removeClass('active-filter'); $(this).addClass('active-filter'); $(this).parent().parent().find('>span').text(value); }); /* Sorting Options */ $('.order-group>button:last-child').hide(); $('.order-group.ascending-sort>button:first-child').hide(); $('.order-group.ascending-sort>button:last-child').show(); $('.order-group.descending-sort>button:last-child').hide(); $('.order-group.descending-sort>button:first-child').show(); $('.filter-sorting button').click(function(){ if(!$(this).parent().hasClass('active-sort')){ $(this).parent().parent().find('.active-sort').removeClass('active-sort'); $(this).parent().addClass('active-sort'); } $(this).hide(); $(this).parent().find('button').not($(this)).show(); }); } /* Start Rating */ function enableStarRating(){ // Read Only Rating $('.shop-rating.read-only').raty({ readOnly: true, path:'img/rating', score: function() { return $(this).attr('data-score'); } }); // Rate Only Rating $('.shop-rating.rate-only').raty({ readOnly: false, path:'img/rating', score: function() { return $(this).attr('data-score'); } }); // Read Only Rating Small $('.shop-rating.read-only-small').raty({ readOnly: true, path:'img/rating/small', score: function() { return $(this).attr('data-score'); } }); } /* Shopping Cart */ function enableShoppingCart(){ $('.shopping-cart-table .remove-shopping-item').click(function(){ $(this).parent().parent().fadeOut(300, function(){ $(this).remove(); }); }); $('.shopping-cart-dropdown .remove-shopping-item').click(function(){ $(this).parent().parent().parent().fadeOut(300, function(){ $(this).remove(); }); }); } /* Social Share Buttons */ function enableSocialShare(){ $('.social-share').each(function(){ var page_url = encodeURIComponent(document.URL); $(this).find('.facebook>a').attr('href', 'http://www.facebook.com/sharer/sharer.php?u='+page_url).attr('target','_blank'); $(this).find('.twitter>a').attr('href', 'https://twitter.com/home?status='+page_url).attr('target','_blank'); $(this).find('.google>a').attr('href', 'https://plus.google.com/share?url='+page_url).attr('target','_blank'); $(this).find('.pinterest>a').attr('href', 'http://pinterest.com/pin/create/button/?url='+page_url).attr('target','_blank'); }); } /* AJAX Contact Form */ function enableContactForm(){ $('#contact-form>*').wrap('<div class="form-content"></div>'); $('#contact-form').append('<div class="form-report"></div>'); $('#contact-form').submit(function(e){ e.preventDefault(); var form = $(this); var action = $(this).attr('action'); var data = $(this).serialize(); $.ajax({ type: "POST", url: action, data: data, beforeSend: function(){ form.css('opacity', '0.5'); }, success: function(data){ // Display returned data form.css('opacity', '1'); form.find('.form-report').html(data); // Hide Form on Success if (data.indexOf('class="success"') >= 0){ form.find('.form-content').slideUp(300); } } }); }); } /* AJAX Newsletter Form */ function enableNewsletterForm(){ $('#newsletter>*').wrap('<div class="form-content"></div>'); $('#newsletter').append('<div class="form-report"></div>'); $('#newsletter').submit(function(e){ e.preventDefault(); $('#newsletter .newsletter-email input').tooltip('destroy'); $('#newsletter .newsletter-zip input').tooltip('destroy'); var form = $(this); var action = $(this).attr('action'); var data = $(this).serialize(); var error = false; var email_val = form.find('.newsletter-email input').val(); var zip_val = form.find('.newsletter-zip input').val(); if(email_val == '' || email_val == ' '){ error = true; form.find('.newsletter-email input').tooltip({title:'Required', trigger: 'manual'}); form.find('.newsletter-email input').tooltip('show'); }else{ var email_re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; if(!email_re.test(email_val)){ error = true; form.find('.newsletter-email input').tooltip({title:'Email not valid', trigger: 'manual'}); form.find('.newsletter-email input').tooltip('show'); }else{ form.find('.newsletter-email input').tooltip('hide'); } } if(zip_val == '' || zip_val == ' '){ error = true; form.find('.newsletter-zip input').tooltip({title:'Required', trigger: 'manual'}); form.find('.newsletter-zip input').tooltip('show'); }else{ form.find('.newsletter-zip input').tooltip('hide'); } if(!error){ $.ajax({ type: "POST", url: action, data: data, beforeSend: function(){ form.css('opacity', '0.5'); }, success: function(data){ // Display returned data form.css('opacity', '1'); form.find('.form-report').html(data); // Hide Form on Success if (data.indexOf('class="success"') >= 0){ form.find('.form-content').slideUp(300); } } }); } }); } /* ClouZoom Products Slider */ function enableProductSlider(){ if($('.shop-product-gallery').length > 0){ var current_img = $('.shop-product-gallery .main-image img').attr('src'); $('.shop-product-gallery .slider-navigation li').find('a[href="'+current_img+'"]').parent().addClass('active'); } /* Slider Navigation */ $('.shop-product-gallery .slider-navigation li').click(function(e){ var image = $(this).find('a').attr('href'); $(this).parent().find('.active').removeClass('active'); $(this).addClass('active'); $('.shop-product-gallery .main-image img').animate({opacity:0},300,function(){ $(this).attr('src',image).animate({opacity:1}, 300); }); }); /* JackBox */ $('.shop-product-gallery .main-image .fullscreen-icon').click(function(){ var image = $(this).parent().find('>img').attr('src'); $('.shop-product-gallery .slider-navigation li').find('a[href="'+image+'"]').trigger('click'); }); /* Cloud Zoom */ $(".cloud-zoom-image").imagezoomsl({ zoomrange: [3, 3] }); $('.tracker').click(function(){ alrt('a'); }); } });
hassiumsoft/hasscms-app
themes/candidate/media/js/script.js
JavaScript
gpl-3.0
30,554
using System; namespace Telegram.Bot.Helpers { public static class UnixDateTimeHelper { /// <summary> /// Convert a long into a DateTime /// </summary> public static DateTime FromUnixTime(this long self) { var ret = new DateTime(1970, 1, 1); return ret.AddSeconds(self); } /// <summary> /// Convert a DateTime into a long /// </summary> /// <exception cref="ArgumentOutOfRangeException"></exception> public static long ToUnixTime(this DateTime self) { if (self == DateTime.MinValue) { return 0; } var epoc = new DateTime(1970, 1, 1); var delta = self - epoc; if (delta.TotalSeconds < 0) throw new ArgumentOutOfRangeException(@"Unix epoc starts January 1st, 1970"); return (long) delta.TotalSeconds; } } }
masternasr/telegram
Telegram.Bot/Helpers/Extensions.cs
C#
gpl-3.0
958
#include "MAP.h" #include <iostream> #include <algorithm> #include <numeric> using namespace std; void MAP::append( std::vector<std::string>& retrieved, std::vector<std::string>& relevant ) { float k = 1; float tp = 0; double avgPrecision = 0; vector<string>::iterator ind; vector<string>::iterator end = retrieved.end(); for( ind = retrieved.begin() ; ind != end ; ++ind ) { if( find( relevant.begin(), relevant.end(), *ind ) != relevant.end() ) { ++tp; avgPrecision += tp / k; } ++k; } avgPrecision = tp > 0 ? avgPrecision / tp : 0; m_avgPrecision.push_back( avgPrecision ); } void MAP::clear() { m_avgPrecision.clear(); } double MAP::eval() { return m_avgPrecision.size() > 0 ? std::accumulate( m_avgPrecision.begin(), m_avgPrecision.end(), 0.0 ) / m_avgPrecision.size() : 0; }
gasevi/pyreclab
eval_metrics/MAP.cpp
C++
gpl-3.0
866
<div class="header"><h1 class="slidetitle">Stay connected</h1></div> <div class="main"> <div class="text"> <div> <p>The Ubuntu Message Indicator gives you an eagle-eye view of incoming messages from all applications and social networks. See at a glance when there’s something new to read, regardless how it arrived.</p> </div> <div class="featured"> <h2 class="subtitle">සහය දක්වන සේවාවන්</h2> <ul> <li> <img class="icon" src="icons/twitter.png" /> <p class="caption">ටුවිටර්</p> </li> <li> <img class="icon" src="icons/facebook.png" /> <p class="caption">ෆේස්බුක්</p> </li> <li> <img class="icon" src="icons/identica.png" /> <p class="caption">Identi.ca</p> </li> </ul> </div> </div> <img class="screenshot" src="screenshots/social.jpeg" /> </div>
Alberto-Beralix/Beralix
i386-squashfs-root/usr/share/ubiquity-slideshow/slides/loc.si/social.html
HTML
gpl-3.0
830
package net.abysmal.clickerconquest.windows.menus; import net.abysmal.clickerconquest.entities.units.melee.Farmer; import net.abysmal.clickerconquest.entities.units.ranged.Hunter; import net.abysmal.clickerconquest.graphics.Panel; public class UnitMenu { static final int ID = 4; Panel panel; public UnitMenu(Panel panel) { this.panel = panel; initializeButtons(); } private void initializeButtons() { int BID = 2; int BO = 25; BID--; panel.createUnitButton(BO + BID, new Farmer()); BID--; panel.createUnitButton(BO + BID, new Hunter()); // BID--; // panel.createUnitButton(BO + BID, 0); // BID--; // panel.createUnitButton(BO + BID, 0); // BID--; // panel.createUnitButton(BO + BID, 0); // BID--; // panel.createUnitButton(BO + BID, 0); // BID--; // panel.createUnitButton(BO + BID, 0); // BID--; // panel.createUnitButton(BO + BID, 0); } }
Mojken/ClickerConquest
src/net/abysmal/clickerconquest/windows/menus/UnitMenu.java
Java
gpl-3.0
906
{% extends 'ilayout.html' %} {% block title %}Free GPS Tracker - Login{% endblock %} {% block css %} <link rel="stylesheet" type="text/css" href="/media/css/style.css" media="screen" /> {% endblock %} {% block content %} <div id="content"> <div class="post"> <div class="entry"> <form action="/login/" method="post"> <fieldset> <legend>For demo access use demo/demo</legend> {% csrf_token %} <p><label for="username">Username:</label><input id="username" name="username" type="text" /> </p> <p><label for="password">Password:</label><input id="password" name="password" type="password" /> </p> <p class="submit"><input type="submit" value="Login" /></p> </fieldset> </form> </div> </div> </div> {% endblock %}
LiveStalker/phermes
tracker/templates/_login.html
HTML
gpl-3.0
892
@extends('layouts.master') @section("content") {{ HTML::ul($errors->all()) }} {{ Form::open(array('url' => 'gamintojai')) }} <div class="form-group"> {{ Form::label('pavadinimas', 'Pavadinimas') }} {{ Form::text('pavadinimas', Input::old('pavadinimas'), array('class' => 'form-control')) }} </div> {{ Form::submit('Sukurti gamintoja', array('class' => 'btn btn-primary')) }} {{ Form::close() }} @stop
benetis/duomenu_bazes_modulis_lab
app/views/gamintojai/create.blade.php
PHP
gpl-3.0
413
<?php /** * Copyright © 2016 Magento. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Payment\Test\Unit\Model\Checks; use \Magento\Payment\Model\Checks\Composite; class CompositeTest extends \PHPUnit_Framework_TestCase { /** * @dataProvider paymentMethodDataProvider * @param bool $expectation */ public function testIsApplicable($expectation) { $quote = $this->getMockBuilder(\Magento\Quote\Model\Quote::class)->disableOriginalConstructor()->setMethods( [] )->getMock(); $paymentMethod = $this->getMockBuilder( \Magento\Payment\Model\MethodInterface::class )->disableOriginalConstructor()->setMethods([])->getMock(); $specification = $this->getMockBuilder( \Magento\Payment\Model\Checks\SpecificationInterface::class )->disableOriginalConstructor()->setMethods([])->getMock(); $specification->expects($this->once())->method('isApplicable')->with($paymentMethod, $quote)->will( $this->returnValue($expectation) ); $model = new Composite([$specification]); $this->assertEquals($expectation, $model->isApplicable($paymentMethod, $quote)); } /** * @return array */ public function paymentMethodDataProvider() { return [[true], [false]]; } }
rajmahesh/magento2-master
vendor/magento/module-payment/Test/Unit/Model/Checks/CompositeTest.php
PHP
gpl-3.0
1,373
#!/usr/bin/python # Nathan Harmon # https://github.com/nharmon/bogie-five # # Turn program # from Motion import * import sys if __name__ == '__main__': if len(sys.argv) < 2: exit("Must specify target image file") try: drive = Drive() drive.turn(float(sys.argv[1])) except: exit("Specify direction change")
nharmon/bogie-five
src/turn.py
Python
gpl-3.0
356
package logic; import java.util.ArrayList; import java.util.Iterator; import org.graphstream.graph.Edge; import org.graphstream.graph.Node; public class Maybe implements Formula { private Formula f; private String agent; public Maybe(Formula f, String agent) { this.f = f; this.agent = agent; } @Override public boolean evaluate(Node n) { Iterator<Edge> worlds = n.getEachLeavingEdge().iterator(); while (worlds.hasNext()){ Edge e = worlds.next(); ArrayList<String> agents = e.getAttribute("agents"); if (agents.contains(agent)){ //world is accessible for the agent Node w = e.getTargetNode(); if (f.evaluate(w)){ return true; } } } //went over all worlds and all evaluated to false! return false; } @Override public String pprint() { return "M_" + agent + "(" + f.pprint() + ")"; } }
Daemonstool/MAS
src/main/java/logic/Maybe.java
Java
gpl-3.0
895
/* The frontend for Code for Hampton Roads' Open Health Inspection Data. Copyright (C) 2014 Code for Hampton Roads contributors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /**************** App.js ****************/ "use strict"; var openHealthDataApp = angular.module('openHealthDataApp', ['ngRoute', 'ui.bootstrap', 'openHealthDataAppControllers', 'ngAnimate', 'openHealthDataServices', 'openHealthDataAppFilters', 'google-maps', 'LocalStorageModule']); openHealthDataApp.config(['$routeProvider', function($routeProvider) { $routeProvider. when('/vendor/:id', { templateUrl: 'partials/restaurantDetailView.html', controller: 'restaurantDetailCtrl' }). otherwise({ redirectTo: '/' }); }]); /* The frontend for Code for Hampton Roads' Open Health Inspection Data. Copyright (C) 2014 Code for Hampton Roads contributors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /****************** Controllers ******************/ var openHealthDataAppControllers = angular.module('openHealthDataAppControllers', []); openHealthDataAppControllers.controller('mapCtrl', ['$scope', '$rootScope', '$http', '$location', '$q', 'Geosearch', 'Search', '$filter', '$modal', 'localStorageService', function($scope, $rootScope, $http, $location, $q, Geosearch, Search, $filter, $modal, localStorageService) { $rootScope.$on('$locationChangeSuccess', function() { ga('send', 'pageview', $location.path()); }); $scope.map = Geosearch.map = { center: { latitude: 36.847010, longitude: -76.292430 }, zoom: 18, options: { streetViewControl: false, panControl: true, panControlOptions: { position: google.maps.ControlPosition.LEFT_BOTTOM }, zoomControl: true, zoomControlOptions: { style: google.maps.ZoomControlStyle.LARGE, position: google.maps.ControlPosition.LEFT_BOTTOM }, styles: [{ "featureType": "poi", "stylers": [{ "visibility": "off" }] },{ "featureType": "transit", "stylers": [{ "visibility": "off" }] }] } }; // console.log(Geosearch.map); $scope.dist = 1000; $rootScope.showPosition = function(position) { //outside Virginia check. //- Latitude 36° 32′ N to 39° 28′ N // 36.533333 - 39.466667 //- Longitude 75° 15′ W to 83° 41′ W // 75.25 - 83.683333 if (_.isUndefined(position)) { console.log('Geolocation unavailable'); } else { if ( ((position.coords.latitude > 36.533333 ) && (position.coords.latitude < 39.466667 ) ) && ((position.coords.longitude < -75.25 ) && (position.coords.longitude > -83.683333 ))) { console.log('coordinates are within Virgina'); if (!_.isUndefined(position)) { Geosearch.map.center.latitude = position.coords.latitude; Geosearch.map.center.longitude = position.coords.longitude; } } else { console.log('Coming from out of state, so falling back to Norfolk.'); } } $scope.results = Geosearch.results = Geosearch.query({lat: $scope.map.center.latitude, lon: $scope.map.center.longitude, dist: $scope.dist}, function(){ Geosearch.results = _.values(_.reject(Geosearch.results, function(el){ return _.isUndefined(el.name); })); Geosearch.results.forEach(function(el, index){ el.dist = el.dist * 0.000621371; el.score = el.score ? Math.round(el.score) : "n/a"; }); Geosearch.results = $filter('orderBy')(Geosearch.results, 'score', true); $rootScope.$broadcast('geosearchFire'); }); }; $scope.showError = function() { console.log("Geolocation is not supported by this browser. Fallback to Norfolk"); $rootScope.showPosition(); }; $rootScope.getLocation = function(){ if (navigator.geolocation) { navigator.geolocation.getCurrentPosition($scope.showPosition, $scope.showError); } else { $scope.error = "Geolocation is not supported by this browser."; } }; $rootScope.getLocation(); $rootScope.toRad = function(Value) { return Value * Math.PI / 180; }; $rootScope.distanceCalculation = function(input) { var lat2 = input.latitude; var lon2 = input.longitude; var lat1 = $scope.map.center.latitude; var lon1 = $scope.map.center.longitude; var R = 6378.137; // km var dLat = $scope.toRad(lat2-lat1); var dLon = $scope.toRad(lon2-lon1); lat1 = $scope.toRad(lat1); lat2 = $scope.toRad(lat2); var a = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.sin(dLon/2) * Math.sin(dLon/2) * Math.cos(lat1) * Math.cos(lat2); var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); var d = R * c; return d * 0.62137; }; $rootScope.open = function (size) { // console.log('open modal'); var modalInstance = $modal.open({ templateUrl: 'partials/modal.html', controller: ModalInstanceCtrl, size: size, windowClass: 'modalContainer', backdrop: false, resolve: { items: function () { return $scope.items; } } }); modalInstance.result.then(function (selectedItem) { $rootScope.close = function(){ modalInstance.close(); } }, function () { // $log.info('Modal dismissed at: ' + new Date()); }); }; if ($location.url() === '/') { $scope.open(); } }]); var ModalInstanceCtrl = function ($rootScope, $scope, $modalInstance, items, localStorageService) { $scope.ok = function () { if ($rootScope.dontshow ) { localStorageService.set('Has Read', 'true'); console.log(localStorageService.get('Has Read')); } $modalInstance.close(); }; $scope.cancel = function () { $modalInstance.dismiss('cancel'); }; }; openHealthDataAppControllers.controller('restaurantDetailCtrl', ['$scope', '$routeParams', '$http', '$location', '$rootScope', 'Geosearch', 'Inspections', function($scope, $routeParams, $http, $location, $rootScope, Geosearch, Inspections) { $rootScope.isVisible = false; $scope.results = Inspections.query({vendorid: $routeParams.id}, function(){ var restaurant = $scope.results[$routeParams.id]; Geosearch.map.center = restaurant.coordinates; $rootScope.restaurantName = restaurant.name; restaurant.score = restaurant.score ? Math.round(restaurant.score) : 'n/a'; $rootScope.restaurantPermalink = $location.absUrl(); }); }]); openHealthDataAppControllers.controller('cityJumpCtrl', ['$scope', '$rootScope', 'Geosearch', '$http', function($scope, $rootScope, Geosearch, $http){ $rootScope.isCityJumpVisible = false; $http.get('js/libs/vaPopCities.json').success(function(data){ $scope.cities = data; }); $scope.cityJump = function(city) { console.log('city center is ', city); Geosearch.map.center = { "latitude": city.primary_latitude, "longitude": city.primary_longitude }; $rootScope.isCityJumpVisible = false; $rootScope.showPosition(); }; }]); openHealthDataAppControllers.controller('searchCtrl', ['$scope', '$rootScope', '$timeout', 'Search', '$filter', function($scope, $rootScope, $timeout, Search, $filter){ $rootScope.toggleList = function(){ console.log('clicked toggleList'); if ($rootScope.isVisible) { $rootScope.isVisible = false; } else { $rootScope.isCityJumpVisible = false; $rootScope.isVisible = true; } }; $rootScope.toggleSearchField = function(){ console.log('clicked search button'); $rootScope.isSearchbarVisible = !$rootScope.isSearchbarVisible; }; $rootScope.toggleCityJump = function() { console.log('clicked city jump button'); $rootScope.isSearchbarVisible = false; $rootScope.isVisible = false; $rootScope.isCityJumpVisible = !$rootScope.isCityJumpVisible; $rootScope.resultsType = "Look at another city's inspections."; } $scope.nameSearch = function() { console.log("Searching for " + $scope.query + "."); $rootScope.isSearchbarVisible = false; Search.results = Search.query({name: $scope.query}, function(){ Search.results = _.values(_.reject(Search.results, function(el){ return _.isUndefined(el.name); })); if (Search.results.length === 0) { $rootScope.alerts.push({type:'danger', msg:'Couldn\'t find any results!'}); $timeout(function(){ $rootScope.alerts.pop(); }, 3000, true); } Search.results.forEach(function(el, index){ if (!_.isUndefined(el.coordinates)) { el.dist = $rootScope.distanceCalculation(el.coordinates); el.score = !_.isUndefined(el.score) && !_.isNull(el.score) ? Math.round(el.score) : "n/a"; } else { Search.results.splice(index,1); } }); Search.results = $filter('orderBy')(Search.results, 'score', true); $rootScope.$broadcast('searchFire'); }); }; }]); openHealthDataAppControllers.controller('searchResultsCtrl', ['$scope', '$rootScope', '$location', 'Search', 'Geosearch', function($scope, $rootScope, $location, Search, Geosearch){ $rootScope.$on('searchFire', function(){ $scope.resultsType = "Displaying search results for: " $scope.results = Search.results; $rootScope.isVisible = true; }); $rootScope.alerts = []; $rootScope.closeAlert = function(index) { $scope.alerts.splice(index, 1); }; $rootScope.$on('geosearchFire', function(){ $scope.resultsType = "Displaying results near you."; $scope.results = Geosearch.results; if ($location.url() === '/') { $rootScope.isVisible = true; } }); $scope.map = Geosearch.map; // console.log("Geosearch map in search results" + Geosearch.map) $rootScope.isVisible = false; }]); /* The frontend for Code for Hampton Roads' Open Health Inspection Data. Copyright (C) 2014 Code for Hampton Roads contributors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ openHealthDataApp.directive('bindOnce', function() { return { scope: true, link: function( $scope, $element ) { setTimeout(function() { $scope.$destroy(); }, 0); } } }).directive('focusMe', function($timeout, $parse) { return { link: function(scope, element, attrs) { var model = $parse(attrs.focusMe); scope.$watch(model, function(value) { console.log('value=',value); if(value === true) { $timeout(function() { element[0].focus(); }); } }); } }; }).directive('twitter', [ function() { return { link: function(scope, element, attr) { setTimeout(function() { twttr.widgets.createShareButton( attr.url, element[0], function(el) {}, { count: 'none', text: attr.text } ); }); } } } ]); /* The frontend for Code for Hampton Roads' Open Health Inspection Data. Copyright (C) 2014 Code for Hampton Roads contributors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ angular.module('openHealthDataAppFilters', []) .filter('was', function() { return function(input) { return input ? 'was' : 'wasn\'t'; } }) .filter('categoryIcon', function(){ return function(input) { switch (input) { case "Education": return "fa fa-graduation-cap"; case "Hospitality": return "fa fa-building"; case "Restaurant": return "fa fa-cutlery"; case "Grocery": return "fa fa-shopping-cart"; case "Government": return "fa fa-university"; case "Medical": return "fa fa-plus-square"; case "Mobile Food": return "fa fa-truck"; case "Other": return "fa fa-spoon"; default: return "fa fa-cutlery"; } }; }) .filter('scoreColor', function(){ return function(score) { if (score >= 90) { //Green return "greenText"; } else if (score >= 80 && score < 90) { //Yellow-Green return "yellowGreenText"; } else if (score >= 70 && score < 80) { //Yellow return "yellowText"; } else if (score < 70) { //Red return "redText"; } else if (score === 'n/a') { return "grayText"; } else { return "grayText"; } } }) .filter('scoreBadge', function(){ return function(score){ if (score >= 90) { //Green return "greenBadge"; } else if (score >= 80 && score < 90) { //Yellow-Green return "yellowGreenBadge"; } else if (score >= 70 && score < 80) { //Yellow return "yellowBadge"; } else if (score < 70) { //Red return "redBadge"; } else if (score === 'n/a') { return "grayBadge"; } else { return "grayBadge"; } } }); /* The frontend for Code for Hampton Roads' Open Health Inspection Data. Copyright (C) 2014 Code for Hampton Roads contributors. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ var openHealthDataServices = angular.module('openHealthDataServices', ['ngResource']); openHealthDataServices.factory('Inspections', ['$resource', function($resource){ return $resource('http://api.openhealthinspection.com/inspections?vendorid=:vendorid', {}, { query: { method: 'JSONP', params: {vendorid: '', callback: 'JSON_CALLBACK'} } }); }]); openHealthDataServices.factory('Geosearch', ['$resource', function($resource) { return $resource('http://api.openhealthinspection.com/vendors?lat=:lat&lng=:lon&dist=:dist', {}, { query: { method: 'JSONP', params: {lat: '36', lon: '-72', dist: '1000', callback: 'JSON_CALLBACK'} } }); }]); openHealthDataServices.factory('Search', ['$resource', function($resource) { return $resource('http://api.openhealthinspection.com/vendors', {}, { query: { method: 'JSONP', params: {callback: 'JSON_CALLBACK'} } }); }]);
0111001101111010/open-health-inspection-app
dist/production.js
JavaScript
gpl-3.0
18,429
# DevOps.Abstractions.BusinessObjects ## Summary Namespace contains concepts that represent software "business objects", their properties, relationships between them, and schema, domain, and system categorization levels. ### - Each **System** contains one or more **Domains**. - Each **Domain** contains one or more **Schema**. - Each **Schema** contains one or more **Concept**. - Each **Concept** contains *properties* and *relationships* to other concepts. - Each Concept has one (and only one) parent Schema. - Each Schema has one (and only one) parent Domain - Each Domain has one (and only one) parent System. ## Semantics ### System A **System** represents a collection of one or more **Domains**. Instances of this abstraction yield: - VisualStudio Solution - Git repository - VSTS Build definition (to run on Pull Requests into `master` branch) - Client application (MVC, Angular, Xamarin, UWP, etc.) ### Domain Domains may be *based* on one (and only one) other domain. The intention of this restriction is that it will simplify code generating a database context for the domain. `[Domain]DbContext : [BaseDomain]DbContext` Compose a **Domain** model with multiple **Domain** nodes chained together by setting the `Domain.BaseDomain` property. Instances of this abstraction yield: - VisualStudio class library project - VisualStudio Solution project reference - EntityFramework DbContext class (& IServiceCollection extension, etc.) - Services / Web API / API client library - VSTS Build & Release definitions (builds triggered by changes under project path in commit to `master`) Domains that are referenced as the BaseDomain of another Domains are intended to be ignored in generating DbContexts, applications, etc. ### Schema ### Concept
cdorst/DevOps
src/Abstractions.BusinessObjects/README.md
Markdown
gpl-3.0
1,764
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef __UAPI_LINUX_FILTER_H__ #define __UAPI_LINUX_FILTER_H__ #include <lyos/types.h> #include <linux/bpf_common.h> struct sock_filter { __u16 code; __u8 jt; __u8 jf; __u32 k; }; struct sock_fprog { unsigned short len; struct sock_filter* filter; }; #endif
Jimx-/lyos
include/uapi/linux/filter.h
C
gpl-3.0
350
# This file is part of ICLS. # # ICLS is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # ICLS is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with ICLS. If not, see <http://www.gnu.org/licenses/>. import xml.dom.minidom from time import strftime, strptime from sys import exit from textwrap import wrap from os import path def colorize(the_color='blue',entry='',new_line=0): color={'gray':30,'green':32,'red':31,'blue':34,'magenta':35,'cyan':36,'white':37,'highgreen':42,'highblue':44,'highred':41,'highgray':47} if new_line==1: new_line='\n' else: new_line='' return_me='\033[1;'+str(color[the_color])+'m'+entry+'\033[1;m'+new_line return return_me def getText(nodelist): rc = [] for node in nodelist: if node.nodeType == node.TEXT_NODE: rc.append(node.data) return ''.join(rc) # Only if error is one that halts things, stop script def aws_print_error(error_obj): error_code=getText(xml.dom.minidom.parseString(error_obj[2]).documentElement.getElementsByTagName('Code')[0].childNodes) error_message=getText(xml.dom.minidom.parseString(error_obj[2]).documentElement.getElementsByTagName('Message')[0].childNodes) error_message=colorize('red',"ERROR",1)+colorize('red',"AWS Error Code: ")+error_code+colorize('red',"\nError Message: ")+error_message print error_message exit() return True def print_error(error_text): error_message=colorize('red',"ERROR",1)+colorize('red',"\nError Message: ")+error_text print error_message exit() return True #takes an entry, and makes it pretty! def makeover(entry,ismonochrome=False): if ismonochrome==False: output=colorize('gray','========================================',1) output+=colorize('cyan',entry['entry'],1) output+=colorize('cyan',strftime("%H:%M %m.%d.%Y", strptime(entry['date'],"%Y-%m-%dT%H:%M:%S+0000")),1) output+=colorize('gray','ID: '+entry.name,0) else: output="========================================\n" output+=entry['entry']+"\n" output+=strftime("%H:%M %m.%d.%Y", strptime(entry['date'],"%Y-%m-%dT%H:%M:%S+0000"))+"\n" output+='ID: '+entry.name return output #If, during parsing, help was flagged print out help text and then exit TODO read it from a md file def print_help(): filepath = path.join(path.dirname(path.abspath(__file__)), 'DOCUMENTATION.mkd') f = open(filepath,'r') print f.read() f.close() exit()
timbotron/ICLS
framework.py
Python
gpl-3.0
2,817