code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
3
942
language
stringclasses
30 values
license
stringclasses
15 values
size
int32
3
1.05M
package tmp.generated_people; import cide.gast.*; import cide.gparser.*; import cide.greferences.*; import java.util.*; public abstract class Element_ol extends GenASTNode { protected Element_ol(Property[] p, Token firstToken, Token lastToken) { super(p, firstToken, lastToken); } protected Element_ol(Property[] p, IToken firstToken, IToken lastToken) { super(p, firstToken, lastToken); } }
ckaestne/CIDE
CIDE_Language_XML_concrete/src/tmp/generated_people/Element_ol.java
Java
gpl-3.0
404
""" Copyright 2014 Jason Heeris, [email protected] This file is part of the dungeon excavator web interface ("webcavate"). Webcavate 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. Webcavate 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 webcavate. If not, see <http://www.gnu.org/licenses/>. """ import argparse import uuid from flask import Flask, render_template, request, make_response, redirect, url_for, flash from dungeon.excavate import render_room HELP_TEXT = """\ Web interface to the dungeon excavator.""" app = Flask('dungeon.web') app.secret_key = str(uuid.uuid4()) @app.route("/") def root(): """ Web interface landing page. """ return render_template('index.html') @app.route("/error") def error(): """ Display errors. """ return render_template('error.html') def make_map(request, format): tile_size = int(request.form['size']) wall_file = request.files['walls'] floor_file = request.files['floor'] floorplan_file = request.files['floorplan'] try: room_data, content_type = render_room( floor_file.read(), wall_file.read(), floorplan_file.read(), tile_size, format ) except ValueError as ve: flash(str(ve)) return redirect(url_for('error')) # Create response response = make_response(room_data) response.headers['Content-Type'] = content_type return response @app.route("/map.svg", methods=['POST']) def map_svg(): return make_map(request, format='svg') @app.route("/map.png", methods=['POST']) def map_png(): return make_map(request, format='png') @app.route("/map.jpg", methods=['POST']) def map_jpg(): return make_map(request, format='jpg') @app.route("/map", methods=['POST']) def process(): """ Process submitted form data. """ format = request.form['format'] try: node = { 'png': 'map_png', 'svg': 'map_svg', 'jpg': 'map_jpg', }[format] except KeyError: flash("The output format you selected is not supported.") return redirect(url_for('error')) else: return redirect(url_for(node, _method='POST'), code=307) def main(): """ Parse arguments and get things going for the web interface """ parser = argparse.ArgumentParser(description=HELP_TEXT) parser.add_argument( '-p', '--port', help="Port to serve the interface on.", type=int, default=5050 ) parser.add_argument( '-a', '--host', help="Host to server the interface on.", ) args = parser.parse_args() app.run(port=args.port, host=args.host, debug=False)
detly/webcavate
webcavate/app.py
Python
gpl-3.0
3,132
import { ComponentFixture, TestBed, async } from '@angular/core/testing'; import { HttpResponse, HttpErrorResponse } from '@angular/common/http'; import { of, throwError } from 'rxjs'; import { BookstoreTestModule } from '../../../test.module'; import { JhiMetricsMonitoringComponent } from 'app/admin/metrics/metrics.component'; import { JhiMetricsService } from 'app/admin/metrics/metrics.service'; describe('Component Tests', () => { describe('JhiMetricsMonitoringComponent', () => { let comp: JhiMetricsMonitoringComponent; let fixture: ComponentFixture<JhiMetricsMonitoringComponent>; let service: JhiMetricsService; beforeEach(async(() => { TestBed.configureTestingModule({ imports: [BookstoreTestModule], declarations: [JhiMetricsMonitoringComponent] }) .overrideTemplate(JhiMetricsMonitoringComponent, '') .compileComponents(); })); beforeEach(() => { fixture = TestBed.createComponent(JhiMetricsMonitoringComponent); comp = fixture.componentInstance; service = fixture.debugElement.injector.get(JhiMetricsService); }); describe('refresh', () => { it('should call refresh on init', () => { // GIVEN const response = { timers: { service: 'test', unrelatedKey: 'test' }, gauges: { 'jcache.statistics': { value: 2 }, unrelatedKey: 'test' } }; spyOn(service, 'getMetrics').and.returnValue(of(response)); // WHEN comp.ngOnInit(); // THEN expect(service.getMetrics).toHaveBeenCalled(); }); }); }); });
Niky4000/UsefulUtils
projects/tutorials-master/tutorials-master/jhipster-5/bookstore-monolith/src/test/javascript/spec/app/admin/metrics/metrics.component.spec.ts
TypeScript
gpl-3.0
1,995
before words \begin{myenv}body of myenv \end{myenv} after words
cmhughes/latexindent.pl
documentation/demonstrations/env-mlb4-mod14.tex
TeX
gpl-3.0
64
<!DOCTYPE html> <html xml:lang="en-GB" lang="en-GB" xmlns="http://www.w3.org/1999/xhtml"> <head lang="en-GB"> <title>Ross Gammonโ€™s Family Tree - Events</title> <meta charset="UTF-8" /> <meta name ="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1" /> <meta name ="apple-mobile-web-app-capable" content="yes" /> <meta name="generator" content="Gramps 4.2.8 http://gramps-project.org/" /> <meta name="author" content="" /> <link href="../../../images/favicon2.ico" rel="shortcut icon" type="image/x-icon" /> <link href="../../../css/narrative-screen.css" media="screen" rel="stylesheet" type="text/css" /> <link href="../../../css/narrative-print.css" media="print" rel="stylesheet" type="text/css" /> </head> <body> <div id="header"> <h1 id="SiteTitle">Ross Gammonโ€™s Family Tree</h1> </div> <div class="wrapper" id="nav" role="navigation"> <div class="container"> <ul class="menu" id="dropmenu"> <li><a href="../../../individuals.html" title="Individuals">Individuals</a></li> <li><a href="../../../index.html" title="Surnames">Surnames</a></li> <li><a href="../../../families.html" title="Families">Families</a></li> <li class = "CurrentSection"><a href="../../../events.html" title="Events">Events</a></li> <li><a href="../../../places.html" title="Places">Places</a></li> <li><a href="../../../sources.html" title="Sources">Sources</a></li> <li><a href="../../../repositories.html" title="Repositories">Repositories</a></li> <li><a href="../../../media.html" title="Media">Media</a></li> <li><a href="../../../thumbnails.html" title="Thumbnails">Thumbnails</a></li> </ul> </div> </div> <div class="content" id="EventDetail"> <h3>Death</h3> <table class="infolist eventlist"> <tbody> <tr> <td class="ColumnAttribute">Gramps ID</td> <td class="ColumnGRAMPSID">E14190</td> </tr> <tr> <td class="ColumnAttribute">Date</td> <td class="ColumnColumnDate"> 1982-09-08 </td> </tr> </tbody> </table> <div class="subsection" id="references"> <h4>References</h4> <ol class="Col1" role="Volume-n-Page"type = 1> <li> <a href="../../../ppl/d/b/d15f6055ff1a0cf06d72b377bd.html"> LUCAS, Desmond Leslie <span class="grampsid"> [I11896]</span> </a> </li> </ol> </div> </div> <div class="fullclear"></div> <div id="footer"> <p id="createdate"> Generated by <a href="http://gramps-project.org/">Gramps</a> 4.2.8<br />Last change was the 2015-08-05 19:55:02<br />Created for <a href="../../../ppl/9/e/d15f5fb48902c4fc1b421d249e9.html">GAMMON, Francis</a> </p> <p id="copyright"> </p> </div> </body> </html>
RossGammon/the-gammons.net
RossFamilyTree/evt/1/9/d15f605600327f8248574cb8e91.html
HTML
gpl-3.0
2,714
//# BaselineSelection.cc: Class to handle the baseline selection //# Copyright (C) 2012 //# ASTRON (Netherlands Institute for Radio Astronomy) //# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands //# //# This file is part of the LOFAR software suite. //# The LOFAR software suite 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. //# //# The LOFAR software suite 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 the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>. //# //# $Id$ //# //# @author Ger van Diepen #include <lofar_config.h> #include <DPPP/BaselineSelection.h> #include <DPPP/DPLogger.h> #include <MS/BaselineSelect.h> #include <Common/ParameterSet.h> #include <Common/ParameterValue.h> #include <Common/LofarLogger.h> #include <Common/StreamUtil.h> using namespace casa; using namespace std; namespace LOFAR { namespace DPPP { BaselineSelection::BaselineSelection() {} BaselineSelection::BaselineSelection (const ParameterSet& parset, const string& prefix, bool minmax, const string& defaultCorrType, const string& defaultBaseline) : itsStrBL (parset.getString (prefix + "baseline", defaultBaseline)), itsCorrType (parset.getString (prefix + "corrtype", defaultCorrType)), itsRangeBL (parset.getDoubleVector (prefix + "blrange", vector<double>())) { if (minmax) { double minbl = parset.getDouble (prefix + "blmin", -1); double maxbl = parset.getDouble (prefix + "blmax", -1); if (minbl > 0) { itsRangeBL.push_back (0.); itsRangeBL.push_back (minbl); } if (maxbl > 0) { itsRangeBL.push_back (maxbl); itsRangeBL.push_back (1e30); } } ASSERTSTR (itsRangeBL.size()%2 == 0, "NDPPP error: uneven number of lengths in baseline range"); } bool BaselineSelection::hasSelection() const { return !((itsStrBL.empty() || itsStrBL == "[]") && itsCorrType.empty() && itsRangeBL.empty()); } void BaselineSelection::show (ostream& os, const string& blanks) const { os << " Baseline selection:" << std::endl; os << " baseline: " << blanks << itsStrBL << std::endl; os << " corrtype: " << blanks << itsCorrType << std::endl; os << " blrange: " << blanks << itsRangeBL << std::endl; } Matrix<bool> BaselineSelection::apply (const DPInfo& info) const { // Size and initialize the selection matrix. int nant = info.antennaNames().size(); Matrix<bool> selectBL(nant, nant, true); // Apply the various parts if given. if (! itsStrBL.empty() && itsStrBL != "[]") { handleBL (selectBL, info); } if (! itsCorrType.empty()) { handleCorrType (selectBL); } if (! itsRangeBL.empty()) { handleLength (selectBL, info); } return selectBL; } Vector<bool> BaselineSelection::applyVec (const DPInfo& info) const { Matrix<bool> sel = apply(info); Vector<bool> vec; vec.resize (info.nbaselines()); for (uint i=0; i<info.nbaselines(); ++i) { vec[i] = sel(info.getAnt1()[i], info.getAnt2()[i]); } return vec; } void BaselineSelection::handleBL (Matrix<bool>& selectBL, const DPInfo& info) const { // Handle the value(s) in the baseline selection string. ParameterValue pvBL(itsStrBL); // The value can be a vector or an MSSelection string. // Alas the ParameterValue vector test cannot be used, because // the first character of a MSSelection string can also be [. // So if the first is [ and a ] is found before the end and before // another [, it must be a MSSelection string. bool mssel = true; if (itsStrBL[0] == '[') { String::size_type rb = itsStrBL.find (']'); ASSERTSTR (rb != string::npos, "Baseline selection " + itsStrBL + " has no ending ]"); if (rb == itsStrBL.size()-1) { mssel = false; } else { String::size_type lb = itsStrBL.find ('[', 1); mssel = (lb == string::npos || lb > rb); } } if (!mssel) { // Specified as a vector of antenna name patterns. selectBL = selectBL && handleBLVector (pvBL, info.antennaNames()); } else { // Specified in casacore's MSSelection format. string msName = info.msName(); ASSERT (! msName.empty()); Matrix<bool> sel(BaselineSelect::convert (msName, itsStrBL)); // The resulting matrix can be smaller because new stations might have // been added that are not present in the MS's ANTENNA table. if (sel.nrow() == selectBL.nrow()) { selectBL = selectBL && sel; } else { // Only and the subset. Matrix<bool> selBL = selectBL(IPosition(2,0), IPosition(2,sel.nrow()-1)); selBL = selBL && sel; } } } Matrix<bool> BaselineSelection::handleBLVector (const ParameterValue& pvBL, const Vector<String>& antNames) const { Matrix<Bool> sel(antNames.size(), antNames.size()); sel = false; vector<ParameterValue> pairs = pvBL.getVector(); // Each ParameterValue can be a single value (antenna) or a pair of // values (a baseline). // Note that [ant1,ant2] is somewhat ambiguous; it means two antennae, // but one might think it means a baseline [[ant1,ant2]]. if (pairs.size() == 2 && !(pairs[0].isVector() || pairs[1].isVector())) { LOG_WARN_STR ("PreFlagger baseline " << pvBL.get() << " means two antennae, but is somewhat ambigious; " << "it's more clear to use [[ant1],[ant2]]"); } for (uint i=0; i<pairs.size(); ++i) { vector<string> bl = pairs[i].getStringVector(); if (bl.size() == 1) { // Turn the given antenna name pattern into a regex. Regex regex(Regex::fromPattern (bl[0])); int nmatch = 0; // Loop through all antenna names and set matrix for matching ones. for (uint i2=0; i2<antNames.size(); ++i2) { if (antNames[i2].matches (regex)) { nmatch++; // Antenna matches, so set all corresponding flags. for (uint j=0; j<antNames.size(); ++j) { sel(i2,j) = true; sel(j,i2) = true; } } } if (nmatch == 0) { DPLOG_WARN_STR ("PreFlagger: no matches for antenna name pattern [" << bl[0] << "]"); } } else { ASSERTSTR (bl.size() == 2, "PreFlagger baseline " << bl << " should contain 1 or 2 antenna name patterns"); // Turn the given antenna name pattern into a regex. Regex regex1(Regex::fromPattern (bl[0])); Regex regex2(Regex::fromPattern (bl[1])); int nmatch = 0; // Loop through all antenna names and set matrix for matching ones. for (uint i2=0; i2<antNames.size(); ++i2) { if (antNames[i2].matches (regex2)) { // Antenna2 matches, now try Antenna1. for (uint i1=0; i1<antNames.size(); ++i1) { if (antNames[i1].matches (regex1)) { nmatch++; sel(i1,i2) = true; sel(i2,i1) = true; } } } } if (nmatch == 0) { DPLOG_WARN_STR ("PreFlagger: no matches for baseline name pattern [" << bl[0] << ',' << bl[1] << "]"); } } } return sel; } void BaselineSelection::handleCorrType (Matrix<bool>& selectBL) const { // Process corrtype if given. string corrType = toLower(itsCorrType); ASSERTSTR (corrType == "auto" || corrType == "cross", "NDPPP corrType " << corrType << " is invalid; must be auto, cross, or empty string"); if (corrType == "auto") { Vector<bool> diag = selectBL.diagonal().copy(); selectBL = false; selectBL.diagonal() = diag; } else { selectBL.diagonal() = false; } } void BaselineSelection::handleLength (Matrix<bool>& selectBL, const DPInfo& info) const { // Get baseline lengths. const vector<double>& blength = info.getBaselineLengths(); const Vector<Int>& ant1 = info.getAnt1(); const Vector<Int>& ant2 = info.getAnt2(); for (uint i=0; i<ant1.size(); ++i) { // Clear selection if no range matches. bool match = false; for (uint j=0; j<itsRangeBL.size(); j+=2) { if (blength[i] >= itsRangeBL[j] && blength[i] <= itsRangeBL[j+1]) { match = true; break; } } if (!match) { int a1 = ant1[i]; int a2 = ant2[i]; selectBL(a1,a2) = false; selectBL(a2,a1) = false; } } } } //# end namespace }
jjdmol/LOFAR
CEP/DP3/DPPP/src/BaselineSelection.cc
C++
gpl-3.0
9,934
// //--------------------------------------------------------------------------- // // Copyright(C) 2005-2016 Christoph Oelckers // All rights reserved. // // This program 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. // // 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 Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with this program. If not, see http://www.gnu.org/licenses/ // //-------------------------------------------------------------------------- // /* ** r_opengl.cpp ** ** OpenGL system interface ** */ #include "gl/system/gl_system.h" #include "tarray.h" #include "doomtype.h" #include "m_argv.h" #include "zstring.h" #include "version.h" #include "i_system.h" #include "v_text.h" #include "r_data/r_translate.h" #include "gl/system/gl_interface.h" #include "gl/system/gl_cvars.h" void gl_PatchMenu(); static TArray<FString> m_Extensions; RenderContext gl; //========================================================================== // // // //========================================================================== static void CollectExtensions() { const char *extension; int max = 0; glGetIntegerv(GL_NUM_EXTENSIONS, &max); if (0 == max) { // Try old method to collect extensions const char *supported = (char *)glGetString(GL_EXTENSIONS); if (nullptr != supported) { char *extensions = new char[strlen(supported) + 1]; strcpy(extensions, supported); char *extension = strtok(extensions, " "); while (extension) { m_Extensions.Push(FString(extension)); extension = strtok(nullptr, " "); } delete [] extensions; } } else { // Use modern method to collect extensions for (int i = 0; i < max; i++) { extension = (const char*)glGetStringi(GL_EXTENSIONS, i); m_Extensions.Push(FString(extension)); } } } //========================================================================== // // // //========================================================================== static bool CheckExtension(const char *ext) { for (unsigned int i = 0; i < m_Extensions.Size(); ++i) { if (m_Extensions[i].CompareNoCase(ext) == 0) return true; } return false; } //========================================================================== // // // //========================================================================== static void InitContext() { gl.flags=0; } //========================================================================== // // // //========================================================================== #define FUDGE_FUNC(name, ext) if (_ptrc_##name == NULL) _ptrc_##name = _ptrc_##name##ext; void gl_LoadExtensions() { InitContext(); CollectExtensions(); const char *version = Args->CheckValue("-glversion"); const char *glversion = (const char*)glGetString(GL_VERSION); if (version == NULL) { version = glversion; } else { double v1 = strtod(version, NULL); double v2 = strtod(glversion, NULL); if (v2 < v1) version = glversion; else Printf("Emulating OpenGL v %s\n", version); } float gl_version = (float)strtod(version, NULL) + 0.01f; // Don't even start if it's lower than 2.0 or no framebuffers are available (The framebuffer extension is needed for glGenerateMipmapsEXT!) if ((gl_version < 2.0f || !CheckExtension("GL_EXT_framebuffer_object")) && gl_version < 3.0f) { I_FatalError("Unsupported OpenGL version.\nAt least OpenGL 2.0 with framebuffer support is required to run " GAMENAME ".\n"); } // add 0.01 to account for roundoff errors making the number a tad smaller than the actual version gl.glslversion = strtod((char*)glGetString(GL_SHADING_LANGUAGE_VERSION), NULL) + 0.01f; gl.vendorstring = (char*)glGetString(GL_VENDOR); // first test for optional features if (CheckExtension("GL_ARB_texture_compression")) gl.flags |= RFL_TEXTURE_COMPRESSION; if (CheckExtension("GL_EXT_texture_compression_s3tc")) gl.flags |= RFL_TEXTURE_COMPRESSION_S3TC; if ((gl_version >= 3.3f || CheckExtension("GL_ARB_sampler_objects")) && !Args->CheckParm("-nosampler")) { gl.flags |= RFL_SAMPLER_OBJECTS; } // The minimum requirement for the modern render path are GL 3.0 + uniform buffers. Also exclude the Linux Mesa driver at GL 3.0 because it errors out on shader compilation. if (gl_version < 3.0f || (gl_version < 3.1f && (!CheckExtension("GL_ARB_uniform_buffer_object") || strstr(gl.vendorstring, "X.Org") != nullptr))) { gl.legacyMode = true; gl.lightmethod = LM_LEGACY; gl.buffermethod = BM_LEGACY; gl.glslversion = 0; gl.flags |= RFL_NO_CLIP_PLANES; } else { gl.legacyMode = false; gl.lightmethod = LM_DEFERRED; gl.buffermethod = BM_DEFERRED; if (gl_version < 4.f) { #ifdef _WIN32 if (strstr(gl.vendorstring, "ATI Tech")) { gl.flags |= RFL_NO_CLIP_PLANES; // gl_ClipDistance is horribly broken on ATI GL3 drivers for Windows. } #endif } else if (gl_version < 4.5f) { // don't use GL 4.x features when running a GL 3.x context. if (CheckExtension("GL_ARB_buffer_storage")) { // work around a problem with older AMD drivers: Their implementation of shader storage buffer objects is piss-poor and does not match uniform buffers even closely. // Recent drivers, GL 4.4 don't have this problem, these can easily be recognized by also supporting the GL_ARB_buffer_storage extension. if (CheckExtension("GL_ARB_shader_storage_buffer_object")) { // Shader storage buffer objects are broken on current Intel drivers. if (strstr(gl.vendorstring, "Intel") == NULL) { gl.flags |= RFL_SHADER_STORAGE_BUFFER; } } gl.flags |= RFL_BUFFER_STORAGE; gl.lightmethod = LM_DIRECT; gl.buffermethod = BM_PERSISTENT; } } else { // Assume that everything works without problems on GL 4.5 drivers where these things are core features. gl.flags |= RFL_SHADER_STORAGE_BUFFER | RFL_BUFFER_STORAGE; gl.lightmethod = LM_DIRECT; gl.buffermethod = BM_PERSISTENT; } if (gl_version >= 4.3f || CheckExtension("GL_ARB_invalidate_subdata")) gl.flags |= RFL_INVALIDATE_BUFFER; if (gl_version >= 4.3f || CheckExtension("GL_KHR_debug")) gl.flags |= RFL_DEBUG; const char *lm = Args->CheckValue("-lightmethod"); if (lm != NULL) { if (!stricmp(lm, "deferred") && gl.lightmethod == LM_DIRECT) gl.lightmethod = LM_DEFERRED; } lm = Args->CheckValue("-buffermethod"); if (lm != NULL) { if (!stricmp(lm, "deferred") && gl.buffermethod == BM_PERSISTENT) gl.buffermethod = BM_DEFERRED; } } int v; if (!gl.legacyMode && !(gl.flags & RFL_SHADER_STORAGE_BUFFER)) { glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, &v); gl.maxuniforms = v; glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, &v); gl.maxuniformblock = v; glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &v); gl.uniformblockalignment = v; } else { gl.maxuniforms = 0; gl.maxuniformblock = 0; gl.uniformblockalignment = 0; } glGetIntegerv(GL_MAX_TEXTURE_SIZE, &gl.max_texturesize); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); if (gl.legacyMode) { // fudge a bit with the framebuffer stuff to avoid redundancies in the main code. Some of the older cards do not have the ARB stuff but the calls are nearly identical. FUDGE_FUNC(glGenerateMipmap, EXT); FUDGE_FUNC(glGenFramebuffers, EXT); FUDGE_FUNC(glBindFramebuffer, EXT); FUDGE_FUNC(glDeleteFramebuffers, EXT); FUDGE_FUNC(glFramebufferTexture2D, EXT); FUDGE_FUNC(glGenerateMipmap, EXT); FUDGE_FUNC(glGenFramebuffers, EXT); FUDGE_FUNC(glBindFramebuffer, EXT); FUDGE_FUNC(glDeleteFramebuffers, EXT); FUDGE_FUNC(glFramebufferTexture2D, EXT); FUDGE_FUNC(glFramebufferRenderbuffer, EXT); FUDGE_FUNC(glGenRenderbuffers, EXT); FUDGE_FUNC(glDeleteRenderbuffers, EXT); FUDGE_FUNC(glRenderbufferStorage, EXT); FUDGE_FUNC(glBindRenderbuffer, EXT); FUDGE_FUNC(glCheckFramebufferStatus, EXT); gl_PatchMenu(); } } //========================================================================== // // // //========================================================================== void gl_PrintStartupLog() { int v = 0; if (!gl.legacyMode) glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &v); Printf ("GL_VENDOR: %s\n", glGetString(GL_VENDOR)); Printf ("GL_RENDERER: %s\n", glGetString(GL_RENDERER)); Printf ("GL_VERSION: %s (%s profile)\n", glGetString(GL_VERSION), (v & GL_CONTEXT_CORE_PROFILE_BIT)? "Core" : "Compatibility"); Printf ("GL_SHADING_LANGUAGE_VERSION: %s\n", glGetString(GL_SHADING_LANGUAGE_VERSION)); Printf (PRINT_LOG, "GL_EXTENSIONS:"); for (unsigned i = 0; i < m_Extensions.Size(); i++) { Printf(PRINT_LOG, " %s", m_Extensions[i].GetChars()); } glGetIntegerv(GL_MAX_TEXTURE_SIZE, &v); Printf("\nMax. texture size: %d\n", v); glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &v); Printf ("Max. texture units: %d\n", v); glGetIntegerv(GL_MAX_VARYING_FLOATS, &v); Printf ("Max. varying: %d\n", v); if (!gl.legacyMode && !(gl.flags & RFL_SHADER_STORAGE_BUFFER)) { glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, &v); Printf ("Max. uniform block size: %d\n", v); glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &v); Printf ("Uniform block alignment: %d\n", v); } if (gl.flags & RFL_SHADER_STORAGE_BUFFER) { glGetIntegerv(GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS, &v); Printf("Max. combined shader storage blocks: %d\n", v); glGetIntegerv(GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS, &v); Printf("Max. vertex shader storage blocks: %d\n", v); } // For shader-less, the special alphatexture translation must be changed to actually set the alpha, because it won't get translated by a shader. if (gl.legacyMode) { FRemapTable *remap = translationtables[TRANSLATION_Standard][8]; for (int i = 0; i < 256; i++) { remap->Remap[i] = i; remap->Palette[i] = PalEntry(i, 255, 255, 255); } } }
Saican/Whitman
src/gl/system/gl_interface.cpp
C++
gpl-3.0
10,215
/******************************************************************************* * Copyright (c) 2008, 2010 Xuggle Inc. All rights reserved. * * This file is part of Xuggle-Utils. * * Xuggle-Utils 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. * * Xuggle-Utils 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 Xuggle-Utils. If not, see <http://www.gnu.org/licenses/>. *******************************************************************************/ /** * Provides convenience methods for registering, and * special implementations of, * {@link com.xuggle.utils.event.IEventHandler}. * <p> * There are certain types of {@link com.xuggle.utils.event.IEventHandler} * implementations that are very common. For example, sometimes * you want to forward an event from one * {@link com.xuggle.utils.event.IEventDispatcher} * to another. * Sometimes you only want * a {@link com.xuggle.utils.event.IEventHandler} to execute if the * {@link com.xuggle.utils.event.IEvent#getSource()} is equal to * a given source. * Sometimes you only * want to handler to execute a maximum number of times. * </p> * <p> * This class tries to provide some of those implementations for you. * </p> * <p> * Use the {@link com.xuggle.utils.event.handler.Handler} class to find * Factory methods for the special handlers you want. * </p> * @see com.xuggle.utils.event.handler.Handler * */ package com.xuggle.utils.event.handler;
artclarke/xuggle-utils
src/main/java/com/xuggle/utils/event/handler/package-info.java
Java
gpl-3.0
1,917
class CreatePasswords < ActiveRecord::Migration def change create_table :passwords do |p| p.string :url p.string :user p.string :password #p.timestamps null: false end end end
webgoal/minhas-senhas-1
db/migrate/20160408001709_create_tests.rb
Ruby
gpl-3.0
213
module Hazel.StringWriter where import Control.Monad.State ------------- StringState ------------- type StringState = State String (Maybe Bool) eval :: StringState -> String eval s = execState s "" newLine :: StringState append :: String -> StringState apply :: (String -> String) -> StringState newLine = append "\n" append s = apply (++s) apply f = get >>= put.(f$) >> return (Just True) --newLine :: StringState --newLine = do -- t <- get -- put $ t++"\n" -- return True -- get >>= put.(++"\n") >>= return True --append :: String -> StringState --append s = do -- t <- get -- put $ t++s -- return True -- get >>= put.(++s) >>= return True --modify :: (String -> String) -> StringState --modify f = do -- t <- get -- put $ f t -- return True
hazel-el/hazel
Hazel/StringWriter.hs
Haskell
gpl-3.0
860
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>ๆ— ่Š็ซ™็‚น</title> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta property="og:type" content="website"> <meta property="og:title" content="ๆ— ่Š็ซ™็‚น"> <meta property="og:url" content="http://wangdongustc.com/index.html"> <meta property="og:site_name" content="ๆ— ่Š็ซ™็‚น"> <meta property="og:locale" content="zh_CN"> <meta property="article:author" content="Darren Wang"> <meta name="twitter:card" content="summary"> <link rel="alternate" href="/atom.xml" title="ๆ— ่Š็ซ™็‚น" type="application/atom+xml"> <link rel="shortcut icon" href="/favicon.png"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/index.min.css"> <link rel="stylesheet" href="/css/style.css"> <link rel="stylesheet" href="/fancybox/jquery.fancybox.min.css"> <meta name="generator" content="Hexo 5.4.0"></head> <body> <div id="container"> <div id="wrap"> <header id="header"> <div id="banner"></div> <div id="header-outer" class="outer"> <div id="header-title" class="inner"> <h1 id="logo-wrap"> <a href="/" id="logo">ๆ— ่Š็ซ™็‚น</a> </h1> <h2 id="subtitle-wrap"> <a href="/" id="subtitle">็Ž‹ๆฑชๆฑชๅŒๅญฆ็š„ๅšๅฎข</a> </h2> </div> <div id="header-inner" class="inner"> <nav id="main-nav"> <a id="main-nav-toggle" class="nav-icon"></a> <a class="main-nav-link" href="/">Home</a> <a class="main-nav-link" href="/archives">Archives</a> </nav> <nav id="sub-nav"> <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a> <a id="nav-search-btn" class="nav-icon" title="Suche"></a> </nav> <div id="search-form-wrap"> <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Suche"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://wangdongustc.com"></form> </div> </div> </div> </header> <div class="outer"> <section id="main"> <article id="post-hello-world" class="h-entry article article-type-post" itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting"> <div class="article-meta"> <a href="/2021/04/24/15/46/04" class="article-date"> <time class="dt-published" datetime="2021-04-24T15:46:04.791Z" itemprop="datePublished">2021-04-24</time> </a> </div> <div class="article-inner"> <header class="article-header"> <h1 itemprop="name"> <a class="p-name article-title" href="/2021/04/24/15/46/04">Hello World</a> </h1> </header> <div class="e-content article-entry" itemprop="articleBody"> <p>Welcome to <a target="_blank" rel="noopener" href="https://hexo.io/">Hexo</a>! This is your very first post. Check <a target="_blank" rel="noopener" href="https://hexo.io/docs/">documentation</a> for more info. If you get any problems when using Hexo, you can find the answer in <a target="_blank" rel="noopener" href="https://hexo.io/docs/troubleshooting.html">troubleshooting</a> or you can ask me on <a target="_blank" rel="noopener" href="https://github.com/hexojs/hexo/issues">GitHub</a>.</p> <h2 id="Quick-Start"><a href="#Quick-Start" class="headerlink" title="Quick Start"></a>Quick Start</h2><h3 id="Create-a-new-post"><a href="#Create-a-new-post" class="headerlink" title="Create a new post"></a>Create a new post</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo new <span class="string">&quot;My New Post&quot;</span></span><br></pre></td></tr></table></figure> <p>More info: <a target="_blank" rel="noopener" href="https://hexo.io/docs/writing.html">Writing</a></p> <h3 id="Run-server"><a href="#Run-server" class="headerlink" title="Run server"></a>Run server</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo server</span><br></pre></td></tr></table></figure> <p>More info: <a target="_blank" rel="noopener" href="https://hexo.io/docs/server.html">Server</a></p> <h3 id="Generate-static-files"><a href="#Generate-static-files" class="headerlink" title="Generate static files"></a>Generate static files</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo generate</span><br></pre></td></tr></table></figure> <p>More info: <a target="_blank" rel="noopener" href="https://hexo.io/docs/generating.html">Generating</a></p> <h3 id="Deploy-to-remote-sites"><a href="#Deploy-to-remote-sites" class="headerlink" title="Deploy to remote sites"></a>Deploy to remote sites</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo deploy</span><br></pre></td></tr></table></figure> <p>More info: <a target="_blank" rel="noopener" href="https://hexo.io/docs/one-command-deployment.html">Deployment</a></p> </div> <footer class="article-footer"> <a data-url="http://wangdongustc.com/2021/04/24/15/46/04" data-id="cknvx0bpn000098nh83v3hvss" data-title="Hello World" class="article-share-link">Teilen</a> </footer> </div> </article> </section> <aside id="sidebar"> <div class="widget-wrap"> <h3 class="widget-title">Archiv</h3> <div class="widget"> <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/04/">ๅ››ๆœˆ 2021</a></li></ul> </div> </div> <div class="widget-wrap"> <h3 class="widget-title">letzter Beitrag</h3> <div class="widget"> <ul> <li> <a href="/2021/04/24/15/46/04">Hello World</a> </li> </ul> </div> </div> </aside> </div> <footer id="footer"> <div class="outer"> <div id="footer-info" class="inner"> &copy; 2021 Darren Wang<br> Powered by <a href="https://hexo.io/" target="_blank">Hexo</a> </div> </div> </footer> </div> <nav id="mobile-nav"> <a href="/" class="mobile-nav-link">Home</a> <a href="/archives" class="mobile-nav-link">Archives</a> </nav> <script src="/js/jquery-3.4.1.min.js"></script> <script src="/fancybox/jquery.fancybox.min.js"></script> <script src="/js/script.js"></script> </div> </body> </html>
wangdongustc/wangdongustc.github.io
index.html
HTML
gpl-3.0
6,979
{% extends 'bs3/base_wo_cms_toolbar.html' %} {% load cms_tags sekizai_tags i18n l10n repanier_tags %} {% block base_content %} <div class="container-repanier"> <div class="container"> {# {% debug %} #} <h4>{{ producer.long_profile_name }}</h4> {% if object %} <h4><span class="glyphicon glyphicon-log-out" aria-hidden="true"></span> {% translate "Previous balance" %} : {{ object.get_negative_previous_balance }} <small>({{ object.date_previous_balance | date:"DATE_FORMAT" }})</small><br></h4> {% endif %} {% if offer_item_set %} <span class="glyphicon glyphicon-minus" aria-hidden="true"></span> {% translate "Purchases" %} {{ object.permanence }} : {{ object.get_total_price_with_tax }} {% if object.get_total_vat != 0 or object.get_total_deposit != 0 or object.delta_transport != 0 %} <small> . {% translate "This price include" %} <span class="glyphicon glyphicon-arrow-right"></span> {% if object.get_total_vat != 0 %}{% translate "VAT" %} : {{ object.get_total_vat }}{% endif %} {% if object.get_total_deposit != 0 %} {% if object.get_total_vat != 0 %}; {% endif %} {% translate "Deposit" %} : {{ object.get_total_deposit }} {% endif %} {% if object.delta_transport != 0 %} {% if object.get_total_vat != 0 or object.get_total_deposit != 0 %}; {% endif %} {% translate "Shipping cost" %} : {{ object.delta_transport }} {% endif %} </small> <br> {% if object.delta_price_with_tax != 0 %} {% if object.delta_price_with_tax < 0 %}{% translate "Reduction granted" %}{% else %}{% translate "Surcharge" %}{% endif %} : {{ object.get_abs_delta_price_with_tax }}<br> {% endif %} {% endif %} {% endif %} {% for bank_account in bank_account_set %} {% if bank_account.bank_amount_in != 0 %} <span class="glyphicon glyphicon-minus" aria-hidden="true"></span> {% translate "Provision" %} : {% if bank_account.operation_comment %} {{ bank_account.operation_comment }} {% else %} {% translate "Refund" %} {% endif %} : {{ bank_account.bank_amount_in }} <small>({{ bank_account.operation_date | date:"DATE_FORMAT" }})</small><br> {% endif %} {% if bank_account.bank_amount_out != 0 %} <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> {% translate "Refund" %} : {% if bank_account.operation_comment %} {{ bank_account.operation_comment }} {% else %} {% translate "Payment" %} {% endif %} : {{ bank_account.bank_amount_out }} <small>({{ bank_account.operation_date | date:"DATE_FORMAT" }})</small><br> {% endif %} {% endfor %} <div class="panel"> {% if object %} <h4><span class="glyphicon glyphicon-log-in" aria-hidden="true"></span> {% translate "New balance" %} : {{ object.get_negative_balance }} <small>({{ object.date_balance | date:"DATE_FORMAT" }}{% if not next_producer_invoice_id and object.invoice_sort_order %} - {% translate "last sale" %}{% endif %})</small> </h4> {% else %} <h4><span class="glyphicon glyphicon-log-in" aria-hidden="true"></span> {% translate "New balance" %} : {{ producer.get_negative_balance }} <small>({{ producer.date_balance | date:"DATE_FORMAT" }}{% if not next_producer_invoice_id %} - {% translate "last sale" %}{% endif %})</small> </h4> {% endif %} <span id="basket_message">{{ basket_message }}</span> </div> <center> <div class="btn-group"> {% if previous_producer_invoice_id %} <a href="{% if uuid %}{% url 'repanier:producer_invoice_uuid_view' previous_producer_invoice_id uuid %}{% else %}{% url 'repanier:producer_invoice_view' previous_producer_invoice_id %}?producer={{ object.producer.id }}{% endif %}" class="btn btn-info btn-disabled">&nbsp;&nbsp;&nbsp;&nbsp;<span class="glyphicon glyphicon-arrow-left"></span>&nbsp;&nbsp;&nbsp;&nbsp;</a> {% endif %} {% if next_producer_invoice_id %} <a href="{% if uuid %}{% url 'repanier:producer_invoice_uuid_view' 0 uuid %}{% else %}{% url 'repanier:producer_invoice_view' 0 %}?producer={{ object.producer.id }}{% endif %}" class="btn btn-disabled"> {% translate "Invoice" %} </a> {% else %} <span class="btn btn-disabled">{% translate "Invoice" %}</span> {% endif %} {% if next_producer_invoice_id %} <a href=" {% if uuid %}{% url 'repanier:producer_invoice_uuid_view' next_producer_invoice_id uuid %}{% else %}{% url 'repanier:producer_invoice_view' next_producer_invoice_id %}?producer={{ object.producer.id }}{% endif %}" class="btn btn-info btn-disabled">&nbsp;&nbsp;&nbsp;&nbsp;<span class="glyphicon glyphicon-arrow-right"></span>&nbsp;&nbsp;&nbsp;&nbsp;</a> {% endif %} </div> </center> {% if offer_item_set %} <br> <table class="table table-hover table-bordered"> <thead> <tr> <th> {% translate "Reference" %} </th> <th> {% translate "Product" %} </th> <th> {% translate "Qty" %} </th> <th> {% translate "Unit price" %} </th> <th> {% translate "Total price" %} </th> <tr> </thead> <tbody> {% for offer_item in offer_item_set %} <tr> <td> {% if offer_item.reference|length < 36 %} {{ offer_item.reference }} {% endif %} </td> <td> {{ offer_item.get_long_name_with_producer_price }} </td> <td align="right"> {{ offer_item.quantity_invoiced }} </td> <td align="right"> {{ offer_item.get_producer_unit_price_invoiced }}{% if offer_item.unit_deposit != 0 %}, โ™ป {{ offer_item.unit_deposit }}{% endif %} </td> <td align="right"> {{ offer_item.get_producer_row_price_invoiced }} </td> <tr> {% endfor %} </tbody> </table> {% else %} <h4>{% translate "No purchase found" %}</h4> {% endif %} </div> </div> <div class="hidden-xs"> <br> </div> {% addtoblock "lastjs" %} <script> $(document).ready(function () { lien = '{% url 'repanier:order_name' %}'; $.ajax({ url: lien, cache: false, async: false, success: function (result) { $.each(result, function (key, val) { $(key).html(val); }); } {# success: function (result) {#} {# $("#my_name").html(result);#} {# },#} {# error: function (result) {#} {# $("#my_name").html("{% translate "Retry5" %}");#} {# }#} }); }); </script> {% endaddtoblock %} {% addtoblock "lastjs" %} {% if not next_producer_invoice_id %} <script> $(document).ready(function () { var lien = '{% url 'repanier:producer_basket_message_form_ajax' producer.id producer.uuid %}'; $.ajax({ url: lien, cache: false, dataType: 'json', async: true, success: function (result) { $.each(result, function (key, val) { $(key).html(val); }); } {# success: function (result) {#} {# $.each(result, function (key, val) {#} {# $(val.id).html(val.html);#} {# });#} {# },#} {# error: function (result) {#} {# $("#basket_message").html("{% translate "Retry" %}");#} {# }#} }); }); </script> {% endif %} {% endaddtoblock %} {% endblock %}
pcolmant/repanier
repanier/templates/bs3/repanier/producer_invoice_form.html
HTML
gpl-3.0
9,170
/* Copyright (c) 1993-2008, Cognitive Technologies All rights reserved. ะ ะฐะทั€ะตัˆะฐะตั‚ัั ะฟะพะฒั‚ะพั€ะฝะพะต ั€ะฐัะฟั€ะพัั‚ั€ะฐะฝะตะฝะธะต ะธ ะธัะฟะพะปัŒะทะพะฒะฐะฝะธะต ะบะฐะบ ะฒ ะฒะธะดะต ะธัั…ะพะดะฝะพะณะพ ะบะพะดะฐ, ั‚ะฐะบ ะธ ะฒ ะดะฒะพะธั‡ะฝะพะน ั„ะพั€ะผะต, ั ะธะทะผะตะฝะตะฝะธัะผะธ ะธะปะธ ะฑะตะท, ะฟั€ะธ ัะพะฑะปัŽะดะตะฝะธะธ ัะปะตะดัƒัŽั‰ะธั… ัƒัะปะพะฒะธะน: * ะŸั€ะธ ะฟะพะฒั‚ะพั€ะฝะพะผ ั€ะฐัะฟั€ะพัั‚ั€ะฐะฝะตะฝะธะธ ะธัั…ะพะดะฝะพะณะพ ะบะพะดะฐ ะดะพะปะถะฝั‹ ะพัั‚ะฐะฒะฐั‚ัŒัั ัƒะบะฐะทะฐะฝะฝะพะต ะฒั‹ัˆะต ัƒะฒะตะดะพะผะปะตะฝะธะต ะพะฑ ะฐะฒั‚ะพั€ัะบะพะผ ะฟั€ะฐะฒะต, ัั‚ะพั‚ ัะฟะธัะพะบ ัƒัะปะพะฒะธะน ะธ ะฟะพัะปะตะดัƒัŽั‰ะธะน ะพั‚ะบะฐะท ะพั‚ ะณะฐั€ะฐะฝั‚ะธะน. * ะŸั€ะธ ะฟะพะฒั‚ะพั€ะฝะพะผ ั€ะฐัะฟั€ะพัั‚ั€ะฐะฝะตะฝะธะธ ะดะฒะพะธั‡ะฝะพะณะพ ะบะพะดะฐ ะฒ ะดะพะบัƒะผะตะฝั‚ะฐั†ะธะธ ะธ/ะธะปะธ ะฒ ะดั€ัƒะณะธั… ะผะฐั‚ะตั€ะธะฐะปะฐั…, ะฟะพัั‚ะฐะฒะปัะตะผั‹ั… ะฟั€ะธ ั€ะฐัะฟั€ะพัั‚ั€ะฐะฝะตะฝะธะธ, ะดะพะปะถะฝั‹ ัะพั…ั€ะฐะฝัั‚ัŒัั ัƒะบะฐะทะฐะฝะฝะฐั ะฒั‹ัˆะต ะธะฝั„ะพั€ะผะฐั†ะธั ะพะฑ ะฐะฒั‚ะพั€ัะบะพะผ ะฟั€ะฐะฒะต, ัั‚ะพั‚ ัะฟะธัะพะบ ัƒัะปะพะฒะธะน ะธ ะฟะพัะปะตะดัƒัŽั‰ะธะน ะพั‚ะบะฐะท ะพั‚ ะณะฐั€ะฐะฝั‚ะธะน. * ะะธ ะฝะฐะทะฒะฐะฝะธะต Cognitive Technologies, ะฝะธ ะธะผะตะฝะฐ ะตะต ัะพั‚ั€ัƒะดะฝะธะบะพะฒ ะฝะต ะผะพะณัƒั‚ ะฑั‹ั‚ัŒ ะธัะฟะพะปัŒะทะพะฒะฐะฝั‹ ะฒ ะบะฐั‡ะตัั‚ะฒะต ัั€ะตะดัั‚ะฒะฐ ะฟะพะดะดะตั€ะถะบะธ ะธ/ะธะปะธ ะฟั€ะพะดะฒะธะถะตะฝะธั ะฟั€ะพะดัƒะบั‚ะพะฒ, ะพัะฝะพะฒะฐะฝะฝั‹ั… ะฝะฐ ัั‚ะพะผ ะŸะž, ะฑะตะท ะฟั€ะตะดะฒะฐั€ะธั‚ะตะปัŒะฝะพะณะพ ะฟะธััŒะผะตะฝะฝะพะณะพ ั€ะฐะทั€ะตัˆะตะฝะธั. ะญะขะ ะŸะ ะžะ“ะ ะะœะœะ ะŸะ ะ•ะ”ะžะกะขะะ’ะ›ะ•ะะ ะ’ะ›ะะ”ะ•ะ›ะฌะฆะะœะ˜ ะะ’ะขะžะ ะกะšะ˜ะฅ ะŸะ ะะ’ ะ˜/ะ˜ะ›ะ˜ ะ”ะ ะฃะ“ะ˜ะœะ˜ ะ›ะ˜ะฆะะœะ˜ "ะšะะš ะžะะ ะ•ะกะขะฌ" ะ‘ะ•ะ— ะšะะšะžะ“ะž-ะ›ะ˜ะ‘ะž ะ’ะ˜ะ”ะ ะ“ะะ ะะะขะ˜ะ™, ะ’ะซะ ะะ–ะ•ะะะซะฅ ะฏะ’ะะž ะ˜ะ›ะ˜ ะŸะžะ”ะ ะะ—ะฃะœะ•ะ’ะะ•ะœะซะฅ, ะ’ะšะ›ะฎะงะะฏ ะ“ะะ ะะะขะ˜ะ˜ ะšะžะœะœะ•ะ ะงะ•ะกะšะžะ™ ะฆะ•ะะะžะกะขะ˜ ะ˜ ะŸะ ะ˜ะ“ะžะ”ะะžะกะขะ˜ ะ”ะ›ะฏ ะšะžะะšะ ะ•ะขะะžะ™ ะฆะ•ะ›ะ˜, ะะž ะะ• ะžะ“ะ ะะะ˜ะงะ˜ะ’ะะฏะกะฌ ะ˜ะœะ˜. ะะ˜ ะ’ะ›ะะ”ะ•ะ›ะ•ะฆ ะะ’ะขะžะ ะกะšะ˜ะฅ ะŸะ ะะ’ ะ˜ ะะ˜ ะžะ”ะะž ะ”ะ ะฃะ“ะžะ• ะ›ะ˜ะฆะž, ะšะžะขะžะ ะžะ• ะœะžะ–ะ•ะข ะ˜ะ—ะœะ•ะะฏะขะฌ ะ˜/ะ˜ะ›ะ˜ ะŸะžะ’ะขะžะ ะะž ะ ะะกะŸะ ะžะกะขะ ะะะฏะขะฌ ะŸะ ะžะ“ะ ะะœะœะฃ, ะะ˜ ะ’ ะšะžะ•ะœ ะกะ›ะฃะงะะ• ะะ• ะะ•ะกะะข ะžะขะ’ะ•ะขะกะขะ’ะ•ะะะžะกะขะ˜, ะ’ะšะ›ะฎะงะะฏ ะ›ะฎะ‘ะซะ• ะžะ‘ะฉะ˜ะ•, ะกะ›ะฃะงะะ™ะะซะ•, ะกะŸะ•ะฆะ˜ะะ›ะฌะะซะ• ะ˜ะ›ะ˜ ะŸะžะกะ›ะ•ะ”ะžะ’ะะ’ะจะ˜ะ• ะฃะ‘ะซะขะšะ˜, ะกะ’ะฏะ—ะะะะซะ• ะก ะ˜ะกะŸะžะ›ะฌะ—ะžะ’ะะะ˜ะ•ะœ ะ˜ะ›ะ˜ ะŸะžะะ•ะกะ•ะะะซะ• ะ’ะกะ›ะ•ะ”ะกะขะ’ะ˜ะ• ะะ•ะ’ะžะ—ะœะžะ–ะะžะกะขะ˜ ะ˜ะกะŸะžะ›ะฌะ—ะžะ’ะะะ˜ะฏ ะŸะ ะžะ“ะ ะะœะœะซ (ะ’ะšะ›ะฎะงะะฏ ะŸะžะขะ•ะ ะ˜ ะ”ะะะะซะฅ, ะ˜ะ›ะ˜ ะ”ะะะะซะ•, ะกะขะะ’ะจะ˜ะ• ะะ•ะ“ะžะ”ะะซะœะ˜, ะ˜ะ›ะ˜ ะฃะ‘ะซะขะšะ˜ ะ˜/ะ˜ะ›ะ˜ ะŸะžะขะ•ะ ะ˜ ะ”ะžะฅะžะ”ะžะ’, ะŸะžะะ•ะกะ•ะะะซะ• ะ˜ะ—-ะ—ะ ะ”ะ•ะ™ะกะขะ’ะ˜ะ™ ะขะ ะ•ะขะฌะ˜ะฅ ะ›ะ˜ะฆ ะ˜/ะ˜ะ›ะ˜ ะžะขะšะะ—ะ ะŸะ ะžะ“ะ ะะœะœะซ ะ ะะ‘ะžะขะะขะฌ ะกะžะ’ะœะ•ะกะขะะž ะก ะ”ะ ะฃะ“ะ˜ะœะ˜ ะŸะ ะžะ“ะ ะะœะœะะœะ˜, ะะž ะะ• ะžะ“ะ ะะะ˜ะงะ˜ะ’ะะฏะกะฌ ะญะขะ˜ะœะ˜ ะกะ›ะฃะงะะฏะœะ˜), ะะž ะะ• ะžะ“ะ ะะะ˜ะงะ˜ะ’ะะฏะกะฌ ะ˜ะœะ˜, ะ”ะะ–ะ• ะ•ะกะ›ะ˜ ะขะะšะžะ™ ะ’ะ›ะะ”ะ•ะ›ะ•ะฆ ะ˜ะ›ะ˜ ะ”ะ ะฃะ“ะžะ• ะ›ะ˜ะฆะž ะ‘ะซะ›ะ˜ ะ˜ะ—ะ’ะ•ะฉะ•ะะซ ะž ะ’ะžะ—ะœะžะ–ะะžะกะขะ˜ ะขะะšะ˜ะฅ ะฃะ‘ะซะขะšะžะ’ ะ˜ ะŸะžะขะ•ะ ะฌ. 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 Cognitive Technologies 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 THE COPYRIGHT OWNER 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. */ #include <stdio.h> /* interface my */ #include "gystogra.h" /* interface our util */ #include "skew1024.h" using namespace cf; /*---------------------------------------------------------------------------*/ Bool MakeTopBotGysts(Rect16 *pRc, int nRc, int32_t Skew, int MaxSize, Un_GYST *pBegGt, Un_GYST *pEndGt) { int MinBeg, MaxBeg, MinEnd, MaxEnd, i, End; long dy, ddy; int32_t x, yBeg, yEnd; int32_t SkewSquar; int *pBegSig, *pEndSig; SkewSquar = Skew * Skew; pBegGt->nElem = nRc; pEndGt->nElem = nRc; pBegSig = pBegGt->Signal; pEndSig = pEndGt->Signal; /* ะŸั€ะตะดะตะปัŒะฝั‹ะต ะทะฝะฐั‡ะตะฝะธั ะฟั€ะพะตะบั†ะธะน */ x = (pRc[0].left + pRc[0].right + 1) / 2; dy = ((-Skew * x + 0x200) >> 10); yBeg = pRc[0].top; yEnd = pRc[0].bottom; ddy = ((SkewSquar * yBeg + 0x100000) >> 21); yBeg += dy; yBeg -= ddy; ddy = ((SkewSquar * yEnd + 0x100000) >> 21); yEnd += dy; yEnd -= ddy; MinBeg = yBeg; MaxBeg = yBeg; MinEnd = yEnd; MaxEnd = yEnd; for (i = 1; i < nRc; i++) { x = (pRc[i].left + pRc[i].right + 1) / 2; dy = ((-Skew * x + 0x200) >> 10); yBeg = pRc[i].top; yEnd = pRc[i].bottom; ddy = ((SkewSquar * yBeg + 0x100000) >> 21); yBeg += dy; yBeg -= ddy; ddy = ((SkewSquar * yEnd + 0x100000) >> 21); yEnd += dy; yEnd -= ddy; if (MinBeg > yBeg) MinBeg = yBeg; if (MaxBeg < yBeg) MaxBeg = yBeg; if (MinEnd > yEnd) MinEnd = yEnd; if (MaxEnd < yEnd) MaxEnd = yEnd; } if (MaxBeg - MinBeg >= MaxSize) return FALSE; if (MaxEnd - MinEnd >= MaxSize) return FALSE; pBegGt->Shift = MinBeg; pBegGt->End = MaxBeg - MinBeg; pEndGt->Shift = MinEnd; pEndGt->End = MaxEnd - MinEnd; End = pBegGt->End; if (End < pEndGt->End) End = pEndGt->End; for (i = 0; i <= End; i++) { pBegSig[i] = 0; pEndSig[i] = 0; } for (i = 0; i < nRc; i++) { x = (pRc[i].left + pRc[i].right + 1) / 2; dy = ((-Skew * x + 0x200) >> 10); yBeg = pRc[i].top; yEnd = pRc[i].bottom; ddy = ((SkewSquar * yBeg + 0x100000) >> 21); yBeg += dy; yBeg -= ddy; ddy = ((SkewSquar * yEnd + 0x100000) >> 21); yEnd += dy; yEnd -= ddy; pBegSig[yBeg - MinBeg]++; pEndSig[yEnd - MinEnd]++; } return TRUE; } /*---------------------------------------------------------------------------*/ Bool MakeLefRigGysts(Rect16 *pRc, int nRc, int32_t Skew, int MaxSize, Un_GYST *pBegGt, Un_GYST *pEndGt) { int MinBeg, MaxBeg, MinEnd, MaxEnd, i, End; long dx, ddx; int32_t y, xBeg, xEnd; int32_t SkewSquar; int *pBegSig, *pEndSig; SkewSquar = Skew * Skew; pBegGt->nElem = nRc; pEndGt->nElem = nRc; pBegSig = pBegGt->Signal; pEndSig = pEndGt->Signal; /* ะŸั€ะตะดะตะปัŒะฝั‹ะต ะทะฝะฐั‡ะตะฝะธั ะฟั€ะพะตะบั†ะธะน */ y = (pRc[0].top + pRc[0].bottom + 1) / 2; dx = ((-Skew * y + 0x200) >> 10); xBeg = pRc[0].left; xEnd = pRc[0].right; ddx = ((SkewSquar * xBeg + 0x100000) >> 21); xBeg -= dx; xBeg -= ddx; ddx = ((SkewSquar * xEnd + 0x100000) >> 21); xEnd -= dx; xEnd -= ddx; MinBeg = xBeg; MaxBeg = xBeg; MinEnd = xEnd; MaxEnd = xEnd; for (i = 1; i < nRc; i++) { y = (pRc[i].top + pRc[i].bottom + 1) / 2; dx = ((-Skew * y + 0x200) >> 10); xBeg = pRc[i].left; xEnd = pRc[i].right; ddx = ((SkewSquar * xBeg + 0x100000) >> 21); xBeg -= dx; xBeg -= ddx; ddx = ((SkewSquar * xEnd + 0x100000) >> 21); xEnd -= dx; xEnd -= ddx; if (MinBeg > xBeg) MinBeg = xBeg; if (MaxBeg < xBeg) MaxBeg = xBeg; if (MinEnd > xEnd) MinEnd = xEnd; if (MaxEnd < xEnd) MaxEnd = xEnd; } if (MaxBeg - MinBeg >= MaxSize) return FALSE; if (MaxEnd - MinEnd >= MaxSize) return FALSE; pBegGt->Shift = MinBeg; pBegGt->End = MaxBeg - MinBeg; pEndGt->Shift = MinEnd; pEndGt->End = MaxEnd - MinEnd; End = pBegGt->End; if (End < pEndGt->End) End = pEndGt->End; for (i = 0; i <= End; i++) { pBegSig[i] = 0; pEndSig[i] = 0; } for (i = 0; i < nRc; i++) { y = (pRc[i].top + pRc[i].bottom + 1) / 2; dx = ((-Skew * y + 0x200) >> 10); xBeg = pRc[i].left; xEnd = pRc[i].right; ddx = ((SkewSquar * xBeg + 0x100000) >> 21); xBeg -= dx; xBeg -= ddx; ddx = ((SkewSquar * xEnd + 0x100000) >> 21); xEnd -= dx; xEnd -= ddx; pBegSig[xBeg - MinBeg]++; pEndSig[xEnd - MinEnd]++; } return TRUE; } /*---------------------------------------------------------------------------*/ Bool MakeTopMidBotGysts(Rect16 *pRc, int nRc, int32_t Skew, int MaxSize, Un_GYST *pBegGt, Un_GYST *pMidGt, Un_GYST *pEndGt) { int MinBeg, MaxBeg, MinMid, MaxMid, MinEnd, MaxEnd, i, End; long dy, ddy; int32_t x, yBeg, yMid, yEnd; int32_t SkewSquar; int *pBegSig, *pMidSig, *pEndSig; SkewSquar = Skew * Skew; pBegGt->nElem = nRc; pMidGt->nElem = nRc; pEndGt->nElem = nRc; pBegSig = pBegGt->Signal; pMidSig = pMidGt->Signal; pEndSig = pEndGt->Signal; /* ะŸั€ะตะดะตะปัŒะฝั‹ะต ะทะฝะฐั‡ะตะฝะธั ะฟั€ะพะตะบั†ะธะน */ x = (pRc[0].left + pRc[0].right + 1) / 2; dy = ((-Skew * x + 0x200) >> 10); yBeg = pRc[0].top; yMid = (pRc[0].top + pRc[0].bottom + 1) / 2; yEnd = pRc[0].bottom; ddy = ((SkewSquar * yBeg + 0x100000) >> 21); yBeg += dy; yBeg -= ddy; ddy = ((SkewSquar * yMid + 0x100000) >> 21); yMid += dy; yMid -= ddy; ddy = ((SkewSquar * yEnd + 0x100000) >> 21); yEnd += dy; yEnd -= ddy; MinBeg = yBeg; MaxBeg = yBeg; MinMid = yMid; MaxMid = yMid; MinEnd = yEnd; MaxEnd = yEnd; for (i = 1; i < nRc; i++) { x = (pRc[i].left + pRc[i].right + 1) / 2; dy = ((-Skew * x + 0x200) >> 10); yBeg = pRc[i].top; yMid = (pRc[i].top + pRc[i].bottom + 1) / 2; yEnd = pRc[i].bottom; ddy = ((SkewSquar * yBeg + 0x100000) >> 21); yBeg += dy; yBeg -= ddy; ddy = ((SkewSquar * yMid + 0x100000) >> 21); yMid += dy; yMid -= ddy; ddy = ((SkewSquar * yEnd + 0x100000) >> 21); yEnd += dy; yEnd -= ddy; if (MinBeg > yBeg) MinBeg = yBeg; if (MaxBeg < yBeg) MaxBeg = yBeg; if (MinMid > yMid) MinMid = yMid; if (MaxMid < yMid) MaxMid = yMid; if (MinEnd > yEnd) MinEnd = yEnd; if (MaxEnd < yEnd) MaxEnd = yEnd; } if (MaxBeg - MinBeg >= MaxSize) return FALSE; if (MaxMid - MinMid >= MaxSize) return FALSE; if (MaxEnd - MinEnd >= MaxSize) return FALSE; pBegGt->Shift = MinBeg; pBegGt->End = MaxBeg - MinBeg; pMidGt->Shift = MinMid; pMidGt->End = MaxMid - MinMid; pEndGt->Shift = MinEnd; pEndGt->End = MaxEnd - MinEnd; End = pBegGt->End; if (End < pMidGt->End) End = pMidGt->End; if (End < pEndGt->End) End = pEndGt->End; for (i = 0; i <= End; i++) { pBegSig[i] = 0; pMidSig[i] = 0; pEndSig[i] = 0; } for (i = 0; i < nRc; i++) { x = (pRc[i].left + pRc[i].right + 1) / 2; dy = ((-Skew * x + 0x200) >> 10); yBeg = pRc[i].top; yMid = (pRc[i].top + pRc[i].bottom + 1) / 2; yEnd = pRc[i].bottom; ddy = ((SkewSquar * yBeg + 0x100000) >> 21); yBeg += dy; yBeg -= ddy; ddy = ((SkewSquar * yMid + 0x100000) >> 21); yMid += dy; yMid -= ddy; ddy = ((SkewSquar * yEnd + 0x100000) >> 21); yEnd += dy; yEnd -= ddy; pBegSig[yBeg - MinBeg]++; pMidSig[yMid - MinMid]++; pEndSig[yEnd - MinEnd]++; } return TRUE; } /*---------------------------------------------------------------------------*/ Bool MakeLefMidRigGysts(Rect16 *pRc, int nRc, int32_t Skew, int MaxSize, Un_GYST *pBegGt, Un_GYST *pMidGt, Un_GYST *pEndGt) { int MinBeg, MaxBeg, MinMid, MaxMid, MinEnd, MaxEnd, i, End; long dx, ddx; int32_t y, xBeg, xMid, xEnd; int32_t SkewSquar; int *pBegSig, *pMidSig, *pEndSig; SkewSquar = Skew * Skew; pBegGt->nElem = nRc; pMidGt->nElem = nRc; pEndGt->nElem = nRc; pBegSig = pBegGt->Signal; pMidSig = pMidGt->Signal; pEndSig = pEndGt->Signal; /* ะŸั€ะตะดะตะปัŒะฝั‹ะต ะทะฝะฐั‡ะตะฝะธั ะฟั€ะพะตะบั†ะธะน */ y = (pRc[0].top + pRc[0].bottom + 1) / 2; dx = ((-Skew * y + 0x200) >> 10); xBeg = pRc[0].left; xMid = (pRc[0].left + pRc[0].right + 1) / 2; xEnd = pRc[0].right; ddx = ((SkewSquar * xBeg + 0x100000) >> 21); xBeg -= dx; xBeg -= ddx; ddx = ((SkewSquar * xMid + 0x100000) >> 21); xMid -= dx; xMid -= ddx; ddx = ((SkewSquar * xEnd + 0x100000) >> 21); xEnd -= dx; xEnd -= ddx; MinBeg = xBeg; MaxBeg = xBeg; MinMid = xMid; MaxMid = xMid; MinEnd = xEnd; MaxEnd = xEnd; for (i = 1; i < nRc; i++) { y = (pRc[i].top + pRc[i].bottom + 1) / 2; dx = ((-Skew * y + 0x200) >> 10); xBeg = pRc[i].left; xMid = (pRc[i].left + pRc[i].right + 1) / 2; xEnd = pRc[i].right; ddx = ((SkewSquar * xBeg + 0x100000) >> 21); xBeg -= dx; xBeg -= ddx; ddx = ((SkewSquar * xMid + 0x100000) >> 21); xMid -= dx; xMid -= ddx; ddx = ((SkewSquar * xEnd + 0x100000) >> 21); xEnd -= dx; xEnd -= ddx; if (MinBeg > xBeg) MinBeg = xBeg; if (MaxBeg < xBeg) MaxBeg = xBeg; if (MinMid > xMid) MinMid = xMid; if (MaxMid < xMid) MaxMid = xMid; if (MinEnd > xEnd) MinEnd = xEnd; if (MaxEnd < xEnd) MaxEnd = xEnd; } if (MaxBeg - MinBeg >= MaxSize) return FALSE; if (MaxMid - MinMid >= MaxSize) return FALSE; if (MaxEnd - MinEnd >= MaxSize) return FALSE; pBegGt->Shift = MinBeg; pBegGt->End = MaxBeg - MinBeg; pMidGt->Shift = MinMid; pMidGt->End = MaxMid - MinMid; pEndGt->Shift = MinEnd; pEndGt->End = MaxEnd - MinEnd; End = pBegGt->End; if (End < pMidGt->End) End = pMidGt->End; if (End < pEndGt->End) End = pEndGt->End; for (i = 0; i <= End; i++) { pBegSig[i] = 0; pMidSig[i] = 0; pEndSig[i] = 0; } for (i = 0; i < nRc; i++) { y = (pRc[i].top + pRc[i].bottom + 1) / 2; dx = ((-Skew * y + 0x200) >> 10); xBeg = pRc[i].left; xMid = (pRc[i].left + pRc[i].right + 1) / 2; xEnd = pRc[i].right; ddx = ((SkewSquar * xBeg + 0x100000) >> 21); xBeg -= dx; xBeg -= ddx; ddx = ((SkewSquar * xMid + 0x100000) >> 21); xMid -= dx; xMid -= ddx; ddx = ((SkewSquar * xEnd + 0x100000) >> 21); xEnd -= dx; xEnd -= ddx; pBegSig[xBeg - MinBeg]++; pMidSig[xMid - MinMid]++; pEndSig[xEnd - MinEnd]++; } return TRUE; } int ScoreComp(const Rect16 *pRcReg, const int32_t Skew, const Rect16 *pRc, const int nRc) { int i, k; Point PosIdeal; k = 0; for (i = 0; i < nRc; i++) { if (pRc[i].right - pRc[i].left < 2) continue; if (pRc[i].right - pRc[i].left > 100) continue; if (pRc[i].bottom - pRc[i].top < 2) continue; if (pRc[i].bottom - pRc[i].top > 100) continue; PosIdeal.rx() = (int) (.5 * (pRc[i].left + pRc[i].right + 1)); PosIdeal.ry() = (int) (.5 * (pRc[i].top + pRc[i].bottom + 1)); PosIdeal.deskew(-Skew); if (PosIdeal.x() > pRcReg->right) continue; if (PosIdeal.x() < pRcReg->left) continue; if (PosIdeal.y() > pRcReg->bottom) continue; if (PosIdeal.y() < pRcReg->top) continue; k++; } return k; } /*---------------------------------------------------------------------------*/ void MakeNormVertGyst(const Rect16 *pRcReg, const int32_t Skew, const Rect16 *pRc, const int nRc, int *Sig) { int i, k; Point BegDirIdeal; Point EndDirIdeal; for (i = 0; i < nRc; i++) { if (pRc[i].right - pRc[i].left < 2) continue; if (pRc[i].right - pRc[i].left > 100) continue; if (pRc[i].bottom - pRc[i].top < 2) continue; if (pRc[i].bottom - pRc[i].top > 100) continue; BegDirIdeal.rx() = (int) (.5 * (pRc[i].left + pRc[i].right + 1)); BegDirIdeal.ry() = pRc[i].top; BegDirIdeal.deskew(-Skew); if (BegDirIdeal.x() > pRcReg->right) continue; if (BegDirIdeal.x() < pRcReg->left) continue; if (BegDirIdeal.y() >= pRcReg->bottom) continue; if (BegDirIdeal.y() < pRcReg->top) BegDirIdeal.ry() = pRcReg->top; EndDirIdeal.rx() = (int) (.5 * (pRc[i].left + pRc[i].right + 1)); EndDirIdeal.ry() = pRc[i].bottom; EndDirIdeal.deskew(-Skew); if (EndDirIdeal.y() <= pRcReg->top) continue; if (EndDirIdeal.y() > pRcReg->bottom) EndDirIdeal.ry() = pRcReg->bottom; for (k = BegDirIdeal.y(); k <= EndDirIdeal.y(); k++) Sig[k - pRcReg->top]++; } } /*---------------------------------------------------------------------------*/ Bool MakeVertGysts(Rect16 *pRc, int nRc, int32_t Skew, int Amnist, int MaxSize, Un_GYST *pVerGt, int *pWhatDo) { int MinBeg, MaxBeg, MinEnd, MaxEnd, CurBeg, CurEnd, i, End, k, iFirst; Point BegDirIdeal; Point EndDirIdeal; iFirst = -1; for (i = 0; i < nRc; i++) { if (pWhatDo[i] != 1) continue; iFirst = i; break; } if (iFirst == -1) return FALSE; /* ะŸั€ะตะดะตะปัŒะฝั‹ะต ะทะฝะฐั‡ะตะฝะธั ะฟั€ะพะตะบั†ะธะน */ BegDirIdeal.rx() = (int) (.5 * (pRc[iFirst].left + pRc[iFirst].right + 1)); BegDirIdeal.ry() = pRc[iFirst].top; BegDirIdeal.deskew(-Skew); MinBeg = BegDirIdeal.y(); MaxBeg = BegDirIdeal.y(); EndDirIdeal.rx() = (int) (.5 * (pRc[iFirst].left + pRc[iFirst].right + 1)); EndDirIdeal.ry() = pRc[iFirst].bottom; EndDirIdeal.deskew(-Skew); MinEnd = EndDirIdeal.y(); MaxEnd = EndDirIdeal.y(); for (i = iFirst + 1; i < nRc; i++) { if (pWhatDo[i] != 1) continue; BegDirIdeal.rx() = (int) (.5 * (pRc[i].left + pRc[i].right + 1)); BegDirIdeal.ry() = pRc[i].top; BegDirIdeal.deskew(-Skew); CurBeg = BegDirIdeal.y(); EndDirIdeal.rx() = (int) (.5 * (pRc[i].left + pRc[i].right + 1)); EndDirIdeal.ry() = pRc[i].bottom; EndDirIdeal.deskew(-Skew); CurEnd = EndDirIdeal.y(); if (MinBeg > CurBeg) MinBeg = CurBeg; if (MaxBeg < CurBeg) MaxBeg = CurBeg; if (MinEnd > CurEnd) MinEnd = CurEnd; if (MaxEnd < CurEnd) MaxEnd = CurEnd; } if (MaxBeg - MinBeg >= MaxSize) return FALSE; if (MaxEnd - MinEnd >= MaxSize) return FALSE; if (MinBeg > MinEnd) return FALSE; if (MaxBeg > MaxEnd) return FALSE; pVerGt->Shift = MinBeg; pVerGt->End = MaxEnd - MinBeg; pVerGt->nElem = nRc; End = pVerGt->End; for (i = 0; i <= End; i++) { pVerGt->Signal[i] = 0; } for (i = 0; i < nRc; i++) { if (pWhatDo[i] != 1) continue; BegDirIdeal.rx() = (int) (.5 * (pRc[i].left + pRc[i].right + 1)); BegDirIdeal.ry() = pRc[i].top; BegDirIdeal.deskew(-Skew); CurBeg = BegDirIdeal.y(); EndDirIdeal.rx() = (int) (.5 * (pRc[i].left + pRc[i].right + 1)); EndDirIdeal.ry() = pRc[i].bottom; EndDirIdeal.deskew(-Skew); CurEnd = EndDirIdeal.y(); for (k = CurBeg + Amnist; k <= CurEnd - Amnist; k++) pVerGt->Signal[k - MinBeg]++; } return TRUE; } /*---------------------------------------------------------------------------*/ void MakeNormHoriGyst(const Rect16 *pRcReg, const int32_t Skew, const Rect16 *pRc, const int nRc, int *Sig) { int i, k; Point BegDirIdeal; Point EndDirIdeal; for (i = 0; i < nRc; i++) { if (pRc[i].right - pRc[i].left < 2) continue; if (pRc[i].right - pRc[i].left > 100) continue; if (pRc[i].bottom - pRc[i].top < 2) continue; if (pRc[i].bottom - pRc[i].top > 100) continue; BegDirIdeal.rx() = pRc[i].left; BegDirIdeal.ry() = (int) (.5 * (pRc[i].top + pRc[i].bottom + 1)); BegDirIdeal.deskew(-Skew); if (BegDirIdeal.y() > pRcReg->bottom) continue; if (BegDirIdeal.y() < pRcReg->top) continue; if (BegDirIdeal.x() >= pRcReg->right) continue; if (BegDirIdeal.x() < pRcReg->left) BegDirIdeal.rx() = pRcReg->left; EndDirIdeal.rx() = pRc[i].right; EndDirIdeal.ry() = (int) (.5 * (pRc[i].top + pRc[i].bottom + 1)); EndDirIdeal.deskew(-Skew); if (EndDirIdeal.x() <= pRcReg->left) continue; if (EndDirIdeal.x() > pRcReg->right) EndDirIdeal.rx() = pRcReg->right; for (k = BegDirIdeal.x(); k <= EndDirIdeal.x(); k++) Sig[k - pRcReg->left]++; } } /*---------------------------------------------------------------------------*/ Bool MakeHoriGysts(Rect16 *pRc, int nRc, int32_t Skew, int MaxSize, Un_GYST *pHorGt, int *pWhatDo) { int MinBeg, MaxBeg, MinEnd, MaxEnd, CurBeg, CurEnd, i, End, k, iFirst; Point BegDirIdeal; Point EndDirIdeal; iFirst = -1; for (i = 0; i < nRc; i++) { if (pWhatDo[i] != 1) continue; iFirst = i; break; } if (iFirst == -1) return FALSE; /* ะŸั€ะตะดะตะปัŒะฝั‹ะต ะทะฝะฐั‡ะตะฝะธั ะฟั€ะพะตะบั†ะธะน */ BegDirIdeal.rx() = pRc[iFirst].left; BegDirIdeal.ry() = (int) (.5 * (pRc[iFirst].top + pRc[iFirst].bottom + 1)); BegDirIdeal.deskew(-Skew); MinBeg = BegDirIdeal.x(); MaxBeg = BegDirIdeal.x(); EndDirIdeal.rx() = pRc[iFirst].right; EndDirIdeal.ry() = (int) (.5 * (pRc[iFirst].top + pRc[iFirst].bottom + 1)); EndDirIdeal.deskew(-Skew); MinEnd = EndDirIdeal.x(); MaxEnd = EndDirIdeal.x(); for (i = iFirst + 1; i < nRc; i++) { if (pWhatDo[i] != 1) continue; BegDirIdeal.rx() = pRc[i].left; BegDirIdeal.ry() = (int) (.5 * (pRc[i].top + pRc[i].bottom + 1)); BegDirIdeal.deskew(-Skew); CurBeg = BegDirIdeal.x(); EndDirIdeal.rx() = pRc[i].right; EndDirIdeal.ry() = (int) (.5 * (pRc[i].top + pRc[i].bottom + 1)); EndDirIdeal.deskew(-Skew); CurEnd = EndDirIdeal.x(); if (MinBeg > CurBeg) MinBeg = CurBeg; if (MaxBeg < CurBeg) MaxBeg = CurBeg; if (MinEnd > CurEnd) MinEnd = CurEnd; if (MaxEnd < CurEnd) MaxEnd = CurEnd; } if (MaxBeg - MinBeg >= MaxSize) return FALSE; if (MaxEnd - MinEnd >= MaxSize) return FALSE; if (MinBeg > MinEnd) return FALSE; if (MaxBeg > MaxEnd) return FALSE; pHorGt->Shift = MinBeg; pHorGt->End = MaxEnd - MinBeg; pHorGt->nElem = nRc; End = pHorGt->End; for (i = 0; i <= End; i++) { pHorGt->Signal[i] = 0; } for (i = 0; i < nRc; i++) { if (pWhatDo[i] != 1) continue; BegDirIdeal.rx() = pRc[i].left; BegDirIdeal.ry() = (int) (.5 * (pRc[i].top + pRc[i].bottom + 1)); BegDirIdeal.deskew(-Skew); CurBeg = BegDirIdeal.x(); EndDirIdeal.rx() = pRc[i].right; EndDirIdeal.ry() = (int) (.5 * (pRc[i].top + pRc[i].bottom + 1)); EndDirIdeal.deskew(-Skew); CurEnd = EndDirIdeal.x(); for (k = CurBeg; k <= CurEnd; k++) pHorGt->Signal[k - MinBeg]++; } return TRUE; } /*---------------------------------------------------------------------------*/ Bool MakeHoriSrez(Rect16 *pRcId, int nRc, int BegSrez, int EndSrez, int MaxSize, Un_GYST *pHorGt, int *pWhatDo) { int MinBeg, MaxBeg, MinEnd, MaxEnd, CurBeg, CurEnd, i, End, k, iFirst; iFirst = -1; for (i = 0; i < nRc; i++) { if (pWhatDo[i] != 1) continue; iFirst = i; break; } if (iFirst == -1) return FALSE; /* ะŸั€ะตะดะตะปัŒะฝั‹ะต ะทะฝะฐั‡ะตะฝะธั ะฟั€ะพะตะบั†ะธะน */ MinBeg = pRcId[iFirst].left; MaxBeg = MinBeg; MinEnd = pRcId[iFirst].right; MaxEnd = MinEnd; for (i = iFirst + 1; i < nRc; i++) { if (pWhatDo[i] != 1) continue; CurBeg = pRcId[i].left; CurEnd = pRcId[i].right; if (MinBeg > CurBeg) MinBeg = CurBeg; if (MaxBeg < CurBeg) MaxBeg = CurBeg; if (MinEnd > CurEnd) MinEnd = CurEnd; if (MaxEnd < CurEnd) MaxEnd = CurEnd; } if (MaxBeg - MinBeg >= MaxSize) return FALSE; if (MaxEnd - MinEnd >= MaxSize) return FALSE; if (MinBeg > MinEnd) return FALSE; if (MaxBeg > MaxEnd) return FALSE; pHorGt->Shift = MinBeg; pHorGt->End = MaxEnd - MinBeg; pHorGt->nElem = nRc; End = pHorGt->End; for (i = 0; i <= End; i++) { pHorGt->Signal[i] = 0; } for (i = 0; i < nRc; i++) { if (pWhatDo[i] != 1) continue; if (pRcId[i].top >= EndSrez) continue; if (pRcId[i].bottom <= BegSrez) continue; CurBeg = pRcId[i].left; CurEnd = pRcId[i].right; for (k = CurBeg; k <= CurEnd; k++) pHorGt->Signal[k - MinBeg]++; } return TRUE; } /*---------------------------------------------------------------------------*/ Bool MakeVertSrez(Rect16 *pRcId, int nRc, int BegSrez, int EndSrez, int MaxSize, Un_GYST *pVerGt, int *pWhatDo) { int MinBeg, MaxBeg, MinEnd, MaxEnd, CurBeg, CurEnd, i, End, k, iFirst; iFirst = -1; for (i = 0; i < nRc; i++) { if (pWhatDo[i] != 1) continue; iFirst = i; break; } if (iFirst == -1) return FALSE; /* ะŸั€ะตะดะตะปัŒะฝั‹ะต ะทะฝะฐั‡ะตะฝะธั ะฟั€ะพะตะบั†ะธะน */ MinBeg = pRcId[iFirst].top; MaxBeg = MinBeg; MinEnd = pRcId[iFirst].bottom; MaxEnd = MinEnd; for (i = iFirst + 1; i < nRc; i++) { if (pWhatDo[i] != 1) continue; CurBeg = pRcId[i].top; CurEnd = pRcId[i].bottom; if (MinBeg > CurBeg) MinBeg = CurBeg; if (MaxBeg < CurBeg) MaxBeg = CurBeg; if (MinEnd > CurEnd) MinEnd = CurEnd; if (MaxEnd < CurEnd) MaxEnd = CurEnd; } if (MaxBeg - MinBeg >= MaxSize) return FALSE; if (MaxEnd - MinEnd >= MaxSize) return FALSE; if (MinBeg > MinEnd) return FALSE; if (MaxBeg > MaxEnd) return FALSE; pVerGt->Shift = MinBeg; pVerGt->End = MaxEnd - MinBeg; pVerGt->nElem = nRc; End = pVerGt->End; for (i = 0; i <= End; i++) { pVerGt->Signal[i] = 0; } for (i = 0; i < nRc; i++) { if (pWhatDo[i] != 1) continue; if (pRcId[i].left >= EndSrez) continue; if (pRcId[i].right <= BegSrez) continue; CurBeg = pRcId[i].top; CurEnd = pRcId[i].bottom; for (k = CurBeg; k <= CurEnd; k++) pVerGt->Signal[k - MinBeg]++; } return TRUE; } /*---------------------------------------------------------------------------*/ Bool FindNextHole(Un_GYST *pDarkGt, int Beg, int End, int *NewBeg, int *NewEnd) { int i; Bool ret; if (Beg > End) return FALSE; ret = FALSE; for (i = Beg; i <= End; i++) { if (i < pDarkGt->Shift) continue; if (i > pDarkGt->Shift + pDarkGt->End) break; if (pDarkGt->Signal[i - pDarkGt->Shift] > 0) continue; *NewBeg = i; ret = TRUE; break; } if (!ret) return FALSE; for (i = *NewBeg; i <= End; i++) { if (i > pDarkGt->Shift + pDarkGt->End) break; if (pDarkGt->Signal[i - pDarkGt->Shift] > 0) break; *NewEnd = i; continue; } return TRUE; } /*---------------------------------------------------------------------------*/ Bool FindNextHoleWithBound(int MaxSig, Un_GYST *pDarkGt, int Beg, int End, int *NewBeg, int *NewEnd, int MinLent) { int i, Beg_C, End_C; Bool ret; if (Beg > End) return FALSE; Beg_C = Beg; if (Beg_C < pDarkGt->Shift) Beg_C = pDarkGt->Shift; End_C = End; if (End_C > pDarkGt->Shift + pDarkGt->End) End_C = pDarkGt->Shift + pDarkGt->End; if (Beg_C > End_C) return FALSE; while (Beg_C <= End_C) { ret = FALSE; for (i = Beg_C; i <= End_C; i++) { if (pDarkGt->Signal[i - pDarkGt->Shift] > MaxSig) continue; *NewBeg = i; ret = TRUE; break; } if (!ret) return FALSE; *NewEnd = *NewBeg; for (i = *NewBeg; i <= End_C; i++) { if (pDarkGt->Signal[i - pDarkGt->Shift] > MaxSig) break; *NewEnd = i; continue; } if (*NewEnd - *NewBeg >= MinLent) return TRUE; Beg_C = *NewEnd + 1; } return FALSE; } /*---------------------------------------------------------------------------*/ Bool FindNormNextHoleWithBound(int *pSig, int LenSig, int Beg, int End, int *NewBeg, int *NewEnd, int MaxSig, int MinLent) { int i, Beg_C, End_C; Bool ret; if (Beg > End) return FALSE; Beg_C = Beg; if (Beg_C < 0) Beg_C = 0; End_C = End; if (End_C > LenSig - 1) End_C = LenSig - 1; if (Beg_C > End_C) return FALSE; while (Beg_C <= End_C) { ret = FALSE; for (i = Beg_C; i <= End_C; i++) { if (pSig[i] > MaxSig) continue; *NewBeg = i; ret = TRUE; break; } if (!ret) return FALSE; *NewEnd = *NewBeg; for (i = *NewBeg; i <= End_C; i++) { if (pSig[i] > MaxSig) break; *NewEnd = i; continue; } if (*NewEnd - *NewBeg >= MinLent) return TRUE; Beg_C = *NewEnd + 1; } return FALSE; } /*---------------------------------------------------------------------------*/ Bool FindMainHole(int Beg, int End, int MaxSig, Un_GYST *pOrtGt, int *NewBeg, int *NewEnd, int *NewMax) { int CurBeg, CurEnd, i, BegPos; Bool ret; ret = FindNextHoleWithBound(MaxSig, pOrtGt, Beg, End, &CurBeg, &CurEnd, 0); if (!ret) return FALSE; *NewBeg = CurBeg; *NewEnd = CurEnd; BegPos = *NewEnd + 1; while (1) { ret = FindNextHoleWithBound(MaxSig, pOrtGt, BegPos, End, &CurBeg, &CurEnd, 0); if (!ret) break; BegPos = CurEnd + 1; if (*NewEnd - *NewBeg > CurEnd - CurBeg) continue; *NewBeg = CurBeg; *NewEnd = CurEnd; } *NewMax = pOrtGt->Signal[*NewBeg - pOrtGt->Shift]; for (i = *NewBeg; i <= *NewEnd; i++) if (*NewMax < pOrtGt->Signal[i - pOrtGt->Shift]) *NewMax = pOrtGt->Signal[i - pOrtGt->Shift]; return TRUE; } /*---------------------------------------------------------------------------*/
uliss/quneiform
src/usage/gystogra.cpp
C++
gpl-3.0
28,504
/* * _____ _ _ _____ _ * | __ \| | | | / ____| | | * | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| | * | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` | * | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| | * |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_| * | | * |_| * PlotSquared plot management system for Minecraft * Copyright (C) 2021 IntellectualSites * * 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 <https://www.gnu.org/licenses/>. */ package com.plotsquared.core.command; import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.util.task.RunnableVal2; import com.plotsquared.core.util.task.RunnableVal3; import java.util.concurrent.CompletableFuture; /** * SubCommand class * * @see Command#Command(Command, boolean) * @deprecated In favor of normal Command class */ public abstract class SubCommand extends Command { public SubCommand() { super(MainCommand.getInstance(), true); } public SubCommand(Argument<?>... arguments) { this(); setRequiredArguments(arguments); } @Override public CompletableFuture<Boolean> execute( PlotPlayer<?> player, String[] args, RunnableVal3<Command, Runnable, Runnable> confirm, RunnableVal2<Command, CommandResult> whenDone ) { return CompletableFuture.completedFuture(onCommand(player, args)); } public abstract boolean onCommand(PlotPlayer<?> player, String[] args); }
IntellectualCrafters/PlotSquared
Core/src/main/java/com/plotsquared/core/command/SubCommand.java
Java
gpl-3.0
2,321
package com.cloudera.cmf.service.yarn; import com.cloudera.cmf.command.flow.CmdWorkCtx; import com.cloudera.cmf.command.flow.WorkOutput; import com.cloudera.cmf.command.flow.work.OneOffRoleProcCmdWork; import com.cloudera.cmf.model.DbProcess; import com.cloudera.cmf.model.DbRole; import com.cloudera.cmf.model.RoleState; import com.cloudera.cmf.service.ServiceDataProvider; import com.cloudera.cmf.service.components.ProcessHelper; import com.cloudera.enterprise.MessageWithArgs; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; import java.util.List; public class RmFormatStateStoreCmdWork extends OneOffRoleProcCmdWork { private RmFormatStateStoreCmdWork(@JsonProperty("roleId") Long roleId) { super(roleId); } public MessageWithArgs getDescription(CmdWorkCtx ctx) { return MessageWithArgs.of("message.command.rmFormatStateStoreCmdWork.desc", new String[0]); } public String getProcessName() { return "rm-format-state-store"; } protected void beforeProcessCreation(CmdWorkCtx ctx, DbProcess proc, DbRole role) { ctx.getServiceDataProvider().getProcessHelper().runAsRole(proc, role); List args = ImmutableList.of("resourcemanager", "-format-state-store"); proc.setProgram("yarn/yarn.sh"); proc.setArguments(args); } protected RoleState getRoleStateAfterProcess(WorkOutput output, CmdWorkCtx ctx) { return RoleState.STOPPED; } public static RmFormatStateStoreCmdWork of(DbRole r) { Preconditions.checkNotNull(r); Preconditions.checkNotNull(r.getId()); Preconditions.checkArgument(YarnServiceHandler.RoleNames.RESOURCEMANAGER.name().equals(r.getRoleType())); return new RmFormatStateStoreCmdWork(r.getId()); } }
Mapleroid/cm-server
server-5.11.0.src/com/cloudera/cmf/service/yarn/RmFormatStateStoreCmdWork.java
Java
gpl-3.0
1,852
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.5.0_01) on Sun Jul 03 11:32:25 ICT 2005 --> <TITLE> com.golden.gamedev.engine.graphics Class Hierarchy (GTGE Add-Ons) </TITLE> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { parent.document.title="com.golden.gamedev.engine.graphics Class Hierarchy (GTGE Add-Ons)"; } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../../com/golden/gamedev/engine/audio/package-tree.html"><B>PREV</B></A>&nbsp; &nbsp;<A HREF="../../../../../com/golden/gamedev/engine/jogl/package-tree.html"><B>NEXT</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?com/golden/gamedev/engine/graphics/package-tree.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> Hierarchy For Package com.golden.gamedev.engine.graphics </H2> </CENTER> <DL> <DT><B>Package Hierarchies:</B><DD><A HREF="../../../../../overview-tree.html">All Packages</A></DL> <HR> <H2> Class Hierarchy </H2> <UL> <LI TYPE="circle">java.lang.<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang"><B>Object</B></A><UL> <LI TYPE="circle">java.awt.<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/awt/Graphics.html" title="class or interface in java.awt"><B>Graphics</B></A><UL> <LI TYPE="circle">java.awt.<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/awt/Graphics2D.html" title="class or interface in java.awt"><B>Graphics2D</B></A><UL> <LI TYPE="circle">com.golden.gamedev.engine.graphics.<A HREF="../../../../../com/golden/gamedev/engine/graphics/NullGraphics.html" title="class in com.golden.gamedev.engine.graphics"><B>NullGraphics</B></A></UL> </UL> </UL> </UL> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../../com/golden/gamedev/engine/audio/package-tree.html"><B>PREV</B></A>&nbsp; &nbsp;<A HREF="../../../../../com/golden/gamedev/engine/jogl/package-tree.html"><B>NEXT</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?com/golden/gamedev/engine/graphics/package-tree.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> <i>Copyright &copy; 2003-2005 Golden T Studios. All rights reserved. Use is subject to <a href=http://creativecommons.org/licenses/by/2.0/>license terms<a/>.<br><a target=_blank href=http://www.goldenstudios.or.id/>GoldenStudios.or.id</a></i> </BODY> </HTML>
idega/com.idega.games
docs/GTGE-Addons/com/golden/gamedev/engine/graphics/package-tree.html
HTML
gpl-3.0
6,498
package com.github.sandokandias.payments.interfaces.rest.model; import com.github.sandokandias.payments.infrastructure.util.i18n.I18nMessage; import lombok.Data; import java.util.Set; @Data public class ErrorResponse { private Set<I18nMessage> errors; }
sandokandias/spring-boot-ddd
src/main/java/com/github/sandokandias/payments/interfaces/rest/model/ErrorResponse.java
Java
gpl-3.0
262
package pt.uminho.sysbio.biosynthframework.integration.model; import pt.uminho.sysbio.biosynth.integration.io.dao.neo4j.MetaboliteMajorLabel; public interface IntegrationEngine { public IntegrationMap<String, MetaboliteMajorLabel> integrate(IntegrationMap<String, MetaboliteMajorLabel> imap); }
Fxe/biosynth-framework
biosynth-integration/src/main/java/pt/uminho/sysbio/biosynthframework/integration/model/IntegrationEngine.java
Java
gpl-3.0
299
// Copyright 2015 The go-ethereum Authors // This file is part of the go-ethereum library. // // The go-ethereum library 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. // // The go-ethereum library 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 the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. package api import ( "math/big" "github.com/ghostnetwrk/ghostnet/eth" "github.com/ghostnetwrk/ghostnet/rpc/codec" "github.com/ghostnetwrk/ghostnet/rpc/shared" "github.com/ghostnetwrk/ghostnet/xeth" ) const ( ShhApiVersion = "1.0" ) var ( // mapping between methods and handlers shhMapping = map[string]shhhandler{ "shh_version": (*shhApi).Version, "shh_post": (*shhApi).Post, "shh_hasIdentity": (*shhApi).HasIdentity, "shh_newIdentity": (*shhApi).NewIdentity, "shh_newFilter": (*shhApi).NewFilter, "shh_uninstallFilter": (*shhApi).UninstallFilter, "shh_getMessages": (*shhApi).GetMessages, "shh_getFilterChanges": (*shhApi).GetFilterChanges, } ) func newWhisperOfflineError(method string) error { return shared.NewNotAvailableError(method, "whisper offline") } // net callback handler type shhhandler func(*shhApi, *shared.Request) (interface{}, error) // shh api provider type shhApi struct { xeth *xeth.XEth ethereum *eth.Ethereum methods map[string]shhhandler codec codec.ApiCoder } // create a new whisper api instance func NewShhApi(xeth *xeth.XEth, eth *eth.Ethereum, coder codec.Codec) *shhApi { return &shhApi{ xeth: xeth, ethereum: eth, methods: shhMapping, codec: coder.New(nil), } } // collection with supported methods func (self *shhApi) Methods() []string { methods := make([]string, len(self.methods)) i := 0 for k := range self.methods { methods[i] = k i++ } return methods } // Execute given request func (self *shhApi) Execute(req *shared.Request) (interface{}, error) { if callback, ok := self.methods[req.Method]; ok { return callback(self, req) } return nil, shared.NewNotImplementedError(req.Method) } func (self *shhApi) Name() string { return shared.ShhApiName } func (self *shhApi) ApiVersion() string { return ShhApiVersion } func (self *shhApi) Version(req *shared.Request) (interface{}, error) { w := self.xeth.Whisper() if w == nil { return nil, newWhisperOfflineError(req.Method) } return w.Version(), nil } func (self *shhApi) Post(req *shared.Request) (interface{}, error) { w := self.xeth.Whisper() if w == nil { return nil, newWhisperOfflineError(req.Method) } args := new(WhisperMessageArgs) if err := self.codec.Decode(req.Params, &args); err != nil { return nil, err } err := w.Post(args.Payload, args.To, args.From, args.Topics, args.Priority, args.Ttl) if err != nil { return false, err } return true, nil } func (self *shhApi) HasIdentity(req *shared.Request) (interface{}, error) { w := self.xeth.Whisper() if w == nil { return nil, newWhisperOfflineError(req.Method) } args := new(WhisperIdentityArgs) if err := self.codec.Decode(req.Params, &args); err != nil { return nil, err } return w.HasIdentity(args.Identity), nil } func (self *shhApi) NewIdentity(req *shared.Request) (interface{}, error) { w := self.xeth.Whisper() if w == nil { return nil, newWhisperOfflineError(req.Method) } return w.NewIdentity(), nil } func (self *shhApi) NewFilter(req *shared.Request) (interface{}, error) { args := new(WhisperFilterArgs) if err := self.codec.Decode(req.Params, &args); err != nil { return nil, err } id := self.xeth.NewWhisperFilter(args.To, args.From, args.Topics) return newHexNum(big.NewInt(int64(id)).Bytes()), nil } func (self *shhApi) UninstallFilter(req *shared.Request) (interface{}, error) { args := new(FilterIdArgs) if err := self.codec.Decode(req.Params, &args); err != nil { return nil, err } return self.xeth.UninstallWhisperFilter(args.Id), nil } func (self *shhApi) GetFilterChanges(req *shared.Request) (interface{}, error) { w := self.xeth.Whisper() if w == nil { return nil, newWhisperOfflineError(req.Method) } // Retrieve all the new messages arrived since the last request args := new(FilterIdArgs) if err := self.codec.Decode(req.Params, &args); err != nil { return nil, err } return self.xeth.WhisperMessagesChanged(args.Id), nil } func (self *shhApi) GetMessages(req *shared.Request) (interface{}, error) { w := self.xeth.Whisper() if w == nil { return nil, newWhisperOfflineError(req.Method) } // Retrieve all the cached messages matching a specific, existing filter args := new(FilterIdArgs) if err := self.codec.Decode(req.Params, &args); err != nil { return nil, err } return self.xeth.WhisperMessages(args.Id), nil }
ghostnetwrk/ghostnet
rpc/api/shh.go
GO
gpl-3.0
5,209
package vrml.external.field; import vrml.external.field.FieldTypes; import vrml.external.Browser; import java.awt.*; import java.math.BigInteger; public class EventInSFImage extends EventIn { public EventInSFImage() { EventType = FieldTypes.SFIMAGE; } public void setValue(int width, int height, int components, byte[] pixels) throws IllegalArgumentException { int count; int pixcount; String val; BigInteger newval; byte xx[]; if (pixels.length != (width*height*components)) { throw new IllegalArgumentException(); } if ((components < 1) || (components > 4)) { throw new IllegalArgumentException(); } // use BigInt to ensure sign bit does not frick us up. xx = new byte[components+1]; xx[0] = (byte) 0; // no sign bit here! val = new String("" + width + " " + height + " " + components); if (pixels== null) { pixcount = 0;} else {pixcount=pixels.length;} if (components == 1) { for (count = 0; count < pixcount; count++) { xx[1] = pixels[count]; newval = new BigInteger(xx); //System.out.println ("Big int " + newval.toString(16)); val = val.concat(" 0x" + newval.toString(16)); } } if (components == 2) { for (count = 0; count < pixcount; count+=2) { xx[1] = pixels[count]; xx[2] = pixels[count+1]; newval = new BigInteger(xx); //System.out.println ("Big int " + newval.toString(16)); val = val.concat(" 0x" + newval.toString(16)); } } if (components == 3) { for (count = 0; count < pixcount; count+=3) { xx[1] = pixels[count]; xx[2] = pixels[count+1]; xx[3]=pixels[count+2]; newval = new BigInteger(xx); //System.out.println ("Big int " + newval.toString(16)); val = val.concat(" 0x" + newval.toString(16)); } } if (components == 4) { for (count = 0; count < pixcount; count+=4) { xx[1] = pixels[count]; xx[2] = pixels[count+1]; xx[3]=pixels[count+2]; xx[4]=pixels[count+3]; newval = new BigInteger(xx); //System.out.println ("Big int " + newval.toString(16)); val = val.concat(" 0x" + newval.toString(16)); } } //System.out.println ("sending " + val); Browser.newSendEvent (this, val.length() + ":" + val + " "); return; } }
cbuehler/freewrl
src/java/vrml/external/field/EventInSFImage.java
Java
gpl-3.0
2,162
#include <cstdio> template<typename T> auto kitten(T x) __attribute__((noinline)); template<class T> auto kitten(T t) { static T x = 0; return (x += 1) + t; } int main() { printf("%d\n", kitten(1)); printf("%g\n", kitten(3.14)); }
Lester-Dowling/studies
C++/CppCon/2015/Arthur-ODwyer-Lambdas-from-First-Principles/kitten-static-T.cpp
C++
gpl-3.0
238
#ifndef __BUF_H #define __BUF_H #include <const.h> struct buf { uint flag; struct buf *prev; struct buf *next; struct buf *io_prev; struct buf *io_next; uint dev; uint sector; uchar data[BLK_SIZE]; }; struct dev { uint active; struct buf *prev; struct buf *next; struct buf *io_prev; struct buf *io_next; }; #define B_BUSY 0b1 #define B_VALID 0b10 #define B_DIRTY 0b100 #define B_ERROR 0b1000 extern struct buf buffer[NBUF]; extern struct buf bfreelist; extern struct dev hd_dev; void buf_init(); struct buf* buf_get(uint dev, uint sector); int buf_relse(struct buf* bp); struct buf* buf_read(uint dev, uint sector); int buf_write(struct buf* b); void dump_buf(struct buf* buf); void hexdump_buf(struct buf* buf); void dump_buffer_freelist(); #endif
shonenada/Constance
src/inc/buf.h
C
gpl-3.0
810
import subprocess import time import sys import re class checkIfUp: __shellPings = [] __shell2Nbst = [] __ipsToCheck = [] checkedIps = 0 onlineIps = 0 unreachable = 0 timedOut = 0 upIpsAddress = [] computerName = [] completeMacAddress = [] executionTime = 0 def __init__(self,fromIp,toIp): startTime = time.time() self.fromIp = fromIp # from 192.168.1.x self.toIp = toIp # to 192.168.x.x self.__checkIfIpIsValid(fromIp) self.__checkIfIpIsValid(toIp) self.__getRange(fromIp,toIp) self.__shellToQueue() #self.__checkIfUp() # run by the shellToQueue queue organizer self.__computerInfoInQueue() endTime = time.time() self.executionTime = round(endTime - startTime,3) def __checkIfIpIsValid(self,ip): def validateRange(val): # valid range => 1 <-> 255 try: val = int(val) if val < 0 or val > 255: print "Invalid IP Range ("+str(val)+")" sys.exit(0) except: print "Invalid IP" sys.exit(0) ip = ip.split(".") firstVal = validateRange(ip[0]) secondVal = validateRange(ip[1]) thirdVal = validateRange(ip[2]) fourthVal = validateRange(ip[3]) return True def __getRange(self,fromIp,toIp): fromIp = fromIp.split(".") toIp = toIp.split(".") # toIp must be > fromIp def ip3chars(ipBlock): # input 1; output 001 ipBlock = str(ipBlock) while len(ipBlock) != 3: ipBlock = "0"+ipBlock return ipBlock fromIpRaw = ip3chars(fromIp[0])+ip3chars(fromIp[1])+ip3chars(fromIp[2])+ip3chars(fromIp[3]) toIpRaw = ip3chars(toIp[0])+ip3chars(toIp[1])+ip3chars(toIp[2])+ip3chars(toIp[3]) if fromIpRaw > toIpRaw: # if from is bigger switch the order temp = fromIp fromIp = toIp toIp = temp currentIp = [0,0,0,0] # all to integers currentIp0 = int(fromIp[0]) currentIp1 = int(fromIp[1]) currentIp2 = int(fromIp[2]) currentIp3 = int(fromIp[3]) toIp0 = int(toIp[0]) toIp1 = int(toIp[1]) toIp2 = int(toIp[2]) toIp3 = int(toIp[3]) firstIp = str(currentIp0)+"."+str(currentIp1)+"."+str(currentIp2)+"."+str(currentIp3) self.__ipsToCheck = [firstIp] while currentIp3 != toIp3 or currentIp2 != toIp2 or currentIp1 != toIp1 or currentIp0 != toIp0: currentIp3 += 1 if currentIp3 > 255: currentIp3 = 0 currentIp2 += 1 if currentIp2 > 255: currentIp2 = 0 currentIp1 += 1 if currentIp1 > 255: currentIp1 = 0 currentIp0 += 1 addIp = str(currentIp0)+"."+str(currentIp1)+"."+str(currentIp2)+"."+str(currentIp3) self.__ipsToCheck.append(addIp) def __shellToQueue(self): # write them in the shell queue maxPingsAtOnce = 200 currentQueuedPings = 0 for pingIp in self.__ipsToCheck: proc = subprocess.Popen(['ping','-n','1',pingIp],stdout=subprocess.PIPE,shell=True) self.__shellPings.append(proc) currentQueuedPings += 1 if currentQueuedPings >= maxPingsAtOnce: #execute shells self.__checkIfUp() currentQueuedPings = 0 self.__shellPings = [] self.__checkIfUp() # execute last queue def __checkIfUp(self): # execute the shells & determine whether the host is up or not for shellInQueue in self.__shellPings: pingResult = "" shellInQueue.wait() while True: line = shellInQueue.stdout.readline() if line != "": pingResult += line else: break; self.checkedIps += 1 if 'unreachable' in pingResult: self.unreachable += 1 elif 'timed out' in pingResult: self.timedOut += 1 else: self.onlineIps += 1 currentIp = self.__ipsToCheck[self.checkedIps-1] self.upIpsAddress.append(currentIp) def __computerInfoInQueue(self): # shell queue for online hosts maxShellsAtOnce = 255 currentQueuedNbst = 0 for onlineIp in self.upIpsAddress: proc = subprocess.Popen(['\\Windows\\sysnative\\nbtstat.exe','-a',onlineIp],stdout=subprocess.PIPE,shell=True) self.__shell2Nbst.append(proc) currentQueuedNbst += 1 if currentQueuedNbst >= maxShellsAtOnce: # execute shells self.__gatherComputerInfo() currentQueuedNbst = 0 self.__shell2Nbst = [] self.__gatherComputerInfo() # execute last queue def __gatherComputerInfo(self): # execute the shells and find host Name and MAC for shellInQueue in self.__shell2Nbst: nbstResult = "" shellInQueue.wait() computerNameLine = "" macAddressLine = "" computerName = "" macAddress = "" while True: line = shellInQueue.stdout.readline() if line != "": if '<00>' in line and 'UNIQUE' in line: computerNameLine = line if 'MAC Address' in line: macAddressLine = line else: break; computerName = re.findall('([ ]+)(.*?)([ ]+)<00>', computerNameLine) macAddress = re.findall('([A-Z0-9]+)-([A-Z0-9]+)-([A-Z0-9]+)-([A-Z0-9]+)-([A-Z0-9]+)-([A-Z0-9]+)',macAddressLine) try: self.computerName.append(computerName[0][1]) except: self.computerName.append("") completeMacAddress = "" firstMacElement = 0 try: for macEach in macAddress[0]: if firstMacElement == 0: firstMacElement += 1 else: completeMacAddress += ":" completeMacAddress += macEach firstMacElement = 0 except: completeMacAddress = "" self.completeMacAddress.append(completeMacAddress) def readValue(self): # debugging use only ips = [] for ip in self.completeMacAddress: ips.append(ip) return ips print "\t\t---LANScanner v1.0---\n" # brief tutorial print "Sample input data:" print "FromIP: 192.168.1.50" print "ToIP: 192.168.1.20" print "---" # input fromIp = raw_input("From: ") toIp = raw_input("To: ") # enter values to class userRange = checkIfUp(fromIp,toIp) # read class values print "" #print userRange.readValue() # debugging use only print "Checked",userRange.checkedIps,"IPs" print "" print "Online:",str(userRange.onlineIps)+"/"+str(userRange.checkedIps) print "Unreachable:",userRange.unreachable,"Timed out:",userRange.timedOut print "" # newline print "Online IPs:" print "IP\t\tNAME\t\tMAC" counter = 0 for onlineIp in userRange.upIpsAddress: print onlineIp+"\t"+userRange.computerName[counter]+"\t"+userRange.completeMacAddress[counter] counter += 1 print "" print "Took",userRange.executionTime,"seconds"
mixedup4x4/Speedy
Contents/LanScan.py
Python
gpl-3.0
7,956
/* * AJDebug.java * * This file is part of Tritonus: http://www.tritonus.org/ */ /* * Copyright (c) 1999 - 2002 by Matthias Pfisterer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as published * by the Free Software Foundation; either version 2 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 Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* |<--- this code is formatted to fit into 80 columns --->| */ package org.tritonus.debug; import org.aspectj.lang.JoinPoint; import javax.sound.midi.MidiSystem; import javax.sound.midi.Synthesizer; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.SourceDataLine; import org.tritonus.core.TMidiConfig; import org.tritonus.core.TInit; import org.tritonus.share.TDebug; import org.tritonus.share.midi.TSequencer; import org.tritonus.midi.device.alsa.AlsaSequencer; import org.tritonus.midi.device.alsa.AlsaSequencer.PlaybackAlsaMidiInListener; import org.tritonus.midi.device.alsa.AlsaSequencer.RecordingAlsaMidiInListener; import org.tritonus.midi.device.alsa.AlsaSequencer.AlsaSequencerReceiver; import org.tritonus.midi.device.alsa.AlsaSequencer.AlsaSequencerTransmitter; import org.tritonus.midi.device.alsa.AlsaSequencer.LoaderThread; import org.tritonus.midi.device.alsa.AlsaSequencer.MasterSynchronizer; import org.tritonus.share.sampled.convert.TAsynchronousFilteredAudioInputStream; /** Debugging output aspect. */ public aspect AJDebug extends Utils { pointcut allExceptions(): handler(Throwable+); // TAudioConfig, TMidiConfig, TInit pointcut TMidiConfigCalls(): execution(* TMidiConfig.*(..)); pointcut TInitCalls(): execution(* TInit.*(..)); // share // midi pointcut MidiSystemCalls(): execution(* MidiSystem.*(..)); pointcut Sequencer(): execution(TSequencer+.new(..)) || execution(* TSequencer+.*(..)) || execution(* PlaybackAlsaMidiInListener.*(..)) || execution(* RecordingAlsaMidiInListener.*(..)) || execution(* AlsaSequencerReceiver.*(..)) || execution(* AlsaSequencerTransmitter.*(..)) || execution(LoaderThread.new(..)) || execution(* LoaderThread.*(..)) || execution(MasterSynchronizer.new(..)) || execution(* MasterSynchronizer.*(..)); // audio pointcut AudioSystemCalls(): execution(* AudioSystem.*(..)); pointcut sourceDataLine(): call(* SourceDataLine+.*(..)); // OLD // pointcut playerStates(): // execution(private void TPlayer.setState(int)); // currently not used pointcut printVelocity(): execution(* JavaSoundToneGenerator.playTone(..)) && call(JavaSoundToneGenerator.ToneThread.new(..)); // pointcut tracedCall(): execution(protected void JavaSoundAudioPlayer.doRealize() throws Exception); /////////////////////////////////////////////////////// // // ACTIONS // /////////////////////////////////////////////////////// before(): MidiSystemCalls() { if (TDebug.TraceMidiSystem) outEnteringJoinPoint(thisJoinPoint); } after(): MidiSystemCalls() { if (TDebug.TraceSequencer) outLeavingJoinPoint(thisJoinPoint); } before(): Sequencer() { if (TDebug.TraceSequencer) outEnteringJoinPoint(thisJoinPoint); } after(): Sequencer() { if (TDebug.TraceSequencer) outLeavingJoinPoint(thisJoinPoint); } before(): TInitCalls() { if (TDebug.TraceInit) outEnteringJoinPoint(thisJoinPoint); } after(): TInitCalls() { if (TDebug.TraceInit) outLeavingJoinPoint(thisJoinPoint); } before(): TMidiConfigCalls() { if (TDebug.TraceMidiConfig) outEnteringJoinPoint(thisJoinPoint); } after(): TMidiConfigCalls() { if (TDebug.TraceMidiConfig) outLeavingJoinPoint(thisJoinPoint); } // execution(* TAsynchronousFilteredAudioInputStream.read(..)) before(): execution(* TAsynchronousFilteredAudioInputStream.read()) { if (TDebug.TraceAudioConverter) outEnteringJoinPoint(thisJoinPoint); } after(): execution(* TAsynchronousFilteredAudioInputStream.read()) { if (TDebug.TraceAudioConverter) outLeavingJoinPoint(thisJoinPoint); } before(): execution(* TAsynchronousFilteredAudioInputStream.read(byte[])) { if (TDebug.TraceAudioConverter) outEnteringJoinPoint(thisJoinPoint); } after(): execution(* TAsynchronousFilteredAudioInputStream.read(byte[])) { if (TDebug.TraceAudioConverter) outLeavingJoinPoint(thisJoinPoint); } before(): execution(* TAsynchronousFilteredAudioInputStream.read(byte[], int, int)) { if (TDebug.TraceAudioConverter) outEnteringJoinPoint(thisJoinPoint); } after(): execution(* TAsynchronousFilteredAudioInputStream.read(byte[], int, int)) { if (TDebug.TraceAudioConverter) outLeavingJoinPoint(thisJoinPoint); } after() returning(int nBytes): call(* TAsynchronousFilteredAudioInputStream.read(byte[], int, int)) { if (TDebug.TraceAudioConverter) TDebug.out("returning bytes: " + nBytes); } // before(int nState): playerStates() && args(nState) // { // // if (TDebug.TracePlayerStates) // // { // // TDebug.out("TPlayer.setState(): " + nState); // // } // } // before(): playerStateTransitions() // { // // if (TDebug.TracePlayerStateTransitions) // // { // // TDebug.out("Entering: " + thisJoinPoint); // // } // } // Synthesizer around(): call(* MidiSystem.getSynthesizer()) // { // // Synthesizer s = proceed(); // // if (TDebug.TraceToneGenerator) // // { // // TDebug.out("MidiSystem.getSynthesizer() gives: " + s); // // } // // return s; // // only to get no compilation errors // return null; // } // TODO: v gives an error; find out what to do // before(int v): printVelocity() && args(nVelocity) // { // if (TDebug.TraceToneGenerator) // { // TDebug.out("velocity: " + v); // } // } before(Throwable t): allExceptions() && args(t) { if (TDebug.TraceAllExceptions) TDebug.out(t); } } /*** AJDebug.java ***/
srnsw/xena
plugins/audio/ext/src/tritonus/src/classes/org/tritonus/debug/AJDebug.java
Java
gpl-3.0
6,383
{"exchange_info":[{"onclick":null,"link":null,"value":"+34 943 018 705"},{"onclick":null,"link":"mailto:[email protected]","value":"[email protected]"},{"onclick":"window.open(this.href,'ix-new-window');return false;","link":"http://www.euskonix.com/principal.html","value":"Website"}],"address":["EuskoNIX (Bilbao, Spain)","\u003Caddress not available\u003E","Bilbao, Spain"],"name":"EuskoNIX (Bilbao, Spain)","id":"euskonix-bilbao-spain","buildings":[{"latitude":"43.268582","address":["\u003Caddress not available\u003E","Bilbao, Spain"],"longitude":"-2.946141","offset":"background:url('images/markers.png') no-repeat -22px 0;","id":18821}]}
brangerbriz/webroutes
nw-app/telegeography-data/internetexchanges/internet-exchanges/euskonix-bilbao-spain.js
JavaScript
gpl-3.0
641
# Game class GameResult < ActiveRecord::Base attr_accessible :question, :question_id, :user, :issues, :answer, :same, :skip belongs_to :user belongs_to :question has_and_belongs_to_many :issues, :join_table => "game_results_issues", :autosave => true after_initialize :default_values private def default_values self.skip = false if (self.has_attribute? :skip) && self.skip.nil? self.same = false if (self.has_attribute? :same) && self.same.nil? end def self.pick_result(uId) @game_result = GameResult.new question_randomizing_prob = 0.70 problem_randomizing_prob = 0.70 epsilon = 0.00000001 played_games = GameResult.select{|g| g.user_id == uId && g.skip == false} #played_games = GameResult.select{|g| g.user_id == uId && g.skip == false} if rand() < question_randomizing_prob && played_games != nil question_list = Question.all.map{|q| q.id} next_question_id = question_list.sort_by{|q| played_games.select{|g| g.question_id == q}.count}.first else question_list = Question.all.map{|q| q.id} next_question_id = question_list[rand(question_list.size)] end # TODO: This needs to be modified at some point to not only ask a single question excessively/heavily when a new one is added to the mix @game_result.question = Question.offset(next_question_id-1).first game_info_for_single_question = played_games.select{|pg| pg.question_id == next_question_id} problem_pairs = game_info_for_single_question.map{|pg| pg.issue_ids.sort}.uniq.sort game_results_with_flags = FlaggedIssues.select{|f| f.issue_id > 0} remove_flags = [] game_results_with_flags.select{|grwf| GameResult.find{|g| g.user_id == uId && g.id == grwf.game_result_id }}.each do |gr| remove_flags << gr.issue_id end remove_same = played_games.select{|g| g.same }.map{|q| q.issue_ids-[q.answer]}.flatten #Probs is all of the problems that we could potentially ask the user probs = Issue.all.map{|r| r.id} - remove_flags - remove_same probs_focus = probs.sort_by{|p| -problem_pairs.flatten.count(p)}[0..14] probs_left = probs - probs_focus #TODO: FIX this code to accommodate more than 2 problems choice = rand()+epsilon if choice < problem_randomizing_prob || probs_left == [] || probs_left == nil problem_choices = probs_focus.combination(2).to_a.map{|a| a.sort}-problem_pairs if problem_choices == [] remove_same_flag_problems = probs_focus.combination(2).to_a.map{|a| a.sort} next_issues = remove_same_flag_problems[rand(remove_same_flag_problems.length)] else next_issues = problem_choices[rand(problem_choices.length)] end else problem_choices = probs_left.combination(2).to_a.map{|a| a.sort}-problem_pairs if problem_choices == [] remove_same_flag_problems = probs_focus.combination(2).to_a.map{|a| a.sort} next_issues = remove_same_flag_problems[rand(remove_same_flag_problems.length)] else next_issues = problem_choices[rand(problem_choices.length)] end end #puts next_issues a = next_issues[0]-1 b = next_issues[1]-1 if rand(2).to_i == 1 @game_result.issues << Issue.offset(a).first @game_result.issues << Issue.offset(b).first else @game_result.issues << Issue.offset(b).first @game_result.issues << Issue.offset(a).first end return @game_result end end
causeroot/causeroot
app/models/game_result.rb
Ruby
gpl-3.0
3,463
<?php /********************************************************************************* * Zurmo is a customer relationship management program developed by * Zurmo, Inc. Copyright (C) 2012 Zurmo Inc. * * Zurmo 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 with the addition of the following permission added * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK * IN WHICH THE COPYRIGHT IS OWNED BY ZURMO, ZURMO DISCLAIMS THE WARRANTY * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS. * * Zurmo 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 or write to the Free * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA. * * You can contact Zurmo, Inc. with a mailing address at 113 McHenry Road Suite 207, * Buffalo Grove, IL 60089, USA. or at email address [email protected]. ********************************************************************************/ class SavedWorkflowsUtilTest extends WorkflowBaseTest { public $freeze = false; public function setup() { parent::setUp(); $freeze = false; if (RedBeanDatabase::isFrozen()) { RedBeanDatabase::unfreeze(); $freeze = true; } $this->freeze = $freeze; } public function teardown() { if ($this->freeze) { RedBeanDatabase::freeze(); } parent::teardown(); } public function testResolveProcessDateTimeByWorkflowAndModel() { //Test Date $model = new WorkflowModelTestItem(); $model->date = '2007-02-02'; $workflow = WorkflowTriggersUtilBaseTest:: makeOnSaveWorkflowAndTimeTriggerForDateOrDateTime('date', 'Is Time For', null, 86400); $processDateTime = SavedWorkflowsUtil::resolveProcessDateTimeByWorkflowAndModel($workflow, $model); $this->assertEquals('2007-02-03 00:00:00', $processDateTime); //Test Date with negative duration $model = new WorkflowModelTestItem(); $model->date = '2007-02-02'; $workflow = WorkflowTriggersUtilBaseTest:: makeOnSaveWorkflowAndTimeTriggerForDateOrDateTime('date', 'Is Time For', null, -86400); $processDateTime = SavedWorkflowsUtil::resolveProcessDateTimeByWorkflowAndModel($workflow, $model); $this->assertEquals('2007-02-01 00:00:00', $processDateTime); //Test DateTime $model = new WorkflowModelTestItem(); $model->dateTime = '2007-05-02 04:00:02'; $workflow = WorkflowTriggersUtilBaseTest:: makeOnSaveWorkflowAndTimeTriggerForDateOrDateTime('dateTime', 'Is Time For', null, 86400); $processDateTime = SavedWorkflowsUtil::resolveProcessDateTimeByWorkflowAndModel($workflow, $model); $this->assertEquals('2007-05-03 04:00:02', $processDateTime); //Test DateTime with negative duration $model = new WorkflowModelTestItem(); $model->dateTime = '2007-05-02 04:00:02'; $workflow = WorkflowTriggersUtilBaseTest:: makeOnSaveWorkflowAndTimeTriggerForDateOrDateTime('dateTime', 'Is Time For', null, -86400); $processDateTime = SavedWorkflowsUtil::resolveProcessDateTimeByWorkflowAndModel($workflow, $model); $this->assertEquals('2007-05-01 04:00:02', $processDateTime); } /** * @depends testResolveProcessDateTimeByWorkflowAndModel * @expectedException ValueForProcessDateTimeIsNullException */ public function testResolveProcessDateTimeByWorkflowAndModelWithNullDate() { $model = new WorkflowModelTestItem(); $workflow = WorkflowTriggersUtilBaseTest:: makeOnSaveWorkflowAndTimeTriggerForDateOrDateTime('date', 'Is Time For', null, 86400); SavedWorkflowsUtil::resolveProcessDateTimeByWorkflowAndModel($workflow, $model); } /** * @depends testResolveProcessDateTimeByWorkflowAndModelWithNullDate * @expectedException ValueForProcessDateTimeIsNullException */ public function testResolveProcessDateTimeByWorkflowAndModelWithPseudoNullDate() { $model = new WorkflowModelTestItem(); $model->dateTime = '0000-00-00'; $workflow = WorkflowTriggersUtilBaseTest:: makeOnSaveWorkflowAndTimeTriggerForDateOrDateTime('date', 'Is Time For', null, 86400); SavedWorkflowsUtil::resolveProcessDateTimeByWorkflowAndModel($workflow, $model); } /** * @depends testResolveProcessDateTimeByWorkflowAndModelWithPseudoNullDate * @expectedException ValueForProcessDateTimeIsNullException */ public function testResolveProcessDateTimeByWorkflowAndModelWithNullDateTime() { $model = new WorkflowModelTestItem(); $workflow = WorkflowTriggersUtilBaseTest:: makeOnSaveWorkflowAndTimeTriggerForDateOrDateTime('dateTime', 'Is Time For', null, 86400); SavedWorkflowsUtil::resolveProcessDateTimeByWorkflowAndModel($workflow, $model); } /** * @depends testResolveProcessDateTimeByWorkflowAndModelWithNullDateTime * @expectedException ValueForProcessDateTimeIsNullException */ public function testResolveProcessDateTimeByWorkflowAndModelWithPseudoNullDateTime() { $model = new WorkflowModelTestItem(); $model->dateTime = '0000-00-00 00:00:00'; $workflow = WorkflowTriggersUtilBaseTest:: makeOnSaveWorkflowAndTimeTriggerForDateOrDateTime('dateTime', 'Is Time For', null, 86400); SavedWorkflowsUtil::resolveProcessDateTimeByWorkflowAndModel($workflow, $model); } /** * @depends testResolveProcessDateTimeByWorkflowAndModelWithPseudoNullDateTime */ public function testResolveOrder() { $this->assertCount(0, SavedWorkflow::getAll()); $savedWorkflow = new SavedWorkflow(); $savedWorkflow->name = 'the name'; $savedWorkflow->moduleClassName = 'AccountsModule'; $savedWorkflow->serializedData = serialize(array('some data')); $savedWorkflow->triggerOn = Workflow::TRIGGER_ON_NEW; $savedWorkflow->type = Workflow::TYPE_ON_SAVE; $this->assertNull($savedWorkflow->order); SavedWorkflowsUtil::resolveOrder($savedWorkflow); $this->assertEquals(1, $savedWorkflow->order); $saved = $savedWorkflow->save(); $this->assertTrue($saved); $savedWorkflowId1 = $savedWorkflow->id; $savedWorkflow = new SavedWorkflow(); $savedWorkflow->name = 'the name 2'; $savedWorkflow->moduleClassName = 'AccountsModule'; $savedWorkflow->serializedData = serialize(array('some data 2')); $savedWorkflow->triggerOn = Workflow::TRIGGER_ON_NEW; $savedWorkflow->type = Workflow::TYPE_ON_SAVE; $this->assertNull($savedWorkflow->order); SavedWorkflowsUtil::resolveOrder($savedWorkflow); $this->assertEquals(2, $savedWorkflow->order); $saved = $savedWorkflow->save(); $this->assertTrue($saved); $savedWorkflowId2 = $savedWorkflow->id; $savedWorkflow = new SavedWorkflow(); $savedWorkflow->name = 'the name 3'; $savedWorkflow->moduleClassName = 'AccountsModule'; $savedWorkflow->serializedData = serialize(array('some data 2')); $savedWorkflow->triggerOn = Workflow::TRIGGER_ON_NEW; $savedWorkflow->type = Workflow::TYPE_ON_SAVE; $this->assertNull($savedWorkflow->order); SavedWorkflowsUtil::resolveOrder($savedWorkflow); $this->assertEquals(3, $savedWorkflow->order); $saved = $savedWorkflow->save(); $this->assertTrue($saved); $savedWorkflowId3 = $savedWorkflow->id; $savedWorkflow = new SavedWorkflow(); $savedWorkflow->name = 'the name 4'; $savedWorkflow->moduleClassName = 'ContactsModule'; $savedWorkflow->serializedData = serialize(array('some data')); $savedWorkflow->triggerOn = Workflow::TRIGGER_ON_NEW; $savedWorkflow->type = Workflow::TYPE_ON_SAVE; $this->assertNull($savedWorkflow->order); SavedWorkflowsUtil::resolveOrder($savedWorkflow); $this->assertEquals(1, $savedWorkflow->order); $saved = $savedWorkflow->save(); $this->assertTrue($saved); $savedWorkflowId4 = $savedWorkflow->id; $savedWorkflow = SavedWorkflow::getById($savedWorkflowId2); $this->assertEquals(2, $savedWorkflow->order); SavedWorkflowsUtil::resolveOrder($savedWorkflow); $this->assertEquals(2, $savedWorkflow->order); //Change the moduleClassName to opportunities, it should show 1 $savedWorkflow->moduleClassName = 'OpportunitiesModule'; SavedWorkflowsUtil::resolveOrder($savedWorkflow); $this->assertEquals(1, $savedWorkflow->order); //Delete the workflow. When creating a new AccountsWorkflow, it should show order 4 since the max //is still 3. $deleted = $savedWorkflow->delete(); $this->assertTrue($deleted); $savedWorkflow = new SavedWorkflow(); $savedWorkflow->name = 'the name 5'; $savedWorkflow->moduleClassName = 'AccountsModule'; $savedWorkflow->serializedData = serialize(array('some data 2')); $savedWorkflow->triggerOn = Workflow::TRIGGER_ON_NEW; $savedWorkflow->type = Workflow::TYPE_ON_SAVE; $this->assertNull($savedWorkflow->order); SavedWorkflowsUtil::resolveOrder($savedWorkflow); $this->assertEquals(4, $savedWorkflow->order); $saved = $savedWorkflow->save(); $this->assertTrue($saved); } /** * @depends testResolveOrder */ public function testResolveBeforeSaveByModel() { //Create workflow $workflow = new Workflow(); $workflow->setDescription ('aDescription'); $workflow->setIsActive (true); $workflow->setOrder (5); $workflow->setModuleClassName('WorkflowsTestModule'); $workflow->setName ('myFirstWorkflow'); $workflow->setTriggerOn (Workflow::TRIGGER_ON_NEW_AND_EXISTING); $workflow->setType (Workflow::TYPE_ON_SAVE); $workflow->setTriggersStructure('1'); //Add trigger $trigger = new TriggerForWorkflowForm('WorkflowsTestModule', 'WorkflowModelTestItem', $workflow->getType()); $trigger->attributeIndexOrDerivedType = 'string'; $trigger->value = 'aValue'; $trigger->operator = 'equals'; $workflow->addTrigger($trigger); //Add action $action = new ActionForWorkflowForm('WorkflowModelTestItem', Workflow::TYPE_ON_SAVE); $action->type = ActionForWorkflowForm::TYPE_UPDATE_SELF; $attributes = array('string' => array('shouldSetValue' => '1', 'type' => WorkflowActionAttributeForm::TYPE_STATIC, 'value' => 'jason')); $action->setAttributes(array(ActionForWorkflowForm::ACTION_ATTRIBUTES => $attributes)); $workflow->addAction($action); //Create the saved Workflow $savedWorkflow = new SavedWorkflow(); SavedWorkflowToWorkflowAdapter::resolveWorkflowToSavedWorkflow($workflow, $savedWorkflow); $saved = $savedWorkflow->save(); $this->assertTrue($saved); //Confirm that the workflow processes and the attribute gets updated $model = new WorkflowModelTestItem(); $model->string = 'aValue'; SavedWorkflowsUtil::resolveBeforeSaveByModel($model, Yii::app()->user->userModel); $this->assertEquals('jason', $model->string); $this->assertTrue($model->id < 0); //Change the workflow to inactive $savedWorkflow->isActive = false; $saved = $savedWorkflow->save(); $this->assertTrue($saved); $model = new WorkflowModelTestItem(); $model->string = 'aValue'; SavedWorkflowsUtil::resolveBeforeSaveByModel($model, Yii::app()->user->userModel); $this->assertEquals('aValue', $model->string); $this->assertTrue($model->id < 0); } /** * @depends testResolveBeforeSaveByModel */ public function testResolveBeforeSaveByModelForByTime() { //Create workflow $workflow = new Workflow(); $workflow->setDescription ('aDescription'); $workflow->setIsActive (true); $workflow->setOrder (5); $workflow->setModuleClassName('WorkflowsTestModule'); $workflow->setName ('myFirstWorkflow'); $workflow->setTriggerOn (Workflow::TRIGGER_ON_NEW_AND_EXISTING); $workflow->setType (Workflow::TYPE_BY_TIME); $workflow->setTriggersStructure('1'); $workflow->setIsActive(true); //Add time trigger $trigger = new TimeTriggerForWorkflowForm('WorkflowsTestModule', 'WorkflowModelTestItem', $workflow->getType()); $trigger->attributeIndexOrDerivedType = 'date'; $trigger->durationSeconds = '500'; $trigger->valueType = 'Is Time For'; $workflow->setTimeTrigger($trigger); //Create the saved Workflow $savedWorkflow = new SavedWorkflow(); SavedWorkflowToWorkflowAdapter::resolveWorkflowToSavedWorkflow($workflow, $savedWorkflow); $saved = $savedWorkflow->save(); $this->assertTrue($saved); //Confirm that the workflow processes and the attribute gets updated $model = new WorkflowModelTestItem(); $model->string = 'aValue'; $model->date = '2013-02-02'; $this->assertEquals(0, count($model->getWorkflowsToProcessAfterSave())); SavedWorkflowsUtil::resolveBeforeSaveByModel($model, Yii::app()->user->userModel); $this->assertEquals(1, count($model->getWorkflowsToProcessAfterSave())); $this->assertTrue($model->id < 0); } /** * @depends testResolveBeforeSaveByModelForByTime */ public function testResolveAfterSaveByModel() { //Create workflow $workflow = new Workflow(); $workflow->setDescription ('aDescription'); $workflow->setIsActive (true); $workflow->setOrder (5); $workflow->setModuleClassName('WorkflowsTestModule'); $workflow->setName ('myFirstWorkflow'); $workflow->setTriggerOn (Workflow::TRIGGER_ON_NEW_AND_EXISTING); $workflow->setType (Workflow::TYPE_ON_SAVE); $workflow->setTriggersStructure('1'); $workflow->setIsActive(true); //Add trigger $trigger = new TriggerForWorkflowForm('WorkflowsTestModule', 'WorkflowModelTestItem', $workflow->getType()); $trigger->attributeIndexOrDerivedType = 'string'; $trigger->value = 'aValue'; $trigger->operator = 'equals'; $workflow->addTrigger($trigger); //Add action $action = new ActionForWorkflowForm('WorkflowModelTestItem', Workflow::TYPE_ON_SAVE); $action->type = ActionForWorkflowForm::TYPE_CREATE; $action->relation = 'hasOne'; $attributes = array('name' => array('shouldSetValue' => '1', 'type' => WorkflowActionAttributeForm::TYPE_STATIC, 'value' => 'jason')); $action->setAttributes(array(ActionForWorkflowForm::ACTION_ATTRIBUTES => $attributes)); $workflow->addAction($action); //Create the saved Workflow $savedWorkflow = new SavedWorkflow(); SavedWorkflowToWorkflowAdapter::resolveWorkflowToSavedWorkflow($workflow, $savedWorkflow); $saved = $savedWorkflow->save(); $this->assertTrue($saved); $model = new WorkflowModelTestItem(); $model->string = 'aValue'; $saved = $savedWorkflow->save(); $this->assertTrue($saved); $model->addWorkflowToProcessAfterSave($workflow); $this->assertEquals(0, count(WorkflowModelTestItem2::getAll())); SavedWorkflowsUtil::resolveAfterSaveByModel($model, Yii::app()->user->userModel); $this->assertEquals(1, count(WorkflowModelTestItem2::getAll())); } /** * @depends testResolveAfterSaveByModel */ public function testResolveAfterSaveByModelForByTime() { //Create workflow $workflow = new Workflow(); $workflow->setDescription ('aDescription'); $workflow->setIsActive (true); $workflow->setOrder (5); $workflow->setModuleClassName('WorkflowsTestModule'); $workflow->setName ('myFirstWorkflow'); $workflow->setTriggerOn (Workflow::TRIGGER_ON_NEW_AND_EXISTING); $workflow->setType (Workflow::TYPE_BY_TIME); $workflow->setTriggersStructure('1'); $workflow->setIsActive(true); //Add time trigger $trigger = new TimeTriggerForWorkflowForm('WorkflowsTestModule', 'WorkflowModelTestItem', $workflow->getType()); $trigger->attributeIndexOrDerivedType = 'date'; $trigger->durationSeconds = '500'; $trigger->valueType = 'Is Time For'; $workflow->setTimeTrigger($trigger); //Create the saved Workflow $savedWorkflow = new SavedWorkflow(); SavedWorkflowToWorkflowAdapter::resolveWorkflowToSavedWorkflow($workflow, $savedWorkflow); $saved = $savedWorkflow->save(); $this->assertTrue($saved); $workflow->setId($savedWorkflow->id); //set Id back. $model = new WorkflowModelTestItem(); $model->lastName = 'something'; $model->string = 'aValue'; $model->date = '2013-03-03'; $saved = $model->save(); $this->assertTrue($saved); $model->addWorkflowToProcessAfterSave($workflow); $this->assertEquals(0, count(ByTimeWorkflowInQueue::getAll())); SavedWorkflowsUtil::resolveAfterSaveByModel($model, Yii::app()->user->userModel); $this->assertEquals(1, count(ByTimeWorkflowInQueue::getAll())); } } ?>
deep9/zurmo
app/protected/modules/workflows/tests/unit/SavedWorkflowsUtilTest.php
PHP
gpl-3.0
20,437
## ubuntuไธ‹ๅฎ‰่ฃ…OpenGLๅนถๆญๅปบOpenGLๅผ€ๅ‘็Žฏๅขƒ 1.ๅฎ‰่ฃ…IDE๏ผš ่ฟ™้‡Œไฝฟ็”จ็š„ๆ˜ฏcodeblocks sudo apt-get install codeblocks 2.้…็ฝฎlinuxไธ‹็š„openGL ไธ‹่ฝฝๅนถๅฎ‰่ฃ…openGLๆ‰€้œ€่ฆ็š„ๅบ“ sudo apt-get install mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev sudo apt-get install freeglut3-dev sudo apt-get install build-essential gdb subversion sudo apt-get install automake autoconf libtool sudo apt-get install libgtk2.0-dev libxmu-dev libxxf86vm-dev 3.้…็ฝฎcodeblocks IDE ๅœจSettings->compiler and debugger settings->link settings ๆทปๅŠ ๏ผš /usr/lib/libGL.so /usr/lib/libGLU.so /usr/lib/libglut.so 4. ๅผ€ๅ‘ ๅผ€ๅ‘็š„ๆ—ถๅ€™๏ผŒๆ–ฐๅปบGLUTๅทฅ็จ‹๏ผŒๅœจmain.cpp้‡Œ้ข็ผ–ๅ†™ไปฃ็ ๅณๅฏ ๆ–ฐๅปบๅŽ๏ผŒ่‡ชๅธฆๆœ‰ไธ€ไธชopenGL็š„ไพ‹ๅญ
faxiang1230/work
OpenGL/develenv.md
Markdown
gpl-3.0
744
Ragnarok
ilfan14/RoGw
README.md
Markdown
gpl-3.0
8
# discourse-hot-topics A plugin for Discourse. Adds ranking to topics ala Hacker News. Translated to English, French and Russian.
danskdynamit/discourse-hot-topics
README.md
Markdown
gpl-3.0
132
<!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"/> <title>GNU Radio 3.6.1 C++ API: gr_tagged_file_sink.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> </head> <body> <div id="top"><!-- do not remove this div! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">GNU Radio 3.6.1 C++ API </div> </td> </tr> </tbody> </table> </div> <!-- Generated by Doxygen 1.7.6.1 --> </div> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> initNavTree('gr__tagged__file__sink_8h.html',''); </script> <div id="doc-content"> <div class="header"> <div class="headertitle"> <div class="title">gr_tagged_file_sink.h</div> </div> </div><!--header--> <div class="contents"> <a href="gr__tagged__file__sink_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* -*- c++ -*- */</span> <a name="l00002"></a>00002 <span class="comment">/*</span> <a name="l00003"></a>00003 <span class="comment"> * Copyright 2010 Free Software Foundation, Inc.</span> <a name="l00004"></a>00004 <span class="comment"> *</span> <a name="l00005"></a>00005 <span class="comment"> * This file is part of GNU Radio</span> <a name="l00006"></a>00006 <span class="comment"> *</span> <a name="l00007"></a>00007 <span class="comment"> * GNU Radio is free software; you can redistribute it and/or modify</span> <a name="l00008"></a>00008 <span class="comment"> * it under the terms of the GNU General Public License as published by</span> <a name="l00009"></a>00009 <span class="comment"> * the Free Software Foundation; either version 3, or (at your option)</span> <a name="l00010"></a>00010 <span class="comment"> * any later version.</span> <a name="l00011"></a>00011 <span class="comment"> *</span> <a name="l00012"></a>00012 <span class="comment"> * GNU Radio is distributed in the hope that it will be useful,</span> <a name="l00013"></a>00013 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00014"></a>00014 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span> <a name="l00015"></a>00015 <span class="comment"> * GNU General Public License for more details.</span> <a name="l00016"></a>00016 <span class="comment"> *</span> <a name="l00017"></a>00017 <span class="comment"> * You should have received a copy of the GNU General Public License</span> <a name="l00018"></a>00018 <span class="comment"> * along with GNU Radio; see the file COPYING. If not, write to</span> <a name="l00019"></a>00019 <span class="comment"> * the Free Software Foundation, Inc., 51 Franklin Street,</span> <a name="l00020"></a>00020 <span class="comment"> * Boston, MA 02110-1301, USA.</span> <a name="l00021"></a>00021 <span class="comment"> */</span> <a name="l00022"></a>00022 <a name="l00023"></a>00023 <span class="preprocessor">#ifndef INCLUDED_GR_TAGGED_FILE_SINK_H</span> <a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define INCLUDED_GR_TAGGED_FILE_SINK_H</span> <a name="l00025"></a>00025 <span class="preprocessor"></span> <a name="l00026"></a>00026 <span class="preprocessor">#include &lt;<a class="code" href="gr__core__api_8h.html">gr_core_api.h</a>&gt;</span> <a name="l00027"></a>00027 <span class="preprocessor">#include &lt;<a class="code" href="gr__sync__block_8h.html">gr_sync_block.h</a>&gt;</span> <a name="l00028"></a>00028 <span class="preprocessor">#include &lt;cstdio&gt;</span> <span class="comment">// for FILE</span> <a name="l00029"></a>00029 <a name="l00030"></a>00030 <span class="keyword">class </span><a class="code" href="classgr__tagged__file__sink.html" title="Write stream to file descriptor.">gr_tagged_file_sink</a>; <a name="l00031"></a>00031 <span class="keyword">typedef</span> <a class="code" href="classboost_1_1shared__ptr.html" title="shared_ptr documentation stub">boost::shared_ptr&lt;gr_tagged_file_sink&gt;</a> <a class="code" href="classboost_1_1shared__ptr.html" title="shared_ptr documentation stub">gr_tagged_file_sink_sptr</a>; <a name="l00032"></a>00032 <a name="l00033"></a>00033 <a class="code" href="gr__core__api_8h.html#a8b8937b0c61edd85ab57ce8203543248">GR_CORE_API</a> <a class="code" href="classboost_1_1shared__ptr.html" title="shared_ptr documentation stub">gr_tagged_file_sink_sptr</a> <a class="code" href="gr__tagged__file__sink_8h.html#ae1631ce4f07efffc69d7f72c76e78190">gr_make_tagged_file_sink</a> (<span class="keywordtype">size_t</span> itemsize, <a name="l00034"></a>00034 <span class="keywordtype">double</span> samp_rate); <a name="l00035"></a>00035 <span class="comment"></span> <a name="l00036"></a>00036 <span class="comment">/*!</span> <a name="l00037"></a>00037 <span class="comment"> * \brief Write stream to file descriptor.</span> <a name="l00038"></a>00038 <span class="comment"> * \ingroup sink_blk</span> <a name="l00039"></a>00039 <span class="comment"> */</span> <a name="l00040"></a>00040 <a name="l00041"></a><a class="code" href="classgr__tagged__file__sink.html">00041</a> <span class="keyword">class </span><a class="code" href="gr__core__api_8h.html#a8b8937b0c61edd85ab57ce8203543248">GR_CORE_API</a> <a class="code" href="classgr__tagged__file__sink.html" title="Write stream to file descriptor.">gr_tagged_file_sink</a> : <span class="keyword">public</span> <a class="code" href="classgr__sync__block.html" title="synchronous 1:1 input to output with historyOverride work to provide the signal processing implementa...">gr_sync_block</a> <a name="l00042"></a>00042 { <a name="l00043"></a>00043 <span class="keyword">friend</span> <a class="code" href="gr__core__api_8h.html#a8b8937b0c61edd85ab57ce8203543248">GR_CORE_API</a> <a class="code" href="classboost_1_1shared__ptr.html" title="shared_ptr documentation stub">gr_tagged_file_sink_sptr</a> <a class="code" href="gr__tagged__file__sink_8h.html#ae1631ce4f07efffc69d7f72c76e78190">gr_make_tagged_file_sink</a> (<span class="keywordtype">size_t</span> itemsize, <a name="l00044"></a>00044 <span class="keywordtype">double</span> samp_rate); <a name="l00045"></a>00045 <a name="l00046"></a>00046 <span class="keyword">private</span>: <a name="l00047"></a>00047 <span class="keyword">enum</span> { <a name="l00048"></a>00048 NOT_IN_BURST = 0, <a name="l00049"></a>00049 IN_BURST <a name="l00050"></a>00050 }; <a name="l00051"></a>00051 <a name="l00052"></a>00052 <span class="keywordtype">size_t</span> d_itemsize; <a name="l00053"></a>00053 <span class="keywordtype">int</span> d_state; <a name="l00054"></a>00054 FILE *d_handle; <a name="l00055"></a>00055 <span class="keywordtype">int</span> d_n; <a name="l00056"></a>00056 <span class="keywordtype">double</span> d_sample_rate; <a name="l00057"></a>00057 <a class="code" href="stdint_8h.html#aec6fcb673ff035718c238c8c9d544c47">uint64_t</a> d_last_N; <a name="l00058"></a>00058 <span class="keywordtype">double</span> d_timeval; <a name="l00059"></a>00059 <a name="l00060"></a>00060 <span class="keyword">protected</span>: <a name="l00061"></a>00061 <a class="code" href="classgr__tagged__file__sink.html" title="Write stream to file descriptor.">gr_tagged_file_sink</a> (<span class="keywordtype">size_t</span> itemsize, <span class="keywordtype">double</span> samp_rate); <a name="l00062"></a>00062 <a name="l00063"></a>00063 <span class="keyword">public</span>: <a name="l00064"></a>00064 ~<a class="code" href="classgr__tagged__file__sink.html" title="Write stream to file descriptor.">gr_tagged_file_sink</a> (); <a name="l00065"></a>00065 <a name="l00066"></a>00066 <span class="keywordtype">int</span> <a class="code" href="classgr__sync__block.html#a0c523f4285a6eb690f677ee6295ab117" title="just like gr_block::general_work, only this arranges to call consume_each for you">work</a> (<span class="keywordtype">int</span> noutput_items, <a name="l00067"></a>00067 <a class="code" href="gr__types_8h.html#a9852a3d906d823cb70eb9c29e7f2a43d">gr_vector_const_void_star</a> &amp;input_items, <a name="l00068"></a>00068 <a class="code" href="gr__types_8h.html#acd3f499576e769966ea44554b359d949">gr_vector_void_star</a> &amp;output_items); <a name="l00069"></a>00069 }; <a name="l00070"></a>00070 <a name="l00071"></a>00071 <a name="l00072"></a>00072 <span class="preprocessor">#endif </span><span class="comment">/* INCLUDED_GR_TAGGED_FILE_SINK_H */</span> </pre></div></div><!-- contents --> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="gr__tagged__file__sink_8h.html">gr_tagged_file_sink.h</a> </li> <li class="footer">Generated on Wed Jun 13 2012 21:29:00 for GNU Radio 3.6.1 C++ API by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li> </ul> </div> </body> </html>
zitouni/gnuradio-3.6.1
build/docs/doxygen/html/gr__tagged__file__sink_8h_source.html
HTML
gpl-3.0
10,045
/* * Project: N|Watch * Author: Zak Kemble, [email protected] * Copyright: (C) 2014 by Zak Kemble * License: GNU GPL v3 (see License.txt) * Web: http://blog.zakkemble.co.uk/diy-digital-wristwatch/ */ #ifndef ENGLISH_H_ #define ENGLISH_H_ // String buffer sizes // Don't forget to add 1 for null terminator #define BUFFSIZE_STR_MENU 24 #define BUFFSIZE_STR_DAYS 4 #define BUFFSIZE_STR_MONTHS 4 #define BUFFSIZE_DATE_FORMAT ((BUFFSIZE_STR_DAYS - 1) + (BUFFSIZE_STR_MONTHS - 1) + 12) #define BUFFSIZE_TIME_FORMAT_SMALL 9 // String formats #define DATE_FORMAT ("%s %02hhu %s 20%02hhu") #define TIME_FORMAT_SMALL ("%02hhu:%02hhu%c") #define CHAR_DEGREES 127 #define CHAR_TICK 128 #define CHAR_AM 'A' #define CHAR_PM 'P' #define CHAR_24 ' ' #define CHAR_YES 'Y' #define CHAR_NO 'N' #define STR_DOWCHARS "MTWTFSS" // Days // Also see BUFFSIZE_STR_DAYS #define STR_MON "Mon" #define STR_TUE "Tue" #define STR_WED "Wed" #define STR_THU "Thu" #define STR_FRI "Fri" #define STR_SAT "Sat" #define STR_SUN "Sun" // Months // Also see BUFFSIZE_STR_MONTHS #define STR_JAN "Jan" #define STR_FEB "Feb" #define STR_MAR "Mar" #define STR_APR "Apr" #define STR_MAY "May" #define STR_JUN "Jun" #define STR_JUL "Jul" #define STR_AUG "Aug" #define STR_SEP "Sep" #define STR_OCT "Oct" #define STR_NOV "Nov" #define STR_DEC "Dec" // Menu strings // Also see BUFFSIZE_STR_MENU #define STR_MAINMENU "< MAIN MENU >" #define STR_ALARMS "Alarms" #define STR_FLASHLIGHT "Flashlight" #define STR_STOPWATCH "Stopwatch" #define STR_STOP "Stop" #define STR_SPLIT "Split" #define STR_RUN "Run" #define STR_RESET "Reset" #define STR_GAMES "Games" #define STR_SETTINGS "Settings" #define STR_DIAGNOSTICS "Diagnostics" //#define STR_BTRCCAR "BT RC Car" //#define STR_TUNEMAKER "Tune maker" //#define STR_CALCULATORS "Calculators" #define STR_ALARMSMENU "< ALARMS >" #define STR_TIMEDATEMENU "< TIME & DATE >" #define STR_SAVE "Save" #define STR_SAVED "Saved" #define STR_DIAGNOSTICSMENU "< DIAGNOSTICS >" #define STR_TEMPERATURE "Temperature %hhd.%hhuC" #define STR_BATTERY "Battery %umV" #define STR_SHOWFPS "Show FPS%9c" #define STR_DISPLAYMENU "< DISPLAY >" #define STR_BRIGHTNESS "Brightness" #define STR_INVERT "Invert" #define STR_ROTATE "Rotate" #define STR_ANIMATIONS "Animations" #define STR_GAMESMENU "< GAMES >" #define STR_SOUNDMENU "< SOUND >" #define STR_UI "UI" #define STR_HOURBEEPS "Hour beeps" #define STR_SLEEPMENU "< SLEEP >" #define STR_TIMEOUT "Timeout" //#define STR_CLOCKMODE "Clock mode" #define STR_SETTINGSMENU "< SETTINGS >" #define STR_TIMEDATE "Time & date" #define STR_SLEEP "Sleep" #define STR_SOUND "Sound" #define STR_DISPLAY "Display" #define STR_LEDS "LEDs" //#define STR_RCSETTINGS "RC Settings" #define STR_BACK "Back" #define STR_EXIT "Exit" // Game strings #define STR_GAME1 "Breakout" #define STR_GAME2 "Car Dodge" #define STR_WIN "WIN!" #define STR_GAMEOVER "GAMEOVER!" #define STR_SCORE "Score:" #define STR_HIGHSCORE "Highscore:" #define STR_NEWHIGHSCORE "!NEW HIGHSCORE!" // Little images (8x8) for showing day of week of next alarm on main screen #define DOWIMG_MON 0x0F,0x01,0x02,0x01,0x6F,0x90,0x90,0x60 #define DOWIMG_TUE 0x01,0x1F,0x01,0x00,0x78,0x80,0x80,0x78 #define DOWIMG_WED 0x0F,0x04,0x02,0x04,0x0F,0xF8,0xA8,0xA8 #define DOWIMG_THU 0x01,0x1F,0x01,0x00,0xF8,0x20,0x20,0xF8 #define DOWIMG_FRI 0x1F,0x05,0x05,0x00,0xF8,0x28,0x68,0x90 #define DOWIMG_SAT 0x12,0x15,0x09,0x00,0xF0,0x28,0x28,0xF0 #define DOWIMG_SUN 0x12,0x15,0x09,0x00,0x78,0x80,0x80,0x78 // Character set for this language #define CHARACTER_SET \ {0x00,0x00,0x00,0x00,0x00},/* space */ \ {0x00,0x5F,0x00,0x00,0x00},/* ! */ \ {0x00,0x07,0x00,0x07,0x00},/* " */ \ {0x14,0x7F,0x14,0x7F,0x14},/* # */ \ {0x24,0x2A,0x7F,0x2A,0x12},/* $ */ \ {0x23,0x13,0x08,0x64,0x62},/* % */ \ {0x36,0x49,0x55,0x22,0x50},/* & */ \ {0x00,0x05,0x03,0x00,0x00},/* ' */ \ {0x1C,0x22,0x41,0x00,0x00},/* ( */ \ {0x41,0x22,0x1C,0x00,0x00},/* ) */ \ {0x08,0x2A,0x1C,0x2A,0x08},/* * */ \ {0x08,0x08,0x3E,0x08,0x08},/* + */ \ {0xA0,0x60,0x00,0x00,0x00},/* , */ \ {0x08,0x08,0x08,0x08,0x08},/* - */ \ {0x60,0x60,0x00,0x00,0x00},/* . */ \ {0x20,0x10,0x08,0x04,0x02},/* / */ \ {0x3E,0x51,0x49,0x45,0x3E},/* 0 */ \ {0x00,0x42,0x7F,0x40,0x00},/* 1 */ \ {0x62,0x51,0x49,0x49,0x46},/* 2 */ \ {0x22,0x41,0x49,0x49,0x36},/* 3 */ \ {0x18,0x14,0x12,0x7F,0x10},/* 4 */ \ {0x27,0x45,0x45,0x45,0x39},/* 5 */ \ {0x3C,0x4A,0x49,0x49,0x30},/* 6 */ \ {0x01,0x71,0x09,0x05,0x03},/* 7 */ \ {0x36,0x49,0x49,0x49,0x36},/* 8 */ \ {0x06,0x49,0x49,0x29,0x1E},/* 9 */ \ {0x00,0x36,0x36,0x00,0x00},/* : */ \ {0x00,0xAC,0x6C,0x00,0x00},/* ; */ \ {0x08,0x14,0x22,0x41,0x00},/* < */ \ {0x14,0x14,0x14,0x14,0x14},/* = */ \ {0x41,0x22,0x14,0x08,0x00},/* > */ \ {0x02,0x01,0x51,0x09,0x06},/* ? */ \ {0x32,0x49,0x79,0x41,0x3E},/* @ */ \ {0x7E,0x09,0x09,0x09,0x7E},/* A */ \ {0x7F,0x49,0x49,0x49,0x36},/* B */ \ {0x3E,0x41,0x41,0x41,0x22},/* C */ \ {0x7F,0x41,0x41,0x22,0x1C},/* D */ \ {0x7F,0x49,0x49,0x49,0x41},/* E */ \ {0x7F,0x09,0x09,0x09,0x01},/* F */ \ {0x3E,0x41,0x41,0x51,0x72},/* G */ \ {0x7F,0x08,0x08,0x08,0x7F},/* H */ \ {0x41,0x7F,0x41,0x00,0x00},/* I */ \ {0x20,0x40,0x41,0x3F,0x01},/* J */ \ {0x7F,0x08,0x14,0x22,0x41},/* K */ \ {0x7F,0x40,0x40,0x40,0x40},/* L */ \ {0x7F,0x02,0x0C,0x02,0x7F},/* M */ \ {0x7F,0x04,0x08,0x10,0x7F},/* N */ \ {0x3E,0x41,0x41,0x41,0x3E},/* O */ \ {0x7F,0x09,0x09,0x09,0x06},/* P */ \ {0x3E,0x41,0x51,0x21,0x5E},/* Q */ \ {0x7F,0x09,0x19,0x29,0x46},/* R */ \ {0x26,0x49,0x49,0x49,0x32},/* S */ \ {0x01,0x01,0x7F,0x01,0x01},/* T */ \ {0x3F,0x40,0x40,0x40,0x3F},/* U */ \ {0x1F,0x20,0x40,0x20,0x1F},/* V */ \ {0x3F,0x40,0x38,0x40,0x3F},/* W */ \ {0x63,0x14,0x08,0x14,0x63},/* X */ \ {0x03,0x04,0x78,0x04,0x03},/* Y */ \ {0x61,0x51,0x49,0x45,0x43},/* Z */ \ {0x7F,0x41,0x41,0x00,0x00},/* [ */ \ {0x02,0x04,0x08,0x10,0x20},/* \ */ \ {0x41,0x41,0x7F,0x00,0x00},/* ] */ \ {0x04,0x02,0x01,0x02,0x04},/* ^ */ \ {0x80,0x80,0x80,0x80,0x80},/* _ */ \ {0x01,0x02,0x04,0x00,0x00},/* ' */ \ {0x20,0x54,0x54,0x54,0x78},/* a */ \ {0x7F,0x48,0x44,0x44,0x38},/* b */ \ {0x38,0x44,0x44,0x28,0x00},/* c */ \ {0x38,0x44,0x44,0x48,0x7F},/* d */ \ {0x38,0x54,0x54,0x54,0x18},/* e */ \ {0x08,0x7E,0x09,0x02,0x00},/* f */ \ {0x18,0xA4,0xA4,0xA4,0x7C},/* g */ \ {0x7F,0x08,0x04,0x04,0x78},/* h */ \ {0x00,0x7D,0x00,0x00,0x00},/* i */ \ {0x80,0x84,0x7D,0x00,0x00},/* j */ \ {0x7F,0x10,0x28,0x44,0x00},/* k */ \ {0x41,0x7F,0x40,0x00,0x00},/* l */ \ {0x7C,0x04,0x18,0x04,0x78},/* m */ \ {0x7C,0x08,0x04,0x7C,0x00},/* n */ \ {0x38,0x44,0x44,0x38,0x00},/* o */ \ {0xFC,0x24,0x24,0x18,0x00},/* p */ \ {0x18,0x24,0x24,0xFC,0x00},/* q */ \ {0x00,0x7C,0x08,0x04,0x00},/* r */ \ {0x48,0x54,0x54,0x24,0x00},/* s */ \ {0x04,0x7F,0x44,0x00,0x00},/* t */ \ {0x3C,0x40,0x40,0x7C,0x00},/* u */ \ {0x1C,0x20,0x40,0x20,0x1C},/* v */ \ {0x3C,0x40,0x30,0x40,0x3C},/* w */ \ {0x44,0x28,0x10,0x28,0x44},/* x */ \ {0x1C,0xA0,0xA0,0x7C,0x00},/* y */ \ {0x44,0x64,0x54,0x4C,0x44},/* z */ \ {0x08,0x36,0x41,0x00,0x00},/* { */ \ {0x00,0x7F,0x00,0x00,0x00},/* | */ \ {0x41,0x36,0x08,0x00,0x00},/* } */ \ {0x02,0x01,0x01,0x02,0x01},/* ~ */ \ {0x02,0x05,0x05,0x02,0x00},/* degrees (non-standard, normally DEL) */ \ {0x60,0xC0,0xF0,0x38,0x1C},/* tick (non-standard) */ \ #endif /* ENGLISH_H_ */
wbphelps/NWatch
firmware/src/watch/includes/lang/english.h
C
gpl-3.0
7,325
//////////////////////////////////////////////////////////////////////////// // Atol file manager project <http://atol.sf.net> // // This code is licensed under BSD license.See "license.txt" for more details. // // File: TOFIX //////////////////////////////////////////////////////////////////////////// /* * console.c: various interactive-prompt routines shared between * the console PuTTY tools */ #include <stdio.h> #include <stdlib.h> #include <stdarg.h> #include "putty.h" #include "storage.h" #include "ssh.h" int console_batch_mode = FALSE; /* * Clean up and exit. */ void cleanup_exit(int code) { /* * Clean up. */ //TOFIX //sk_cleanup(); //WSACleanup(); if (cfg.protocol == PROT_SSH) { random_save_seed(); #ifdef MSCRYPTOAPI crypto_wrapup(); #endif } //exit(code); } void verify_ssh_host_key(CSshSession &session, char *host, int port, char *keytype, char *keystr, char *fingerprint) { int ret, choice = 0; //HANDLE hin; //DWORD savemode, i; static const char absentmsg_batch[] = "The server's host key is not cached in the registry. You\n" "have no guarantee that the server is the computer you\n" "think it is.\n" "The server's key fingerprint is:\n" "%s\n" "Connection abandoned.\n"; static const char absentmsg[] = "The server's host key is not cached in the registry. You\n" "have no guarantee that the server is the computer you\n" "think it is.\n" "The server's key fingerprint is:\n" "%s\n" "If you trust this host, press \"Yes\" to add the key to\n" "PuTTY's cache and carry on connecting.\n" "If you want to carry on connecting just once, without\n" "adding the key to the cache, press \"No\".\n" "If you do not trust this host, press \"Cancel\" to abandon the\n" "connection.\n" "Store key in cache? (y/n) "; static const char wrongmsg_batch[] = "WARNING - POTENTIAL SECURITY BREACH!\n" "The server's host key does not match the one PuTTY has\n" "cached in the registry. This means that either the\n" "server administrator has changed the host key, or you\n" "have actually connected to another computer pretending\n" "to be the server.\n" "The new key fingerprint is:\n" "%s\n" "Connection abandoned.\n"; static const char wrongmsg[] = "WARNING - POTENTIAL SECURITY BREACH!\n" "The server's host key does not match the one PuTTY has\n" "cached in the registry. This means that either the\n" "server administrator has changed the host key, or you\n" "have actually connected to another computer pretending\n" "to be the server.\n" "The new key fingerprint is:\n" "%s\n" "If you were expecting this change and trust the new key,\n" "press \"Yes\" to update Atol cache and continue connecting.\n" "If you want to carry on connecting but without updating\n" "the cache, press \"No\".\n" "If you want to abandon the connection completely, press\n" "\"Cancel\". Pressing \"Cancel\" is the ONLY guaranteed\n" "safe choice.\n" "Update cached key? (y/n, \"Cancel\" cancels connection) "; static const char abandoned[] = "Connection abandoned.\n"; // char line[32]; /* * Verify the key against the registry. */ ret = verify_host_key(host, port, keytype, keystr); if (ret == 0) /* success - key matched OK */ return; char szBuffer[512]; if (ret == 2) { /* key was different */ if (console_batch_mode) { //TOFIX fprintf(stderr, wrongmsg_batch, fingerprint); sprintf(szBuffer, wrongmsg_batch, fingerprint); if(session.m_fnKeyWarning) session.m_fnKeyWarning(szBuffer, 0, session.m_fnKeyData); cleanup_exit(1); } //TOFIX fprintf(stderr, wrongmsg, fingerprint); //TOFIX fflush(stderr); sprintf(szBuffer, wrongmsg, fingerprint); if(session.m_fnKeyWarning) choice = session.m_fnKeyWarning(szBuffer, 1, session.m_fnKeyData); } if (ret == 1) { /* key was absent */ if (console_batch_mode) { //TOFIX fprintf(stderr, absentmsg_batch, fingerprint); sprintf(szBuffer, absentmsg_batch, fingerprint); if(session.m_fnKeyWarning) session.m_fnKeyWarning(szBuffer, 0, session.m_fnKeyData); cleanup_exit(1); } //TOFIX fprintf(stderr, absentmsg, fingerprint); //TOFIX fflush(stderr); sprintf(szBuffer, absentmsg, fingerprint); if(session.m_fnKeyWarning) choice = session.m_fnKeyWarning(szBuffer, 1, session.m_fnKeyData); } //hin = GetStdHandle(STD_INPUT_HANDLE); //if(hin) { //GetConsoleMode(hin, &savemode); //SetConsoleMode(hin, (savemode | ENABLE_ECHO_INPUT | // ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT)); //ReadFile(hin, line, sizeof(line) - 1, &i, NULL); //SetConsoleMode(hin, savemode); //if (line[0] != '\0' && line[0] != '\r' && line[0] != '\n') { if(choice > 0){ //if (line[0] == 'y' || line[0] == 'Y') if(1 == choice) store_host_key(host, port, keytype, keystr); } else { //TOFIX fprintf(stderr, abandoned); sprintf(szBuffer, abandoned, fingerprint); if(session.m_fnKeyWarning) session.m_fnKeyWarning(szBuffer, 0, session.m_fnKeyData); cleanup_exit(0); } } } /* * Ask whether the selected cipher is acceptable (since it was * below the configured 'warn' threshold). * cs: 0 = both ways, 1 = client->server, 2 = server->client */ void askcipher(char *ciphername, int cs) { HANDLE hin; DWORD savemode, i; static const char msg[] = "The first %scipher supported by the server is\n" "%s, which is below the configured warning threshold.\n" "Continue with connection? (y/n) "; static const char msg_batch[] = "The first %scipher supported by the server is\n" "%s, which is below the configured warning threshold.\n" "Connection abandoned.\n"; static const char abandoned[] = "Connection abandoned.\n"; char line[32]; if (console_batch_mode) { //TOFIX fprintf(stderr, msg_batch, //TOFIX (cs == 0) ? "" : //TOFIX (cs == 1) ? "client-to-server " : "server-to-client ", //TOFIX ciphername); cleanup_exit(1); } //TOFIX fprintf(stderr, msg, //TOFIX (cs == 0) ? "" : //TOFIX (cs == 1) ? "client-to-server " : "server-to-client ", //TOFIX ciphername); //fflush(stderr); hin = GetStdHandle(STD_INPUT_HANDLE); GetConsoleMode(hin, &savemode); SetConsoleMode(hin, (savemode | ENABLE_ECHO_INPUT | ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT)); ReadFile(hin, line, sizeof(line) - 1, &i, NULL); SetConsoleMode(hin, savemode); if (line[0] == 'y' || line[0] == 'Y') { return; } else { //TOFIX fprintf(stderr, abandoned); cleanup_exit(0); } } /* * Ask whether to wipe a session log file before writing to it. * Returns 2 for wipe, 1 for append, 0 for cancel (don't log). */ int askappend(char *filename) { HANDLE hin; DWORD savemode, i; static const char msgtemplate[] = "The session log file \"%.*s\" already exists.\n" "You can overwrite it with a new session log,\n" "append your session log to the end of it,\n" "or disable session logging for this session.\n" "Enter \"y\" to wipe the file, \"n\" to append to it,\n" "or just press Return to disable logging.\n" "Wipe the log file? (y/n, Return cancels logging) "; static const char msgtemplate_batch[] = "The session log file \"%.*s\" already exists.\n" "Logging will not be enabled.\n"; char line[32]; if (cfg.logxfovr != LGXF_ASK) { return ((cfg.logxfovr == LGXF_OVR) ? 2 : 1); } if (console_batch_mode) { //TOFIX fprintf(stderr, msgtemplate_batch, FILENAME_MAX, filename); //TOFIX fflush(stderr); return 0; } //TOFIX fprintf(stderr, msgtemplate, FILENAME_MAX, filename); //fflush(stderr); hin = GetStdHandle(STD_INPUT_HANDLE); GetConsoleMode(hin, &savemode); SetConsoleMode(hin, (savemode | ENABLE_ECHO_INPUT | ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT)); ReadFile(hin, line, sizeof(line) - 1, &i, NULL); SetConsoleMode(hin, savemode); if (line[0] == 'y' || line[0] == 'Y') return 2; else if (line[0] == 'n' || line[0] == 'N') return 1; else return 0; } /* * Warn about the obsolescent key file format. */ void old_keyfile_warning(void) { static const char message[] = "You are loading an SSH 2 private key which has an\n" "old version of the file format. This means your key\n" "file is not fully tamperproof. Future versions of\n" "PuTTY may stop supporting this private key format,\n" "so we recommend you convert your key to the new\n" "format.\n" "\n" "Once the key is loaded into PuTTYgen, you can perform\n" "this conversion simply by saving it again.\n"; fputs(message, stderr); } //TOFIX move to CSshSession void logevent(CSshSession &session, char *string) { if(session.m_dbgFn) session.m_dbgFn(string, session.m_dwDbgData); } char *console_password = NULL; int console_get_line(const char *prompt, char *str, int maxlen, int is_pw) { HANDLE hin, hout; DWORD savemode, newmode, i; if (is_pw && console_password) { static int tried_once = 0; if (tried_once) { return 0; } else { strncpy(str, console_password, maxlen); str[maxlen - 1] = '\0'; tried_once = 1; return 1; } } if (console_batch_mode) { if (maxlen > 0) str[0] = '\0'; } else { hin = GetStdHandle(STD_INPUT_HANDLE); hout = GetStdHandle(STD_OUTPUT_HANDLE); if (hin == INVALID_HANDLE_VALUE || hout == INVALID_HANDLE_VALUE) { //TOFIX fprintf(stderr, "Cannot get standard input/output handles\n"); cleanup_exit(1); } if (hin == NULL || hout == NULL) return 1; GetConsoleMode(hin, &savemode); newmode = savemode | ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT; if (is_pw) newmode &= ~ENABLE_ECHO_INPUT; else newmode |= ENABLE_ECHO_INPUT; SetConsoleMode(hin, newmode); WriteFile(hout, prompt, strlen(prompt), &i, NULL); ReadFile(hin, str, maxlen - 1, &i, NULL); SetConsoleMode(hin, savemode); if ((int) i > maxlen) i = maxlen - 1; else i = i - 2; str[i] = '\0'; if (is_pw) WriteFile(hout, "\r\n", 2, &i, NULL); } return 1; }
chriskmanx/qmole
QMOLEDEV/atol-0.7.3/src/core/_sftp/Console.cpp
C++
gpl-3.0
10,402
<?xml version="1.0" encoding="utf-8"?> <!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" xml:lang="en" lang="en"> <head> <title>ActiveJob::Core::ClassMethods</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" /> <link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" /> <link rel="stylesheet" href="../../../css/github.css" type="text/css" media="screen" /> <script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script> <script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script> <script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script> <script src="../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script> </head> <body> <div class="banner"> <span>Ruby on Rails 4.2.6</span><br /> <h1> <span class="type">Module</span> ActiveJob::Core::ClassMethods </h1> <ul class="files"> <li><a href="../../../files/__/__/_rbenv/versions/2_4_0/lib/ruby/gems/2_4_0/gems/activejob-4_2_6/lib/active_job/core_rb.html">/home/user/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activejob-4.2.6/lib/active_job/core.rb</a></li> </ul> </div> <div id="bodyContent"> <div id="content"> <div class="description"> <p>These methods will be included into any Active Job object, adding helpers for de/serialization and creation of job instances.</p> </div> <!-- Method ref --> <div class="sectiontitle">Methods</div> <dl class="methods"> <dt>D</dt> <dd> <ul> <li> <a href="#method-i-deserialize">deserialize</a> </li> </ul> </dd> <dt>S</dt> <dd> <ul> <li> <a href="#method-i-set">set</a> </li> </ul> </dd> </dl> <!-- Methods --> <div class="sectiontitle">Instance Public methods</div> <div class="method"> <div class="title method-title" id="method-i-deserialize"> <b>deserialize</b>(job_data) <a href="../../../classes/ActiveJob/Core/ClassMethods.html#method-i-deserialize" name="method-i-deserialize" class="permalink">Link</a> </div> <div class="description"> <p>Creates a new job instance from a hash created with <code>serialize</code></p> </div> <div class="sourcecode"> <p class="source-link"> Source: <a href="javascript:toggleSource('method-i-deserialize_source')" id="l_method-i-deserialize_source">show</a> </p> <div id="method-i-deserialize_source" class="dyn-source"> <pre><span class="ruby-comment"># File ../../.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activejob-4.2.6/lib/active_job/core.rb, line 27</span> <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">deserialize</span>(<span class="ruby-identifier">job_data</span>) <span class="ruby-identifier">job</span> = <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&#39;job_class&#39;</span>].<span class="ruby-identifier">constantize</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">job</span>.<span class="ruby-identifier">job_id</span> = <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&#39;job_id&#39;</span>] <span class="ruby-identifier">job</span>.<span class="ruby-identifier">queue_name</span> = <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&#39;queue_name&#39;</span>] <span class="ruby-identifier">job</span>.<span class="ruby-identifier">serialized_arguments</span> = <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&#39;arguments&#39;</span>] <span class="ruby-identifier">job</span>.<span class="ruby-identifier">locale</span> = <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&#39;locale&#39;</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">I18n</span>.<span class="ruby-identifier">locale</span> <span class="ruby-identifier">job</span> <span class="ruby-keyword">end</span></pre> </div> </div> </div> <div class="method"> <div class="title method-title" id="method-i-set"> <b>set</b>(options={}) <a href="../../../classes/ActiveJob/Core/ClassMethods.html#method-i-set" name="method-i-set" class="permalink">Link</a> </div> <div class="description"> <p>Creates a job preconfigured with the given options. You can call perform_later with the job arguments to enqueue the job with the preconfigured options</p> <h4 id="method-i-set-label-Options">Options</h4> <ul><li> <p><code>:wait</code> - Enqueues the job with the specified delay</p> </li><li> <p><code>:wait_until</code> - Enqueues the job at the time specified</p> </li><li> <p><code>:queue</code> - Enqueues the job on the specified queue</p> </li></ul> <h4 id="method-i-set-label-Examples">Examples</h4> <pre><code>VideoJob.set(queue: :some_queue).perform_later(Video.last) VideoJob.set(wait: 5.minutes).perform_later(Video.last) VideoJob.set(wait_until: Time.now.tomorrow).perform_later(Video.last) VideoJob.set(queue: :some_queue, wait: 5.minutes).perform_later(Video.last) VideoJob.set(queue: :some_queue, wait_until: Time.now.tomorrow).perform_later(Video.last) </code></pre> </div> <div class="sourcecode"> <p class="source-link"> Source: <a href="javascript:toggleSource('method-i-set_source')" id="l_method-i-set_source">show</a> </p> <div id="method-i-set_source" class="dyn-source"> <pre><span class="ruby-comment"># File ../../.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activejob-4.2.6/lib/active_job/core.rb, line 52</span> <span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">set</span>(<span class="ruby-identifier">options</span>={}) <span class="ruby-constant">ConfiguredJob</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword">self</span>, <span class="ruby-identifier">options</span>) <span class="ruby-keyword">end</span></pre> </div> </div> </div> </div> </div> </body> </html>
Dpasi314/DevConnect
project/doc/api/classes/ActiveJob/Core/ClassMethods.html
HTML
gpl-3.0
7,371
/* Copyright 2011-2014 Red Hat, Inc This file is part of PressGang CCMS. PressGang CCMS 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. PressGang CCMS 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 PressGang CCMS. If not, see <http://www.gnu.org/licenses/>. */ package org.jboss.pressgang.ccms.rest.v1.query; import java.util.ArrayList; import java.util.List; import org.jboss.pressgang.ccms.rest.v1.constants.CommonFilterConstants; import org.jboss.pressgang.ccms.rest.v1.query.base.RESTBaseQueryBuilderV1; import org.jboss.pressgang.ccms.utils.structures.Pair; public class RESTPropertyCategoryQueryBuilderV1 extends RESTBaseQueryBuilderV1 { private static List<Pair<String, String>> filterPairs = new ArrayList<Pair<String, String>>() { private static final long serialVersionUID = -8638470044710698912L; { add(new Pair<String, String>(CommonFilterConstants.PROP_CATEGORY_IDS_FILTER_VAR, CommonFilterConstants.PROP_CATEGORY_IDS_FILTER_VAR_DESC)); add(new Pair<String, String>(CommonFilterConstants.PROP_CATEGORY_NAME_FILTER_VAR, CommonFilterConstants.PROP_CATEGORY_NAME_FILTER_VAR_DESC)); add(new Pair<String, String>(CommonFilterConstants.PROP_CATEGORY_DESCRIPTION_FILTER_VAR, CommonFilterConstants.PROP_CATEGORY_DESCRIPTION_FILTER_VAR_DESC)); } }; public static List<Pair<String, String>> getFilterInfo() { return filterPairs; } public static String getFilterDesc(final String varName) { if (varName == null) return null; final List<Pair<String, String>> filterInfo = getFilterInfo(); for (final Pair<String, String> varInfo : filterInfo) { if (varInfo.getFirst().equals(varName)) { return varInfo.getSecond(); } } return null; } public List<Integer> getPropertyCategoryIds() { final String propertyCategoryIdsString = get(CommonFilterConstants.PROP_CATEGORY_IDS_FILTER_VAR); return getIntegerList(propertyCategoryIdsString); } public void setPropertyCategoryIds(final List<Integer> propertyCategoryIds) { put(CommonFilterConstants.PROP_CATEGORY_IDS_FILTER_VAR, propertyCategoryIds); } public String getPropertyCategoryName() { return get(CommonFilterConstants.PROP_CATEGORY_NAME_FILTER_VAR); } public void setPropertyCategoryName(final String propertyCategoryName) { put(CommonFilterConstants.PROP_CATEGORY_NAME_FILTER_VAR, propertyCategoryName); } public String getPropertyCategoryDescription() { return get(CommonFilterConstants.PROP_CATEGORY_DESCRIPTION_FILTER_VAR); } public void setPropertyCategoryDescription(final String propertyCategoryDescription) { put(CommonFilterConstants.PROP_CATEGORY_DESCRIPTION_FILTER_VAR, propertyCategoryDescription); } }
pressgang-ccms/PressGangCCMSRESTv1Common
src/main/java/org/jboss/pressgang/ccms/rest/v1/query/RESTPropertyCategoryQueryBuilderV1.java
Java
gpl-3.0
3,394
<?php /** * This file is part of OXID eShop Community Edition. * * OXID eShop Community Edition 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. * * OXID eShop Community Edition 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 OXID eShop Community Edition. If not, see <http://www.gnu.org/licenses/>. * * @link http://www.oxid-esales.com * @package core * @copyright (C) OXID eSales AG 2003-2013 * @version OXID eShop CE * @version SVN: $Id: oxnews.php 48786 2012-08-17 10:20:42Z tomas $ */ /** * News manager. * Performs news text collection. News may be sorted by user categories (only * these user may read news), etc. * * @package model */ class oxNews extends oxI18n { /** * User group object (default null). * * @var object */ protected $_oGroups = null; /** * Current class name * * @var string */ protected $_sClassName = 'oxnews'; /** * Class constructor, initiates parent constructor (parent::oxI18n()). * * @return null */ public function __construct() { parent::__construct(); $this->init('oxnews'); } /** * Assigns object data. * * @param string $dbRecord database record to be assigned * * @return null */ public function assign( $dbRecord ) { parent::assign( $dbRecord ); // convert date's to international format if ($this->oxnews__oxdate) { $this->oxnews__oxdate->setValue( oxRegistry::get("oxUtilsDate")->formatDBDate( $this->oxnews__oxdate->value ) ); } } /** * Returns list of user groups assigned to current news object * * @return oxlist */ public function getGroups() { if ( $this->_oGroups == null && $sOxid = $this->getId() ) { // usergroups $this->_oGroups = oxNew( 'oxlist', 'oxgroups' ); $sViewName = getViewName( "oxgroups", $this->getLanguage() ); $sSelect = "select {$sViewName}.* from {$sViewName}, oxobject2group "; $sSelect .= "where oxobject2group.oxobjectid='$sOxid' "; $sSelect .= "and oxobject2group.oxgroupsid={$sViewName}.oxid "; $this->_oGroups->selectString( $sSelect ); } return $this->_oGroups; } /** * Checks if this object is in group, returns true on success. * * @param string $sGroupID user group ID * * @return bool */ public function inGroup( $sGroupID ) { $blResult = false; $aGroups = $this->getGroups(); foreach ( $aGroups as $oObject ) { if ( $oObject->_sOXID == $sGroupID ) { $blResult = true; break; } } return $blResult; } /** * Deletes object information from DB, returns true on success. * * @param string $sOxid Object ID (default null) * * @return bool */ public function delete( $sOxid = null ) { if ( !$sOxid ) { $sOxid = $this->getId(); } if ( !$sOxid ) { return false; } if ( $blDelete = parent::delete( $sOxid ) ) { $oDb = oxDb::getDb(); $oDb->execute( "delete from oxobject2group where oxobject2group.oxobjectid = ".$oDb->quote( $sOxid ) ); } return $blDelete; } /** * Updates object information in DB. * * @return null */ protected function _update() { $this->oxnews__oxdate->setValue( oxRegistry::get("oxUtilsDate")->formatDBDate( $this->oxnews__oxdate->value, true ) ); parent::_update(); } /** * Inserts object details to DB, returns true on success. * * @return bool */ protected function _insert() { if ( !$this->oxnews__oxdate || oxRegistry::get("oxUtilsDate")->isEmptyDate( $this->oxnews__oxdate->value ) ) { // if date field is empty, assigning current date $this->oxnews__oxdate = new oxField( date( 'Y-m-d' ) ); } else { $this->oxnews__oxdate = new oxField( oxRegistry::get("oxUtilsDate")->formatDBDate( $this->oxnews__oxdate->value, true ) ); } return parent::_insert(); } /** * Sets data field value * * @param string $sFieldName index OR name (eg. 'oxarticles__oxtitle') of a data field to set * @param string $sValue value of data field * @param int $iDataType field type * * @return null */ protected function _setFieldData( $sFieldName, $sValue, $iDataType = oxField::T_TEXT) { switch (strtolower($sFieldName)) { case 'oxlongdesc': case 'oxnews__oxlongdesc': $iDataType = oxField::T_RAW; break; } return parent::_setFieldData($sFieldName, $sValue, $iDataType); } /** * get long description, parsed through smarty * * @return string */ public function getLongDesc() { return oxRegistry::get("oxUtilsView")->parseThroughSmarty( $this->oxnews__oxlongdesc->getRawValue(), $this->getId().$this->getLanguage() ); } }
NikolayPetrenko/oxid
application/models/oxnews.php
PHP
gpl-3.0
5,714
<?php /* ########################################################################## # # # Version 4 / / / # # -----------__---/__---__------__----__---/---/- # # | /| / /___) / ) (_ ` / ) /___) / / # # _|/_|/__(___ _(___/_(__)___/___/_(___ _/___/___ # # Free Content / Management System # # / # # # # # # Copyright 2005-2011 by webspell.org # # # # visit webSPELL.org, webspell.info to get webSPELL for free # # - Script runs under the GNU GENERAL PUBLIC LICENSE # # - It's NOT allowed to remove this copyright-tag # # -- http://www.fsf.org/licensing/licenses/gpl.html # # # # Code based on WebSPELL Clanpackage (Michael Gruber - webspell.at), # # Far Development by Development Team - webspell.org # # # # visit webspell.org # # # ########################################################################## */ $language_array = Array( /* do not edit above this line */ 'del_from_mail_list'=>'Izbriลกi sa newsletter liste', 'del_key'=>'Kod za brisanje', 'delete'=>'Izbriลกi', 'deletion_key'=>'Kod za brisanje', 'email_not_valid'=>'Vaลก e-mail nije ispravno upisan!', 'lost_deletion_key'=>'Izgubili ste kod za brisanje?', 'mail_adress'=>'E-mail adresa', 'mail_pw_didnt_match'=>'E-mail/lozinka se ne podudaraju.', 'mail_not_in_db'=>'Upisana e-mail adresa ne postoji u naลกoj bazi.', 'newsletter'=>'newsletter', 'newsletter_registration'=>'Registracija za newsletter', 'no_such_mail_adress'=>'Ne postoji takva e-mail adresa.', 'password_had_been_send'=>'Lozinka je poslana.', 'register_newsletter'=>'Registriraj se za newsletter', 'request_mail'=>'<b>Treba Vam vaลก kod za brisanje!</b><br /><br />Da bi maknuli Vaลก e-mail sa liste mailova za newsletter kliknite <a href="http://%homepage_url%/index.php?site=newsletter&mail=%mail%&pass=%delete_key%">ovdje</a><br />Vaลกa lozinka za brisanje s liste: %delete_key%<br /><br />Vidimo se na %homepage_url%', 'send'=>'Poลกalji', 'submit'=>'Spremi', 'success_mail'=>'<b>Hvala Vam na registraciji!</b><br /><br />Da bi maknuli Vaลก e-mail sa liste mailova za newsletter kliknite <a href="http://%homepage_url%/index.php?site=newsletter&mail=%mail%&pass=%delete_key%">ovdje</a><br />Vaลกa lozinka za brisanje s liste: %delete_key%<br /><br />Vidimo se na %homepage_url%', 'thank_you_for_registration'=>'Hvala Vam na registraciji.', 'you_are_already_registered'=>'Veฤ‡ ste registrirani.', 'your_mail_adress'=>'Vaลก e-mail', 'your_mail_adress_deleted'=>'Vaลก e-mail je maknut s liste.' ); ?>
webSPELL/webSPELL
languages/hr/newsletter.php
PHP
gpl-3.0
3,435
CREATE TABLE "south_boston_planning_district_2010_census_population" ( );
talos/docker4data
data/socrata/data.cityofboston.gov/south_boston_planning_district_2010_census_population/schema.sql
SQL
gpl-3.0
75
/* gvSIG. Sistema de Informaciรณn Geogrรกfica de la Generalitat Valenciana * * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. * * 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 2 * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. * * For more information, contact: * * Generalitat Valenciana * Conselleria d'Infraestructures i Transport * Av. Blasco Ibรกรฑez, 50 * 46010 VALENCIA * SPAIN * * +34 963862235 * [email protected] * www.gvsig.gva.es * * or * * IVER T.I. S.A * Salamanca 50 * 46005 Valencia * Spain * * +34 963163400 * [email protected] */ package com.iver.cit.gvsig.fmap.layers; import java.awt.Graphics2D; import java.awt.Point; import java.awt.geom.AffineTransform; import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; import java.io.File; import java.net.URI; import java.util.ArrayList; import javax.print.attribute.PrintRequestAttributeSet; import javax.print.attribute.standard.PrintQuality; import org.apache.log4j.Logger; import org.cresques.cts.ICoordTrans; import org.gvsig.tools.file.PathGenerator; import com.hardcode.gdbms.driver.exceptions.ReadDriverException; import com.hardcode.gdbms.engine.data.DataSourceFactory; import com.hardcode.gdbms.engine.data.NoSuchTableException; import com.hardcode.gdbms.engine.data.driver.DriverException; import com.hardcode.gdbms.engine.instruction.FieldNotFoundException; import com.iver.cit.gvsig.exceptions.expansionfile.ExpansionFileReadException; import com.iver.cit.gvsig.exceptions.layers.LegendLayerException; import com.iver.cit.gvsig.exceptions.layers.ReloadLayerException; import com.iver.cit.gvsig.exceptions.layers.ReprojectLayerException; import com.iver.cit.gvsig.exceptions.layers.StartEditionLayerException; import com.iver.cit.gvsig.exceptions.visitors.StartWriterVisitorException; import com.iver.cit.gvsig.exceptions.visitors.VisitorException; import com.iver.cit.gvsig.fmap.MapContext; import com.iver.cit.gvsig.fmap.MapControl; import com.iver.cit.gvsig.fmap.ViewPort; import com.iver.cit.gvsig.fmap.core.CartographicSupport; import com.iver.cit.gvsig.fmap.core.FPoint2D; import com.iver.cit.gvsig.fmap.core.FShape; import com.iver.cit.gvsig.fmap.core.IFeature; import com.iver.cit.gvsig.fmap.core.IGeometry; import com.iver.cit.gvsig.fmap.core.ILabelable; import com.iver.cit.gvsig.fmap.core.IRow; import com.iver.cit.gvsig.fmap.core.symbols.IMultiLayerSymbol; import com.iver.cit.gvsig.fmap.core.symbols.ISymbol; import com.iver.cit.gvsig.fmap.core.symbols.SimpleLineSymbol; import com.iver.cit.gvsig.fmap.core.v02.FConverter; import com.iver.cit.gvsig.fmap.core.v02.FSymbol; import com.iver.cit.gvsig.fmap.drivers.BoundedShapes; import com.iver.cit.gvsig.fmap.drivers.IFeatureIterator; import com.iver.cit.gvsig.fmap.drivers.IVectorialDatabaseDriver; import com.iver.cit.gvsig.fmap.drivers.VectorialDriver; import com.iver.cit.gvsig.fmap.drivers.WithDefaultLegend; import com.iver.cit.gvsig.fmap.drivers.featureiterators.JoinFeatureIterator; import com.iver.cit.gvsig.fmap.edition.AfterFieldEditEvent; import com.iver.cit.gvsig.fmap.edition.AfterRowEditEvent; import com.iver.cit.gvsig.fmap.edition.AnnotationEditableAdapter; import com.iver.cit.gvsig.fmap.edition.BeforeFieldEditEvent; import com.iver.cit.gvsig.fmap.edition.BeforeRowEditEvent; import com.iver.cit.gvsig.fmap.edition.EditionEvent; import com.iver.cit.gvsig.fmap.edition.IEditionListener; import com.iver.cit.gvsig.fmap.edition.ISpatialWriter; import com.iver.cit.gvsig.fmap.edition.IWriteable; import com.iver.cit.gvsig.fmap.edition.IWriter; import com.iver.cit.gvsig.fmap.edition.VectorialEditableAdapter; import com.iver.cit.gvsig.fmap.edition.VectorialEditableDBAdapter; import com.iver.cit.gvsig.fmap.layers.layerOperations.AlphanumericData; import com.iver.cit.gvsig.fmap.layers.layerOperations.ClassifiableVectorial; import com.iver.cit.gvsig.fmap.layers.layerOperations.InfoByPoint; import com.iver.cit.gvsig.fmap.layers.layerOperations.RandomVectorialData; import com.iver.cit.gvsig.fmap.layers.layerOperations.SingleLayer; import com.iver.cit.gvsig.fmap.layers.layerOperations.VectorialData; import com.iver.cit.gvsig.fmap.layers.layerOperations.VectorialXMLItem; import com.iver.cit.gvsig.fmap.layers.layerOperations.XMLItem; import com.iver.cit.gvsig.fmap.operations.strategies.FeatureVisitor; import com.iver.cit.gvsig.fmap.operations.strategies.Strategy; import com.iver.cit.gvsig.fmap.operations.strategies.StrategyManager; import com.iver.cit.gvsig.fmap.rendering.IClassifiedVectorLegend; import com.iver.cit.gvsig.fmap.rendering.ILegend; import com.iver.cit.gvsig.fmap.rendering.IVectorLegend; import com.iver.cit.gvsig.fmap.rendering.LegendClearEvent; import com.iver.cit.gvsig.fmap.rendering.LegendContentsChangedListener; import com.iver.cit.gvsig.fmap.rendering.LegendFactory; import com.iver.cit.gvsig.fmap.rendering.SingleSymbolLegend; import com.iver.cit.gvsig.fmap.rendering.SymbolLegendEvent; import com.iver.cit.gvsig.fmap.rendering.ZSort; import com.iver.cit.gvsig.fmap.rendering.styling.labeling.AttrInTableLabelingStrategy; import com.iver.cit.gvsig.fmap.rendering.styling.labeling.ILabelingStrategy; import com.iver.cit.gvsig.fmap.rendering.styling.labeling.LabelingFactory; import com.iver.cit.gvsig.fmap.spatialindex.IPersistentSpatialIndex; import com.iver.cit.gvsig.fmap.spatialindex.ISpatialIndex; import com.iver.cit.gvsig.fmap.spatialindex.QuadtreeGt2; import com.iver.cit.gvsig.fmap.spatialindex.QuadtreeJts; import com.iver.cit.gvsig.fmap.spatialindex.SpatialIndexException; import com.iver.utiles.FileUtils; import com.iver.utiles.IPersistence; import com.iver.utiles.NotExistInXMLEntity; import com.iver.utiles.PostProcessSupport; import com.iver.utiles.XMLEntity; import com.iver.utiles.swing.threads.Cancellable; import com.iver.utiles.swing.threads.CancellableMonitorable; import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.GeometryFactory; import com.vividsolutions.jts.geom.Polygon; import com.vividsolutions.jts.geom.TopologyException; /** * Capa bรกsica Vectorial. * * @author Fernando Gonzรกlez Cortรฉs */ public class FLyrVect extends FLyrDefault implements ILabelable, ClassifiableVectorial, SingleLayer, VectorialData, RandomVectorialData, AlphanumericData, InfoByPoint, SelectionListener, IEditionListener, LegendContentsChangedListener { private static Logger logger = Logger.getLogger(FLyrVect.class.getName()); /** Leyenda de la capa vectorial */ private IVectorLegend legend; private int typeShape = -1; private ReadableVectorial source; private SelectableDataSource sds; private SpatialCache spatialCache = new SpatialCache(); private boolean spatialCacheEnabled = false; /** * An implementation of gvSIG spatial index */ protected ISpatialIndex spatialIndex = null; private boolean bHasJoin = false; private XMLEntity orgXMLEntity = null; private XMLEntity loadSelection = null; private IVectorLegend loadLegend = null; //Lo aรฑado. Caracterรญsticas de HyperEnlace (LINK) private FLyrVectLinkProperties linkProperties=new FLyrVectLinkProperties(); //private ArrayList linkProperties=null; private boolean waitTodraw=false; private static PathGenerator pathGenerator=PathGenerator.getInstance(); public boolean isWaitTodraw() { return waitTodraw; } public void setWaitTodraw(boolean waitTodraw) { this.waitTodraw = waitTodraw; } /** * Devuelve el VectorialAdapater de la capa. * * @return VectorialAdapter. */ public ReadableVectorial getSource() { if (!this.isAvailable()) return null; return source; } /** * If we use a persistent spatial index associated with this layer, and the * index is not intrisic to the layer (for example spatial databases) this * method looks for existent spatial index, and loads it. * */ private void loadSpatialIndex() { //FIXME: Al abrir el indice en fichero... //ยฟCรณmo lo liberamos? un metodo Layer.shutdown() ReadableVectorial source = getSource(); //REVISAR QUE PASA CON LOS DRIVERS DXF, DGN, etc. //PUES SON VECTORIALFILEADAPTER if (!(source instanceof VectorialFileAdapter)) { // we are not interested in db adapters return; } VectorialDriver driver = source.getDriver(); if (!(driver instanceof BoundedShapes)) { // we dont spatially index layers that are not bounded return; } File file = ((VectorialFileAdapter) source).getFile(); String fileName = file.getAbsolutePath(); File sptFile = new File(fileName + ".qix"); if (!sptFile.exists() || (!(sptFile.length() > 0))) { // before to exit, look for it in temp path String tempPath = System.getProperty("java.io.tmpdir"); fileName = tempPath + File.separator + sptFile.getName(); sptFile = new File(fileName); // it doesnt exists, must to create if (!sptFile.exists() || (!(sptFile.length() > 0))) { return; }// if }// if try { source.start(); spatialIndex = new QuadtreeGt2(FileUtils.getFileWithoutExtension(sptFile), "NM", source.getFullExtent(), source.getShapeCount(), false); source.setSpatialIndex(spatialIndex); } catch (SpatialIndexException e) { spatialIndex = null; e.printStackTrace(); return; } catch (ReadDriverException e) { spatialIndex = null; e.printStackTrace(); return; } } /** * Checks if it has associated an external spatial index * (an spatial index file). * * It looks for it in main file path, or in temp system path. * If main file is rivers.shp, it looks for a file called * rivers.shp.qix. * @return */ public boolean isExternallySpatiallyIndexed() { /* * FIXME (AZABALA): Independizar del tipo de fichero de รญndice * con el que se trabaje (ahora mismo considera la extension .qix, * pero esto dependerรก del tipo de รญndice) * */ ReadableVectorial source = getSource(); if (!(source instanceof VectorialFileAdapter)) { // we are not interested in db adapters. // think in non spatial dbs, like HSQLDB return false; } File file = ((VectorialFileAdapter) source).getFile(); String fileName = file.getAbsolutePath(); File sptFile = new File(fileName + ".qix"); if (!sptFile.exists() || (!(sptFile.length() > 0))) { // before to exit, look for it in temp path // it doesnt exists, must to create String tempPath = System.getProperty("java.io.tmpdir"); fileName = tempPath + File.separator + sptFile.getName(); sptFile = new File(fileName); if (!sptFile.exists() || (!(sptFile.length() > 0))) { return false; }// if }// if return true; } /** * Inserta el VectorialAdapter a la capa. * * @param va * VectorialAdapter. */ public void setSource(ReadableVectorial rv) { source = rv; // azabala: we check if this layer could have a file spatial index // and load it if it exists loadSpatialIndex(); } public Rectangle2D getFullExtent() throws ReadDriverException, ExpansionFileReadException { Rectangle2D rAux; source.start(); rAux = (Rectangle2D)source.getFullExtent().clone(); source.stop(); // Si existe reproyecciรณn, reproyectar el extent if (!(this.getProjection()!=null && this.getMapContext().getProjection()!=null && this.getProjection().getAbrev().equals(this.getMapContext().getProjection().getAbrev()))){ ICoordTrans ct = getCoordTrans(); try{ if (ct != null) { Point2D pt1 = new Point2D.Double(rAux.getMinX(), rAux.getMinY()); Point2D pt2 = new Point2D.Double(rAux.getMaxX(), rAux.getMaxY()); pt1 = ct.convert(pt1, null); pt2 = ct.convert(pt2, null); rAux = new Rectangle2D.Double(); rAux.setFrameFromDiagonal(pt1, pt2); } }catch (IllegalStateException e) { this.setAvailable(false); this.addError(new ReprojectLayerException(getName(), e)); } } //Esto es para cuando se crea una capa nueva con el fullExtent de ancho y alto 0. if (rAux.getWidth()==0 && rAux.getHeight()==0) { rAux=new Rectangle2D.Double(0,0,100,100); } return rAux; } /** * Draws using IFeatureIterator. This method will replace the old draw(...) one. * @autor jaume dominguez faus - [email protected] * @param image * @param g * @param viewPort * @param cancel * @param scale * @throws ReadDriverException */ private void _draw(BufferedImage image, Graphics2D g, ViewPort viewPort, Cancellable cancel, double scale) throws ReadDriverException { boolean bDrawShapes = true; if (legend instanceof SingleSymbolLegend) { bDrawShapes = legend.getDefaultSymbol().isShapeVisible(); } Point2D offset = viewPort.getOffset(); double dpi = MapContext.getScreenDPI(); if (bDrawShapes) { boolean cacheFeatures = isSpatialCacheEnabled(); SpatialCache cache = null; if (cacheFeatures) { getSpatialCache().clearAll(); cache = getSpatialCache(); } try { ArrayList<String> fieldList = new ArrayList<String>(); // fields from legend String[] aux = null; if (legend instanceof IClassifiedVectorLegend) { aux = ((IClassifiedVectorLegend) legend).getClassifyingFieldNames(); if (aux!=null) { for (int i = 0; i < aux.length; i++) { // check fields exists if (sds.getFieldIndexByName(aux[i]) == -1) { logger.warn("Error en leyenda de " + getName() + ". El campo " + aux[i] + " no estรก."); legend = LegendFactory.createSingleSymbolLegend(getShapeType()); break; } fieldList.add(aux[i]); } } } // Get the iterator over the visible features IFeatureIterator it = null; if (isJoined()) { it = new JoinFeatureIterator(this, viewPort, fieldList.toArray(new String[fieldList.size()])); } else { ReadableVectorial rv=getSource(); // rv.start(); it = rv.getFeatureIterator( viewPort.getAdjustedExtent(), fieldList.toArray(new String[fieldList.size()]), viewPort.getProjection(), true); // rv.stop(); } ZSort zSort = ((IVectorLegend) getLegend()).getZSort(); boolean bSymbolLevelError = false; // if layer has map levels it will use a ZSort boolean useZSort = zSort != null && zSort.isUsingZSort(); // -- visual FX stuff long time = System.currentTimeMillis(); BufferedImage virtualBim; Graphics2D virtualGraphics; // render temporary map each screenRefreshRate milliseconds; int screenRefreshDelay = (int) ((1D/MapControl.getDrawFrameRate())*3*1000); BufferedImage[] imageLevels = null; Graphics2D[] graphics = null; if (useZSort) { imageLevels = new BufferedImage[zSort.getLevelCount()]; graphics = new Graphics2D[imageLevels.length]; for (int i = 0; !cancel.isCanceled() && i < imageLevels.length; i++) { imageLevels[i] = new BufferedImage(image.getWidth(), image.getHeight(), image.getType()); graphics[i] = imageLevels[i].createGraphics(); graphics[i].setTransform(g.getTransform()); graphics[i].setRenderingHints(g.getRenderingHints()); } } // -- end visual FX stuff boolean isInMemory = false; if (getSource().getDriverAttributes() != null){ isInMemory = getSource().getDriverAttributes().isLoadedInMemory(); } SelectionSupport selectionSupport=getSelectionSupport(); // Iteration over each feature while ( !cancel.isCanceled() && it.hasNext()) { IFeature feat = it.next(); IGeometry geom = null; if (isInMemory){ geom = feat.getGeometry().cloneGeometry(); }else{ geom = feat.getGeometry(); } if (cacheFeatures) { if (cache.getMaxFeatures() >= cache.size()) { // already reprojected cache.insert(geom.getBounds2D(), geom); } } // retrieve the symbol associated to such feature ISymbol sym = legend.getSymbolByFeature(feat); if (sym == null) continue; //Cรณdigo para poder acceder a los รญndices para ver si estรก seleccionado un Feature ReadableVectorial rv=getSource(); int selectionIndex=-1; if (rv instanceof ISpatialDB){ selectionIndex = ((ISpatialDB)rv).getRowIndexByFID(feat); }else{ selectionIndex = Integer.parseInt(feat.getID()); } if (selectionIndex!=-1) { if (selectionSupport.isSelected(selectionIndex)) { sym = sym.getSymbolForSelection(); } } // Check if this symbol is sized with CartographicSupport CartographicSupport csSym = null; int symbolType = sym.getSymbolType(); boolean bDrawCartographicSupport = false; if ( symbolType == FShape.POINT || symbolType == FShape.LINE || sym instanceof CartographicSupport) { // patch if (!sym.getClass().equals(FSymbol.class)) { csSym = (CartographicSupport) sym; bDrawCartographicSupport = (csSym.getUnit() != -1); } } int x = -1; int y = -1; int[] xyCoords = new int[2]; // Check if size is a pixel boolean onePoint = bDrawCartographicSupport ? isOnePoint(g.getTransform(), viewPort, MapContext.getScreenDPI(), csSym, geom, xyCoords) : isOnePoint(g.getTransform(), viewPort, geom, xyCoords); // Avoid out of bounds exceptions if (onePoint) { x = xyCoords[0]; y = xyCoords[1]; if (x<0 || y<0 || x>= viewPort.getImageWidth() || y>=viewPort.getImageHeight()) continue; } if (useZSort) { // Check if this symbol is a multilayer int[] symLevels = zSort.getLevels(sym); if (sym instanceof IMultiLayerSymbol) { // if so, treat each of its layers as a single symbol // in its corresponding map level IMultiLayerSymbol mlSym = (IMultiLayerSymbol) sym; for (int i = 0; !cancel.isCanceled() && i < mlSym.getLayerCount(); i++) { ISymbol mySym = mlSym.getLayer(i); int symbolLevel = 0; if (symLevels != null) { symbolLevel = symLevels[i]; } else { /* an error occured when managing symbol levels. * some of the legend changed events regarding the * symbols did not finish satisfactory and the legend * is now inconsistent. For this drawing, it will finish * as it was at the bottom (level 0) but, when done, the * ZSort will be reset to avoid app crashes. This is * a bug that has to be fixed. */ bSymbolLevelError = true; } if (onePoint) { if (x<0 || y<0 || x>= imageLevels[symbolLevel].getWidth() || y>=imageLevels[symbolLevel].getHeight()) continue; imageLevels[symbolLevel].setRGB(x, y, mySym.getOnePointRgb()); } else { if (!bDrawCartographicSupport) { geom.drawInts(graphics[symbolLevel], viewPort, mySym, cancel); } else { geom.drawInts(graphics[symbolLevel], viewPort, dpi, (CartographicSupport) mySym, cancel); } } } } else { // else, just draw the symbol in its level int symbolLevel = 0; if (symLevels != null) { symbolLevel=symLevels[0]; } else { /* If symLevels == null * an error occured when managing symbol levels. * some of the legend changed events regarding the * symbols did not finish satisfactory and the legend * is now inconsistent. For this drawing, it will finish * as it was at the bottom (level 0). This is * a bug that has to be fixed. */ // bSymbolLevelError = true; } if (!bDrawCartographicSupport) { geom.drawInts(graphics[symbolLevel], viewPort, sym, cancel); } else { geom.drawInts(graphics[symbolLevel], viewPort, dpi, csSym, cancel); } } // -- visual FX stuff // Cuando el offset!=0 se estรก dibujando sobre el Layout y por tanto no tiene que ejecutar el siguiente cรณdigo. if (offset.getX()==0 && offset.getY()==0) if ((System.currentTimeMillis() - time) > screenRefreshDelay) { virtualBim = new BufferedImage(image.getWidth(),image.getHeight(),BufferedImage.TYPE_INT_ARGB); virtualGraphics = virtualBim.createGraphics(); virtualGraphics.drawImage(image,0,0, null); for (int i = 0; !cancel.isCanceled() && i < imageLevels.length; i++) { virtualGraphics.drawImage(imageLevels[i],0,0, null); } g.clearRect(0, 0, image.getWidth(), image.getHeight()); g.drawImage(virtualBim, 0, 0, null); time = System.currentTimeMillis(); } // -- end visual FX stuff } else { // no ZSort, so there is only a map level, symbols are // just drawn. if (onePoint) { if (x<0 || y<0 || x>= image.getWidth() || y>=image.getHeight()) continue; image.setRGB(x, y, sym.getOnePointRgb()); } else { if (!bDrawCartographicSupport) { geom.drawInts(g, viewPort, sym, cancel); } else { geom.drawInts(g, viewPort, dpi, csSym, cancel); } } } } if (useZSort) { g.drawImage(image, (int)offset.getX(), (int)offset.getY(), null); g.translate(offset.getX(), offset.getY()); for (int i = 0; !cancel.isCanceled() && i < imageLevels.length; i++) { g.drawImage(imageLevels[i],0,0, null); imageLevels[i] = null; graphics[i] = null; } g.translate(-offset.getX(), -offset.getY()); imageLevels = null; graphics = null; } it.closeIterator(); if (bSymbolLevelError) { ((IVectorLegend) getLegend()).setZSort(null); } } catch (ReadDriverException e) { this.setVisible(false); this.setActive(false); throw e; } } } public void draw(BufferedImage image, Graphics2D g, ViewPort viewPort, Cancellable cancel, double scale) throws ReadDriverException { if (isWaitTodraw()) { return; } if (getStrategy() != null) { getStrategy().draw(image, g, viewPort, cancel); } else { _draw(image, g, viewPort, cancel, scale); } } public void _print(Graphics2D g, ViewPort viewPort, Cancellable cancel, double scale, PrintRequestAttributeSet properties, boolean highlight) throws ReadDriverException { boolean bDrawShapes = true; boolean cutGeom = true; if (legend instanceof SingleSymbolLegend) { bDrawShapes = legend.getDefaultSymbol().isShapeVisible(); } if (bDrawShapes) { try { double dpi = 72; PrintQuality resolution=(PrintQuality)properties.get(PrintQuality.class); if (resolution.equals(PrintQuality.NORMAL)){ dpi = 300; } else if (resolution.equals(PrintQuality.HIGH)){ dpi = 600; } else if (resolution.equals(PrintQuality.DRAFT)){ dpi = 72; } ArrayList<String> fieldList = new ArrayList<String>(); String[] aux; // fields from legend if (legend instanceof IClassifiedVectorLegend) { aux = ((IClassifiedVectorLegend) legend).getClassifyingFieldNames(); for (int i = 0; i < aux.length; i++) { fieldList.add(aux[i]); } } // // // fields from labeling // if (isLabeled()) { // aux = getLabelingStrategy().getUsedFields(); // for (int i = 0; i < aux.length; i++) { // fieldList.add(aux[i]); // } // } ZSort zSort = ((IVectorLegend) getLegend()).getZSort(); // if layer has map levels it will use a ZSort boolean useZSort = zSort != null && zSort.isUsingZSort(); int mapLevelCount = (useZSort) ? zSort.getLevelCount() : 1; for (int mapPass = 0; mapPass < mapLevelCount; mapPass++) { // Get the iterator over the visible features // IFeatureIterator it = getSource().getFeatureIterator( // viewPort.getAdjustedExtent(), // fieldList.toArray(new String[fieldList.size()]), // viewPort.getProjection(), // true); IFeatureIterator it = null; if (isJoined()) { it = new JoinFeatureIterator(this, viewPort, fieldList.toArray(new String[fieldList.size()])); } else { it = getSource().getFeatureIterator( viewPort.getAdjustedExtent(), fieldList.toArray(new String[fieldList.size()]), viewPort.getProjection(), true); } // Iteration over each feature while ( !cancel.isCanceled() && it.hasNext()) { IFeature feat = it.next(); IGeometry geom = feat.getGeometry(); // retreive the symbol associated to such feature ISymbol sym = legend.getSymbolByFeature(feat); if (sym == null) { continue; } SelectionSupport selectionSupport=getSelectionSupport(); if (highlight) { //Cรณdigo para poder acceder a los รญndices para ver si estรก seleccionado un Feature ReadableVectorial rv=getSource(); int selectionIndex=-1; if (rv instanceof ISpatialDB){ selectionIndex = ((ISpatialDB)rv).getRowIndexByFID(feat); } else { selectionIndex = Integer.parseInt(feat.getID()); } if (selectionIndex!=-1) { if (selectionSupport.isSelected(selectionIndex)) { sym = sym.getSymbolForSelection(); } } } if (useZSort) { int[] symLevels = zSort.getLevels(sym); if(symLevels != null){ // Check if this symbol is a multilayer if (sym instanceof IMultiLayerSymbol) { // if so, get the layer corresponding to the current // level. If none, continue to next iteration IMultiLayerSymbol mlSym = (IMultiLayerSymbol) sym; for (int i = 0; i < mlSym.getLayerCount(); i++) { ISymbol mySym = mlSym.getLayer(i); if (symLevels[i] == mapPass) { sym = mySym; break; } System.out.println("avoided layer "+i+"of symbol '"+mlSym.getDescription()+"' (pass "+mapPass+")"); } } else { // else, just draw the symbol in its level if (symLevels[0] != mapPass) { System.out.println("avoided single layer symbol '"+sym.getDescription()+"' (pass "+mapPass+")"); continue; } } } } // Check if this symbol is sized with CartographicSupport CartographicSupport csSym = null; int symbolType = sym.getSymbolType(); if (symbolType == FShape.POINT || symbolType == FShape.LINE || sym instanceof CartographicSupport) { csSym = (CartographicSupport) sym; if (sym instanceof SimpleLineSymbol) { SimpleLineSymbol lineSym = new SimpleLineSymbol(); lineSym.setXMLEntity(sym.getXMLEntity()); if (((SimpleLineSymbol) sym).getLineStyle() .getArrowDecorator() != null) { // Lines with decorators should not be cut // because the decorators would be drawn in // the wrong places cutGeom = false; if (!((SimpleLineSymbol) sym) .getLineStyle().getArrowDecorator() .isScaleArrow()) { // Hack for increasing non-scaled arrow // marker size, which usually looks // smaller when printing lineSym.getLineStyle() .getArrowDecorator() .getMarker() .setSize( lineSym.getLineStyle() .getArrowDecorator() .getMarker() .getSize() * 3); } } else { // Make default lines slightly thinner when // printing lineSym.setLineWidth(lineSym.getLineWidth() * 0.75); } csSym = lineSym; } } //System.err.println("passada "+mapPass+" pinte sรญmboll "+sym.getDescription()); // We check if the geometry seems to intersect with the // view extent Rectangle2D extent = viewPort.getExtent(); IGeometry geomToPrint = null; if (cutGeom) { try { if (geom.fastIntersects(extent.getX(), extent.getY(), extent.getWidth(), extent.getHeight())) { // If it does, then we create a rectangle // based on // the view extent and cut the geometries by // it // before drawing them GeometryFactory geomF = new GeometryFactory(); Geometry intersection = geom .toJTSGeometry() .intersection( new Polygon( geomF.createLinearRing(new Coordinate[] { new Coordinate( extent.getMinX(), extent.getMaxY()), new Coordinate( extent.getMaxX(), extent.getMaxY()), new Coordinate( extent.getMaxX(), extent.getMinY()), new Coordinate( extent.getMinX(), extent.getMinY()), new Coordinate( extent.getMinX(), extent.getMaxY()) }), null, geomF)); if (!intersection.isEmpty()) { geomToPrint = FConverter .jts_to_igeometry(intersection); } } } catch (TopologyException e) { logger.warn( "Some error happened while trying to cut a polygon with the view extent before printing (layer '" + this.getName() + "' / feature id " + feat.getID() + "). The whole polygon will be drawn. ", e); geomToPrint = geom; } } else { geomToPrint = geom; } if (geomToPrint != null) { if (csSym == null) { geomToPrint.drawInts(g, viewPort, sym, null); } else { geomToPrint.drawInts(g, viewPort, dpi, csSym, cancel); } } } it.closeIterator(); } } catch (ReadDriverException e) { this.setVisible(false); this.setActive(false); throw e; } } } public void print(Graphics2D g, ViewPort viewPort, Cancellable cancel, double scale, PrintRequestAttributeSet properties) throws ReadDriverException { print(g, viewPort, cancel, scale, properties, false); } public void print(Graphics2D g, ViewPort viewPort, Cancellable cancel, double scale, PrintRequestAttributeSet properties, boolean highlight) throws ReadDriverException { if (isVisible() && isWithinScale(scale)) { _print(g, viewPort, cancel, scale, properties, highlight); } } public void deleteSpatialIndex() { //must we delete possible spatial indexes files? spatialIndex = null; } /** * <p> * Creates an spatial index associated to this layer. * The spatial index will used * the native projection of the layer, so if the layer is reprojected, it will * be ignored. * </p> * @param cancelMonitor instance of CancellableMonitorable that allows * to monitor progress of spatial index creation, and cancel the process */ public void createSpatialIndex(CancellableMonitorable cancelMonitor){ // FJP: ESTO HABRร QUE CAMBIARLO. PARA LAS CAPAS SECUENCIALES, TENDREMOS // QUE ACCEDER CON UN WHILE NEXT. (O mejorar lo de los FeatureVisitor // para que acepten recorrer sin geometria, solo con rectangulos. //If this vectorial layer is based in a spatial database, the spatial //index is already implicit. We only will index file drivers ReadableVectorial va = getSource(); //We must think in non spatial databases, like HSQLDB if(!(va instanceof VectorialFileAdapter)){ return; } if (!(va.getDriver() instanceof BoundedShapes)) { return; } File file = ((VectorialFileAdapter) va).getFile(); String fileName = file.getAbsolutePath(); ISpatialIndex localCopy = null; try { va.start(); localCopy = new QuadtreeGt2(fileName, "NM", va.getFullExtent(), va.getShapeCount(), true); } catch (SpatialIndexException e1) { // Probably we dont have writing permissions String directoryName = System.getProperty("java.io.tmpdir"); File newFile = new File(directoryName + File.separator + file.getName()); String newFileName = newFile.getName(); try { localCopy = new QuadtreeGt2(newFileName, "NM", va.getFullExtent(), va.getShapeCount(), true); } catch (SpatialIndexException e) { // if we cant build a file based spatial index, we'll build // a pure memory spatial index localCopy = new QuadtreeJts(); } catch (ReadDriverException e) { localCopy = new QuadtreeJts(); } } catch(Exception e){ e.printStackTrace(); }//try BoundedShapes shapeBounds = (BoundedShapes) va.getDriver(); try { for (int i=0; i < va.getShapeCount(); i++) { if(cancelMonitor != null){ if(cancelMonitor.isCanceled()) return; cancelMonitor.reportStep(); } Rectangle2D r = shapeBounds.getShapeBounds(i); if(r != null) localCopy.insert(r, i); } // for va.stop(); if(localCopy instanceof IPersistentSpatialIndex) ((IPersistentSpatialIndex) localCopy).flush(); spatialIndex = localCopy; //vectorial adapter needs a reference to the spatial index, to solve //request for feature iteration based in spatial queries source.setSpatialIndex(spatialIndex); } catch (ReadDriverException e) { e.printStackTrace(); } } public void createSpatialIndex() { createSpatialIndex(null); } public void process(FeatureVisitor visitor, FBitSet subset) throws ReadDriverException, ExpansionFileReadException, VisitorException { Strategy s = StrategyManager.getStrategy(this); s.process(visitor, subset); } public void process(FeatureVisitor visitor) throws ReadDriverException, VisitorException { Strategy s = StrategyManager.getStrategy(this); s.process(visitor); } public void process(FeatureVisitor visitor, Rectangle2D rect) throws ReadDriverException, ExpansionFileReadException, VisitorException { Strategy s = StrategyManager.getStrategy(this); s.process(visitor, rect); } public FBitSet queryByRect(Rectangle2D rect) throws ReadDriverException, VisitorException { Strategy s = StrategyManager.getStrategy(this); return s.queryByRect(rect); } public FBitSet queryByPoint(Point2D p, double tolerance) throws ReadDriverException, VisitorException { Strategy s = StrategyManager.getStrategy(this); return s.queryByPoint(p, tolerance); } public FBitSet queryByShape(IGeometry g, int relationship) throws ReadDriverException, VisitorException { Strategy s = StrategyManager.getStrategy(this); return s.queryByShape(g, relationship); } public XMLItem[] getInfo(Point p, double tolerance, Cancellable cancel) throws ReadDriverException, VisitorException { Point2D pReal = this.getMapContext().getViewPort().toMapPoint(p); FBitSet bs = queryByPoint(pReal, tolerance); VectorialXMLItem[] item = new VectorialXMLItem[1]; item[0] = new VectorialXMLItem(bs, this); return item; } public void setLegend(IVectorLegend r) throws LegendLayerException { if (this.legend == r){ return; } if (this.legend != null && this.legend.equals(r)){ return; } IVectorLegend oldLegend = legend; /* * Parche para discriminar las leyendas clasificadas cuyos campos de * clasificaciรณn no estรกn en la fuente de la capa. * * Esto puede ocurrir porque en versiones anteriores se admitรญan * leyendas clasificadas en capas que se han unido a una tabla * por campos que pertenecรญan a la tabla y no sรณlo a la capa. * */ // if(r instanceof IClassifiedVectorLegend){ // IClassifiedVectorLegend classifiedLegend = (IClassifiedVectorLegend)r; // String[] fieldNames = classifiedLegend.getClassifyingFieldNames(); // // for (int i = 0; i < fieldNames.length; i++) { // try { // if(this.getRecordset().getFieldIndexByName(fieldNames[i]) == -1){ //// if(this.getSource().getRecordset().getFieldIndexByName(fieldNames[i]) == -1){ // logger.warn("Some fields of the classification of the legend doesn't belong with the source of the layer."); // if (this.legend == null){ // r = LegendFactory.createSingleSymbolLegend(this.getShapeType()); // } else { // return; // } // } // } catch (ReadDriverException e1) { // throw new LegendLayerException(getName(),e1); // } // } // } /* Fin del parche */ legend = r; try { legend.setDataSource(getRecordset()); } catch (FieldNotFoundException e1) { throw new LegendLayerException(getName(),e1); } catch (ReadDriverException e1) { throw new LegendLayerException(getName(),e1); } finally{ this.updateDrawVersion(); } if (oldLegend != null){ oldLegend.removeLegendListener(this); } if (legend != null){ legend.addLegendListener(this); } LegendChangedEvent e = LegendChangedEvent.createLegendChangedEvent( oldLegend, legend); e.setLayer(this); callLegendChanged(e); } /** * Devuelve la Leyenda de la capa. * * @return Leyenda. */ public ILegend getLegend() { return legend; } /** * Devuelve el tipo de shape que contiene la capa. * * @return tipo de shape. * * @throws DriverException */ public int getShapeType() throws ReadDriverException { if (typeShape == -1) { getSource().start(); typeShape = getSource().getShapeType(); getSource().stop(); } return typeShape; } public XMLEntity getXMLEntity() throws XMLException { if (!this.isAvailable() && this.orgXMLEntity != null) { return this.orgXMLEntity; } XMLEntity xml = super.getXMLEntity(); if (getLegend()!=null) xml.addChild(getLegend().getXMLEntity()); try { if (getRecordset()!=null) xml.addChild(getRecordset().getSelectionSupport().getXMLEntity()); } catch (ReadDriverException e1) { e1.printStackTrace(); throw new XMLException(e1); } // Repongo el mismo ReadableVectorial mรกs abajo para cuando se guarda el proyecto. ReadableVectorial rv=getSource(); xml.putProperty("type", "vectorial"); if (source instanceof VectorialEditableAdapter) { setSource(((VectorialEditableAdapter) source).getOriginalAdapter()); } if (source instanceof VectorialFileAdapter) { xml.putProperty("type", "vectorial"); xml.putProperty("absolutePath",((VectorialFileAdapter) source) .getFile().getAbsolutePath()); xml.putProperty("file", pathGenerator.getPath(((VectorialFileAdapter) source) .getFile().getAbsolutePath())); try { xml.putProperty("recordset-name", source.getRecordset() .getName()); } catch (ReadDriverException e) { throw new XMLException(e); } catch (RuntimeException e) { e.printStackTrace(); } } else if (source instanceof VectorialDBAdapter) { xml.putProperty("type", "vectorial"); IVectorialDatabaseDriver dbDriver = (IVectorialDatabaseDriver) source .getDriver(); // Guardamos el nombre del driver para poder recuperarlo // con el DriverManager de Fernando. xml.putProperty("db", dbDriver.getName()); try { xml.putProperty("recordset-name", source.getRecordset() .getName()); } catch (ReadDriverException e) { throw new XMLException(e); } catch (RuntimeException e) { e.printStackTrace(); } xml.addChild(dbDriver.getXMLEntity()); // Tercer child. Antes hemos // metido la leyenda y el // selection support } else if (source instanceof VectorialAdapter) { // Se supone que hemos hecho algo genรฉrico. xml.putProperty("type", "vectorial"); VectorialDriver driver = source.getDriver(); // Guardamos el nombre del driver para poder recuperarlo // con el DriverManager de Fernando. xml.putProperty("other", driver.getName()); // try { try { xml.putProperty("recordset-name", source.getRecordset() .getName()); } catch (ReadDriverException e) { throw new XMLException(e); } catch (RuntimeException e) { e.printStackTrace(); } if (driver instanceof IPersistence) { // xml.putProperty("className", driver.getClass().getName()); IPersistence persist = (IPersistence) driver; xml.addChild(persist.getXMLEntity()); // Tercer child. Antes // hemos metido la // leyenda y el // selection support } } if (rv!=null) setSource(rv); xml.putProperty("driverName", source.getDriver().getName()); if (bHasJoin) xml.putProperty("hasJoin", "true"); // properties from ILabelable xml.putProperty("isLabeled", isLabeled); if (strategy != null) { XMLEntity strategyXML = strategy.getXMLEntity(); strategyXML.putProperty("Strategy", strategy.getClassName()); xml.addChild(strategy.getXMLEntity()); } xml.addChild(getLinkProperties().getXMLEntity()); return xml; } /* * @see com.iver.cit.gvsig.fmap.layers.FLyrDefault#setXMLEntity(com.iver.utiles.XMLEntity) */ public void setXMLEntity(XMLEntity xml) throws XMLException { try { super.setXMLEntity(xml); XMLEntity legendXML = xml.getChild(0); IVectorLegend leg = LegendFactory.createFromXML(legendXML); try { getRecordset().getSelectionSupport().setXMLEntity(xml.getChild(1)); // JMVIVO: Esto sirve para algo???? /* * Jaume: si, para restaurar el selectable datasource cuando se * clona la capa, cuando se carga de un proyecto. Si no esta ya * no se puede ni hacer consultas sql, ni hacer selecciones, * ni usar la mayor parte de las herramientas. * * Lo vuelvo a poner. */ String recordsetName = xml.getStringProperty("recordset-name"); LayerFactory.getDataSourceFactory().changeDataSourceName( getSource().getRecordset().getName(), recordsetName); SelectableDataSource sds = new SelectableDataSource(LayerFactory .getDataSourceFactory().createRandomDataSource( recordsetName, DataSourceFactory.AUTOMATIC_OPENING)); } catch (NoSuchTableException e1) { this.setAvailable(false); throw new XMLException(e1); } catch (ReadDriverException e1) { this.setAvailable(false); throw new XMLException(e1); } // Si tiene una uniรณn, lo marcamos para que no se cree la leyenda hasta // el final // de la lectura del proyecto if (xml.contains("hasJoin")) { setIsJoined(true); PostProcessSupport.addToPostProcess(this, "setLegend", leg, 1); } else { try { setLegend(leg); } catch (LegendLayerException e) { throw new XMLException(e); } } //Por compatibilidad con proyectos anteriores a la 1.0 boolean containsIsLabeled = xml.contains("isLabeled"); if (containsIsLabeled){ isLabeled = xml.getBooleanProperty("isLabeled"); } // set properties for ILabelable XMLEntity labelingXML = xml.firstChild("labelingStrategy", "labelingStrategy"); if (labelingXML!= null) { if(!containsIsLabeled){ isLabeled = true; } try { ILabelingStrategy labeling = LabelingFactory.createStrategyFromXML(labelingXML, this); if (isJoined()) { PostProcessSupport.addToPostProcess(this, "setLabelingStrategy", labeling, 1); } else this.setLabelingStrategy(labeling); } catch (NotExistInXMLEntity neXMLEX) { // no strategy was set, just continue; logger.warn("Reached what should be unreachable code"); } } else if (legendXML.contains("labelFieldName")|| legendXML.contains("labelfield")) { /* (jaume) begin patch; * for backward compatibility purposes. Since gvSIG v1.1 labeling is * no longer managed by the Legend but by the ILabelingStrategy. The * following allows restoring older projects' labelings. */ String labelTextField = null; if (legendXML.contains("labelFieldName")){ labelTextField = legendXML.getStringProperty("labelFieldName"); if (labelTextField != null) { AttrInTableLabelingStrategy labeling = new AttrInTableLabelingStrategy(); labeling.setLayer(this); int unit = 1; boolean useFixedSize = false; String labelFieldHeight = legendXML.getStringProperty("labelHeightFieldName"); labeling.setTextField(labelTextField); if(labelFieldHeight!=null){ labeling.setHeightField(labelFieldHeight); } else { double size = -1; for(int i=0; i<legendXML.getChildrenCount();i++){ XMLEntity xmlChild = legendXML.getChild(i); if(xmlChild.contains("m_FontSize")){ double childFontSize = xmlChild.getDoubleProperty("m_FontSize"); if(size<0){ size = childFontSize; useFixedSize = true; } else { useFixedSize = useFixedSize && (size==childFontSize); } if(xmlChild.contains("m_bUseFontSize")){ if(xmlChild.getBooleanProperty("m_bUseFontSize")){ unit = -1; } else { unit = 1; } } } } labeling.setFixedSize(size/1.4);//Factor de correcciรณn que se aplicaba antes en el etiquetado } labeling.setUsesFixedSize(useFixedSize); labeling.setUnit(unit); labeling.setRotationField(legendXML.getStringProperty("labelRotationFieldName")); if (isJoined()) { PostProcessSupport.addToPostProcess(this, "setLabelingStrategy", labeling, 1); } else this.setLabelingStrategy(labeling); this.setIsLabeled(true); } }else{ labelTextField = legendXML.getStringProperty("labelfield"); if (labelTextField != null) { AttrInTableLabelingStrategy labeling = new AttrInTableLabelingStrategy(); labeling.setLayer(this); int unit = 1; boolean useFixedSize = false; String labelFieldHeight = legendXML.getStringProperty("labelFieldHeight"); labeling.setTextField(labelTextField); if(labelFieldHeight!=null){ labeling.setHeightField(labelFieldHeight); } else { double size = -1; for(int i=0; i<legendXML.getChildrenCount();i++){ XMLEntity xmlChild = legendXML.getChild(i); if(xmlChild.contains("m_FontSize")){ double childFontSize = xmlChild.getDoubleProperty("m_FontSize"); if(size<0){ size = childFontSize; useFixedSize = true; } else { useFixedSize = useFixedSize && (size==childFontSize); } if(xmlChild.contains("m_bUseFontSize")){ if(xmlChild.getBooleanProperty("m_bUseFontSize")){ unit = -1; } else { unit = 1; } } } } labeling.setFixedSize(size/1.4);//Factor de correcciรณn que se aplicaba antes en el etiquetado } labeling.setUsesFixedSize(useFixedSize); labeling.setUnit(unit); labeling.setRotationField(legendXML.getStringProperty("labelFieldRotation")); if (isJoined()) { PostProcessSupport.addToPostProcess(this, "setLabelingStrategy", labeling, 1); } else this.setLabelingStrategy(labeling); this.setIsLabeled(true); } } }else if(!containsIsLabeled){ isLabeled = false; } // compatibility with hyperlink from 1.9 alpha version... do we really need to be compatible with alpha versions?? XMLEntity xmlLinkProperties=xml.firstChild("typeChild", "linkProperties"); if (xmlLinkProperties != null){ try { String fieldName=xmlLinkProperties.getStringProperty("fieldName"); xmlLinkProperties.remove("fieldName"); String extName = xmlLinkProperties.getStringProperty("extName"); xmlLinkProperties.remove("extName"); int typeLink = xmlLinkProperties.getIntProperty("typeLink"); xmlLinkProperties.remove("typeLink"); if (fieldName!=null) { setProperty("legacy.hyperlink.selectedField", fieldName); setProperty("legacy.hyperlink.type", new Integer(typeLink)); if (extName!=null) { setProperty("legacy.hyperlink.extension", extName); } } } catch (NotExistInXMLEntity ex) { logger.warn("Error getting old hyperlink configuration", ex); } } } catch (XMLException e) { this.setAvailable(false); this.orgXMLEntity = xml; } catch (Exception e) { e.printStackTrace(); this.setAvailable(false); this.orgXMLEntity = xml; } } public void setXMLEntityNew(XMLEntity xml) throws XMLException { try { super.setXMLEntity(xml); XMLEntity legendXML = xml.getChild(0); IVectorLegend leg = LegendFactory.createFromXML(legendXML); /* (jaume) begin patch; * for backward compatibility purposes. Since gvSIG v1.1 labeling is * no longer managed by the Legend but by the ILabelingStrategy. The * following allows restoring older projects' labelings. */ if (legendXML.contains("labelFieldHeight")) { AttrInTableLabelingStrategy labeling = new AttrInTableLabelingStrategy(); labeling.setLayer(this); labeling.setTextField(legendXML.getStringProperty("labelFieldHeight")); labeling.setRotationField(legendXML.getStringProperty("labelFieldRotation")); this.setLabelingStrategy(labeling); this.setIsLabeled(true); } /* end patch */ try { getRecordset().getSelectionSupport().setXMLEntity(xml.getChild(1)); this.setLoadSelection(xml.getChild(1)); } catch (ReadDriverException e1) { this.setAvailable(false); throw new XMLException(e1); } // Si tiene una uniรณn, lo marcamos para que no se cree la leyenda hasta // el final // de la lectura del proyecto if (xml.contains("hasJoin")) { setIsJoined(true); PostProcessSupport.addToPostProcess(this, "setLegend", leg, 1); } else { this.setLoadLegend(leg); } } catch (XMLException e) { this.setAvailable(false); this.orgXMLEntity = xml; } catch (Exception e) { this.setAvailable(false); this.orgXMLEntity = xml; } } /** * Sobreimplementaciรณn del mรฉtodo toString para que las bases de datos * identifiquen la capa. * * @return DOCUMENT ME! */ public String toString() { /* * Se usa internamente para que la parte de datos identifique de forma * unรญvoca las tablas */ String ret = super.toString(); return "layer" + ret.substring(ret.indexOf('@') + 1); } public boolean isJoined() { return bHasJoin; } /** * Returns if a layer is spatially indexed * * @return if this layer has the ability to proces spatial queries without * secuential scans. */ public boolean isSpatiallyIndexed() { ReadableVectorial source = getSource(); if (source instanceof ISpatialDB) return true; //FIXME azabala /* * Esto es muy dudoso, y puede cambiar. * Estoy diciendo que las que no son fichero o no son * BoundedShapes estan indexadas. Esto es mentira, pero * asรญ quien pregunte no querrรก generar el indice. * Esta por ver si interesa generar el indice para capas * HSQLDB, WFS, etc. */ if(!(source instanceof VectorialFileAdapter)){ return true; } if (!(source.getDriver() instanceof BoundedShapes)) { return true; } if (getISpatialIndex() != null) return true; return false; } public void setIsJoined(boolean hasJoin) { bHasJoin = hasJoin; } /** * @return Returns the spatialIndex. */ public ISpatialIndex getISpatialIndex() { return spatialIndex; } /** * Sets the spatial index. This could be useful if, for some * reasons, you want to work with a distinct spatial index * (for example, a spatial index which could makes nearest * neighbour querys) * @param spatialIndex */ public void setISpatialIndex(ISpatialIndex spatialIndex){ this.spatialIndex = spatialIndex; } public SelectableDataSource getRecordset() throws ReadDriverException { if (!this.isAvailable()) return null; if (sds == null) { SelectableDataSource ds = source.getRecordset(); if (ds == null) { return null; } sds = ds; getSelectionSupport().addSelectionListener(this); } return sds; } public void setEditing(boolean b) throws StartEditionLayerException { super.setEditing(b); try { if (b) { VectorialEditableAdapter vea = null; // TODO: Quรฉ pasa si hay mรกs tipos de adapters? // FJP: Se podrรญa pasar como argumento el // VectorialEditableAdapter // que se quiera usar para evitar meter cรณdigo aquรญ de este // estilo. if (getSource() instanceof VectorialDBAdapter) { vea = new VectorialEditableDBAdapter(); } else if (this instanceof FLyrAnnotation) { vea = new AnnotationEditableAdapter( (FLyrAnnotation) this); } else { vea = new VectorialEditableAdapter(); } vea.addEditionListener(this); vea.setOriginalVectorialAdapter(getSource()); // azo: implementations of readablevectorial need //references of projection and spatial index vea.setProjection(getProjection()); vea.setSpatialIndex(spatialIndex); // /vea.setSpatialIndex(getSpatialIndex()); // /vea.setFullExtent(getFullExtent()); vea.setCoordTrans(getCoordTrans()); vea.startEdition(EditionEvent.GRAPHIC); setSource(vea); getRecordset().setSelectionSupport( vea.getOriginalAdapter().getRecordset() .getSelectionSupport()); } else { VectorialEditableAdapter vea = (VectorialEditableAdapter) getSource(); vea.removeEditionListener(this); setSource(vea.getOriginalAdapter()); } // Si tenemos una leyenda, hay que pegarle el cambiazo a su // recordset setRecordset(getSource().getRecordset()); if (getLegend() instanceof IVectorLegend) { IVectorLegend ley = (IVectorLegend) getLegend(); ley.setDataSource(getSource().getRecordset()); // Esto lo pongo para evitar que al dibujar sobre un // dxf, dwg, o dgn no veamos nada. Es debido al checkbox // de la leyenda de textos "dibujar solo textos". //jaume // if (!(getSource().getDriver() instanceof IndexedShpDriver)){ // FSymbol symbol=new FSymbol(getShapeType()); // symbol.setFontSizeInPixels(false); // symbol.setFont(new Font("SansSerif", Font.PLAIN, 9)); // Color color=symbol.getColor(); // int alpha=symbol.getColor().getAlpha(); // if (alpha>250) { // symbol.setColor(new Color(color.getRed(),color.getGreen(),color.getBlue(),100)); // } // ley.setDefaultSymbol(symbol); // } //jaume// ley.useDefaultSymbol(true); } } catch (ReadDriverException e) { throw new StartEditionLayerException(getName(),e); } catch (FieldNotFoundException e) { throw new StartEditionLayerException(getName(),e); } catch (StartWriterVisitorException e) { throw new StartEditionLayerException(getName(),e); } setSpatialCacheEnabled(b); callEditionChanged(LayerEvent .createEditionChangedEvent(this, "edition")); } /** * Para cuando haces una uniรณn, sustituyes el recorset por el nuevo. De esta * forma, podrรกs poner leyendas basadas en el nuevo recordset * * @param newSds */ public void setRecordset(SelectableDataSource newSds) { // TODO: Deberiamos hacer comprobaciones del cambio sds = newSds; getSelectionSupport().addSelectionListener(this); this.updateDrawVersion(); } public void clearSpatialCache() { spatialCache.clearAll(); } public boolean isSpatialCacheEnabled() { return spatialCacheEnabled; } public void setSpatialCacheEnabled(boolean spatialCacheEnabled) { this.spatialCacheEnabled = spatialCacheEnabled; } public SpatialCache getSpatialCache() { return spatialCache; } /** * Siempre es un numero mayor de 1000 * @param maxFeatures */ public void setMaxFeaturesInEditionCache(int maxFeatures) { if (maxFeatures > spatialCache.maxFeatures) spatialCache.setMaxFeatures(maxFeatures); } /** * This method returns a boolean that is used by the FPopMenu * to make visible the properties menu or not. It is visible by * default, and if a later don't have to show this menu only * has to override this method. * @return * If the properties menu is visible (or not) */ public boolean isPropertiesMenuVisible(){ return true; } public void reload() throws ReloadLayerException { if(this.isEditing()){ throw new ReloadLayerException(getName()); } this.setAvailable(true); super.reload(); this.updateDrawVersion(); try { this.source.getDriver().reload(); if (this.getLegend() == null) { if (this.getRecordset().getDriver() instanceof WithDefaultLegend) { WithDefaultLegend aux = (WithDefaultLegend) this.getRecordset().getDriver(); this.setLegend((IVectorLegend) aux.getDefaultLegend()); this.setLabelingStrategy(aux.getDefaultLabelingStrategy()); } else { this.setLegend(LegendFactory.createSingleSymbolLegend( this.getShapeType())); } } } catch (LegendLayerException e) { this.setAvailable(false); throw new ReloadLayerException(getName(),e); } catch (ReadDriverException e) { this.setAvailable(false); throw new ReloadLayerException(getName(),e); } } protected void setLoadSelection(XMLEntity xml) { this.loadSelection = xml; } protected void setLoadLegend(IVectorLegend legend) { this.loadLegend = legend; } protected void putLoadSelection() throws XMLException { if (this.loadSelection == null) return; try { this.getRecordset().getSelectionSupport().setXMLEntity(this.loadSelection); } catch (ReadDriverException e) { throw new XMLException(e); } this.loadSelection = null; } protected void putLoadLegend() throws LegendLayerException { if (this.loadLegend == null) return; this.setLegend(this.loadLegend); this.loadLegend = null; } protected void cleanLoadOptions() { this.loadLegend = null; this.loadSelection = null; } public boolean isWritable() { VectorialDriver drv = getSource().getDriver(); if (!drv.isWritable()) return false; if (drv instanceof IWriteable) { IWriter writer = ((IWriteable)drv).getWriter(); if (writer != null) { if (writer instanceof ISpatialWriter) return true; } } return false; } public FLayer cloneLayer() throws Exception { FLyrVect clonedLayer = new FLyrVect(); clonedLayer.setSource(getSource()); if (isJoined()) { clonedLayer.setIsJoined(true); clonedLayer.setRecordset(getRecordset()); } clonedLayer.setVisible(isVisible()); clonedLayer.setISpatialIndex(getISpatialIndex()); clonedLayer.setName(getName()); clonedLayer.setCoordTrans(getCoordTrans()); clonedLayer.setLegend((IVectorLegend)getLegend().cloneLegend()); clonedLayer.setIsLabeled(isLabeled()); ILabelingStrategy labelingStrategy=getLabelingStrategy(); if (labelingStrategy!=null) clonedLayer.setLabelingStrategy(labelingStrategy); return clonedLayer; } public SelectionSupport getSelectionSupport() { try { return getRecordset().getSelectionSupport(); } catch (ReadDriverException e) { e.printStackTrace(); } return null; } protected boolean isOnePoint(AffineTransform graphicsTransform, ViewPort viewPort, double dpi, CartographicSupport csSym, IGeometry geom, int[] xyCoords) { return isOnePoint(graphicsTransform, viewPort, geom, xyCoords) && csSym.getCartographicSize(viewPort, dpi, (FShape)geom.getInternalShape()) <= 1; } protected boolean isOnePoint(AffineTransform graphicsTransform, ViewPort viewPort, IGeometry geom, int[] xyCoords) { boolean onePoint = false; int type=geom.getGeometryType() % FShape.Z; if (type!=FShape.POINT && type!=FShape.MULTIPOINT && type!=FShape.NULL) { Rectangle2D geomBounds = geom.getBounds2D(); // ICoordTrans ct = getCoordTrans(); // Se supone que la geometria ya esta // repoyectada y no hay que hacer // ninguna transformacion // if (ct!=null) { //// geomBounds = ct.getInverted().convert(geomBounds); // geomBounds = ct.convert(geomBounds); // } double dist1Pixel = viewPort.getDist1pixel(); onePoint = (geomBounds.getWidth() <= dist1Pixel && geomBounds.getHeight() <= dist1Pixel); if (onePoint) { // avoid out of range exceptions FPoint2D p = new FPoint2D(geomBounds.getMinX(), geomBounds.getMinY()); p.transform(viewPort.getAffineTransform()); p.transform(graphicsTransform); xyCoords[0] = (int) p.getX(); xyCoords[1] = (int) p.getY(); } } return onePoint; } /* * jaume. Stuff from ILabeled. */ private boolean isLabeled; private ILabelingStrategy strategy; public boolean isLabeled() { return isLabeled; } public void setIsLabeled(boolean isLabeled) { this.isLabeled = isLabeled; } public ILabelingStrategy getLabelingStrategy() { return strategy; } public void setLabelingStrategy(ILabelingStrategy strategy) { this.strategy = strategy; try { strategy.setLayer(this); } catch (ReadDriverException e) { e.printStackTrace(); } } public void drawLabels(BufferedImage image, Graphics2D g, ViewPort viewPort, Cancellable cancel, double scale, double dpi) throws ReadDriverException { if (strategy!=null && isWithinScale(scale)) { strategy.draw(image, g, viewPort, cancel, dpi); } } public void printLabels(Graphics2D g, ViewPort viewPort, Cancellable cancel, double scale, PrintRequestAttributeSet properties) throws ReadDriverException { if (strategy!=null) { strategy.print(g, viewPort, cancel, properties); } } //Mรฉtodos para el uso de HyperLinks en capas FLyerVect /** * Return true, because a Vectorial Layer supports HyperLink */ public boolean allowLinks() { return true; } /** * Returns an instance of AbstractLinkProperties that contains the information * of the HyperLink * @return Abstra */ public AbstractLinkProperties getLinkProperties() { return linkProperties; } /** * Provides an array with URIs. Returns one URI by geometry that includes the point * in its own geometry limits with a allowed tolerance. * @param layer, the layer * @param point, the point to check that is contained or not in the geometries in the layer * @param tolerance, the tolerance allowed. Allowed margin of error to detect if the point * is contained in some geometries of the layer * @return */ public URI[] getLink(Point2D point, double tolerance) { //return linkProperties.getLink(this) return linkProperties.getLink(this,point,tolerance); } public void selectionChanged(SelectionEvent e) { this.updateDrawVersion(); } public void afterFieldEditEvent(AfterFieldEditEvent e) { this.updateDrawVersion(); } public void afterRowEditEvent(IRow feat, AfterRowEditEvent e) { this.updateDrawVersion(); } public void beforeFieldEditEvent(BeforeFieldEditEvent e) { } public void beforeRowEditEvent(IRow feat, BeforeRowEditEvent e) { } public void processEvent(EditionEvent e) { if (e.getChangeType()== e.ROW_EDITION){ this.updateDrawVersion(); } } public void legendCleared(LegendClearEvent event) { this.updateDrawVersion(); LegendChangedEvent e = LegendChangedEvent.createLegendChangedEvent( legend, legend); this.callLegendChanged(e); } public boolean symbolChanged(SymbolLegendEvent e) { this.updateDrawVersion(); LegendChangedEvent event = LegendChangedEvent.createLegendChangedEvent( legend, legend); this.callLegendChanged(event); return true; } public String getTypeStringVectorLayer() throws ReadDriverException { String typeString=""; int typeShape=this.getShapeType(); if (FShape.MULTI==typeShape){ ReadableVectorial rv=this.getSource(); int i=0; boolean isCorrect=false; while(rv.getShapeCount()>i && !isCorrect){ IGeometry geom=rv.getShape(i); if (geom==null){ i++; continue; } isCorrect=true; if ((geom.getGeometryType() & FShape.Z) == FShape.Z){ typeString="Geometries3D"; }else{ typeString="Geometries2D"; } } }else{ ReadableVectorial rv=this.getSource(); int i=0; boolean isCorrect=false; while(rv.getShapeCount()>i && !isCorrect){ IGeometry geom=rv.getShape(i); if (geom==null){ i++; continue; } isCorrect=true; int type=geom.getGeometryType(); if (FShape.POINT == type){ typeString="Point2D"; } else if (FShape.LINE == type){ typeString="Line2D"; } else if (FShape.POLYGON == type){ typeString="Polygon2D"; } else if (FShape.MULTIPOINT == type){ typeString="MultiPint2D"; } else if ((FShape.POINT | FShape.Z) == type ){ typeString="Point3D"; } else if ((FShape.LINE | FShape.Z) == type ){ typeString="Line3D"; } else if ((FShape.POLYGON | FShape.Z) == type ){ typeString="Polygon3D"; } else if ((FShape.MULTIPOINT | FShape.Z) == type ){ typeString="MultiPoint3D"; } else if ((FShape.POINT | FShape.M) == type ){ typeString="PointM"; } else if ((FShape.LINE | FShape.M) == type ){ typeString="LineM"; } else if ((FShape.POLYGON | FShape.M) == type ){ typeString="PolygonM"; } else if ((FShape.MULTIPOINT | FShape.M) == type ){ typeString="MultiPointM"; } else if ((FShape.MULTI | FShape.M) == type ){ typeString="M"; } } return typeString; } return ""; } public int getTypeIntVectorLayer() throws ReadDriverException { int typeInt=0; int typeShape=this.getShapeType(); if (FShape.MULTI==typeShape){ ReadableVectorial rv=this.getSource(); int i=0; boolean isCorrect=false; while(rv.getShapeCount()>i && !isCorrect){ IGeometry geom=rv.getShape(i); if (geom==null){ i++; continue; } isCorrect=true; if ((geom.getGeometryType() & FShape.Z) == FShape.Z){ typeInt=FShape.MULTI | FShape.Z; }else{ typeInt=FShape.MULTI; } } }else{ ReadableVectorial rv=this.getSource(); int i=0; boolean isCorrect=false; while(rv.getShapeCount()>i && !isCorrect){ IGeometry geom=rv.getShape(i); if (geom==null){ i++; continue; } isCorrect=true; int type=geom.getGeometryType(); typeInt=type; } return typeInt; } return typeInt; } }
iCarto/siga
libFMap/src/com/iver/cit/gvsig/fmap/layers/FLyrVect.java
Java
gpl-3.0
77,323
/* This file is part of the hkl library. * * The hkl library 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. * * The hkl library 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 the hkl library. If not, see <http://www.gnu.org/licenses/>. * * Copyright (C) 2003-2015 Synchrotron SOLEIL * L'Orme des Merisiers Saint-Aubin * BP 48 91192 GIF-sur-YVETTE CEDEX * * Authors: Picca Frรฉdรฉric-Emmanuel <[email protected]> */ #include "hkl.h" #include <tap/basic.h> #include <tap/float.h> #include "hkl-vector-private.h" #include "hkl-matrix-private.h" /* we will check also the private API */ static void init(void) { HklMatrix m; hkl_matrix_init(&m, 1, 1, 0, 0, 1, 0, 0, 0, 1); is_double(1., m.data[0][0], HKL_EPSILON, __func__); is_double(1., m.data[0][1], HKL_EPSILON, __func__); is_double(0., m.data[0][2], HKL_EPSILON, __func__); is_double(0., m.data[1][0], HKL_EPSILON, __func__); is_double(1., m.data[1][1], HKL_EPSILON, __func__); is_double(0., m.data[1][2], HKL_EPSILON, __func__); is_double(0., m.data[2][0], HKL_EPSILON, __func__); is_double(0., m.data[2][1], HKL_EPSILON, __func__); is_double(1., m.data[2][2], HKL_EPSILON, __func__); } static void cmp(void) { HklMatrix m1 = {{{0.0, 1.0, 2.0}, {3.0, 4.0, 5.0}, {6.0, 7.0, 8.0}}}; HklMatrix m2 = {{{1.0, 1.0, 2.0}, {3.0, 4.0, 5.0}, {6.0, 7.0, 8.0}}}; ok(TRUE == hkl_matrix_cmp(&m1, &m1), __func__); ok(FALSE == hkl_matrix_cmp(&m1, &m2), __func__); } static void assignement(void) { HklMatrix m1 = {{{0.0, 1.0, 2.0}, {3.0, 4.0, 5.0}, {6.0, 7.0, 8.0}}}; HklMatrix m; m = m1; ok(TRUE == hkl_matrix_cmp(&m1, &m), __func__); } static void init_from_euler(void) { HklMatrix m_ref = {{{ 1./2., -1./2., sqrt(2)/2.}, { sqrt(2.)/4.+1./2., -sqrt(2.)/4.+1./2., -1./2.}, {-sqrt(2.)/4.+1./2., sqrt(2.)/4.+1./2., 1./2.}}}; HklMatrix m; hkl_matrix_init_from_euler(&m, 45.*HKL_DEGTORAD, 45.*HKL_DEGTORAD, 45.*HKL_DEGTORAD); ok(TRUE == hkl_matrix_cmp(&m_ref, &m), __func__); } static void init_from_two_vector(void) { HklVector v1 = {{0.0, 1.0, 2.0}}; HklVector v2 = {{1.0, 2.0, 3.0}}; HklMatrix m_ref = {{{0.0, 5.0 / sqrt(30.0), -1.0 / sqrt(6.0)}, {1.0 / sqrt(5.0), 2.0 / sqrt(30.0), 2.0 / sqrt(6.0)}, {2.0 / sqrt(5.0),-1.0 / sqrt(30.0), -1.0 / sqrt(6.0)}} }; HklMatrix m; hkl_matrix_init_from_two_vector(&m, &v1, &v2); ok(TRUE == hkl_matrix_cmp(&m_ref, &m), __func__); } static void times_vector(void) { HklMatrix m = {{{ 1.0, 3.0,-2.0}, {10.0, 5.0, 5.0}, {-3.0, 2.0, 0.0}} }; HklVector v = {{1, 2, 3}}; HklVector v_ref = {{1, 35, 1}}; hkl_matrix_times_vector(&m, &v); ok(0 == hkl_vector_cmp(&v_ref, &v), __func__); } static void times_matrix(void) { HklMatrix m_ref = {{{37., 14., 13.}, {45., 65., 5.}, {17., 1., 16.}} }; HklMatrix m = {{{ 1., 3.,-2.}, {10., 5., 5.}, {-3., 2., 0.}} }; hkl_matrix_times_matrix(&m, &m); ok(TRUE == hkl_matrix_cmp(&m_ref, &m), __func__); } static void transpose(void) { HklMatrix m_ref = {{{37., 14., 13.}, {45., 65., 5.}, {17., 1., 16.}} }; HklMatrix m = {{{37., 45., 17.}, {14., 65., 1.}, {13., 5., 16.}} }; hkl_matrix_transpose(&m); ok(TRUE == hkl_matrix_cmp(&m_ref, &m), __func__); } int main(void) { plan(17); init(); cmp(); assignement(); init_from_euler(); init_from_two_vector(); times_vector(); times_matrix(); transpose(); return 0; }
klauer/hkl
tests/hkl-matrix-t.c
C
gpl-3.0
3,973
{{ define "main" }} <main> <h1>{{ .Title }}</h1> {{ if .Content }} <article> {{ .Content }} </article> {{ end }} <hr /> <ul class="font-sans-title"> {{- range .Data.Pages -}} <li>{{ .Date.Format "2006-01-02" }} &mdash; <a href="{{ .URL }}">{{ .Title }}</a></li> {{ end }} </ul> </main> {{ end }}
moe-serifu-circle/website
layouts/_default/list.html
HTML
gpl-3.0
312
@echo off %~d0 cd "%~dp0" call rebuild_orca.bat 105 TreeList105
sebkirche/treelist
PB/rebuild_105.bat
Batchfile
gpl-3.0
66
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-3.0.html import re from PyQt5.QtCore import Qt, pyqtSlot from PyQt5.QtWidgets import ( QPushButton, QLineEdit, QVBoxLayout, QGridLayout, QDialog, QTableView, QAbstractItemView, QSpacerItem, QSizePolicy, QHeaderView, ) from .exclude_list_table import ExcludeListTable from core.exclude import AlreadyThereException from hscommon.trans import trget tr = trget("ui") class ExcludeListDialog(QDialog): def __init__(self, app, parent, model, **kwargs): flags = Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowSystemMenuHint super().__init__(parent, flags, **kwargs) self.app = app self.specific_actions = frozenset() self._setupUI() self.model = model # ExcludeListDialogCore self.model.view = self self.table = ExcludeListTable(app, view=self.tableView) # Qt ExcludeListTable self._row_matched = False # test if at least one row matched our test string self._input_styled = False self.buttonAdd.clicked.connect(self.addStringFromLineEdit) self.buttonRemove.clicked.connect(self.removeSelected) self.buttonRestore.clicked.connect(self.restoreDefaults) self.buttonClose.clicked.connect(self.accept) self.buttonHelp.clicked.connect(self.display_help_message) self.buttonTestString.clicked.connect(self.onTestStringButtonClicked) self.inputLine.textEdited.connect(self.reset_input_style) self.testLine.textEdited.connect(self.reset_input_style) self.testLine.textEdited.connect(self.reset_table_style) def _setupUI(self): layout = QVBoxLayout(self) gridlayout = QGridLayout() self.buttonAdd = QPushButton(tr("Add")) self.buttonRemove = QPushButton(tr("Remove Selected")) self.buttonRestore = QPushButton(tr("Restore defaults")) self.buttonTestString = QPushButton(tr("Test string")) self.buttonClose = QPushButton(tr("Close")) self.buttonHelp = QPushButton(tr("Help")) self.inputLine = QLineEdit() self.testLine = QLineEdit() self.tableView = QTableView() triggers = ( QAbstractItemView.DoubleClicked | QAbstractItemView.EditKeyPressed | QAbstractItemView.SelectedClicked ) self.tableView.setEditTriggers(triggers) self.tableView.setSelectionMode(QTableView.ExtendedSelection) self.tableView.setSelectionBehavior(QTableView.SelectRows) self.tableView.setShowGrid(False) vheader = self.tableView.verticalHeader() vheader.setSectionsMovable(True) vheader.setVisible(False) hheader = self.tableView.horizontalHeader() hheader.setSectionsMovable(False) hheader.setSectionResizeMode(QHeaderView.Fixed) hheader.setStretchLastSection(True) hheader.setHighlightSections(False) hheader.setVisible(True) gridlayout.addWidget(self.inputLine, 0, 0) gridlayout.addWidget(self.buttonAdd, 0, 1, Qt.AlignLeft) gridlayout.addWidget(self.buttonRemove, 1, 1, Qt.AlignLeft) gridlayout.addWidget(self.buttonRestore, 2, 1, Qt.AlignLeft) gridlayout.addWidget(self.buttonHelp, 3, 1, Qt.AlignLeft) gridlayout.addWidget(self.buttonClose, 4, 1) gridlayout.addWidget(self.tableView, 1, 0, 6, 1) gridlayout.addItem(QSpacerItem(0, 0, QSizePolicy.Minimum, QSizePolicy.Expanding), 4, 1) gridlayout.addWidget(self.buttonTestString, 6, 1) gridlayout.addWidget(self.testLine, 6, 0) layout.addLayout(gridlayout) self.inputLine.setPlaceholderText(tr("Type a python regular expression here...")) self.inputLine.setFocus() self.testLine.setPlaceholderText(tr("Type a file system path or filename here...")) self.testLine.setClearButtonEnabled(True) # --- model --> view def show(self): super().show() self.inputLine.setFocus() @pyqtSlot() def addStringFromLineEdit(self): text = self.inputLine.text() if not text: return try: self.model.add(text) except AlreadyThereException: self.app.show_message("Expression already in the list.") return except Exception as e: self.app.show_message(f"Expression is invalid: {e}") return self.inputLine.clear() def removeSelected(self): self.model.remove_selected() def restoreDefaults(self): self.model.restore_defaults() def onTestStringButtonClicked(self): input_text = self.testLine.text() if not input_text: self.reset_input_style() return # If at least one row matched, we know whether table is highlighted or not self._row_matched = self.model.test_string(input_text) self.table.refresh() # Test the string currently in the input text box as well input_regex = self.inputLine.text() if not input_regex: self.reset_input_style() return compiled = None try: compiled = re.compile(input_regex) except re.error: self.reset_input_style() return if self.model.is_match(input_text, compiled): self.inputLine.setStyleSheet("background-color: rgb(10, 200, 10);") self._input_styled = True else: self.reset_input_style() def reset_input_style(self): """Reset regex input line background""" if self._input_styled: self.inputLine.setStyleSheet(self.styleSheet()) self._input_styled = False def reset_table_style(self): if self._row_matched: self._row_matched = False self.model.reset_rows_highlight() self.table.refresh() def display_help_message(self): self.app.show_message( tr( """\ These (case sensitive) python regular expressions will filter out files during scans.<br>\ Directores will also have their <strong>default state</strong> set to Excluded \ in the Directories tab if their name happens to match one of the selected regular expressions.<br>\ For each file collected, two tests are performed to determine whether or not to completely ignore it:<br>\ <li>1. Regular expressions with no path separator in them will be compared to the file name only.</li> <li>2. Regular expressions with at least one path separator in them will be compared to the full path to the file.</li><br> Example: if you want to filter out .PNG files from the "My Pictures" directory only:<br>\ <code>.*My\\sPictures\\\\.*\\.png</code><br><br>\ You can test the regular expression with the "test string" button after pasting a fake path in the test field:<br>\ <code>C:\\\\User\\My Pictures\\test.png</code><br><br> Matching regular expressions will be highlighted.<br>\ If there is at least one highlight, the path or filename tested will be ignored during scans.<br><br>\ Directories and files starting with a period '.' are filtered out by default.<br><br>""" ) )
arsenetar/dupeguru
qt/exclude_list_dialog.py
Python
gpl-3.0
7,359
<meta name="viewport" content="user-scalable=no, width=device-width" /> <body> <h3>276</h3> <p> Until you make up your mind on them, your beliefs that were brought and injected to you by your family, religion or society will keep on changing. Actually this kind of creative adaptiveness will help to keep you away from egoistic worries, and channel your energies in the direction of good. There is a strong possibility you will have artistic and spiritual skills. </p> </body>
burakbayramli/kod
guide/doc/details/lewi/276.html
HTML
gpl-3.0
479
#ifndef PLUGINMANAGER_H #define PLUGINMANAGER_H #include <QDialog> #include <QIcon> #include <QString> #include <QHash> #include <QList> #include <SPlugin> #include "spluginengine.h" #include "perconf.h" namespace Ui { class LoadedPlugins; } class PluginManager : public QObject { Q_OBJECT public: PluginManager( PerConf *conf , const QString & pluginsDirectory , QWidget *parent = 0 ); ~PluginManager(); void refreshUI(); void detect(); void setStyleSheet( const QString & style ); public slots: void show(); void hide(); void pluginStarted( SPlugin *plugin ); void pluginStopped( SPlugin *plugin ); private slots: void currentCellChanged( int row , int col ); void stop_start_CurrentItem(); private: void save(); void loadSaved(); bool defaultActived( const QString & name ) const; private: Ui::LoadedPlugins *ui; QDialog *dialog; QList<SPlugin *> startedPlugins; QHash<QString,SPlugin *> loadedPlugins; QHash<QString,SPluginEngine *> plugins_hash; QString plugin_dir_str; PerConf *prc; QString style_sheet; }; #endif // PLUGINMANAGER_H
realbardia/silicon
Silicon/pluginmanager.h
C
gpl-3.0
1,151
/* * Pixel Dungeon * Copyright (C) 2012-2015 Oleg Dolya * * Shattered Pixel Dungeon * Copyright (C) 2014-2019 Evan Debenham * * 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.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Adrenaline; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; public class AdrenalineDart extends TippedDart { { image = ItemSpriteSheet.ADRENALINE_DART; } @Override public int proc(Char attacker, Char defender, int damage) { Buff.prolong( defender, Adrenaline.class, Adrenaline.DURATION); if (attacker.alignment == defender.alignment){ return 0; } return super.proc(attacker, defender, damage); } }
00-Evan/shattered-pixel-dungeon-gdx
core/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/AdrenalineDart.java
Java
gpl-3.0
1,505
Bitrix 16.5 Business Demo = 16d7a678d19259b91107fcffd1fa68c9
gohdan/DFC
known_files/hashes/bitrix/modules/sender/lang/ru/admin/mailing_edit.php
PHP
gpl-3.0
61
package eu.ehri.project.models.base; import com.tinkerpop.blueprints.Vertex; import com.tinkerpop.frames.modules.javahandler.JavaHandler; import com.tinkerpop.frames.modules.javahandler.JavaHandlerContext; import eu.ehri.project.definitions.Ontology; import eu.ehri.project.models.events.SystemEvent; import eu.ehri.project.models.utils.JavaHandlerUtils; public interface Actioner extends NamedEntity { /** * Fetch a list of Actions for this user in newest-first order. * * @return */ @JavaHandler public Iterable<SystemEvent> getActions(); @JavaHandler public Iterable<SystemEvent> getLatestAction(); /** * Implementation of complex methods. */ abstract class Impl implements JavaHandlerContext<Vertex>, Actioner { public Iterable<SystemEvent> getLatestAction() { return frameVertices(gremlin() .out(Ontology.ACTIONER_HAS_LIFECYCLE_ACTION) .out(Ontology.ENTITY_HAS_EVENT)); } public Iterable<SystemEvent> getActions() { return frameVertices(gremlin().as("n").out(Ontology.ACTIONER_HAS_LIFECYCLE_ACTION) .loop("n", JavaHandlerUtils.noopLoopFunc, JavaHandlerUtils.noopLoopFunc) .out(Ontology.ENTITY_HAS_EVENT)); } } }
lindareijnhoudt/neo4j-ehri-plugin
ehri-frames/src/main/java/eu/ehri/project/models/base/Actioner.java
Java
gpl-3.0
1,321
๏ปฟusing System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using AppointmentsManagement.Classes; namespace AppointmentsManagement.Forms { public partial class wfnSrvcOffrdForm : WeifenLuo.WinFormsUI.Docking.DockContent { #region "GLOBAL VARIABLES..." //Records; cadmaFunctions.NavFuncs myNav = new cadmaFunctions.NavFuncs(); bool beenToCheckBx = false; long rec_cur_indx = 0; bool is_last_rec = false; long totl_rec = 0; long last_rec_num = 0; public string rec_SQL = ""; public string recDt_SQL = ""; bool obey_evnts = false; bool autoLoad = false; public bool txtChngd = false; public string srchWrd = "%"; bool addRec = false; bool editRec = false; bool someLinesFailed = false; bool vwRecs = false; bool addRecs = false; bool editRecs = false; bool delRecs = false; //Line Dtails; long ldt_cur_indx = 0; bool is_last_ldt = false; long totl_ldt = 0; long last_ldt_num = 0; bool obey_ldt_evnts = false; public int curid = -1; public string curCode = ""; #endregion public wfnSrvcOffrdForm() { InitializeComponent(); } private void wfnGLIntfcForm_Load(object sender, EventArgs e) { Color[] clrs = Global.mnFrm.cmCde.getColors(); this.BackColor = clrs[0]; this.tabPage1.BackColor = clrs[0]; this.disableFormButtons(); this.curid = Global.mnFrm.cmCde.getOrgFuncCurID(Global.mnFrm.cmCde.Org_id); this.curCode = Global.mnFrm.cmCde.getPssblValNm(this.curid); this.loadPanel(); } public void disableFormButtons() { bool vwSQL = Global.mnFrm.cmCde.test_prmssns(Global.dfltPrvldgs[5]); bool rcHstry = Global.mnFrm.cmCde.test_prmssns(Global.dfltPrvldgs[6]); this.vwRecs = Global.mnFrm.cmCde.test_prmssns(Global.dfltPrvldgs[4]); this.addRecs = Global.mnFrm.cmCde.test_prmssns(Global.dfltPrvldgs[10]); this.editRecs = Global.mnFrm.cmCde.test_prmssns(Global.dfltPrvldgs[11]); this.delRecs = Global.mnFrm.cmCde.test_prmssns(Global.dfltPrvldgs[12]); this.vwSQLButton.Enabled = vwSQL; this.rcHstryButton.Enabled = rcHstry; this.vwSQLDtButton.Enabled = vwSQL; this.rcHstryDtButton.Enabled = rcHstry; this.saveButton.Enabled = false; this.addButton.Enabled = this.addRecs; this.editButton.Enabled = this.editRecs; this.addDtButton.Enabled = this.editRecs; this.delDtButton.Enabled = this.editRecs; this.delButton.Enabled = this.delRecs; } #region "SERVICE TYPES..." public void loadPanel() { Cursor.Current = Cursors.Default; this.obey_evnts = false; if (this.searchInComboBox.SelectedIndex < 0) { this.searchInComboBox.SelectedIndex = 1; } if (searchForTextBox.Text.Contains("%") == false) { this.searchForTextBox.Text = "%" + this.searchForTextBox.Text.Replace(" ", "%") + "%"; } if (this.searchForTextBox.Text == "%%") { this.searchForTextBox.Text = "%"; } int dsply = 0; if (this.dsplySizeComboBox.Text == "" || int.TryParse(this.dsplySizeComboBox.Text, out dsply) == false) { this.dsplySizeComboBox.Text = Global.mnFrm.cmCde.get_CurPlcy_Mx_Dsply_Recs().ToString(); } this.is_last_rec = false; this.totl_rec = Global.mnFrm.cmCde.Big_Val; this.getPnlData(); this.obey_evnts = true; this.srvcsOffrdListView.Focus(); } private void getPnlData() { this.updtTotals(); this.populateSrvsTypListVw(); this.updtNavLabels(); } private void updtTotals() { Global.mnFrm.cmCde.navFuncts.FindNavigationIndices( long.Parse(this.dsplySizeComboBox.Text), this.totl_rec); if (this.rec_cur_indx >= Global.mnFrm.cmCde.navFuncts.totalGroups) { this.rec_cur_indx = Global.mnFrm.cmCde.navFuncts.totalGroups - 1; } if (this.rec_cur_indx < 0) { this.rec_cur_indx = 0; } Global.mnFrm.cmCde.navFuncts.currentNavigationIndex = this.rec_cur_indx; } private void updtNavLabels() { this.moveFirstButton.Enabled = Global.mnFrm.cmCde.navFuncts.moveFirstBtnStatus(); this.movePreviousButton.Enabled = Global.mnFrm.cmCde.navFuncts.movePrevBtnStatus(); this.moveNextButton.Enabled = Global.mnFrm.cmCde.navFuncts.moveNextBtnStatus(); this.moveLastButton.Enabled = Global.mnFrm.cmCde.navFuncts.moveLastBtnStatus(); this.positionTextBox.Text = Global.mnFrm.cmCde.navFuncts.displayedRecordsNumbers(); if (this.is_last_rec == true || this.totl_rec != Global.mnFrm.cmCde.Big_Val) { this.totalRecsLabel.Text = Global.mnFrm.cmCde.navFuncts.totalRecordsLabel(); } else { this.totalRecsLabel.Text = "of Total"; } } private void populateSrvsTypListVw() { this.obey_evnts = false; DataSet dtst = Global.get_SrvcTyps(this.searchForTextBox.Text, this.searchInComboBox.Text, this.rec_cur_indx, int.Parse(this.dsplySizeComboBox.Text), Global.mnFrm.cmCde.Org_id); this.srvcsOffrdListView.Items.Clear(); this.clearDtInfo(); this.loadDtPanel(); if (!this.editRec) { this.disableDtEdit(); } //System.Windows.Forms.Application.DoEvents(); for (int i = 0; i < dtst.Tables[0].Rows.Count; i++) { this.last_rec_num = Global.mnFrm.cmCde.navFuncts.startIndex() + i; ListViewItem nwItem = new ListViewItem(new string[] { (Global.mnFrm.cmCde.navFuncts.startIndex() + i).ToString(), dtst.Tables[0].Rows[i][1].ToString(), dtst.Tables[0].Rows[i][0].ToString()}); this.srvcsOffrdListView.Items.Add(nwItem); } this.correctNavLbls(dtst); if (this.srvcsOffrdListView.Items.Count > 0) { this.obey_evnts = true; this.srvcsOffrdListView.Items[0].Selected = true; } else { } this.obey_evnts = true; } private void populateDt(int HdrID) { //Global.mnFrm.cmCde.minimizeMemory(); this.clearDtInfo(); //System.Windows.Forms.Application.DoEvents(); if (this.editRec == false) { this.disableDtEdit(); } this.obey_evnts = false; DataSet dtst = Global.get_One_ServTypeDt(HdrID); for (int i = 0; i < dtst.Tables[0].Rows.Count; i++) { this.serviceTypeIDTextBox.Text = dtst.Tables[0].Rows[i][0].ToString(); this.serviceNameTextBox.Text = dtst.Tables[0].Rows[i][1].ToString(); this.servTypeDescTextBox.Text = dtst.Tables[0].Rows[i][2].ToString(); this.salesItemIDTextBox.Text = dtst.Tables[0].Rows[i][4].ToString(); this.salesItemTextBox.Text = Global.get_InvItemNm( int.Parse(dtst.Tables[0].Rows[i][4].ToString())); this.priceCurLabel.Text = this.curCode; this.priceLabel.Text = Global.get_InvItemPrice(int.Parse(dtst.Tables[0].Rows[i][4].ToString())).ToString("#,##0.00"); string orgnlItm = dtst.Tables[0].Rows[i][5].ToString(); this.srvcTypeComboBox.Items.Clear(); this.srvcTypeComboBox.Items.Add(orgnlItm); if (this.editRec == false) { } this.srvcTypeComboBox.SelectedItem = orgnlItm; this.isEnabledCheckBox.Checked = Global.mnFrm.cmCde.cnvrtBitStrToBool(dtst.Tables[0].Rows[i][3].ToString()); } this.loadDtPanel(); this.obey_evnts = true; } private void correctNavLbls(DataSet dtst) { long totlRecs = dtst.Tables[0].Rows.Count; if (this.rec_cur_indx == 0 && totlRecs == 0) { this.is_last_rec = true; this.totl_rec = 0; this.last_rec_num = 0; this.rec_cur_indx = 0; this.updtTotals(); this.updtNavLabels(); } else if (this.totl_rec == Global.mnFrm.cmCde.Big_Val && totlRecs < long.Parse(this.dsplySizeComboBox.Text)) { this.totl_rec = this.last_rec_num; if (totlRecs == 0) { this.rec_cur_indx -= 1; this.updtTotals(); this.populateSrvsTypListVw(); } else { this.updtTotals(); } } } private bool shdObeyEvts() { return this.obey_evnts; } private void PnlNavButtons(object sender, System.EventArgs e) { System.Windows.Forms.ToolStripButton sentObj = (System.Windows.Forms.ToolStripButton)sender; this.totalRecsLabel.Text = ""; if (sentObj.Name.ToLower().Contains("first")) { this.is_last_rec = false; this.rec_cur_indx = 0; } else if (sentObj.Name.ToLower().Contains("previous")) { this.is_last_rec = false; this.rec_cur_indx -= 1; } else if (sentObj.Name.ToLower().Contains("next")) { this.is_last_rec = false; this.rec_cur_indx += 1; } else if (sentObj.Name.ToLower().Contains("last")) { this.is_last_rec = true; this.totl_rec = Global.get_Ttl_SrvsTyps(this.searchForTextBox.Text, this.searchInComboBox.Text, Global.mnFrm.cmCde.Org_id); this.updtTotals(); this.rec_cur_indx = Global.mnFrm.cmCde.navFuncts.totalGroups - 1; } this.getPnlData(); } private void clearDtInfo() { this.obey_evnts = false; // this.serviceTypeIDTextBox.Text = "-1"; this.serviceNameTextBox.Text = ""; this.servTypeDescTextBox.Text = ""; this.isEnabledCheckBox.Checked = false; this.salesItemIDTextBox.Text = "-1"; this.salesItemTextBox.Text = ""; this.priceLabel.Text = "0.00"; this.priceCurLabel.Text = this.curCode; if (this.editRec == false) { this.srvcTypeComboBox.Items.Clear(); } this.obey_evnts = true; } private void prpareForDtEdit() { this.obey_evnts = false; this.saveButton.Enabled = true; this.serviceNameTextBox.ReadOnly = false; this.serviceNameTextBox.BackColor = Color.FromArgb(255, 255, 128); this.servTypeDescTextBox.ReadOnly = false; this.servTypeDescTextBox.BackColor = Color.White; this.salesItemTextBox.ReadOnly = false; this.salesItemTextBox.BackColor = Color.White;// FromArgb(255, 255, 128); string brgtSQL = ""; bool isDynmc = false; DataSet dtst = Global.mnFrm.cmCde.getLovValues("%", "Both", 0, 5000, ref brgtSQL, Global.mnFrm.cmCde.getLovID("System Codes for Appointment Services"), ref isDynmc, -1, "", "", ""); object orgnlItm = null; if (this.srvcTypeComboBox.SelectedIndex >= 0) { orgnlItm = this.srvcTypeComboBox.SelectedItem; } if (this.addRec) { this.srvcTypeComboBox.Items.Clear(); for (int i = 0; i < dtst.Tables[0].Rows.Count; i++) { this.srvcTypeComboBox.Items.Add(dtst.Tables[0].Rows[i][0].ToString()); } } if (orgnlItm != null) { this.srvcTypeComboBox.SelectedItem = orgnlItm; } this.srvcTypeComboBox.BackColor = Color.FromArgb(255, 255, 128); this.obey_evnts = true; } private void disableDtEdit() { if (this.editButton.Text == "STOP") { EventArgs e = new EventArgs(); this.editButton_Click(this.editButton, e); } this.addRec = false; this.editRec = false; this.saveButton.Enabled = false; this.editButton.Enabled = this.editRecs; this.addButton.Enabled = this.addRecs; this.serviceNameTextBox.ReadOnly = true; this.serviceNameTextBox.BackColor = Color.WhiteSmoke; this.servTypeDescTextBox.ReadOnly = true; this.servTypeDescTextBox.BackColor = Color.WhiteSmoke; this.salesItemTextBox.ReadOnly = true; this.salesItemTextBox.BackColor = Color.WhiteSmoke; if (this.srvcTypeComboBox.SelectedIndex >= 0) { object orgnlItm = this.srvcTypeComboBox.SelectedItem; this.srvcTypeComboBox.Items.Clear(); this.srvcTypeComboBox.Items.Add(orgnlItm); this.srvcTypeComboBox.SelectedItem = orgnlItm; } else { this.srvcTypeComboBox.Items.Clear(); } this.srvcTypeComboBox.BackColor = Color.WhiteSmoke; } private void searchForTextBox_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { EventArgs ex = new EventArgs(); if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Return) { this.goButton.PerformClick(); } } private void positionTextBox_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { EventArgs ex = new EventArgs(); if (e.KeyCode == Keys.Left || e.KeyCode == Keys.Up) { this.PnlNavButtons(this.movePreviousButton, ex); } else if (e.KeyCode == Keys.Right || e.KeyCode == Keys.Down) { this.PnlNavButtons(this.moveNextButton, ex); } } private void goButton_Click(object sender, EventArgs e) { this.loadPanel(); } #endregion private void srvcsOffrdListView_SelectedIndexChanged(object sender, EventArgs e) { if (this.obey_evnts == false || this.srvcsOffrdListView.SelectedItems.Count > 1) { return; } //this.populateDt(-100000); if (this.srvcsOffrdListView.SelectedItems.Count == 1) { this.populateDt(int.Parse(this.srvcsOffrdListView.SelectedItems[0].SubItems[2].Text)); } else if (this.addRec == false) { this.clearDtInfo(); this.disableDtEdit(); this.disableLnsEdit(); this.dataDefDataGridView.Rows.Clear(); } } private void loadDtPanel() { this.changeGridVw(); this.obey_ldt_evnts = false; if (this.searchInDtComboBox.SelectedIndex < 0) { this.searchInDtComboBox.SelectedIndex = 2; } if (this.searchForDtTextBox.Text.Contains("%") == false) { this.searchForDtTextBox.Text = "%" + this.searchForDtTextBox.Text.Replace(" ", "%") + "%"; } if (this.searchForDtTextBox.Text == "%%") { this.searchForDtTextBox.Text = "%"; } int dsply = 0; if (this.dsplySizeDtComboBox.Text == "" || int.TryParse(this.dsplySizeDtComboBox.Text, out dsply) == false) { this.dsplySizeDtComboBox.Text = Global.mnFrm.cmCde.get_CurPlcy_Mx_Dsply_Recs().ToString(); } //this.groupBox8.Height = this.g.Bottom - this.toolStrip4.Bottom - 50; this.ldt_cur_indx = 0; this.is_last_ldt = false; this.last_ldt_num = 0; this.totl_ldt = Global.mnFrm.cmCde.Big_Val; this.getldtPnlData(); //this.dataDefDataGridView.Focus(); this.obey_ldt_evnts = true; //SendKeys.Send("{TAB}"); //System.Windows.Forms.Application.DoEvents(); //SendKeys.Send("{HOME}"); //System.Windows.Forms.Application.DoEvents(); } private void getldtPnlData() { this.updtldtTotals(); this.populateDtLines(int.Parse(this.serviceTypeIDTextBox.Text)); this.updtldtNavLabels(); } private void updtldtTotals() { int dsply = 0; if (this.dsplySizeDtComboBox.Text == "" || int.TryParse(this.dsplySizeDtComboBox.Text, out dsply) == false) { this.dsplySizeDtComboBox.Text = Global.mnFrm.cmCde.get_CurPlcy_Mx_Dsply_Recs().ToString(); } this.myNav.FindNavigationIndices( long.Parse(this.dsplySizeDtComboBox.Text), this.totl_ldt); if (this.ldt_cur_indx >= this.myNav.totalGroups) { this.ldt_cur_indx = this.myNav.totalGroups - 1; } if (this.ldt_cur_indx < 0) { this.ldt_cur_indx = 0; } this.myNav.currentNavigationIndex = this.ldt_cur_indx; } private void updtldtNavLabels() { this.moveFirstDtButton.Enabled = this.myNav.moveFirstBtnStatus(); this.movePreviousDtButton.Enabled = this.myNav.movePrevBtnStatus(); this.moveNextDtButton.Enabled = this.myNav.moveNextBtnStatus(); this.moveLastDtButton.Enabled = this.myNav.moveLastBtnStatus(); this.positionDtTextBox.Text = this.myNav.displayedRecordsNumbers(); if (this.is_last_ldt == true || this.totl_ldt != Global.mnFrm.cmCde.Big_Val) { this.totalRecsDtLabel.Text = this.myNav.totalRecordsLabel(); } else { this.totalRecsDtLabel.Text = "of Total"; } } private void populateDtLines(int HdrID) { this.dataDefDataGridView.Rows.Clear(); if (HdrID > 0 && this.addRec == false && this.editRec == false) { this.disableLnsEdit(); } this.obey_ldt_evnts = false; //System.Windows.Forms.Application.DoEvents(); DataSet dtst = Global.get_datadfntns(HdrID, this.searchForDtTextBox.Text, this.searchInDtComboBox.Text, this.ldt_cur_indx, int.Parse(this.dsplySizeDtComboBox.Text)); int rwcnt = dtst.Tables[0].Rows.Count; for (int i = 0; i < rwcnt; i++) { this.last_ldt_num = this.myNav.startIndex() + i; //System.Windows.Forms.Application.DoEvents(); this.dataDefDataGridView.RowCount += 1;//, this.apprvlStatusTextBox.Text.Insert(this.rgstrDtDataGridView.RowCount - 1, 1); int rowIdx = this.dataDefDataGridView.RowCount - 1; this.dataDefDataGridView.Rows[rowIdx].HeaderCell.Value = (i + 1).ToString(); //Object[] cellDesc = new Object[27]; this.dataDefDataGridView.Rows[rowIdx].Cells[0].Value = dtst.Tables[0].Rows[i][2].ToString(); this.dataDefDataGridView.Rows[rowIdx].Cells[1].Value = "..."; this.dataDefDataGridView.Rows[rowIdx].Cells[2].Value = dtst.Tables[0].Rows[i][3].ToString(); this.dataDefDataGridView.Rows[rowIdx].Cells[3].Value = dtst.Tables[0].Rows[i][4].ToString(); this.dataDefDataGridView.Rows[rowIdx].Cells[4].Value = dtst.Tables[0].Rows[i][5].ToString(); this.dataDefDataGridView.Rows[rowIdx].Cells[5].Value = "..."; this.dataDefDataGridView.Rows[rowIdx].Cells[6].Value = dtst.Tables[0].Rows[i][6].ToString(); this.dataDefDataGridView.Rows[rowIdx].Cells[7].Value = "..."; this.dataDefDataGridView.Rows[rowIdx].Cells[8].Value = Global.mnFrm.cmCde.cnvrtBitStrToBool(dtst.Tables[0].Rows[i][7].ToString()); this.dataDefDataGridView.Rows[rowIdx].Cells[9].Value = dtst.Tables[0].Rows[i][0].ToString(); } this.correctldtNavLbls(dtst); this.obey_ldt_evnts = true; System.Windows.Forms.Application.DoEvents(); } private void correctldtNavLbls(DataSet dtst) { long totlRecs = dtst.Tables[0].Rows.Count; if (this.totl_ldt == Global.mnFrm.cmCde.Big_Val && totlRecs < long.Parse(this.dsplySizeDtComboBox.Text)) { this.totl_ldt = this.last_ldt_num; if (totlRecs == 0) { this.ldt_cur_indx -= 1; this.updtldtTotals(); this.populateDtLines(int.Parse(this.serviceTypeIDTextBox.Text)); } else { this.updtldtTotals(); } } } private bool shdObeyldtEvts() { return this.obey_ldt_evnts; } private void DtPnlNavButtons(object sender, System.EventArgs e) { System.Windows.Forms.ToolStripButton sentObj = (System.Windows.Forms.ToolStripButton)sender; this.totalRecsDtLabel.Text = ""; if (sentObj.Name.ToLower().Contains("first")) { this.is_last_ldt = false; this.ldt_cur_indx = 0; } else if (sentObj.Name.ToLower().Contains("previous")) { this.is_last_ldt = false; this.ldt_cur_indx -= 1; } else if (sentObj.Name.ToLower().Contains("next")) { this.is_last_ldt = false; this.ldt_cur_indx += 1; } else if (sentObj.Name.ToLower().Contains("last")) { this.is_last_ldt = true; this.totl_ldt = Global.get_ttl_datadfntns(int.Parse(this.serviceTypeIDTextBox.Text), this.searchForDtTextBox.Text, this.searchInDtComboBox.Text); this.updtldtTotals(); this.ldt_cur_indx = this.myNav.totalGroups - 1; } this.getldtPnlData(); } private void prpareForLnsEdit() { this.saveButton.Enabled = true; this.dataDefDataGridView.ReadOnly = false; this.dataDefDataGridView.Columns[0].ReadOnly = false; this.dataDefDataGridView.Columns[0].DefaultCellStyle.BackColor = Color.FromArgb(255, 255, 128); this.dataDefDataGridView.Columns[2].ReadOnly = false; this.dataDefDataGridView.Columns[2].DefaultCellStyle.BackColor = Color.FromArgb(255, 255, 128); this.dataDefDataGridView.Columns[3].ReadOnly = false; this.dataDefDataGridView.Columns[3].DefaultCellStyle.BackColor = Color.FromArgb(255, 255, 128); this.dataDefDataGridView.Columns[4].ReadOnly = false; this.dataDefDataGridView.Columns[4].DefaultCellStyle.BackColor = Color.White; this.dataDefDataGridView.Columns[6].ReadOnly = false; this.dataDefDataGridView.Columns[6].DefaultCellStyle.BackColor = Color.White; this.dataDefDataGridView.Columns[8].ReadOnly = false; this.dataDefDataGridView.Columns[8].DefaultCellStyle.BackColor = Color.White; this.dataDefDataGridView.Columns[9].ReadOnly = true; this.dataDefDataGridView.Columns[9].DefaultCellStyle.BackColor = Color.Gainsboro; } private void disableLnsEdit() { this.addRec = false; this.editRec = false; this.saveButton.Enabled = false; this.dataDefDataGridView.ReadOnly = true; this.dataDefDataGridView.Columns[0].ReadOnly = true; this.dataDefDataGridView.Columns[0].DefaultCellStyle.BackColor = Color.Gainsboro; this.dataDefDataGridView.Columns[2].ReadOnly = true; this.dataDefDataGridView.Columns[2].DefaultCellStyle.BackColor = Color.Gainsboro; this.dataDefDataGridView.Columns[3].ReadOnly = true; this.dataDefDataGridView.Columns[3].DefaultCellStyle.BackColor = Color.Gainsboro; this.dataDefDataGridView.Columns[4].ReadOnly = true; this.dataDefDataGridView.Columns[4].DefaultCellStyle.BackColor = Color.Gainsboro; this.dataDefDataGridView.Columns[6].ReadOnly = true; this.dataDefDataGridView.Columns[6].DefaultCellStyle.BackColor = Color.Gainsboro; this.dataDefDataGridView.Columns[8].ReadOnly = true; this.dataDefDataGridView.Columns[8].DefaultCellStyle.BackColor = Color.Gainsboro; this.dataDefDataGridView.Columns[9].ReadOnly = true; this.dataDefDataGridView.Columns[9].DefaultCellStyle.BackColor = Color.Gainsboro; System.Windows.Forms.Application.DoEvents(); } private void vwSQLDtButton_Click(object sender, EventArgs e) { Global.mnFrm.cmCde.showSQL(this.recDt_SQL, 5); } private void rcHstryDtButton_Click(object sender, EventArgs e) { if (this.dataDefDataGridView.CurrentCell != null && this.dataDefDataGridView.SelectedRows.Count <= 0) { this.dataDefDataGridView.Rows[this.dataDefDataGridView.CurrentCell.RowIndex].Selected = true; } if (this.dataDefDataGridView.SelectedRows.Count <= 0) { Global.mnFrm.cmCde.showMsg("Please select a Record First!", 0); return; } Global.mnFrm.cmCde.showRecHstry( Global.get_DT_Rec_Hstry(int.Parse(this.dataDefDataGridView.SelectedRows[0].Cells[9].Value.ToString())), 6); } private void vwSQLButton_Click(object sender, EventArgs e) { Global.mnFrm.cmCde.showSQL(this.rec_SQL, 5); } private void rcHstryButton_Click(object sender, EventArgs e) { if (this.serviceTypeIDTextBox.Text == "-1" || this.serviceTypeIDTextBox.Text == "") { Global.mnFrm.cmCde.showMsg("Please select a Record First!", 0); return; } Global.mnFrm.cmCde.showRecHstry( Global.get_Rec_Hstry(int.Parse(this.serviceTypeIDTextBox.Text)), 6); } private void positionDtTextBox_KeyDown(object sender, KeyEventArgs e) { EventArgs ex = new EventArgs(); if (e.KeyCode == Keys.Left || e.KeyCode == Keys.Up) { this.DtPnlNavButtons(this.movePreviousDtButton, ex); } else if (e.KeyCode == Keys.Right || e.KeyCode == Keys.Down) { this.DtPnlNavButtons(this.moveNextDtButton, ex); } } private void dsplySizeDtComboBox_KeyDown(object sender, KeyEventArgs e) { EventArgs ex = new EventArgs(); if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Return) { this.loadDtPanel(); } } private void resetButton_Click(object sender, EventArgs e) { Global.mnFrm.cmCde.minimizeMemory(); this.searchInComboBox.SelectedIndex = 1; this.searchForTextBox.Text = "%"; this.searchInDtComboBox.SelectedIndex = 2; this.searchForDtTextBox.Text = "%"; this.dsplySizeComboBox.Text = Global.mnFrm.cmCde.get_CurPlcy_Mx_Dsply_Recs().ToString(); this.dsplySizeDtComboBox.Text = Global.mnFrm.cmCde.get_CurPlcy_Mx_Dsply_Recs().ToString(); this.rec_cur_indx = 0; this.ldt_cur_indx = 0; this.loadPanel(); } private void addButton_Click(object sender, EventArgs e) { if (Global.mnFrm.cmCde.test_prmssns(Global.dfltPrvldgs[10]) == false) { Global.mnFrm.cmCde.showMsg("You don't have permission to perform" + " this action!\nContact your System Administrator!", 0); return; } if (this.editButton.Text == "STOP") { this.editButton.PerformClick(); } //this.editGBVButton.Enabled = false; this.clearDtInfo(); this.dataDefDataGridView.Rows.Clear(); this.addRec = true; this.editRec = false; this.prpareForDtEdit(); ToolStripButton mybtn = (ToolStripButton)sender; this.changeGridVw(); this.prpareForLnsEdit(); this.serviceNameTextBox.Focus(); this.editButton.Enabled = false; this.addButton.Enabled = false; this.addDtButton.PerformClick(); //this.addPriceButton.PerformClick(); } private void editButton_Click(object sender, EventArgs e) { if (this.editButton.Text == "EDIT") { if (Global.mnFrm.cmCde.test_prmssns(Global.dfltPrvldgs[8]) == false) { Global.mnFrm.cmCde.showMsg("You don't have permission to perform" + " this action!\nContact your System Administrator!", 0); return; } if (this.serviceTypeIDTextBox.Text == "" || this.serviceTypeIDTextBox.Text == "-1") { Global.mnFrm.cmCde.showMsg("No record to Edit!", 0); return; } this.addRec = false; this.editRec = true; this.prpareForDtEdit(); this.prpareForLnsEdit(); //this.addGBVButton.Enabled = false; this.editButton.Text = "STOP"; this.serviceNameTextBox.Focus(); //this.editMenuItem.Text = "STOP EDITING"; } else { this.saveButton.Enabled = false; this.addRec = false; this.editRec = false; this.addButton.Enabled = this.addRecs; this.editButton.Enabled = this.editRecs; this.addDtButton.Enabled = this.editRecs; this.delDtButton.Enabled = this.editRecs; this.editButton.Text = "EDIT"; //this.editMenuItem.Text = "Edit Item"; this.disableDtEdit(); this.disableLnsEdit(); System.Windows.Forms.Application.DoEvents(); //this.loadPanel(); } System.Windows.Forms.Application.DoEvents(); } private void delButton_Click(object sender, EventArgs e) { if (Global.mnFrm.cmCde.test_prmssns(Global.dfltPrvldgs[9]) == false) { Global.mnFrm.cmCde.showMsg("You don't have permission to perform" + " this action!\nContact your System Administrator!", 0); return; } if (this.serviceTypeIDTextBox.Text == "" || this.serviceTypeIDTextBox.Text == "-1") { Global.mnFrm.cmCde.showMsg("Please select the Record to DELETE!", 0); return; } if (Global.isSrvsTypInUse(int.Parse(this.serviceTypeIDTextBox.Text)) == true) { Global.mnFrm.cmCde.showMsg("This Service Type is in Use!", 0); return; } if (Global.mnFrm.cmCde.showMsg("Are you sure you want to DELETE the selected Record?" + "\r\nThis action cannot be undone!", 1) == DialogResult.No) { //Global.mnFrm.cmCde.showMsg("Operation Cancelled!", 4); return; } Global.deleteSrvsTyp(int.Parse(this.serviceTypeIDTextBox.Text), this.serviceNameTextBox.Text); this.loadPanel(); } private void delDtButton_Click(object sender, EventArgs e) { if (this.addRec == false && this.editRec == false) { Global.mnFrm.cmCde.showMsg("Must be in ADD/EDIT mode First!", 0); return; } if (this.dataDefDataGridView.CurrentCell != null && this.dataDefDataGridView.SelectedRows.Count <= 0) { this.dataDefDataGridView.Rows[this.dataDefDataGridView.CurrentCell.RowIndex].Selected = true; } if (this.dataDefDataGridView.SelectedRows.Count <= 0) { Global.mnFrm.cmCde.showMsg("Please select the Record(s) to Delete!", 0); return; } if (Global.mnFrm.cmCde.showMsg("Are you sure you want to DELETE the selected Line?" + "\r\nThis action cannot be undone!", 1) == DialogResult.No) { //Global.mnFrm.cmCde.showMsg("Operation Cancelled!", 4); return; } int cnt = this.dataDefDataGridView.SelectedRows.Count; for (int i = 0; i < cnt; i++) { if (this.dataDefDataGridView.SelectedRows[0].Cells[2].Value == null) { this.dataDefDataGridView.SelectedRows[0].Cells[2].Value = string.Empty; } long lnID = -1; long.TryParse(this.dataDefDataGridView.SelectedRows[0].Cells[9].Value.ToString(), out lnID); if (lnID > 0) { if (Global.isSrvcDataCaptureInUse(lnID)) { Global.mnFrm.cmCde.showMsg("The Record at Row(" + (i + 1) + ") has been Used hence cannot be Deleted!", 0); continue; } Global.deleteSrvsTypLn(lnID, this.dataDefDataGridView.SelectedRows[0].Cells[2].Value.ToString()); } this.dataDefDataGridView.Rows.RemoveAt(this.dataDefDataGridView.SelectedRows[0].Index); } //this.loadDtPanel(); } private void salesItemTextBox_TextChanged(object sender, EventArgs e) { if (!this.obey_evnts) { return; } this.txtChngd = true; } private void salesItemTextBox_Leave(object sender, EventArgs e) { if (this.txtChngd == false) { return; } this.txtChngd = false; TextBox mytxt = (TextBox)sender; this.obey_evnts = false; this.srchWrd = mytxt.Text; if (!mytxt.Text.Contains("%")) { this.srchWrd = "%" + this.srchWrd.Replace(" ", "%") + "%"; } if (mytxt.Name == "salesItemTextBox") { this.salesItemTextBox.Text = ""; this.salesItemIDTextBox.Text = "-1"; this.salesItemButton_Click(this.salesItemButton, e); } this.srchWrd = "%"; this.obey_evnts = true; this.txtChngd = false; } private void salesItemButton_Click(object sender, EventArgs e) { if (this.addRec == false && this.editRec == false) { Global.mnFrm.cmCde.showMsg("Must be in ADD/EDIT mode First!", 0); return; } string[] selVals = new string[1]; selVals[0] = this.salesItemIDTextBox.Text; DialogResult dgRes = Global.mnFrm.cmCde.showPssblValDiag( Global.mnFrm.cmCde.getLovID("Inventory Items"), ref selVals, true, false, Global.mnFrm.cmCde.Org_id, this.srchWrd, "Both", true); if (dgRes == DialogResult.OK) { for (int i = 0; i < selVals.Length; i++) { this.salesItemIDTextBox.Text = selVals[i]; this.salesItemTextBox.Text = Global.get_InvItemNm (int.Parse(selVals[i])); this.priceLabel.Text = Global.get_InvItemPrice(int.Parse(selVals[i])).ToString("#,##0.00"); } } } private void saveButton_Click(object sender, EventArgs e) { if (this.addRec == true) { if (Global.mnFrm.cmCde.test_prmssns(Global.dfltPrvldgs[10]) == false) { Global.mnFrm.cmCde.showMsg("You don't have permission to perform" + " this action!\nContact your System Administrator!", 0); return; } } else { if (Global.mnFrm.cmCde.test_prmssns(Global.dfltPrvldgs[11]) == false) { Global.mnFrm.cmCde.showMsg("You don't have permission to perform" + " this action!\nContact your System Administrator!", 0); return; } } if (this.serviceNameTextBox.Text == "") { Global.mnFrm.cmCde.showMsg("Please enter a Service Name!", 0); return; } long oldRecID = Global.getSrvsTypID(this.serviceNameTextBox.Text, Global.mnFrm.cmCde.Org_id); if (oldRecID > 0 && this.addRec == true) { Global.mnFrm.cmCde.showMsg("Service Name is already in use in this Organisation!", 0); return; } if (oldRecID > 0 && this.editRec == true && oldRecID.ToString() != this.serviceTypeIDTextBox.Text) { Global.mnFrm.cmCde.showMsg("New Service Name is already in use in this Organisation!", 0); return; } if (this.srvcTypeComboBox.Text == "") { Global.mnFrm.cmCde.showMsg("Type of Service cannot be empty!", 0); return; } if (this.addRec == true) { Global.createSrvsTyp(this.serviceNameTextBox.Text, this.servTypeDescTextBox.Text, int.Parse(this.salesItemIDTextBox.Text), this.isEnabledCheckBox.Checked, this.srvcTypeComboBox.Text, Global.mnFrm.cmCde.Org_id); //this.saveGBVButton.Enabled = false; //this.addgbv = false; //this.editgbv = true; this.editButton.Enabled = this.editRecs; this.addButton.Enabled = this.addRecs; //Global.mnFrm.cmCde.showMsg("Record Saved!", 3); System.Windows.Forms.Application.DoEvents(); this.serviceTypeIDTextBox.Text = Global.getSrvsTypID(this.serviceNameTextBox.Text, Global.mnFrm.cmCde.Org_id).ToString(); this.someLinesFailed = false; this.saveGridView(int.Parse(this.serviceTypeIDTextBox.Text)); if (this.someLinesFailed == false) { this.loadPanel(); } else { this.editRec = true; this.addRec = false; this.saveButton.Enabled = true; } this.someLinesFailed = false; } else if (this.editRec == true) { Global.updateSrvsTyp(int.Parse(this.serviceTypeIDTextBox.Text), this.serviceNameTextBox.Text, this.servTypeDescTextBox.Text, int.Parse(this.salesItemIDTextBox.Text), this.isEnabledCheckBox.Checked, this.srvcTypeComboBox.Text); this.someLinesFailed = false; this.saveGridView(int.Parse(this.serviceTypeIDTextBox.Text)); if (this.someLinesFailed == false) { //this.loadPanel(); if (this.srvcsOffrdListView.SelectedItems.Count > 0) { this.srvcsOffrdListView.SelectedItems[0].SubItems[1].Text = this.serviceNameTextBox.Text; } } else { this.editRec = true; this.saveButton.Enabled = true; } this.someLinesFailed = false; // Global.mnFrm.cmCde.showMsg("Record Saved!", 3); } } private bool checkDtRqrmnts(int rwIdx) { this.dfltFill(rwIdx); if (this.dataDefDataGridView.Rows[rwIdx].Cells[0].Value.ToString() == "") { return false; } int dataDefID = int.Parse(this.dataDefDataGridView.Rows[rwIdx].Cells[9].Value.ToString()); string dataCtgry = this.dataDefDataGridView.Rows[rwIdx].Cells[0].Value.ToString(); string dataLabel = this.dataDefDataGridView.Rows[rwIdx].Cells[2].Value.ToString(); if (dataCtgry == "") { Global.mnFrm.cmCde.showMsg("Data Category cannot be Empty!", 0); return false; } if (dataLabel == "") { Global.mnFrm.cmCde.showMsg("Data Label cannot be Empty!", 0); return false; } long oldDataDefID = Global.getSrvcsDataDefID(dataLabel, dataCtgry, int.Parse(this.serviceTypeIDTextBox.Text)); if (oldDataDefID > 0 && dataDefID <= 0) { Global.mnFrm.cmCde.showMsg("Data Definition Category & Label Combination is already Defined in this Service!", 0); return false; } if (oldDataDefID > 0 && dataDefID > 0 && oldDataDefID != dataDefID) { Global.mnFrm.cmCde.showMsg("New Data Definition Category & Label Combination is already Defined in this Service!", 0); return false; } if (this.dataDefDataGridView.Rows[rwIdx].Cells[3].Value.ToString() == "") { Global.mnFrm.cmCde.showMsg("Data Label cannot be Empty!", 0); return false; } return true; } private void saveGridView(int srvcTypHdrID) { int svd = 0; if (this.dataDefDataGridView.Rows.Count > 0) { this.dataDefDataGridView.EndEdit(); //this.itemsDataGridView.Rows[0].Cells[1].Selected = true; System.Windows.Forms.Application.DoEvents(); } for (int i = 0; i < this.dataDefDataGridView.Rows.Count; i++) { if (!this.checkDtRqrmnts(i)) { this.dataDefDataGridView.Rows[i].DefaultCellStyle.BackColor = Color.FromArgb(255, 100, 100); this.someLinesFailed = true; continue; } else { //Check if Doc Ln Rec Exists //Create if not else update int hdrID = int.Parse(this.serviceTypeIDTextBox.Text); long dataDefID = int.Parse(this.dataDefDataGridView.Rows[i].Cells[9].Value.ToString()); string dataCtgry = this.dataDefDataGridView.Rows[i].Cells[0].Value.ToString(); string dataLabel = this.dataDefDataGridView.Rows[i].Cells[2].Value.ToString(); string dataType = this.dataDefDataGridView.Rows[i].Cells[3].Value.ToString(); string dataValLov = this.dataDefDataGridView.Rows[i].Cells[4].Value.ToString(); string dataValLovDesc = this.dataDefDataGridView.Rows[i].Cells[6].Value.ToString(); bool enbld = (bool)this.dataDefDataGridView.Rows[i].Cells[8].Value; if (dataDefID <= 0) { dataDefID = Global.getNewDataDefID(); Global.createDataDefntn(hdrID, dataCtgry, dataLabel, enbld, dataType, dataValLov, dataValLovDesc); this.dataDefDataGridView.Rows[i].Cells[9].Value = dataDefID; } else { Global.updateDataDefntn(dataDefID, dataCtgry, dataLabel, enbld, dataType, dataValLov, dataValLovDesc); } svd++; this.dataDefDataGridView.Rows[i].DefaultCellStyle.BackColor = Color.Lime; } } this.dataDefDataGridView.EndEdit(); Global.mnFrm.cmCde.showMsg(svd + " Line(s) Saved Successfully!", 3); } private void dfltFill(int rwIdx) { if (this.dataDefDataGridView.Rows[rwIdx].Cells[0].Value == null) { this.dataDefDataGridView.Rows[rwIdx].Cells[0].Value = string.Empty; } if (this.dataDefDataGridView.Rows[rwIdx].Cells[2].Value == null) { this.dataDefDataGridView.Rows[rwIdx].Cells[2].Value = string.Empty; } if (this.dataDefDataGridView.Rows[rwIdx].Cells[3].Value == null) { this.dataDefDataGridView.Rows[rwIdx].Cells[3].Value = string.Empty; } if (this.dataDefDataGridView.Rows[rwIdx].Cells[4].Value == null) { this.dataDefDataGridView.Rows[rwIdx].Cells[4].Value = string.Empty; } if (this.dataDefDataGridView.Rows[rwIdx].Cells[6].Value == null) { this.dataDefDataGridView.Rows[rwIdx].Cells[6].Value = string.Empty; } if (this.dataDefDataGridView.Rows[rwIdx].Cells[8].Value == null) { this.dataDefDataGridView.Rows[rwIdx].Cells[8].Value = false; } if (this.dataDefDataGridView.Rows[rwIdx].Cells[9].Value == null) { this.dataDefDataGridView.Rows[rwIdx].Cells[9].Value = "-1"; } } private void isEnabledCheckBox_CheckedChanged(object sender, EventArgs e) { if (this.shdObeyEvts() == false || beenToCheckBx == true) { beenToCheckBx = false; return; } beenToCheckBx = true; if (this.addRec == false && this.editRec == false) { this.isEnabledCheckBox.Checked = !this.isEnabledCheckBox.Checked; } } private void addDtButton_Click(object sender, EventArgs e) { if (this.addRec == false && this.editRec == false) { Global.mnFrm.cmCde.showMsg("Must be in ADD/EDIT mode First!", 0); return; } this.createDtRows(1); this.prpareForLnsEdit(); } private void changeGridVw() { /* * Room/Hall Field/Yard Restaurant Table Gym/Sport Subscription, Rental Item */ } public void createDtRows(int num) { this.dataDefDataGridView.DefaultCellStyle.ForeColor = Color.Black; this.obey_ldt_evnts = false; for (int i = 0; i < num; i++) { this.dataDefDataGridView.Rows.Insert(0, 1); int rowIdx = 0;// this.dataDefDataGridView.RowCount - 1; this.dataDefDataGridView.Rows[rowIdx].Cells[0].Value = ""; this.dataDefDataGridView.Rows[rowIdx].Cells[1].Value = "..."; this.dataDefDataGridView.Rows[rowIdx].Cells[2].Value = ""; this.dataDefDataGridView.Rows[rowIdx].Cells[3].Value = "TEXT"; this.dataDefDataGridView.Rows[rowIdx].Cells[4].Value = ""; this.dataDefDataGridView.Rows[rowIdx].Cells[5].Value = "..."; this.dataDefDataGridView.Rows[rowIdx].Cells[6].Value = ""; this.dataDefDataGridView.Rows[rowIdx].Cells[7].Value = "..."; this.dataDefDataGridView.Rows[rowIdx].Cells[8].Value = false; this.dataDefDataGridView.Rows[rowIdx].Cells[9].Value = "-1"; } this.obey_ldt_evnts = true; } private void serviceTypesForm_KeyDown(object sender, KeyEventArgs e) { EventArgs ex = new EventArgs(); if (e.Control && e.KeyCode == Keys.S) { if (this.saveButton.Enabled == true) { this.saveButton_Click(this.saveButton, ex); } e.Handled = true; e.SuppressKeyPress = true; } else if (e.Control && e.KeyCode == Keys.N) { if (this.addButton.Enabled == true) { this.addButton_Click(this.addButton, ex); } e.Handled = true; e.SuppressKeyPress = true; } else if (e.Control && e.KeyCode == Keys.E) { if (this.editButton.Enabled == true) { this.editButton_Click(this.editButton, ex); } e.Handled = true; e.SuppressKeyPress = true; } else if (e.Control && e.KeyCode == Keys.R) { this.resetButton.PerformClick(); } else if ((e.Control && e.KeyCode == Keys.F) || e.KeyCode == Keys.F5) { if (this.goButton.Enabled == true) { this.goButton_Click(this.goButton, ex); } e.Handled = true; e.SuppressKeyPress = true; } else if (e.Control && e.KeyCode == Keys.Delete) { if (this.delButton.Enabled == true) { this.delButton_Click(this.delButton, ex); } e.Handled = true; e.SuppressKeyPress = true; } else { e.Handled = false; e.SuppressKeyPress = false; if (this.serviceNameTextBox.Focused) { //Global.mnFrm.cmCde.listViewKeyDown(this.serviceNameTextBox.Text, e); } } } private void searchForTextBox_Click(object sender, EventArgs e) { this.searchForTextBox.SelectAll(); } private void srvcTypeComboBox_SelectedIndexChanged(object sender, EventArgs e) { this.changeGridVw(); } private void dataDefDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e == null || this.obey_ldt_evnts == false) { return; } if (e.RowIndex < 0 || e.ColumnIndex < 0) { return; } bool prv = this.obey_ldt_evnts; this.obey_ldt_evnts = false; this.dfltFill(e.RowIndex); if (e.ColumnIndex == 1 || e.ColumnIndex == 5 || e.ColumnIndex == 7) { if (this.addRec == false && this.editRec == false) { Global.mnFrm.cmCde.showMsg("Must be in ADD/EDIT mode First!", 0); this.obey_ldt_evnts = true; return; } } if (e.ColumnIndex == 1) { int[] selVals = new int[1]; selVals[0] = Global.mnFrm.cmCde.getPssblValID( this.dataDefDataGridView.Rows[e.RowIndex].Cells[0].Value.ToString(), Global.mnFrm.cmCde.getLovID("Appointment Data Capture Category")); DialogResult dgRes = Global.mnFrm.cmCde.showPssblValDiag( Global.mnFrm.cmCde.getLovID("Appointment Data Capture Category"), ref selVals, true, false, this.srchWrd, "Both", this.autoLoad); if (dgRes == DialogResult.OK) { for (int i = 0; i < selVals.Length; i++) { this.dataDefDataGridView.Rows[e.RowIndex].Cells[0].Value = Global.mnFrm.cmCde.getPssblValNm( selVals[i]); } this.obey_ldt_evnts = true; } } else if (e.ColumnIndex == 5) { //LOV Names string[] selVals = new string[1]; selVals[0] = Global.mnFrm.cmCde.getLovID(this.dataDefDataGridView.Rows[e.RowIndex].Cells[4].Value.ToString()).ToString(); DialogResult dgRes = Global.mnFrm.cmCde.showPssblValDiag( Global.mnFrm.cmCde.getLovID("Non-Dynamic LOV Names"), ref selVals, true, false, this.srchWrd, "Both", this.autoLoad); if (dgRes == DialogResult.OK) { for (int i = 0; i < selVals.Length; i++) { this.dataDefDataGridView.Rows[e.RowIndex].Cells[4].Value = Global.mnFrm.cmCde.getLovNm(int.Parse(selVals[i])); } } } else if (e.ColumnIndex == 7) { //LOV Names string[] selVals = new string[1]; selVals[0] = Global.mnFrm.cmCde.getLovID(this.dataDefDataGridView.Rows[e.RowIndex].Cells[6].Value.ToString()).ToString(); DialogResult dgRes = Global.mnFrm.cmCde.showPssblValDiag( Global.mnFrm.cmCde.getLovID("Non-Dynamic LOV Names"), ref selVals, true, false, this.srchWrd, "Both", this.autoLoad); if (dgRes == DialogResult.OK) { for (int i = 0; i < selVals.Length; i++) { this.dataDefDataGridView.Rows[e.RowIndex].Cells[6].Value = Global.mnFrm.cmCde.getLovNm(int.Parse(selVals[i])); } } } this.obey_ldt_evnts = true; } private void dataDefDataGridView_CellValueChanged(object sender, DataGridViewCellEventArgs e) { if (e == null || this.obey_ldt_evnts == false) { return; } if (e.RowIndex < 0 || e.ColumnIndex < 0) { return; } this.dfltFill(e.RowIndex); bool prv = this.obey_ldt_evnts; this.obey_ldt_evnts = false; if (e.ColumnIndex == 0) { this.autoLoad = true; DataGridViewCellEventArgs e1 = new DataGridViewCellEventArgs(1, e.RowIndex); this.obey_ldt_evnts = true; this.dataDefDataGridView_CellContentClick(this.dataDefDataGridView, e1); this.autoLoad = false; } else if (e.ColumnIndex == 4) { this.autoLoad = true; DataGridViewCellEventArgs e1 = new DataGridViewCellEventArgs(5, e.RowIndex); this.obey_ldt_evnts = true; this.dataDefDataGridView_CellContentClick(this.dataDefDataGridView, e1); this.autoLoad = false; } else if (e.ColumnIndex == 6) { this.autoLoad = true; DataGridViewCellEventArgs e1 = new DataGridViewCellEventArgs(7, e.RowIndex); this.obey_ldt_evnts = true; this.dataDefDataGridView_CellContentClick(this.dataDefDataGridView, e1); this.autoLoad = false; } this.obey_ldt_evnts = true; } private void rfrshDtButton_Click(object sender, EventArgs e) { this.loadDtPanel(); } private void searchForDtTextBox_KeyDown(object sender, KeyEventArgs e) { EventArgs ex = new EventArgs(); if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Return) { this.rfrshDtButton.PerformClick(); } } } }
rhomicom-systems-tech-gh/Rhomicom-ERP-Desktop
AppointmentsManagement/AppointmentsManagement/Forms/wfnSrvcOffrdForm.cs
C#
gpl-3.0
49,317
<!DOCTYPE html> <html xml:lang="en-GB" lang="en-GB" xmlns="http://www.w3.org/1999/xhtml"> <head lang="en-GB"> <title>Ross Gammonโ€™s Family Tree - Events</title> <meta charset="UTF-8" /> <meta name ="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1" /> <meta name ="apple-mobile-web-app-capable" content="yes" /> <meta name="generator" content="Gramps 4.2.8 http://gramps-project.org/" /> <meta name="author" content="" /> <link href="../../../images/favicon2.ico" rel="shortcut icon" type="image/x-icon" /> <link href="../../../css/narrative-screen.css" media="screen" rel="stylesheet" type="text/css" /> <link href="../../../css/narrative-print.css" media="print" rel="stylesheet" type="text/css" /> </head> <body> <div id="header"> <h1 id="SiteTitle">Ross Gammonโ€™s Family Tree</h1> </div> <div class="wrapper" id="nav" role="navigation"> <div class="container"> <ul class="menu" id="dropmenu"> <li><a href="../../../individuals.html" title="Individuals">Individuals</a></li> <li><a href="../../../index.html" title="Surnames">Surnames</a></li> <li><a href="../../../families.html" title="Families">Families</a></li> <li class = "CurrentSection"><a href="../../../events.html" title="Events">Events</a></li> <li><a href="../../../places.html" title="Places">Places</a></li> <li><a href="../../../sources.html" title="Sources">Sources</a></li> <li><a href="../../../repositories.html" title="Repositories">Repositories</a></li> <li><a href="../../../media.html" title="Media">Media</a></li> <li><a href="../../../thumbnails.html" title="Thumbnails">Thumbnails</a></li> </ul> </div> </div> <div class="content" id="EventDetail"> <h3>Christening</h3> <table class="infolist eventlist"> <tbody> <tr> <td class="ColumnAttribute">Gramps ID</td> <td class="ColumnGRAMPSID">E2683</td> </tr> <tr> <td class="ColumnAttribute">Date</td> <td class="ColumnColumnDate"> 1692-06-22 </td> </tr> <tr> <td class="ColumnAttribute">Place</td> <td class="ColumnColumnPlace"> <a href="../../../plc/d/c/d15f5fbf06e36c82f6fe416cacd.html" title=""> </a> </td> </tr> </tbody> </table> <div class="subsection" id="references"> <h4>References</h4> <ol class="Col1" role="Volume-n-Page"type = 1> <li> <a href="../../../ppl/0/0/d15f5fd909a134ee791a002d00.html"> CUTCLIFFE, Mary <span class="grampsid"> [I2492]</span> </a> </li> </ol> </div> </div> <div class="fullclear"></div> <div id="footer"> <p id="createdate"> Generated by <a href="http://gramps-project.org/">Gramps</a> 4.2.8<br />Last change was the 2015-08-05 19:54:10<br />Created for <a href="../../../ppl/9/e/d15f5fb48902c4fc1b421d249e9.html">GAMMON, Francis</a> </p> <p id="copyright"> </p> </div> </body> </html>
RossGammon/the-gammons.net
RossFamilyTree/evt/f/9/d15f5fd90ca7578d7fb40d9a89f.html
HTML
gpl-3.0
2,916
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM 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. OpenFOAM 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 OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class Foam::geomDecomp Description Geometrical domain decomposition SourceFiles geomDecomp.C \*---------------------------------------------------------------------------*/ #ifndef geomDecomp_H #define geomDecomp_H #include "OpenFOAM-2.1.x/src/parallel/decompose/decompositionMethods/decompositionMethod/decompositionMethod.H" #include "OpenFOAM-2.1.x/src/OpenFOAM/primitives/Vector/Vector.H" namespace Foam { /*---------------------------------------------------------------------------*\ Class geomDecomp Declaration \*---------------------------------------------------------------------------*/ class geomDecomp : public decompositionMethod { protected: // Protected data const dictionary& geomDecomDict_; Vector<label> n_; scalar delta_; tensor rotDelta_; public: // Constructors //- Construct given the decomposition dictionary // and the derived type name geomDecomp ( const dictionary& decompositionDict, const word& derivedType ); //- Return for every coordinate the wanted processor number. virtual labelList decompose ( const pointField& points, const scalarField& pointWeights ) = 0; //- Like decompose but with uniform weights on the points virtual labelList decompose(const pointField&) = 0; }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif // ************************************************************************* //
kempj/OpenFOAM-win
src/parallel/decompose/decompositionMethods/geomDecomp/geomDecomp.H
C++
gpl-3.0
2,796
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_33) on Fri Aug 03 11:43:00 PDT 2012 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> Uses of Class com.hp.hpl.jena.sparql.ARQConstants (Apache Jena ARQ) </TITLE> <META NAME="date" CONTENT="2012-08-03"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class com.hp.hpl.jena.sparql.ARQConstants (Apache Jena ARQ)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../com/hp/hpl/jena/sparql/ARQConstants.html" title="class in com.hp.hpl.jena.sparql"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?com/hp/hpl/jena/sparql//class-useARQConstants.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="ARQConstants.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Class<br>com.hp.hpl.jena.sparql.ARQConstants</B></H2> </CENTER> No usage of com.hp.hpl.jena.sparql.ARQConstants <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../com/hp/hpl/jena/sparql/ARQConstants.html" title="class in com.hp.hpl.jena.sparql"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?com/hp/hpl/jena/sparql//class-useARQConstants.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="ARQConstants.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Licenced under the Apache License, Version 2.0 </BODY> </HTML>
decoit/Visa-Topologie-Editor
backend/lib/jena/javadoc-arq/com/hp/hpl/jena/sparql/class-use/ARQConstants.html
HTML
gpl-3.0
6,075
// Copyright (c) 2009-2016 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #if defined(HAVE_CONFIG_H) #include "config/bitcoin-config.h" #endif #include "base58.h" #include "clientversion.h" #include "coins.h" #include "consensus/consensus.h" #include "core_io.h" #include "keystore.h" #include "policy/policy.h" #include "policy/rbf.h" #include "primitives/transaction.h" #include "script/script.h" #include "script/sign.h" #include <univalue.h> #include "util.h" #include "utilmoneystr.h" #include "utilstrencodings.h" #include <stdio.h> #include <boost/algorithm/string.hpp> static bool fCreateBlank; static std::map<std::string,UniValue> registers; static const int CONTINUE_EXECUTION=-1; // // This function returns either one of EXIT_ codes when it's expected to stop the process or // CONTINUE_EXECUTION when it's expected to continue further. // static int AppInitRawTx(int argc, char* argv[]) { // // Parameters // gArgs.ParseParameters(argc, argv); // Check for -testnet or -regtest parameter (Params() calls are only valid after this clause) try { SelectParams(ChainNameFromCommandLine()); } catch (const std::exception& e) { fprintf(stderr, "Error: %s\n", e.what()); return EXIT_FAILURE; } fCreateBlank = gArgs.GetBoolArg("-create", false); if (argc<2 || gArgs.IsArgSet("-?") || gArgs.IsArgSet("-h") || gArgs.IsArgSet("-help")) { // First part of help message is specific to this utility std::string strUsage = strprintf(_("%s berycoin-tx utility version"), _(PACKAGE_NAME)) + " " + FormatFullVersion() + "\n\n" + _("Usage:") + "\n" + " berycoin-tx [options] <hex-tx> [commands] " + _("Update hex-encoded berycoin transaction") + "\n" + " berycoin-tx [options] -create [commands] " + _("Create hex-encoded berycoin transaction") + "\n" + "\n"; fprintf(stdout, "%s", strUsage.c_str()); strUsage = HelpMessageGroup(_("Options:")); strUsage += HelpMessageOpt("-?", _("This help message")); strUsage += HelpMessageOpt("-create", _("Create new, empty TX.")); strUsage += HelpMessageOpt("-json", _("Select JSON output")); strUsage += HelpMessageOpt("-txid", _("Output only the hex-encoded transaction id of the resultant transaction.")); AppendParamsHelpMessages(strUsage); fprintf(stdout, "%s", strUsage.c_str()); strUsage = HelpMessageGroup(_("Commands:")); strUsage += HelpMessageOpt("delin=N", _("Delete input N from TX")); strUsage += HelpMessageOpt("delout=N", _("Delete output N from TX")); strUsage += HelpMessageOpt("in=TXID:VOUT(:SEQUENCE_NUMBER)", _("Add input to TX")); strUsage += HelpMessageOpt("locktime=N", _("Set TX lock time to N")); strUsage += HelpMessageOpt("nversion=N", _("Set TX version to N")); strUsage += HelpMessageOpt("replaceable(=N)", _("Set RBF opt-in sequence number for input N (if not provided, opt-in all available inputs)")); strUsage += HelpMessageOpt("outaddr=VALUE:ADDRESS", _("Add address-based output to TX")); strUsage += HelpMessageOpt("outpubkey=VALUE:PUBKEY[:FLAGS]", _("Add pay-to-pubkey output to TX") + ". " + _("Optionally add the \"W\" flag to produce a pay-to-witness-pubkey-hash output") + ". " + _("Optionally add the \"S\" flag to wrap the output in a pay-to-script-hash.")); strUsage += HelpMessageOpt("outdata=[VALUE:]DATA", _("Add data-based output to TX")); strUsage += HelpMessageOpt("outscript=VALUE:SCRIPT[:FLAGS]", _("Add raw script output to TX") + ". " + _("Optionally add the \"W\" flag to produce a pay-to-witness-script-hash output") + ". " + _("Optionally add the \"S\" flag to wrap the output in a pay-to-script-hash.")); strUsage += HelpMessageOpt("outmultisig=VALUE:REQUIRED:PUBKEYS:PUBKEY1:PUBKEY2:....[:FLAGS]", _("Add Pay To n-of-m Multi-sig output to TX. n = REQUIRED, m = PUBKEYS") + ". " + _("Optionally add the \"W\" flag to produce a pay-to-witness-script-hash output") + ". " + _("Optionally add the \"S\" flag to wrap the output in a pay-to-script-hash.")); strUsage += HelpMessageOpt("sign=SIGHASH-FLAGS", _("Add zero or more signatures to transaction") + ". " + _("This command requires JSON registers:") + _("prevtxs=JSON object") + ", " + _("privatekeys=JSON object") + ". " + _("See signrawtransaction docs for format of sighash flags, JSON objects.")); fprintf(stdout, "%s", strUsage.c_str()); strUsage = HelpMessageGroup(_("Register Commands:")); strUsage += HelpMessageOpt("load=NAME:FILENAME", _("Load JSON file FILENAME into register NAME")); strUsage += HelpMessageOpt("set=NAME:JSON-STRING", _("Set register NAME to given JSON-STRING")); fprintf(stdout, "%s", strUsage.c_str()); if (argc < 2) { fprintf(stderr, "Error: too few parameters\n"); return EXIT_FAILURE; } return EXIT_SUCCESS; } return CONTINUE_EXECUTION; } static void RegisterSetJson(const std::string& key, const std::string& rawJson) { UniValue val; if (!val.read(rawJson)) { std::string strErr = "Cannot parse JSON for key " + key; throw std::runtime_error(strErr); } registers[key] = val; } static void RegisterSet(const std::string& strInput) { // separate NAME:VALUE in string size_t pos = strInput.find(':'); if ((pos == std::string::npos) || (pos == 0) || (pos == (strInput.size() - 1))) throw std::runtime_error("Register input requires NAME:VALUE"); std::string key = strInput.substr(0, pos); std::string valStr = strInput.substr(pos + 1, std::string::npos); RegisterSetJson(key, valStr); } static void RegisterLoad(const std::string& strInput) { // separate NAME:FILENAME in string size_t pos = strInput.find(':'); if ((pos == std::string::npos) || (pos == 0) || (pos == (strInput.size() - 1))) throw std::runtime_error("Register load requires NAME:FILENAME"); std::string key = strInput.substr(0, pos); std::string filename = strInput.substr(pos + 1, std::string::npos); FILE *f = fopen(filename.c_str(), "r"); if (!f) { std::string strErr = "Cannot open file " + filename; throw std::runtime_error(strErr); } // load file chunks into one big buffer std::string valStr; while ((!feof(f)) && (!ferror(f))) { char buf[4096]; int bread = fread(buf, 1, sizeof(buf), f); if (bread <= 0) break; valStr.insert(valStr.size(), buf, bread); } int error = ferror(f); fclose(f); if (error) { std::string strErr = "Error reading file " + filename; throw std::runtime_error(strErr); } // evaluate as JSON buffer register RegisterSetJson(key, valStr); } static CAmount ExtractAndValidateValue(const std::string& strValue) { CAmount value; if (!ParseMoney(strValue, value)) throw std::runtime_error("invalid TX output value"); return value; } static void MutateTxVersion(CMutableTransaction& tx, const std::string& cmdVal) { int64_t newVersion = atoi64(cmdVal); if (newVersion < 1 || newVersion > CTransaction::MAX_STANDARD_VERSION) throw std::runtime_error("Invalid TX version requested"); tx.nVersion = (int) newVersion; } static void MutateTxLocktime(CMutableTransaction& tx, const std::string& cmdVal) { int64_t newLocktime = atoi64(cmdVal); if (newLocktime < 0LL || newLocktime > 0xffffffffLL) throw std::runtime_error("Invalid TX locktime requested"); tx.nLockTime = (unsigned int) newLocktime; } static void MutateTxRBFOptIn(CMutableTransaction& tx, const std::string& strInIdx) { // parse requested index int inIdx = atoi(strInIdx); if (inIdx < 0 || inIdx >= (int)tx.vin.size()) { throw std::runtime_error("Invalid TX input index '" + strInIdx + "'"); } // set the nSequence to MAX_INT - 2 (= RBF opt in flag) int cnt = 0; for (CTxIn& txin : tx.vin) { if (strInIdx == "" || cnt == inIdx) { if (txin.nSequence > MAX_BIP125_RBF_SEQUENCE) { txin.nSequence = MAX_BIP125_RBF_SEQUENCE; } } ++cnt; } } static void MutateTxAddInput(CMutableTransaction& tx, const std::string& strInput) { std::vector<std::string> vStrInputParts; boost::split(vStrInputParts, strInput, boost::is_any_of(":")); // separate TXID:VOUT in string if (vStrInputParts.size()<2) throw std::runtime_error("TX input missing separator"); // extract and validate TXID std::string strTxid = vStrInputParts[0]; if ((strTxid.size() != 64) || !IsHex(strTxid)) throw std::runtime_error("invalid TX input txid"); uint256 txid(uint256S(strTxid)); static const unsigned int minTxOutSz = 9; static const unsigned int maxVout = dgpMaxBlockSize / minTxOutSz; // extract and validate vout std::string strVout = vStrInputParts[1]; int vout = atoi(strVout); if ((vout < 0) || (vout > (int)maxVout)) throw std::runtime_error("invalid TX input vout"); // extract the optional sequence number uint32_t nSequenceIn=std::numeric_limits<unsigned int>::max(); if (vStrInputParts.size() > 2) nSequenceIn = std::stoul(vStrInputParts[2]); // append to transaction input list CTxIn txin(txid, vout, CScript(), nSequenceIn); tx.vin.push_back(txin); } static void MutateTxAddOutAddr(CMutableTransaction& tx, const std::string& strInput) { // Separate into VALUE:ADDRESS std::vector<std::string> vStrInputParts; boost::split(vStrInputParts, strInput, boost::is_any_of(":")); if (vStrInputParts.size() != 2) throw std::runtime_error("TX output missing or too many separators"); // Extract and validate VALUE CAmount value = ExtractAndValidateValue(vStrInputParts[0]); // extract and validate ADDRESS std::string strAddr = vStrInputParts[1]; CBitcoinAddress addr(strAddr); if (!addr.IsValid()) throw std::runtime_error("invalid TX output address"); // build standard output script via GetScriptForDestination() CScript scriptPubKey = GetScriptForDestination(addr.Get()); // construct TxOut, append to transaction output list CTxOut txout(value, scriptPubKey); tx.vout.push_back(txout); } static void MutateTxAddOutPubKey(CMutableTransaction& tx, const std::string& strInput) { // Separate into VALUE:PUBKEY[:FLAGS] std::vector<std::string> vStrInputParts; boost::split(vStrInputParts, strInput, boost::is_any_of(":")); if (vStrInputParts.size() < 2 || vStrInputParts.size() > 3) throw std::runtime_error("TX output missing or too many separators"); // Extract and validate VALUE CAmount value = ExtractAndValidateValue(vStrInputParts[0]); // Extract and validate PUBKEY CPubKey pubkey(ParseHex(vStrInputParts[1])); if (!pubkey.IsFullyValid()) throw std::runtime_error("invalid TX output pubkey"); CScript scriptPubKey = GetScriptForRawPubKey(pubkey); // Extract and validate FLAGS bool bSegWit = false; bool bScriptHash = false; if (vStrInputParts.size() == 3) { std::string flags = vStrInputParts[2]; bSegWit = (flags.find("W") != std::string::npos); bScriptHash = (flags.find("S") != std::string::npos); } if (bSegWit) { if (!pubkey.IsCompressed()) { throw std::runtime_error("Uncompressed pubkeys are not useable for SegWit outputs"); } // Call GetScriptForWitness() to build a P2WSH scriptPubKey scriptPubKey = GetScriptForWitness(scriptPubKey); } if (bScriptHash) { // Get the address for the redeem script, then call // GetScriptForDestination() to construct a P2SH scriptPubKey. CBitcoinAddress redeemScriptAddr(scriptPubKey); scriptPubKey = GetScriptForDestination(redeemScriptAddr.Get()); } // construct TxOut, append to transaction output list CTxOut txout(value, scriptPubKey); tx.vout.push_back(txout); } static void MutateTxAddOutMultiSig(CMutableTransaction& tx, const std::string& strInput) { // Separate into VALUE:REQUIRED:NUMKEYS:PUBKEY1:PUBKEY2:....[:FLAGS] std::vector<std::string> vStrInputParts; boost::split(vStrInputParts, strInput, boost::is_any_of(":")); // Check that there are enough parameters if (vStrInputParts.size()<3) throw std::runtime_error("Not enough multisig parameters"); // Extract and validate VALUE CAmount value = ExtractAndValidateValue(vStrInputParts[0]); // Extract REQUIRED uint32_t required = stoul(vStrInputParts[1]); // Extract NUMKEYS uint32_t numkeys = stoul(vStrInputParts[2]); // Validate there are the correct number of pubkeys if (vStrInputParts.size() < numkeys + 3) throw std::runtime_error("incorrect number of multisig pubkeys"); if (required < 1 || required > 20 || numkeys < 1 || numkeys > 20 || numkeys < required) throw std::runtime_error("multisig parameter mismatch. Required " \ + std::to_string(required) + " of " + std::to_string(numkeys) + "signatures."); // extract and validate PUBKEYs std::vector<CPubKey> pubkeys; for(int pos = 1; pos <= int(numkeys); pos++) { CPubKey pubkey(ParseHex(vStrInputParts[pos + 2])); if (!pubkey.IsFullyValid()) throw std::runtime_error("invalid TX output pubkey"); pubkeys.push_back(pubkey); } // Extract FLAGS bool bSegWit = false; bool bScriptHash = false; if (vStrInputParts.size() == numkeys + 4) { std::string flags = vStrInputParts.back(); bSegWit = (flags.find("W") != std::string::npos); bScriptHash = (flags.find("S") != std::string::npos); } else if (vStrInputParts.size() > numkeys + 4) { // Validate that there were no more parameters passed throw std::runtime_error("Too many parameters"); } CScript scriptPubKey = GetScriptForMultisig(required, pubkeys); if (bSegWit) { for (CPubKey& pubkey : pubkeys) { if (!pubkey.IsCompressed()) { throw std::runtime_error("Uncompressed pubkeys are not useable for SegWit outputs"); } } // Call GetScriptForWitness() to build a P2WSH scriptPubKey scriptPubKey = GetScriptForWitness(scriptPubKey); } if (bScriptHash) { if (scriptPubKey.size() > MAX_SCRIPT_ELEMENT_SIZE) { throw std::runtime_error(strprintf( "redeemScript exceeds size limit: %d > %d", scriptPubKey.size(), MAX_SCRIPT_ELEMENT_SIZE)); } // Get the address for the redeem script, then call // GetScriptForDestination() to construct a P2SH scriptPubKey. CBitcoinAddress addr(scriptPubKey); scriptPubKey = GetScriptForDestination(addr.Get()); } // construct TxOut, append to transaction output list CTxOut txout(value, scriptPubKey); tx.vout.push_back(txout); } static void MutateTxAddOutData(CMutableTransaction& tx, const std::string& strInput) { CAmount value = 0; // separate [VALUE:]DATA in string size_t pos = strInput.find(':'); if (pos==0) throw std::runtime_error("TX output value not specified"); if (pos != std::string::npos) { // Extract and validate VALUE value = ExtractAndValidateValue(strInput.substr(0, pos)); } // extract and validate DATA std::string strData = strInput.substr(pos + 1, std::string::npos); if (!IsHex(strData)) throw std::runtime_error("invalid TX output data"); std::vector<unsigned char> data = ParseHex(strData); CTxOut txout(value, CScript() << OP_RETURN << data); tx.vout.push_back(txout); } static void MutateTxAddOutScript(CMutableTransaction& tx, const std::string& strInput) { // separate VALUE:SCRIPT[:FLAGS] std::vector<std::string> vStrInputParts; boost::split(vStrInputParts, strInput, boost::is_any_of(":")); if (vStrInputParts.size() < 2) throw std::runtime_error("TX output missing separator"); // Extract and validate VALUE CAmount value = ExtractAndValidateValue(vStrInputParts[0]); // extract and validate script std::string strScript = vStrInputParts[1]; CScript scriptPubKey = ParseScript(strScript); // Extract FLAGS bool bSegWit = false; bool bScriptHash = false; if (vStrInputParts.size() == 3) { std::string flags = vStrInputParts.back(); bSegWit = (flags.find("W") != std::string::npos); bScriptHash = (flags.find("S") != std::string::npos); } if (scriptPubKey.size() > MAX_SCRIPT_SIZE) { throw std::runtime_error(strprintf( "script exceeds size limit: %d > %d", scriptPubKey.size(), MAX_SCRIPT_SIZE)); } if (bSegWit) { scriptPubKey = GetScriptForWitness(scriptPubKey); } if (bScriptHash) { if (scriptPubKey.size() > MAX_SCRIPT_ELEMENT_SIZE) { throw std::runtime_error(strprintf( "redeemScript exceeds size limit: %d > %d", scriptPubKey.size(), MAX_SCRIPT_ELEMENT_SIZE)); } CBitcoinAddress addr(scriptPubKey); scriptPubKey = GetScriptForDestination(addr.Get()); } // construct TxOut, append to transaction output list CTxOut txout(value, scriptPubKey); tx.vout.push_back(txout); } static void MutateTxDelInput(CMutableTransaction& tx, const std::string& strInIdx) { // parse requested deletion index int inIdx = atoi(strInIdx); if (inIdx < 0 || inIdx >= (int)tx.vin.size()) { std::string strErr = "Invalid TX input index '" + strInIdx + "'"; throw std::runtime_error(strErr.c_str()); } // delete input from transaction tx.vin.erase(tx.vin.begin() + inIdx); } static void MutateTxDelOutput(CMutableTransaction& tx, const std::string& strOutIdx) { // parse requested deletion index int outIdx = atoi(strOutIdx); if (outIdx < 0 || outIdx >= (int)tx.vout.size()) { std::string strErr = "Invalid TX output index '" + strOutIdx + "'"; throw std::runtime_error(strErr.c_str()); } // delete output from transaction tx.vout.erase(tx.vout.begin() + outIdx); } static const unsigned int N_SIGHASH_OPTS = 6; static const struct { const char *flagStr; int flags; } sighashOptions[N_SIGHASH_OPTS] = { {"ALL", SIGHASH_ALL}, {"NONE", SIGHASH_NONE}, {"SINGLE", SIGHASH_SINGLE}, {"ALL|ANYONECANPAY", SIGHASH_ALL|SIGHASH_ANYONECANPAY}, {"NONE|ANYONECANPAY", SIGHASH_NONE|SIGHASH_ANYONECANPAY}, {"SINGLE|ANYONECANPAY", SIGHASH_SINGLE|SIGHASH_ANYONECANPAY}, }; static bool findSighashFlags(int& flags, const std::string& flagStr) { flags = 0; for (unsigned int i = 0; i < N_SIGHASH_OPTS; i++) { if (flagStr == sighashOptions[i].flagStr) { flags = sighashOptions[i].flags; return true; } } return false; } static CAmount AmountFromValue(const UniValue& value) { if (!value.isNum() && !value.isStr()) throw std::runtime_error("Amount is not a number or string"); CAmount amount; if (!ParseFixedPoint(value.getValStr(), 8, &amount)) throw std::runtime_error("Invalid amount"); if (!MoneyRange(amount)) throw std::runtime_error("Amount out of range"); return amount; } static void MutateTxSign(CMutableTransaction& tx, const std::string& flagStr) { int nHashType = SIGHASH_ALL; if (flagStr.size() > 0) if (!findSighashFlags(nHashType, flagStr)) throw std::runtime_error("unknown sighash flag/sign option"); std::vector<CTransaction> txVariants; txVariants.push_back(tx); // mergedTx will end up with all the signatures; it // starts as a clone of the raw tx: CMutableTransaction mergedTx(txVariants[0]); bool fComplete = true; CCoinsView viewDummy; CCoinsViewCache view(&viewDummy); if (!registers.count("privatekeys")) throw std::runtime_error("privatekeys register variable must be set."); CBasicKeyStore tempKeystore; UniValue keysObj = registers["privatekeys"]; for (unsigned int kidx = 0; kidx < keysObj.size(); kidx++) { if (!keysObj[kidx].isStr()) throw std::runtime_error("privatekey not a std::string"); CBitcoinSecret vchSecret; bool fGood = vchSecret.SetString(keysObj[kidx].getValStr()); if (!fGood) throw std::runtime_error("privatekey not valid"); CKey key = vchSecret.GetKey(); tempKeystore.AddKey(key); } // Add previous txouts given in the RPC call: if (!registers.count("prevtxs")) throw std::runtime_error("prevtxs register variable must be set."); UniValue prevtxsObj = registers["prevtxs"]; { for (unsigned int previdx = 0; previdx < prevtxsObj.size(); previdx++) { UniValue prevOut = prevtxsObj[previdx]; if (!prevOut.isObject()) throw std::runtime_error("expected prevtxs internal object"); std::map<std::string, UniValue::VType> types = { {"txid", UniValue::VSTR}, {"vout", UniValue::VNUM}, {"scriptPubKey", UniValue::VSTR}, }; if (!prevOut.checkObject(types)) throw std::runtime_error("prevtxs internal object typecheck fail"); uint256 txid = ParseHashUV(prevOut["txid"], "txid"); int nOut = atoi(prevOut["vout"].getValStr()); if (nOut < 0) throw std::runtime_error("vout must be positive"); COutPoint out(txid, nOut); std::vector<unsigned char> pkData(ParseHexUV(prevOut["scriptPubKey"], "scriptPubKey")); CScript scriptPubKey(pkData.begin(), pkData.end()); { const Coin& coin = view.AccessCoin(out); if (!coin.IsSpent() && coin.out.scriptPubKey != scriptPubKey) { std::string err("Previous output scriptPubKey mismatch:\n"); err = err + ScriptToAsmStr(coin.out.scriptPubKey) + "\nvs:\n"+ ScriptToAsmStr(scriptPubKey); throw std::runtime_error(err); } Coin newcoin; newcoin.out.scriptPubKey = scriptPubKey; newcoin.out.nValue = 0; if (prevOut.exists("amount")) { newcoin.out.nValue = AmountFromValue(prevOut["amount"]); } newcoin.nHeight = 1; view.AddCoin(out, std::move(newcoin), true); } // if redeemScript given and private keys given, // add redeemScript to the tempKeystore so it can be signed: if ((scriptPubKey.IsPayToScriptHash() || scriptPubKey.IsPayToWitnessScriptHash()) && prevOut.exists("redeemScript")) { UniValue v = prevOut["redeemScript"]; std::vector<unsigned char> rsData(ParseHexUV(v, "redeemScript")); CScript redeemScript(rsData.begin(), rsData.end()); tempKeystore.AddCScript(redeemScript); } } } const CKeyStore& keystore = tempKeystore; bool fHashSingle = ((nHashType & ~SIGHASH_ANYONECANPAY) == SIGHASH_SINGLE); // Sign what we can: for (unsigned int i = 0; i < mergedTx.vin.size(); i++) { CTxIn& txin = mergedTx.vin[i]; const Coin& coin = view.AccessCoin(txin.prevout); if (coin.IsSpent()) { fComplete = false; continue; } const CScript& prevPubKey = coin.out.scriptPubKey; const CAmount& amount = coin.out.nValue; SignatureData sigdata; // Only sign SIGHASH_SINGLE if there's a corresponding output: if (!fHashSingle || (i < mergedTx.vout.size())) ProduceSignature(MutableTransactionSignatureCreator(&keystore, &mergedTx, i, amount, nHashType), prevPubKey, sigdata); // ... and merge in other signatures: for (const CTransaction& txv : txVariants) sigdata = CombineSignatures(prevPubKey, MutableTransactionSignatureChecker(&mergedTx, i, amount), sigdata, DataFromTransaction(txv, i)); UpdateTransaction(mergedTx, i, sigdata); if (!VerifyScript(txin.scriptSig, prevPubKey, &txin.scriptWitness, STANDARD_SCRIPT_VERIFY_FLAGS, MutableTransactionSignatureChecker(&mergedTx, i, amount))) fComplete = false; } if (fComplete) { // do nothing... for now // perhaps store this for later optional JSON output } tx = mergedTx; } class Secp256k1Init { ECCVerifyHandle globalVerifyHandle; public: Secp256k1Init() { ECC_Start(); } ~Secp256k1Init() { ECC_Stop(); } }; static void MutateTx(CMutableTransaction& tx, const std::string& command, const std::string& commandVal) { std::unique_ptr<Secp256k1Init> ecc; if (command == "nversion") MutateTxVersion(tx, commandVal); else if (command == "locktime") MutateTxLocktime(tx, commandVal); else if (command == "replaceable") { MutateTxRBFOptIn(tx, commandVal); } else if (command == "delin") MutateTxDelInput(tx, commandVal); else if (command == "in") MutateTxAddInput(tx, commandVal); else if (command == "delout") MutateTxDelOutput(tx, commandVal); else if (command == "outaddr") MutateTxAddOutAddr(tx, commandVal); else if (command == "outpubkey") { if (!ecc) { ecc.reset(new Secp256k1Init()); } MutateTxAddOutPubKey(tx, commandVal); } else if (command == "outmultisig") { if (!ecc) { ecc.reset(new Secp256k1Init()); } MutateTxAddOutMultiSig(tx, commandVal); } else if (command == "outscript") MutateTxAddOutScript(tx, commandVal); else if (command == "outdata") MutateTxAddOutData(tx, commandVal); else if (command == "sign") { if (!ecc) { ecc.reset(new Secp256k1Init()); } MutateTxSign(tx, commandVal); } else if (command == "load") RegisterLoad(commandVal); else if (command == "set") RegisterSet(commandVal); else throw std::runtime_error("unknown command"); } static void OutputTxJSON(const CTransaction& tx) { UniValue entry(UniValue::VOBJ); TxToUniv(tx, uint256(), entry); std::string jsonOutput = entry.write(4); fprintf(stdout, "%s\n", jsonOutput.c_str()); } static void OutputTxHash(const CTransaction& tx) { std::string strHexHash = tx.GetHash().GetHex(); // the hex-encoded transaction hash (aka the transaction id) fprintf(stdout, "%s\n", strHexHash.c_str()); } static void OutputTxHex(const CTransaction& tx) { std::string strHex = EncodeHexTx(tx); fprintf(stdout, "%s\n", strHex.c_str()); } static void OutputTx(const CTransaction& tx) { if (gArgs.GetBoolArg("-json", false)) OutputTxJSON(tx); else if (gArgs.GetBoolArg("-txid", false)) OutputTxHash(tx); else OutputTxHex(tx); } static std::string readStdin() { char buf[4096]; std::string ret; while (!feof(stdin)) { size_t bread = fread(buf, 1, sizeof(buf), stdin); ret.append(buf, bread); if (bread < sizeof(buf)) break; } if (ferror(stdin)) throw std::runtime_error("error reading stdin"); boost::algorithm::trim_right(ret); return ret; } static int CommandLineRawTx(int argc, char* argv[]) { std::string strPrint; int nRet = 0; try { // Skip switches; Permit common stdin convention "-" while (argc > 1 && IsSwitchChar(argv[1][0]) && (argv[1][1] != 0)) { argc--; argv++; } CMutableTransaction tx; int startArg; if (!fCreateBlank) { // require at least one param if (argc < 2) throw std::runtime_error("too few parameters"); // param: hex-encoded bitcoin transaction std::string strHexTx(argv[1]); if (strHexTx == "-") // "-" implies standard input strHexTx = readStdin(); if (!DecodeHexTx(tx, strHexTx, true)) throw std::runtime_error("invalid transaction encoding"); startArg = 2; } else startArg = 1; for (int i = startArg; i < argc; i++) { std::string arg = argv[i]; std::string key, value; size_t eqpos = arg.find('='); if (eqpos == std::string::npos) key = arg; else { key = arg.substr(0, eqpos); value = arg.substr(eqpos + 1); } MutateTx(tx, key, value); } OutputTx(tx); } catch (const boost::thread_interrupted&) { throw; } catch (const std::exception& e) { strPrint = std::string("error: ") + e.what(); nRet = EXIT_FAILURE; } catch (...) { PrintExceptionContinue(nullptr, "CommandLineRawTx()"); throw; } if (strPrint != "") { fprintf((nRet == 0 ? stdout : stderr), "%s\n", strPrint.c_str()); } return nRet; } int main(int argc, char* argv[]) { SetupEnvironment(); try { int ret = AppInitRawTx(argc, argv); if (ret != CONTINUE_EXECUTION) return ret; } catch (const std::exception& e) { PrintExceptionContinue(&e, "AppInitRawTx()"); return EXIT_FAILURE; } catch (...) { PrintExceptionContinue(nullptr, "AppInitRawTx()"); return EXIT_FAILURE; } int ret = EXIT_FAILURE; try { ret = CommandLineRawTx(argc, argv); } catch (const std::exception& e) { PrintExceptionContinue(&e, "CommandLineRawTx()"); } catch (...) { PrintExceptionContinue(nullptr, "CommandLineRawTx()"); } return ret; }
berycoin-project/berycoin
src/bitcoin-tx.cpp
C++
gpl-3.0
30,448
package net.minecraft.src; public class BlockJukeBox extends BlockContainer { protected BlockJukeBox(int par1) { super(par1, Material.wood); this.setCreativeTab(CreativeTabs.tabDecorations); } /** * Called upon block activation (right click on the block.) */ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { if (par1World.getBlockMetadata(par2, par3, par4) == 0) { return false; } else { this.ejectRecord(par1World, par2, par3, par4); return true; } } /** * Insert the specified music disc in the jukebox at the given coordinates */ public void insertRecord(World par1World, int par2, int par3, int par4, ItemStack par5ItemStack) { if (!par1World.isRemote) { TileEntityRecordPlayer var6 = (TileEntityRecordPlayer)par1World.getBlockTileEntity(par2, par3, par4); if (var6 != null) { var6.func_96098_a(par5ItemStack.copy()); par1World.setBlockMetadata(par2, par3, par4, 1, 2); } } } /** * Ejects the current record inside of the jukebox. */ public void ejectRecord(World par1World, int par2, int par3, int par4) { if (!par1World.isRemote) { TileEntityRecordPlayer var5 = (TileEntityRecordPlayer)par1World.getBlockTileEntity(par2, par3, par4); if (var5 != null) { ItemStack var6 = var5.func_96097_a(); if (var6 != null) { par1World.playAuxSFX(1005, par2, par3, par4, 0); par1World.playRecord((String)null, par2, par3, par4); var5.func_96098_a((ItemStack)null); par1World.setBlockMetadata(par2, par3, par4, 0, 2); float var7 = 0.7F; double var8 = (double)(par1World.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D; double var10 = (double)(par1World.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.2D + 0.6D; double var12 = (double)(par1World.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D; ItemStack var14 = var6.copy(); EntityItem var15 = new EntityItem(par1World, (double)par2 + var8, (double)par3 + var10, (double)par4 + var12, var14); var15.delayBeforeCanPickup = 10; par1World.spawnEntityInWorld(var15); } } } } /** * ejects contained items into the world, and notifies neighbours of an update, as appropriate */ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { this.ejectRecord(par1World, par2, par3, par4); super.breakBlock(par1World, par2, par3, par4, par5, par6); } /** * Drops the block items with a specified chance of dropping the specified items */ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { if (!par1World.isRemote) { super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0); } } /** * Returns a new instance of a block's tile entity class. Called on placing the block. */ public TileEntity createNewTileEntity(World par1World) { return new TileEntityRecordPlayer(); } /** * If this returns true, then comparators facing away from this block will use the value from * getComparatorInputOverride instead of the actual redstone signal strength. */ public boolean hasComparatorInputOverride() { return true; } /** * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal * strength when this block inputs to a comparator. */ public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { ItemStack var6 = ((TileEntityRecordPlayer)par1World.getBlockTileEntity(par2, par3, par4)).func_96097_a(); return var6 == null ? 0 : var6.itemID + 1 - Item.record13.itemID; } }
herpingdo/Hakkit
net/minecraft/src/BlockJukeBox.java
Java
gpl-3.0
4,434
from bottle import route, template, error, request, static_file, get, post from index import get_index from bmarks import get_bmarks from tags import get_tags from add import add_tags from bmarklet import get_bmarklet from account import get_account from edit_tags import get_edit_tags from importbm import get_import_bm from edit import do_edit from login import do_login from register import do_register @route('/') def myroot(): return_data = get_index() return return_data @route('/account', method=['GET', 'POST']) def bmarks(): return_data = get_bmarklet() return return_data @route('/add', method=['GET', 'POST']) def bmarks(): return_data = add_tags() return return_data @route('/bmarklet') def bmarks(): return_data = get_bmarklet() return return_data @route('/bmarks') def bmarks(): return_data = get_bmarks() return return_data @route('/edit', method=['GET', 'POST']) def bmarks(): return_data = do_edit() return return_data @route('/edit_tags', method=['GET', 'POST']) def bmarks(): return_data = get_edit_tags() return return_data @route('/import', method=['GET', 'POST']) def bmarks(): return_data = get_import_bm() return return_data @route('/login', method=['GET', 'POST']) def bmarks(): return_data = do_login() return return_data @route('/register', method=['GET', 'POST']) def bmarks(): return_data = do_register() return return_data @route('/tags') def bmarks(): return_data = get_tags() return return_data # serve css @get('/<filename:re:.*\.css>') def send_css(filename): return static_file(filename, root='css') # serve javascript @get('/<filename:re:.*\.js>') def send_js(filename): return static_file(filename, root='js') # serve images @get('<filename:re:.*\.png>') def send_img(filename): return static_file(filename, root='images') # serve fonts @get('<filename:re:.*\.(woff|woff2)>') def send_font(filename): return static_file(filename, root='fonts') @error(404) def handle404(error): return '<H1>Ooops, its not here<BR>' @error(500) def handle500(error): return '<H1>Oops, its broken:&nbsp;{}<BR>'.format(error)
netllama/tastipy
tastiapp.py
Python
gpl-3.0
2,172
LetsModReboot ============= Learning to mod mc with Pahimar
vdvman1/LetsModReboot
README.md
Markdown
gpl-3.0
61
import com.jogamp.opengl.*; import com.jogamp.opengl.awt.GLJPanel; import com.jogamp.opengl.fixedfunc.GLMatrixFunc; import com.jogamp.opengl.glu.GLU; import javax.swing.*; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import static com.jogamp.opengl.GL.GL_COLOR_BUFFER_BIT; import static com.jogamp.opengl.GL.GL_DEPTH_BUFFER_BIT; /** * This program demonstrates geometric primitives and their attributes. * * @author Kiet Le (Java port) Ported to JOGL 2.x by Claudio Eduardo Goes */ public class LinesDemo// // extends GLSkeleton<GLJPanel> implements GLEventListener, KeyListener { private GLU glu; // public static void main(String[] args) { // final GLCanvas glcanvas = createCanvas(); // // final JFrame frame = new JFrame("Basic Frame"); // // frame.getContentPane().add(glcanvas); // frame.setSize(frame.getContentPane().getPreferredSize()); // frame.setVisible(true); // // frame.repaint(); // } // public static GLCanvas createCanvas() { // final GLProfile profile = GLProfile.get(GLProfile.GL2); // GLCapabilities capabilities = new GLCapabilities(profile); // // final GLCanvas glcanvas = new GLCanvas(capabilities); // LinesDemo b = new LinesDemo(); // glcanvas.addGLEventListener(b); //// glcanvas.setSize(screenSize, screenSize); // // return glcanvas; // } // @Override protected GLJPanel createDrawable() { GLCapabilities caps = new GLCapabilities(null); // GLJPanel panel = new GLJPanel(caps); panel.addGLEventListener(this); panel.addKeyListener(this); return panel; } public void run() { GLJPanel demo = createDrawable(); JFrame.setDefaultLookAndFeelDecorated(true); JFrame frame = new JFrame("LinesDemo"); frame.setSize(400, 150); frame.setLocationRelativeTo(null); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().add(demo); frame.setVisible(true); demo.requestFocusInWindow(); } public static void main(String[] args) { new LinesDemo().run(); } public void init(GLAutoDrawable drawable) { GL2 gl = drawable.getGL().getGL2(); glu = new GLU(); // gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); gl.glShadeModel(GL2.GL_FLAT); } public void display(GLAutoDrawable drawable) { GL2 gl = drawable.getGL().getGL2(); // int i; float coordinateSize = 300; // gl.glClear(GL.GL_COLOR_BUFFER_BIT); gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // gl.glClearColor(1f, 1f, 1f, 1f); // gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION); // gl.glLoadIdentity(); // gl.glOrtho(-coordinateSize, coordinateSize, -coordinateSize, coordinateSize, -1, 1); /* select white for all LinesDemo */ gl.glColor3f(1.0f, 1.0f, 1.0f); /* in 1st row, 3 LinesDemo, each with a different stipple */ gl.glEnable(GL2.GL_LINE_STIPPLE); gl.glEnable(GL2.GL_POINT_SMOOTH); gl.glBegin(GL2.GL_POINTS); gl.glPointSize(10e5f); gl.glVertex2i(200, 200); gl.glEnd(); gl.glDisable(GL2.GL_POINT_SMOOTH); gl.glLineStipple(1, (short) 0x0101); /* dotted */ drawOneLine(gl, 50.0f, 125.0f, 150.0f, 125.0f); gl.glLineStipple(1, (short) 0x00FF); /* dashed */ drawOneLine(gl, 150.0f, 125.0f, 250.0f, 125.0f); drawOneLine(gl, 150.0f, 125.0f, 250.0f, 200f); gl.glLineStipple(1, (short) 0x1C47); /* dash/dot/dash */ drawOneLine(gl, 250.0f, 125.0f, 350.0f, 125.0f); /* in 2nd row, 3 wide LinesDemo, each with different stipple */ gl.glLineWidth(5.0f); gl.glLineStipple(1, (short) 0x0101); /* dotted */ drawOneLine(gl, 50.0f, 100.0f, 150.0f, 100.f); gl.glLineStipple(1, (short) 0x00FF); /* dashed */ drawOneLine(gl, 150.0f, 100.0f, 250.0f, 100.0f); gl.glLineStipple(1, (short) 0x1C47); /* dash/dot/dash */ drawOneLine(gl, 250.0f, 100.0f, 350.0f, 100.0f); gl.glLineWidth(1.0f); /* in 3rd row, 6 LinesDemo, with dash/dot/dash stipple */ /* as part of a single connected line strip */ gl.glLineStipple(1, (short) 0x1C47); /* dash/dot/dash */ gl.glBegin(GL.GL_LINE_STRIP); for (i = 0; i < 7; i++) gl.glVertex2f(50.0f + ((float) i * 50.0f), 75.0f); gl.glEnd(); /* in 4th row, 6 independent LinesDemo with same stipple */ for (i = 0; i < 6; i++) { drawOneLine(gl, 50.0f + ((float) i * 50.0f), 50.0f, 50.0f + ((float) (i + 1) * 50.0f), 50.0f); } /* in 5th row, 1 line, with dash/dot/dash stipple */ /* and a stipple repeat factor of 5 */ gl.glLineStipple(5, (short) 0x1C47); /* dash/dot/dash */ drawOneLine(gl, 50.0f, 25.0f, 350.0f, 25.0f); gl.glDisable(GL2.GL_LINE_STIPPLE); gl.glFlush(); } public void reshape(GLAutoDrawable drawable, int x, int y, int w, int h) { GL2 gl = drawable.getGL().getGL2(); // gl.glViewport(0, 0, w, h); gl.glMatrixMode(GL2.GL_PROJECTION); gl.glLoadIdentity(); glu.gluOrtho2D(0.0, (double) w, 0.0, (double) h); } public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) { } private void drawOneLine(GL2 gl, float x1, float y1, float x2, float y2) { // gl.glBegin(GL.GL_LINES); gl.glVertex2f((x1), (y1)); gl.glVertex2f((x2), (y2)); // gl.glEnd(); } public void keyTyped(KeyEvent key) { } public void keyPressed(KeyEvent key) { switch (key.getKeyCode()) { case KeyEvent.VK_ESCAPE: System.exit(0); break; default: break; } } public void keyReleased(KeyEvent key) { } public void dispose(GLAutoDrawable arg0) { } }
Tiofx/semester_6
CG/src/LinesDemo.java
Java
gpl-3.0
6,151
/*------------------------------------------------------------------------- * * prepjointree.c * Planner preprocessing for subqueries and join tree manipulation. * * NOTE: the intended sequence for invoking these operations is * pull_up_sublinks * inline_set_returning_functions * pull_up_subqueries * do expression preprocessing (including flattening JOIN alias vars) * reduce_outer_joins * * * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION * $PostgreSQL: pgsql/src/backend/optimizer/prep/prepjointree.c,v 1.73 2010/07/06 19:18:56 momjian Exp $ * *------------------------------------------------------------------------- */ #include "postgres.h" #include "catalog/pg_type.h" #include "nodes/makefuncs.h" #include "nodes/nodeFuncs.h" #include "optimizer/clauses.h" #include "optimizer/placeholder.h" #include "optimizer/prep.h" #include "optimizer/subselect.h" #include "optimizer/tlist.h" #include "optimizer/var.h" #include "parser/parse_relation.h" #include "parser/parsetree.h" #include "rewrite/rewriteManip.h" typedef struct pullup_replace_vars_context { PlannerInfo *root; List *targetlist; /* tlist of subquery being pulled up */ RangeTblEntry *target_rte; /* RTE of subquery */ bool *outer_hasSubLinks; /* -> outer query's hasSubLinks */ int varno; /* varno of subquery */ bool need_phvs; /* do we need PlaceHolderVars? */ bool wrap_non_vars; /* do we need 'em on *all* non-Vars? */ Node **rv_cache; /* cache for results with PHVs */ } pullup_replace_vars_context; typedef struct reduce_outer_joins_state { Relids relids; /* base relids within this subtree */ bool contains_outer; /* does subtree contain outer join(s)? */ List *sub_states; /* List of states for subtree components */ } reduce_outer_joins_state; static Node *pull_up_sublinks_jointree_recurse(PlannerInfo *root, Node *jtnode, Relids *relids); static Node *pull_up_sublinks_qual_recurse(PlannerInfo *root, Node *node, Relids available_rels, Node **jtlink); static Node *pull_up_simple_subquery(PlannerInfo *root, Node *jtnode, RangeTblEntry *rte, JoinExpr *lowest_outer_join, AppendRelInfo *containing_appendrel); static Node *pull_up_simple_union_all(PlannerInfo *root, Node *jtnode, RangeTblEntry *rte); static void pull_up_union_leaf_queries(Node *setOp, PlannerInfo *root, int parentRTindex, Query *setOpQuery, int childRToffset); static void make_setop_translation_list(Query *query, Index newvarno, List **translated_vars); static bool is_simple_subquery(Query *subquery); static bool is_simple_union_all(Query *subquery); static bool is_simple_union_all_recurse(Node *setOp, Query *setOpQuery, List *colTypes); static bool is_safe_append_member(Query *subquery); static void replace_vars_in_jointree(Node *jtnode, pullup_replace_vars_context *context, JoinExpr *lowest_outer_join); static Node *pullup_replace_vars(Node *expr, pullup_replace_vars_context *context); static Node *pullup_replace_vars_callback(Var *var, replace_rte_variables_context *context); static reduce_outer_joins_state *reduce_outer_joins_pass1(Node *jtnode); static void reduce_outer_joins_pass2(Node *jtnode, reduce_outer_joins_state *state, PlannerInfo *root, Relids nonnullable_rels, List *nonnullable_vars, List *forced_null_vars); static void substitute_multiple_relids(Node *node, int varno, Relids subrelids); static void fix_append_rel_relids(List *append_rel_list, int varno, Relids subrelids); static Node *find_jointree_node_for_rel(Node *jtnode, int relid); /* * pull_up_sublinks * Attempt to pull up ANY and EXISTS SubLinks to be treated as * semijoins or anti-semijoins. * * A clause "foo op ANY (sub-SELECT)" can be processed by pulling the * sub-SELECT up to become a rangetable entry and treating the implied * comparisons as quals of a semijoin. However, this optimization *only* * works at the top level of WHERE or a JOIN/ON clause, because we cannot * distinguish whether the ANY ought to return FALSE or NULL in cases * involving NULL inputs. Also, in an outer join's ON clause we can only * do this if the sublink is degenerate (ie, references only the nullable * side of the join). In that case it is legal to push the semijoin * down into the nullable side of the join. If the sublink references any * nonnullable-side variables then it would have to be evaluated as part * of the outer join, which makes things way too complicated. * * Under similar conditions, EXISTS and NOT EXISTS clauses can be handled * by pulling up the sub-SELECT and creating a semijoin or anti-semijoin. * * This routine searches for such clauses and does the necessary parsetree * transformations if any are found. * * This routine has to run before preprocess_expression(), so the quals * clauses are not yet reduced to implicit-AND format. That means we need * to recursively search through explicit AND clauses, which are * probably only binary ANDs. We stop as soon as we hit a non-AND item. */ void pull_up_sublinks(PlannerInfo *root) { Node *jtnode; Relids relids; /* Begin recursion through the jointree */ jtnode = pull_up_sublinks_jointree_recurse(root, (Node *) root->parse->jointree, &relids); /* * root->parse->jointree must always be a FromExpr, so insert a dummy one * if we got a bare RangeTblRef or JoinExpr out of the recursion. */ if (IsA(jtnode, FromExpr)) root->parse->jointree = (FromExpr *) jtnode; else root->parse->jointree = makeFromExpr(list_make1(jtnode), NULL); } /* * Recurse through jointree nodes for pull_up_sublinks() * * In addition to returning the possibly-modified jointree node, we return * a relids set of the contained rels into *relids. */ static Node * pull_up_sublinks_jointree_recurse(PlannerInfo *root, Node *jtnode, Relids *relids) { if (jtnode == NULL) { *relids = NULL; } else if (IsA(jtnode, RangeTblRef)) { int varno = ((RangeTblRef *) jtnode)->rtindex; *relids = bms_make_singleton(varno); /* jtnode is returned unmodified */ } else if (IsA(jtnode, FromExpr)) { FromExpr *f = (FromExpr *) jtnode; List *newfromlist = NIL; Relids frelids = NULL; FromExpr *newf; Node *jtlink; ListCell *l; /* First, recurse to process children and collect their relids */ foreach(l, f->fromlist) { Node *newchild; Relids childrelids; newchild = pull_up_sublinks_jointree_recurse(root, lfirst(l), &childrelids); newfromlist = lappend(newfromlist, newchild); frelids = bms_join(frelids, childrelids); } /* Build the replacement FromExpr; no quals yet */ newf = makeFromExpr(newfromlist, NULL); /* Set up a link representing the rebuilt jointree */ jtlink = (Node *) newf; /* Now process qual --- all children are available for use */ newf->quals = pull_up_sublinks_qual_recurse(root, f->quals, frelids, &jtlink); /* * Note that the result will be either newf, or a stack of JoinExprs * with newf at the base. We rely on subsequent optimization steps to * flatten this and rearrange the joins as needed. * * Although we could include the pulled-up subqueries in the returned * relids, there's no need since upper quals couldn't refer to their * outputs anyway. */ *relids = frelids; jtnode = jtlink; } else if (IsA(jtnode, JoinExpr)) { JoinExpr *j; Relids leftrelids; Relids rightrelids; Node *jtlink; /* * Make a modifiable copy of join node, but don't bother copying its * subnodes (yet). */ j = (JoinExpr *) palloc(sizeof(JoinExpr)); memcpy(j, jtnode, sizeof(JoinExpr)); jtlink = (Node *) j; /* Recurse to process children and collect their relids */ j->larg = pull_up_sublinks_jointree_recurse(root, j->larg, &leftrelids); j->rarg = pull_up_sublinks_jointree_recurse(root, j->rarg, &rightrelids); /* * Now process qual, showing appropriate child relids as available, * and attach any pulled-up jointree items at the right place. In the * inner-join case we put new JoinExprs above the existing one (much * as for a FromExpr-style join). In outer-join cases the new * JoinExprs must go into the nullable side of the outer join. The * point of the available_rels machinations is to ensure that we only * pull up quals for which that's okay. * * XXX for the moment, we refrain from pulling up IN/EXISTS clauses * appearing in LEFT or RIGHT join conditions. Although it is * semantically valid to do so under the above conditions, we end up * with a query in which the semijoin or antijoin must be evaluated * below the outer join, which could perform far worse than leaving it * as a sublink that is executed only for row pairs that meet the * other join conditions. Fixing this seems to require considerable * restructuring of the executor, but maybe someday it can happen. * * We don't expect to see any pre-existing JOIN_SEMI or JOIN_ANTI * nodes here. */ switch (j->jointype) { case JOIN_INNER: j->quals = pull_up_sublinks_qual_recurse(root, j->quals, bms_union(leftrelids, rightrelids), &jtlink); break; case JOIN_LEFT: #ifdef NOT_USED /* see XXX comment above */ j->quals = pull_up_sublinks_qual_recurse(root, j->quals, rightrelids, &j->rarg); #endif break; case JOIN_FULL: /* can't do anything with full-join quals */ break; case JOIN_RIGHT: #ifdef NOT_USED /* see XXX comment above */ j->quals = pull_up_sublinks_qual_recurse(root, j->quals, leftrelids, &j->larg); #endif break; default: elog(ERROR, "unrecognized join type: %d", (int) j->jointype); break; } /* * Although we could include the pulled-up subqueries in the returned * relids, there's no need since upper quals couldn't refer to their * outputs anyway. But we *do* need to include the join's own rtindex * because we haven't yet collapsed join alias variables, so upper * levels would mistakenly think they couldn't use references to this * join. */ *relids = bms_join(leftrelids, rightrelids); if (j->rtindex) *relids = bms_add_member(*relids, j->rtindex); jtnode = jtlink; } else elog(ERROR, "unrecognized node type: %d", (int) nodeTag(jtnode)); return jtnode; } /* * Recurse through top-level qual nodes for pull_up_sublinks() * * jtlink points to the link in the jointree where any new JoinExprs should be * inserted. If we find multiple pull-up-able SubLinks, they'll get stacked * there in the order we encounter them. We rely on subsequent optimization * to rearrange the stack if appropriate. */ static Node * pull_up_sublinks_qual_recurse(PlannerInfo *root, Node *node, Relids available_rels, Node **jtlink) { if (node == NULL) return NULL; if (IsA(node, SubLink)) { SubLink *sublink = (SubLink *) node; JoinExpr *j; /* Is it a convertible ANY or EXISTS clause? */ if (sublink->subLinkType == ANY_SUBLINK) { j = convert_ANY_sublink_to_join(root, sublink, available_rels); if (j) { /* Yes, insert the new join node into the join tree */ j->larg = *jtlink; *jtlink = (Node *) j; /* and return NULL representing constant TRUE */ return NULL; } } else if (sublink->subLinkType == EXISTS_SUBLINK) { j = convert_EXISTS_sublink_to_join(root, sublink, false, available_rels); if (j) { /* Yes, insert the new join node into the join tree */ j->larg = *jtlink; *jtlink = (Node *) j; /* and return NULL representing constant TRUE */ return NULL; } } /* Else return it unmodified */ return node; } if (not_clause(node)) { /* If the immediate argument of NOT is EXISTS, try to convert */ SubLink *sublink = (SubLink *) get_notclausearg((Expr *) node); JoinExpr *j; if (sublink && IsA(sublink, SubLink)) { if (sublink->subLinkType == EXISTS_SUBLINK) { j = convert_EXISTS_sublink_to_join(root, sublink, true, available_rels); if (j) { /* Yes, insert the new join node into the join tree */ j->larg = *jtlink; *jtlink = (Node *) j; /* and return NULL representing constant TRUE */ return NULL; } } } /* Else return it unmodified */ return node; } if (and_clause(node)) { /* Recurse into AND clause */ List *newclauses = NIL; ListCell *l; foreach(l, ((BoolExpr *) node)->args) { Node *oldclause = (Node *) lfirst(l); Node *newclause; newclause = pull_up_sublinks_qual_recurse(root, oldclause, available_rels, jtlink); if (newclause) newclauses = lappend(newclauses, newclause); } /* We might have got back fewer clauses than we started with */ if (newclauses == NIL) return NULL; else if (list_length(newclauses) == 1) return (Node *) linitial(newclauses); else return (Node *) make_andclause(newclauses); } /* Stop if not an AND */ return node; } /* * inline_set_returning_functions * Attempt to "inline" set-returning functions in the FROM clause. * * If an RTE_FUNCTION rtable entry invokes a set-returning function that * contains just a simple SELECT, we can convert the rtable entry to an * RTE_SUBQUERY entry exposing the SELECT directly. This is especially * useful if the subquery can then be "pulled up" for further optimization, * but we do it even if not, to reduce executor overhead. * * This has to be done before we have started to do any optimization of * subqueries, else any such steps wouldn't get applied to subqueries * obtained via inlining. However, we do it after pull_up_sublinks * so that we can inline any functions used in SubLink subselects. * * Like most of the planner, this feels free to scribble on its input data * structure. */ void inline_set_returning_functions(PlannerInfo *root) { ListCell *rt; foreach(rt, root->parse->rtable) { RangeTblEntry *rte = (RangeTblEntry *) lfirst(rt); if (rte->rtekind == RTE_FUNCTION) { Query *funcquery; /* Check safety of expansion, and expand if possible */ funcquery = inline_set_returning_function(root, rte); if (funcquery) { /* Successful expansion, replace the rtable entry */ rte->rtekind = RTE_SUBQUERY; rte->subquery = funcquery; rte->funcexpr = NULL; rte->funccoltypes = NIL; rte->funccoltypmods = NIL; } } } } /* * pull_up_subqueries * Look for subqueries in the rangetable that can be pulled up into * the parent query. If the subquery has no special features like * grouping/aggregation then we can merge it into the parent's jointree. * Also, subqueries that are simple UNION ALL structures can be * converted into "append relations". * * If this jointree node is within the nullable side of an outer join, then * lowest_outer_join references the lowest such JoinExpr node; otherwise it * is NULL. This forces use of the PlaceHolderVar mechanism for references * to non-nullable targetlist items, but only for references above that join. * * If we are looking at a member subquery of an append relation, * containing_appendrel describes that relation; else it is NULL. * This forces use of the PlaceHolderVar mechanism for all non-Var targetlist * items, and puts some additional restrictions on what can be pulled up. * * A tricky aspect of this code is that if we pull up a subquery we have * to replace Vars that reference the subquery's outputs throughout the * parent query, including quals attached to jointree nodes above the one * we are currently processing! We handle this by being careful not to * change the jointree structure while recursing: no nodes other than * subquery RangeTblRef entries will be replaced. Also, we can't turn * pullup_replace_vars loose on the whole jointree, because it'll return a * mutated copy of the tree; we have to invoke it just on the quals, instead. * This behavior is what makes it reasonable to pass lowest_outer_join as a * pointer rather than some more-indirect way of identifying the lowest OJ. * Likewise, we don't replace append_rel_list members but only their * substructure, so the containing_appendrel reference is safe to use. */ Node * pull_up_subqueries(PlannerInfo *root, Node *jtnode, JoinExpr *lowest_outer_join, AppendRelInfo *containing_appendrel) { if (jtnode == NULL) return NULL; if (IsA(jtnode, RangeTblRef)) { int varno = ((RangeTblRef *) jtnode)->rtindex; RangeTblEntry *rte = rt_fetch(varno, root->parse->rtable); /* * Is this a subquery RTE, and if so, is the subquery simple enough to * pull up? * * If we are looking at an append-relation member, we can't pull it up * unless is_safe_append_member says so. */ if (rte->rtekind == RTE_SUBQUERY && is_simple_subquery(rte->subquery) && (containing_appendrel == NULL || is_safe_append_member(rte->subquery))) return pull_up_simple_subquery(root, jtnode, rte, lowest_outer_join, containing_appendrel); /* * Alternatively, is it a simple UNION ALL subquery? If so, flatten * into an "append relation". * * It's safe to do this regardless of whether this query is itself an * appendrel member. (If you're thinking we should try to flatten the * two levels of appendrel together, you're right; but we handle that * in set_append_rel_pathlist, not here.) */ if (rte->rtekind == RTE_SUBQUERY && is_simple_union_all(rte->subquery)) return pull_up_simple_union_all(root, jtnode, rte); /* Otherwise, do nothing at this node. */ } else if (IsA(jtnode, FromExpr)) { FromExpr *f = (FromExpr *) jtnode; ListCell *l; Assert(containing_appendrel == NULL); foreach(l, f->fromlist) lfirst(l) = pull_up_subqueries(root, lfirst(l), lowest_outer_join, NULL); } else if (IsA(jtnode, JoinExpr)) { JoinExpr *j = (JoinExpr *) jtnode; Assert(containing_appendrel == NULL); /* Recurse, being careful to tell myself when inside outer join */ switch (j->jointype) { case JOIN_INNER: j->larg = pull_up_subqueries(root, j->larg, lowest_outer_join, NULL); j->rarg = pull_up_subqueries(root, j->rarg, lowest_outer_join, NULL); break; case JOIN_LEFT: case JOIN_SEMI: case JOIN_ANTI: j->larg = pull_up_subqueries(root, j->larg, lowest_outer_join, NULL); j->rarg = pull_up_subqueries(root, j->rarg, j, NULL); break; case JOIN_FULL: j->larg = pull_up_subqueries(root, j->larg, j, NULL); j->rarg = pull_up_subqueries(root, j->rarg, j, NULL); break; case JOIN_RIGHT: j->larg = pull_up_subqueries(root, j->larg, j, NULL); j->rarg = pull_up_subqueries(root, j->rarg, lowest_outer_join, NULL); break; default: elog(ERROR, "unrecognized join type: %d", (int) j->jointype); break; } } else elog(ERROR, "unrecognized node type: %d", (int) nodeTag(jtnode)); return jtnode; } /* * pull_up_simple_subquery * Attempt to pull up a single simple subquery. * * jtnode is a RangeTblRef that has been tentatively identified as a simple * subquery by pull_up_subqueries. We return the replacement jointree node, * or jtnode itself if we determine that the subquery can't be pulled up after * all. * * rte is the RangeTblEntry referenced by jtnode. Remaining parameters are * as for pull_up_subqueries. */ static Node * pull_up_simple_subquery(PlannerInfo *root, Node *jtnode, RangeTblEntry *rte, JoinExpr *lowest_outer_join, AppendRelInfo *containing_appendrel) { Query *parse = root->parse; int varno = ((RangeTblRef *) jtnode)->rtindex; Query *subquery; PlannerInfo *subroot; int rtoffset; pullup_replace_vars_context rvcontext; ListCell *lc; /* * Need a modifiable copy of the subquery to hack on. Even if we didn't * sometimes choose not to pull up below, we must do this to avoid * problems if the same subquery is referenced from multiple jointree * items (which can't happen normally, but might after rule rewriting). */ subquery = copyObject(rte->subquery); /* * Create a PlannerInfo data structure for this subquery. * * NOTE: the next few steps should match the first processing in * subquery_planner(). Can we refactor to avoid code duplication, or * would that just make things uglier? */ subroot = makeNode(PlannerInfo); subroot->parse = subquery; subroot->glob = root->glob; subroot->query_level = root->query_level; subroot->parent_root = root->parent_root; subroot->planner_cxt = CurrentMemoryContext; subroot->init_plans = NIL; subroot->cte_plan_ids = NIL; subroot->eq_classes = NIL; subroot->append_rel_list = NIL; subroot->rowMarks = NIL; subroot->hasRecursion = false; subroot->wt_param_id = -1; subroot->non_recursive_plan = NULL; /* No CTEs to worry about */ Assert(subquery->cteList == NIL); /* * Pull up any SubLinks within the subquery's quals, so that we don't * leave unoptimized SubLinks behind. */ if (subquery->hasSubLinks) pull_up_sublinks(subroot); /* * Similarly, inline any set-returning functions in its rangetable. */ inline_set_returning_functions(subroot); /* * Recursively pull up the subquery's subqueries, so that * pull_up_subqueries' processing is complete for its jointree and * rangetable. * * Note: we should pass NULL for containing-join info even if we are * within an outer join in the upper query; the lower query starts with a * clean slate for outer-join semantics. Likewise, we say we aren't * handling an appendrel member. */ subquery->jointree = (FromExpr *) pull_up_subqueries(subroot, (Node *) subquery->jointree, NULL, NULL); /* * Now we must recheck whether the subquery is still simple enough to pull * up. If not, abandon processing it. * * We don't really need to recheck all the conditions involved, but it's * easier just to keep this "if" looking the same as the one in * pull_up_subqueries. */ if (is_simple_subquery(subquery) && (containing_appendrel == NULL || is_safe_append_member(subquery))) { /* good to go */ } else { /* * Give up, return unmodified RangeTblRef. * * Note: The work we just did will be redone when the subquery gets * planned on its own. Perhaps we could avoid that by storing the * modified subquery back into the rangetable, but I'm not gonna risk * it now. */ return jtnode; } /* * Adjust level-0 varnos in subquery so that we can append its rangetable * to upper query's. We have to fix the subquery's append_rel_list as * well. */ rtoffset = list_length(parse->rtable); OffsetVarNodes((Node *) subquery, rtoffset, 0); OffsetVarNodes((Node *) subroot->append_rel_list, rtoffset, 0); /* * Upper-level vars in subquery are now one level closer to their parent * than before. */ IncrementVarSublevelsUp((Node *) subquery, -1, 1); IncrementVarSublevelsUp((Node *) subroot->append_rel_list, -1, 1); /* * The subquery's targetlist items are now in the appropriate form to * insert into the top query, but if we are under an outer join then * non-nullable items may have to be turned into PlaceHolderVars. If we * are dealing with an appendrel member then anything that's not a simple * Var has to be turned into a PlaceHolderVar. Set up appropriate context * data for pullup_replace_vars. */ rvcontext.root = root; rvcontext.targetlist = subquery->targetList; rvcontext.target_rte = rte; rvcontext.outer_hasSubLinks = &parse->hasSubLinks; rvcontext.varno = varno; rvcontext.need_phvs = (lowest_outer_join != NULL || containing_appendrel != NULL); rvcontext.wrap_non_vars = (containing_appendrel != NULL); /* initialize cache array with indexes 0 .. length(tlist) */ rvcontext.rv_cache = palloc0((list_length(subquery->targetList) + 1) * sizeof(Node *)); /* * Replace all of the top query's references to the subquery's outputs * with copies of the adjusted subtlist items, being careful not to * replace any of the jointree structure. (This'd be a lot cleaner if we * could use query_tree_mutator.) We have to use PHVs in the targetList, * returningList, and havingQual, since those are certainly above any * outer join. replace_vars_in_jointree tracks its location in the * jointree and uses PHVs or not appropriately. */ parse->targetList = (List *) pullup_replace_vars((Node *) parse->targetList, &rvcontext); parse->returningList = (List *) pullup_replace_vars((Node *) parse->returningList, &rvcontext); replace_vars_in_jointree((Node *) parse->jointree, &rvcontext, lowest_outer_join); Assert(parse->setOperations == NULL); parse->havingQual = pullup_replace_vars(parse->havingQual, &rvcontext); /* * Replace references in the translated_vars lists of appendrels. When * pulling up an appendrel member, we do not need PHVs in the list of the * parent appendrel --- there isn't any outer join between. Elsewhere, use * PHVs for safety. (This analysis could be made tighter but it seems * unlikely to be worth much trouble.) */ foreach(lc, root->append_rel_list) { AppendRelInfo *appinfo = (AppendRelInfo *) lfirst(lc); bool save_need_phvs = rvcontext.need_phvs; if (appinfo == containing_appendrel) rvcontext.need_phvs = false; appinfo->translated_vars = (List *) pullup_replace_vars((Node *) appinfo->translated_vars, &rvcontext); rvcontext.need_phvs = save_need_phvs; } /* * Replace references in the joinaliasvars lists of join RTEs. * * You might think that we could avoid using PHVs for alias vars of joins * below lowest_outer_join, but that doesn't work because the alias vars * could be referenced above that join; we need the PHVs to be present in * such references after the alias vars get flattened. (It might be worth * trying to be smarter here, someday.) */ foreach(lc, parse->rtable) { RangeTblEntry *otherrte = (RangeTblEntry *) lfirst(lc); if (otherrte->rtekind == RTE_JOIN) otherrte->joinaliasvars = (List *) pullup_replace_vars((Node *) otherrte->joinaliasvars, &rvcontext); } /* * Now append the adjusted rtable entries to upper query. (We hold off * until after fixing the upper rtable entries; no point in running that * code on the subquery ones too.) */ parse->rtable = list_concat(parse->rtable, subquery->rtable); /* * Pull up any FOR UPDATE/SHARE markers, too. (OffsetVarNodes already * adjusted the marker rtindexes, so just concat the lists.) */ parse->rowMarks = list_concat(parse->rowMarks, subquery->rowMarks); /* * We also have to fix the relid sets of any PlaceHolderVar nodes in the * parent query. (This could perhaps be done by pullup_replace_vars(), * but it seems cleaner to use two passes.) Note in particular that any * PlaceHolderVar nodes just created by pullup_replace_vars() will be * adjusted, so having created them with the subquery's varno is correct. * * Likewise, relids appearing in AppendRelInfo nodes have to be fixed. We * already checked that this won't require introducing multiple subrelids * into the single-slot AppendRelInfo structs. */ if (parse->hasSubLinks || root->glob->lastPHId != 0 || root->append_rel_list) { Relids subrelids; subrelids = get_relids_in_jointree((Node *) subquery->jointree, false); substitute_multiple_relids((Node *) parse, varno, subrelids); fix_append_rel_relids(root->append_rel_list, varno, subrelids); } /* * And now add subquery's AppendRelInfos to our list. */ root->append_rel_list = list_concat(root->append_rel_list, subroot->append_rel_list); /* * We don't have to do the equivalent bookkeeping for outer-join info, * because that hasn't been set up yet. placeholder_list likewise. */ Assert(root->join_info_list == NIL); Assert(subroot->join_info_list == NIL); Assert(root->placeholder_list == NIL); Assert(subroot->placeholder_list == NIL); /* * Miscellaneous housekeeping. * * Although replace_rte_variables() faithfully updated parse->hasSubLinks * if it copied any SubLinks out of the subquery's targetlist, we still * could have SubLinks added to the query in the expressions of FUNCTION * and VALUES RTEs copied up from the subquery. So it's necessary to copy * subquery->hasSubLinks anyway. Perhaps this can be improved someday. */ parse->hasSubLinks |= subquery->hasSubLinks; /* * subquery won't be pulled up if it hasAggs or hasWindowFuncs, so no work * needed on those flags */ /* * Return the adjusted subquery jointree to replace the RangeTblRef entry * in parent's jointree. */ return (Node *) subquery->jointree; } /* * pull_up_simple_union_all * Pull up a single simple UNION ALL subquery. * * jtnode is a RangeTblRef that has been identified as a simple UNION ALL * subquery by pull_up_subqueries. We pull up the leaf subqueries and * build an "append relation" for the union set. The result value is just * jtnode, since we don't actually need to change the query jointree. */ static Node * pull_up_simple_union_all(PlannerInfo *root, Node *jtnode, RangeTblEntry *rte) { int varno = ((RangeTblRef *) jtnode)->rtindex; Query *subquery = rte->subquery; int rtoffset; List *rtable; /* * Append the subquery rtable entries to upper query. */ rtoffset = list_length(root->parse->rtable); /* * Append child RTEs to parent rtable. * * Upper-level vars in subquery are now one level closer to their parent * than before. We don't have to worry about offsetting varnos, though, * because any such vars must refer to stuff above the level of the query * we are pulling into. */ rtable = copyObject(subquery->rtable); IncrementVarSublevelsUp_rtable(rtable, -1, 1); root->parse->rtable = list_concat(root->parse->rtable, rtable); /* * Recursively scan the subquery's setOperations tree and add * AppendRelInfo nodes for leaf subqueries to the parent's * append_rel_list. */ Assert(subquery->setOperations); pull_up_union_leaf_queries(subquery->setOperations, root, varno, subquery, rtoffset); /* * Mark the parent as an append relation. */ rte->inh = true; return jtnode; } /* * pull_up_union_leaf_queries -- recursive guts of pull_up_simple_union_all * * Note that setOpQuery is the Query containing the setOp node, whose rtable * is where to look up the RTE if setOp is a RangeTblRef. This is *not* the * same as root->parse, which is the top-level Query we are pulling up into. * * parentRTindex is the appendrel parent's index in root->parse->rtable. * * The child RTEs have already been copied to the parent. childRToffset * tells us where in the parent's range table they were copied. */ static void pull_up_union_leaf_queries(Node *setOp, PlannerInfo *root, int parentRTindex, Query *setOpQuery, int childRToffset) { if (IsA(setOp, RangeTblRef)) { RangeTblRef *rtr = (RangeTblRef *) setOp; int childRTindex; AppendRelInfo *appinfo; /* * Calculate the index in the parent's range table */ childRTindex = childRToffset + rtr->rtindex; /* * Build a suitable AppendRelInfo, and attach to parent's list. */ appinfo = makeNode(AppendRelInfo); appinfo->parent_relid = parentRTindex; appinfo->child_relid = childRTindex; appinfo->parent_reltype = InvalidOid; appinfo->child_reltype = InvalidOid; make_setop_translation_list(setOpQuery, childRTindex, &appinfo->translated_vars); appinfo->parent_reloid = InvalidOid; root->append_rel_list = lappend(root->append_rel_list, appinfo); /* * Recursively apply pull_up_subqueries to the new child RTE. (We * must build the AppendRelInfo first, because this will modify it.) * Note that we can pass NULL for containing-join info even if we're * actually under an outer join, because the child's expressions * aren't going to propagate up above the join. */ rtr = makeNode(RangeTblRef); rtr->rtindex = childRTindex; (void) pull_up_subqueries(root, (Node *) rtr, NULL, appinfo); } else if (IsA(setOp, SetOperationStmt)) { SetOperationStmt *op = (SetOperationStmt *) setOp; /* Recurse to reach leaf queries */ pull_up_union_leaf_queries(op->larg, root, parentRTindex, setOpQuery, childRToffset); pull_up_union_leaf_queries(op->rarg, root, parentRTindex, setOpQuery, childRToffset); } else { elog(ERROR, "unrecognized node type: %d", (int) nodeTag(setOp)); } } /* * make_setop_translation_list * Build the list of translations from parent Vars to child Vars for * a UNION ALL member. (At this point it's just a simple list of * referencing Vars, but if we succeed in pulling up the member * subquery, the Vars will get replaced by pulled-up expressions.) */ static void make_setop_translation_list(Query *query, Index newvarno, List **translated_vars) { List *vars = NIL; ListCell *l; foreach(l, query->targetList) { TargetEntry *tle = (TargetEntry *) lfirst(l); if (tle->resjunk) continue; vars = lappend(vars, makeVar(newvarno, tle->resno, exprType((Node *) tle->expr), exprTypmod((Node *) tle->expr), 0)); } *translated_vars = vars; } /* * is_simple_subquery * Check a subquery in the range table to see if it's simple enough * to pull up into the parent query. */ static bool is_simple_subquery(Query *subquery) { /* * Let's just make sure it's a valid subselect ... */ if (!IsA(subquery, Query) || subquery->commandType != CMD_SELECT || subquery->utilityStmt != NULL || subquery->intoClause != NULL) elog(ERROR, "subquery is bogus"); /* * Can't currently pull up a query with setops (unless it's simple UNION * ALL, which is handled by a different code path). Maybe after querytree * redesign... */ if (subquery->setOperations) return false; /* * Can't pull up a subquery involving grouping, aggregation, sorting, * limiting, or WITH. (XXX WITH could possibly be allowed later) * * We also don't pull up a subquery that has explicit FOR UPDATE/SHARE * clauses, because pullup would cause the locking to occur semantically * higher than it should. Implicit FOR UPDATE/SHARE is okay because in * that case the locking was originally declared in the upper query * anyway. */ if (subquery->hasAggs || subquery->hasWindowFuncs || subquery->groupClause || subquery->havingQual || subquery->sortClause || subquery->distinctClause || subquery->limitOffset || subquery->limitCount || subquery->hasForUpdate || subquery->cteList) return false; /* * Don't pull up a subquery that has any set-returning functions in its * targetlist. Otherwise we might well wind up inserting set-returning * functions into places where they mustn't go, such as quals of higher * queries. */ if (expression_returns_set((Node *) subquery->targetList)) return false; /* * Don't pull up a subquery that has any volatile functions in its * targetlist. Otherwise we might introduce multiple evaluations of these * functions, if they get copied to multiple places in the upper query, * leading to surprising results. (Note: the PlaceHolderVar mechanism * doesn't quite guarantee single evaluation; else we could pull up anyway * and just wrap such items in PlaceHolderVars ...) */ if (contain_volatile_functions((Node *) subquery->targetList)) return false; /* * Hack: don't try to pull up a subquery with an empty jointree. * query_planner() will correctly generate a Result plan for a jointree * that's totally empty, but I don't think the right things happen if an * empty FromExpr appears lower down in a jointree. It would pose a * problem for the PlaceHolderVar mechanism too, since we'd have no way to * identify where to evaluate a PHV coming out of the subquery. Not worth * working hard on this, just to collapse SubqueryScan/Result into Result; * especially since the SubqueryScan can often be optimized away by * setrefs.c anyway. */ if (subquery->jointree->fromlist == NIL) return false; return true; } /* * is_simple_union_all * Check a subquery to see if it's a simple UNION ALL. * * We require all the setops to be UNION ALL (no mixing) and there can't be * any datatype coercions involved, ie, all the leaf queries must emit the * same datatypes. */ static bool is_simple_union_all(Query *subquery) { SetOperationStmt *topop; /* Let's just make sure it's a valid subselect ... */ if (!IsA(subquery, Query) || subquery->commandType != CMD_SELECT || subquery->utilityStmt != NULL || subquery->intoClause != NULL) elog(ERROR, "subquery is bogus"); /* Is it a set-operation query at all? */ topop = (SetOperationStmt *) subquery->setOperations; if (!topop) return false; Assert(IsA(topop, SetOperationStmt)); /* Can't handle ORDER BY, LIMIT/OFFSET, locking, or WITH */ if (subquery->sortClause || subquery->limitOffset || subquery->limitCount || subquery->rowMarks || subquery->cteList) return false; /* Recursively check the tree of set operations */ return is_simple_union_all_recurse((Node *) topop, subquery, topop->colTypes); } static bool is_simple_union_all_recurse(Node *setOp, Query *setOpQuery, List *colTypes) { if (IsA(setOp, RangeTblRef)) { RangeTblRef *rtr = (RangeTblRef *) setOp; RangeTblEntry *rte = rt_fetch(rtr->rtindex, setOpQuery->rtable); Query *subquery = rte->subquery; Assert(subquery != NULL); /* Leaf nodes are OK if they match the toplevel column types */ /* We don't have to compare typmods here */ return tlist_same_datatypes(subquery->targetList, colTypes, true); } else if (IsA(setOp, SetOperationStmt)) { SetOperationStmt *op = (SetOperationStmt *) setOp; /* Must be UNION ALL */ if (op->op != SETOP_UNION || !op->all) return false; /* Recurse to check inputs */ return is_simple_union_all_recurse(op->larg, setOpQuery, colTypes) && is_simple_union_all_recurse(op->rarg, setOpQuery, colTypes); } else { elog(ERROR, "unrecognized node type: %d", (int) nodeTag(setOp)); return false; /* keep compiler quiet */ } } /* * is_safe_append_member * Check a subquery that is a leaf of a UNION ALL appendrel to see if it's * safe to pull up. */ static bool is_safe_append_member(Query *subquery) { FromExpr *jtnode; /* * It's only safe to pull up the child if its jointree contains exactly * one RTE, else the AppendRelInfo data structure breaks. The one base RTE * could be buried in several levels of FromExpr, however. * * Also, the child can't have any WHERE quals because there's no place to * put them in an appendrel. (This is a bit annoying...) If we didn't * need to check this, we'd just test whether get_relids_in_jointree() * yields a singleton set, to be more consistent with the coding of * fix_append_rel_relids(). */ jtnode = subquery->jointree; while (IsA(jtnode, FromExpr)) { if (jtnode->quals != NULL) return false; if (list_length(jtnode->fromlist) != 1) return false; jtnode = linitial(jtnode->fromlist); } if (!IsA(jtnode, RangeTblRef)) return false; return true; } /* * Helper routine for pull_up_subqueries: do pullup_replace_vars on every * expression in the jointree, without changing the jointree structure itself. * Ugly, but there's no other way... * * If we are at or below lowest_outer_join, we can suppress use of * PlaceHolderVars wrapped around the replacement expressions. */ static void replace_vars_in_jointree(Node *jtnode, pullup_replace_vars_context *context, JoinExpr *lowest_outer_join) { if (jtnode == NULL) return; if (IsA(jtnode, RangeTblRef)) { /* nothing to do here */ } else if (IsA(jtnode, FromExpr)) { FromExpr *f = (FromExpr *) jtnode; ListCell *l; foreach(l, f->fromlist) replace_vars_in_jointree(lfirst(l), context, lowest_outer_join); f->quals = pullup_replace_vars(f->quals, context); } else if (IsA(jtnode, JoinExpr)) { JoinExpr *j = (JoinExpr *) jtnode; bool save_need_phvs = context->need_phvs; if (j == lowest_outer_join) { /* no more PHVs in or below this join */ context->need_phvs = false; lowest_outer_join = NULL; } replace_vars_in_jointree(j->larg, context, lowest_outer_join); replace_vars_in_jointree(j->rarg, context, lowest_outer_join); j->quals = pullup_replace_vars(j->quals, context); /* * We don't bother to update the colvars list, since it won't be used * again ... */ context->need_phvs = save_need_phvs; } else elog(ERROR, "unrecognized node type: %d", (int) nodeTag(jtnode)); } /* * Apply pullup variable replacement throughout an expression tree * * Returns a modified copy of the tree, so this can't be used where we * need to do in-place replacement. */ static Node * pullup_replace_vars(Node *expr, pullup_replace_vars_context *context) { return replace_rte_variables(expr, context->varno, 0, pullup_replace_vars_callback, (void *) context, context->outer_hasSubLinks); } static Node * pullup_replace_vars_callback(Var *var, replace_rte_variables_context *context) { pullup_replace_vars_context *rcon = (pullup_replace_vars_context *) context->callback_arg; int varattno = var->varattno; Node *newnode; /* * If PlaceHolderVars are needed, we cache the modified expressions in * rcon->rv_cache[]. This is not in hopes of any material speed gain * within this function, but to avoid generating identical PHVs with * different IDs. That would result in duplicate evaluations at runtime, * and possibly prevent optimizations that rely on recognizing different * references to the same subquery output as being equal(). So it's worth * a bit of extra effort to avoid it. */ if (rcon->need_phvs && varattno >= InvalidAttrNumber && varattno <= list_length(rcon->targetlist) && rcon->rv_cache[varattno] != NULL) { /* Just copy the entry and fall through to adjust its varlevelsup */ newnode = copyObject(rcon->rv_cache[varattno]); } else if (varattno == InvalidAttrNumber) { /* Must expand whole-tuple reference into RowExpr */ RowExpr *rowexpr; List *colnames; List *fields; bool save_need_phvs = rcon->need_phvs; int save_sublevelsup = context->sublevels_up; /* * If generating an expansion for a var of a named rowtype (ie, this * is a plain relation RTE), then we must include dummy items for * dropped columns. If the var is RECORD (ie, this is a JOIN), then * omit dropped columns. Either way, attach column names to the * RowExpr for use of ruleutils.c. * * In order to be able to cache the results, we always generate the * expansion with varlevelsup = 0, and then adjust if needed. */ expandRTE(rcon->target_rte, var->varno, 0 /* not varlevelsup */ , var->location, (var->vartype != RECORDOID), &colnames, &fields); /* Adjust the generated per-field Vars, but don't insert PHVs */ rcon->need_phvs = false; context->sublevels_up = 0; /* to match the expandRTE output */ fields = (List *) replace_rte_variables_mutator((Node *) fields, context); rcon->need_phvs = save_need_phvs; context->sublevels_up = save_sublevelsup; rowexpr = makeNode(RowExpr); rowexpr->args = fields; rowexpr->row_typeid = var->vartype; rowexpr->row_format = COERCE_IMPLICIT_CAST; rowexpr->colnames = colnames; rowexpr->location = var->location; newnode = (Node *) rowexpr; /* * Insert PlaceHolderVar if needed. Notice that we are wrapping one * PlaceHolderVar around the whole RowExpr, rather than putting one * around each element of the row. This is because we need the * expression to yield NULL, not ROW(NULL,NULL,...) when it is forced * to null by an outer join. */ if (rcon->need_phvs) { /* RowExpr is certainly not strict, so always need PHV */ newnode = (Node *) make_placeholder_expr(rcon->root, (Expr *) newnode, bms_make_singleton(rcon->varno)); /* cache it with the PHV, and with varlevelsup still zero */ rcon->rv_cache[InvalidAttrNumber] = copyObject(newnode); } } else { /* Normal case referencing one targetlist element */ TargetEntry *tle = get_tle_by_resno(rcon->targetlist, varattno); if (tle == NULL) /* shouldn't happen */ elog(ERROR, "could not find attribute %d in subquery targetlist", varattno); /* Make a copy of the tlist item to return */ newnode = copyObject(tle->expr); /* Insert PlaceHolderVar if needed */ if (rcon->need_phvs) { bool wrap; if (newnode && IsA(newnode, Var) && ((Var *) newnode)->varlevelsup == 0) { /* Simple Vars always escape being wrapped */ wrap = false; } else if (rcon->wrap_non_vars) { /* Wrap all non-Vars in a PlaceHolderVar */ wrap = true; } else { /* * If it contains a Var of current level, and does not contain * any non-strict constructs, then it's certainly nullable and * we don't need to insert a PlaceHolderVar. (Note: in future * maybe we should insert PlaceHolderVars anyway, when a tlist * item is expensive to evaluate? */ if (contain_vars_of_level((Node *) newnode, 0) && !contain_nonstrict_functions((Node *) newnode)) { /* No wrap needed */ wrap = false; } else { /* Else wrap it in a PlaceHolderVar */ wrap = true; } } if (wrap) newnode = (Node *) make_placeholder_expr(rcon->root, (Expr *) newnode, bms_make_singleton(rcon->varno)); /* * Cache it if possible (ie, if the attno is in range, which it * probably always should be). We can cache the value even if we * decided we didn't need a PHV, since this result will be * suitable for any request that has need_phvs. */ if (varattno > InvalidAttrNumber && varattno <= list_length(rcon->targetlist)) rcon->rv_cache[varattno] = copyObject(newnode); } } /* Must adjust varlevelsup if tlist item is from higher query */ if (var->varlevelsup > 0) IncrementVarSublevelsUp(newnode, var->varlevelsup, 0); return newnode; } /* * reduce_outer_joins * Attempt to reduce outer joins to plain inner joins. * * The idea here is that given a query like * SELECT ... FROM a LEFT JOIN b ON (...) WHERE b.y = 42; * we can reduce the LEFT JOIN to a plain JOIN if the "=" operator in WHERE * is strict. The strict operator will always return NULL, causing the outer * WHERE to fail, on any row where the LEFT JOIN filled in NULLs for b's * columns. Therefore, there's no need for the join to produce null-extended * rows in the first place --- which makes it a plain join not an outer join. * (This scenario may not be very likely in a query written out by hand, but * it's reasonably likely when pushing quals down into complex views.) * * More generally, an outer join can be reduced in strength if there is a * strict qual above it in the qual tree that constrains a Var from the * nullable side of the join to be non-null. (For FULL joins this applies * to each side separately.) * * Another transformation we apply here is to recognize cases like * SELECT ... FROM a LEFT JOIN b ON (a.x = b.y) WHERE b.y IS NULL; * If the join clause is strict for b.y, then only null-extended rows could * pass the upper WHERE, and we can conclude that what the query is really * specifying is an anti-semijoin. We change the join type from JOIN_LEFT * to JOIN_ANTI. The IS NULL clause then becomes redundant, and must be * removed to prevent bogus selectivity calculations, but we leave it to * distribute_qual_to_rels to get rid of such clauses. * * Also, we get rid of JOIN_RIGHT cases by flipping them around to become * JOIN_LEFT. This saves some code here and in some later planner routines, * but the main reason to do it is to not need to invent a JOIN_REVERSE_ANTI * join type. * * To ease recognition of strict qual clauses, we require this routine to be * run after expression preprocessing (i.e., qual canonicalization and JOIN * alias-var expansion). */ void reduce_outer_joins(PlannerInfo *root) { reduce_outer_joins_state *state; /* * To avoid doing strictness checks on more quals than necessary, we want * to stop descending the jointree as soon as there are no outer joins * below our current point. This consideration forces a two-pass process. * The first pass gathers information about which base rels appear below * each side of each join clause, and about whether there are outer * join(s) below each side of each join clause. The second pass examines * qual clauses and changes join types as it descends the tree. */ state = reduce_outer_joins_pass1((Node *) root->parse->jointree); /* planner.c shouldn't have called me if no outer joins */ if (state == NULL || !state->contains_outer) elog(ERROR, "so where are the outer joins?"); reduce_outer_joins_pass2((Node *) root->parse->jointree, state, root, NULL, NIL, NIL); } /* * reduce_outer_joins_pass1 - phase 1 data collection * * Returns a state node describing the given jointree node. */ static reduce_outer_joins_state * reduce_outer_joins_pass1(Node *jtnode) { reduce_outer_joins_state *result; result = (reduce_outer_joins_state *) palloc(sizeof(reduce_outer_joins_state)); result->relids = NULL; result->contains_outer = false; result->sub_states = NIL; if (jtnode == NULL) return result; if (IsA(jtnode, RangeTblRef)) { int varno = ((RangeTblRef *) jtnode)->rtindex; result->relids = bms_make_singleton(varno); } else if (IsA(jtnode, FromExpr)) { FromExpr *f = (FromExpr *) jtnode; ListCell *l; foreach(l, f->fromlist) { reduce_outer_joins_state *sub_state; sub_state = reduce_outer_joins_pass1(lfirst(l)); result->relids = bms_add_members(result->relids, sub_state->relids); result->contains_outer |= sub_state->contains_outer; result->sub_states = lappend(result->sub_states, sub_state); } } else if (IsA(jtnode, JoinExpr)) { JoinExpr *j = (JoinExpr *) jtnode; reduce_outer_joins_state *sub_state; /* join's own RT index is not wanted in result->relids */ if (IS_OUTER_JOIN(j->jointype)) result->contains_outer = true; sub_state = reduce_outer_joins_pass1(j->larg); result->relids = bms_add_members(result->relids, sub_state->relids); result->contains_outer |= sub_state->contains_outer; result->sub_states = lappend(result->sub_states, sub_state); sub_state = reduce_outer_joins_pass1(j->rarg); result->relids = bms_add_members(result->relids, sub_state->relids); result->contains_outer |= sub_state->contains_outer; result->sub_states = lappend(result->sub_states, sub_state); } else elog(ERROR, "unrecognized node type: %d", (int) nodeTag(jtnode)); return result; } /* * reduce_outer_joins_pass2 - phase 2 processing * * jtnode: current jointree node * state: state data collected by phase 1 for this node * root: toplevel planner state * nonnullable_rels: set of base relids forced non-null by upper quals * nonnullable_vars: list of Vars forced non-null by upper quals * forced_null_vars: list of Vars forced null by upper quals */ static void reduce_outer_joins_pass2(Node *jtnode, reduce_outer_joins_state *state, PlannerInfo *root, Relids nonnullable_rels, List *nonnullable_vars, List *forced_null_vars) { /* * pass 2 should never descend as far as an empty subnode or base rel, * because it's only called on subtrees marked as contains_outer. */ if (jtnode == NULL) elog(ERROR, "reached empty jointree"); if (IsA(jtnode, RangeTblRef)) elog(ERROR, "reached base rel"); else if (IsA(jtnode, FromExpr)) { FromExpr *f = (FromExpr *) jtnode; ListCell *l; ListCell *s; Relids pass_nonnullable_rels; List *pass_nonnullable_vars; List *pass_forced_null_vars; /* Scan quals to see if we can add any constraints */ pass_nonnullable_rels = find_nonnullable_rels(f->quals); pass_nonnullable_rels = bms_add_members(pass_nonnullable_rels, nonnullable_rels); /* NB: we rely on list_concat to not damage its second argument */ pass_nonnullable_vars = find_nonnullable_vars(f->quals); pass_nonnullable_vars = list_concat(pass_nonnullable_vars, nonnullable_vars); pass_forced_null_vars = find_forced_null_vars(f->quals); pass_forced_null_vars = list_concat(pass_forced_null_vars, forced_null_vars); /* And recurse --- but only into interesting subtrees */ Assert(list_length(f->fromlist) == list_length(state->sub_states)); forboth(l, f->fromlist, s, state->sub_states) { reduce_outer_joins_state *sub_state = lfirst(s); if (sub_state->contains_outer) reduce_outer_joins_pass2(lfirst(l), sub_state, root, pass_nonnullable_rels, pass_nonnullable_vars, pass_forced_null_vars); } bms_free(pass_nonnullable_rels); /* can't so easily clean up var lists, unfortunately */ } else if (IsA(jtnode, JoinExpr)) { JoinExpr *j = (JoinExpr *) jtnode; int rtindex = j->rtindex; JoinType jointype = j->jointype; reduce_outer_joins_state *left_state = linitial(state->sub_states); reduce_outer_joins_state *right_state = lsecond(state->sub_states); List *local_nonnullable_vars = NIL; bool computed_local_nonnullable_vars = false; /* Can we simplify this join? */ switch (jointype) { case JOIN_INNER: break; case JOIN_LEFT: if (bms_overlap(nonnullable_rels, right_state->relids)) jointype = JOIN_INNER; break; case JOIN_RIGHT: if (bms_overlap(nonnullable_rels, left_state->relids)) jointype = JOIN_INNER; break; case JOIN_FULL: if (bms_overlap(nonnullable_rels, left_state->relids)) { if (bms_overlap(nonnullable_rels, right_state->relids)) jointype = JOIN_INNER; else jointype = JOIN_LEFT; } else { if (bms_overlap(nonnullable_rels, right_state->relids)) jointype = JOIN_RIGHT; } break; case JOIN_SEMI: case JOIN_ANTI: /* * These could only have been introduced by pull_up_sublinks, * so there's no way that upper quals could refer to their * righthand sides, and no point in checking. */ break; default: elog(ERROR, "unrecognized join type: %d", (int) jointype); break; } /* * Convert JOIN_RIGHT to JOIN_LEFT. Note that in the case where we * reduced JOIN_FULL to JOIN_RIGHT, this will mean the JoinExpr no * longer matches the internal ordering of any CoalesceExpr's built to * represent merged join variables. We don't care about that at * present, but be wary of it ... */ if (jointype == JOIN_RIGHT) { Node *tmparg; tmparg = j->larg; j->larg = j->rarg; j->rarg = tmparg; jointype = JOIN_LEFT; right_state = linitial(state->sub_states); left_state = lsecond(state->sub_states); } /* * See if we can reduce JOIN_LEFT to JOIN_ANTI. This is the case if * the join's own quals are strict for any var that was forced null by * higher qual levels. NOTE: there are other ways that we could * detect an anti-join, in particular if we were to check whether Vars * coming from the RHS must be non-null because of table constraints. * That seems complicated and expensive though (in particular, one * would have to be wary of lower outer joins). For the moment this * seems sufficient. */ if (jointype == JOIN_LEFT) { List *overlap; local_nonnullable_vars = find_nonnullable_vars(j->quals); computed_local_nonnullable_vars = true; /* * It's not sufficient to check whether local_nonnullable_vars and * forced_null_vars overlap: we need to know if the overlap * includes any RHS variables. */ overlap = list_intersection(local_nonnullable_vars, forced_null_vars); if (overlap != NIL && bms_overlap(pull_varnos((Node *) overlap), right_state->relids)) jointype = JOIN_ANTI; } /* Apply the jointype change, if any, to both jointree node and RTE */ if (rtindex && jointype != j->jointype) { RangeTblEntry *rte = rt_fetch(rtindex, root->parse->rtable); Assert(rte->rtekind == RTE_JOIN); Assert(rte->jointype == j->jointype); rte->jointype = jointype; } j->jointype = jointype; /* Only recurse if there's more to do below here */ if (left_state->contains_outer || right_state->contains_outer) { Relids local_nonnullable_rels; List *local_forced_null_vars; Relids pass_nonnullable_rels; List *pass_nonnullable_vars; List *pass_forced_null_vars; /* * If this join is (now) inner, we can add any constraints its * quals provide to those we got from above. But if it is outer, * we can pass down the local constraints only into the nullable * side, because an outer join never eliminates any rows from its * non-nullable side. Also, there is no point in passing upper * constraints into the nullable side, since if there were any * we'd have been able to reduce the join. (In the case of upper * forced-null constraints, we *must not* pass them into the * nullable side --- they either applied here, or not.) The upshot * is that we pass either the local or the upper constraints, * never both, to the children of an outer join. * * At a FULL join we just punt and pass nothing down --- is it * possible to be smarter? */ if (jointype != JOIN_FULL) { local_nonnullable_rels = find_nonnullable_rels(j->quals); if (!computed_local_nonnullable_vars) local_nonnullable_vars = find_nonnullable_vars(j->quals); local_forced_null_vars = find_forced_null_vars(j->quals); if (jointype == JOIN_INNER) { /* OK to merge upper and local constraints */ local_nonnullable_rels = bms_add_members(local_nonnullable_rels, nonnullable_rels); local_nonnullable_vars = list_concat(local_nonnullable_vars, nonnullable_vars); local_forced_null_vars = list_concat(local_forced_null_vars, forced_null_vars); } } else { /* no use in calculating these */ local_nonnullable_rels = NULL; local_forced_null_vars = NIL; } if (left_state->contains_outer) { if (jointype == JOIN_INNER) { /* pass union of local and upper constraints */ pass_nonnullable_rels = local_nonnullable_rels; pass_nonnullable_vars = local_nonnullable_vars; pass_forced_null_vars = local_forced_null_vars; } else if (jointype != JOIN_FULL) /* ie, LEFT/SEMI/ANTI */ { /* can't pass local constraints to non-nullable side */ pass_nonnullable_rels = nonnullable_rels; pass_nonnullable_vars = nonnullable_vars; pass_forced_null_vars = forced_null_vars; } else { /* no constraints pass through JOIN_FULL */ pass_nonnullable_rels = NULL; pass_nonnullable_vars = NIL; pass_forced_null_vars = NIL; } reduce_outer_joins_pass2(j->larg, left_state, root, pass_nonnullable_rels, pass_nonnullable_vars, pass_forced_null_vars); } if (right_state->contains_outer) { if (jointype != JOIN_FULL) /* ie, INNER/LEFT/SEMI/ANTI */ { /* pass appropriate constraints, per comment above */ pass_nonnullable_rels = local_nonnullable_rels; pass_nonnullable_vars = local_nonnullable_vars; pass_forced_null_vars = local_forced_null_vars; } else { /* no constraints pass through JOIN_FULL */ pass_nonnullable_rels = NULL; pass_nonnullable_vars = NIL; pass_forced_null_vars = NIL; } reduce_outer_joins_pass2(j->rarg, right_state, root, pass_nonnullable_rels, pass_nonnullable_vars, pass_forced_null_vars); } bms_free(local_nonnullable_rels); } } else elog(ERROR, "unrecognized node type: %d", (int) nodeTag(jtnode)); } /* * substitute_multiple_relids - adjust node relid sets after pulling up * a subquery * * Find any PlaceHolderVar nodes in the given tree that reference the * pulled-up relid, and change them to reference the replacement relid(s). * We do not need to recurse into subqueries, since no subquery of the current * top query could (yet) contain such a reference. * * NOTE: although this has the form of a walker, we cheat and modify the * nodes in-place. This should be OK since the tree was copied by * pullup_replace_vars earlier. Avoid scribbling on the original values of * the bitmapsets, though, because expression_tree_mutator doesn't copy those. */ typedef struct { int varno; Relids subrelids; } substitute_multiple_relids_context; static bool substitute_multiple_relids_walker(Node *node, substitute_multiple_relids_context *context) { if (node == NULL) return false; if (IsA(node, PlaceHolderVar)) { PlaceHolderVar *phv = (PlaceHolderVar *) node; if (bms_is_member(context->varno, phv->phrels)) { phv->phrels = bms_union(phv->phrels, context->subrelids); phv->phrels = bms_del_member(phv->phrels, context->varno); } /* fall through to examine children */ } /* Shouldn't need to handle planner auxiliary nodes here */ Assert(!IsA(node, SpecialJoinInfo)); Assert(!IsA(node, AppendRelInfo)); Assert(!IsA(node, PlaceHolderInfo)); return expression_tree_walker(node, substitute_multiple_relids_walker, (void *) context); } static void substitute_multiple_relids(Node *node, int varno, Relids subrelids) { substitute_multiple_relids_context context; context.varno = varno; context.subrelids = subrelids; /* * Must be prepared to start with a Query or a bare expression tree. */ query_or_expression_tree_walker(node, substitute_multiple_relids_walker, (void *) &context, 0); } /* * fix_append_rel_relids: update RT-index fields of AppendRelInfo nodes * * When we pull up a subquery, any AppendRelInfo references to the subquery's * RT index have to be replaced by the substituted relid (and there had better * be only one). We also need to apply substitute_multiple_relids to their * translated_vars lists, since those might contain PlaceHolderVars. * * We assume we may modify the AppendRelInfo nodes in-place. */ static void fix_append_rel_relids(List *append_rel_list, int varno, Relids subrelids) { ListCell *l; int subvarno = -1; /* * We only want to extract the member relid once, but we mustn't fail * immediately if there are multiple members; it could be that none of the * AppendRelInfo nodes refer to it. So compute it on first use. Note that * bms_singleton_member will complain if set is not singleton. */ foreach(l, append_rel_list) { AppendRelInfo *appinfo = (AppendRelInfo *) lfirst(l); /* The parent_relid shouldn't ever be a pullup target */ Assert(appinfo->parent_relid != varno); if (appinfo->child_relid == varno) { if (subvarno < 0) subvarno = bms_singleton_member(subrelids); appinfo->child_relid = subvarno; } /* Also finish fixups for its translated vars */ substitute_multiple_relids((Node *) appinfo->translated_vars, varno, subrelids); } } /* * get_relids_in_jointree: get set of RT indexes present in a jointree * * If include_joins is true, join RT indexes are included; if false, * only base rels are included. */ Relids get_relids_in_jointree(Node *jtnode, bool include_joins) { Relids result = NULL; if (jtnode == NULL) return result; if (IsA(jtnode, RangeTblRef)) { int varno = ((RangeTblRef *) jtnode)->rtindex; result = bms_make_singleton(varno); } else if (IsA(jtnode, FromExpr)) { FromExpr *f = (FromExpr *) jtnode; ListCell *l; foreach(l, f->fromlist) { result = bms_join(result, get_relids_in_jointree(lfirst(l), include_joins)); } } else if (IsA(jtnode, JoinExpr)) { JoinExpr *j = (JoinExpr *) jtnode; result = get_relids_in_jointree(j->larg, include_joins); result = bms_join(result, get_relids_in_jointree(j->rarg, include_joins)); if (include_joins && j->rtindex) result = bms_add_member(result, j->rtindex); } else elog(ERROR, "unrecognized node type: %d", (int) nodeTag(jtnode)); return result; } /* * get_relids_for_join: get set of base RT indexes making up a join */ Relids get_relids_for_join(PlannerInfo *root, int joinrelid) { Node *jtnode; jtnode = find_jointree_node_for_rel((Node *) root->parse->jointree, joinrelid); if (!jtnode) elog(ERROR, "could not find join node %d", joinrelid); return get_relids_in_jointree(jtnode, false); } /* * find_jointree_node_for_rel: locate jointree node for a base or join RT index * * Returns NULL if not found */ static Node * find_jointree_node_for_rel(Node *jtnode, int relid) { if (jtnode == NULL) return NULL; if (IsA(jtnode, RangeTblRef)) { int varno = ((RangeTblRef *) jtnode)->rtindex; if (relid == varno) return jtnode; } else if (IsA(jtnode, FromExpr)) { FromExpr *f = (FromExpr *) jtnode; ListCell *l; foreach(l, f->fromlist) { jtnode = find_jointree_node_for_rel(lfirst(l), relid); if (jtnode) return jtnode; } } else if (IsA(jtnode, JoinExpr)) { JoinExpr *j = (JoinExpr *) jtnode; if (relid == j->rtindex) return jtnode; jtnode = find_jointree_node_for_rel(j->larg, relid); if (jtnode) return jtnode; jtnode = find_jointree_node_for_rel(j->rarg, relid); if (jtnode) return jtnode; } else elog(ERROR, "unrecognized node type: %d", (int) nodeTag(jtnode)); return NULL; }
TextusData/Mover
thirdparty/postgresql-9.0.1/src/backend/optimizer/prep/prepjointree.c
C
gpl-3.0
66,368
/* * This is a plugin for GIMP. * * Copyright (C) 1997 Xavier Bouchoux * * 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/>. * */ /* * This plug-in produces sinus textures. * * Please send any patches or suggestions to me: [email protected]. */ /* Version 0.99 */ #include "config.h" #include <libgimp/gimp.h> #include <libgimp/gimpui.h> #include "libgimp/stdplugins-intl.h" #define PLUG_IN_PROC "plug-in-sinus" #define PLUG_IN_BINARY "sinus" #define PLUG_IN_ROLE "gimp-sinus" /* * This structure is used for persistent data. */ #define B_W 0L /* colors setting */ #define USE_FG_BG 1L #define USE_COLORS 2L #define LINEAR 0L /* colorization settings */ #define BILINEAR 1L #define SINUS 2L #define IDEAL 0L /* Perturbation settings */ #define PERTURBED 1L typedef struct { gdouble scalex; gdouble scaley; gdouble cmplx; gdouble blend_power; guint32 seed; gint tiling; glong perturbation; glong colorization; glong colors; GimpRGB col1; GimpRGB col2; gboolean random_seed; } SinusVals; static SinusVals svals = { 15.0, 15.0, 1.0, 0.0, 42, TRUE, PERTURBED, LINEAR, USE_COLORS, { 1.0, 1.0, 0.0, 1.0 }, { 0.0, 0.0, 1.0, 1.0 }, FALSE }; typedef struct { gint height, width; gdouble c11, c12, c13, c21, c22, c23, c31, c32, c33; gdouble (*blend) (double ); guchar r, g, b, a; gint dr, dg, db, da; } params; typedef struct { gint width; gint height; gint bpp; gdouble scale; guchar *bits; } mwPreview; static gboolean drawable_is_grayscale = FALSE; static mwPreview *thePreview; static GimpDrawable *drawable; /* preview stuff -- to be removed as soon as we have a real libgimp preview */ #define PREVIEW_SIZE 100 static gboolean do_preview = TRUE; static GtkWidget * mw_preview_new (GtkWidget *parent, mwPreview *mwp); static mwPreview * mw_preview_build_virgin (GimpDrawable *drw); /* Declare functions */ static void query (void); static void run (const gchar *name, gint nparams, const GimpParam *param, gint *nreturn_vals, GimpParam **return_vals); static void sinus (void); static gdouble linear (gdouble v); static gdouble bilinear (gdouble v); static gdouble cosinus (gdouble v); static gint sinus_dialog (void); static void sinus_do_preview (GtkWidget *widget); static void assign_block_4 (guchar *dest, gdouble grey, params *p); static void assign_block_3 (guchar *dest, gdouble grey, params *p); static void assign_block_2 (guchar *dest, gdouble grey, params *p); static void assign_block_1 (guchar *dest, gdouble grey, params *p); static void compute_block_x (guchar *dest_row, guint rowstride, gint x0, gint y0, gint w, gint h, gint bpp, void (*assign)(guchar *dest, gdouble grey, params *p), params *p); const GimpPlugInInfo PLUG_IN_INFO = { NULL, /* init_proc */ NULL, /* quit_proc */ query, /* query_proc */ run, /* run_proc */ }; MAIN () static void query (void) { static const GimpParamDef args[] = { { GIMP_PDB_INT32, "run-mode", "The run mode { RUN-INTERACTIVE (0), RUN-NONINTERACTIVE (1) }" }, { GIMP_PDB_IMAGE, "image", "Input image (unused)" }, { GIMP_PDB_DRAWABLE, "drawable", "Input drawable" }, { GIMP_PDB_FLOAT, "xscale", "Scale value for x axis" }, { GIMP_PDB_FLOAT, "yscale", "Scale value dor y axis" }, { GIMP_PDB_FLOAT, "complex", "Complexity factor" }, { GIMP_PDB_INT32, "seed", "Seed value for random number generator" }, { GIMP_PDB_INT32, "tiling", "If set, the pattern generated will tile" }, { GIMP_PDB_INT32, "perturb", "If set, the pattern is a little more distorted..." }, { GIMP_PDB_INT32, "colors", "where to take the colors (0= B&W, 1= fg/bg, 2= col1/col2)"}, { GIMP_PDB_COLOR, "col1", "fist color (sometimes unused)" }, { GIMP_PDB_COLOR, "col2", "second color (sometimes unused)" }, { GIMP_PDB_FLOAT, "alpha1", "alpha for the first color (used if the drawable has an alpha chanel)" }, { GIMP_PDB_FLOAT, "alpha2", "alpha for the second color (used if the drawable has an alpha chanel)" }, { GIMP_PDB_INT32, "blend", "0= linear, 1= bilinear, 2= sinusoidal" }, { GIMP_PDB_FLOAT, "blend-power", "Power used to strech the blend" } }; gimp_install_procedure (PLUG_IN_PROC, N_("Generate complex sinusoidal textures"), "FIX ME: sinus help", "Xavier Bouchoux", "Xavier Bouchoux", "1997", N_("_Sinus..."), "RGB*, GRAY*", GIMP_PLUGIN, G_N_ELEMENTS (args), 0, args, NULL); gimp_plugin_menu_register (PLUG_IN_PROC, "<Image>/Filters/Render/Pattern"); } static void run (const gchar *name, gint nparams, const GimpParam *param, gint *nreturn_vals, GimpParam **return_vals) { static GimpParam values[1]; GimpRunMode run_mode; GimpPDBStatusType status = GIMP_PDB_SUCCESS; run_mode = param[0].data.d_int32; *nreturn_vals = 1; *return_vals = values; values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = status; INIT_I18N (); switch (run_mode) { case GIMP_RUN_INTERACTIVE: /* Possibly retrieve data */ gimp_get_data (PLUG_IN_PROC, &svals); /* In order to prepare the dialog I need to know whether it's grayscale or not */ drawable = gimp_drawable_get (param[2].data.d_drawable); thePreview = mw_preview_build_virgin(drawable); drawable_is_grayscale = gimp_drawable_is_gray (drawable->drawable_id); if (! sinus_dialog ()) return; break; case GIMP_RUN_NONINTERACTIVE: /* Make sure all the arguments are there! */ if (nparams != 17) { status = GIMP_PDB_CALLING_ERROR; } else { svals.scalex = param[3].data.d_float; svals.scaley = param[4].data.d_float; svals.cmplx = param[5].data.d_float; svals.seed = param[6].data.d_int32; svals.tiling = param[7].data.d_int32; svals.perturbation = param[8].data.d_int32; svals.colors = param[9].data.d_int32; svals.col1 = param[10].data.d_color; svals.col2 = param[11].data.d_color; gimp_rgb_set_alpha (&svals.col1, param[12].data.d_float); gimp_rgb_set_alpha (&svals.col2, param[13].data.d_float); svals.colorization = param[14].data.d_int32; svals.blend_power = param[15].data.d_float; if (svals.random_seed) svals.seed = g_random_int (); } break; case GIMP_RUN_WITH_LAST_VALS: /* Possibly retrieve data */ gimp_get_data (PLUG_IN_PROC, &svals); if (svals.random_seed) svals.seed = g_random_int (); break; default: break; } /* Get the specified drawable */ drawable = gimp_drawable_get (param[2].data.d_drawable); /* Make sure that the drawable is gray or RGB */ if ((status == GIMP_PDB_SUCCESS) && (gimp_drawable_is_rgb (drawable->drawable_id) || gimp_drawable_is_gray (drawable->drawable_id))) { gimp_progress_init (_("Sinus: rendering")); gimp_tile_cache_ntiles (1); sinus (); if (run_mode != GIMP_RUN_NONINTERACTIVE) gimp_displays_flush (); /* Store data */ if (run_mode == GIMP_RUN_INTERACTIVE) gimp_set_data (PLUG_IN_PROC, &svals, sizeof (SinusVals)); } else { status = GIMP_PDB_EXECUTION_ERROR; } values[0].data.d_status = status; gimp_drawable_detach (drawable); } /* * Main procedure */ static void prepare_coef (params *p) { GimpRGB color1; GimpRGB color2; gdouble scalex = svals.scalex; gdouble scaley = svals.scaley; GRand *gr; gr = g_rand_new (); g_rand_set_seed (gr, svals.seed); switch (svals.colorization) { case BILINEAR: p->blend = bilinear; break; case SINUS: p->blend = cosinus; break; case LINEAR: default: p->blend = linear; } if (svals.perturbation==IDEAL) { /* Presumably the 0 * g_rand_int ()s are to pop random * values off the prng, I don't see why though. */ p->c11= 0 * g_rand_int (gr); p->c12= g_rand_double_range (gr, -1, 1) * scaley; p->c13= g_rand_double_range (gr, 0, 2 * G_PI); p->c21= 0 * g_rand_int (gr); p->c22= g_rand_double_range (gr, -1, 1) * scaley; p->c23= g_rand_double_range (gr, 0, 2 * G_PI); p->c31= g_rand_double_range (gr, -1, 1) * scalex; p->c32= 0 * g_rand_int (gr); p->c33= g_rand_double_range (gr, 0, 2 * G_PI); } else { p->c11= g_rand_double_range (gr, -1, 1) * scalex; p->c12= g_rand_double_range (gr, -1, 1) * scaley; p->c13= g_rand_double_range (gr, 0, 2 * G_PI); p->c21= g_rand_double_range (gr, -1, 1) * scalex; p->c22= g_rand_double_range (gr, -1, 1) * scaley; p->c23= g_rand_double_range (gr, 0, 2 * G_PI); p->c31= g_rand_double_range (gr, -1, 1) * scalex; p->c32= g_rand_double_range (gr, -1, 1) * scaley; p->c33= g_rand_double_range (gr, 0, 2 * G_PI); } if (svals.tiling) { p->c11= ROUND (p->c11/(2*G_PI))*2*G_PI; p->c12= ROUND (p->c12/(2*G_PI))*2*G_PI; p->c21= ROUND (p->c21/(2*G_PI))*2*G_PI; p->c22= ROUND (p->c22/(2*G_PI))*2*G_PI; p->c31= ROUND (p->c31/(2*G_PI))*2*G_PI; p->c32= ROUND (p->c32/(2*G_PI))*2*G_PI; } color1 = svals.col1; color2 = svals.col2; if (drawable_is_grayscale) { gimp_rgb_set (&color1, 1.0, 1.0, 1.0); gimp_rgb_set (&color2, 0.0, 0.0, 0.0); } else { switch (svals.colors) { case USE_COLORS: break; case B_W: gimp_rgb_set (&color1, 1.0, 1.0, 1.0); gimp_rgb_set (&color2, 0.0, 0.0, 0.0); break; case USE_FG_BG: gimp_context_get_background (&color1); gimp_context_get_foreground (&color2); break; } } gimp_rgba_get_uchar (&color1, &p->r, &p->g, &p->b, &p->a); gimp_rgba_subtract (&color2, &color1); p->dr = color2.r * 255.0; p->dg = color2.g * 255.0; p->db = color2.b * 255.0; p->da = color2.a * 255.0; g_rand_free (gr); } static void sinus (void) { params p; gint bytes; GimpPixelRgn dest_rgn; gint x1, y1, x2, y2; gpointer pr; gint progress, max_progress; prepare_coef(&p); gimp_drawable_mask_bounds(drawable->drawable_id, &x1, &y1, &x2, &y2); p.width = drawable->width; p.height = drawable->height; bytes = drawable->bpp; gimp_pixel_rgn_init (&dest_rgn, drawable, x1, y1, x2 - x1, y2 - y1, TRUE,TRUE); progress = 0; max_progress = (x2 - x1) * (y2 - y1); for (pr = gimp_pixel_rgns_register (1, &dest_rgn); pr != NULL; pr = gimp_pixel_rgns_process (pr)) { switch (bytes) { case 4: compute_block_x (dest_rgn.data, dest_rgn.rowstride, dest_rgn.x, dest_rgn.y, dest_rgn.w, dest_rgn.h, 4, assign_block_4, &p); break; case 3: compute_block_x (dest_rgn.data, dest_rgn.rowstride, dest_rgn.x, dest_rgn.y, dest_rgn.w, dest_rgn.h, 3, assign_block_3, &p); break; case 2: compute_block_x (dest_rgn.data, dest_rgn.rowstride, dest_rgn.x, dest_rgn.y, dest_rgn.w, dest_rgn.h, 2, assign_block_2, &p); break; case 1: compute_block_x (dest_rgn.data, dest_rgn.rowstride, dest_rgn.x, dest_rgn.y, dest_rgn.w, dest_rgn.h, 1, assign_block_1, &p); break; } progress += dest_rgn.w * dest_rgn.h; gimp_progress_update ((double) progress / (double) max_progress); } gimp_progress_update (1.0); gimp_drawable_flush (drawable); gimp_drawable_merge_shadow (drawable->drawable_id, TRUE); gimp_drawable_update (drawable->drawable_id, x1, y1, x2 - x1, y2 - y1); } static gdouble linear (gdouble v) { double a = v - (int) v; return (a < 0 ? 1.0 + a : a); } static gdouble bilinear (gdouble v) { double a = v - (int) v; a = (a < 0 ? 1.0 + a : a); return (a > 0.5 ? 2 - 2 * a : 2 * a); } static gdouble cosinus (gdouble v) { return 0.5 - 0.5 * sin ((v + 0.25) * G_PI * 2); } static void assign_block_4 (guchar *dest, gdouble grey, params *p) { dest[0] = p->r + (gint) (grey * p->dr); dest[1] = p->g + (gint) (grey * p->dg); dest[2] = p->b + (gint) (grey * p->db); dest[3] = p->a + (gint) (grey * p->da); } static void assign_block_3 (guchar *dest, gdouble grey, params *p) { dest[0] = p->r + (gint) (grey * p->dr); dest[1] = p->g + (gint) (grey * p->dg); dest[2] = p->b + (gint) (grey * p->db); } static void assign_block_2 (guchar *dest, gdouble grey, params *p) { dest[0] = (guchar) (grey * 255.0); dest[1] = p->a + (gint)(grey * p->da); } static void assign_block_1 (guchar *dest, gdouble grey, params *p) { dest[0]= (guchar) (grey * 255.0); } static void compute_block_x (guchar *dest_row, guint rowstride, gint x0, gint y0, gint w, gint h, gint bpp, void (*assign)(guchar *dest, gdouble grey, params *p), params *p) { gint i, j; gdouble x, y, grey; gdouble pow_exp; guchar *dest; pow_exp = exp (svals.blend_power); for (j = y0; j < y0 + h; j++) { y= ((gdouble) j) / p->height; dest = dest_row; for (i = x0; i < x0 + w; i++) { gdouble c; x = ((gdouble) i) / p->width; c = 0.5 * sin(p->c31 * x + p->c32 * y + p->c33); grey = sin(p->c11 * x + p->c12 * y + p->c13) * (0.5 + 0.5 * c) + sin(p->c21 * x + p->c22 * y + p->c23) * (0.5 - 0.5 * c); grey = pow(p->blend(svals.cmplx * (0.5 + 0.5 * grey)), pow_exp); assign (dest, grey, p); dest += bpp; } dest_row += rowstride; } } static void alpha_scale_cb (GtkAdjustment *adj, gpointer data) { GimpColorButton *color_button; GimpRGB color; if (!data) return; color_button = GIMP_COLOR_BUTTON (data); gimp_color_button_get_color (GIMP_COLOR_BUTTON (color_button), &color); gimp_rgb_set_alpha (&color, gtk_adjustment_get_value (adj)); gimp_color_button_set_color (GIMP_COLOR_BUTTON (color_button), &color); } static void alpha_scale_update (GtkWidget *color_button, gpointer data) { GtkAdjustment *adj; GimpRGB color; adj = GTK_ADJUSTMENT (data); gimp_color_button_get_color (GIMP_COLOR_BUTTON (color_button), &color); gtk_adjustment_set_value (adj, color.a); sinus_do_preview (NULL); } static void sinus_toggle_button_update (GtkWidget *widget, gpointer data) { gimp_toggle_button_update (widget, data); sinus_do_preview (NULL); } static void sinus_radio_button_update (GtkWidget *widget, gpointer data) { gimp_radio_button_update (widget, data); sinus_do_preview (NULL); } static void sinus_double_adjustment_update (GtkAdjustment *adjustment, gpointer data) { gimp_double_adjustment_update (adjustment, data); sinus_do_preview (NULL); } static void sinus_random_update (GObject *unused, gpointer data) { sinus_do_preview (NULL); } /*****************************************/ /* The note book */ /*****************************************/ static gint sinus_dialog (void) { GtkWidget *dlg; GtkWidget *main_hbox; GtkWidget *preview; GtkWidget *notebook; GtkWidget *page; GtkWidget *frame; GtkWidget *label; GtkWidget *vbox; GtkWidget *vbox2; GtkWidget *hbox; GtkWidget *table; GtkWidget *toggle; GtkWidget *push_col1 = NULL; GtkWidget *push_col2 = NULL; GtkAdjustment *adj; gboolean run; gimp_ui_init (PLUG_IN_BINARY, TRUE); /* Create Main window with a vbox */ /* ============================== */ dlg = gimp_dialog_new (_("Sinus"), PLUG_IN_ROLE, NULL, 0, gimp_standard_help_func, PLUG_IN_PROC, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); gtk_dialog_set_alternative_button_order (GTK_DIALOG (dlg), GTK_RESPONSE_OK, GTK_RESPONSE_CANCEL, -1); gimp_window_set_transient (GTK_WINDOW (dlg)); main_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12); gtk_container_set_border_width (GTK_CONTAINER (main_hbox), 12); gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))), main_hbox, TRUE, TRUE, 0); gtk_widget_show (main_hbox); /* Create preview */ /* ============== */ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); gtk_box_pack_start (GTK_BOX (main_hbox), vbox, FALSE, FALSE, 0); gtk_widget_show (vbox); preview = mw_preview_new (vbox, thePreview); /* Create the notebook */ /* =================== */ notebook = gtk_notebook_new (); gtk_notebook_set_tab_pos (GTK_NOTEBOOK (notebook), GTK_POS_TOP); gtk_box_pack_start (GTK_BOX (main_hbox), notebook, FALSE, FALSE, 0); gtk_widget_show (notebook); /* Create the drawing settings frame */ /* ================================= */ page = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); gtk_container_set_border_width (GTK_CONTAINER (page), 12); frame = gimp_frame_new (_("Drawing Settings")); gtk_box_pack_start (GTK_BOX (page), frame, FALSE, FALSE, 0); gtk_widget_show (frame); table = gtk_table_new (3, 3, FALSE); gtk_table_set_col_spacings (GTK_TABLE (table), 6); gtk_table_set_row_spacings (GTK_TABLE (table), 6); gtk_container_add (GTK_CONTAINER(frame), table); adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0, _("_X scale:"), 140, 8, svals.scalex, 0.0001, 100.0, 0.0001, 5, 4, TRUE, 0, 0, NULL, NULL); g_signal_connect (adj, "value-changed", G_CALLBACK (sinus_double_adjustment_update), &svals.scalex); adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1, _("_Y scale:"), 140, 8, svals.scaley, 0.0001, 100.0, 0.0001, 5, 4, TRUE, 0, 0, NULL, NULL); g_signal_connect (adj, "value-changed", G_CALLBACK (sinus_double_adjustment_update), &svals.scaley); adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 2, _("Co_mplexity:"), 140, 8, svals.cmplx, 0.0, 15.0, 0.01, 5, 2, TRUE, 0, 0, NULL, NULL); g_signal_connect (adj, "value-changed", G_CALLBACK (sinus_double_adjustment_update), &svals.cmplx); gtk_widget_show (table); frame= gimp_frame_new (_("Calculation Settings")); gtk_box_pack_start (GTK_BOX (page), frame, FALSE, FALSE, 0); gtk_widget_show (frame); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); gtk_container_add (GTK_CONTAINER (frame), vbox); gtk_widget_show (vbox); table = gtk_table_new (3, 1, FALSE); gtk_table_set_col_spacings (GTK_TABLE (table), 6); gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0); hbox = gimp_random_seed_new (&svals.seed, &svals.random_seed); label = gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, _("R_andom seed:"), 1.0, 0.5, hbox, 1, TRUE); gtk_label_set_mnemonic_widget (GTK_LABEL (label), GIMP_RANDOM_SEED_SPINBUTTON (hbox)); g_signal_connect (GIMP_RANDOM_SEED_SPINBUTTON_ADJ (hbox), "value-changed", G_CALLBACK (sinus_random_update), NULL); gtk_widget_show (table); toggle = gtk_check_button_new_with_mnemonic (_("_Force tiling?")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), svals.tiling); gtk_box_pack_start (GTK_BOX (vbox), toggle, FALSE, FALSE, 0); gtk_widget_show (toggle); g_signal_connect (toggle, "toggled", G_CALLBACK (sinus_toggle_button_update), &svals.tiling); vbox2 = gimp_int_radio_group_new (FALSE, NULL, G_CALLBACK (sinus_radio_button_update), &svals.perturbation, svals.perturbation, _("_Ideal"), IDEAL, NULL, _("_Distorted"), PERTURBED, NULL, NULL); gtk_box_pack_start (GTK_BOX (vbox), vbox2, FALSE, FALSE, 0); gtk_widget_show (vbox2); label = gtk_label_new_with_mnemonic (_("_Settings")); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); gtk_widget_show (page); /* Color settings dialog: */ /* ====================== */ page = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); gtk_container_set_border_width (GTK_CONTAINER (page), 12); if (drawable_is_grayscale) { frame = gimp_frame_new (_("Colors")); gtk_box_pack_start(GTK_BOX(page), frame, FALSE, FALSE, 0); gtk_widget_show (frame); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); gtk_container_add (GTK_CONTAINER (frame), vbox); gtk_widget_show (vbox); /*if in grey scale, the colors are necessarily black and white */ label = gtk_label_new (_("The colors are white and black.")); gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); gtk_widget_show (label); } else { frame = gimp_int_radio_group_new (TRUE, _("Colors"), G_CALLBACK (sinus_radio_button_update), &svals.colors, svals.colors, _("Bl_ack & white"), B_W, NULL, _("_Foreground & background"), USE_FG_BG, NULL, _("C_hoose here:"), USE_COLORS, NULL, NULL); gtk_box_pack_start(GTK_BOX(page), frame, FALSE, FALSE, 0); gtk_widget_show (frame); vbox = gtk_bin_get_child (GTK_BIN (frame)); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); push_col1 = gimp_color_button_new (_("First color"), 32, 32, &svals.col1, GIMP_COLOR_AREA_SMALL_CHECKS); gtk_box_pack_start (GTK_BOX (hbox), push_col1, FALSE, FALSE, 0); gtk_widget_show (push_col1); g_signal_connect (push_col1, "color-changed", G_CALLBACK (gimp_color_button_get_color), &svals.col1); push_col2 = gimp_color_button_new (_("Second color"), 32, 32, &svals.col2, GIMP_COLOR_AREA_SMALL_CHECKS); gtk_box_pack_start (GTK_BOX (hbox), push_col2, FALSE, FALSE, 0); gtk_widget_show (push_col2); g_signal_connect (push_col2, "color-changed", G_CALLBACK (gimp_color_button_get_color), &svals.col2); gtk_widget_show (hbox); } frame = gimp_frame_new (_("Alpha Channels")); gtk_box_pack_start (GTK_BOX (page), frame, FALSE, FALSE, 0); gtk_widget_show (frame); gtk_widget_set_sensitive (frame, gimp_drawable_has_alpha (drawable->drawable_id)); table = gtk_table_new (2, 3, FALSE); gtk_table_set_col_spacings (GTK_TABLE (table), 6); gtk_table_set_row_spacings (GTK_TABLE (table), 6); gtk_container_add (GTK_CONTAINER (frame), table); adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0, _("F_irst color:"), 0, 0, svals.col1.a, 0.0, 1.0, 0.01, 0.1, 2, TRUE, 0, 0, NULL, NULL); g_signal_connect (adj, "value-changed", G_CALLBACK (alpha_scale_cb), push_col1); if (push_col1) g_signal_connect (push_col1, "color-changed", G_CALLBACK (alpha_scale_update), adj); adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1, _("S_econd color:"), 0, 0, svals.col2.a, 0.0, 1.0, 0.01, 0.1, 2, TRUE, 0, 0, NULL, NULL); g_signal_connect (adj, "value-changed", G_CALLBACK (alpha_scale_cb), push_col2); if (push_col2) g_signal_connect (push_col2, "color-changed", G_CALLBACK (alpha_scale_update), adj); gtk_widget_show (table); label = gtk_label_new_with_mnemonic (_("Co_lors")); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); gtk_widget_show (page); /* blend settings dialog: */ /* ====================== */ page = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); gtk_container_set_border_width (GTK_CONTAINER (page), 12); frame = gimp_frame_new (_("Blend Settings")); gtk_box_pack_start (GTK_BOX (page), frame, TRUE, TRUE, 0); gtk_widget_show (frame); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); gtk_container_add (GTK_CONTAINER (frame), vbox); gtk_widget_show (vbox); frame = gimp_int_radio_group_new (TRUE, _("Gradient"), G_CALLBACK (sinus_radio_button_update), &svals.colorization, svals.colorization, _("L_inear"), LINEAR, NULL, _("Bili_near"), BILINEAR, NULL, _("Sin_usoidal"), SINUS, NULL, NULL); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); table = gtk_table_new (1, 3, FALSE); gtk_table_set_col_spacings (GTK_TABLE (table), 6); gtk_box_pack_start (GTK_BOX (vbox), table, TRUE, TRUE, 0); adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0, _("_Exponent:"), 0, 0, svals.blend_power, -7.5, 7.5, 0.01, 5.0, 2, TRUE, 0, 0, NULL, NULL); g_signal_connect (adj, "value-changed", G_CALLBACK (sinus_double_adjustment_update), &svals.blend_power); gtk_widget_show (table); label = gtk_label_new_with_mnemonic (_("_Blend")); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label); gtk_widget_show (page); gtk_widget_show (dlg); sinus_do_preview (preview); run = (gimp_dialog_run (GIMP_DIALOG (dlg)) == GTK_RESPONSE_OK); gtk_widget_destroy (dlg); return run; } /******************************************************************/ /* Draw preview image. if DoCompute is TRUE then recompute image. */ /******************************************************************/ static void sinus_do_preview (GtkWidget *widget) { static GtkWidget *theWidget = NULL; gint rowsize; guchar *buf; params p; if (!do_preview) return; if (theWidget == NULL) { theWidget = widget; } rowsize = thePreview->width * thePreview->bpp; buf = g_new (guchar, thePreview->width*thePreview->height*thePreview->bpp); p.height = thePreview->height; p.width = thePreview->width; prepare_coef (&p); if (thePreview->bpp == 3) /* [dindinx]: it looks to me that this is always true... */ compute_block_x (buf, rowsize, 0, 0, thePreview->width, thePreview->height, 3, assign_block_3, &p); else if (thePreview->bpp == 1) { compute_block_x (buf, rowsize, 0, 0, thePreview->width, thePreview->height, 1, assign_block_1, &p); } gimp_preview_area_draw (GIMP_PREVIEW_AREA (theWidget), 0, 0, thePreview->width, thePreview->height, GIMP_RGB_IMAGE, buf, rowsize); g_free (buf); } static void mw_preview_toggle_callback (GtkWidget *widget, gpointer data) { gimp_toggle_button_update (widget, data); sinus_do_preview (NULL); } static mwPreview * mw_preview_build_virgin (GimpDrawable *drw) { mwPreview *mwp; mwp = g_new (mwPreview, 1); if (drw->width > drw->height) { mwp->scale = (gdouble) drw->width / (gdouble) PREVIEW_SIZE; mwp->width = PREVIEW_SIZE; mwp->height = drw->height / mwp->scale; } else { mwp->scale = (gdouble) drw->height / (gdouble) PREVIEW_SIZE; mwp->height = PREVIEW_SIZE; mwp->width = drw->width / mwp->scale; } mwp->bpp = 3; mwp->bits = NULL; return mwp; } static GtkWidget * mw_preview_new (GtkWidget *parent, mwPreview *mwp) { GtkWidget *preview; GtkWidget *frame; GtkWidget *vbox; GtkWidget *button; vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); gtk_box_pack_start (GTK_BOX (parent), vbox, FALSE, FALSE, 0); gtk_widget_show (vbox); frame = gtk_aspect_frame_new (NULL, 0.5, 0.5, 1, TRUE); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_widget_show (frame); preview = gimp_preview_area_new (); gtk_widget_set_size_request (preview, mwp->width, mwp->height); gtk_container_add (GTK_CONTAINER (frame), preview); gtk_widget_show (preview); button = gtk_check_button_new_with_mnemonic (_("Do _preview")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), do_preview); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); gtk_widget_show (button); g_signal_connect (button, "toggled", G_CALLBACK (mw_preview_toggle_callback), &do_preview); return preview; }
brion/gimp
plug-ins/common/sinus.c
C
gpl-3.0
32,096
<?php // This file is part of Moodle - http://moodle.org/ // // Moodle 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. // // Moodle 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 Moodle. If not, see <http://www.gnu.org/licenses/>. /** * @package mod * @subpackage coursework * @copyright 2011 University of London Computer Centre {@link ulcc.ac.uk} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require_once(dirname(__FILE__) . '/../../../../config.php'); global $CFG, $USER; $submissionid = required_param('submissionid', PARAM_INT); $cmid = optional_param('cmid', 0, PARAM_INT); $feedbackid = optional_param('feedbackid', 0, PARAM_INT); $assessorid = optional_param('assessorid', $USER->id, PARAM_INT); $stage_identifier = optional_param('stage_identifier', 'uh-oh', PARAM_RAW); $params = array( 'submissionid' => $submissionid, 'cmid' => $cmid, 'feedbackid' => $feedbackid, 'assessorid' => $assessorid, 'stage_identifier' => $stage_identifier, ); $controller = new mod_coursework\controllers\feedback_controller($params); $controller->new_feedback();
universityofglasgow/moodle
mod/coursework/actions/feedbacks/new.php
PHP
gpl-3.0
1,574
body, html { margin: 0px; background-color: black; overflow: hidden; height: 100%; } canvas[resize] { width: 100%; height: 100%; } #container { display: flex; height: 100vh; align-content: center; align-items: center; position: absolute; top: 0px; } video { flex: 1 1 100vw; align-self: center; width: 100vw; /*transform: translateY(-50%);*/ } .draw { position: absolute; top: 0px; left: 0px; } #render canvas{ width: 100%; height: 100%; position: absolute; top: 0px; left: 0px; } #htmlUI { position: absolute; top: 0px; background: #00AFEF; width: 100vw; height: 100vh; }
alex4o/Graphene
src/css/global.css
CSS
gpl-3.0
618
import java.io.IOException; import java.io.PrintWriter; import java.util.HashMap; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.ofte.services.MetaDataCreations; /** * Servlet implementation class ScheduledTransferRemoteasDestination */ @SuppressWarnings("serial") @WebServlet("/ScheduledTransferRemoteasDestination") public class ScheduledTransferRemoteasDestination extends HttpServlet { // private static final long serialVersionUID = 1L; HashMap<String, String> hashMap = new HashMap<String, String>(); // com.ofte.services.MetaDataCreations metaDataCreations = new // MetaDataCreations(); MetaDataCreations metaDataCreations = new MetaDataCreations(); /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse * response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub // read form fields String schedulername = request.getParameter("schedulername"); // String jobName = request.getParameter("jname"); String sourceDirectory = request.getParameter("sd"); String sourceTriggerPattern = request.getParameter("stp"); String sourceFilePattern = request.getParameter("sfp"); String destinationDirectory = request.getParameter("dd"); String destinationFilePattern = request.getParameter("dfp"); String destinationTriggerPattern = request.getParameter("dtp"); String hostIp = request.getParameter("hostip"); String userName = request.getParameter("username"); String password = request.getParameter("password"); String port = request.getParameter("port"); String pollUnits = request.getParameter("pu"); String pollInterval = request.getParameter("pi"); // String XMLFilePath = request.getParameter("xmlfilename"); HashMap<String, String> hashMap = new HashMap<>(); hashMap.put("-sn", schedulername); // hashMap.put("-jn", jobName); hashMap.put("-sd", sourceDirectory); hashMap.put("-tr", sourceTriggerPattern); hashMap.put("-sfp", sourceFilePattern); hashMap.put("-sftp-d", destinationDirectory); hashMap.put("-trd", destinationTriggerPattern); hashMap.put("-hi", hostIp); hashMap.put("-un", userName); hashMap.put("-pw", password); hashMap.put("-po", port); hashMap.put("-pu", pollUnits); hashMap.put("-pi", pollInterval); hashMap.put("-dfp", destinationFilePattern); // hashMap.put("-gt", XMLFilePath); // System.out.println(hashMap); // System.out.println("username: " + username); // System.out.println("password: " + password); // String str[] = {"-mn "+monitorName,"-jn "+jobName,"-sd // "+sourceDirectory,"-tr "+sourceTriggerPattern,"-sfp // "+sourceFilePattern,"-dd // "+destinationDirectory,destinationFilePattern,"-trd // "+destinationTriggerPattern,"-pu "+pollUnits,"-pi "+pollInterval,"-gt // "+XMLFilePath}; // for(int i=0;i<str.length;i++) { // System.out.println(str[i]); // } try { // metaDataCreations.fetchingUIDetails(hashMap); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } // String string = "-mn "+monitorName+",-jn "+jobName+",-pi // "+pollInterval+",-pu "+pollUnits+",-dd "+destinationDirectory+" "+ // sourceDirectory+",-tr "+sourceTriggerPattern+",-trd // "+destinationTriggerPattern+",-gt "+XMLFilePath+",-sfp // "+sourceFilePattern; // FileWriter fileWriter = new FileWriter("D:\\UIDetails.txt"); // fileWriter.write(string); // fileWriter.close(); Runnable r = new Runnable() { public void run() { // runYourBackgroundTaskHere(); try { metaDataCreations.fetchingUIDetails(hashMap); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } }; new Thread(r).start(); // Example example = new Example(); // hashMap.put("monitorName", monitorName); // example.result("-mn "+monitorName+" -jn "+jobName+" -pi // "+pollInterval+" -pu "+pollUnits+" -dd "+destinationDirectory+" "+ // sourceDirectory+" -tr "+sourceTriggerPattern+" -trd // "+destinationTriggerPattern+" -gt "+XMLFilePath+" -sfp // "+sourceFilePattern); // do some processing here... // get response writer // PrintWriter writer = response.getWriter(); // build HTML code // String htmlRespone = "<html>"; // htmlRespone += "<h2>Your username is: " + username + "<br/>"; // htmlRespone += "Your password is: " + password + "</h2>"; // htmlRespone += "</html>"; // return response // writer.println(htmlRespone); PrintWriter out = response.getWriter(); response.setContentType("text/html"); out.println("<script type=\"text/javascript\">"); out.println("alert('successfully submited');"); out.println( "window.open('http://localhost:8080/TestingUI/Open_OFTE_Scheduled_Transfers_Page.html','_self')"); out.println("</script>"); } }
MithunThadi/OFTE
SourceCode/new ofte with del monitor/servlet/ScheduledTransferRemoteasDestination.java
Java
gpl-3.0
5,035
package xde.lincore.mcscript.math; public enum RoundingMethod { Round, Floor, Ceil, CastInt; public int round(final double value) { switch (this) { case Round: return (int) Math.round(value); case Floor: return (int) Math.floor(value); case Ceil: return (int) Math.ceil(value); case CastInt: return (int) value; default: throw new UnsupportedOperationException(); } } public long roundToLong(final double value) { switch (this) { case Round: return Math.round(value); case Floor: return (long) Math.floor(value); case Ceil: return (long) Math.ceil(value); case CastInt: return (long) value; default: throw new UnsupportedOperationException(); } } }
lincore81/mcscript
ScriptMod/src/xde/lincore/mcscript/math/RoundingMethod.java
Java
gpl-3.0
741
package com.baselet.gwt.client.view; import java.util.List; import com.baselet.control.basics.geom.Rectangle; import com.baselet.control.config.SharedConfig; import com.baselet.control.enums.ElementId; import com.baselet.element.Selector; import com.baselet.element.interfaces.GridElement; import com.baselet.gwt.client.element.ComponentGwt; import com.baselet.gwt.client.element.ElementFactoryGwt; import com.baselet.gwt.client.resources.HelptextFactory; import com.baselet.gwt.client.resources.HelptextResources; import com.google.gwt.canvas.client.Canvas; import com.google.gwt.core.client.GWT; import com.google.gwt.dom.client.CanvasElement; import com.google.gwt.user.client.ui.FocusWidget; public class DrawCanvas { private final Canvas canvas = Canvas.createIfSupported(); /* setScaling can be used to set the size the canvas for the next time draw() is used DISCLAIMER: if scaling is set to anything other than 1, this WILL break the way selected elements are viewed, furthermore the dragging will still remain the same and will not update to the new scale. This function is solely meant to be used for high-res exporting of the diagram */ private double scaling = 1.0d; private boolean scaleHasChangedSinceLastDraw = false; public void setScaling(double scaling) { this.scaling = scaling; scaleHasChangedSinceLastDraw = true; } void draw(boolean drawEmptyInfo, List<GridElement> gridElements, Selector selector, boolean forceRedraw) { if (SharedConfig.getInstance().isDev_mode()) { CanvasUtils.drawGridOn(getContext2d()); } if (drawEmptyInfo && gridElements.isEmpty()) { drawEmptyInfoText(getScaling()); } else { // if (tryOptimizedDrawing()) return; for (GridElement ge : gridElements) { if (forceRedraw) { ((ComponentGwt) ge.getComponent()).afterModelUpdate(); } ((ComponentGwt) ge.getComponent()).drawOn(getContext2d(), selector.isSelected(ge), getScaling()); } } if (selector instanceof SelectorNew && ((SelectorNew) selector).isLassoActive()) { ((SelectorNew) selector).drawLasso(getContext2d()); } } public void draw(boolean drawEmptyInfo, List<GridElement> gridElements, Selector selector) { if (isScaleHasChangedSinceLastDraw()) { draw(drawEmptyInfo, gridElements, selector, true); setScaleHasChangedSinceLastDraw(false); } else { draw(drawEmptyInfo, gridElements, selector, false); } } public double getScaling() { return scaling; } public boolean isScaleHasChangedSinceLastDraw() { return scaleHasChangedSinceLastDraw; } public void setScaleHasChangedSinceLastDraw(boolean scaleHasChangedSinceLastDraw) { this.scaleHasChangedSinceLastDraw = scaleHasChangedSinceLastDraw; } public Context2dWrapper getContext2d() { return new Context2dGwtWrapper(canvas.getContext2d()); } public void clearAndSetSize(int width, int height) { // setCoordinateSpace always clears the canvas. To avoid that see https://groups.google.com/d/msg/google-web-toolkit/dpc84mHeKkA/3EKxrlyFCEAJ canvas.setCoordinateSpaceWidth(width); canvas.setCoordinateSpaceHeight(height); } public String toDataUrl(String type) { return canvas.toDataUrl(type); } public void drawEmptyInfoText(double scaling) { double elWidth = 440; double elHeight = 246; double elXPos = getWidth() / 2.0 - elWidth / 2; double elYPos = getHeight() / 2.0 - elHeight / 2; HelptextFactory factory = GWT.create(HelptextFactory.class); HelptextResources resources = factory.getInstance(); String helptext = resources.helpText().getText(); GridElement emptyElement = ElementFactoryGwt.create(ElementId.Text, new Rectangle(elXPos, elYPos, elWidth, elHeight), helptext, "", null); ((ComponentGwt) emptyElement.getComponent()).drawOn(getContext2d(), false, scaling); } /* used to display temporal invalid if vs code passes a wrong uxf */ void drawInvalidDiagramInfo() { double elWidth = 440; double elHeight = 246; double elXPos = getWidth() / 2.0 - elWidth / 2; double elYPos = getHeight() / 2.0 - elHeight / 2; String invalidDiagramText = "valign=center\n" + "halign=center\n" + ".uxf file is currently invalid and can't be displayed.\n" + "Please revert changes or load a valid file"; GridElement emptyElement = ElementFactoryGwt.create(ElementId.Text, new Rectangle(elXPos, elYPos, elWidth, elHeight), invalidDiagramText, "", null); ((ComponentGwt) emptyElement.getComponent()).drawOn(getContext2d(), false, getScaling()); } public int getWidth() { return canvas.getCoordinateSpaceWidth(); } public int getHeight() { return canvas.getCoordinateSpaceHeight(); } public CanvasElement getCanvasElement() { return canvas.getCanvasElement(); } public FocusWidget getWidget() { return canvas; } // TODO would not work because canvas gets always resized and therefore cleaned -> so everything must be redrawn // private boolean tryOptimizedDrawing() { // List<GridElement> geToRedraw = new ArrayList<GridElement>(); // for (GridElement ge : gridElements) { // if(((GwtComponent) ge.getComponent()).isRedrawNecessary()) { // for (GridElement geRedraw : geToRedraw) { // if (geRedraw.getRectangle().intersects(ge.getRectangle())) { // return false; // } // } // geToRedraw.add(ge); // } // } // // for (GridElement ge : gridElements) { // elementCanvas.getContext2d().clearRect(0, 0, ge.getRectangle().getWidth(), ge.getRectangle().getHeight()); // ((GwtComponent) ge.getComponent()).drawOn(elementCanvas.getContext2d()); // } // return true; // } }
umlet/umlet
umlet-gwt/src/main/java/com/baselet/gwt/client/view/DrawCanvas.java
Java
gpl-3.0
5,538
#!/usr/bin/env python class Message(object): """ Base type of a message sent through the pipeline. Define some attributes and methods to form your message. I suggest you don't alter this class. You're are free to do so, of course. It's your own decision. Though, I suggest you create your own message type and let it inherit from this class. """ pass
lumannnn/pypifi
pypifi/message.py
Python
gpl-3.0
397
/* * WorldEdit, a Minecraft world manipulation toolkit * Copyright (C) sk89q <http://www.sk89q.com> * Copyright (C) WorldEdit team and contributors * * This program 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. * * 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 Lesser General Public License * for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package com.sk89q.worldedit.internal.registry; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.NoMatchException; import java.util.ArrayList; import java.util.List; import static com.google.common.base.Preconditions.checkNotNull; /** * An abstract implementation of a factory for internal usage. * * @param <E> the element that the factory returns */ public abstract class AbstractFactory<E> { protected final WorldEdit worldEdit; protected final List<InputParser<E>> parsers = new ArrayList<InputParser<E>>(); /** * Create a new factory. * * @param worldEdit the WorldEdit instance */ protected AbstractFactory(WorldEdit worldEdit) { checkNotNull(worldEdit); this.worldEdit = worldEdit; } public E parseFromInput(String input, ParserContext context) throws InputParseException { E match; for (InputParser<E> parser : parsers) { match = parser.parseFromInput(input, context); if (match != null) { return match; } } throw new NoMatchException("No match for '" + input + "'"); } }
UnlimitedFreedom/UF-WorldEdit
worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/AbstractFactory.java
Java
gpl-3.0
2,120
# Install dependencies of the cloud_controller component package "libmysqlclient-dev" do action :install end
Altoros/cf-vagrant-installer
chef/cloudfoundry/recipes/cloud_controller.rb
Ruby
gpl-3.0
112
{% extends 'index.html' %} {% load static %} {% load staticfiles %} {% block css %} <link href="/static/tools/style.css" rel="stylesheet" type="text/css" /> <link href="/static/tools/960.css" rel="stylesheet" type="text/css" /> <link href='https://fonts.googleapis.com/css?family=Fjalla+One' rel='stylesheet' type='text/css'> {% endblock %} {% block content %} <div id="shim"></div> <div id="content"> <div class="logo_box"><h1>Portal do Conhecimento<br/>&<br/>CMPaaS</h1></div> <div class="main_box"> <h2>Este serviรงo estรก em construรงรฃo.<br/><span>Estamos trabalhando para disponibilizรก-lo em breve. Vocรช pode ter mais informaรงรตes pelos contatos:</span></h2> <ul class="info"> <li> <h3><i class="fa fa-phone"></i></h3> <p>+55 (27) 4009-2061<br/>+55 (27) 4009-2817<br/>+55 (27) 4009-2124</p> </li> <li> <h3><i class="fa fa-road"></i></h3> <p>Laboratรณrio de Informรกtica na Educaรงรฃo<br/> Departamento de Informรกtica<br/> Universidade Federal do Espรญrito Santo<br/> Av. Fernando Ferrari, 514, 29075-910 - Vitรณria - ES, Brasil</p> </li> <li> <h3><li><a href="https://www.facebook.com/cmpaas/"><i class="fa fa-facebook-square"></i></a> </li></h3> </li> </ul> </div> {% endblock %} {% block javascript %} <script src="/static/js/cufon-yui.js"></script> <script type="text/javascript"> Cufon.replace('h1,h3', {fontFamily: font-family: 'Fjalla One', hover:true}) </script> {% endblock %}
wagnerperin/portal
home/templates/home/underconstruction.html
HTML
gpl-3.0
1,561
<?php /** * @package Mautic * @copyright 2014 Mautic Contributors. All rights reserved. * @author Mautic * @link http://mautic.org * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ namespace Mautic\CampaignBundle\Entity; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; use Mautic\ApiBundle\Serializer\Driver\ApiMetadataDriver; use Mautic\CoreBundle\Doctrine\Mapping\ClassMetadataBuilder; use Mautic\CoreBundle\Entity\FormEntity; use Mautic\FormBundle\Entity\Form; use Mautic\LeadBundle\Entity\LeadList; use Mautic\LeadBundle\Form\Validator\Constraints\LeadListAccess; use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Validator\Mapping\ClassMetadata; /** * Class Campaign * * @package Mautic\CampaignBundle\Entity */ class Campaign extends FormEntity { /** * @var int */ private $id; /** * @var string */ private $name; /** * @var string */ private $description; /** * @var null|\DateTime */ private $publishUp; /** * @var null|\DateTime */ private $publishDown; /** * @var \Mautic\CategoryBundle\Entity\Category **/ private $category; /** * @var ArrayCollection */ private $events; /** * @var ArrayCollection */ private $leads; /** * @var ArrayCollection */ private $lists; /** * @var ArrayCollection */ private $forms; /** * @var array */ private $canvasSettings = array(); /** * Constructor */ public function __construct () { $this->events = new ArrayCollection(); $this->leads = new ArrayCollection(); $this->lists = new ArrayCollection(); $this->forms = new ArrayCollection(); } /** * */ public function __clone() { $this->leads = new ArrayCollection(); $this->events = new ArrayCollection(); $this->lists = new ArrayCollection(); $this->forms = new ArrayCollection(); $this->id = null; parent::__clone(); } /** * @param ORM\ClassMetadata $metadata */ public static function loadMetadata (ORM\ClassMetadata $metadata) { $builder = new ClassMetadataBuilder($metadata); $builder->setTable('campaigns') ->setCustomRepositoryClass('Mautic\CampaignBundle\Entity\CampaignRepository'); $builder->addIdColumns(); $builder->addPublishDates(); $builder->addCategory(); $builder->createOneToMany('events', 'Event') ->setIndexBy('id') ->setOrderBy(array('order' => 'ASC')) ->mappedBy('campaign') ->cascadeAll() ->fetchExtraLazy() ->build(); $builder->createOneToMany('leads', 'Lead') ->setIndexBy('id') ->mappedBy('campaign') ->fetchExtraLazy() ->build(); $builder->createManyToMany('lists', 'Mautic\LeadBundle\Entity\LeadList') ->setJoinTable('campaign_leadlist_xref') ->setIndexBy('id') ->addInverseJoinColumn('leadlist_id', 'id', false, false, 'CASCADE') ->addJoinColumn('campaign_id', 'id', true, false, 'CASCADE') ->build(); $builder->createManyToMany('forms', 'Mautic\FormBundle\Entity\Form') ->setJoinTable('campaign_form_xref') ->setIndexBy('id') ->addInverseJoinColumn('form_id', 'id', false, false, 'CASCADE') ->addJoinColumn('campaign_id', 'id', true, false, 'CASCADE') ->build(); $builder->createField('canvasSettings', 'array') ->columnName('canvas_settings') ->nullable() ->build(); } /** * @param ClassMetadata $metadata */ public static function loadValidatorMetadata (ClassMetadata $metadata) { $metadata->addPropertyConstraint('name', new Assert\NotBlank(array( 'message' => 'mautic.core.name.required' ))); } /** * Prepares the metadata for API usage * * @param $metadata */ public static function loadApiMetadata(ApiMetadataDriver $metadata) { $metadata->setGroupPrefix('campaign') ->addListProperties( array( 'id', 'name', 'category', 'description' ) ) ->addProperties( array( 'publishUp', 'publishDown', 'events', 'leads', 'forms', 'lists', 'canvasSettings' ) ) ->build(); } /** * @return array */ public function convertToArray () { return get_object_vars($this); } /** * @param string $prop * @param mixed $val * * @return void */ protected function isChanged ($prop, $val) { $getter = "get" . ucfirst($prop); $current = $this->$getter(); if ($prop == 'category') { $currentId = ($current) ? $current->getId() : ''; $newId = ($val) ? $val->getId() : null; if ($currentId != $newId) { $this->changes[$prop] = array($currentId, $newId); } } elseif ($current != $val) { $this->changes[$prop] = array($current, $val); } } /** * Get id * * @return integer */ public function getId () { return $this->id; } /** * Set description * * @param string $description * * @return Campaign */ public function setDescription ($description) { $this->isChanged('description', $description); $this->description = $description; return $this; } /** * Get description * * @return string */ public function getDescription () { return $this->description; } /** * Set name * * @param string $name * * @return Campaign */ public function setName ($name) { $this->isChanged('name', $name); $this->name = $name; return $this; } /** * Get name * * @return string */ public function getName () { return $this->name; } /** * Add events * * @param $key * @param \Mautic\CampaignBundle\Entity\Event $event * * @return Campaign */ public function addEvent ($key, Event $event) { if ($changes = $event->getChanges()) { $this->changes['events']['added'][$key] = array($key, $changes); } $this->events[$key] = $event; return $this; } /** * Remove events * * @param \Mautic\CampaignBundle\Entity\Event $event */ public function removeEvent (\Mautic\CampaignBundle\Entity\Event $event) { $this->changes['events']['removed'][$event->getId()] = $event->getName(); $this->events->removeElement($event); } /** * Get events * * @return \Doctrine\Common\Collections\Collection */ public function getEvents () { return $this->events; } /** * Set publishUp * * @param \DateTime $publishUp * * @return Campaign */ public function setPublishUp ($publishUp) { $this->isChanged('publishUp', $publishUp); $this->publishUp = $publishUp; return $this; } /** * Get publishUp * * @return \DateTime */ public function getPublishUp () { return $this->publishUp; } /** * Set publishDown * * @param \DateTime $publishDown * * @return Campaign */ public function setPublishDown ($publishDown) { $this->isChanged('publishDown', $publishDown); $this->publishDown = $publishDown; return $this; } /** * Get publishDown * * @return \DateTime */ public function getPublishDown () { return $this->publishDown; } /** * @return mixed */ public function getCategory () { return $this->category; } /** * @param mixed $category */ public function setCategory ($category) { $this->isChanged('category', $category); $this->category = $category; } /** * Add lead * * @param $key * @param \Mautic\CampaignBundle\Entity\Lead $lead * * @return Campaign */ public function addLead ($key, Lead $lead) { $action = ($this->leads->contains($lead)) ? 'updated' : 'added'; $leadEntity = $lead->getLead(); $this->changes['leads'][$action][$leadEntity->getId()] = $leadEntity->getPrimaryIdentifier(); $this->leads[$key] = $lead; return $this; } /** * Remove lead * * @param Lead $lead */ public function removeLead (Lead $lead) { $leadEntity = $lead->getLead(); $this->changes['leads']['removed'][$leadEntity->getId()] = $leadEntity->getPrimaryIdentifier(); $this->leads->removeElement($lead); } /** * Get leads * * @return \Doctrine\Common\Collections\Collection */ public function getLeads () { return $this->leads; } /** * @return ArrayCollection */ public function getLists () { return $this->lists; } /** * Add list * * @param LeadList $list * @return Campaign */ public function addList(LeadList $list) { $this->lists[] = $list; $this->changes['lists']['added'][$list->getId()] = $list->getName(); return $this; } /** * Remove list * * @param LeadList $list */ public function removeList(LeadList $list) { $this->changes['lists']['removed'][$list->getId()] = $list->getName(); $this->lists->removeElement($list); } /** * @return ArrayCollection */ public function getForms() { return $this->forms; } /** * Add form * * @param Form $form * * @return Campaign */ public function addForm(Form $form) { $this->forms[] = $form; $this->changes['forms']['added'][$form->getId()] = $form->getName(); return $this; } /** * Remove form * * @param Form $form */ public function removeForm(Form $form) { $this->changes['forms']['removed'][$form->getId()] = $form->getName(); $this->forms->removeElement($form); } /** * @return mixed */ public function getCanvasSettings () { return $this->canvasSettings; } /** * @param array $canvasSettings */ public function setCanvasSettings (array $canvasSettings) { $this->canvasSettings = $canvasSettings; } }
mqueme/mautic
app/bundles/CampaignBundle/Entity/Campaign.php
PHP
gpl-3.0
11,416
package com.derpgroup.livefinder.manager; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @JsonIgnoreProperties(ignoreUnknown = true) public class TwitchFollowedStreamsResponse { private TwitchStream[] streams; public TwitchStream[] getStreams() { return streams.clone(); } public void setStreams(TwitchStream[] streams) { this.streams = streams.clone(); } @Override public String toString() { return "TwitchFollowedStreamsResponse [streams=" + Arrays.toString(streams) + "]"; } }
DERP-Group/LiveFinder
service/src/main/java/com/derpgroup/livefinder/manager/TwitchFollowedStreamsResponse.java
Java
gpl-3.0
563
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html> <head> <title>ErrorToken - jgo.tools.compiler.lexer.ErrorToken</title> <meta name="description" content="ErrorToken - jgo.tools.compiler.lexer.ErrorToken" /> <meta name="keywords" content="ErrorToken jgo.tools.compiler.lexer.ErrorToken" /> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <link href="../../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" /> <link href="../../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" /> <script type="text/javascript"> if(top === self) { var url = '../../../../index.html'; var hash = 'jgo.tools.compiler.lexer.ErrorToken'; var anchor = window.location.hash; var anchor_opt = ''; if (anchor.length >= 1) anchor_opt = '@' + anchor.substring(1); window.location.href = url + '#' + hash + anchor_opt; } </script> </head> <body class="type"> <div id="definition"> <img src="../../../../lib/class_big.png" /> <p id="owner"><a href="../../../package.html" class="extype" name="jgo">jgo</a>.<a href="../../package.html" class="extype" name="jgo.tools">tools</a>.<a href="../package.html" class="extype" name="jgo.tools.compiler">compiler</a>.<a href="package.html" class="extype" name="jgo.tools.compiler.lexer">lexer</a></p> <h1>ErrorToken</h1> </div> <h4 id="signature" class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">case class</span> </span> <span class="symbol"> <span class="name">ErrorToken</span><span class="params">(<span name="msg">msg: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="result"> extends <a href="Token.html" class="extype" name="jgo.tools.compiler.lexer.Token">Token</a> with <span class="extype" name="scala.Product">Product</span> with <span class="extype" name="scala.Serializable">Serializable</span></span> </span> </h4> <div id="comment" class="fullcommenttop"><div class="toggleContainer block"> <span class="toggle">Linear Supertypes</span> <div class="superTypes hiddenContent"><span class="extype" name="scala.Serializable">Serializable</span>, <span class="extype" name="java.io.Serializable">Serializable</span>, <span class="extype" name="scala.Product">Product</span>, <span class="extype" name="scala.Equals">Equals</span>, <a href="Token.html" class="extype" name="jgo.tools.compiler.lexer.Token">Token</a>, <span class="extype" name="scala.AnyRef">AnyRef</span>, <span class="extype" name="scala.Any">Any</span></div> </div></div> <div id="mbrsel"> <div id="textfilter"><span class="pre"></span><span class="input"><input id="mbrsel-input" type="text" accesskey="/" /></span><span class="post"></span></div> <div id="order"> <span class="filtertype">Ordering</span> <ol> <li class="alpha in"><span>Alphabetic</span></li> <li class="inherit out"><span>By inheritance</span></li> </ol> </div> <div id="ancestors"> <span class="filtertype">Inherited<br /> </span> <ol id="linearization"> <li class="in" name="jgo.tools.compiler.lexer.ErrorToken"><span>ErrorToken</span></li><li class="in" name="scala.Serializable"><span>Serializable</span></li><li class="in" name="java.io.Serializable"><span>Serializable</span></li><li class="in" name="scala.Product"><span>Product</span></li><li class="in" name="scala.Equals"><span>Equals</span></li><li class="in" name="jgo.tools.compiler.lexer.Token"><span>Token</span></li><li class="in" name="scala.AnyRef"><span>AnyRef</span></li><li class="in" name="scala.Any"><span>Any</span></li> </ol> </div><div id="ancestors"> <span class="filtertype"></span> <ol> <li class="hideall out"><span>Hide All</span></li> <li class="showall in"><span>Show all</span></li> </ol> <a href="http://docs.scala-lang.org/overviews/scaladoc/usage.html#members" target="_blank">Learn more about member selection</a> </div> <div id="visbl"> <span class="filtertype">Visibility</span> <ol><li class="public in"><span>Public</span></li><li class="all out"><span>All</span></li></ol> </div> </div> <div id="template"> <div id="allMembers"> <div id="constructors" class="members"> <h3>Instance Constructors</h3> <ol><li name="jgo.tools.compiler.lexer.ErrorToken#&lt;init&gt;" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped"> <a id="&lt;init&gt;(msg:String):jgo.tools.compiler.lexer.ErrorToken"></a> <a id="&lt;init&gt;:ErrorToken"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">new</span> </span> <span class="symbol"> <span class="name">ErrorToken</span><span class="params">(<span name="msg">msg: <span class="extype" name="scala.Predef.String">String</span></span>)</span> </span> </h4> </li></ol> </div> <div id="values" class="values members"> <h3>Value Members</h3> <ol><li name="scala.AnyRef#!=" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="!=(x$1:AnyRef):Boolean"></a> <a id="!=(AnyRef):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $bang$eq" class="name">!=</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.Any#!=" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="!=(x$1:Any):Boolean"></a> <a id="!=(Any):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $bang$eq" class="name">!=</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div> </li><li name="scala.AnyRef###" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="##():Int"></a> <a id="##():Int"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $hash$hash" class="name">##</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef โ†’ Any</dd></dl></div> </li><li name="scala.AnyRef#==" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="==(x$1:AnyRef):Boolean"></a> <a id="==(AnyRef):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $eq$eq" class="name">==</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.Any#==" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="==(x$1:Any):Boolean"></a> <a id="==(Any):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $eq$eq" class="name">==</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div> </li><li name="scala.Any#asInstanceOf" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="asInstanceOf[T0]:T0"></a> <a id="asInstanceOf[T0]:T0"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">asInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Any.asInstanceOf.T0">T0</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div> </li><li name="jgo.tools.compiler.lexer.ErrorToken#chars" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="chars:String"></a> <a id="chars:String"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">val</span> </span> <span class="symbol"> <span class="name">chars</span><span class="result">: <span class="extype" name="java.lang.String">String</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="" class="extype" name="jgo.tools.compiler.lexer.ErrorToken">ErrorToken</a> โ†’ <a href="Token.html" class="extype" name="jgo.tools.compiler.lexer.Token">Token</a></dd></dl></div> </li><li name="scala.AnyRef#clone" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="clone():Object"></a> <a id="clone():AnyRef"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">clone</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.AnyRef">AnyRef</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<a href="../../../../java$lang.html" class="extype" name="java.lang">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="defval" name="classOf[java.lang.CloneNotSupportedException]">...</span> </span>)</span> </dd></dl></div> </li><li name="scala.AnyRef#eq" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="eq(x$1:AnyRef):Boolean"></a> <a id="eq(AnyRef):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">eq</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.AnyRef#finalize" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="finalize():Unit"></a> <a id="finalize():Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">finalize</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<a href="../../../../java$lang.html" class="extype" name="java.lang">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="symbol">classOf[java.lang.Throwable]</span> </span>)</span> </dd></dl></div> </li><li name="scala.AnyRef#getClass" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="getClass():Class[_]"></a> <a id="getClass():Class[_]"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">getClass</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.Class">Class</span>[_]</span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef โ†’ Any</dd></dl></div> </li><li name="scala.Any#isInstanceOf" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="isInstanceOf[T0]:Boolean"></a> <a id="isInstanceOf[T0]:Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">isInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div> </li><li name="jgo.tools.compiler.lexer.ErrorToken#msg" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped"> <a id="msg:String"></a> <a id="msg:String"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">val</span> </span> <span class="symbol"> <span class="name">msg</span><span class="result">: <span class="extype" name="scala.Predef.String">String</span></span> </span> </h4> </li><li name="scala.AnyRef#ne" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="ne(x$1:AnyRef):Boolean"></a> <a id="ne(AnyRef):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">ne</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.AnyRef#notify" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="notify():Unit"></a> <a id="notify():Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">notify</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.AnyRef#notifyAll" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="notifyAll():Unit"></a> <a id="notifyAll():Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">notifyAll</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.AnyRef#synchronized" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="synchronized[T0](x$1:=&gt;T0):T0"></a> <a id="synchronized[T0](โ‡’T0):T0"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">synchronized</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="params">(<span name="arg0">arg0: โ‡’ <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span>)</span><span class="result">: <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="jgo.tools.compiler.lexer.Token#toString" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="toString():String"></a> <a id="toString():String"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">toString</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Predef.String">String</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="Token.html" class="extype" name="jgo.tools.compiler.lexer.Token">Token</a> โ†’ AnyRef โ†’ Any</dd></dl></div> </li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="wait():Unit"></a> <a id="wait():Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">wait</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="defval" name="classOf[java.lang.InterruptedException]">...</span> </span>)</span> </dd></dl></div> </li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="wait(x$1:Long,x$2:Int):Unit"></a> <a id="wait(Long,Int):Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>, <span name="arg1">arg1: <span class="extype" name="scala.Int">Int</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="defval" name="classOf[java.lang.InterruptedException]">...</span> </span>)</span> </dd></dl></div> </li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="wait(x$1:Long):Unit"></a> <a id="wait(Long):Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="defval" name="classOf[java.lang.InterruptedException]">...</span> </span>)</span> </dd></dl></div> </li></ol> </div> </div> <div id="inheritedMembers"> <div class="parent" name="scala.Serializable"> <h3>Inherited from <span class="extype" name="scala.Serializable">Serializable</span></h3> </div><div class="parent" name="java.io.Serializable"> <h3>Inherited from <span class="extype" name="java.io.Serializable">Serializable</span></h3> </div><div class="parent" name="scala.Product"> <h3>Inherited from <span class="extype" name="scala.Product">Product</span></h3> </div><div class="parent" name="scala.Equals"> <h3>Inherited from <span class="extype" name="scala.Equals">Equals</span></h3> </div><div class="parent" name="jgo.tools.compiler.lexer.Token"> <h3>Inherited from <a href="Token.html" class="extype" name="jgo.tools.compiler.lexer.Token">Token</a></h3> </div><div class="parent" name="scala.AnyRef"> <h3>Inherited from <span class="extype" name="scala.AnyRef">AnyRef</span></h3> </div><div class="parent" name="scala.Any"> <h3>Inherited from <span class="extype" name="scala.Any">Any</span></h3> </div> </div> <div id="groupedMembers"> <div class="group" name="Ungrouped"> <h3>Ungrouped</h3> </div> </div> </div> <div id="tooltip"></div> <div id="footer"> </div> <script defer="defer" type="text/javascript" id="jquery-js" src="../../../../lib/jquery.js"></script><script defer="defer" type="text/javascript" id="jquery-ui-js" src="../../../../lib/jquery-ui.js"></script><script defer="defer" type="text/javascript" id="tools-tooltip-js" src="../../../../lib/tools.tooltip.js"></script><script defer="defer" type="text/javascript" id="template-js" src="../../../../lib/template.js"></script> </body> </html>
thomasmodeneis/jgo-web
static/api/jgo/tools/compiler/lexer/ErrorToken.html
HTML
gpl-3.0
24,405
// Copyright 2015 ThoughtWorks, Inc. // // This file is part of Gauge-CSharp. // // Gauge-CSharp 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. // // Gauge-CSharp 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 Gauge-CSharp. If not, see <http://www.gnu.org/licenses/>. using System; using System.Collections.Generic; using Gauge.CSharp.Lib; using Gauge.CSharp.Runner.Models; using Gauge.CSharp.Runner.Strategy; namespace Gauge.CSharp.Runner { public interface ISandbox { // Used only from tests. // Don't return Assembly here! assembly instance returned on sandbox side // would be replaced by assembly instance on runner side, thus making any asserts on it useless. string TargetLibAssemblyVersion { get; } ExecutionResult ExecuteMethod(GaugeMethod gaugeMethod, params string[] args); bool TryScreenCapture(out byte[] screenShotBytes); List<GaugeMethod> GetStepMethods(); void InitializeDataStore(string dataStoreType); IEnumerable<string> GetStepTexts(GaugeMethod gaugeMethod); List<string> GetAllStepTexts(); void ClearObjectCache(); IEnumerable<string> GetAllPendingMessages(); IEnumerable<byte[]> GetAllPendingScreenshots(); void StartExecutionScope(string tag); void CloseExectionScope(); ExecutionResult ExecuteHooks(string hookType, IHooksStrategy strategy, IList<string> applicableTags, object executionContext); IEnumerable<string> Refactor(GaugeMethod methodInfo, IList<Tuple<int, int>> parameterPositions, IList<string> parametersList, string newStepValue); } }
getgauge/gauge-csharp
Runner/ISandbox.cs
C#
gpl-3.0
2,096
๏ปฟ' Copyright 2012 Daniel Wagner O. de Medeiros ' ' This file is part of DWSIM. ' ' DWSIM 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. ' ' DWSIM 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 DWSIM. If not, see <http://www.gnu.org/licenses/>. Imports DWSIM.Thermodynamics.BaseClasses Imports DWSIM.Thermodynamics.PropertyPackages Imports System.IO Public Class FormConfigPRSV2 Inherits FormConfigPropertyPackageBase Public Loaded = False Public param As System.Collections.Specialized.StringDictionary Private Sub ConfigFormUNIQUAC_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load FaTabStripItem1.Controls.Add(New PropertyPackageSettingsEditingControl(_pp) With {.Dock = DockStyle.Fill}) Loaded = False Me.Text += " (" & _pp.Tag & ") [" + _pp.ComponentName + "]" Me.KryptonDataGridView2.DataSource = Nothing Me.FaTabStripItem2.Visible = True Me.KryptonDataGridView2.Rows.Clear() Dim nf As String = "0.0000" If TypeOf _pp Is PRSV2PropertyPackage Then Dim ppu As PRSV2PropertyPackage = _pp For Each cp As ConstantProperties In _comps.Values gt0: If ppu.m_pr.InteractionParameters.ContainsKey(cp.Name.ToLower) Then For Each cp2 As ConstantProperties In _comps.Values If cp.Name <> cp2.Name Then If Not ppu.m_pr.InteractionParameters(cp.Name.ToLower).ContainsKey(cp2.Name.ToLower) Then 'check if collection has id2 as primary id If ppu.m_pr.InteractionParameters.ContainsKey(cp2.Name.ToLower) Then If Not ppu.m_pr.InteractionParameters(cp2.Name.ToLower).ContainsKey(cp.Name.ToLower) Then ppu.m_pr.InteractionParameters(cp.Name.ToLower).Add(cp2.Name.ToLower, New PropertyPackages.Auxiliary.PRSV2_IPData) Dim a12 As Double = ppu.m_pr.InteractionParameters(cp.Name.ToLower)(cp2.Name.ToLower).kij Dim a21 As Double = ppu.m_pr.InteractionParameters(cp.Name.ToLower)(cp2.Name.ToLower).kji KryptonDataGridView2.Rows.Add(New Object() {(cp2.Name), (cp.Name), Format(a12, nf), Format(a21, nf)}) With KryptonDataGridView2.Rows(KryptonDataGridView2.Rows.Count - 1) .Cells(0).Tag = cp.Name.ToLower .Cells(1).Tag = cp2.Name.ToLower End With End If End If Else Dim a12 As Double = ppu.m_pr.InteractionParameters(cp.Name.ToLower)(cp2.Name.ToLower).kij Dim a21 As Double = ppu.m_pr.InteractionParameters(cp.Name.ToLower)(cp2.Name.ToLower).kji KryptonDataGridView2.Rows.Add(New Object() {(cp.Name), (cp2.Name), Format(a12, nf), Format(a21, nf)}) With KryptonDataGridView2.Rows(KryptonDataGridView2.Rows.Count - 1) .Cells(0).Tag = cp.Name.ToLower .Cells(1).Tag = cp2.Name.ToLower End With End If End If Next Else ppu.m_pr.InteractionParameters.Add(cp.Name.ToLower, New Dictionary(Of String, PropertyPackages.Auxiliary.PRSV2_IPData)) GoTo gt0 End If Next dgvu1.Rows.Clear() For Each cp As ConstantProperties In _comps.Values gt1: If ppu.m_pr._data.ContainsKey(cp.Name.ToLower) Then Dim kappa1 As Double = ppu.m_pr._data(cp.Name.ToLower).kappa1 Dim kappa2 As Double = ppu.m_pr._data(cp.Name.ToLower).kappa2 Dim kappa3 As Double = ppu.m_pr._data(cp.Name.ToLower).kappa3 dgvu1.Rows.Add(New Object() {(cp.Name), kappa1, kappa2, kappa3}) Else ppu.m_pr._data.Add(cp.Name.ToLower, New PropertyPackages.Auxiliary.PRSV2Param) GoTo gt1 End If Next Else Dim ppu As PRSV2VLPropertyPackage = _pp For Each cp As ConstantProperties In _comps.Values gt0a: If ppu.m_pr.InteractionParameters.ContainsKey(cp.Name.ToLower) Then For Each cp2 As ConstantProperties In _comps.Values If cp.Name <> cp2.Name Then If Not ppu.m_pr.InteractionParameters(cp.Name.ToLower).ContainsKey(cp2.Name.ToLower) Then 'check if collection has id2 as primary id If ppu.m_pr.InteractionParameters.ContainsKey(cp2.Name.ToLower) Then If Not ppu.m_pr.InteractionParameters(cp2.Name.ToLower).ContainsKey(cp.Name.ToLower) Then ppu.m_pr.InteractionParameters(cp.Name.ToLower).Add(cp2.Name.ToLower, New PropertyPackages.Auxiliary.PRSV2_IPData) Dim a12 As Double = ppu.m_pr.InteractionParameters(cp.Name.ToLower)(cp2.Name.ToLower).kij Dim a21 As Double = ppu.m_pr.InteractionParameters(cp.Name.ToLower)(cp2.Name.ToLower).kji KryptonDataGridView2.Rows.Add(New Object() {(cp2.Name), (cp.Name), Format(a12, nf), Format(a21, nf)}) With KryptonDataGridView2.Rows(KryptonDataGridView2.Rows.Count - 1) .Cells(0).Tag = cp.Name.ToLower .Cells(1).Tag = cp2.Name.ToLower End With End If End If Else Dim a12 As Double = ppu.m_pr.InteractionParameters(cp.Name.ToLower)(cp2.Name.ToLower).kij Dim a21 As Double = ppu.m_pr.InteractionParameters(cp.Name.ToLower)(cp2.Name.ToLower).kji KryptonDataGridView2.Rows.Add(New Object() {(cp.Name), (cp2.Name), Format(a12, nf), Format(a21, nf)}) With KryptonDataGridView2.Rows(KryptonDataGridView2.Rows.Count - 1) .Cells(0).Tag = cp.Name.ToLower .Cells(1).Tag = cp2.Name.ToLower End With End If End If Next Else ppu.m_pr.InteractionParameters.Add(cp.Name.ToLower, New Dictionary(Of String, PropertyPackages.Auxiliary.PRSV2_IPData)) GoTo gt0a End If Next dgvu1.Rows.Clear() For Each cp As ConstantProperties In _comps.Values gt2: If ppu.m_pr._data.ContainsKey(cp.Name.ToLower) Then Dim kappa1 As Double = ppu.m_pr._data(cp.Name.ToLower).kappa1 Dim kappa2 As Double = ppu.m_pr._data(cp.Name.ToLower).kappa2 Dim kappa3 As Double = ppu.m_pr._data(cp.Name.ToLower).kappa3 dgvu1.Rows.Add(New Object() {(cp.Name), kappa1, kappa2, kappa3}) Else ppu.m_pr._data.Add(cp.Name.ToLower, New PropertyPackages.Auxiliary.PRSV2Param) GoTo gt2 End If Next End If Loaded = True End Sub Private Sub FormConfigPR_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown Loaded = True End Sub Private Sub KryptonDataGridView2_CellValidating(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellValidatingEventArgs) If e.FormattedValue <> Nothing Then If Double.TryParse(e.FormattedValue, New Double) = False Then MessageBox.Show(Calculator.GetLocalString("Ovalorinseridoinvlid"), Calculator.GetLocalString("Parmetroinvlido"), MessageBoxButtons.OK, MessageBoxIcon.Error) e.Cancel = True End If End If End Sub Private Sub dgvu1_CellValueChanged(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvu1.CellValueChanged If Loaded Then If TypeOf _pp Is PRSV2PropertyPackage Then Dim ppu As PRSV2PropertyPackage = _pp Dim value As Object = dgvu1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value Dim id1 As String = dgvu1.Rows(e.RowIndex).Cells(1).Value.ToString.ToLower Select Case e.ColumnIndex Case 1 ppu.m_pr._data(id1).kappa1 = value Case 2 ppu.m_pr._data(id1).kappa2 = value Case 3 ppu.m_pr._data(id1).kappa3 = value End Select Else Dim ppu As PRSV2VLPropertyPackage = _pp Dim value As Object = dgvu1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value Dim id1 As String = dgvu1.Rows(e.RowIndex).Cells(1).Value.ToString.ToLower Select Case e.ColumnIndex Case 1 ppu.m_pr._data(id1).kappa1 = value Case 2 ppu.m_pr._data(id1).kappa2 = value Case 3 ppu.m_pr._data(id1).kappa3 = value End Select End If End If End Sub Private Sub KryptonDataGridView2_CellValueChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles KryptonDataGridView2.CellValueChanged If Loaded Then Dim oldvalue As Double, tp As String = "" If TypeOf _pp Is PRSV2PropertyPackage Then Dim ppu As PRSV2PropertyPackage = _pp Dim value As Object = KryptonDataGridView2.Rows(e.RowIndex).Cells(e.ColumnIndex).Value Dim id1 As String = KryptonDataGridView2.Rows(e.RowIndex).Cells(0).Tag.ToString.ToLower Dim id2 As String = KryptonDataGridView2.Rows(e.RowIndex).Cells(1).Tag.ToString.ToLower Select Case e.ColumnIndex Case 2 oldvalue = ppu.m_pr.InteractionParameters(id1)(id2).kij ppu.m_pr.InteractionParameters(id1)(id2).kij = value tp = "PRSV2_KIJ" Case 3 oldvalue = ppu.m_pr.InteractionParameters(id1)(id2).kji ppu.m_pr.InteractionParameters(id1)(id2).kji = value tp = "PRSV2_KJI" End Select If Not _form Is Nothing Then _form.AddUndoRedoAction(New SharedClasses.UndoRedoAction() With {.AType = Interfaces.Enums.UndoRedoActionType.PropertyPackagePropertyChanged, .Name = String.Format(_pp.Flowsheet.GetTranslatedString("UndoRedo_PropertyPackagePropertyChanged"), _pp.Tag, tp, oldvalue, value), .OldValue = oldvalue, .NewValue = CDbl(value), .ObjID = id1, .ObjID2 = id2, .Tag = _pp, .PropertyName = tp}) End If Else Dim ppu As PRSV2VLPropertyPackage = _pp Dim value As Object = KryptonDataGridView2.Rows(e.RowIndex).Cells(e.ColumnIndex).Value Dim id1 As String = KryptonDataGridView2.Rows(e.RowIndex).Cells(0).Tag.ToString.ToLower Dim id2 As String = KryptonDataGridView2.Rows(e.RowIndex).Cells(1).Tag.ToString.ToLower Select Case e.ColumnIndex Case 2 oldvalue = ppu.m_pr.InteractionParameters(id1)(id2).kij ppu.m_pr.InteractionParameters(id1)(id2).kij = value tp = "PRSV2VL_KIJ" Case 3 oldvalue = ppu.m_pr.InteractionParameters(id1)(id2).kji ppu.m_pr.InteractionParameters(id1)(id2).kji = value tp = "PRSV2VL_KJI" End Select If Not _form Is Nothing Then _form.AddUndoRedoAction(New SharedClasses.UndoRedoAction() With {.AType = Interfaces.Enums.UndoRedoActionType.PropertyPackagePropertyChanged, .Name = String.Format(_pp.Flowsheet.GetTranslatedString("UndoRedo_PropertyPackagePropertyChanged"), _pp.Tag, tp, oldvalue, value), .OldValue = oldvalue, .NewValue = CDbl(value), .ObjID = id1, .ObjID2 = id2, .Tag = _pp, .PropertyName = tp}) End If End If End If End Sub End Class
DanWBR/dwsim5
DWSIM.Thermodynamics/Editing Forms/Property Packages/FormConfigPRSV2.vb
Visual Basic
gpl-3.0
14,255
// test #ifndef TEST_HPP #define TEST_HPP #include <iostream> #include <cmath> #include <cassert> #include "ga.hpp" #include "ioga.hpp" #include "ray.hpp" #include "elem.hpp" #include "rt.hpp" #include "grid.hpp" using namespace std; #endif
institution/_qq
test.hpp
C++
gpl-3.0
245
/* * SMDataSignature.h * * Copyright 2019 Avรฉrous Julien-Pierre * * This file is part of SMFoundation. * * SMFoundation 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. * * SMFoundation 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 SMFoundation. If not, see <http://www.gnu.org/licenses/>. * */ #import <Foundation/Foundation.h> NS_ASSUME_NONNULL_BEGIN /* ** SMDataSignature */ #pragma mark - SMDataSignature @interface SMDataSignature : NSObject + (BOOL)validateSignature:(NSData *)signature data:(NSData *)data publicKey:(NSData *)publicKey; @end NS_ASSUME_NONNULL_END
javerous/framework-foundation
SMFoundation/SMDataSignature.h
C
gpl-3.0
1,064
#!/bin/bash #SBATCH --job-name=heatwave_projections_py_mpi # Job name #SBATCH -p batch # partition (this is the queue your job will be added to) #SBATCH --ntasks=4 # Number of MPI ranks #SBATCH --nodes=2 # Number of nodes #SBATCH --mem-per-cpu=3000mb # Memory per processor #SBATCH --time=36:00:00 # time allocation, which has the format (D-HH:MM), here set to 36 hours #SBATCH --mail-type=ALL # Mail events (NONE, BEGIN, END, FAIL, ALL) #SBATCH [email protected] # Where to send mail pwd; hostname; date echo "Running Heatwave analysis program (v Small) on $SLURM_JOB_NUM_NODES nodes with $SLURM_NTASKS tasks, each with $SLURM_CPUS_PER_TASK cores." module load GEOS/3.5.0-foss-2016uofa module load GDAL/2.1.0-foss-2016uofa module load Python/3.6.0-foss-2016uofa module load R/3.3.0-foss-2016uofa mpirun -np 4 python "/home/a1091793/Code/HeatwaveAnalaysis/Heatrisk_South_Australia_GoyderProjections/ParallelHeatRiskAnalysis2Phoenix.py"
jeffrey-newman/Heatrisk_South_Australia_GoyderProjections
PhoenixHeatwaveJobSmall.sh
Shell
gpl-3.0
1,038
<?php /* * This file is part of PHP-FFmpeg. * * (c) Alchemy <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace FFMpeg\Media; use Alchemy\BinaryDriver\Exception\ExecutionFailureException; use FFMpeg\Filters\Audio\AudioFilters; use FFMpeg\Format\FormatInterface; use FFMpeg\Filters\Audio\SimpleFilter; use FFMpeg\Exception\RuntimeException; use FFMpeg\Exception\InvalidArgumentException; use FFMpeg\Filters\Audio\AudioFilterInterface; use FFMpeg\Filters\FilterInterface; use FFMpeg\Format\ProgressableInterface; class Audio extends AbstractStreamableMedia { /** * {@inheritdoc} * * @return AudioFilters */ public function filters() { return new AudioFilters($this); } /** * {@inheritdoc} * * @return Audio */ public function addFilter(FilterInterface $filter) { if (!$filter instanceof AudioFilterInterface) { throw new InvalidArgumentException('Audio only accepts AudioFilterInterface filters'); } $this->filters->add($filter); return $this; } /** * Exports the audio in the desired format, applies registered filters. * * @param FormatInterface $format * @param string $outputPathfile * @return Audio * @throws RuntimeException */ public function save(FormatInterface $format, $outputPathfile) { $listeners = null; if ($format instanceof ProgressableInterface) { $listeners = $format->createProgressListener($this, $this->ffprobe, 1, 1, 0); } $commands = $this->buildCommand($format, $outputPathfile); try { $this->driver->command($commands, false, $listeners); } catch (ExecutionFailureException $e) { $this->cleanupTemporaryFile($outputPathfile); throw new RuntimeException('Encoding failed', $e->getCode(), $e); } return $this; } /** * Returns the final command as a string, useful for debugging purposes. * * @param FormatInterface $format * @param string $outputPathfile * @return string * @since 0.11.0 */ public function getFinalCommand(FormatInterface $format, $outputPathfile) { return implode(' ', $this->buildCommand($format, $outputPathfile)); } /** * Builds the command which will be executed with the provided format * * @param FormatInterface $format * @param string $outputPathfile * @return string[] An array which are the components of the command * @since 0.11.0 */ protected function buildCommand(FormatInterface $format, $outputPathfile) { $commands = array('-y', '-i', $this->pathfile); $filters = clone $this->filters; $filters->add(new SimpleFilter($format->getExtraParams(), 10)); if ($this->driver->getConfiguration()->has('ffmpeg.threads')) { $filters->add(new SimpleFilter(array('-threads', $this->driver->getConfiguration()->get('ffmpeg.threads')))); } if (null !== $format->getAudioCodec()) { $filters->add(new SimpleFilter(array('-acodec', $format->getAudioCodec()))); } foreach ($filters as $filter) { $commands = array_merge($commands, $filter->apply($this, $format)); } if (null !== $format->getAudioKiloBitrate()) { $commands[] = '-b:a'; $commands[] = $format->getAudioKiloBitrate() . 'k'; } if (null !== $format->getAudioChannels()) { $commands[] = '-ac'; $commands[] = $format->getAudioChannels(); } $commands[] = $outputPathfile; return $commands; } /** * Gets the waveform of the video. * * @param integer $width * @param integer $height * @param array $colors Array of colors for ffmpeg to use. Color format is #000000 (RGB hex string with #) * @return Waveform */ public function waveform($width = 640, $height = 120, $colors = array(Waveform::DEFAULT_COLOR)) { return new Waveform($this, $this->driver, $this->ffprobe, $width, $height, $colors); } /** * Concatenates a list of audio files into one unique audio file. * * @param array $sources * @return Concat */ public function concat($sources) { return new Concat($sources, $this->driver, $this->ffprobe); } }
vfremaux/moodle-mod_mplayer
extralib/PHP-FFMpeg-master/src/FFMpeg/Media/Audio.php
PHP
gpl-3.0
4,582
# ## val.fm support # { url_regex => qr{\bval\.fm\b}, code => sub { my ($content) = @_; if ($content =~ m{class="song-text.*?>(.*?)</div>}si) { my $lyrics = $1; $lyrics =~ s{<p\s+class=['"]verse['"]>}{\n\n}gi; $lyrics =~ s{<.*?>}{}sg; return if unpack('A*', $lyrics) eq ''; return $lyrics; } return; } }
genomorro/clyrics
plugins/888-valfm.pl
Perl
gpl-3.0
380
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import itertools import json import erpnext import frappe import copy from erpnext.controllers.item_variant import (ItemVariantExistsError, copy_attributes_to_variant, get_variant, make_variant_item_code, validate_item_variant_attributes) from erpnext.setup.doctype.item_group.item_group import (get_parent_item_groups, invalidate_cache_for) from frappe import _, msgprint from frappe.utils import (cint, cstr, flt, formatdate, get_timestamp, getdate, now_datetime, random_string, strip) from frappe.utils.html_utils import clean_html from frappe.website.doctype.website_slideshow.website_slideshow import \ get_slideshow from frappe.website.render import clear_cache from frappe.website.website_generator import WebsiteGenerator from six import iteritems class DuplicateReorderRows(frappe.ValidationError): pass class StockExistsForTemplate(frappe.ValidationError): pass class InvalidBarcode(frappe.ValidationError): pass class Item(WebsiteGenerator): website = frappe._dict( page_title_field="item_name", condition_field="show_in_website", template="templates/generators/item.html", no_cache=1 ) def onload(self): super(Item, self).onload() self.set_onload('stock_exists', self.stock_ledger_created()) self.set_asset_naming_series() def set_asset_naming_series(self): if not hasattr(self, '_asset_naming_series'): from erpnext.assets.doctype.asset.asset import get_asset_naming_series self._asset_naming_series = get_asset_naming_series() self.set_onload('asset_naming_series', self._asset_naming_series) def autoname(self): if frappe.db.get_default("item_naming_by") == "Naming Series": if self.variant_of: if not self.item_code: template_item_name = frappe.db.get_value("Item", self.variant_of, "item_name") self.item_code = make_variant_item_code(self.variant_of, template_item_name, self) else: from frappe.model.naming import set_name_by_naming_series set_name_by_naming_series(self) self.item_code = self.name self.item_code = strip(self.item_code) self.name = self.item_code def before_insert(self): if not self.description: self.description = self.item_name # if self.is_sales_item and not self.get('is_item_from_hub'): # self.publish_in_hub = 1 def after_insert(self): '''set opening stock and item price''' if self.standard_rate: for default in self.item_defaults: self.add_price(default.default_price_list) if self.opening_stock: self.set_opening_stock() def validate(self): self.get_doc_before_save() super(Item, self).validate() if not self.item_name: self.item_name = self.item_code if not self.description: self.description = self.item_name self.validate_uom() self.validate_description() self.add_default_uom_in_conversion_factor_table() self.validate_conversion_factor() self.validate_item_type() self.check_for_active_boms() self.fill_customer_code() self.check_item_tax() self.validate_barcode() self.validate_warehouse_for_reorder() self.update_bom_item_desc() self.synced_with_hub = 0 self.validate_has_variants() self.validate_stock_exists_for_template_item() self.validate_attributes() self.validate_variant_attributes() self.validate_variant_based_on_change() self.validate_website_image() self.make_thumbnail() self.validate_fixed_asset() self.validate_retain_sample() self.validate_uom_conversion_factor() self.validate_item_defaults() self.update_defaults_from_item_group() self.validate_stock_for_has_batch_and_has_serial() if not self.get("__islocal"): self.old_item_group = frappe.db.get_value(self.doctype, self.name, "item_group") self.old_website_item_groups = frappe.db.sql_list("""select item_group from `tabWebsite Item Group` where parentfield='website_item_groups' and parenttype='Item' and parent=%s""", self.name) def on_update(self): invalidate_cache_for_item(self) self.validate_name_with_item_group() self.update_variants() self.update_item_price() self.update_template_item() def validate_description(self): '''Clean HTML description if set''' if cint(frappe.db.get_single_value('Stock Settings', 'clean_description_html')): self.description = clean_html(self.description) def add_price(self, price_list=None): '''Add a new price''' if not price_list: price_list = (frappe.db.get_single_value('Selling Settings', 'selling_price_list') or frappe.db.get_value('Price List', _('Standard Selling'))) if price_list: item_price = frappe.get_doc({ "doctype": "Item Price", "price_list": price_list, "item_code": self.name, "currency": erpnext.get_default_currency(), "price_list_rate": self.standard_rate }) item_price.insert() def set_opening_stock(self): '''set opening stock''' if not self.is_stock_item or self.has_serial_no or self.has_batch_no: return if not self.valuation_rate and self.standard_rate: self.valuation_rate = self.standard_rate if not self.valuation_rate: frappe.throw(_("Valuation Rate is mandatory if Opening Stock entered")) from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry # default warehouse, or Stores for default in self.item_defaults: default_warehouse = (default.default_warehouse or frappe.db.get_single_value('Stock Settings', 'default_warehouse') or frappe.db.get_value('Warehouse', {'warehouse_name': _('Stores')})) if default_warehouse: stock_entry = make_stock_entry(item_code=self.name, target=default_warehouse, qty=self.opening_stock, rate=self.valuation_rate, company=default.company) stock_entry.add_comment("Comment", _("Opening Stock")) def make_route(self): if not self.route: return cstr(frappe.db.get_value('Item Group', self.item_group, 'route')) + '/' + self.scrub((self.item_name if self.item_name else self.item_code) + '-' + random_string(5)) def validate_website_image(self): if frappe.flags.in_import: return """Validate if the website image is a public file""" auto_set_website_image = False if not self.website_image and self.image: auto_set_website_image = True self.website_image = self.image if not self.website_image: return # find if website image url exists as public file_doc = frappe.get_all("File", filters={ "file_url": self.website_image }, fields=["name", "is_private"], order_by="is_private asc", limit_page_length=1) if file_doc: file_doc = file_doc[0] if not file_doc: if not auto_set_website_image: frappe.msgprint(_("Website Image {0} attached to Item {1} cannot be found").format(self.website_image, self.name)) self.website_image = None elif file_doc.is_private: if not auto_set_website_image: frappe.msgprint(_("Website Image should be a public file or website URL")) self.website_image = None def make_thumbnail(self): if frappe.flags.in_import: return """Make a thumbnail of `website_image`""" import requests.exceptions if not self.is_new() and self.website_image != frappe.db.get_value(self.doctype, self.name, "website_image"): self.thumbnail = None if self.website_image and not self.thumbnail: file_doc = None try: file_doc = frappe.get_doc("File", { "file_url": self.website_image, "attached_to_doctype": "Item", "attached_to_name": self.name }) except frappe.DoesNotExistError: pass # cleanup frappe.local.message_log.pop() except requests.exceptions.HTTPError: frappe.msgprint(_("Warning: Invalid attachment {0}").format(self.website_image)) self.website_image = None except requests.exceptions.SSLError: frappe.msgprint( _("Warning: Invalid SSL certificate on attachment {0}").format(self.website_image)) self.website_image = None # for CSV import if self.website_image and not file_doc: try: file_doc = frappe.get_doc({ "doctype": "File", "file_url": self.website_image, "attached_to_doctype": "Item", "attached_to_name": self.name }).insert() except IOError: self.website_image = None if file_doc: if not file_doc.thumbnail_url: file_doc.make_thumbnail() self.thumbnail = file_doc.thumbnail_url def validate_fixed_asset(self): if self.is_fixed_asset: if self.is_stock_item: frappe.throw(_("Fixed Asset Item must be a non-stock item.")) if not self.asset_category: frappe.throw(_("Asset Category is mandatory for Fixed Asset item")) if self.stock_ledger_created(): frappe.throw(_("Cannot be a fixed asset item as Stock Ledger is created.")) if not self.is_fixed_asset: asset = frappe.db.get_all("Asset", filters={"item_code": self.name, "docstatus": 1}, limit=1) if asset: frappe.throw(_('"Is Fixed Asset" cannot be unchecked, as Asset record exists against the item')) def validate_retain_sample(self): if self.retain_sample and not frappe.db.get_single_value('Stock Settings', 'sample_retention_warehouse'): frappe.throw(_("Please select Sample Retention Warehouse in Stock Settings first")) if self.retain_sample and not self.has_batch_no: frappe.throw(_(" {0} Retain Sample is based on batch, please check Has Batch No to retain sample of item").format( self.item_code)) def get_context(self, context): context.show_search = True context.search_link = '/product_search' context.parents = get_parent_item_groups(self.item_group) self.set_variant_context(context) self.set_attribute_context(context) self.set_disabled_attributes(context) return context def set_variant_context(self, context): if self.has_variants: context.no_cache = True # load variants # also used in set_attribute_context context.variants = frappe.get_all("Item", filters={"variant_of": self.name, "show_variant_in_website": 1}, order_by="name asc") variant = frappe.form_dict.variant if not variant and context.variants: # the case when the item is opened for the first time from its list variant = context.variants[0] if variant: context.variant = frappe.get_doc("Item", variant) for fieldname in ("website_image", "web_long_description", "description", "website_specifications"): if context.variant.get(fieldname): value = context.variant.get(fieldname) if isinstance(value, list): value = [d.as_dict() for d in value] context[fieldname] = value if self.slideshow: if context.variant and context.variant.slideshow: context.update(get_slideshow(context.variant)) else: context.update(get_slideshow(self)) def set_attribute_context(self, context): if self.has_variants: attribute_values_available = {} context.attribute_values = {} context.selected_attributes = {} # load attributes for v in context.variants: v.attributes = frappe.get_all("Item Variant Attribute", fields=["attribute", "attribute_value"], filters={"parent": v.name}) for attr in v.attributes: values = attribute_values_available.setdefault(attr.attribute, []) if attr.attribute_value not in values: values.append(attr.attribute_value) if v.name == context.variant.name: context.selected_attributes[attr.attribute] = attr.attribute_value # filter attributes, order based on attribute table for attr in self.attributes: values = context.attribute_values.setdefault(attr.attribute, []) if cint(frappe.db.get_value("Item Attribute", attr.attribute, "numeric_values")): for val in sorted(attribute_values_available.get(attr.attribute, []), key=flt): values.append(val) else: # get list of values defined (for sequence) for attr_value in frappe.db.get_all("Item Attribute Value", fields=["attribute_value"], filters={"parent": attr.attribute}, order_by="idx asc"): if attr_value.attribute_value in attribute_values_available.get(attr.attribute, []): values.append(attr_value.attribute_value) context.variant_info = json.dumps(context.variants) def set_disabled_attributes(self, context): """Disable selection options of attribute combinations that do not result in a variant""" if not self.attributes or not self.has_variants: return context.disabled_attributes = {} attributes = [attr.attribute for attr in self.attributes] def find_variant(combination): for variant in context.variants: if len(variant.attributes) < len(attributes): continue if "combination" not in variant: ref_combination = [] for attr in variant.attributes: idx = attributes.index(attr.attribute) ref_combination.insert(idx, attr.attribute_value) variant["combination"] = ref_combination if not (set(combination) - set(variant["combination"])): # check if the combination is a subset of a variant combination # eg. [Blue, 0.5] is a possible combination if exists [Blue, Large, 0.5] return True for i, attr in enumerate(self.attributes): if i == 0: continue combination_source = [] # loop through previous attributes for prev_attr in self.attributes[:i]: combination_source.append([context.selected_attributes.get(prev_attr.attribute)]) combination_source.append(context.attribute_values[attr.attribute]) for combination in itertools.product(*combination_source): if not find_variant(combination): context.disabled_attributes.setdefault(attr.attribute, []).append(combination[-1]) def add_default_uom_in_conversion_factor_table(self): uom_conv_list = [d.uom for d in self.get("uoms")] if self.stock_uom not in uom_conv_list: ch = self.append('uoms', {}) ch.uom = self.stock_uom ch.conversion_factor = 1 to_remove = [] for d in self.get("uoms"): if d.conversion_factor == 1 and d.uom != self.stock_uom: to_remove.append(d) [self.remove(d) for d in to_remove] def update_template_tables(self): template = frappe.get_doc("Item", self.variant_of) # add item taxes from template for d in template.get("taxes"): self.append("taxes", {"tax_type": d.tax_type, "tax_rate": d.tax_rate}) # copy re-order table if empty if not self.get("reorder_levels"): for d in template.get("reorder_levels"): n = {} for k in ("warehouse", "warehouse_reorder_level", "warehouse_reorder_qty", "material_request_type"): n[k] = d.get(k) self.append("reorder_levels", n) def validate_conversion_factor(self): check_list = [] for d in self.get('uoms'): if cstr(d.uom) in check_list: frappe.throw( _("Unit of Measure {0} has been entered more than once in Conversion Factor Table").format(d.uom)) else: check_list.append(cstr(d.uom)) if d.uom and cstr(d.uom) == cstr(self.stock_uom) and flt(d.conversion_factor) != 1: frappe.throw( _("Conversion factor for default Unit of Measure must be 1 in row {0}").format(d.idx)) def validate_item_type(self): if self.has_serial_no == 1 and self.is_stock_item == 0 and not self.is_fixed_asset: msgprint(_("'Has Serial No' can not be 'Yes' for non-stock item"), raise_exception=1) if self.has_serial_no == 0 and self.serial_no_series: self.serial_no_series = None def check_for_active_boms(self): if self.default_bom: bom_item = frappe.db.get_value("BOM", self.default_bom, "item") if bom_item not in (self.name, self.variant_of): frappe.throw( _("Default BOM ({0}) must be active for this item or its template").format(bom_item)) def fill_customer_code(self): """ Append all the customer codes and insert into "customer_code" field of item table """ cust_code = [] for d in self.get('customer_items'): cust_code.append(d.ref_code) self.customer_code = ','.join(cust_code) def check_item_tax(self): """Check whether Tax Rate is not entered twice for same Tax Type""" check_list = [] for d in self.get('taxes'): if d.tax_type: account_type = frappe.db.get_value("Account", d.tax_type, "account_type") if account_type not in ['Tax', 'Chargeable', 'Income Account', 'Expense Account']: frappe.throw( _("Item Tax Row {0} must have account of type Tax or Income or Expense or Chargeable").format(d.idx)) else: if d.tax_type in check_list: frappe.throw(_("{0} entered twice in Item Tax").format(d.tax_type)) else: check_list.append(d.tax_type) def validate_barcode(self): from stdnum import ean if len(self.barcodes) > 0: for item_barcode in self.barcodes: options = frappe.get_meta("Item Barcode").get_options("barcode_type").split('\n') if item_barcode.barcode: duplicate = frappe.db.sql( """select parent from `tabItem Barcode` where barcode = %s and parent != %s""", (item_barcode.barcode, self.name)) if duplicate: frappe.throw(_("Barcode {0} already used in Item {1}").format( item_barcode.barcode, duplicate[0][0]), frappe.DuplicateEntryError) item_barcode.barcode_type = "" if item_barcode.barcode_type not in options else item_barcode.barcode_type if item_barcode.barcode_type and item_barcode.barcode_type.upper() in ('EAN', 'UPC-A', 'EAN-13', 'EAN-8'): if not ean.is_valid(item_barcode.barcode): frappe.throw(_("Barcode {0} is not a valid {1} code").format( item_barcode.barcode, item_barcode.barcode_type), InvalidBarcode) def validate_warehouse_for_reorder(self): '''Validate Reorder level table for duplicate and conditional mandatory''' warehouse = [] for d in self.get("reorder_levels"): if not d.warehouse_group: d.warehouse_group = d.warehouse if d.get("warehouse") and d.get("warehouse") not in warehouse: warehouse += [d.get("warehouse")] else: frappe.throw(_("Row {0}: An Reorder entry already exists for this warehouse {1}") .format(d.idx, d.warehouse), DuplicateReorderRows) if d.warehouse_reorder_level and not d.warehouse_reorder_qty: frappe.throw(_("Row #{0}: Please set reorder quantity").format(d.idx)) def stock_ledger_created(self): if not hasattr(self, '_stock_ledger_created'): self._stock_ledger_created = len(frappe.db.sql("""select name from `tabStock Ledger Entry` where item_code = %s limit 1""", self.name)) return self._stock_ledger_created def validate_name_with_item_group(self): # causes problem with tree build if frappe.db.exists("Item Group", self.name): frappe.throw( _("An Item Group exists with same name, please change the item name or rename the item group")) def update_item_price(self): frappe.db.sql("""update `tabItem Price` set item_name=%s, item_description=%s, brand=%s where item_code=%s""", (self.item_name, self.description, self.brand, self.name)) def on_trash(self): super(Item, self).on_trash() frappe.db.sql("""delete from tabBin where item_code=%s""", self.name) frappe.db.sql("delete from `tabItem Price` where item_code=%s", self.name) for variant_of in frappe.get_all("Item", filters={"variant_of": self.name}): frappe.delete_doc("Item", variant_of.name) def before_rename(self, old_name, new_name, merge=False): if self.item_name == old_name: frappe.db.set_value("Item", old_name, "item_name", new_name) if merge: # Validate properties before merging if not frappe.db.exists("Item", new_name): frappe.throw(_("Item {0} does not exist").format(new_name)) field_list = ["stock_uom", "is_stock_item", "has_serial_no", "has_batch_no"] new_properties = [cstr(d) for d in frappe.db.get_value("Item", new_name, field_list)] if new_properties != [cstr(self.get(fld)) for fld in field_list]: frappe.throw(_("To merge, following properties must be same for both items") + ": \n" + ", ".join([self.meta.get_label(fld) for fld in field_list])) def after_rename(self, old_name, new_name, merge): if self.route: invalidate_cache_for_item(self) clear_cache(self.route) frappe.db.set_value("Item", new_name, "item_code", new_name) if merge: self.set_last_purchase_rate(new_name) self.recalculate_bin_qty(new_name) for dt in ("Sales Taxes and Charges", "Purchase Taxes and Charges"): for d in frappe.db.sql("""select name, item_wise_tax_detail from `tab{0}` where ifnull(item_wise_tax_detail, '') != ''""".format(dt), as_dict=1): item_wise_tax_detail = json.loads(d.item_wise_tax_detail) if isinstance(item_wise_tax_detail, dict) and old_name in item_wise_tax_detail: item_wise_tax_detail[new_name] = item_wise_tax_detail[old_name] item_wise_tax_detail.pop(old_name) frappe.db.set_value(dt, d.name, "item_wise_tax_detail", json.dumps(item_wise_tax_detail), update_modified=False) def set_last_purchase_rate(self, new_name): last_purchase_rate = get_last_purchase_details(new_name).get("base_rate", 0) frappe.db.set_value("Item", new_name, "last_purchase_rate", last_purchase_rate) def recalculate_bin_qty(self, new_name): from erpnext.stock.stock_balance import repost_stock frappe.db.auto_commit_on_many_writes = 1 existing_allow_negative_stock = frappe.db.get_value("Stock Settings", None, "allow_negative_stock") frappe.db.set_value("Stock Settings", None, "allow_negative_stock", 1) repost_stock_for_warehouses = frappe.db.sql_list("""select distinct warehouse from tabBin where item_code=%s""", new_name) # Delete all existing bins to avoid duplicate bins for the same item and warehouse frappe.db.sql("delete from `tabBin` where item_code=%s", new_name) for warehouse in repost_stock_for_warehouses: repost_stock(new_name, warehouse) frappe.db.set_value("Stock Settings", None, "allow_negative_stock", existing_allow_negative_stock) frappe.db.auto_commit_on_many_writes = 0 def copy_specification_from_item_group(self): self.set("website_specifications", []) if self.item_group: for label, desc in frappe.db.get_values("Item Website Specification", {"parent": self.item_group}, ["label", "description"]): row = self.append("website_specifications") row.label = label row.description = desc def update_bom_item_desc(self): if self.is_new(): return if self.db_get('description') != self.description: frappe.db.sql(""" update `tabBOM` set description = %s where item = %s and docstatus < 2 """, (self.description, self.name)) frappe.db.sql(""" update `tabBOM Item` set description = %s where item_code = %s and docstatus < 2 """, (self.description, self.name)) frappe.db.sql(""" update `tabBOM Explosion Item` set description = %s where item_code = %s and docstatus < 2 """, (self.description, self.name)) def update_template_item(self): """Set Show in Website for Template Item if True for its Variant""" if self.variant_of: if self.show_in_website: self.show_variant_in_website = 1 self.show_in_website = 0 if self.show_variant_in_website: # show template template_item = frappe.get_doc("Item", self.variant_of) if not template_item.show_in_website: template_item.show_in_website = 1 template_item.flags.dont_update_variants = True template_item.flags.ignore_permissions = True template_item.save() def validate_item_defaults(self): companies = list(set([row.company for row in self.item_defaults])) if len(companies) != len(self.item_defaults): frappe.throw(_("Cannot set multiple Item Defaults for a company.")) def update_defaults_from_item_group(self): """Get defaults from Item Group""" if self.item_group and not self.item_defaults: item_defaults = frappe.db.get_values("Item Default", {"parent": self.item_group}, ['company', 'default_warehouse','default_price_list','buying_cost_center','default_supplier', 'expense_account','selling_cost_center','income_account'], as_dict = 1) if item_defaults: for item in item_defaults: self.append('item_defaults', { 'company': item.company, 'default_warehouse': item.default_warehouse, 'default_price_list': item.default_price_list, 'buying_cost_center': item.buying_cost_center, 'default_supplier': item.default_supplier, 'expense_account': item.expense_account, 'selling_cost_center': item.selling_cost_center, 'income_account': item.income_account }) else: warehouse = '' defaults = frappe.defaults.get_defaults() or {} # To check default warehouse is belong to the default company if defaults.get("default_warehouse") and frappe.db.exists("Warehouse", {'name': defaults.default_warehouse, 'company': defaults.company}): warehouse = defaults.default_warehouse self.append("item_defaults", { "company": defaults.get("company"), "default_warehouse": warehouse }) def update_variants(self): if self.flags.dont_update_variants or \ frappe.db.get_single_value('Item Variant Settings', 'do_not_update_variants'): return if self.has_variants: variants = frappe.db.get_all("Item", fields=["item_code"], filters={"variant_of": self.name}) if variants: if len(variants) <= 30: update_variants(variants, self, publish_progress=False) frappe.msgprint(_("Item Variants updated")) else: frappe.enqueue("erpnext.stock.doctype.item.item.update_variants", variants=variants, template=self, now=frappe.flags.in_test, timeout=600) def validate_has_variants(self): if not self.has_variants and frappe.db.get_value("Item", self.name, "has_variants"): if frappe.db.exists("Item", {"variant_of": self.name}): frappe.throw(_("Item has variants.")) def validate_stock_exists_for_template_item(self): if self.stock_ledger_created() and self._doc_before_save: if (cint(self._doc_before_save.has_variants) != cint(self.has_variants) or self._doc_before_save.variant_of != self.variant_of): frappe.throw(_("Cannot change Variant properties after stock transaction. You will have to make a new Item to do this.").format(self.name), StockExistsForTemplate) if self.has_variants or self.variant_of: if not self.is_child_table_same('attributes'): frappe.throw( _('Cannot change Attributes after stock transaction. Make a new Item and transfer stock to the new Item')) def validate_variant_based_on_change(self): if not self.is_new() and (self.variant_of or (self.has_variants and frappe.get_all("Item", {"variant_of": self.name}))): if self.variant_based_on != frappe.db.get_value("Item", self.name, "variant_based_on"): frappe.throw(_("Variant Based On cannot be changed")) def validate_uom(self): if not self.get("__islocal"): check_stock_uom_with_bin(self.name, self.stock_uom) if self.has_variants: for d in frappe.db.get_all("Item", filters={"variant_of": self.name}): check_stock_uom_with_bin(d.name, self.stock_uom) if self.variant_of: template_uom = frappe.db.get_value("Item", self.variant_of, "stock_uom") if template_uom != self.stock_uom: frappe.throw(_("Default Unit of Measure for Variant '{0}' must be same as in Template '{1}'") .format(self.stock_uom, template_uom)) def validate_uom_conversion_factor(self): if self.uoms: for d in self.uoms: value = get_uom_conv_factor(d.uom, self.stock_uom) if value: d.conversion_factor = value def validate_attributes(self): if not (self.has_variants or self.variant_of): return if not self.variant_based_on: self.variant_based_on = 'Item Attribute' if self.variant_based_on == 'Item Attribute': attributes = [] if not self.attributes: frappe.throw(_("Attribute table is mandatory")) for d in self.attributes: if d.attribute in attributes: frappe.throw( _("Attribute {0} selected multiple times in Attributes Table".format(d.attribute))) else: attributes.append(d.attribute) def validate_variant_attributes(self): if self.is_new() and self.variant_of and self.variant_based_on == 'Item Attribute': args = {} for d in self.attributes: if cstr(d.attribute_value).strip() == '': frappe.throw(_("Please specify Attribute Value for attribute {0}").format(d.attribute)) args[d.attribute] = d.attribute_value variant = get_variant(self.variant_of, args, self.name) if variant: frappe.throw(_("Item variant {0} exists with same attributes") .format(variant), ItemVariantExistsError) validate_item_variant_attributes(self, args) def validate_stock_for_has_batch_and_has_serial(self): if self.stock_ledger_created(): for value in ["has_batch_no", "has_serial_no"]: if frappe.db.get_value("Item", self.name, value) != self.get_value(value): frappe.throw(_("Cannot change {0} as Stock Transaction for Item {1} exist.".format(value, self.name))) def get_timeline_data(doctype, name): '''returns timeline data based on stock ledger entry''' out = {} items = dict(frappe.db.sql('''select posting_date, count(*) from `tabStock Ledger Entry` where item_code=%s and posting_date > date_sub(curdate(), interval 1 year) group by posting_date''', name)) for date, count in iteritems(items): timestamp = get_timestamp(date) out.update({timestamp: count}) return out def validate_end_of_life(item_code, end_of_life=None, disabled=None, verbose=1): if (not end_of_life) or (disabled is None): end_of_life, disabled = frappe.db.get_value("Item", item_code, ["end_of_life", "disabled"]) if end_of_life and end_of_life != "0000-00-00" and getdate(end_of_life) <= now_datetime().date(): msg = _("Item {0} has reached its end of life on {1}").format(item_code, formatdate(end_of_life)) _msgprint(msg, verbose) if disabled: _msgprint(_("Item {0} is disabled").format(item_code), verbose) def validate_is_stock_item(item_code, is_stock_item=None, verbose=1): if not is_stock_item: is_stock_item = frappe.db.get_value("Item", item_code, "is_stock_item") if is_stock_item != 1: msg = _("Item {0} is not a stock Item").format(item_code) _msgprint(msg, verbose) def validate_cancelled_item(item_code, docstatus=None, verbose=1): if docstatus is None: docstatus = frappe.db.get_value("Item", item_code, "docstatus") if docstatus == 2: msg = _("Item {0} is cancelled").format(item_code) _msgprint(msg, verbose) def _msgprint(msg, verbose): if verbose: msgprint(msg, raise_exception=True) else: raise frappe.ValidationError(msg) def get_last_purchase_details(item_code, doc_name=None, conversion_rate=1.0): """returns last purchase details in stock uom""" # get last purchase order item details last_purchase_order = frappe.db.sql("""\ select po.name, po.transaction_date, po.conversion_rate, po_item.conversion_factor, po_item.base_price_list_rate, po_item.discount_percentage, po_item.base_rate from `tabPurchase Order` po, `tabPurchase Order Item` po_item where po.docstatus = 1 and po_item.item_code = %s and po.name != %s and po.name = po_item.parent order by po.transaction_date desc, po.name desc limit 1""", (item_code, cstr(doc_name)), as_dict=1) # get last purchase receipt item details last_purchase_receipt = frappe.db.sql("""\ select pr.name, pr.posting_date, pr.posting_time, pr.conversion_rate, pr_item.conversion_factor, pr_item.base_price_list_rate, pr_item.discount_percentage, pr_item.base_rate from `tabPurchase Receipt` pr, `tabPurchase Receipt Item` pr_item where pr.docstatus = 1 and pr_item.item_code = %s and pr.name != %s and pr.name = pr_item.parent order by pr.posting_date desc, pr.posting_time desc, pr.name desc limit 1""", (item_code, cstr(doc_name)), as_dict=1) purchase_order_date = getdate(last_purchase_order and last_purchase_order[0].transaction_date or "1900-01-01") purchase_receipt_date = getdate(last_purchase_receipt and last_purchase_receipt[0].posting_date or "1900-01-01") if (purchase_order_date > purchase_receipt_date) or \ (last_purchase_order and not last_purchase_receipt): # use purchase order last_purchase = last_purchase_order[0] purchase_date = purchase_order_date elif (purchase_receipt_date > purchase_order_date) or \ (last_purchase_receipt and not last_purchase_order): # use purchase receipt last_purchase = last_purchase_receipt[0] purchase_date = purchase_receipt_date else: return frappe._dict() conversion_factor = flt(last_purchase.conversion_factor) out = frappe._dict({ "base_price_list_rate": flt(last_purchase.base_price_list_rate) / conversion_factor, "base_rate": flt(last_purchase.base_rate) / conversion_factor, "discount_percentage": flt(last_purchase.discount_percentage), "purchase_date": purchase_date }) conversion_rate = flt(conversion_rate) or 1.0 out.update({ "price_list_rate": out.base_price_list_rate / conversion_rate, "rate": out.base_rate / conversion_rate, "base_rate": out.base_rate }) return out def invalidate_cache_for_item(doc): invalidate_cache_for(doc, doc.item_group) website_item_groups = list(set((doc.get("old_website_item_groups") or []) + [d.item_group for d in doc.get({"doctype": "Website Item Group"}) if d.item_group])) for item_group in website_item_groups: invalidate_cache_for(doc, item_group) if doc.get("old_item_group") and doc.get("old_item_group") != doc.item_group: invalidate_cache_for(doc, doc.old_item_group) def check_stock_uom_with_bin(item, stock_uom): if stock_uom == frappe.db.get_value("Item", item, "stock_uom"): return matched = True ref_uom = frappe.db.get_value("Stock Ledger Entry", {"item_code": item}, "stock_uom") if ref_uom: if cstr(ref_uom) != cstr(stock_uom): matched = False else: bin_list = frappe.db.sql("select * from tabBin where item_code=%s", item, as_dict=1) for bin in bin_list: if (bin.reserved_qty > 0 or bin.ordered_qty > 0 or bin.indented_qty > 0 or bin.planned_qty > 0) and cstr(bin.stock_uom) != cstr(stock_uom): matched = False break if matched and bin_list: frappe.db.sql("""update tabBin set stock_uom=%s where item_code=%s""", (stock_uom, item)) if not matched: frappe.throw( _("Default Unit of Measure for Item {0} cannot be changed directly because you have already made some transaction(s) with another UOM. You will need to create a new Item to use a different Default UOM.").format(item)) def get_item_defaults(item_code, company): item = frappe.get_cached_doc('Item', item_code) out = item.as_dict() for d in item.item_defaults: if d.company == company: row = copy.deepcopy(d.as_dict()) row.pop("name") out.update(row) return out def set_item_default(item_code, company, fieldname, value): item = frappe.get_cached_doc('Item', item_code) for d in item.item_defaults: if d.company == company: if not d.get(fieldname): frappe.db.set_value(d.doctype, d.name, fieldname, value) return # no row found, add a new row for the company d = item.append('item_defaults', {fieldname: value, "company": company}) d.db_insert() item.clear_cache() @frappe.whitelist() def get_uom_conv_factor(uom, stock_uom): uoms = [uom, stock_uom] value = "" uom_details = frappe.db.sql("""select to_uom, from_uom, value from `tabUOM Conversion Factor`\ where to_uom in ({0}) """.format(', '.join(['"' + frappe.db.escape(i, percent=False) + '"' for i in uoms])), as_dict=True) for d in uom_details: if d.from_uom == stock_uom and d.to_uom == uom: value = 1/flt(d.value) elif d.from_uom == uom and d.to_uom == stock_uom: value = d.value if not value: uom_stock = frappe.db.get_value("UOM Conversion Factor", {"to_uom": stock_uom}, ["from_uom", "value"], as_dict=1) uom_row = frappe.db.get_value("UOM Conversion Factor", {"to_uom": uom}, ["from_uom", "value"], as_dict=1) if uom_stock and uom_row: if uom_stock.from_uom == uom_row.from_uom: value = flt(uom_stock.value) * 1/flt(uom_row.value) return value @frappe.whitelist() def get_item_attribute(parent, attribute_value=''): if not frappe.has_permission("Item"): frappe.msgprint(_("No Permission"), raise_exception=1) return frappe.get_all("Item Attribute Value", fields = ["attribute_value"], filters = {'parent': parent, 'attribute_value': ("like", "%%%s%%" % attribute_value)}) def update_variants(variants, template, publish_progress=True): count=0 for d in variants: variant = frappe.get_doc("Item", d) copy_attributes_to_variant(template, variant) variant.save() count+=1 if publish_progress: frappe.publish_progress(count*100/len(variants), title = _("Updating Variants..."))
shubhamgupta123/erpnext
erpnext/stock/doctype/item/item.py
Python
gpl-3.0
36,632
// ************************************************************************** // // 24 Bomb // // By: rcargou <[email protected]> ::: :::::::: // // By: nmohamed <[email protected]> :+: :+: :+: // // By: adjivas <[email protected]> +:+ +:+ +:+ // // By: vjacquie <[email protected]> +#+ +:+ +#+ // // By: jmoiroux <[email protected]> +#+#+#+#+#+ +#+ // // Created: 2015/10/16 17:03:20 by rcargou #+# #+# // // Updated: 2015/10/27 14:00:02 by rcargou ### ########.fr // // // // ************************************************************************** // #include <mapparser.class.hpp> #include <entity.class.hpp> #include <wall.class.hpp> #include <bomb.class.hpp> #include <fire.class.hpp> #include <player.class.hpp> #include <enemy.class.hpp> #include <boss.class.hpp> #include <globject.class.hpp> #include <event.class.hpp> Entity *** Mapparser::map_from_file( char *map_path ) { if (NULL != main_event->map) Mapparser::free_old_map(); Entity *** tmp = Mapparser::map_alloc(); Entity * elem = NULL; std::fstream file; std::string line; std::string casemap; int i = 0, j = globject::mapY_size - 1, x = 0; Mapparser::valid_map(map_path); file.open(map_path , std::fstream::in); for (int x = 0; x < 3; x++) std::getline(file, line); while (j >= 0) { i = ((globject::mapX_size - 1) * 4 ); x = globject::mapX_size - 1; std::getline(file, line); while (i >= 0) { casemap += line[i]; casemap += line[i + 1]; casemap += line[i + 2]; elem = Mapparser::get_entity_from_map( casemap, (float)x, (float)j ); if (elem->type == PLAYER || elem->type == ENEMY || elem->type == BOSS) { tmp[j][x] = Factory::create_empty((int)x, (int)j); main_event->char_list.push_back(elem); } else tmp[j][x] = elem; casemap.clear(); i -= 4; x--; if ( i < 0 ) break; } j--; } main_event->w_log("Mapparser::map_from_file LOADED"); return tmp; } Entity * Mapparser::get_entity_from_map( std::string & casemap, float x, float y) { Entity * tmp = NULL; if ( g_mapcase.count(casemap) == 0) { main_event->w_error("Map file Case Syntax error/doesn't exist"); throw std::exception(); } else { switch (g_mapcase.at(casemap)) { case EMPTY: return static_cast<Entity*>( Factory::create_empty(x, y) ); case WALL_INDESTRUCTIBLE: return static_cast<Entity*>( Factory::create_wall(WALL_INDESTRUCTIBLE, x, y, WALL_INDESTRUCTIBLE) ); case WALL_HP_1: return static_cast<Entity*>( Factory::create_wall(WALL_HP_1, x, y, WALL_HP_1) ); case WALL_HP_2: return static_cast<Entity*>( Factory::create_wall(WALL_HP_2, x, y, WALL_HP_2) ); case WALL_HP_3: return static_cast<Entity*>( Factory::create_wall(WALL_HP_3, x, y, WALL_HP_3) ); case WALL_HP_4: return static_cast<Entity*>( Factory::create_wall(WALL_HP_4, x, y, WALL_HP_4) ); case ENEMY1: return static_cast<Entity*>( Factory::create_enemy(ENEMY, x, y, ENEMY1) ); case ENEMY2: return static_cast<Entity*>( Factory::create_enemy(ENEMY, x, y, ENEMY2) ); case ENEMY3: return static_cast<Entity*>( Factory::create_enemy(ENEMY, x, y, ENEMY3) ); case ENEMY4: return static_cast<Entity*>( Factory::create_enemy(ENEMY, x, y, ENEMY4) ); case ENEMY5: return static_cast<Entity*>( Factory::create_enemy(ENEMY, x, y, ENEMY5) ); case BOSS_A: return static_cast<Entity*>( Factory::create_boss(BOSS, x, y, BOSS_A, BOSS_A) ); case BOSS_B: return static_cast<Entity*>( Factory::create_boss(BOSS, x, y, BOSS_B, BOSS_B) ); case BOSS_C: return static_cast<Entity*>( Factory::create_boss(BOSS, x, y, BOSS_C, BOSS_C) ); case BOSS_D: return static_cast<Entity*>( Factory::create_boss(BOSS, x, y, BOSS_C, BOSS_D) ); case PLAYER1: return static_cast<Entity*>( Factory::create_player( PLAYER, x, y, PLAYER1) ); case PLAYER2: return static_cast<Entity*>( Factory::create_player( PLAYER, x, y, PLAYER2) ); case PLAYER3: return static_cast<Entity*>( Factory::create_player( PLAYER, x, y, PLAYER3) ); case PLAYER4: return static_cast<Entity*>( Factory::create_player( PLAYER, x, y, PLAYER4) ); case PLAYER5: return static_cast<Entity*>( Factory::create_player( PLAYER, x, y, PLAYER5) ); case PLAYER6: return static_cast<Entity*>( Factory::create_player( PLAYER, x, y, PLAYER6) ); case PLAYER7: return static_cast<Entity*>( Factory::create_player( PLAYER, x, y, PLAYER7) ); case PLAYER8: return static_cast<Entity*>( Factory::create_player( PLAYER, x, y, PLAYER8) ); case PLAYER9: return static_cast<Entity*>( Factory::create_player( PLAYER, x, y, PLAYER9) ); case PLAYER10: return static_cast<Entity*>( Factory::create_player( PLAYER, x, y, PLAYER10) ); case BONUS_POWER_UP: return static_cast<Entity*>( Factory::create_player( BONUS, x, y, BONUS_POWER_UP) ); case BONUS_PLUS_ONE: return static_cast<Entity*>( Factory::create_player( BONUS, x, y, BONUS_PLUS_ONE) ); case BONUS_KICK: return static_cast<Entity*>( Factory::create_player( BONUS, x, y, BONUS_KICK) ); case BONUS_CHANGE: return static_cast<Entity*>( Factory::create_player( BONUS, x, y, BONUS_CHANGE) ); case BONUS_REMOTE_BOMB: return static_cast<Entity*>( Factory::create_player( BONUS, x, y, BONUS_REMOTE_BOMB) ); case BONUS_SPEED_UP: return static_cast<Entity*>( Factory::create_player( BONUS, x, y, BONUS_SPEED_UP) ); default: return static_cast<Entity*>( Factory::create_empty(x, y) ); } } return tmp; } int Mapparser::valid_map( char const *map_path ) { std::fstream file; std::string line; int x = 0, y = 0, j = 0; if( access( map_path, F_OK ) < 0 ) { main_event->w_error("Mapparser::valid_map file access error"); throw std::exception(); } file.open(map_path , std::fstream::in); if (!file.is_open()) { main_event->w_error("Mapparser::valid_map file open error"); throw std::exception(); } std::getline(file, line); // y: 20 if (line.length() >= 4) x = std::stoi(&line[3]); else main_event->w_exception("map line 1 error"); std::getline(file, line); // x: 20 if (line.length() >= 4) y = std::stoi(&line[3]); else main_event->w_exception("map line 2 error"); std::getline(file, line); // <-- MAP --> j = 0; while ( std::getline(file, line) ) { if ((int)line.length() != (4 * x - 1) ) { main_event->w_exception("width doesn't correspond"); } if (j >= y - 1) break; j++; } if (j != y - 1) main_event->w_exception("Map height doesn't correspond"); file.close(); return 0; } Entity *** Mapparser::map_alloc() { // return map 2d without entity int y = 0; Entity *** new_map = NULL; // TO DELETE SI SEGFAULT // if (main_event->map != NULL) { // while (y < globject::mapY_size) { // std::free(main_event->map[y]); // main_event->map[y] = NULL; // y++; // } // std::free(main_event->map); // main_event->map = NULL; // } ///////////////////// new_map = (Entity ***)std::malloc(sizeof(Entity **) * globject::mapY_size); if (new_map == NULL) { main_event->w_error("Mapparser::map_alloc() new_map Allocation error"); throw std::exception(); } y = 0; while (y < globject::mapY_size) { new_map[y] = NULL; new_map[y] = (Entity **)std::malloc(sizeof(Entity *) * globject::mapX_size); if (new_map[y] == NULL) { main_event->w_error("Mapparser::map_alloc() new_map[y] Allocation error"); throw std::exception(); } y++; } return new_map; } void Mapparser::free_old_map() { int y = 0; while (y < globject::mapY_size) { if (NULL != main_event->map[y]) std::free( main_event->map[y]); y++; } if (NULL != main_event->map) std::free(main_event->map); main_event->map = NULL; } void Mapparser::get_error() const { if (NULL != Mapparser::error) std::cerr << Mapparser::error; } std::string * Mapparser::error = NULL; Mapparser::Mapparser() {} Mapparser::~Mapparser() {} Mapparser::Mapparser( Mapparser const & src ) { *this = src; } Mapparser & Mapparser::operator=( Mapparser const & rhs ) { if (this != &rhs) { this->error = rhs.error; } return *this; }
noxsnono/Bomberman_42
src/map/mapparser.class.cpp
C++
gpl-3.0
9,453
import unittest import os from ui import main print os.getcwd() class TestMain(unittest.TestCase): def setUp(self): self.m = main.MainWindow() def test_mainWindow(self): assert(self.m) def test_dataframe(self): import numpy #Random 25x4 Numpy Matrix self.m.render_dataframe(numpy.random.rand(25,4) ,name='devel',rownames=xrange(0,25)) assert(self.m.active_robject) assert(self.m.active_robject.columns) assert(self.m.active_robject.column_data) def test_imports(self): datasets = ['iris','Nile','morley','freeny','sleep','mtcars'] for a in datasets: main.rsession.r('%s=%s' % (a,a)) self.m.sync_with_r() assert(a in self.m.robjects) unittest.main()
sdiehl/rpygtk
rpygtk/runtests.py
Python
gpl-3.0
818
package osberbot.bo; /** * TODO: Description * * @author Tititesouris * @since 2016/03/20 */ public class ViewerBO { private Integer id; private String name; private Boolean moderator; private RankBO rank; public ViewerBO(Integer id, String name, RankBO rank) { this.id = id; this.name = name; this.rank = rank; } public boolean hasPower(PowerBO power) { if (rank != null) return rank.hasPower(power); return moderator; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public RankBO getRank() { return rank; } public void setRank(RankBO rank) { this.rank = rank; } }
Tititesouris/OsberBot
src/osberbot/bo/ViewerBO.java
Java
gpl-3.0
900
from datetime import datetime import factory from zds.forum.factories import PostFactory, TopicFactory from zds.gallery.factories import GalleryFactory, UserGalleryFactory from zds.utils.factories import LicenceFactory, SubCategoryFactory from zds.utils.models import Licence from zds.tutorialv2.models.database import PublishableContent, Validation, ContentReaction from zds.tutorialv2.models.versioned import Container, Extract from zds.tutorialv2.publication_utils import publish_content from zds.tutorialv2.utils import init_new_repo text_content = "Ceci est un texte bidon, **avec markown**" tricky_text_content = ( "Ceci est un texte contenant plein d'images, pour la publication. Le modifier affectera le testย !\n\n" "# Les images\n\n" "Image: ![PNG qui existe](https://upload.wikimedia.org/wikipedia/commons/2/24/" "Derivative_of_medical_imaging.jpg)\n\n" "Image: ![PNG qui existe pas](example.com/test.png)\n\n" "Image: ![SVG qui existe](https://upload.wikimedia.org/wikipedia/commons/f/f9/10DF.svg)\n\n" "Image: ![SVG qui existe pas](example.com/test.svg)\n\n" "Image: ![GIF qui existe](https://upload.wikimedia.org/wikipedia/commons/2/27/AnimatedStar.gif)\n\n" "Image: ![GIF qui existe pas](example.com/test.gif)\n\n" "Image: ![Image locale qui existe pas](does-not-exist/test.png)\n\n" "Image: ![Bonus: image bizarre](https://s2.qwant.com/thumbr/300x0/e/7/" "56e2a2bdcd656d0b8a29c650116e29e893239089f71adf128d5f06330703b1/1024px-" "Oh_my_darling.jpg?u=https%3A%2F%2Fupload" ".wikimedia.org%2Fwikipedia%2Fcommons%2Fthumb%2Fa%2Fa9%2FOh_my_darling.jpg%2F1024px-" "Oh_my_darling.jpg&q=0&b=0&p=0&a=0)\n\n" "Image: ![Bonus: le serveur existe pas !](http://unknown.image.zds/test.png)\n\n" "Image: ![Bonus: juste du texte](URL invalide)\n\n" "# Et donc ...\n\n" "Voilร  :)" ) class PublishableContentFactory(factory.django.DjangoModelFactory): """ Factory that creates a PublishableContent. """ class Meta: model = PublishableContent title = factory.Sequence("Mon contenu No{}".format) description = factory.Sequence("Description du contenu No{}".format) type = "TUTORIAL" creation_date = datetime.now() pubdate = datetime.now() @classmethod def _generate(cls, create, attrs): # These parameters are only used inside _generate() and won't be saved in the database, # which is why we use attrs.pop() (they are removed from attrs). light = attrs.pop("light", True) author_list = attrs.pop("author_list", None) add_license = attrs.pop("add_license", True) add_category = attrs.pop("add_category", True) # This parameter will be saved in the database, # which is why we use attrs.get() (it stays in attrs). licence = attrs.get("licence", None) auths = author_list or [] if add_license: given_licence = licence or Licence.objects.first() if isinstance(given_licence, str) and given_licence: given_licence = Licence.objects.filter(title=given_licence).first() or Licence.objects.first() licence = given_licence or LicenceFactory() text = text_content if not light: text = tricky_text_content publishable_content = super()._generate(create, attrs) publishable_content.gallery = GalleryFactory() publishable_content.licence = licence for auth in auths: publishable_content.authors.add(auth) if add_category: publishable_content.subcategory.add(SubCategoryFactory()) publishable_content.save() for author in publishable_content.authors.all(): UserGalleryFactory(user=author, gallery=publishable_content.gallery, mode="W") init_new_repo(publishable_content, text, text) return publishable_content class ContainerFactory(factory.Factory): """ Factory that creates a Container. """ class Meta: model = Container title = factory.Sequence(lambda n: "Mon container No{}".format(n + 1)) @classmethod def _generate(cls, create, attrs): # These parameters are only used inside _generate() and won't be saved in the database, # which is why we use attrs.pop() (they are removed from attrs). db_object = attrs.pop("db_object", None) light = attrs.pop("light", True) # This parameter will be saved in the database, # which is why we use attrs.get() (it stays in attrs). parent = attrs.get("parent", None) # Needed because we use container.title later container = super()._generate(create, attrs) text = text_content if not light: text = tricky_text_content sha = parent.repo_add_container(container.title, text, text) container = parent.children[-1] if db_object: db_object.sha_draft = sha db_object.save() return container class ExtractFactory(factory.Factory): """ Factory that creates a Extract. """ class Meta: model = Extract title = factory.Sequence(lambda n: "Mon extrait No{}".format(n + 1)) @classmethod def _generate(cls, create, attrs): # These parameters are only used inside _generate() and won't be saved in the database, # which is why we use attrs.pop() (they are removed from attrs). light = attrs.pop("light", True) db_object = attrs.pop("db_object", None) # This parameter will be saved in the database, # which is why we use attrs.get() (it stays in attrs). container = attrs.get("container", None) # Needed because we use extract.title later extract = super()._generate(create, attrs) parent = container text = text_content if not light: text = tricky_text_content sha = parent.repo_add_extract(extract.title, text) extract = parent.children[-1] if db_object: db_object.sha_draft = sha db_object.save() return extract class ContentReactionFactory(factory.django.DjangoModelFactory): """ Factory that creates a ContentReaction. """ class Meta: model = ContentReaction ip_address = "192.168.3.1" text = "Bonjour, je me prรฉsente, je m'appelle l'homme au texte bidonnรฉ" @classmethod def _generate(cls, create, attrs): note = super()._generate(create, attrs) note.pubdate = datetime.now() note.save() note.related_content.last_note = note note.related_content.save() return note class BetaContentFactory(PublishableContentFactory): """ Factory that creates a PublishableContent with a beta version and a beta topic. """ @classmethod def _generate(cls, create, attrs): # This parameter is only used inside _generate() and won't be saved in the database, # which is why we use attrs.pop() (it is removed from attrs). beta_forum = attrs.pop("forum", None) # Creates the PublishableContent (see PublishableContentFactory._generate() for more info) publishable_content = super()._generate(create, attrs) if publishable_content.authors.count() > 0 and beta_forum is not None: beta_topic = TopicFactory( title="[beta]" + publishable_content.title, author=publishable_content.authors.first(), forum=beta_forum ) publishable_content.sha_beta = publishable_content.sha_draft publishable_content.beta_topic = beta_topic publishable_content.save() PostFactory(topic=beta_topic, position=1, author=publishable_content.authors.first()) beta_topic.save() return publishable_content class PublishedContentFactory(PublishableContentFactory): """ Factory that creates a PublishableContent and the publish it. """ @classmethod def _generate(cls, create, attrs): # This parameter is only used inside _generate() and won't be saved in the database, # which is why we use attrs.pop() (it is removed from attrs). is_major_update = attrs.pop("is_major_update", True) # Creates the PublishableContent (see PublishableContentFactory._generate() for more info) content = super()._generate(create, attrs) published = publish_content(content, content.load_version(), is_major_update) content.sha_public = content.sha_draft content.public_version = published content.save() return content class ValidationFactory(factory.django.DjangoModelFactory): """ Factory that creates a Validation. """ class Meta: model = Validation
ChantyTaguan/zds-site
zds/tutorialv2/factories.py
Python
gpl-3.0
8,840
//============================================================================ // Name : BoxyLady // Author : Darren Green // Copyright : (C) Darren Green 2011-2020 // Description : Music sequencer // // License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> // This is free software; you are free to change and redistribute it. // There is NO WARRANTY, to the extent permitted by law. // Contact: [email protected] http://www.pinkmongoose.co.uk //============================================================================ #ifndef DICTIONARY_H_ #define DICTIONARY_H_ #include <unordered_map> #include "Global.h" #include "Sequence.h" #include "Blob.h" namespace BoxyLady { enum class dic_item_protection { temp, normal, locked, system, active }; enum class dic_item_type { null, patch, macro }; class DictionaryItem; class Dictionary; class DictionaryMutex; class DictionaryItem { friend class DictionaryMutex; friend class Dictionary; private: int semaphor_; dic_item_type type_; dic_item_protection protection_level_; Blob macro_; Sequence sequence_; public: DictionaryItem(dic_item_type type = dic_item_type::null) : semaphor_(0), type_(type), protection_level_( dic_item_protection::normal) { } dic_item_protection ProtectionLevel() const { return protection_level_; } void Protect(dic_item_protection level) { protection_level_ = level; } bool isMacro() const { return type_ == dic_item_type::macro; } bool isPatch() const { return type_ == dic_item_type::patch; } bool isNull() const { return type_ == dic_item_type::null; } dic_item_type getType() const { return type_; } Blob& getMacro() { return macro_; } Sequence& getSequence() { return sequence_; } static bool ValidName(std::string); }; typedef std::unordered_map<std::string, DictionaryItem> DictionaryType; typedef DictionaryType::iterator DictionaryIterator; typedef std::list<DictionaryIterator> DictionaryIteratorList; class DictionaryMutex { private: DictionaryItem &item_; public: DictionaryMutex(DictionaryItem &item) : item_(item) { item_.semaphor_++; } ~DictionaryMutex() { item_.semaphor_--; } }; class Dictionary { private: DictionaryType dictionary_; DictionaryItem invalid_item_; public: DictionaryIterator begin() { return dictionary_.begin(); } DictionaryIterator end() { return dictionary_.end(); } bool Exists(std::string name) const { auto item = dictionary_.find(name); return item != dictionary_.end(); } DictionaryItem& Find(std::string name) { auto item = dictionary_.find(name); if (item != dictionary_.end()) return item->second; else return invalid_item_; } Sequence& FindSequence(std::string name) { return Find(name).sequence_; } Sequence& FindSequence(Blob &Q) { const std::string name = Q["@"].atom(); return FindSequence(name); } DictionaryItem& Insert(DictionaryItem item, std::string name) { if (!item.ValidName(name)) throw EDictionary().msg(name + ": Illegal character in name."); if (Exists(name)) throw EDictionary().msg(name + ": Name already used."); dictionary_.insert( { { name, item } }); return Find(name); } Sequence& InsertSequence(std::string name) { DictionaryItem item; item.type_ = dic_item_type::patch; return Insert(item, name).sequence_; } bool Delete(std::string name, bool protect = false) { auto item = dictionary_.find(name); if (item != dictionary_.end()) { if (item->second.semaphor_) return false; if (protect && (item->second.protection_level_ > dic_item_protection::normal)) return false; else { dictionary_.erase(item); return true; } } else return false; } void Clear(bool protect = false) { DictionaryIteratorList list; for (auto item = dictionary_.begin(); item != dictionary_.end(); item++) { if (!item->second.semaphor_) if ((!protect) || (item->second.protection_level_ <= dic_item_protection::normal)) list.push_back(item); } for (auto it : list) dictionary_.erase(it); } void Rename(std::string old_name, std::string new_name) { auto node = dictionary_.extract(old_name); //@suppress("Method cannot be resolved") node.key() = new_name; //@suppress("Method cannot be resolved") dictionary_.insert(move(node)); //@suppress("Invalid arguments") @suppress("Function cannot be resolved") } void ListEntries(Blob &Q); static void WriteSlotProtection(std::string&, dic_item_protection); template<class T> static void SWrite(std::string&, T, int); }; } #endif /* DICTIONARY_H_ */
pinkmongoose/BoxyLady
BoxyLady/src/Dictionary.h
C
gpl-3.0
4,596
package miscellaneous; import java.util.Arrays; public class Gen { private static int greyCode(int n1){ return n1 ^ (n1 >> 1); } /* * Advances l1 to next lexicographical higher combination. * cap is the largest value allowed for one index. * return false */ public static boolean nextComb(int[] l1, int cap){ for (int ptr = l1.length-1;;){ if (ptr < 0) return false; if (l1[ptr] == cap - 1){ l1[ptr] = 0; ptr--; } else { l1[ptr]++; break; } } return true; } /* * Advances l1 to next lexicographical higher permutation. * 1 * Find the highest index i such that s[i] < s[i+1]. * If no such index exists, the permutation is the last permutation. * 2 * Find the highest index j > i such that s[j] > s[i]. * Such a j must exist, since i+1 is such an index. * 3 * Swap s[i] with s[j]. * 4 * Reverse all the order of all of the elements after index i */ public static void swap(int[] l1, int a, int b){ int k1 = l1[a];l1[a]=l1[b];l1[b]=k1; } public static void rev(int[] l1, int a, int b){ for (int i = 0; i < (b-a+1)/2;i++) swap(l1,a+i,b-i); } public static boolean nextPerm(int[] l1) { for (int i = l1.length- 2; i >=0; i--) { if (l1[i] < l1[i + 1]){ for (int k = l1.length - 1; k>=0;k--){ if (l1[k]>=l1[i]){ swap(l1,i,k); rev(l1,i+1,l1.length-1); return true; } } } } rev(l1,0,l1.length-1); return false; } public static int[] permInv(int[] l1){ int[] fin = new int[l1.length]; for (int i = 0; i< l1.length;i++){ fin[l1[i]]=i; } return fin; } }
cs6096/contest-library
src/miscellaneous/Gen.java
Java
gpl-3.0
1,729
# # -*- coding: utf-8 -*- # Dia Group Resize Plugin # Copyright (c) 2015, Alexandre Machado <[email protected]> # # 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/>. # import sys, dia import os import pygtk pygtk.require("2.0") import gtk import locale class ResizeWindow(object): def __init__(self, group, data): self.group = group self.data = data self.initWindow() def initWindow(self): self.dlg = gtk.Dialog() self.dlg.set_title('Group Resize') self.dlg.set_border_width(6) self.dlg.vbox.pack_start(self.dialogContents(), fill=True, expand=True, padding=5) self.dlg.add_button(gtk.STOCK_APPLY, gtk.RESPONSE_APPLY) self.dlg.add_button(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE) self.dlg.set_has_separator(True) self.dlg.set_modal(False) self.dlg.get_widget_for_response(gtk.RESPONSE_CLOSE).connect("clicked", self.hide, None) self.dlg.get_widget_for_response(gtk.RESPONSE_APPLY).connect("clicked", self.clickAplicar, None) def dimensionsFrame(self, label): frame = gtk.Frame(label) table = gtk.Table(rows=4, columns=2) ignore = gtk.RadioButton(group=None, label="do not change") ignore.show() smallest = gtk.RadioButton(group=ignore, label="shrink to smallest") smallest.show() largest = gtk.RadioButton(group=ignore, label="enlarge to largest") largest.show() specify = gtk.RadioButton(group=ignore, label="resize to:") specify.show() value = gtk.Entry() value.show() specify.connect("toggled", self.enableValueEntry, value) self.enableValueEntry(specify, value) table.attach (ignore, 0, 1, 0, 1) table.attach (smallest, 0, 1, 1, 2) table.attach (largest, 0, 1, 2, 3) table.attach (specify, 0, 1, 3, 4) table.attach (value, 1, 2, 3, 4) frame.add(table) table.show() frame.show() options = { 'ignore': ignore, 'smallest': smallest, 'largest': largest, 'specify': specify, 'value': value } return frame, options def enableValueEntry(self, radioSpecify, entrySpecify, *args): entrySpecify.set_sensitive(radioSpecify.get_active()) def contentsFrameWidth(self): frame, self.widthOptions = self.dimensionsFrame('Width') return frame def contentsFrameHeight(self): frame, self.heightOptions = self.dimensionsFrame('Height') return frame def dialogContents(self): contents = gtk.VBox(spacing=5) contents.pack_start(self.contentsFrameWidth(), fill=True, expand=True) contents.pack_start(self.contentsFrameHeight(), fill=True, expand=True) contents.show() return contents def getSelectedGroupOption(self, options): value = options['value'].get_text() for opt in 'ignore', 'smallest', 'largest', 'specify': if options[opt].get_active(): return (opt,value) return ('ignore',value) def getValue(self, opt, value, elProperty): if opt == 'specify': return self.toFloat(value) else: values = [ x.properties[elProperty].value for x in self.group if x.properties.has_key(elProperty) ] if opt == 'smallest': return min(values) else: return max(values) def adjustWidth(self, value): for obj in self.group: pos = obj.properties['obj_pos'].value if obj.properties.has_key("elem_width"): difference = value - obj.properties['elem_width'].value handleLeft = obj.handles[3] handleRight = obj.handles[4] amount = difference/2 obj.move_handle(handleLeft, (handleLeft.pos.x - amount, handleLeft.pos.y), 0, 0) obj.move_handle(handleRight, (handleRight.pos.x + amount, handleRight.pos.y), 0, 0) obj.move(pos.x, pos.y) def adjustHeight(self, value): for obj in self.group: pos = obj.properties['obj_pos'].value if obj.properties.has_key("elem_height"): difference = value - obj.properties['elem_height'].value handleTop = obj.handles[1] handleBottom = obj.handles[6] amount = difference/2 obj.move_handle(handleTop, (handleTop.pos.x, handleTop.pos.y - amount), 0, 0) obj.move_handle(handleBottom, (handleBottom.pos.x, handleBottom.pos.y + amount), 0, 0) obj.move(pos.x, pos.y) def toFloat(self, valor): return locale.atof(valor) def clickAplicar(self, *args): optWidth = self.getSelectedGroupOption(self.widthOptions) optHeight = self.getSelectedGroupOption(self.heightOptions) try: if optWidth[0] != 'ignore': width = self.getValue(optWidth[0], optWidth[1], 'elem_width') self.adjustWidth(width) if optHeight[0] != 'ignore': height = self.getValue(optHeight[0], optHeight[1], 'elem_height') self.adjustHeight(height) if dia.active_display(): diagram = dia.active_display().diagram for obj in self.group: diagram.update_connections(obj) except Exception,e: dia.message(gtk.MESSAGE_ERROR, repr(e)) if dia.active_display(): dia.active_display().add_update_all() dia.active_display().flush() def show(self): self.dlg.show() def hide(self, *args): self.dlg.hide() def run(self): return self.dlg.run() def dia_group_resize_db (data,flags): diagram = dia.active_display().diagram group = diagram.get_sorted_selected() if len(group) > 0: win = ResizeWindow(group, data) win.show() else: dia.message(gtk.MESSAGE_INFO, "Please select a group of objects") dia.register_action("ObjectGroupResize", "Group Resize", "/DisplayMenu/Objects/ObjectsExtensionStart", dia_group_resize_db)
axmachado/dia-group-resize
group_resize.py
Python
gpl-3.0
6,960
# SagittariuSEC This repository is stale and only serves as public archive for my master thesis. However, rules developed for the thesis serve as a base for frankenstack correlator. Please see [this repo](https://github.com/ccdcoe/frankenSEC) for more up-to-date version of the rules. ## Old readme This SEC ruleset is designed to indentify common attack patterns from server log files. Currently, it supports identification of authentication attacks from various services, general web application injections and some forms of DNS amplification attacks. NOTE: Please edit action.sec file to match your environment. ``` pattern=\S*(?:192\\.168\\.\d{1,3}\\.\d{1,3}) ``` For example if your internal network uses 10.0.0.0/8 range then use the following regular expression: ``` pattern=\S*(?:10(?:\\.\d{1,3}){3}) ``` ### Simple deployment ``` cd /opt git pull https://github.com/markuskont/SagittariuSEC sec --detach --conf=/opt/SagittariuSEC/rules/\*.sec --input=/var/log/\*.log --syslog=daemon ``` Rules in actions.sec file can be used to block attackers in real time. Some basic scripts for that are provided in Scripts folder. These scripts can be executed over key-based SSH connection on central firewall. ``` vim /opt/SagittariuSEC/rules/actions.sec ``` ``` action=logonly; event IP_BLOCKED_$+{remote_IP}; shellcmd (ssh [email protected] 'bash -s' -- < /opt/SagittariuSEC/scripts/iptables.sh $+{remote_IP} ``` Simple ruleset update, custom actions will be preserved ``` cd /opt/SagittariuSEC/ mv rules/actions.sec /tmp/ && git pull && mv /tmp/actions.sec rules/ ```
markuskont/SagittariuSEC
README.md
Markdown
gpl-3.0
1,587
<html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <title>Google Maps - pygmaps </title> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?libraries=visualization&sensor=true_or_false"></script> <script type="text/javascript"> function initialize() { var centerlatlng = new google.maps.LatLng(37.750000, -122.427325); var myOptions = { zoom: 13, center: centerlatlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); var latlng = new google.maps.LatLng(37.707418, -122.447039); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "222 Whittier St, Daly City, CA 94014, USA employee_id 485", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.721335, -122.429407); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "435 Vienna St, San Francisco, CA 94112, USA employee_id 383", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.706102, -122.450627); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "80 Risel Ave, Daly City, CA 94014, USA employee_id 525", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719312, -122.428504); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "928 Persia Ave, San Francisco, CA 94112, USA employee_id 93", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.716105, -122.437706); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "801 Lisbon St, San Francisco, CA 94112, USA employee_id 1364", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.714655, -122.436449); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1169 Geneva Ave, San Francisco, CA 94112, USA employee_id 1312", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719745, -122.443181); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "16 Navajo Ave, San Francisco, CA 94112, USA employee_id 1874", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.713955, -122.439535); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "55 Curtis St, San Francisco, CA 94112, USA employee_id 971", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.715138, -122.435856); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "924 Naples St, San Francisco, CA 94112, USA employee_id 236", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.705865, -122.450057); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "59 Risel Ave, Daly City, CA 94014, USA employee_id 1528", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720619, -122.431192); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "600 Persia Ave, San Francisco, CA 94112, USA employee_id 1864", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.706156, -122.450468); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "72 Risel Ave, Daly City, CA 94014, USA employee_id 708", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712880, -122.439150); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "135 Morse St, San Francisco, CA 94112, USA employee_id 1355", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.710570, -122.449228); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "562 Ellington Ave, San Francisco, CA 94112, USA employee_id 529", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.705126, -122.448653); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "324 Frankfort St, Daly City, CA 94014, USA employee_id 547", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.713952, -122.440165); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "56 Curtis St, San Francisco, CA 94112, USA employee_id 517", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.710839, -122.438039); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1183 Munich St, San Francisco, CA 94112, USA employee_id 1545", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.704876, -122.451706); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "510 Bellevue Ave, Daly City, CA 94014, USA employee_id 939", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712817, -122.434488); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "417 Rolph St, San Francisco, CA 94112, USA employee_id 74", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.715740, -122.440196); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "966 Geneva Ave, San Francisco, CA 94112, USA employee_id 302", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712829, -122.431958); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1499 Geneva Ave, San Francisco, CA 94112, USA employee_id 359", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.711065, -122.446626); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "720 Morse St, San Francisco, CA 94112, USA employee_id 1392", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718336, -122.442164); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "2150 Alemany Blvd, San Francisco, CA 94112, USA employee_id 2161", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.706396, -122.450254); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "631 Hanover St, Daly City, CA 94014, USA employee_id 1785", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720781, -122.431428); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "502 Naples St, San Francisco, CA 94112, USA employee_id 253", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.714951, -122.437109); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1131 Geneva Ave, San Francisco, CA 94112, USA employee_id 388", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712299, -122.440232); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "233 Pope St, San Francisco, CA 94112, USA employee_id 377", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.711405, -122.435790); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "200 Cordova St, San Francisco, CA 94112, USA employee_id 1446", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.711171, -122.446392); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "5601 Mission St, San Francisco, CA 94112, USA employee_id 1521", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.721311, -122.431203); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "474 Naples St, San Francisco, CA 94112, USA employee_id 1952", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720635, -122.428441); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "446 Moscow St, San Francisco, CA 94112, USA employee_id 128", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.716351, -122.437603); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "301 Amazon Ave, San Francisco, CA 94112, USA employee_id 1626", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.705624, -122.451269); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "260 Acton St, Daly City, CA 94014, USA employee_id 1054", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.711412, -122.433893); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1 Naylor St, San Francisco, CA 94112, USA employee_id 693", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.715337, -122.436784); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "934 Edinburgh St, San Francisco, CA 94112, USA employee_id 1208", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.711418, -122.447039); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "5620 Mission St, San Francisco, CA 94112, USA employee_id 2033", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.717344, -122.442116); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "820 Geneva Ave, San Francisco, CA 94112, USA employee_id 1179", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720139, -122.430164); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "750 Persia Ave, San Francisco, CA 94112, USA employee_id 551", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.713817, -122.433971); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "975 Athens St, San Francisco, CA 94112, USA employee_id 915", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.717345, -122.441312); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "855 Geneva Ave, San Francisco, CA 94112, USA employee_id 2017", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.714753, -122.440363); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "20 Curtis St, San Francisco, CA 94112, USA employee_id 1374", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718863, -122.442497); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "34 Bannock St, San Francisco, CA 94112, USA employee_id 475", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.713768, -122.434010); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "981 Athens St, San Francisco, CA 94112, USA employee_id 1399", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.711307, -122.437906); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1225 Naples St, San Francisco, CA 94112, USA employee_id 1419", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719157, -122.429961); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "551 Athens St, San Francisco, CA 94112, USA employee_id 137", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712030, -122.431075); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "737 Rolph St, San Francisco, CA 94112, USA employee_id 616", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.716494, -122.441022); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "899 Geneva Ave, San Francisco, CA 94112, USA employee_id 439", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.704113, -122.449915); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "708 Acton St, Daly City, CA 94014, USA employee_id 1661", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719500, -122.440566); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "2044 Alemany Blvd, San Francisco, CA 94112, USA employee_id 1436", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.715816, -122.438598); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "850 Lisbon St, San Francisco, CA 94112, USA employee_id 1811", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.710955, -122.436691); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1144 Munich St, San Francisco, CA 94112, USA employee_id 1456", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.713768, -122.434010); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "981 Athens St, San Francisco, CA 94112, USA employee_id 1948", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720253, -122.442814); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "222 Seneca Ave, San Francisco, CA 94112, USA employee_id 964", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.709256, -122.445324); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "242 Lowell St, San Francisco, CA 94112, USA employee_id 460", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.710869, -122.433206); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "781 Prague St, San Francisco, CA 94112, USA employee_id 86", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.708451, -122.445935); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "440 Hanover St, San Francisco, CA 94112, USA employee_id 641", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720870, -122.431248); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "598 Persia Ave, San Francisco, CA 94112, USA employee_id 911", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719428, -122.429354); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "524 Moscow St, San Francisco, CA 94112, USA employee_id 1966", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.716861, -122.441020); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "5098 Mission St, San Francisco, CA 94112, USA employee_id 1281", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719484, -122.430812); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "555 Vienna St, San Francisco, CA 94112, USA employee_id 765", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718319, -122.443246); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "730 Geneva Ave, San Francisco, CA 94112, USA employee_id 1950", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.715001, -122.438644); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1062 Geneva Ave, San Francisco, CA 94112, USA employee_id 1681", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.716646, -122.437312); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "751 Lisbon St, San Francisco, CA 94112, USA employee_id 733", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.707339, -122.444193); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "428 Lowell St, San Francisco, CA 94112, USA employee_id 1260", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.715356, -122.434677); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "827 Vienna St, San Francisco, CA 94112, USA employee_id 1397", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.717452, -122.442325); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "2201 Alemany Blvd, San Francisco, CA 94112, USA employee_id 1056", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.704931, -122.450703); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "302 Acton St, Daly City, CA 94014, USA employee_id 512", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712180, -122.430433); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1576 Geneva Ave, San Francisco, CA 94112, USA employee_id 920", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.705795, -122.452031); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "439 Templeton Ave, Daly City, CA 94014, USA employee_id 1402", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.705295, -122.449214); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "439 Bellevue Ave, Daly City, CA 94014, USA employee_id 1534", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718922, -122.430139); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "567 Athens St, San Francisco, CA 94112, USA employee_id 1161", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719645, -122.442508); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1198 Cayuga Ave, San Francisco, CA 94112, USA employee_id 433", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.704428, -122.449119); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "361 Frankfort St, Daly City, CA 94014, USA employee_id 1834", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712097, -122.436040); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "102 Cordova St, San Francisco, CA 94112, USA employee_id 217", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.713970, -122.434465); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "976 Athens St, San Francisco, CA 94112, USA employee_id 565", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720755, -122.440328); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1101 Cayuga Ave, San Francisco, CA 94112, USA employee_id 2181", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.715075, -122.438819); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1050 Geneva Ave, San Francisco, CA 94112, USA employee_id 536", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.705754, -122.451949); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "449 Templeton Ave, Daly City, CA 94014, USA employee_id 580", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.714455, -122.432822); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "899 Moscow St, San Francisco, CA 94112, USA employee_id 1717", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.709040, -122.448493); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "728 Brunswick St, San Francisco, CA 94112, USA employee_id 854", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.706769, -122.449489); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "615 Hanover St, Daly City, CA 94014, USA employee_id 2100", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.714466, -122.439780); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "25 Curtis St, San Francisco, CA 94112, USA employee_id 2079", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712805, -122.433227); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "4 S Hill Blvd, San Francisco, CA 94112, USA employee_id 1145", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.710285, -122.433059); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "198 Naylor St, San Francisco, CA 94112, USA employee_id 1028", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718632, -122.441273); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "2099 Alemany Blvd, San Francisco, CA 94112, USA employee_id 1862", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712720, -122.435761); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "43 Cordova St, San Francisco, CA 94112, USA employee_id 1656", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.710100, -122.448641); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "5715 Mission St, San Francisco, CA 94112, USA employee_id 1786", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712163, -122.430349); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1580 Geneva Ave, San Francisco, CA 94112, USA employee_id 322", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712375, -122.431055); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1544 Geneva Ave, San Francisco, CA 94112, USA employee_id 1590", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712394, -122.435022); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1121 Athens St, San Francisco, CA 94112, USA employee_id 1283", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.707112, -122.449736); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "618 Hanover St, Daly City, CA 94014, USA employee_id 1618", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.706562, -122.451221); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "199 Acton St, Daly City, CA 94014, USA employee_id 27", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712744, -122.439745); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "207 Morse St, San Francisco, CA 94112, USA employee_id 1992", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719341, -122.430513); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "554 Athens St, San Francisco, CA 94112, USA employee_id 940", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.707353, -122.450127); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "131 Winchester St, Daly City, CA 94014, USA employee_id 208", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719543, -122.430767); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "553 Vienna St, San Francisco, CA 94112, USA employee_id 1739", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719645, -122.442508); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1198 Cayuga Ave, San Francisco, CA 94112, USA employee_id 1075", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.704536, -122.448801); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "343 Frankfort St, Daly City, CA 94014, USA employee_id 1284", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.716063, -122.439535); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "965 Geneva Ave, San Francisco, CA 94112, USA employee_id 864", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.709109, -122.445628); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "240 Lowell St, San Francisco, CA 94112, USA employee_id 110", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.706396, -122.450254); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "631 Hanover St, Daly City, CA 94014, USA employee_id 702", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.714446, -122.430587); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "799 Moscow St, San Francisco, CA 94112, USA employee_id 2062", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.706532, -122.449361); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "16 Risel Ave, Daly City, CA 94014, USA employee_id 238", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.715999, -122.437379); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "900 Madrid St, San Francisco, CA 94112, USA employee_id 627", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.713323, -122.437458); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "31 Morse St, San Francisco, CA 94112, USA employee_id 1112", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720705, -122.430437); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "645 Persia Ave, San Francisco, CA 94112, USA employee_id 613", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.721764, -122.430797); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "444 Naples St, San Francisco, CA 94112, USA employee_id 204", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.711150, -122.434295); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "2 Naylor St, San Francisco, CA 94112, USA employee_id 72", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718319, -122.443246); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "730 Geneva Ave, San Francisco, CA 94112, USA employee_id 1890", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720432, -122.440481); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1117 Cayuga Ave, San Francisco, CA 94112, USA employee_id 853", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718932, -122.438829); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "4963 Mission St, San Francisco, CA 94112, USA employee_id 2130", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.715420, -122.438155); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1063 Geneva Ave, San Francisco, CA 94112, USA employee_id 1164", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.704167, -122.449968); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "706 Acton St, Daly City, CA 94014, USA employee_id 1877", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.705234, -122.450918); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "498 Bellevue Ave, Daly City, CA 94014, USA employee_id 697", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720274, -122.443129); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "231 Seneca Ave, San Francisco, CA 94112, USA employee_id 133", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.704428, -122.449119); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "361 Frankfort St, Daly City, CA 94014, USA employee_id 390", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720523, -122.431800); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "526 Naples St, San Francisco, CA 94112, USA employee_id 2166", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.706396, -122.450254); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "631 Hanover St, Daly City, CA 94014, USA employee_id 1766", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.716822, -122.437179); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "731 Lisbon St, San Francisco, CA 94112, USA employee_id 2011", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.711454, -122.432412); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "616 Rolph St, San Francisco, CA 94112, USA employee_id 1725", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.704568, -122.449096); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "355 Frankfort St, Daly City, CA 94014, USA employee_id 1274", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.705160, -122.449611); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "459 Bellevue Ave, Daly City, CA 94014, USA employee_id 130", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.711547, -122.437721); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1201 Naples St, San Francisco, CA 94112, USA employee_id 1938", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.721426, -122.429401); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "431 Vienna St, San Francisco, CA 94112, USA employee_id 223", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.715694, -122.440122); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "974 Geneva Ave, San Francisco, CA 94112, USA employee_id 1368", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.713954, -122.434992); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1253 Geneva Ave, San Francisco, CA 94112, USA employee_id 371", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.713188, -122.437810); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "57 Morse St, San Francisco, CA 94112, USA employee_id 1479", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720202, -122.440980); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1138 Cayuga Ave, San Francisco, CA 94112, USA employee_id 905", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718831, -122.430247); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "575 Athens St, San Francisco, CA 94112, USA employee_id 575", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.704882, -122.449368); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "360 Frankfort St, Daly City, CA 94014, USA employee_id 1216", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.704329, -122.449669); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "395 Frankfort St, Daly City, CA 94014, USA employee_id 952", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.715586, -122.438086); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "855 Lisbon St, San Francisco, CA 94112, USA employee_id 2159", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.717775, -122.441829); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "817 Geneva Ave, San Francisco, CA 94112, USA employee_id 2152", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.707331, -122.449607); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "176 Oliver St, Daly City, CA 94014, USA employee_id 1478", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712765, -122.431871); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1599 Geneva Ave, San Francisco, CA 94112, USA employee_id 499", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.711634, -122.430967); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "748 Rolph St, San Francisco, CA 94112, USA employee_id 1822", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.705982, -122.451406); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "232 Acton St, Daly City, CA 94014, USA employee_id 1600", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.716787, -122.441671); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "860 Geneva Ave, San Francisco, CA 94112, USA employee_id 1532", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.706396, -122.450254); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "631 Hanover St, Daly City, CA 94014, USA employee_id 1201", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719107, -122.428503); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "418 Munich St, San Francisco, CA 94112, USA employee_id 298", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.717864, -122.442716); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "2200 Alemany Blvd, San Francisco, CA 94112, USA employee_id 894", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.714306, -122.440257); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "42 Curtis St, San Francisco, CA 94112, USA employee_id 1223", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.721330, -122.430569); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "463 Naples St, San Francisco, CA 94112, USA employee_id 2191", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.704346, -122.449357); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "373 Frankfort St, Daly City, CA 94014, USA employee_id 1549", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.716351, -122.437603); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "301 Amazon Ave, San Francisco, CA 94112, USA employee_id 2019", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.715173, -122.435147); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "901 Naples St, San Francisco, CA 94112, USA employee_id 590", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.706695, -122.450905); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "674 Hanover St, Daly City, CA 94014, USA employee_id 1894", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718676, -122.443076); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "731 Geneva Ave, San Francisco, CA 94112, USA employee_id 973", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720202, -122.440980); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1138 Cayuga Ave, San Francisco, CA 94112, USA employee_id 2115", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.705865, -122.450057); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "59 Risel Ave, Daly City, CA 94014, USA employee_id 970", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.721611, -122.428894); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "724 Brazil Ave, San Francisco, CA 94112, USA employee_id 1040", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.706079, -122.450970); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "231 Acton St, Daly City, CA 94014, USA employee_id 1431", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.714908, -122.435344); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "941 Naples St, San Francisco, CA 94112, USA employee_id 1300", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.704428, -122.449119); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "361 Frankfort St, Daly City, CA 94014, USA employee_id 1787", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719013, -122.431168); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "587 Vienna St, San Francisco, CA 94112, USA employee_id 82", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.703712, -122.450675); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "724 Templeton Ave, Daly City, CA 94014, USA employee_id 1957", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712825, -122.431946); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1501 Geneva Ave, San Francisco, CA 94112, USA employee_id 508", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712641, -122.438644); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "142 Newton St, San Francisco, CA 94112, USA employee_id 266", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720836, -122.428773); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "445 Athens St, San Francisco, CA 94112, USA employee_id 858", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.714446, -122.430587); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "799 Moscow St, San Francisco, CA 94112, USA employee_id 1749", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.706015, -122.449774); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "43 Risel Ave, Daly City, CA 94014, USA employee_id 912", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718813, -122.429202); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "551 Moscow St, San Francisco, CA 94112, USA employee_id 634", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719719, -122.428849); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "899 Persia Ave, San Francisco, CA 94112, USA employee_id 1757", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.715711, -122.435589); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "527 Amazon Ave, San Francisco, CA 94112, USA employee_id 1722", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720705, -122.430437); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "645 Persia Ave, San Francisco, CA 94112, USA employee_id 1733", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720836, -122.428773); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "445 Athens St, San Francisco, CA 94112, USA employee_id 1046", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.717877, -122.441956); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "801 Geneva Ave, San Francisco, CA 94112, USA employee_id 545", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712373, -122.436415); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1224 Athens St, San Francisco, CA 94112, USA employee_id 3", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.714265, -122.437001); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1162 Geneva Ave, San Francisco, CA 94112, USA employee_id 1438", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.705376, -122.448976); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "427 Bellevue Ave, Daly City, CA 94014, USA employee_id 1962", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.715582, -122.438915); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1025 Geneva Ave, San Francisco, CA 94112, USA employee_id 1117", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720141, -122.431000); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "524 Vienna St, San Francisco, CA 94112, USA employee_id 299", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.717864, -122.442716); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "2200 Alemany Blvd, San Francisco, CA 94112, USA employee_id 772", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.713594, -122.434087); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1315 Geneva Ave, San Francisco, CA 94112, USA employee_id 1930", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718474, -122.430125); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "831 Russia Ave, San Francisco, CA 94112, USA employee_id 2189", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.721012, -122.428560); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "431 Athens St, San Francisco, CA 94112, USA employee_id 501", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.714446, -122.430587); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "799 Moscow St, San Francisco, CA 94112, USA employee_id 1066", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720047, -122.429978); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "504 Athens St, San Francisco, CA 94112, USA employee_id 101", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.713760, -122.439452); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "65 Curtis St, San Francisco, CA 94112, USA employee_id 1319", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.713273, -122.437528); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "35 Morse St, San Francisco, CA 94112, USA employee_id 759", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.705796, -122.449434); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "436 Bellevue Ave, Daly City, CA 94014, USA employee_id 240", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719232, -122.442470); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "171 Seneca Ave, San Francisco, CA 94112, USA employee_id 1403", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712865, -122.433882); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1350 Geneva Ave, San Francisco, CA 94112, USA employee_id 49", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.711145, -122.437771); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1184 Munich St, San Francisco, CA 94112, USA employee_id 1636", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.710064, -122.447743); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "25 Whittier St, San Francisco, CA 94112, USA employee_id 638", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.711298, -122.429729); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "814 Rolph St, San Francisco, CA 94112, USA employee_id 1437", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.710751, -122.438234); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "275 Curtis St, San Francisco, CA 94112, USA employee_id 897", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719823, -122.428415); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "487 Moscow St, San Francisco, CA 94112, USA employee_id 340", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719840, -122.442825); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "207 Seneca Ave, San Francisco, CA 94112, USA employee_id 441", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720139, -122.430164); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "750 Persia Ave, San Francisco, CA 94112, USA employee_id 84", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.704882, -122.449368); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "360 Frankfort St, Daly City, CA 94014, USA employee_id 523", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.715999, -122.437379); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "900 Madrid St, San Francisco, CA 94112, USA employee_id 29", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.714019, -122.438087); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "218 Rolph St, San Francisco, CA 94112, USA employee_id 2116", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719929, -122.430067); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "508 Athens St, San Francisco, CA 94112, USA employee_id 1567", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719157, -122.429961); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "551 Athens St, San Francisco, CA 94112, USA employee_id 1468", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718068, -122.441003); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "61 Seneca Ave, San Francisco, CA 94112, USA employee_id 2132", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.705263, -122.449309); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "443 Bellevue Ave, Daly City, CA 94014, USA employee_id 1603", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720141, -122.431000); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "524 Vienna St, San Francisco, CA 94112, USA employee_id 1377", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.704346, -122.449357); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "373 Frankfort St, Daly City, CA 94014, USA employee_id 2012", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.708978, -122.444411); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "376 Hanover St, San Francisco, CA 94112, USA employee_id 1007", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712650, -122.435742); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "45 Cordova St, San Francisco, CA 94112, USA employee_id 1338", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718780, -122.429843); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "566 Moscow St, San Francisco, CA 94112, USA employee_id 39", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.704882, -122.449368); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "360 Frankfort St, Daly City, CA 94014, USA employee_id 783", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720806, -122.429808); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "469 Vienna St, San Francisco, CA 94112, USA employee_id 1177", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719548, -122.428180); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "931 Persia Ave, San Francisco, CA 94112, USA employee_id 234", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.705651, -122.451786); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "475 Templeton Ave, Daly City, CA 94014, USA employee_id 1485", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.706000, -122.450927); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "237 Acton St, Daly City, CA 94014, USA employee_id 67", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.706018, -122.450780); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "88 Risel Ave, Daly City, CA 94014, USA employee_id 511", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.710384, -122.448400); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "5699 Mission St, San Francisco, CA 94112, USA employee_id 1847", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.717002, -122.438732); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "772 Paris St, San Francisco, CA 94112, USA employee_id 1097", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.704174, -122.450634); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "694 Templeton Ave, Daly City, CA 94014, USA employee_id 1793", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718659, -122.441715); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "2106 Alemany Blvd, San Francisco, CA 94112, USA employee_id 1902", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.704882, -122.449368); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "360 Frankfort St, Daly City, CA 94014, USA employee_id 1266", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.706564, -122.449167); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "8 Risel Ave, Daly City, CA 94014, USA employee_id 1807", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.713265, -122.437051); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1118 Naples St, San Francisco, CA 94112, USA employee_id 929", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718952, -122.429028); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "539 Moscow St, San Francisco, CA 94112, USA employee_id 1776", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.714700, -122.432909); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "836 Moscow St, San Francisco, CA 94112, USA employee_id 347", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.709200, -122.443729); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "340 Hanover St, San Francisco, CA 94112, USA employee_id 541", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.707304, -122.446092); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "251 Whittier St, Daly City, CA 94014, USA employee_id 230", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.705688, -122.449751); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "452 Bellevue Ave, Daly City, CA 94014, USA employee_id 188", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.714748, -122.435495); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "953 Naples St, San Francisco, CA 94112, USA employee_id 1544", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.710637, -122.437565); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1171 Munich St, San Francisco, CA 94112, USA employee_id 1175", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.711323, -122.438577); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1254 Naples St, San Francisco, CA 94112, USA employee_id 667", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.704310, -122.451223); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "18 Alexander Ave, Daly City, CA 94014, USA employee_id 696", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712152, -122.432997); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "515 Rolph St, San Francisco, CA 94112, USA employee_id 52", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.711684, -122.438310); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1220 Naples St, San Francisco, CA 94112, USA employee_id 26", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.714789, -122.435429); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "949 Naples St, San Francisco, CA 94112, USA employee_id 1027", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712128, -122.433989); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "468 Rolph St, San Francisco, CA 94112, USA employee_id 254", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.704921, -122.451620); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "506 Bellevue Ave, Daly City, CA 94014, USA employee_id 1571", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.711947, -122.437455); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1185 Naples St, San Francisco, CA 94112, USA employee_id 614", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.711112, -122.432854); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "743 Prague St, San Francisco, CA 94112, USA employee_id 296", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.705566, -122.451220); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "264 Acton St, Daly City, CA 94014, USA employee_id 297", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.704935, -122.450986); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "499 Bellevue Ave, Daly City, CA 94014, USA employee_id 1474", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712765, -122.431871); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1599 Geneva Ave, San Francisco, CA 94112, USA employee_id 1042", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719886, -122.442897); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "211 Seneca Ave, San Francisco, CA 94112, USA employee_id 1342", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.721592, -122.429241); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "411 Vienna St, San Francisco, CA 94112, USA employee_id 1116", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.711862, -122.428320); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1669 Geneva Ave, San Francisco, CA 94134, USA employee_id 94", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.716179, -122.438339); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "816 Lisbon St, San Francisco, CA 94112, USA employee_id 1595", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719454, -122.428800); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "900 Persia Ave, San Francisco, CA 94112, USA employee_id 2163", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.710398, -122.445372); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "155 Lowell St, San Francisco, CA 94112, USA employee_id 309", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719539, -122.429219); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "512 Moscow St, San Francisco, CA 94112, USA employee_id 1133", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712741, -122.438615); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "136 Newton St, San Francisco, CA 94112, USA employee_id 1983", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719343, -122.428032); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "998 Persia Ave, San Francisco, CA 94112, USA employee_id 1954", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.713894, -122.433233); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "943 Moscow St, San Francisco, CA 94112, USA employee_id 1250", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.711532, -122.430377); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "776 Rolph St, San Francisco, CA 94112, USA employee_id 1587", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.708572, -122.447200); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "145 Whittier St, San Francisco, CA 94112, USA employee_id 895", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712068, -122.438348); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "198 Newton St, San Francisco, CA 94112, USA employee_id 1599", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.706000, -122.450927); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "237 Acton St, Daly City, CA 94014, USA employee_id 454", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.707487, -122.447051); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "216 Whittier St, Daly City, CA 94014, USA employee_id 2074", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.715845, -122.435795); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "851 Edinburgh St, San Francisco, CA 94112, USA employee_id 778", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.715138, -122.435856); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "924 Naples St, San Francisco, CA 94112, USA employee_id 1748", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718864, -122.441373); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "2098 Alemany Blvd, San Francisco, CA 94112, USA employee_id 797", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.704918, -122.451271); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "598 Templeton Ave, Daly City, CA 94014, USA employee_id 1358", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720928, -122.430403); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "480 Vienna St, San Francisco, CA 94112, USA employee_id 2086", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.714455, -122.432822); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "899 Moscow St, San Francisco, CA 94112, USA employee_id 2063", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.705451, -122.451540); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "501 Templeton Ave, Daly City, CA 94014, USA employee_id 724", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.714446, -122.430587); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "799 Moscow St, San Francisco, CA 94112, USA employee_id 1482", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718767, -122.442621); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "46 Bannock St, San Francisco, CA 94112, USA employee_id 1812", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718956, -122.443315); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1271 Cayuga Ave, San Francisco, CA 94112, USA employee_id 1838", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718957, -122.429710); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "554 Moscow St, San Francisco, CA 94112, USA employee_id 2021", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.710064, -122.447743); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "25 Whittier St, San Francisco, CA 94112, USA employee_id 1455", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.714199, -122.435502); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1231 Geneva Ave, San Francisco, CA 94112, USA employee_id 786", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.716939, -122.440305); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "5103 Mission St, San Francisco, CA 94112, USA employee_id 2075", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719893, -122.441421); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1158 Cayuga Ave, San Francisco, CA 94112, USA employee_id 857", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.704352, -122.450921); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "14 Alexander Ave, Daly City, CA 94014, USA employee_id 1726", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.714446, -122.430587); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "799 Moscow St, San Francisco, CA 94112, USA employee_id 1313", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.713183, -122.439723); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "92 Curtis St, San Francisco, CA 94112, USA employee_id 799", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720517, -122.439912); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "65 Oneida Ave, San Francisco, CA 94112, USA employee_id 1949", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718632, -122.441273); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "2099 Alemany Blvd, San Francisco, CA 94112, USA employee_id 1669", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.710187, -122.444950); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "572 Brunswick St, San Francisco, CA 94112, USA employee_id 1565", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718599, -122.440208); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "165 Bertita St, San Francisco, CA 94112, USA employee_id 699", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712163, -122.430349); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1580 Geneva Ave, San Francisco, CA 94112, USA employee_id 1296", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.709124, -122.445432); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "244 Lowell St, San Francisco, CA 94112, USA employee_id 370", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712765, -122.431871); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1599 Geneva Ave, San Francisco, CA 94112, USA employee_id 768", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.706122, -122.448841); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "282 Oliver St, Daly City, CA 94014, USA employee_id 1574", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.703712, -122.450675); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "724 Templeton Ave, Daly City, CA 94014, USA employee_id 1166", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.710595, -122.447505); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "762 Morse St, San Francisco, CA 94112, USA employee_id 1428", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.704228, -122.450034); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "702 Acton St, Daly City, CA 94014, USA employee_id 1273", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712835, -122.439143); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "141 Morse St, San Francisco, CA 94112, USA employee_id 2147", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719489, -122.429307); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "522 Moscow St, San Francisco, CA 94112, USA employee_id 1710", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712462, -122.435633); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "65 Cordova St, San Francisco, CA 94112, USA employee_id 366", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.717864, -122.442716); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "2200 Alemany Blvd, San Francisco, CA 94112, USA employee_id 803", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.714152, -122.440631); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "91 Pope St, San Francisco, CA 94112, USA employee_id 12", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719764, -122.428460); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "491 Moscow St, San Francisco, CA 94112, USA employee_id 1205", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.705499, -122.450304); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "474 Bellevue Ave, Daly City, CA 94014, USA employee_id 1323", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718873, -122.443164); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "715 Geneva Ave, San Francisco, CA 94112, USA employee_id 1426", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.716644, -122.438789); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "198 Amazon Ave, San Francisco, CA 94112, USA employee_id 532", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.717931, -122.439567); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "5025 Mission St, San Francisco, CA 94112, USA employee_id 360", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.715876, -122.438556); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "842 Lisbon St, San Francisco, CA 94112, USA employee_id 1288", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.706135, -122.448492); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "398 Bellevue Ave, Daly City, CA 94014, USA employee_id 286", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.705224, -122.449423); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "451 Bellevue Ave, Daly City, CA 94014, USA employee_id 1507", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.710954, -122.436604); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1142 Munich St, San Francisco, CA 94112, USA employee_id 291", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.709885, -122.440592); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "405 Allison St, San Francisco, CA 94112, USA employee_id 33", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.706914, -122.450391); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "656 Hanover St, Daly City, CA 94014, USA employee_id 727", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.704881, -122.449168); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "348 Frankfort St, Daly City, CA 94014, USA employee_id 1026", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.711031, -122.448505); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "512 Ellington Ave, San Francisco, CA 94112, USA employee_id 1985", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.714455, -122.432822); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "899 Moscow St, San Francisco, CA 94112, USA employee_id 1869", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.715885, -122.437872); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "825 Lisbon St, San Francisco, CA 94112, USA employee_id 674", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.721306, -122.428338); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "411 Athens St, San Francisco, CA 94112, USA employee_id 1604", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.706803, -122.444792); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "233 Bellevue Ave, Daly City, CA 94014, USA employee_id 1898", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.707122, -122.449192); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "599 Hanover St, Daly City, CA 94014, USA employee_id 937", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.704842, -122.451777); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "518 Bellevue Ave, Daly City, CA 94014, USA employee_id 2124", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719418, -122.428726); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "906 Persia Ave, San Francisco, CA 94112, USA employee_id 392", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720366, -122.430688); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "644 Persia Ave, San Francisco, CA 94112, USA employee_id 665", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.710629, -122.431657); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "96 S Hill Blvd, San Francisco, CA 94112, USA employee_id 283", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719798, -122.429528); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "808 Persia Ave, San Francisco, CA 94112, USA employee_id 932", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.704717, -122.451346); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "600 Templeton Ave, Daly City, CA 94014, USA employee_id 1582", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.706917, -122.445008); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "238 Bellevue Ave, Daly City, CA 94014, USA employee_id 1940", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719670, -122.431357); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "560 Vienna St, San Francisco, CA 94112, USA employee_id 2187", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.706005, -122.449645); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "39 Risel Ave, Daly City, CA 94014, USA employee_id 1541", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720366, -122.430688); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "644 Persia Ave, San Francisco, CA 94112, USA employee_id 1191", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720716, -122.429382); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "462 Athens St, San Francisco, CA 94112, USA employee_id 1867", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.705715, -122.449672); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "448 Bellevue Ave, Daly City, CA 94014, USA employee_id 1946", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.717431, -122.440698); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "5060 Mission St, San Francisco, CA 94112, USA employee_id 782", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718929, -122.430824); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "582 Athens St, San Francisco, CA 94112, USA employee_id 1616", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.705591, -122.451784); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "487 Templeton Ave, Daly City, CA 94014, USA employee_id 1052", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718244, -122.439399); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "2 Italy Ave, San Francisco, CA 94112, USA employee_id 495", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.715219, -122.437267); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "955 Madrid St, San Francisco, CA 94112, USA employee_id 434", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719787, -122.429320); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "816 Persia Ave, San Francisco, CA 94112, USA employee_id 345", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.715647, -122.439930); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "984 Geneva Ave, San Francisco, CA 94112, USA employee_id 382", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.706392, -122.450598); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "671 Hanover St, Daly City, CA 94014, USA employee_id 1188", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.721625, -122.442156); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "499 Otsego Ave, San Francisco, CA 94112, USA employee_id 500", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712185, -122.439025); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "167 Curtis St, San Francisco, CA 94112, USA employee_id 1550", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.709885, -122.440592); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "405 Allison St, San Francisco, CA 94112, USA employee_id 1975", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720294, -122.439111); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1991 Alemany Blvd, San Francisco, CA 94112, USA employee_id 1746", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719936, -122.440101); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "2010 Alemany Blvd, San Francisco, CA 94112, USA employee_id 1945", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.705405, -122.448472); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "322 Oliver St, Daly City, CA 94014, USA employee_id 428", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.705250, -122.451294); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "551 Templeton Ave, Daly City, CA 94014, USA employee_id 372", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719455, -122.443479); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "11 Navajo Ave, San Francisco, CA 94112, USA employee_id 216", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.721153, -122.431377); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "531 Persia Ave, San Francisco, CA 94112, USA employee_id 1880", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.717172, -122.438072); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "737 Paris St, San Francisco, CA 94112, USA employee_id 1789", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.714168, -122.437490); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "243 Rolph St, San Francisco, CA 94112, USA employee_id 447", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.709996, -122.445371); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "195 Lowell St, San Francisco, CA 94112, USA employee_id 2169", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718587, -122.439160); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "4987 Mission St, San Francisco, CA 94112, USA employee_id 996", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.721592, -122.429241); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "411 Vienna St, San Francisco, CA 94112, USA employee_id 885", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.716944, -122.437771); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "742 Lisbon St, San Francisco, CA 94112, USA employee_id 617", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719698, -122.431220); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "554 Vienna St, San Francisco, CA 94112, USA employee_id 278", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.714185, -122.436712); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1184 Geneva Ave, San Francisco, CA 94112, USA employee_id 1194", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718716, -122.429206); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "555 Moscow St, San Francisco, CA 94112, USA employee_id 620", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712933, -122.434032); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1340 Geneva Ave, San Francisco, CA 94112, USA employee_id 1165", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.711358, -122.435150); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "221 Cordova St, San Francisco, CA 94112, USA employee_id 1581", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.714428, -122.433091); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "900 Moscow St, San Francisco, CA 94112, USA employee_id 805", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712775, -122.434420); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "429 Rolph St, San Francisco, CA 94112, USA employee_id 930", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720241, -122.430874); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "516 Vienna St, San Francisco, CA 94112, USA employee_id 993", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.707244, -122.450338); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "143 Winchester St, Daly City, CA 94014, USA employee_id 1650", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720310, -122.429776); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "498 Athens St, San Francisco, CA 94112, USA employee_id 809", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.711178, -122.445168); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "651 Morse St, San Francisco, CA 94112, USA employee_id 2090", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719692, -122.429305); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "818 Persia Ave, San Francisco, CA 94112, USA employee_id 824", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718396, -122.440455); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "181 Bertita St, San Francisco, CA 94112, USA employee_id 844", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.711383, -122.438534); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1250 Naples St, San Francisco, CA 94112, USA employee_id 1598", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718988, -122.430780); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "578 Athens St, San Francisco, CA 94112, USA employee_id 1939", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.710856, -122.437549); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1173 Munich St, San Francisco, CA 94112, USA employee_id 1816", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719611, -122.431402); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "562 Vienna St, San Francisco, CA 94112, USA employee_id 1649", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.706008, -122.447120); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "341 Bellevue Ave, Daly City, CA 94014, USA employee_id 2170", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719105, -122.430691); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "568 Athens St, San Francisco, CA 94112, USA employee_id 1623", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718433, -122.438972); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "15 Italy Ave, San Francisco, CA 94112, USA employee_id 1888", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718111, -122.441481); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "2133 Alemany Blvd, San Francisco, CA 94112, USA employee_id 983", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.717544, -122.439865); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "5059 Mission St, San Francisco, CA 94112, USA employee_id 1012", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.720460, -122.431146); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "509 Naples St, San Francisco, CA 94112, USA employee_id 1608", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.717177, -122.441098); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "875 Geneva Ave, San Francisco, CA 94112, USA employee_id 1053", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.719438, -122.440720); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "2050 Alemany Blvd, San Francisco, CA 94112, USA employee_id 1126", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.705334, -122.448473); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "330 Oliver St, Daly City, CA 94014, USA employee_id 385", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.712765, -122.431871); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/FF0000.png'); var marker = new google.maps.Marker({ title: "1599 Geneva Ave, San Francisco, CA 94112, USA employee_id 1025", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.718478, -122.439536); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/008000.png'); var marker = new google.maps.Marker({ title: "centroid", icon: img, position: latlng }); marker.setMap(map); var latlng = new google.maps.LatLng(37.709688, -122.450124); var img = new google.maps.MarkerImage('/home/jeremy/anaconda3/lib/python3.5/site-packages/gmplot/markers/008000.png'); var marker = new google.maps.Marker({ title: "centroid", icon: img, position: latlng }); marker.setMap(map); } </script> </head> <body style="margin:0px; padding:0px;" onload="initialize()"> <div id="map_canvas" style="width: 100%; height: 100%;"></div> </body> </html>
Jeremy123W/Optimizing-Employee-Shuttle-Stops
Section_Maps/section3_2_stops.html
HTML
gpl-3.0
131,199
#!/bin/bash # Created by Nahuel Barrios on 27/3/16. # shellcheck disable=SC1091 preInstallationLog "Gnome System Tools" sudo apt-get -fy install gnome-system-tools postInstallationLog "Gnome System Tools" logInfo "Available programs: network-admin, shares-admin, time-admin, users-admin" logInfo "Installing packages to compress and extract different kind of files..." sudo apt-get -fy install unace unrar zip unzip p7zip-full p7zip-rar sharutils rar uudeview mpack arj cabextract preInstallationLog "GParted with NTFS support" sudo apt-get -fy install gparted ntfs-3g logInfo "Adding repositories for Rhythmbox and its plugins..." sudo add-apt-repository ppa:fossfreedom/rhythmbox -y sudo add-apt-repository ppa:fossfreedom/rhythmbox-plugins -y sudo apt-get update logInfo "Installing latest Rhythmbox and its plugins..." sudo apt-get -fy install rhythmbox rhythmbox-plugin-rhythmweb rhythmbox-plugin-equalizer rhythmbox-plugin-opencontainingfolder rhythmbox-plugin-llyrics preInstallationLog "Curl, Subdownloader, GMountISO, Sound Converter, Steam client (will update on first run) and PlayOnLinux" sudo apt-get -fy install curl subdownloader gmountiso soundconverter steam playonlinux postInstallationLog "Subdownloader, GMountISO, Freemind (a mind maps editor), Sound Converter, Steam client (will update on first run) and PlayOnLinux" logInfo "Cleaning up..." && sudo apt-get -f install && sudo apt-get -y autoremove && sudo apt-get -y autoclean && sudo apt-get -y clean logInfo "Updating installed packages..." sudo apt-get upgrade
barriosnahuel/efu
Ubuntu/core.sh
Shell
gpl-3.0
1,549
package com.xcode.bean; import java.io.Serializable; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContext; import org.springframework.security.core.context.SecurityContextHolder; @ManagedBean @SessionScoped public class UserAuth implements Serializable { /** * */ private static final long serialVersionUID = 4027678448802658446L; private String email; public UserAuth() { SecurityContext context = SecurityContextHolder.getContext(); Authentication auth = context.getAuthentication(); email = auth.getName(); } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } }
georgematos/ocaert
src/com/xcode/bean/UserAuth.java
Java
gpl-3.0
838
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM 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. OpenFOAM 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 OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class Foam::distributionModels::massRosinRammler Description Mass-based Rosin-Rammler distributionModel. Corrected form of the Rosin-Rammler distribution taking into account the varying number of particles per parcel for for fixed-mass parcels. This distribution should be used when \verbatim parcelBasisType mass; \endverbatim See equation 10 in reference: \verbatim Yoon, S. S., Hewson, J. C., DesJardin, P. E., Glaze, D. J., Black, A. R., & Skaggs, R. R. (2004). Numerical modeling and experimental measurements of a high speed solid-cone water spray for use in fire suppression applications. International Journal of Multiphase Flow, 30(11), 1369-1388. \endverbatim SourceFiles massRosinRammler.C \*---------------------------------------------------------------------------*/ #ifndef massRosinRammler_H #define massRosinRammler_H #include "distributionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { namespace distributionModels { /*---------------------------------------------------------------------------*\ Class massRosinRammler Declaration \*---------------------------------------------------------------------------*/ class massRosinRammler : public distributionModel { // Private Data //- Distribution minimum scalar minValue_; //- Distribution maximum scalar maxValue_; //- Characteristic droplet size scalar d_; //- Empirical dimensionless constant to specify the distribution width, // sometimes referred to as the dispersion coefficient scalar n_; public: //- Runtime type information TypeName("massRosinRammler"); // Constructors //- Construct from components massRosinRammler(const dictionary& dict, Random& rndGen); //- Construct copy massRosinRammler(const massRosinRammler& p); //- Construct and return a clone virtual autoPtr<distributionModel> clone() const { return autoPtr<distributionModel>(new massRosinRammler(*this)); } //- Destructor virtual ~massRosinRammler(); // Member Functions //- Sample the distributionModel virtual scalar sample() const; //- Return the minimum value virtual scalar minValue() const; //- Return the maximum value virtual scalar maxValue() const; //- Return the mean value virtual scalar meanValue() const; }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace distributionModels } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif // ************************************************************************* //
will-bainbridge/OpenFOAM-dev
src/lagrangian/distributionModels/massRosinRammler/massRosinRammler.H
C++
gpl-3.0
4,039
/* meowbot Copyright (C) 2008-2009 Park Jeong Min <pjm0616_at_gmail_d0t_com> 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/>. */ #include <iostream> #include <string> #include <vector> #include <map> #include <deque> #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <fcntl.h> #include <errno.h> #include <signal.h> #include <sys/types.h> #include <sys/wait.h> #include <sys/time.h> #include <time.h> #include <pcrecpp.h> #include "defs.h" #include "ircbot.h" #include "luacpp.h" /* Lua๋Š” ๋‹ค๋ฅธ ์–ธ์–ด์™€ ๋‹ฌ๋ฆฌ ๊ธฐ๋ณธ์ ์œผ๋กœ ์ˆœ์ˆ˜ํ•œ ์–ธ์–ด๋กœ์„œ์˜ ๊ธฐ๋Šฅ๋งŒ ์ œ๊ณตํ•˜๋ฉฐ, ๊ธฐํƒ€ ์‹œ์Šคํ…œ ์ ‘๊ทผ์€ ๋ณ„๋„ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ๋กœ๋“œํ•ด์„œ ์‚ฌ์šฉ. ๋”ฐ๋ผ์„œ ์‹œ์Šคํ…œ ์ ‘๊ทผ์ด ๊ฐ€๋Šฅํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋งŒ ๋กœ๋“œํ•˜์ง€ ์•Š์œผ๋ฉด ์•ˆ์ „. ์˜ˆ์™ธ์ธ ๋ฃจ์•„ ํŒŒ์ผ์„ ๋กœ๋“œํ•˜๋Š” dofile, loadfile 2๊ฐ€์ง€ ํ•จ์ˆ˜๋Š” ์ฝ”๋“œ ์‹คํ–‰ ์ „์— ์‚ญ์ œ. */ ///FIXME: ๋Œ€์ถฉ ๋งŒ๋“ฌ=_= ์ˆ˜์ • ํ•„์š” static int lua_safeeval_child(const char *code) { lua_State *L = luaL_newstate(); // ๊ธฐ๋ณธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋กœ๋“œ #define LOADLIB(name, func) \ lua_pushcfunction(L, func); \ lua_pushstring(L, name); \ lua_call(L, 1, 0); LOADLIB("", luaopen_base) LOADLIB("table", luaopen_table) LOADLIB("string", luaopen_string) LOADLIB("math", luaopen_math) #undef LOADLIB luaopen_libluapcre(L); luaopen_libluautf8(L); luaopen_libluahangul(L); // ํŒŒ์ผ์— ์ ‘๊ทผํ•  ์ˆ˜ ์žˆ๋Š” ํ•จ์ˆ˜ ์‚ญ์ œ #define SETNIL(name) \ lua_pushliteral(L, name); \ lua_pushnil(L); \ lua_rawset(L, LUA_GLOBALSINDEX); SETNIL("dofile"); SETNIL("loadfile"); #undef SETNIL // ์ฝ”๋“œ ์‹คํ–‰ std::string codebuf(code); codebuf += '\n'; int ret = luaL_loadstring(L, codebuf.c_str()); if(ret) { const char *errmsg = lua_tostring(L, -1); printf("Error: %s\n", errmsg); lua_pop(L, 1); } else { ret = lua_pcall(L, 0, 0, 0); if(ret != 0) { const char *errmsg = lua_tostring(L, -1); printf("Error: %s\n", errmsg); lua_pop(L, 1); } } lua_close(L); return 0; } static void luaeval_child_signal_handler(int sig) { if(sig == SIGALRM) puts("Timeout"); else printf("Recieved signal %d\n", sig); exit(1); } static int lua_safeeval(ircbot_conn *isrv, irc_privmsg &pmsg, irc_msginfo &mdest, const char *code, const char *cparam) { int rdpipe[2]; pipe(rdpipe); int pid = fork(); if(pid < 0) { close(rdpipe[0]); close(rdpipe[1]); return -1; } else if(pid == 0) { close(0); dup2(rdpipe[1], 1); dup2(rdpipe[1], 2); close(rdpipe[0]); signal(SIGALRM, luaeval_child_signal_handler); alarm(2); lua_safeeval_child(code); exit(0); } else { close(rdpipe[1]); int status, ret; ret = waitpid(pid, &status, 0); char buf[512*3+1]; ret = read(rdpipe[0], buf, sizeof(buf)-1); close(rdpipe[0]); if(ret < 0) return -1; buf[ret] = 0; char *pp, *p = strtok_r(buf, "\n", &pp); if(!p) { isrv->privmsg(mdest, "(No output)"); } else { int lines = 3; do { isrv->privmsg_nh(mdest, p); } while((p = strtok_r(NULL, "\n", &pp)) && --lines); } } return 0; } int cmd_cb_luaeval(ircbot_conn *isrv, irc_privmsg &pmsg, irc_msginfo &mdest, std::string &cmd, std::string &carg, void *) { if(carg.empty()) { isrv->privmsg(mdest, "์‚ฌ์šฉ๋ฒ•: !" + cmd + " <์ฝ”๋“œ>"); } else { lua_safeeval(isrv, pmsg, mdest, carg.c_str(), NULL); } return HANDLER_FINISHED; } #if 0 int cmd_cb_memeval(ircbot_conn *isrv, irc_privmsg &pmsg, irc_msginfo &mdest, std::string &cmd, std::string &carg, void *) { (void)cmd; std::string mname, marg; if(!pcrecpp::RE("([^ ]+) ?(.*)").FullMatch(carg, &mname, &marg)) { isrv->privmsg(mdest, "์‚ฌ์šฉ๋ฒ•: !๊ธฐ์–ตํ•ด <๊ธฐ์–ต ์ด๋ฆ„> !perl <์ฝ”๋“œ> ๋“ฑ์œผ๋กœ ๊ธฐ์–ต์‹œํ‚จ ํ›„, " "!๊ธฐ์–ต์‹คํ–‰ <๊ธฐ์–ต ์ด๋ฆ„> ๋˜๋Š” !๊ธฐ์–ต์‹คํ–‰ <๊ธฐ์–ต ์ด๋ฆ„> <ํŒŒ๋ผ๋ฏธํ„ฐ> ๋กœ ์‹คํ–‰ (๋‹จ์ถ•: !.)"); isrv->privmsg(mdest, " %nick%์€ ๋‹‰๋„ค์ž„์œผ๋กœ, %param%๋Š” ํŒŒ๋ผ๋ฏธํ„ฐ๋กœ ์น˜ํ™˜๋ฉ๋‹ˆ๋‹ค. " "C,C++์—์„œ๋Š” int nparam, const char *params[] ์ „์—ญ๋ณ€์ˆ˜๊ฐ€ ์ œ๊ณต๋ฉ๋‹ˆ๋‹ค."); } else { const std::string &nick = pmsg.getnick(); // FIXME: use getremdb_v2 std::pair<std::string, std::string> (*getremdb_fxn)(const std::string &word); getremdb_fxn = (std::pair<std::string, std::string> (*)(const std::string &)) isrv->bot->modules.dlsym("mod_remember", "getremdb"); if(!getremdb_fxn) { isrv->privmsg(mdest, "๋‚ด๋ถ€ ์˜ค๋ฅ˜: ์ด ๋ช…๋ น์— ํ•„์š”ํ•œ ๋ชจ๋“ˆ์ด ๋กœ๋“œ๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค."); return 0; } std::pair<std::string, std::string> data = getremdb_fxn(mname); std::string cmd2, carg2; if(data.first.empty()) { isrv->privmsg(mdest, "์˜ค๋ฅ˜: " + data.second); } else if(pcrecpp::RE("^!([^ ]+) (.+)").FullMatch(data.second, &cmd2, &carg2)) { irc_cmd_eval_code(isrv, mdest, nick, cmd2, carg2, marg); } else { isrv->privmsgf_nh(mdest, "์˜ฌ๋ฐ”๋ฅธ ํ˜•์‹์ด ์•„๋‹™๋‹ˆ๋‹ค: %s", data.second.c_str()); } } return HANDLER_FINISHED; } #endif #include "main.h" int mod_luaeval_init(ircbot *bot) { //bot->register_cmd("๊ธฐ์–ต์‹คํ–‰", cmd_cb_memeval); //bot->register_cmd(".", cmd_cb_memeval); bot->register_cmd("luaeval", cmd_cb_luaeval); return 0; } int mod_luaeval_cleanup(ircbot *bot) { //bot->unregister_cmd("๊ธฐ์–ต์‹คํ–‰"); //bot->unregister_cmd("."); bot->unregister_cmd("luaeval"); return 0; } MODULE_INFO(mod_luaeval, mod_luaeval_init, mod_luaeval_cleanup)
pjm0616/meowbot-pub
modules/mod_luaeval.cpp
C++
gpl-3.0
5,984
import { NgModule } from "@angular/core"; import { SamplesModule } from "samples/samples.module"; import { SamplesRoutingModule } from "./samples.routing.module"; @NgModule({ imports: [ SamplesModule, SamplesRoutingModule ] }) export class SamplesFeatureModule {}
SciCatProject/catanie
src/app/app-routing/lazy/samples-routing/samples.feature.module.ts
TypeScript
gpl-3.0
277
package Yogibear617.mods.FuturisticCraft.CreativeTabs; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; public class FCSBModCreativeTab extends CreativeTabs { public FCSBModCreativeTab(int par1, String par2Str) { super(par1, par2Str); } @SideOnly(Side.CLIENT) public int getTabIconItemIndex() { return Block.stoneBrick.blockID; } }
Yogibear617/Futuristic_Craft
fc_common/Yogibear617/mods/FuturisticCraft/CreativeTabs/FCSBModCreativeTab.java
Java
gpl-3.0
455
/* * Generated by class-dump 3.1.2. * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2007 by Steve Nygard. */ #import "_ABCreateStringWithAddressDictionary.h" @interface _ABCreateStringWithAddressDictionary (RMStore) - (id)rm_transaction; - (id)rm_storeError; - (id)rm_storeDownload; - (id)rm_products; - (id)rm_productIdentifier; - (id)rm_invalidProductIdentifiers; - (float)rm_downloadProgress; @end
f41c0r/TinderStats-iOS
theos/include/Tinder/_ABCreateStringWithAddressDictionary-RMStore.h
C
gpl-3.0
427
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <title>Uses of Class org.apache.poi.hssf.util.HSSFColor.VIOLET (POI API Documentation)</title> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.poi.hssf.util.HSSFColor.VIOLET (POI API Documentation)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/apache/poi/hssf/util/HSSFColor.VIOLET.html" title="class in org.apache.poi.hssf.util">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>PREV</li> <li>NEXT</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/apache/poi/hssf/util//class-useHSSFColor.VIOLET.html" target="_top">FRAMES</a></li> <li><a href="HSSFColor.VIOLET.html" target="_top">NO FRAMES</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class org.apache.poi.hssf.util.HSSFColor.VIOLET" class="title">Uses of Class<br>org.apache.poi.hssf.util.HSSFColor.VIOLET</h2> </div> <div class="classUseContainer">No usage of org.apache.poi.hssf.util.HSSFColor.VIOLET</div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/apache/poi/hssf/util/HSSFColor.VIOLET.html" title="class in org.apache.poi.hssf.util">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>PREV</li> <li>NEXT</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/apache/poi/hssf/util//class-useHSSFColor.VIOLET.html" target="_top">FRAMES</a></li> <li><a href="HSSFColor.VIOLET.html" target="_top">NO FRAMES</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small> <i>Copyright 2017 The Apache Software Foundation or its licensors, as applicable.</i> </small></p> </body> </html>
doughtnerd/POD
resources/Apache/Apache-POI-3.16-beta2/poi-bin-3.16-beta2-20170202/poi-3.16-beta2/docs/apidocs/org/apache/poi/hssf/util/class-use/HSSFColor.VIOLET.html
HTML
gpl-3.0
4,312
from ..models import Album from ..resource import SingleResource, ListResource from ..schemas import AlbumSchema class SingleAlbum(SingleResource): schema = AlbumSchema() routes = ('/album/<int:id>/',) model = Album class ListAlbums(ListResource): schema = AlbumSchema(many=True) routes = ('/album/', '/tracklist/') model = Album
justanr/owa
owa/api/album.py
Python
gpl-3.0
358
package com.eveningoutpost.dexdrip.Models; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import java.util.TimeZone; // from package info.nightscout.client.utils; /** * Created by mike on 30.12.2015. */ /** * The Class DateUtil. A simple wrapper around SimpleDateFormat to ease the handling of iso date string &lt;-&gt; date obj * with TZ */ public class DateUtil { private static final String FORMAT_DATE_ISO = "yyyy-MM-dd'T'HH:mm:ss'Z'"; // eg 2017-03-24T22:03:27Z private static final String FORMAT_DATE_ISO2 = "yyyy-MM-dd'T'HH:mm:ssZ"; // eg 2017-03-27T17:38:14+0300 private static final String FORMAT_DATE_ISO3 = "yyyy-MM-dd'T'HH:mmZ"; // eg 2017-05-12T08:16-0400 /** * Takes in an ISO date string of the following format: * yyyy-mm-ddThh:mm:ss.ms+HoMo * * @param isoDateString the iso date string * @return the date * @throws Exception the exception */ private static Date fromISODateString(String isoDateString) throws Exception { SimpleDateFormat f = new SimpleDateFormat(FORMAT_DATE_ISO); f.setTimeZone(TimeZone.getTimeZone("UTC")); return f.parse(isoDateString); } private static Date fromISODateString3(String isoDateString) throws Exception { SimpleDateFormat f = new SimpleDateFormat(FORMAT_DATE_ISO3); f.setTimeZone(TimeZone.getTimeZone("UTC")); return f.parse(isoDateString); } private static Date fromISODateString2(String isoDateString) throws Exception { try { SimpleDateFormat f = new SimpleDateFormat(FORMAT_DATE_ISO2); f.setTimeZone(TimeZone.getTimeZone("UTC")); return f.parse(isoDateString); } catch (java.text.ParseException e) { return fromISODateString3(isoDateString); } } public static Date tolerantFromISODateString(String isoDateString) throws Exception { try { return fromISODateString(isoDateString.replaceFirst("\\.[0-9][0-9][0-9]Z$", "Z")); } catch (java.text.ParseException e) { return fromISODateString2(isoDateString); } } /** * Render date * * @param date the date obj * @param format - if not specified, will use FORMAT_DATE_ISO * @param tz - tz to set to, if not specified uses local timezone * @return the iso-formatted date string */ public static String toISOString(Date date, String format, TimeZone tz) { if (format == null) format = FORMAT_DATE_ISO; if (tz == null) tz = TimeZone.getDefault(); DateFormat f = new SimpleDateFormat(format); f.setTimeZone(tz); return f.format(date); } public static String toISOString(Date date) { return toISOString(date, FORMAT_DATE_ISO, TimeZone.getTimeZone("UTC")); } public static String toISOString(long date) { return toISOString(new Date(date), FORMAT_DATE_ISO, TimeZone.getTimeZone("UTC")); } public static String toNightscoutFormat(long date) { final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.US); format.setTimeZone(TimeZone.getDefault()); return format.format(date); } }
TecMunky/xDrip
app/src/main/java/com/eveningoutpost/dexdrip/Models/DateUtil.java
Java
gpl-3.0
3,340
""" System plugin Copyright (C) 2016 Walid Benghabrit 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/>. """ from accmon.plugins.plugin import * class System(Plugin): def __init__(self): super().__init__() def handle_request(self, request): res = super(System, self).handle_request(request) if res is not None: return res
hkff/AccMon
accmon/plugins/system.py
Python
gpl-3.0
920
/* * Copyright (C) 2017 GedMarc * * 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.jwebmp.core.htmlbuilder.css.displays; import com.jwebmp.core.base.client.CSSVersions; import com.jwebmp.core.htmlbuilder.css.CSSEnumeration; import com.jwebmp.core.htmlbuilder.css.annotations.CSSAnnotationType; /** * Definition and Usage * <p> * The display property defines how a certain HTML element should be displayed. * Default value: inline Inherited: no Version: * CSS1 JavaScript syntax: object.style.display="inline" * * @author GedMarc * @version 1.0 * @since 2013/01/22 */ @CSSAnnotationType public enum Displays implements CSSEnumeration<Displays> { /** * Default value. Displays an element as an inline element (like &lt;span&gt;) */ Inline, /** * Displays an element as a block element (like * &lt;p&gt; * ) */ Block, /** * Displays an element as an block_level flex container. New in CSS3 */ Flex, /** * Displays an element as an inline_level flex container. New in CSS3 */ Inline_flex, /** * The element is displayed as an inline_level table */ Inline_table, /** * Let the element behave like a &lt;li&gt; element */ List_item, /** * Displays an element as either block or inline, depending on context */ Run_in, /** * Let the element behave like a &lt;table&gt; element */ Table, /** * Let the element behave like a &lt;caption&gt; element */ Table_caption, /** * Let the element behave like a &lt;colgroup&gt; element */ Table_column_group, /** * Let the element behave like a &lt;thead&gt; element */ Table_header_group, /** * Let the element behave like a &lt;tfoot&gt; element */ Table_footer_group, /** * Let the element behave like a &lt;tbody&gt; element */ Table_row_group, /** * Let the element behave like a &lt;td&gt; element */ Table_cell, /** * Let the element behave like a &lt;col&gt; element */ Table_column, /** * Let the element behave like a &lt;tr&gt; element */ Table_row, /** * The element will not be displayed at all (has no effect on layout) */ None, /** * Sets this property to its default value. Read about initial */ Initial, /** * Inherits this property from its parent element. Read about inherit; */ Inherit, /** * Sets this field as not set */ Unset; @Override public String getJavascriptSyntax() { return "style.display"; } @Override public CSSVersions getCSSVersion() { return CSSVersions.CSS1; } @Override public String getValue() { return name(); } @Override public Displays getDefault() { return Unset; } @Override public String toString() { return super.toString() .toLowerCase() .replaceAll("_", "-"); } }
GedMarc/JWebSwing
src/main/java/com/jwebmp/core/htmlbuilder/css/displays/Displays.java
Java
gpl-3.0
3,363