repo_name
stringlengths
4
116
path
stringlengths
4
379
size
stringlengths
1
7
content
stringlengths
3
1.05M
license
stringclasses
15 values
lfreneda/cepdb
api/v1/13216140.jsonp.js
148
jsonp({"cep":"13216140","logradouro":"Rua Concei\u00e7\u00e3o","bairro":"Vila Joana","cidade":"Jundia\u00ed","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/73755120.jsonp.js
161
jsonp({"cep":"73755120","logradouro":"Quadra Quadra 120","bairro":"Jardim Paquet\u00e1 I","cidade":"Planaltina de Goi\u00e1s","uf":"GO","estado":"Goi\u00e1s"});
cc0-1.0
lfreneda/cepdb
api/v1/32015360.jsonp.js
136
jsonp({"cep":"32015360","logradouro":"Rua Dezoito","bairro":"Vila Panam\u00e1","cidade":"Contagem","uf":"MG","estado":"Minas Gerais"});
cc0-1.0
Happyculture/exercices
happy_alexandrie/src/Plugin/Block/LibraryBlock.php
1251
<?php namespace Drupal\happy_alexandrie\Plugin\Block; use Drupal\Core\Block\BlockBase; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Url; /** * Provides a 'LibraryBlock' block. * * @Block( * id = "library_block", * admin_label = @Translation("Library block"), * ) */ class LibraryBlock extends BlockBase { /** * {@inheritdoc} */ public function build() { $build = []; $build['link'] = [ '#type' => 'link', '#url' => Url::fromRoute('happy_alexandrie.alexandrie_controller_welcome'), '#title' => $this->configuration['link_title'], ]; return $build; } /** * {@inheritdoc} */ public function defaultConfiguration() { return [ 'link_title' => 'Visit the library', ]; } /** * {@inheritdoc} */ public function blockForm($form, FormStateInterface $form_state) { $form['link_title'] = [ '#type' => 'textfield', '#title' => $this->t('Link title'), '#default_value' => $this->configuration['link_title'], ]; return $form; } /** * {@inheritdoc} */ public function blockSubmit($form, FormStateInterface $form_state) { $this->setConfigurationValue('link_title', $form_state->getValue('link_title')); } }
cc0-1.0
lfreneda/cepdb
api/v1/90230974.jsonp.js
157
jsonp({"cep":"90230974","logradouro":"Rua Ernesto da Fontoura","bairro":"S\u00e3o Geraldo","cidade":"Porto Alegre","uf":"RS","estado":"Rio Grande do Sul"});
cc0-1.0
lfreneda/cepdb
api/v1/26250335.jsonp.js
155
jsonp({"cep":"26250335","logradouro":"Rua Olga Fran\u00e7a de Moraes","bairro":"Caonze","cidade":"Nova Igua\u00e7u","uf":"RJ","estado":"Rio de Janeiro"});
cc0-1.0
lfreneda/cepdb
api/v1/12949186.jsonp.js
160
jsonp({"cep":"12949186","logradouro":"Alameda Aroeira","bairro":"Loteamento Retiro Recanto Tranquilo","cidade":"Atibaia","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/27281142.jsonp.js
131
jsonp({"cep":"27281142","logradouro":"Rua Cravo","bairro":"Retiro","cidade":"Volta Redonda","uf":"RJ","estado":"Rio de Janeiro"});
cc0-1.0
lfreneda/cepdb
api/v1/26475410.jsonp.js
170
jsonp({"cep":"26475410","logradouro":"Rua Sebasti\u00e3o Lobato Gomes","bairro":"Jardim S\u00e3o Sebasti\u00e3o","cidade":"Japeri","uf":"RJ","estado":"Rio de Janeiro"});
cc0-1.0
lfreneda/cepdb
api/v1/41810970.jsonp.js
124
jsonp({"cep":"41810970","logradouro":"Avenida Paulo VI","bairro":"Pituba","cidade":"Salvador","uf":"BA","estado":"Bahia"});
cc0-1.0
mverwe/UserCode
UserCode/PixelTrackletAnalyzer/src/StripHitAnalyzer.cc
38701
// -*- C++ -*- // // Package: StripHitAnalyzer // Class: StripHitAnalyzer // /**\class StripHitAnalyzer StripHitAnalyzer.cc MitHig/StripHitAnalyzer/src/StripHitAnalyzer.cc Description: <one line class summary> Implementation: Prepare the Hit Tree for analysis */ // // Original Author: Yilmaz Yetkin, Yen-Jie // Created: Tue Sep 30 15:14:28 CEST 2008 // $Id: StripHitAnalyzer.cc,v 1.28 2010/11/09 00:14:40 yjlee Exp $ // // // system include files #include <memory> #include <iostream> #include <vector> #include <string> #include <map> // CMSSW user include files #include "DataFormats/Common/interface/DetSetAlgorithm.h" #include "DataFormats/GeometryVector/interface/GlobalPoint.h" #include "DataFormats/SiPixelDetId/interface/PXBDetId.h" #include "DataFormats/Common/interface/TriggerResults.h" #include "DataFormats/VertexReco/interface/Vertex.h" #include "DataFormats/VertexReco/interface/VertexFwd.h" #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitCollection.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/EDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "FWCore/Common/interface/TriggerNames.h" #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetUnit.h" #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" //#include "Geometry/TrackerGeometryBuilder/interface/TrackerLayerIdAccessor.h" #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" #include "CommonTools/UtilAlgos/interface/TFileService.h" #include "SimDataFormats/TrackingAnalysis/interface/TrackingVertex.h" #include "SimDataFormats/TrackingAnalysis/interface/TrackingVertexContainer.h" #include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h" #include "SimDataFormats/Vertex/interface/SimVertex.h" #include "SimDataFormats/Vertex/interface/SimVertexContainer.h" #include "SimDataFormats/TrackingHit/interface/PSimHit.h" #include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h" #include "SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h" #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetup.h" #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h" #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMapRecord.h" #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerObjectMap.h" #include "DataFormats/BeamSpot/interface/BeamSpot.h" //#include "L1Trigger/GlobalTrigger/interface/L1GlobalTrigger.h" #include "DataFormats/CaloTowers/interface/CaloTower.h" #include "DataFormats/CaloTowers/interface/CaloTowerFwd.h" #include "DataFormats/HcalDetId/interface/HcalSubdetector.h" #include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetUnit.h" #include "DataFormats/DetId/interface/DetId.h" #include "DataFormats/SiStripDetId/interface/StripSubdetector.h" #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2DCollection.h" #include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2DCollection.h" // Heavyion #include "DataFormats/HeavyIonEvent/interface/Centrality.h" //#include "DataFormats/HeavyIonEvent/interface/CentralityProvider.h" // Root include files #include "TTree.h" using namespace std; using namespace edm; using namespace reco; // // class decleration // #define PI 3.14159265358979 #define MAXPARTICLES 500000 #define MAXHITS 500000 #define MAXVTX 100 #define MAXHLTBITS 256 struct PixelEvent{ int nRun; int nEv; int nLumi; int nBX; int nhits1; int nhits2; int nhits3; int nhits4; int ntrks; int ntrksCut; int nHFp; int nHFn; int mult; // Vertex information int nv; float vx[MAXVTX]; float vy[MAXVTX]; float vz[MAXVTX]; float vxError[MAXVTX]; float vyError[MAXVTX]; float vzError[MAXVTX]; float beamSpotX; float beamSpotY; float beamSpotZ; // First layer hit float eta1[MAXHITS]; float phi1[MAXHITS]; float r1[MAXHITS]; float cs1[MAXHITS]; float ch1[MAXHITS]; //int id1[MAXHITS]; //int gp1[MAXHITS]; //int type1[MAXHITS]; // Second layer hit float eta2[MAXHITS]; float phi2[MAXHITS]; float r2[MAXHITS]; float cs2[MAXHITS]; float ch2[MAXHITS]; //int id2[MAXHITS]; //int gp2[MAXHITS]; //int type2[MAXHITS]; // Third layer hit float eta3[MAXHITS]; float phi3[MAXHITS]; float r3[MAXHITS]; float cs3[MAXHITS]; float ch3[MAXHITS]; //int id3[MAXHITS]; //int gp3[MAXHITS]; //int type3[MAXHITS]; // Fourth layer hit float eta4[MAXHITS]; float phi4[MAXHITS]; float r4[MAXHITS]; float cs4[MAXHITS]; float ch4[MAXHITS]; // genparticle int nparticle; float pt[MAXPARTICLES]; float eta[MAXPARTICLES]; float phi[MAXPARTICLES]; int pdg[MAXPARTICLES]; int chg[MAXPARTICLES]; int evtType; float xi; bool passDS; bool passSingleTrack; //float x[MAXPARTICLES]; //float y[MAXPARTICLES]; //float z[MAXPARTICLES]; // hlt int nHLTBit; bool hltBit[MAXHLTBITS]; // l1 int nL1TBit; bool l1TBit[MAXHLTBITS]; int nL1ABit; bool l1ABit[MAXHLTBITS]; // HI int cBin; int nbins; int binsize; float hf; float hftp; float hftm; float hfp; float hfm; float eb; float eep; float eem; float etMid; float nparti; float npartiSigma; float ncoll; float ncollSigma; float nhard; float nhardSigma; float b; float bSigma; float pixel; float zdcp; float zdcm; }; class StripHitAnalyzer : public edm::EDAnalyzer { public: explicit StripHitAnalyzer(const edm::ParameterSet&); ~StripHitAnalyzer(); private: virtual void beginJob() ; virtual void analyze(const edm::Event&, const edm::EventSetup&); virtual void endJob() ; void fillVertices(const edm::Event& iEvent); void fillBeamSpot(const edm::Event& iEvent); void fillHits(const edm::Event& iEvent, const edm::EventSetup& iSetup); void fillParticles(const edm::Event& iEvent); void fillPixelTracks(const edm::Event& iEvent); void fillL1Bits(const edm::Event& iEvent); void fillHLTBits(const edm::Event& iEvent); void fillHF(const edm::Event& iEvent); void fillTracks(const edm::Event& iEvent, const edm::EventSetup& iSetup); void fillCentrality(const edm::Event& iEvent, const edm::EventSetup& iSetup); static bool pairCompare(pair<double,HepMC::FourVector> i, pair<double,HepMC::FourVector> j); template <typename TYPE> void getProduct(const std::string name, edm::Handle<TYPE> &prod, const edm::Event &event) const; template <typename TYPE> bool getProductSafe(const std::string name, edm::Handle<TYPE> &prod, const edm::Event &event) const; // int associateSimhitToTrackingparticle(unsigned int trid ); bool checkprimaryparticle(const TrackingParticle* tp); // ----------member data --------------------------- bool doMC_; bool doHF_; bool doCentrality_; bool doTrackingParticle_; bool doPixel_; bool doTrack_; bool doBeamSpot_; vector<string> vertexSrc_; edm::InputTag trackSrc_; edm::InputTag TowerSrc_; // > 2.87 for HF edm::InputTag beamSpotProducer_; std::vector<edm::InputTag> siStripRecHitInputTags_; edm::InputTag L1gtReadout_; edm::InputTag CentralityTag_; double etaMult_; const TrackerGeometry* trGeo_; edm::Service<TFileService> fs; edm::ESHandle < ParticleDataTable > pdt; edm::Handle<TrackingParticleCollection> trackingParticles; map<int,int> tpmap_; edm::InputTag hltResName_; //HLT trigger results name std::vector<std::string> hltProcNames_; //HLT process name(s) std::vector<std::string> hltTrgNames_; //HLT trigger name(s) std::vector<int> hltTrgBits_; //HLT trigger bit(s) std::vector<bool> hltTrgDeci_; //HLT trigger descision(s) std::vector<std::string> hltTrgUsedNames_; //HLT used trigger name(s) std::string hltUsedResName_; //used HLT trigger results name // CentralityProvider * centrality_; // Root object TTree* pixelTree_; PixelEvent pev_; }; //-------------------------------------------------------------------------------------------------- StripHitAnalyzer::StripHitAnalyzer(const edm::ParameterSet& iConfig) { doMC_ = iConfig.getUntrackedParameter<bool> ("doMC",true); doCentrality_ = iConfig.getUntrackedParameter<bool> ("doCentrality",false); doHF_ = iConfig.getUntrackedParameter<bool> ("doHF",true); doTrackingParticle_ = iConfig.getUntrackedParameter<bool> ("doTrackingParticle",false); doPixel_ = iConfig.getUntrackedParameter<bool> ("doPixel",true); doTrack_ = iConfig.getUntrackedParameter<bool> ("doTrack",true); doBeamSpot_ = iConfig.getUntrackedParameter<bool> ("doBeamSpot",true); vertexSrc_ = iConfig.getParameter<vector<string> >("vertexSrc"); etaMult_ = iConfig.getUntrackedParameter<double> ("nHitsRegion",1.); trackSrc_ = iConfig.getUntrackedParameter<edm::InputTag>("trackSrc",edm::InputTag("generalTracks")); L1gtReadout_ = iConfig.getUntrackedParameter<edm::InputTag>("L1gtReadout",edm::InputTag("gtDigis")); TowerSrc_ = iConfig.getUntrackedParameter<edm::InputTag>("towersSrc",edm::InputTag("towerMaker")); hltResName_ = iConfig.getUntrackedParameter<edm::InputTag>("hltTrgResults",edm::InputTag("TriggerResults")); beamSpotProducer_ = iConfig.getUntrackedParameter<edm::InputTag>("towersSrc",edm::InputTag("offlineBeamSpot")); CentralityTag_ = iConfig.getUntrackedParameter<edm::InputTag>("CentralityTag",edm::InputTag("pACentrality")); siStripRecHitInputTags_ = iConfig.getParameter<std::vector<edm::InputTag> >("RecHitCollections"); // if it's not MC, don't do TrackingParticle if (doMC_ == false) doTrackingParticle_ = false; if (iConfig.exists("hltTrgNames")) hltTrgNames_ = iConfig.getUntrackedParameter<vector<string> >("hltTrgNames"); if (iConfig.exists("hltProcNames")) hltProcNames_ = iConfig.getUntrackedParameter<vector<string> >("hltProcNames"); else { hltProcNames_.push_back("FU"); hltProcNames_.push_back("HLT"); } } //-------------------------------------------------------------------------------------------------- StripHitAnalyzer::~StripHitAnalyzer() { } //-------------------------------------------------------------------------------------------------- void StripHitAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { edm::ESHandle<TrackerGeometry> tGeo; iSetup.get<TrackerDigiGeometryRecord>().get(tGeo); trGeo_ = tGeo.product(); iSetup.getData(pdt); tpmap_.clear(); pev_.nhits1 = 0; pev_.nhits2 = 0; pev_.nhits3 = 0; pev_.nhits4 = 0; pev_.ntrks = 0; pev_.ntrksCut = 0; pev_.mult = 0; pev_.nparticle = 0; pev_.nEv = (int)iEvent.id().event(); pev_.nRun = (int)iEvent.id().run(); pev_.nLumi = (int)iEvent.luminosityBlock(); pev_.nBX = (int)iEvent.bunchCrossing(); pev_.xi = -1; pev_.nv = 0; if (doTrack_) fillTracks(iEvent, iSetup); if (doMC_) fillParticles(iEvent); // cout <<"Fill Vtx"<<endl; fillVertices(iEvent); // cout <<"Fill BeamSpot"<<endl; fillBeamSpot(iEvent); // cout <<"Fill Hits"<<endl; if (doPixel_) fillHits(iEvent, iSetup); fillTracks(iEvent, iSetup); // cout <<"Fill L1"<<endl; fillL1Bits(iEvent); // cout <<"Fill HLT"<<endl; fillHLTBits(iEvent); // cout <<"Fill HF"<<endl; fillHF(iEvent); // cout <<"Fill Centrality"<<endl; if (doCentrality_) fillCentrality(iEvent, iSetup); map<int,int>::iterator begin = tpmap_.begin(); map<int,int>::iterator end = tpmap_.end(); pixelTree_->Fill(); } //-------------------------------------------------------------------------------------------------- void StripHitAnalyzer::fillTracks(const edm::Event& iEvent, const edm::EventSetup& iSetup){ Handle<vector<Track> > etracks; iEvent.getByLabel(trackSrc_, etracks); reco::BeamSpot beamSpot; edm::Handle<reco::BeamSpot> recoBeamSpotHandle; iEvent.getByLabel(beamSpotProducer_,recoBeamSpotHandle); beamSpot = *recoBeamSpotHandle; pev_.ntrks=0; pev_.ntrksCut=0; for(unsigned it=0; it<etracks->size(); ++it){ const reco::Track & etrk = (*etracks)[it]; reco::TrackRef trackRef=reco::TrackRef(etracks,it); pev_.ntrks++; if (etrk.pt()<0.4||fabs(etrk.eta())>0.8) continue; // if(fiducialCut_ && hitDeadPXF(etrk)) continue; // if track hits the dead region, igonore it; if(etrk.quality(reco::TrackBase::qualityByName("highPurity")) != 1) continue; math::XYZPoint v1(pev_.vx[1],pev_.vy[1], pev_.vz[1]); double dz=etrk.dz(v1); double dzError=sqrt(etrk.dzError()*etrk.dzError()+pev_.vzError[1]*pev_.vzError[1]); double dxy=etrk.dxy(v1); double dxyError=sqrt(etrk.dxyError()*etrk.dxyError()+pev_.vxError[1]*pev_.vxError[1]+pev_.vyError[1]*pev_.vyError[1]); if (fabs(dz/dzError)>3||fabs(dxy/dxyError)>3) continue; pev_.ntrksCut++; } } //-------------------------------------------------------------------------------------------------- void StripHitAnalyzer::fillVertices(const edm::Event& iEvent){ // Vertex 0 : pev_vz[0] MC information from TrackingVertexCollection // Vertex 1 - n : Reconstructed Vertex from various of algorithms if(doMC_){ unsigned int daughter = 0; // int nVertex; // nVertex = 0; int greatestvtx = 0; edm::Handle<SimVertexContainer> SimVtx; iEvent.getByLabel("g4SimHits",SimVtx); if (doTrackingParticle_) { Handle<TrackingVertexCollection> vertices; iEvent.getByLabel("mergedtruth","MergedTrackTruth", vertices); //nVertex = vertices->size(); for (unsigned int i = 0 ; i< vertices->size(); ++i){ daughter = (*vertices)[i].nDaughterTracks(); if( daughter >(*vertices)[greatestvtx].nDaughterTracks()&&fabs((*vertices)[i].position().z())<30000) greatestvtx = i; } if(vertices->size()>0&&fabs((*vertices)[greatestvtx].position().z())<30000){ pev_.vx[pev_.nv] = (*vertices)[greatestvtx].position().x(); pev_.vy[pev_.nv] = (*vertices)[greatestvtx].position().y(); pev_.vz[pev_.nv] = (*vertices)[greatestvtx].position().z(); }else{ pev_.vx[pev_.nv] = -99; pev_.vy[pev_.nv] = -99; pev_.vz[pev_.nv] = -99; } } else { pev_.vx[pev_.nv] = -99; pev_.vy[pev_.nv] = -99; pev_.vz[pev_.nv] = -99; edm::SimVertexContainer::const_iterator simVtxItr= SimVtx->begin(); // for (unsigned int iv=0; iv<SimVtx->size(); iv++) { for (unsigned int iv=0; iv<=0; iv++) { //itr->momentum(); if (fabs(simVtxItr->position().Z())<30) { pev_.vx[0]=simVtxItr->position().X(); pev_.vy[0]=simVtxItr->position().Y(); pev_.vz[0]=simVtxItr->position().Z(); }//cout <<pev_.vx[0]<<" "<<pev_.vy[0]<<" "<<pev_.vz[0]<<" "<<simVtxItr->position().T()<<endl; simVtxItr++; } //cout <<"============"<<endl; } pev_.nv++; } else { // Fill a dummy MC information pev_.vz[pev_.nv] = -99; pev_.nv++; } // Fill reconstructed vertices. for(unsigned int iv = 0; iv < vertexSrc_.size(); ++iv){ const reco::VertexCollection * recoVertices; edm::Handle<reco::VertexCollection> vertexCollection; iEvent.getByLabel(vertexSrc_[iv],vertexCollection); recoVertices = vertexCollection.product(); unsigned int daughter = 0; int greatestvtx = 0; for (unsigned int i = 0 ; i< recoVertices->size(); ++i){ daughter = (*recoVertices)[i].tracksSize(); if( daughter > (*recoVertices)[greatestvtx].tracksSize()) greatestvtx = i; // cout <<"Vertex: "<< (*recoVertices)[i].position().z()<<" "<<daughter<<endl; } if(recoVertices->size()>0){ pev_.vx[pev_.nv] = (*recoVertices)[greatestvtx].position().x(); pev_.vy[pev_.nv] = (*recoVertices)[greatestvtx].position().y(); pev_.vz[pev_.nv] = (*recoVertices)[greatestvtx].position().z(); pev_.vxError[pev_.nv] = (*recoVertices)[greatestvtx].xError(); pev_.vyError[pev_.nv] = (*recoVertices)[greatestvtx].yError(); pev_.vzError[pev_.nv] = (*recoVertices)[greatestvtx].zError(); }else{ pev_.vx[pev_.nv] = -99; pev_.vy[pev_.nv] = -99; pev_.vz[pev_.nv] = -99; pev_.vxError[pev_.nv] = 0; pev_.vyError[pev_.nv] = 0; pev_.vzError[pev_.nv] = 0; } pev_.nv++; } } //-------------------------------------------------------------------------------------------------- void StripHitAnalyzer::fillBeamSpot(const edm::Event& iEvent){ // Get the Beam Spot reco::BeamSpot beamSpot; edm::Handle<reco::BeamSpot> recoBeamSpotHandle; iEvent.getByLabel(beamSpotProducer_,recoBeamSpotHandle); beamSpot = *recoBeamSpotHandle; pev_.beamSpotX = beamSpot.x0(); pev_.beamSpotY = beamSpot.y0(); pev_.beamSpotZ = beamSpot.z0(); } //-------------------------------------------------------------------------------------------------- void StripHitAnalyzer::fillHits(const edm::Event& iEvent, const edm::EventSetup& iSetup){ //edm::ESHandle<TrackerGeometry> tracker; //iSetup.get<TrackerDigiGeometryRecord>().get( tracker ); //geo_ = tracker.product(); vector<edm::Handle<SiStripMatchedRecHit2DCollection> > stripColls; iEvent.getManyByType(stripColls); for(vector<edm::Handle<SiStripMatchedRecHit2DCollection> >::const_iterator stripColl = stripColls.begin(); stripColl!= stripColls.end(); stripColl++) { const SiStripMatchedRecHit2DCollection* theStripHits = (*stripColl).product(); for(SiStripMatchedRecHit2DCollection::DataContainer::const_iterator recHit = theStripHits->data().begin(); recHit!= theStripHits->data().end(); recHit++) { DetId id = recHit->geographicalId(); LocalPoint lpos = recHit->localPosition(); GlobalPoint globalPosition = trGeo_->idToDet(id)->toGlobal(lpos); double rhX_= globalPosition.x(); double rhY_= globalPosition.y(); double rhZ_ = globalPosition.z(); double rhR_ = sqrt(rhX_*rhX_+rhY_*rhY_); double rhEta_ = -log(tan(atan2(rhR_,rhZ_)/2.)); double rhPhi_= atan2(rhY_,rhX_); double clSize_=0; double clTotCharge_=0; if(rhR_>20&&rhR_<30) { pev_.cs1[pev_.nhits1] = clSize_; pev_.ch1[pev_.nhits1] = clTotCharge_; pev_.r1[pev_.nhits1] = rhR_; pev_.eta1[pev_.nhits1] = rhEta_; pev_.phi1[pev_.nhits1] = rhPhi_; pev_.nhits1++; } else if (rhR_>30&&rhR_<45){ pev_.cs2[pev_.nhits2] = clSize_; pev_.ch2[pev_.nhits2] = clTotCharge_; pev_.r2[pev_.nhits2] = rhR_; pev_.eta2[pev_.nhits2] = rhEta_; pev_.phi2[pev_.nhits2] = rhPhi_; pev_.nhits2++; } else if (rhR_>45&&rhR_<65) { pev_.cs3[pev_.nhits3] = clSize_; pev_.ch3[pev_.nhits3] = clTotCharge_; pev_.r3[pev_.nhits3] = rhR_; pev_.eta3[pev_.nhits3] = rhEta_; pev_.phi3[pev_.nhits3] = rhPhi_; pev_.nhits3++; } else if (rhR_>65) { pev_.cs4[pev_.nhits4] = clSize_; pev_.ch4[pev_.nhits4] = clTotCharge_; pev_.r4[pev_.nhits4] = rhR_; pev_.eta4[pev_.nhits4] = rhEta_; pev_.phi4[pev_.nhits4] = rhPhi_; pev_.nhits4++; } } } } //-------------------------------------------------------------------------------------------------- void StripHitAnalyzer::fillParticles(const edm::Event& iEvent) { Handle<HepMCProduct> mc; iEvent.getByLabel("generator",mc); const HepMC::GenEvent* evt = mc->GetEvent(); int evtType = evt->signal_process_id(); pev_.evtType = evtType; pev_.passDS = 0; pev_.passSingleTrack = 0; HepMC::GenEvent::particle_const_iterator begin = evt->particles_begin(); HepMC::GenEvent::particle_const_iterator end = evt->particles_end(); int nPos=0; int nNeg=0; for(HepMC::GenEvent::particle_const_iterator it = begin; it != end; ++it){ if((*it)->status() != 1) continue; if ((*it)->momentum().eta()>3&&(*it)->momentum().eta()<5&&(*it)->momentum().e()>3) nPos++; if ((*it)->momentum().eta()>-5&&(*it)->momentum().eta()<-3&&(*it)->momentum().e()>3) nNeg++; tpmap_[(*it)->barcode()] = pev_.nparticle; pev_.pdg[pev_.nparticle] = (*it)->pdg_id(); pev_.eta[pev_.nparticle] = (*it)->momentum().eta(); pev_.phi[pev_.nparticle] = (*it)->momentum().phi(); pev_.pt[pev_.nparticle] = (*it)->momentum().perp(); const ParticleData * part = pdt->particle(pev_.pdg[pev_.nparticle]); pev_.chg[pev_.nparticle] = (int)part->charge(); if (fabs((*it)->momentum().eta())<0.8&&(*it)->momentum().perp()>0.4&&pev_.chg[pev_.nparticle]!=0) pev_.passSingleTrack=1; //pev_.x[pev_.nparticle] = (*it)->production_vertex()->position().x(); //pev_.y[pev_.nparticle] = (*it)->production_vertex()->position().y(); //pev_.z[pev_.nparticle] = (*it)->production_vertex()->position().z(); if (pev_.chg[pev_.nparticle]==0) continue; if (fabs(pev_.eta[pev_.nparticle])>3) continue; pev_.nparticle++; } if (nPos>0&&nNeg>0) pev_.passDS=1; // xi calculation pev_.xi = -1; vector<pair<double,HepMC::FourVector> > particles; for(HepMC::GenEvent::particle_const_iterator p = evt->particles_begin(); p!= evt->particles_end(); p++) { if((*p)->status() == 1) { double e = (*p)->momentum().e(); double pz = (*p)->momentum().pz(); double y = 1./2*log((e+pz)/(e-pz)); particles.push_back(pair<double,HepMC::FourVector> (y, (*p)->momentum()) ); } } sort(particles.begin(), particles.end(), pairCompare); double detamax = 0.; vector<pair<double,HepMC::FourVector> >::const_iterator plast; for(vector<pair<double,HepMC::FourVector> >::const_iterator p = particles.begin(); p!= particles.end() - 1; p++) { double deta = (p+1)->first - p->first; if(deta > detamax) { detamax = deta; plast = p; } } HepMC::FourVector sum_low, sum_hig; for(vector<pair<double,HepMC::FourVector> >::iterator p = particles.begin(); p!= particles.end(); p++) { if(p <= plast) { sum_low.setPx(sum_low.px() + p->second.px()); sum_low.setPy(sum_low.py() + p->second.py()); sum_low.setPz(sum_low.pz() + p->second.pz()); sum_low.setE (sum_low.e() + p->second.e() ); } else { sum_hig.setPx(sum_hig.px() + p->second.px()); sum_hig.setPy(sum_hig.py() + p->second.py()); sum_hig.setPz(sum_hig.pz() + p->second.pz()); sum_hig.setE (sum_hig.e() + p->second.e() ); } } double m_low = sum_low.m(); double m_hig = sum_hig.m(); double Mx = (m_low > m_hig ? m_low : m_hig); pev_.xi = Mx*Mx / (13e+3*13e+3); // 13 TeV } /* //-------------------------------------------------------------------------------------------------- int StripHitAnalyzer::associateSimhitToTrackingparticle(unsigned int trid ) { int ref=-1; const TrackingParticleCollection* TPCProd = trackingParticles.product(); for (TrackingParticleCollection::size_type i=0; i<TPCProd->size(); i++){ const TrackingParticle* tp = &(*TPCProd)[i]; vector <PSimHit> particlesimhits = tp->trackPSimHit(); for(vector<PSimHit>::const_iterator simhit = particlesimhits.begin(); simhit != particlesimhits.end(); ++simhit) { //cout <<" matching TP: "<<i<<" TPsimhitid: "<<simhit->trackId()<<" simhitId: "<<trid<<endl; if(simhit->trackId()==trid)// checkprimaryparticle(tp)) { ref=i; break; } } if (ref!=-1) break; } return ref; } */ //-------------------------------------------------------------------------------------------------- bool StripHitAnalyzer::checkprimaryparticle(const TrackingParticle* tp) { int primarycheck=2; if(((tp->charge()==1)||(tp->charge()==-1))&&(tp->vertex().Rho()<0.2)) { primarycheck=1; } else { primarycheck=0; } return primarycheck; } // ------------ method called once each job just before starting event loop ------------ void StripHitAnalyzer::beginJob() { pixelTree_ = fs->make<TTree>("PixelTree","Tree of Pixel Hits"); pixelTree_->Branch("nEv",&pev_.nEv,"nEv/I"); pixelTree_->Branch("nLumi",&pev_.nLumi,"nLumi/I"); pixelTree_->Branch("nBX",&pev_.nBX,"nBX/I"); pixelTree_->Branch("nRun",&pev_.nRun,"nRun/I"); // Beam spot pixelTree_->Branch("beamSpotX",&pev_.beamSpotX,"beamSpotX/F"); pixelTree_->Branch("beamSpotY",&pev_.beamSpotY,"beamSpotY/F"); pixelTree_->Branch("beamSpotZ",&pev_.beamSpotZ,"beamSpotZ/F"); pixelTree_->Branch("nhits1",&pev_.nhits1,"nhits1/I"); pixelTree_->Branch("nhits2",&pev_.nhits2,"nhits2/I"); pixelTree_->Branch("nhits3",&pev_.nhits3,"nhits3/I"); pixelTree_->Branch("nhits4",&pev_.nhits4,"nhits4/I"); pixelTree_->Branch("ntrks",&pev_.ntrks,"ntrks/I"); pixelTree_->Branch("ntrksCut",&pev_.ntrksCut,"ntrksCut/I"); pixelTree_->Branch("mult",&pev_.mult,"mult/I"); pixelTree_->Branch("nv",&pev_.nv,"nv/I"); pixelTree_->Branch("vx",pev_.vx,"vx[nv]/F"); pixelTree_->Branch("vy",pev_.vy,"vy[nv]/F"); pixelTree_->Branch("vz",pev_.vz,"vz[nv]/F"); pixelTree_->Branch("eta1",pev_.eta1,"eta1[nhits1]/F"); pixelTree_->Branch("phi1",pev_.phi1,"phi1[nhits1]/F"); pixelTree_->Branch("r1",pev_.r1,"r1[nhits1]/F"); //pixelTree_->Branch("id1",pev_.id1,"id1[nhits1]/I"); pixelTree_->Branch("cs1",pev_.cs1,"cs1[nhits1]/F"); pixelTree_->Branch("ch1",pev_.ch1,"ch1[nhits1]/F"); //pixelTree_->Branch("gp1",pev_.gp1,"gp1[nhits1]/I"); //pixelTree_->Branch("type1",pev_.type1,"type1[nhits1]/I"); pixelTree_->Branch("eta2",pev_.eta2,"eta2[nhits2]/F"); pixelTree_->Branch("phi2",pev_.phi2,"phi2[nhits2]/F"); pixelTree_->Branch("r2",pev_.r2,"r2[nhits2]/F"); //pixelTree_->Branch("id2",pev_.id2,"id2[nhits2]/I"); pixelTree_->Branch("cs2",pev_.cs2,"cs2[nhits2]/F"); pixelTree_->Branch("ch2",pev_.ch2,"ch2[nhits2]/F"); //pixelTree_->Branch("gp2",pev_.gp2,"gp2[nhits2]/I"); //pixelTree_->Branch("type2",pev_.type2,"type2[nhits2]/I"); pixelTree_->Branch("eta3",pev_.eta3,"eta3[nhits3]/F"); pixelTree_->Branch("phi3",pev_.phi3,"phi3[nhits3]/F"); pixelTree_->Branch("r3",pev_.r3,"r3[nhits3]/F"); //pixelTree_->Branch("id3",pev_.id3,"id3[nhits3]/I"); pixelTree_->Branch("cs3",pev_.cs3,"cs3[nhits3]/F"); pixelTree_->Branch("ch3",pev_.ch3,"ch3[nhits3]/F"); //pixelTree_->Branch("gp3",pev_.gp3,"gp3[nhits3]/I"); //pixelTree_->Branch("type3",pev_.type3,"type3[nhits3]/I"); pixelTree_->Branch("eta4",pev_.eta4,"eta4[nhits4]/F"); pixelTree_->Branch("phi4",pev_.phi4,"phi4[nhits4]/F"); pixelTree_->Branch("r4",pev_.r4,"r4[nhits4]/F"); //pixelTree_->Branch("id4",pev_.id4,"id4[nhits4]/I"); pixelTree_->Branch("cs4",pev_.cs4,"cs4[nhits4]/F"); pixelTree_->Branch("ch4",pev_.ch4,"ch4[nhits4]/F"); //pixelTree_->Branch("gp4",pev_.gp4,"gp4[nhits4]/I"); //pixelTree_->Branch("type4",pev_.type4,"type4[nhits4]/I"); pixelTree_->Branch("evtType",&pev_.evtType,"evtType/I"); pixelTree_->Branch("npart",&pev_.nparticle,"npart/I"); pixelTree_->Branch("pt",pev_.pt,"pt[npart]/F"); pixelTree_->Branch("eta",pev_.eta,"eta[npart]/F"); pixelTree_->Branch("phi",pev_.phi,"phi[npart]/F"); pixelTree_->Branch("pdg",pev_.pdg,"pdg[npart]/I"); pixelTree_->Branch("chg",pev_.chg,"chg[npart]/I"); pixelTree_->Branch("xi",&pev_.xi,"xi/F"); pixelTree_->Branch("passDS",&pev_.passDS,"passDS/O"); pixelTree_->Branch("passSingleTrack",&pev_.passSingleTrack,"passSingleTrack/O"); /* Not needed anymore pixelTree_->Branch("x",pev_.x,"x[npart]/F"); pixelTree_->Branch("y",pev_.y,"y[npart]/F"); pixelTree_->Branch("z",pev_.z,"z[npart]/F"); */ pixelTree_->Branch("nHLTBit",&pev_.nHLTBit,"nHLTBit/I"); pixelTree_->Branch("hltBit",pev_.hltBit,"hltBit[nHLTBit]/O"); pixelTree_->Branch("nL1T",&pev_.nL1TBit,"nL1T/I"); pixelTree_->Branch("L1T",pev_.l1TBit,"L1T[nL1T]/O"); pixelTree_->Branch("nL1A",&pev_.nL1ABit,"nL1A/I"); pixelTree_->Branch("L1A",pev_.l1ABit,"L1A[nL1A]/O"); // HI related pixelTree_->Branch("zdcp",&pev_.zdcp,"zdcp/F"); pixelTree_->Branch("zdcm",&pev_.zdcm,"zdcm/F"); pixelTree_->Branch("hf",&pev_.hf,"hf/F"); pixelTree_->Branch("hftp",&pev_.hftp,"hftp/F"); pixelTree_->Branch("hftm",&pev_.hftm,"hftm/F"); pixelTree_->Branch("hfp",&pev_.hfp,"hfp/F"); pixelTree_->Branch("hfm",&pev_.hfm,"hfm/F"); pixelTree_->Branch("etMid",&pev_.etMid,"etMid/F"); pixelTree_->Branch("eb",&pev_.eb,"eb/F"); pixelTree_->Branch("eep",&pev_.eep,"eep/F"); pixelTree_->Branch("eem",&pev_.eem,"eem/F"); pixelTree_->Branch("cBin",&pev_.cBin,"cBin/I"); pixelTree_->Branch("nbins",&pev_.nbins,"nbins/I"); pixelTree_->Branch("binsize",&pev_.binsize,"binsize/I"); pixelTree_->Branch("nparti",&pev_.nparti,"nparti/F"); pixelTree_->Branch("npartiSigma",&pev_.npartiSigma,"npartiSigma/F"); pixelTree_->Branch("ncoll",&pev_.ncoll,"ncoll/F"); pixelTree_->Branch("ncollSigma",&pev_.ncollSigma,"ncollSigma/F"); pixelTree_->Branch("nhard",&pev_.nhard,"nhard/F"); pixelTree_->Branch("nhardSigma",&pev_.nhardSigma,"nhardSigma/F"); pixelTree_->Branch("b",&pev_.b,"b/F"); pixelTree_->Branch("bSigma",&pev_.bSigma,"bSigma/F"); pixelTree_->Branch("pixel",&pev_.pixel,"pixel/F"); pixelTree_->Branch("nHFp",&pev_.nHFp,"nHFp/I"); pixelTree_->Branch("nHFn",&pev_.nHFn,"nHFn/I"); HLTConfigProvider hltConfig; /* cout <<"Configure hlt"<<endl; string teststr; // setup "Any" bit hltTrgBits_.clear(); hltTrgBits_.push_back(-1); hltTrgDeci_.clear(); hltTrgDeci_.push_back(true); hltTrgUsedNames_.clear(); hltTrgUsedNames_.push_back("Any"); // figure out relation of trigger name to trigger bit and store used trigger names/bits for(size_t i=0;i<hltTrgNames_.size();++i) { const string &n1(hltTrgNames_.at(i)); bool found = 0; for(size_t j=0;j<hltConfig.size();++j) { const string &n2(hltConfig.triggerName(j)); if (n2==n1) { hltTrgBits_.push_back(j); hltTrgUsedNames_.push_back(n1); hltTrgDeci_.push_back(false); cout <<Form("Added trigger %d with name %s for bit %d", hltTrgBits_.size()-1, n1.c_str(), j)<<endl; found = 1; break; } } if (!found) { cout <<Form("Could not find trigger bit for %s", n1.c_str())<<endl; } } // ensure that trigger collections are of same size if (hltTrgBits_.size()!=hltTrgUsedNames_.size()) cout <<Form("Size of trigger bits not equal used names: %d %d", hltTrgBits_.size(), hltTrgUsedNames_.size())<<endl; if (hltTrgDeci_.size()!=hltTrgUsedNames_.size()) cout <<Form("Size of decision bits not equal names: %d %d", hltTrgDeci_.size(), hltTrgUsedNames_.size())<<endl; */ } //-------------------------------------------------------------------------------------------------- void StripHitAnalyzer::fillPixelTracks(const edm::Event& iEvent){ /* // First fish the pixel tracks out of the event edm::Handle<reco::TrackCollection> trackCollection; edm::InputTag trackCollName = trackSrc_; iEvent.getByLabel(trackCollName,trackCollection); const reco::TrackCollection tracks = *(trackCollection.product()); reco::TrackRefVector trks; for (unsigned int i=0; i<tracks.size(); i++) { if (tracks[i].pt() > 0.15) trks.push_back( reco::TrackRef(trackCollection, i) ); } pev_.ntrksCut = trks.size(); pev_.ntrks = tracks.size(); */ } //-------------------------------------------------------------------------------------------------- void StripHitAnalyzer::fillL1Bits(const edm::Event &iEvent) { edm::Handle< L1GlobalTriggerReadoutRecord > L1GlobalTrigger; iEvent.getByLabel(L1gtReadout_, L1GlobalTrigger); const TechnicalTriggerWord& technicalTriggerWordBeforeMask = L1GlobalTrigger->technicalTriggerWord(); for (int i=0; i<64;i++) { pev_.l1TBit[i] = technicalTriggerWordBeforeMask.at(i); } pev_.nL1TBit = 64; int ntrigs = L1GlobalTrigger->decisionWord().size(); pev_.nL1ABit = ntrigs; for (int i=0; i != ntrigs; i++) { bool accept = L1GlobalTrigger->decisionWord()[i]; pev_.l1ABit[i] = (accept == true)? 1:0; } } //-------------------------------------------------------------------------------------------------- void StripHitAnalyzer::fillHLTBits(const edm::Event &iEvent) { // Fill HLT trigger bits. Handle<TriggerResults> triggerResultsHLT; iEvent.getByLabel(hltResName_,triggerResultsHLT); // getProduct(hltResName_, triggerResultsHLT, iEvent); const TriggerResults *hltResults = triggerResultsHLT.product(); const TriggerNames & triggerNames = iEvent.triggerNames(*hltResults); pev_.nHLTBit = triggerNames.size(); for(size_t i=0;i<triggerNames.size();++i) { cout <<triggerNames.triggerName(i)<<endl; pev_.hltBit[i] = triggerResultsHLT->accept(i); } } //-------------------------------------------------------------------------------------------------- void StripHitAnalyzer::fillCentrality(const edm::Event& iEvent, const edm::EventSetup& iSetup) { edm::Handle<reco::Centrality> centrality; iEvent.getByLabel(CentralityTag_, centrality); /* hiNpix = centrality->multiplicityPixel(); hiNpixelTracks = centrality->NpixelTracks(); hiNtracks = centrality->Ntracks(); hiNtracksPtCut = centrality->NtracksPtCut(); hiNtracksEtaCut = centrality->NtracksEtaCut(); hiNtracksEtaPtCut = centrality->NtracksEtaPtCut(); hiHF = centrality->EtHFtowerSum(); hiHFplus = centrality->EtHFtowerSumPlus(); hiHFminus = centrality->EtHFtowerSumMinus(); hiHFplusEta4 = centrality->EtHFtruncatedPlus(); hiHFminusEta4 = centrality->EtHFtruncatedMinus(); hiHFhit = centrality->EtHFhitSum(); hiHFhitPlus = centrality->EtHFhitSumPlus(); hiHFhitMinus = centrality->EtHFhitSumMinus(); hiZDC = centrality->zdcSum(); hiZDCplus = centrality->zdcSumPlus(); hiZDCminus = centrality->zdcSumMinus(); hiEEplus = centrality->EtEESumPlus(); hiEEminus = centrality->EtEESumMinus(); hiEE = centrality->EtEESum(); hiEB = centrality->EtEBSum(); hiET = centrality->EtMidRapiditySum(); centrality_->newEvent(iEvent,iSetup); */ pev_.hf = centrality->EtHFhitSum(); pev_.hftp = (double)centrality->EtHFtowerSumPlus(); pev_.hftm = (double)centrality->EtHFtowerSumMinus(); pev_.zdcp = (double)centrality->zdcSumPlus(); pev_.zdcm = (double)centrality->zdcSumMinus(); pev_.hfp = (double)centrality->EtHFhitSumPlus(); pev_.hfm = (double)centrality->EtHFhitSumMinus(); pev_.etMid = (double)centrality->EtMidRapiditySum(); pev_.eb = (double)centrality->EtEBSum(); pev_.eep = (double)centrality->EtEESumPlus(); pev_.eem = (double)centrality->EtEESumMinus(); /* pev_.cBin = (int)centrality->getBin(); pev_.nbins = (int)centrality->getNbins(); pev_.binsize = (int)(100/centrality->getNbins() ); pev_.nparti = (double)centrality->NpartMean(); pev_.npartiSigma = (double)centrality->NpartSigma(); pev_.ncoll = (double)centrality->NcollMean(); pev_.ncollSigma = (double)centrality->NcollSigma(); pev_.nhard = (double)centrality->NhardMean(); pev_.nhardSigma = (double)centrality->NhardSigma(); pev_.b = (double)centrality->bMean(); pev_.bSigma = (double)centrality->bSigma(); */ pev_.pixel = (double)centrality->multiplicityPixel(); } void StripHitAnalyzer::fillHF(const edm::Event& iEvent) { edm::Handle<CaloTowerCollection> towers; iEvent.getByLabel(TowerSrc_,towers); int negTowers = 0; int posTowers = 0; for(CaloTowerCollection::const_iterator cal = towers->begin(); cal != towers->end(); ++cal) { for(unsigned int i = 0; i < cal->constituentsSize(); i++) { const DetId id = cal->constituent(i); if(id.det() == DetId::Hcal) { HcalSubdetector subdet=(HcalSubdetector(id.subdetId())); if(subdet == HcalForward) { if(cal->energy()>3. && cal->eta()<-3.) negTowers++; if(cal->energy()>3. && cal->eta()>3.) posTowers++; } } } } pev_.nHFp = posTowers; pev_.nHFn = negTowers; } //-------------------------------------------------------------------------------------------------- template <typename TYPE> inline void StripHitAnalyzer::getProduct(const std::string name, edm::Handle<TYPE> &prod, const edm::Event &event) const { // Try to access data collection from EDM file. We check if we really get just one // product with the given name. If not we throw an exception. event.getByLabel(edm::InputTag(name),prod); if (!prod.isValid()) throw edm::Exception(edm::errors::Configuration, "StripHitAnalyzer::GetProduct()\n") << "Collection with label '" << name << "' is not valid" << std::endl; } //-------------------------------------------------------------------------------------------------- template <typename TYPE> inline bool StripHitAnalyzer::getProductSafe(const std::string name, edm::Handle<TYPE> &prod, const edm::Event &event) const { // Try to safely access data collection from EDM file. We check if we really get just one // product with the given name. If not, we return false. if (name.size()==0) return false; try { event.getByLabel(edm::InputTag(name),prod); if (!prod.isValid()) return false; } catch (...) { return false; } return true; } // ------------ method called once each job just after ending the event loop ------------ void StripHitAnalyzer::endJob() { } // -------------------------------------------------------------------------------------------------- bool StripHitAnalyzer::pairCompare(pair<double,HepMC::FourVector> i, pair<double,HepMC::FourVector> j) { return (i.first < j.first); } //define this as a plug-in DEFINE_FWK_MODULE(StripHitAnalyzer);
cc0-1.0
lfreneda/cepdb
api/v1/90660190.jsonp.js
146
jsonp({"cep":"90660190","logradouro":"Rua Primeiro de Maio","bairro":"Partenon","cidade":"Porto Alegre","uf":"RS","estado":"Rio Grande do Sul"});
cc0-1.0
lfreneda/cepdb
api/v1/72641134.jsonp.js
165
jsonp({"cep":"72641134","logradouro":"Quadra Quadra 605 Conjunto 23-C","bairro":"Recanto das Emas","cidade":"Bras\u00edlia","uf":"DF","estado":"Distrito Federal"});
cc0-1.0
lfreneda/cepdb
api/v1/75053878.jsonp.js
148
jsonp({"cep":"75053878","logradouro":"Rua Sirus","bairro":"Residencial Centen\u00e1rio","cidade":"An\u00e1polis","uf":"GO","estado":"Goi\u00e1s"});
cc0-1.0
lfreneda/cepdb
api/v1/70834060.jsonp.js
149
jsonp({"cep":"70834060","logradouro":"Quadra SQN 402 Bloco F","bairro":"Asa Norte","cidade":"Bras\u00edlia","uf":"DF","estado":"Distrito Federal"});
cc0-1.0
lfreneda/cepdb
api/v1/41650000.jsonp.js
143
jsonp({"cep":"41650000","logradouro":"Avenida Oct\u00e1vio Mangabeira","bairro":"Piat\u00e3","cidade":"Salvador","uf":"BA","estado":"Bahia"});
cc0-1.0
lfreneda/cepdb
api/v1/69093326.jsonp.js
139
jsonp({"cep":"69093326","logradouro":"Rua 2","bairro":"Col\u00f4nia Santo Ant\u00f4nio","cidade":"Manaus","uf":"AM","estado":"Amazonas"});
cc0-1.0
lfreneda/cepdb
api/v1/72610206.jsonp.js
162
jsonp({"cep":"72610206","logradouro":"Quadra Quadra 202 Conjunto 6","bairro":"Recanto das Emas","cidade":"Bras\u00edlia","uf":"DF","estado":"Distrito Federal"});
cc0-1.0
lfreneda/cepdb
api/v1/64012642.jsonp.js
136
jsonp({"cep":"64012642","logradouro":"Quadra X","bairro":"Santa Maria da Codipe","cidade":"Teresina","uf":"PI","estado":"Piau\u00ed"});
cc0-1.0
lfreneda/cepdb
api/v1/67100210.jsonp.js
153
jsonp({"cep":"67100210","logradouro":"Passagem Nossa Senhora de F\u00e1tima","bairro":"Marituba","cidade":"Ananindeua","uf":"PA","estado":"Par\u00e1"});
cc0-1.0
lfreneda/cepdb
api/v1/39401832.jsonp.js
163
jsonp({"cep":"39401832","logradouro":"Avenida Doutor Jos\u00e9 Correia Machado","bairro":"Ibituruna","cidade":"Montes Claros","uf":"MG","estado":"Minas Gerais"});
cc0-1.0
lfreneda/cepdb
api/v1/77060130.jsonp.js
150
jsonp({"cep":"77060130","logradouro":"Rua Espirito Santo","bairro":"Jardim Aureny I (Taquaralto)","cidade":"Palmas","uf":"TO","estado":"Tocantins"});
cc0-1.0
lfreneda/cepdb
api/v1/13401587.jsonp.js
146
jsonp({"cep":"13401587","logradouro":"Rua Etore Galesi","bairro":"Monte L\u00edbano","cidade":"Piracicaba","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/08381020.jsonp.js
178
jsonp({"cep":"08381020","logradouro":"Rua Pir\u00e2mide dos Piques","bairro":"Jardim da Laranjeira (Zona Leste)","cidade":"S\u00e3o Paulo","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/49055630.jsonp.js
160
jsonp({"cep":"49055630","logradouro":"Travessa S\u00e3o Crist\u00f3vao Velho","bairro":"Get\u00falio Vargas","cidade":"Aracaju","uf":"SE","estado":"Sergipe"});
cc0-1.0
lfreneda/cepdb
api/v1/18703766.jsonp.js
156
jsonp({"cep":"18703766","logradouro":"Rua Cabo Franscisco Verpa","bairro":"Vila Oper\u00e1ria","cidade":"Avar\u00e9","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/14804153.jsonp.js
185
jsonp({"cep":"14804153","logradouro":"Pra\u00e7a Doutor Raphael C. Calabria Tancredi","bairro":"Jardim \u00c1guas do Paiol","cidade":"Araraquara","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/69009340.jsonp.js
131
jsonp({"cep":"69009340","logradouro":"Rua Doutor Celso","bairro":"Puraquequara","cidade":"Manaus","uf":"AM","estado":"Amazonas"});
cc0-1.0
lfreneda/cepdb
api/v1/21010060.jsonp.js
143
jsonp({"cep":"21010060","logradouro":"Rua Igacaba","bairro":"Parada de Lucas","cidade":"Rio de Janeiro","uf":"RJ","estado":"Rio de Janeiro"});
cc0-1.0
lfreneda/cepdb
api/v1/76907874.jsonp.js
157
jsonp({"cep":"76907874","logradouro":"Rua Heitor Guilherme","bairro":"Parque S\u00e3o Pedro","cidade":"Ji-Paran\u00e1","uf":"RO","estado":"Rond\u00f4nia"});
cc0-1.0
lfreneda/cepdb
api/v1/04601070.jsonp.js
163
jsonp({"cep":"04601070","logradouro":"Rua Comendador Eduardo Saccab","bairro":"Brooklin Paulista","cidade":"S\u00e3o Paulo","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/95045282.jsonp.js
166
jsonp({"cep":"95045282","logradouro":"Rua Victor Mocelin","bairro":"Nossa Senhora do Ros\u00e1rio","cidade":"Caxias do Sul","uf":"RS","estado":"Rio Grande do Sul"});
cc0-1.0
lfreneda/cepdb
api/v1/74966690.jsonp.js
175
jsonp({"cep":"74966690","logradouro":"Avenida Dom Fernando Gomes dos Santos","bairro":"Jardim Riviera","cidade":"Aparecida de Goi\u00e2nia","uf":"GO","estado":"Goi\u00e1s"});
cc0-1.0
lfreneda/cepdb
api/v1/68458150.jsonp.js
134
jsonp({"cep":"68458150","logradouro":"Rua G","bairro":"Jardim Para\u00edso","cidade":"Tucuru\u00ed","uf":"PA","estado":"Par\u00e1"});
cc0-1.0
lfreneda/cepdb
api/v1/74075140.jsonp.js
134
jsonp({"cep":"74075140","logradouro":"Rua 13 A","bairro":"Setor Aeroporto","cidade":"Goi\u00e2nia","uf":"GO","estado":"Goi\u00e1s"});
cc0-1.0
lfreneda/cepdb
api/v1/79064120.jsonp.js
158
jsonp({"cep":"79064120","logradouro":"Rua Ubirajara Guarani","bairro":"Vila Cidade Morena","cidade":"Campo Grande","uf":"MS","estado":"Mato Grosso do Sul"});
cc0-1.0
lfreneda/cepdb
api/v1/29201455.jsonp.js
153
jsonp({"cep":"29201455","logradouro":"Rua Manoel de Almeida","bairro":"Praia do Riacho","cidade":"Guarapari","uf":"ES","estado":"Esp\u00edrito Santo"});
cc0-1.0
lfreneda/cepdb
api/v1/38072680.jsonp.js
145
jsonp({"cep":"38072680","logradouro":"Rua Orlando Moreira da Silva","bairro":"Boa Vista","cidade":"Uberaba","uf":"MG","estado":"Minas Gerais"});
cc0-1.0
lfreneda/cepdb
api/v1/15025075.jsonp.js
179
jsonp({"cep":"15025075","logradouro":"Rua Delegado Pinto de Toledo","bairro":"Parque Industrial","cidade":"S\u00e3o Jos\u00e9 do Rio Preto","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/69087132.jsonp.js
134
jsonp({"cep":"69087132","logradouro":"Rua Pedras Corais","bairro":"Tancredo Neves","cidade":"Manaus","uf":"AM","estado":"Amazonas"});
cc0-1.0
lfreneda/cepdb
api/v1/23836600.jsonp.js
150
jsonp({"cep":"23836600","logradouro":"Rua Rio das Flores","bairro":"Cidade Industrial","cidade":"Itagua\u00ed","uf":"RJ","estado":"Rio de Janeiro"});
cc0-1.0
lfreneda/cepdb
api/v1/05333060.jsonp.js
169
jsonp({"cep":"05333060","logradouro":"Pra\u00e7a Ant\u00f4nio Moreira da Costa","bairro":"Jaguar\u00e9","cidade":"S\u00e3o Paulo","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
amarriner/hearthstone-art
src/js/controllers/cards.js
5338
(function() { 'use strict'; var module = angular.module('hearthstone-art.cardsController', []) .controller('CardsController', ['$scope', '$uibModal', '$filter', 'Cards', function($scope, $uibModal, $filter, Cards) { $scope.index = 0; $scope.collectible = true; $scope.name = ""; $scope.rarity = 'COMMON'; $scope.set = 'EXPERT1'; Cards.getSets().get(function(data) { $scope.sets = data; }); Cards.getRarities().get(function(data) { $scope.rarities = data; }); Cards.getCards().get(function(data) { $scope.CARDS = data; $scope.filterCards(); }); $scope.filterCards = function() { $scope.cards = $filter('orderBy')($filter('filter')($scope.CARDS, { collectible: $scope.collectible || undefined, name: $scope.name, rarity: $scope.rarity, set: $scope.set }), 'name'); return $scope.cards; }; $scope.open = function (i) { var modalInstance = $uibModal.open({ templateUrl: 'js/views/card.html', controller: 'CardModalController', resolve: { index: function() { return i; }, cards: function() { return $scope.cards; } } }); }; } ]) .controller('CardModalController', ['$http', '$scope', '$uibModalInstance', 'cards', 'imageHost', 'index', 'Cards', function ($http, $scope, $uibModalInstance, cards, imageHost, index, Cards) { $scope.cards = cards; $scope.index = index; $scope.image = null; $scope.imageError = false; $scope.imageHost = imageHost; $scope.viewCardImage = true; Cards.getSets().get(function(data) { $scope.sets = data; }); Cards.getRarities().get(function(data) { $scope.rarities = data; }); $scope.getRarity = function(rarity) { if (!$scope.rarities) { return ''; } for (var i = 0; i < $scope.rarities.length; i++) { if (rarity === $scope.rarities[i].rarity) { return $scope.rarities[i].label; } } return ''; }; $scope.getSet = function(set) { if (!$scope.sets) { return ''; } for (var i = 0; i < $scope.sets.length; i++) { if (set === $scope.sets[i].set) { return $scope.sets[i].label; } } return ''; }; $scope.initCap = function(str) { return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase(); }; $scope.next = function() { if (!$scope.cards.length) { return; } $scope.index++; if ($scope.index >= $scope.cards.length) { $scope.index = 0; } $scope.setImage(); }; $scope.prev = function() { if (!$scope.cards.length) { return; } $scope.index--; if ($scope.index < 0) { $scope.index = $scope.cards.length - 1; } $scope.setImage(); }; $scope.setImage = function(i) { if (i) { $scope.index = i; } if (!$scope.cards) { return; } $scope.image = null; $scope.imageError = false; $http.get($scope.imageHost + '/' + $scope.cards[$scope.index].id + '.png', {responseType: 'arraybuffer'}) .then( function (response) { var blob = new Blob([response.data], {type: 'image/png'}); $scope.image = (window.URL || window.webkitURL).createObjectURL(blob); }, function (error) { $scope.imageError = true; } ); }; $scope.toggle = function() { $scope.viewCardImage = !$scope.viewCardImage; }; $scope.setImage(); } ]); }());
cc0-1.0
lfreneda/cepdb
api/v1/50680440.jsonp.js
126
jsonp({"cep":"50680440","logradouro":"Rua Pesqueiro","bairro":"Iputinga","cidade":"Recife","uf":"PE","estado":"Pernambuco"});
cc0-1.0
lfreneda/cepdb
api/v1/35930128.jsonp.js
154
jsonp({"cep":"35930128","logradouro":"Rua Ma\u00edza Maximiano","bairro":"Industrial","cidade":"Jo\u00e3o Monlevade","uf":"MG","estado":"Minas Gerais"});
cc0-1.0
lfreneda/cepdb
api/v1/96836400.jsonp.js
174
jsonp({"cep":"96836400","logradouro":"Avenida Deputado Euclydes Nicolau Kliemann","bairro":"Progresso","cidade":"Santa Cruz do Sul","uf":"RS","estado":"Rio Grande do Sul"});
cc0-1.0
lfreneda/cepdb
api/v1/55028240.jsonp.js
136
jsonp({"cep":"55028240","logradouro":"Rua do Cauc\u00e1sio","bairro":"Santa Rosa","cidade":"Caruaru","uf":"PE","estado":"Pernambuco"});
cc0-1.0
lfreneda/cepdb
api/v1/13406526.jsonp.js
159
jsonp({"cep":"13406526","logradouro":"Rua Aristides Balbino","bairro":"Grande Parque Residencial","cidade":"Piracicaba","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/41650045.jsonp.js
124
jsonp({"cep":"41650045","logradouro":"Rua Carapeba","bairro":"Piat\u00e3","cidade":"Salvador","uf":"BA","estado":"Bahia"});
cc0-1.0
lfreneda/cepdb
api/v1/93230864.jsonp.js
147
jsonp({"cep":"93230864","logradouro":"Rua Santos Dumont","bairro":"Boa Vista","cidade":"Sapucaia do Sul","uf":"RS","estado":"Rio Grande do Sul"});
cc0-1.0
lfreneda/cepdb
api/v1/69304410.jsonp.js
129
jsonp({"cep":"69304410","logradouro":"Rua Manoel Aires","bairro":"Mecejana","cidade":"Boa Vista","uf":"RR","estado":"Roraima"});
cc0-1.0
jEdwinCo/tdd_coursera
week1/images/6.java
1109
import static org.junit.Assert.*; import java.util.List; import org.junit.Test; public class TesteCamelCase { @Test public void test() { CamelCaseSplit cc_split = new CamelCaseSplit(); } @Test public void testeUmaPalabra() { CamelCaseSplit cc_split = new CamelCaseSplit(); List<String> lista; lista = cc_split.converterCamelCase("nome"); assertEquals(1,lista.size()); assertEquals("nome", lista.get(0)); } @Test public void testeUmaPalabraMaisculo() { CamelCaseSplit cc_split = new CamelCaseSplit(); List<String> lista; lista = cc_split.converterCamelCase("Nome"); assertEquals(1,lista.size()); assertEquals("nome", lista.get(0)); } @Test public void testeDoisPalabra() { CamelCaseSplit cc_split = new CamelCaseSplit(); List<String> lista; lista = cc_split.converterCamelCase("nomeComposto"); assertEquals(2,lista.size()); assertEquals("nome", lista.get(1)); assertEquals("composto", lista.get(0)); } }
cc0-1.0
biomodels/MODEL2937159804
setup.py
377
from setuptools import setup, find_packages setup(name='MODEL2937159804', version=20140916, description='MODEL2937159804 from BioModels', url='http://www.ebi.ac.uk/biomodels-main/MODEL2937159804', maintainer='Stanley Gu', maintainer_url='stanleygu@gmail.com', packages=find_packages(), package_data={'': ['*.xml', 'README.md']}, )
cc0-1.0
lfreneda/cepdb
api/v1/17035640.jsonp.js
133
jsonp({"cep":"17035640","logradouro":"Rua Doze","bairro":"Jardim Alto Bauru","cidade":"Bauru","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/71593315.jsonp.js
165
jsonp({"cep":"71593315","logradouro":"Quadra 326 Conjunto A","bairro":"Del Lago II (Parano\u00e1)","cidade":"Bras\u00edlia","uf":"DF","estado":"Distrito Federal"});
cc0-1.0
lfreneda/cepdb
api/v1/74845470.jsonp.js
141
jsonp({"cep":"74845470","logradouro":"Rua J 3","bairro":"Vila Reden\u00e7\u00e3o","cidade":"Goi\u00e2nia","uf":"GO","estado":"Goi\u00e1s"});
cc0-1.0
lfreneda/cepdb
api/v1/68374719.jsonp.js
130
jsonp({"cep":"68374719","logradouro":"Travessa Treze","bairro":"Bela Vista","cidade":"Altamira","uf":"PA","estado":"Par\u00e1"});
cc0-1.0
wyozi/hash.js
main.js
1179
var config = require( "./config" ); // // Connection Handler // bot.on( "Connected", function() { this.setStatus( "Online" ); this.setChat( config.Group ); } ); // // Default Commands // bot.registerCommand( "update", function( name, steamID ) { if ( bot.isAdmin( steamID ) ) process.exit( 1 ); } ); // // CLI Output // function print( str ) { console.log( str.replace( /[\x00-\x09]/g, "" ) ); } bot.on( "Connected", function() { print( "Connected." ); } ); bot.on( "Disconnected", function() { print( "Lost Connection." ); } ); bot.on( "Message", function( name, steamID, msg ) { print( name + ": " + msg ); } ); bot.on( "UserConnected", function( name, steamID ) { print( name + " (" + steamID + ") connected." ); } ); bot.on( "UserDisconnected", function( name, steamID ) { print( name + " (" + steamID + ") disconnected." ); } ); bot.on( "UserKicked", function( target, _, actor ) { print( target + " was kicked by " + actor + "." ); } ); bot.on( "UserBanned", function( target, _, actor ) { print( target + " was banned by " + actor + "." ); } ); // // Init connection! // bot.connect( config.User, config.Pass ); // Here we go!
cc0-1.0
lfreneda/cepdb
api/v1/31515060.jsonp.js
179
jsonp({"cep":"31515060","logradouro":"Rua Antenor Perdig\u00e3o","bairro":"S\u00e3o Jo\u00e3o Batista (Venda Nova)","cidade":"Belo Horizonte","uf":"MG","estado":"Minas Gerais"});
cc0-1.0
lfreneda/cepdb
api/v1/26325190.jsonp.js
135
jsonp({"cep":"26325190","logradouro":"Rua Guarapuava","bairro":"Queimados","cidade":"Queimados","uf":"RJ","estado":"Rio de Janeiro"});
cc0-1.0
lfreneda/cepdb
api/v1/30692670.jsonp.js
172
jsonp({"cep":"30692670","logradouro":"Rua das Laranjeiras","bairro":"Maril\u00e2ndia Jatob\u00e1 (Barreiro)","cidade":"Belo Horizonte","uf":"MG","estado":"Minas Gerais"});
cc0-1.0
lfreneda/cepdb
api/v1/08452120.jsonp.js
137
jsonp({"cep":"08452120","logradouro":"Rua Avacambui","bairro":"Lajeado","cidade":"S\u00e3o Paulo","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
jdanyow/edge-promise
jspm_packages/npm/aurelia-pal@1.0.0-beta.1.0.1/aurelia-pal.d.ts
9981
declare module 'aurelia-pal' { /** * Enables discovery of what features the runtime environment supports. */ export interface Feature { /** * Does the runtime environment support ShadowDOM? */ shadowDOM: boolean; /** * Does the runtime environment support the css scoped attribute? */ scopedCSS: boolean; /** * Does the runtime environment support native HTMLTemplateElement? */ htmlTemplateElement: boolean; /** * Does the runtime environment support Object.observe? */ objectObserve: boolean; /** * Does the runtime environment support Array.observe? */ arrayObserve: boolean; } /** * The runtime's performance API. */ export interface Performance { now(): number; } /** * Represents the core APIs of the runtime environment. */ export interface Platform { /** * The runtime environment's global. */ global: Object; /** * A function wich does nothing. */ noop: Function; /** * The runtime's location API. */ location: Object; /** * The runtime's history API. */ history: Object; /** * The runtime's performance API */ performance: Performance; /** * Registers a function to call when the system is ready to update (repaint) the display. * @param callback The function to call. */ requestAnimationFrame(callback: ((animationFrameStart: number) => void)): number; /** * The runtime's XMLHttpRequest API. */ XMLHttpRequest: XMLHttpRequest; /** * Iterate all modules loaded by the script loader. * @param callback A callback that will receive each module id along with the module object. Return true to end enumeration. */ eachModule(callback: ((key: string, value: Object) => boolean)): void; /** * Add a global event listener. * @param eventName A string representing the event type to listen for. * @param callback The function that receives a notification when an event of the specified type occurs. * @param capture If true, useCapture indicates that the user wishes to initiate capture. */ addEventListener(eventName: string, callback: Function, capture?: boolean): void; /** * Remove a global event listener. * @param eventName A string representing the event type to listen for. * @param callback The function to remove from the event. * @param capture Specifies whether the listener to be removed was registered as a capturing listener or not. */ removeEventListener(eventName: string, callback: Function, capture?: boolean): void; } /** * Represents the core APIs of the DOM. */ export interface Dom { /** * The global DOM Element type. */ Element: Element; /** * The global DOM SVGElement type. */ SVGElement: SVGElement; /** * A key representing a DOM boundary. */ boundary: string; /** * The document title. */ title: string; /** * The document's active/focused element. */ activeElement: Element; /** * Add an event listener to the document. * @param eventName A string representing the event type to listen for. * @param callback The function that receives a notification when an event of the specified type occurs. * @param capture If true, useCapture indicates that the user wishes to initiate capture. */ addEventListener(eventName: string, callback: Function, capture: boolean): void; /** * Remove an event listener from the document. * @param eventName A string representing the event type to listen for. * @param callback The function to remove from the event. * @param capture Specifies whether the listener to be removed was registered as a capturing listener or not. */ removeEventListener(eventName: string, callback: Function, capture: boolean): void; /** * Adopts a node from an external document. * @param node The node to be adopted. * @return The adopted node able to be used in the document. */ adoptNode(node: Node): Node; /** * Creates the specified HTML element or an HTMLUnknownElement if the given element name isn't a known one. * @param tagName A string that specifies the type of element to be created. * @return The created element. */ createElement(tagName: string): Element; /** * Creates a new Text node. * @param text A string to populate the new Text node. * @return A Text node. */ createTextNode(text: string): Text; /** * Creates a new Comment node. * @param text A string to populate the new Comment node. * @return A Comment node. */ createComment(text: string): Comment; /** * Creates a new DocumentFragment. * @return A DocumentFragment. */ createDocumentFragment(): DocumentFragment; /** * Creates a new MutationObserver. * @param callback A callback that will recieve the change records with the mutations. * @return A MutationObservere. */ createMutationObserver(callback: Function): MutationObserver; /** * Creates a new CustomEvent. * @param eventType A string representing the event type. * @param options An options object specifying bubbles:boolean, cancelable:boolean and/or detail:Object information. * @return A CustomEvent. */ createCustomEvent(eventType: string, options: Object): CustomEvent; /** * Dispatches an event on the document. * @param evt The event to dispatch. */ dispatchEvent(evt: Event): void; /** * Gives the values of all the CSS properties of an element after applying the active stylesheets and resolving any basic computation those values may contain. * @param element The Element for which to get the computed style. * @return The computed styles. */ getComputedStyle(element: Element): CSSStyleDeclaration; /** * Locates an element in the document according to its id. * @param id The id to search the document for. * @return The found element. */ getElementById(id: string): Element; /** * Performs a query selector on the document and returns all located matches. * @param query The query to use in searching the document. * @return A list of all matched elements in the document. */ querySelectorAll(query: string): NodeList; /** * Gets the element that is the next sibling of the provided element. * @param element The element whose next sibling is being located. * @return The next sibling Element of the provided Element. */ nextElementSibling(element: Node): Element; /** * Creates an HTMLTemplateElement using the markup provided. * @param markup A string containing the markup to turn into a template. Note: This string must contain the template element as well. * @return The instance of HTMLTemplateElement that was created from the provided markup. */ createTemplateFromMarkup(markup: string): Element; /** * Appends a node to the parent, if provided, or the document.body otherwise. * @param newNode The node to append. * @param parentNode The node to append to, otherwise the document.body. */ appendNode(newNode: Node, parentNode?: Node): void; /** * Replaces a node in the parent with a new node. * @param newNode The node to replace the old node with. * @param node The node that is being replaced. * @param parentNode The node that the current node is parented to. */ replaceNode(newNode: Node, node: Node, parentNode: Node): void; /** * Removes the specified node from the parent node. * @param node The node to remove. * @param parentNode The parent node from which the node will be removed. */ removeNode(node: Node, parentNode: Node): void; /** * Injects styles into the destination element, or the document.head if no destination is provided. * @param styles The css text to injext. * @param destination The destination element to inject the css text into. If not specified it will default to the document.head. * @param prepend Indicates whether or not the styles should be prepended to the destination. By default they are appended. * @return The Style node that was created. */ injectStyles(styles: string, destination?: Element, prepend?: boolean): Node; } /** * Creates an instance of Error that aggregates and preserves an innerError. * @param message The error message. * @param innerError The inner error message to aggregate. * @param skipIfAlreadyAggregate Indicates to not wrap the inner error if it itself already has an innerError. * @return The Error instance. */ export function AggregateError(message: string, innerError?: Error, skipIfAlreadyAggregate?: boolean): Error; /** * The singleton instance of the Feature discovery API. */ export const FEATURE: Feature; /** * The singleton instance of the Platform API. */ export const PLATFORM: Platform; /** * The singleton instance of the Dom API. */ export const DOM: Dom; /** * Enables initializing a specific implementation of the Platform Abstraction Layer (PAL). * @param callback Allows providing a callback which configures the three PAL singletons with their platform-specific implementations. */ export function initializePAL(callback: ((platform: Platform, feature: Feature, dom: Dom) => void)): void; }
cc0-1.0
lfreneda/cepdb
api/v1/59042142.jsonp.js
147
jsonp({"cep":"59042142","logradouro":"Travessa dos Transmissores","bairro":"Nordeste","cidade":"Natal","uf":"RN","estado":"Rio Grande do Norte"});
cc0-1.0
DINA-Web/datasets
collections-data/transformations/prepare_geography.py
4838
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import argparse import numpy import pandas """ Script for preparing geography data. Writes output to geography.csv. Run from commandline, like this: prepare_geography.py treedef_filename basetree_filename [--sweden filename] """ def append_country_geography(frame, country_frame, country): country_id = frame.ID[frame.Name==country].values[0] country_frame.ID = ( country_frame.ID.astype(int) + max(frame.ID.astype('int'))) country_frame.ParentID = ( country_frame.ID.astype(int).fillna(0) + max(frame.ID.astype(int))) country_frame.loc[country_frame.Name==country, 'ID'] = country_id frame = pandas.concat([frame, country_frame]) frame.drop_duplicates(subset='ID', inplace=True) return frame if __name__ == '__main__': help_text = 'Transform geography data import to Specify' parser = argparse.ArgumentParser(description=help_text) parser.add_argument( dest='treedefitems', type=argparse.FileType('r'), help='path to file with tree definition items') parser.add_argument( dest='basetree', type=argparse.FileType('r'), help='path to file with the base tree') parser.add_argument( '--denmark', dest='denmark', type=argparse.FileType('r'), metavar='filename', help='path to file with geography for Denmark') parser.add_argument( '--finland', dest='finland', type=argparse.FileType('r'), metavar='filename', help='path to file with geography for Finland') parser.add_argument( '--norway', dest='norway', type=argparse.FileType('r'), metavar='filename', help='path to file with geography for Norway') parser.add_argument( '--sweden', dest='sweden', type=argparse.FileType('r'), metavar='filename', help='path to file with geography for Sweden') arguments = parser.parse_args() rank_names = { 'L0 earth' : 'Earth', 'L1 continent': 'Continent', 'L2 region': 'Region', 'L3 area': 'Area', 'L4 country': 'Country', 'L5 province': 'State', 'L6 district': 'County'} output_columns = [ 'geography_sourceid', 'parent_sourceid', 'name', 'geographytreedefitem_sourceid'] treedefitems = pandas.read_csv(arguments.treedefitems, dtype='unicode') basetree = pandas.read_csv(arguments.basetree, dtype='unicode') # Add root node root_id = min(basetree.ID.astype(int) - 1) basetree.loc[basetree.ParentID.isnull(), 'ParentID'] = root_id number_to_add = 1 - root_id basetree.ID = basetree.ID.astype(int) + number_to_add basetree.ParentID = basetree.ParentID.astype(int) + number_to_add basetree = basetree.append({ 'ID': root_id + number_to_add, 'ParentID': numpy.nan, 'Name': 'Earth', 'Category': 'L0 earth'}, ignore_index=True) basetree = basetree[['ID', 'ParentID', 'Name', 'Category']] if arguments.denmark: geo_den = pandas.read_csv(arguments.denmark, dtype='unicode') geo_den = geo_den[['ID', 'ParentID', 'Name', 'Category']] basetree = append_country_geography(basetree, geo_den, 'Denmark') if arguments.finland: geo_fin = pandas.read_csv(arguments.finland, dtype='unicode') geo_fin = geo_fin[['ID', 'ParentID', 'Name', 'Category']] basetree = append_country_geography(basetree, geo_fin, 'Finland') if arguments.norway: geo_nor = pandas.read_csv(arguments.norway, dtype='unicode') geo_nor = geo_nor[['ID', 'ParentID', 'Name', 'Category']] basetree = append_country_geography(basetree, geo_nor, 'Norway') if arguments.sweden: geo_swe = pandas.read_csv(arguments.sweden, dtype='unicode') geo_swe = geo_swe[['ID', 'ParentID', 'Name', 'Category']] basetree = append_country_geography(basetree, geo_swe, 'Sweden') basetree['Category'] = basetree['Category'].replace(rank_names) treedefitems_merge = treedefitems[[ 'geographytreedefitem_sourceid', 'name']].rename(columns={'name': 'Category'}) geography = basetree.merge( treedefitems_merge, how='inner', on='Category') geography.rename(columns={ 'Name': 'name', 'ID': 'geography_sourceid', 'ParentID': 'parent_sourceid'}, inplace=True) geography.geography_sourceid = geography.geography_sourceid.astype(int) geography.sort_values(by='geography_sourceid', inplace=True) geography.parent_sourceid = ( geography.parent_sourceid.dropna().astype(int).astype(str)) geography[output_columns].to_csv('geography.csv', index=False, float='%g')
cc0-1.0
joseluispalillero/chat
tests/ChatServiceProviderTest.php
358
<?php namespace MilSonUno\Chat\Tests; use GrahamCampbell\TestBenchCore\ServiceProviderTrait; use MilSonUno\Chat\Chat; /** * This is the service provider test class. */ class ChatServiceProviderTest extends TestCase { use ServiceProviderTrait; public function testChatIsInjectable() { $this->assertIsInjectable(Chat::class); } }
cc0-1.0
lfreneda/cepdb
api/v1/75045060.jsonp.js
162
jsonp({"cep":"75045060","logradouro":"Rua Jos\u00e9 Bonif\u00e1cio","bairro":"S\u00e3o Louren\u00e7o","cidade":"An\u00e1polis","uf":"GO","estado":"Goi\u00e1s"});
cc0-1.0
biomodels/BIOMD0000000272
BIOMD0000000272/model.py
427
import os path = os.path.dirname(os.path.realpath(__file__)) sbmlFilePath = os.path.join(path, 'BIOMD0000000272.xml') with open(sbmlFilePath,'r') as f: sbmlString = f.read() def module_exists(module_name): try: __import__(module_name) except ImportError: return False else: return True if module_exists('libsbml'): import libsbml sbml = libsbml.readSBMLFromString(sbmlString)
cc0-1.0
lfreneda/cepdb
api/v1/13070970.jsonp.js
159
jsonp({"cep":"13070970","logradouro":"Rua Professor Jorge Hennings","bairro":"Jardim Chapad\u00e3o","cidade":"Campinas","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
JustCodeApp/JustCode
JustCode/src/JustCode/Bundle/actividadesBundle/Tests/Controller/DefaultControllerTest.php
397
<?php namespace JustCode\Bundle\actividadesBundle\Tests\Controller; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class DefaultControllerTest extends WebTestCase { public function testIndex() { $client = static::createClient(); $crawler = $client->request('GET', '/'); $this->assertContains('Hello World', $client->getResponse()->getContent()); } }
cc0-1.0
lfreneda/cepdb
api/v1/13145739.jsonp.js
160
jsonp({"cep":"13145739","logradouro":"Rua Albano Ferreira de Souza","bairro":"Jo\u00e3o Aranha","cidade":"Paul\u00ednia","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/33130330.jsonp.js
164
jsonp({"cep":"33130330","logradouro":"Rua Porace","bairro":"S\u00e3o Cosme de Cima (S\u00e3o Benedito)","cidade":"Santa Luzia","uf":"MG","estado":"Minas Gerais"});
cc0-1.0
lfreneda/cepdb
api/v1/12010550.jsonp.js
171
jsonp({"cep":"12010550","logradouro":"Rua Jos\u00e9 Francisco Gomes Moreira","bairro":"Jardim Eul\u00e1lia","cidade":"Taubat\u00e9","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/29203045.jsonp.js
140
jsonp({"cep":"29203045","logradouro":"Rua Rio Purus","bairro":"Kubitschek","cidade":"Guarapari","uf":"ES","estado":"Esp\u00edrito Santo"});
cc0-1.0
lfreneda/cepdb
api/v1/23951300.jsonp.js
196
jsonp({"cep":"23951300","logradouro":"Rodovia Governador M\u00e1rio Covas","bairro":"Vila Hist\u00f3rica de Mambucaba (Mambucaba)","cidade":"Angra dos Reis","uf":"RJ","estado":"Rio de Janeiro"});
cc0-1.0
lfreneda/cepdb
api/v1/12287200.jsonp.js
178
jsonp({"cep":"12287200","logradouro":"Rua Jos\u00e9 Francisco Teixeira","bairro":"Vila Ant\u00f4nio Augusto Luiz","cidade":"Ca\u00e7apava","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/15076680.jsonp.js
190
jsonp({"cep":"15076680","logradouro":"Rua Gabriel Nassif Issas","bairro":"Parque Industrial Tancredo Neves","cidade":"S\u00e3o Jos\u00e9 do Rio Preto","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/87711500.jsonp.js
168
jsonp({"cep":"87711500","logradouro":"Rua Jos\u00e9 Roberto da Silva Arrais","bairro":"Jardim Campo Belo","cidade":"Paranava\u00ed","uf":"PR","estado":"Paran\u00e1"});
cc0-1.0
lfreneda/cepdb
api/v1/70675232.jsonp.js
156
jsonp({"cep":"70675232","logradouro":"Quadra QRSW 2 Bloco B-12","bairro":"Setor Sudoeste","cidade":"Bras\u00edlia","uf":"DF","estado":"Distrito Federal"});
cc0-1.0
lfreneda/cepdb
api/v1/35030395.jsonp.js
161
jsonp({"cep":"35030395","logradouro":"Avenida Pascoal de Souza Lima","bairro":"Vila Bretas","cidade":"Governador Valadares","uf":"MG","estado":"Minas Gerais"});
cc0-1.0
lfreneda/cepdb
api/v1/15085360.jsonp.js
172
jsonp({"cep":"15085360","logradouro":"Rua Ot\u00e1vio Pinto Cesar","bairro":"Cidade Nova","cidade":"S\u00e3o Jos\u00e9 do Rio Preto","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/08081705.jsonp.js
141
jsonp({"cep":"08081705","logradouro":"Rua Kalmax","bairro":"Cidade de Deus","cidade":"S\u00e3o Paulo","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/78098608.jsonp.js
153
jsonp({"cep":"78098608","logradouro":"Travessa Paulo Seleri","bairro":"Nova Esperan\u00e7a I","cidade":"Cuiab\u00e1","uf":"MT","estado":"Mato Grosso"});
cc0-1.0
lfreneda/cepdb
api/v1/03350010.jsonp.js
156
jsonp({"cep":"03350010","logradouro":"Rua Almirante Alexandrino","bairro":"Vila Invernada","cidade":"S\u00e3o Paulo","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/89211590.jsonp.js
131
jsonp({"cep":"89211590","logradouro":"Rua Lontras","bairro":"Floresta","cidade":"Joinville","uf":"SC","estado":"Santa Catarina"});
cc0-1.0
lfreneda/cepdb
api/v1/12246120.jsonp.js
190
jsonp({"cep":"12246120","logradouro":"Rua Benedito Alvarenga Carvalho","bairro":"Parque Residencial Aquarius","cidade":"S\u00e3o Jos\u00e9 dos Campos","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/38705372.jsonp.js
152
jsonp({"cep":"38705372","logradouro":"Rua Jair Dumont","bairro":"Jardim Panor\u00e2mico","cidade":"Patos de Minas","uf":"MG","estado":"Minas Gerais"});
cc0-1.0
lfreneda/cepdb
api/v1/04580040.jsonp.js
152
jsonp({"cep":"04580040","logradouro":"Rua Oscar Gomes Cardim","bairro":"Vila Cordeiro","cidade":"S\u00e3o Paulo","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/09971060.jsonp.js
129
jsonp({"cep":"09971060","logradouro":"Rua Biquara","bairro":"Eldorado","cidade":"Diadema","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
dfdx2/ancfinder
ancfindersite/migrations/0001_initial.py
3132
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.db.models.deletion from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('annotator', '__first__'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='Document', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('anc', models.CharField(db_index=True, max_length=4, verbose_name=b'ANC', choices=[('1A', '1A'), ('1B', '1B'), ('1C', '1C'), ('1D', '1D'), ('2A', '2A'), ('2B', '2B'), ('2C', '2C'), ('2D', '2D'), ('2E', '2E'), ('2F', '2F'), ('3B', '3B'), ('3C', '3C'), ('3D', '3D'), ('3E', '3E'), ('3F', '3F'), ('3G', '3G'), ('4A', '4A'), ('4B', '4B'), ('4C', '4C'), ('4D', '4D'), ('5A', '5A'), ('5B', '5B'), ('5C', '5C'), ('5D', '5D'), ('5E', '5E'), ('6A', '6A'), ('6B', '6B'), ('6C', '6C'), ('6D', '6D'), ('6E', '6E'), ('7B', '7B'), ('7C', '7C'), ('7D', '7D'), ('7E', '7E'), ('7F', '7F'), ('8A', '8A'), ('8B', '8B'), ('8C', '8C'), ('8D', '8D'), ('8E', '8E')])), ('title', models.CharField(default=b'No Title', max_length=256)), ('created', models.DateTimeField(auto_now_add=True, db_index=True)), ('doc_type', models.IntegerField(default=0, verbose_name=b'Document Type', choices=[(0, b'Unknown'), (1, b'Agenda'), (2, b'Minutes'), (3, b'Report'), (4, b'Resolution'), (5, b'Draft'), (6, b'Application'), (7, b'Grant'), (8, b'Official Correspondence'), (9, b'Financial Statement'), (10, b'Operating Document'), (11, b'Committee Agenda'), (12, b'Committee Minutes'), (13, b'Committee Report'), (14, b'Meeting Summary')])), ('pub_date', models.DateField(help_text=b'The date the document was published by the ANC, if known.', null=True, verbose_name=b'Date Published', blank=True)), ('meeting_date', models.DateField(help_text=b'The date of an associated meeting, if relevant.', null=True, verbose_name=b'Date of Meeting', blank=True)), ('document_content', models.TextField(help_text=b'The binary document content, stored Base64-encoded.', editable=False)), ('document_content_type', models.CharField(help_text=b'The MIME type of the document_content.', max_length=128, editable=False)), ('document_content_size', models.IntegerField(null=True, editable=False, blank=True)), ('source_url', models.CharField(help_text=b'The web address where this document was obtained from.', max_length=256, null=True, verbose_name=b'Source URL', blank=True)), ('annotation_document', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, blank=True, editable=False, to='annotator.Document', null=True)), ('owner', models.ForeignKey(related_name='uploaded_documents', to=settings.AUTH_USER_MODEL)), ], options={ }, bases=(models.Model,), ), ]
cc0-1.0
lfreneda/cepdb
api/v1/97511154.jsonp.js
146
jsonp({"cep":"97511154","logradouro":"Rua Alceu Wamosy","bairro":"Cidade Alegria","cidade":"Uruguaiana","uf":"RS","estado":"Rio Grande do Sul"});
cc0-1.0
lfreneda/cepdb
api/v1/06210110.jsonp.js
146
jsonp({"cep":"06210110","logradouro":"Rua \u00c2ngelo Piva","bairro":"Presidente Altino","cidade":"Osasco","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/89042141.jsonp.js
150
jsonp({"cep":"89042141","logradouro":"Rua Joel Marcio de Souza","bairro":"\u00c1gua Verde","cidade":"Blumenau","uf":"SC","estado":"Santa Catarina"});
cc0-1.0
lfreneda/cepdb
api/v1/18119248.jsonp.js
158
jsonp({"cep":"18119248","logradouro":"Rua Rosimeire Aparecido Firmino","bairro":"Jardim Tatiana","cidade":"Votorantim","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
dataLabApp/dataLabApp
salesSeed.js
867
const pg = require('pg') const client = new pg.Client('postgres://localhost/headSetLaunch') const path = require('path') const seedQuery= `INSERT INTO "sales" (Date,Sales) VALUES ('May 3, 2017',10652),('May 4, 2017',17342),('May 5, 2017',15450),('May 6, 2017',22530),('May 7, 2017',33750),('May 8, 2017',15450),('May 9, 2017',34620),('May 10, 2017',38205)` client.connect() client.query(`DROP TABLE IF EXISTS sales`, function(err, data) { if (err)console.error(err) else console.log('dropped sales') }) client.query(`CREATE TABLE "sales" (id SERIAL PRIMARY KEY, Date varchar(255), Sales integer NULL)`, function(err, data) { if (err)console.error(err) else { console.log('table created') } }) client.query(seedQuery, function(err, data){ if (err)console.log(err) else { console.log('looks like seeding sales worked') client.end() } })
cc0-1.0
lfreneda/cepdb
api/v1/29933230.jsonp.js
143
jsonp({"cep":"29933230","logradouro":"Rua Malvinas","bairro":"Carapina","cidade":"S\u00e3o Mateus","uf":"ES","estado":"Esp\u00edrito Santo"});
cc0-1.0
lfreneda/cepdb
api/v1/13272576.jsonp.js
146
jsonp({"cep":"13272576","logradouro":"Rua das Paineiras","bairro":"Ch\u00e1cara Flora","cidade":"Valinhos","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/74390110.jsonp.js
153
jsonp({"cep":"74390110","logradouro":"Rua Castro Alves","bairro":"Condom\u00ednio Rio Branco","cidade":"Goi\u00e2nia","uf":"GO","estado":"Goi\u00e1s"});
cc0-1.0
lfreneda/cepdb
api/v1/13231465.jsonp.js
168
jsonp({"cep":"13231465","logradouro":"Rua Laurides Bonamigo","bairro":"Residencial Monte Alegre","cidade":"Campo Limpo Paulista","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/14404412.jsonp.js
145
jsonp({"cep":"14404412","logradouro":"Alameda dos Ip\u00eas","bairro":"Morada do Verde","cidade":"Franca","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0