answer
stringlengths
15
1.25M
jsonp({"cep":"54720684","logradouro":"Travessa Cardeal Arcoverde","bairro":"Muribara","cidade":"S\u00e3o Louren\u00e7o da Mata","uf":"PE","estado":"Pernambuco"});
jsonp({"cep":"60542022","logradouro":"Travessa Anselmo Nogueira","bairro":"Bonsucesso","cidade":"Fortaleza","uf":"CE","estado":"Cear\u00e1"});
'use strict'; function draw_recursive(entity){ if(entity === top_layer){ return; } <API key>({ 'properties': { 'fillStyle': entity_entities[entity]['color'], }, }); canvas_buffer.fillRect( entity_entities[entity]['x'], entity_entities[entity]['y'], core_storage_data['layer-width'], core_storage_data['layer-height'] ); draw_recursive(entity_entities[entity]['parent']); } function logic_recursive(entity){ if(entity === top_layer){ return; } const speed = math_move_2d({ 'speed': core_storage_data['layer-speed'], 'x0': entity_entities[entity]['x'], 'x1': entity_entities[entity_entities[entity]['parent']]['x'], 'y0': entity_entities[entity]['y'], 'y1': entity_entities[entity_entities[entity]['parent']]['y'], }); if(core_storage_data['layer-random'] !== 0){ speed['x'] += core_random_number({ 'multiplier': core_storage_data['layer-random'], }) - core_storage_data['layer-random'] / 2; speed['y'] += core_random_number({ 'multiplier': core_storage_data['layer-random'], }) - core_storage_data['layer-random'] / 2; } entity_entities[entity]['x'] += speed['x']; entity_entities[entity]['y'] += speed['y']; logic_recursive(entity_entities[entity]['parent']); } function load_data(){ top_layer = false; let parent_id = ''; for(let i = 0; i < core_storage_data['snake-length']; i++){ if(!top_layer){ top_layer = i; } entity_create({ 'id': i, 'properties': { 'color': '#' + core_random_hex(), 'parent': parent_id, 'x': core_random_integer({ 'max': canvas_properties['width'], }) - core_storage_data['layer-width'] / 2, 'y': core_random_integer({ 'max': canvas_properties['height'], }) - core_storage_data['layer-height'] / 2, }, }); parent_id = i; } last_entity = parent_id; }
jsonp({"cep":"83503150","logradouro":"Rua S\u00e3o Manoel","bairro":"Parque S\u00e3o Jorge","cidade":"Almirante Tamandar\u00e9","uf":"PR","estado":"Paran\u00e1"});
jsonp({"cep":"13475251","logradouro":"Rua Dois","bairro":"Ch\u00e1cara Mantovani","cidade":"Americana","uf":"SP","estado":"S\u00e3o Paulo"});
package edu.ahs.frc.spaceraiders.zodiac.hook; import edu.ahs.frc.spaceraiders.zodiac.Ports; import edu.ahs.frc.spaceraiders.zodiac.input.HumanInput; import edu.wpi.first.wpilibj.DoubleSolenoid; import edu.wpi.first.wpilibj.command.Subsystem; //TODO: extend closes the hook, retract opens the hook. /** * Hook Subsystem * *@author Arden *@author Fahim *@author Josh */ public class HookSubsystem extends Subsystem { public static final int HOOK_MOVE_TIME = 1000; private DoubleSolenoid hookSolenoid = new DoubleSolenoid(Ports.<API key>, Ports.<API key>); public void initDefaultCommand() { } /** * extends hook */ public void extendHook() { hookSolenoid.set(DoubleSolenoid.Value.kForward); } /** * retracts hook */ public void retractHook() { hookSolenoid.set(DoubleSolenoid.Value.kReverse); } /** * stops hook */ public void stopHook() { hookSolenoid.set(DoubleSolenoid.Value.kOff); } /** * registers 2 buttons to hookExtendCommand and hookRetractCommand */ public void registerButtons() { HumanInput.<API key>(HumanInput.hookOpenButton,new HookExtendCommand() ); HumanInput.<API key>(HumanInput.hookCloseButton,new HookRetractCommand() ); } }
jsonp({"cep":"17205183","logradouro":"Pra\u00e7a Renato Santo Gallo","bairro":"Vila Nova Ja\u00fa","cidade":"Ja\u00fa","uf":"SP","estado":"S\u00e3o Paulo"});
<!DOCTYPE html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Expires" content="-1"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Cache-Control" content="no-cache"> <title>105</title> <link href="../css/style.css" rel="stylesheet" type="text/css"> <link href="../css/style2.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="../js/ftiens4.js"></script> <script type="text/javascript" src="../js/ua.js"></script> <script type="text/javascript" src="../js/func.js"></script> <script type="text/javascript" src="../js/treeP1.js"></script> <script type="text/javascript" src="../js/refresh.js"></script> </head> <body id="main-body"> <div id="main-header"> <div id="main-top"> <a class="main-top-logo" href=" <ul class="main-top-list"> <li class="main-top-item"><a class="main-top-link main-top-link-home" href="../index.html"></a></li> <li class="main-top-item"><a class="main-top-link main-top-link-cec" href="http://2016.cec.gov.tw"></a></li> <li class="main-top-item"><a class="main-top-link <API key>" href="../../en/index.html">English</a></li> </ul> </div> </div> <div id="main-wrap"> <div id="main-banner"> <div class="slideshow"> <img src="../img/main_bg_1.jpg" width="1024" height="300" alt="background" title="background"> </div> <div class="main-deco"></div> <div class="main-title"></div> <a class="main-pvpe main-pvpe-current" href="../IDX/indexP1.html"></a> <a class="main-le" href="../IDX/indexT.html"></a> </div> <div id="main-container"> <div id="main-content"> <table width="1024" border="1" cellpadding="0" cellspacing="0"> <tr> <td width="180" valign="top"> <div id="divMenu"> <table border="0"> <tr> <td><a style="text-decoration:none;color:silver" href="http: </tr> </table> <span class="TreeviewSpanArea"> <script>initializeDocument()</script> <noscript>Javascript</noscript> </span> </div> </td> <td width="796" valign="top"> <div id="divContent"> <table width="100%" border="0" cellpadding="0" cellspacing="4"> <tr> <td><img src="../images/search.png" alt="" title="">&nbsp;<b>&nbsp; &nbsp;</b></td> </tr> <tr valign="bottom"> <td> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr valign="bottom"> <td class="fontNumber">&nbsp;<img src="../images/nav.gif" alt="" title="">&nbsp;<img src="../images/nav.gif" alt="" title="">&nbsp;3&nbsp;&nbsp;<img src="../images/nav.gif" alt="" title="">&nbsp;<img src="../images/nav.gif" alt="" title="">&nbsp;1</td> <td align="right"> <select name="selector_order" class="selectC" tabindex="1" id="orderBy" onChange="changeOrder();"> <option value="n"></option> <option value="s"></option> </select> </td> </tr> </table> </td> </tr> <tr valign="top"> <td> <table width="100%" border="0" cellpadding="6" cellspacing="1" class="tableT"> <tr class="trHeaderT"> <td></td> <td></td> <td><table><tr><td></td><td rowspan=2></td></tr><td></td></table></td> <td></td> <td></td> <td>%</td> <td></td> </tr> <tr class="trT"> <td>&nbsp;</td> <td>1</td> <td><br></td> <td><br></td> <td class="tdAlignRight">1,187</td> <td class="tdAlignRight">35.7422</td> <td>&nbsp; </td> </tr> <tr class="trT"> <td>&nbsp;</td> <td>2</td> <td><br></td> <td><br></td> <td class="tdAlignRight">1,564</td> <td class="tdAlignRight">47.0942</td> <td>&nbsp; </td> </tr> <tr class="trT"> <td>&nbsp;</td> <td>3</td> <td><br></td> <td><br></td> <td class="tdAlignRight">570</td> <td class="tdAlignRight">17.1635</td> <td>&nbsp; </td> </tr> <tr class="trFooterT"> <td colspan="7" align="right">/:&nbsp;8/8&nbsp;</td> </tr> </table> </td> </tr> <tr valign="top"> <td> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="10"></td> <td valign="top" class="fontNote"> <table> <tr> <td></td> <td align="center"></td> <td></td> </tr> <tr> <td></td> <td align="center"></td> <td></td> </tr> </table> </td> <td valign="top" class="fontTimer"><img src="../images/clock2.png" alt="Sat, 16 Jan 2016 19:30:11 +0800" title="Sat, 16 Jan 2016 19:30:11 +0800">&nbsp;&nbsp;01/16&nbsp;19:30:06&nbsp;<br>(3)</td> </tr> <tr> <td colspan="3" class="fontNote"></td> </tr> </table> </td> </tr> </table> </div> </td> </tr> </table> </div> <div class="main-footer"></div> <div id="divFooter" align=center>[] </div> <!--main-content </div><!--main-container </div><!--END main-wrap <script>setOrder();</script> <script>setMenuScrollPosY();</script> </body> </html>
jsonp({"cep":"17215102","logradouro":"Rua Ceferino Asensio de Diego","bairro":"Loteamento Residencial Maria Isabel","cidade":"Ja\u00fa","uf":"SP","estado":"S\u00e3o Paulo"});
jsonp({"cep":"88523250","logradouro":"Rua Avelino Ant\u00f4nio de Miranda","bairro":"Santa Maria","cidade":"Lages","uf":"SC","estado":"Santa Catarina"});
jsonp({"cep":"45201710","logradouro":"Rua Ana Delmiro","bairro":"Curral Novo","cidade":"Jequi\u00e9","uf":"BA","estado":"Bahia"});
jsonp({"cep":"23540100","logradouro":"Rua Jorge de Castro","bairro":"Sepetiba","cidade":"Rio de Janeiro","uf":"RJ","estado":"Rio de Janeiro"});
function canvas_init_pre() { prop.canvas={}; prop.canvas.contexts={}; // resize canvas to fit window? prop.canvas.resize=true; prop.canvas.size={ // all canvases are the same size height:480, width:640 }; } function canvas_init() { canvas_add("main"); } function canvas_resize() { if(prop.canvas.resize) { prop.canvas.size.width=$(window).width(); prop.canvas.size.height=$(window).height(); } for(var i in prop.canvas.contexts) { prop.canvas.contexts[i].canvas.height=prop.canvas.size.height; prop.canvas.contexts[i].canvas.width=prop.canvas.size.width; } } function canvas_add(name) { $("#canvases").append("<canvas id='"+name+"-canvas'></canvas>"); prop.canvas.contexts[name]=$("#"+name+"-canvas").get(0).getContext("2d"); } function canvas_get(name) { return(prop.canvas.contexts[name]); } function canvas_clear(cc) { cc.clearRect(0,0,prop.canvas.size.width,prop.canvas.size.height); } /* GROUND */ function canvas_draw_ground(cc) { var width = Math.ceil(prop.canvas.size.width/2)*2; var height = Math.ceil(prop.canvas.size.height/2)*2; cc.fillStyle="#333"; cc.fillRect(-width / 2, 0, width, 10); } /* GRID */ function canvas_draw_grid(cc) { cc.fillStyle="#aaa"; var spacing=300; var width = Math.ceil(prop.canvas.size.width/2) + spacing; var height = Math.ceil(prop.canvas.size.height/2) + spacing; var xs = -(meters(prop.ui.pan[0]) % spacing); var ys = -(meters(prop.ui.pan[1]) % spacing); for(var x=-width-xs;x<width+xs;x+=spacing) { for(var y=-height-ys;y<height+ys;y+=spacing) { cc.fillRect(x-5, y-5, 10, 10); } } } /* QUAD */ function canvas_draw_quad(cc, quad) { cc.fillStyle="#f22"; cc.fillRect(meters(prop.quad.target[0])-5, -meters(prop.quad.target[1])-5, 10, 10); cc.save(); var width = meters(0.6); var height = Math.ceil(meters(0.07)) - 2; var x=meters(quad.body.position[0]); var y=meters(quad.body.position[1]); cc.translate(x, -y); cc.save(); cc.rotate(-quad.body.angle); cc.translate(0, -height/2); cc.scale(quad.size, quad.size); cc.fillStyle="#38f"; cc.fillRect(-width / 2, -height / 2, width, height); cc.fillStyle="#222"; width = meters(0.2); cc.fillRect(-width / 2, height / 2, width, height); cc.fillStyle="#222"; width = meters(0.8); var disk = meters(0.35); cc.fillRect(meters(quad.power.left_position/quad.size)-disk/2, -height, disk, height/2); cc.fillRect(meters(quad.power.right_position/quad.size)-disk/2, -height, disk, height/2); if(true) { cc.beginPath(); var thrust=-meters(quad.power.left_motor*0.5*quad.size); cc.moveTo(meters(quad.power.left_position/quad.size), 0); cc.lineTo(meters(quad.power.left_position/quad.size), thrust); thrust=-meters(quad.power.right_motor*0.5*quad.size); cc.moveTo(meters(quad.power.right_position/quad.size), 0); cc.lineTo(meters(quad.power.right_position/quad.size), thrust); cc.strokeStyle="#f22"; cc.lineWidth=4; cc.stroke(); } cc.restore(); cc.beginPath(); cc.beginPath(); vspeed = -quad.autopilot.pid.verticalSpeed.error * 50; hspeed = quad.autopilot.pid.horizontalSpeed.error * 50; cc.moveTo(0, 0); cc.lineTo(hspeed, vspeed); cc.lineCap="round"; cc.strokeStyle = "#f83"; cc.lineWidth=3; cc.stroke(); cc.restore(); } function canvas_draw_quads(cc) { for(var i=0;i<prop.quad.quads.length;i++) { canvas_draw_quad(cc, prop.quad.quads[i]); } } function canvas_update() { var cc=canvas_get("main"); cc.save(); canvas_clear(cc); cc.translate(Math.round(prop.canvas.size.width/2), Math.round(prop.canvas.size.height/2)); cc.save(); canvas_draw_grid(cc); cc.restore(); cc.translate(0, meters(prop.ui.pan[1])); cc.save(); canvas_draw_ground(cc); cc.restore(); cc.translate(meters(prop.ui.pan[0]), 0); cc.save(); canvas_draw_quads(cc); cc.restore(); cc.restore(); }
jsonp({"cep":"06787560","logradouro":"Rua Jos\u00e9 de Caldas Ribeiro","bairro":"Jardim Saint Moritz","cidade":"Tabo\u00e3o da Serra","uf":"SP","estado":"S\u00e3o Paulo"});
jsonp({"cep":"89205200","logradouro":"Rua Graciliano Ramos","bairro":"Boa Vista","cidade":"Joinville","uf":"SC","estado":"Santa Catarina"});
jsonp({"cep":"81250380","logradouro":"Rua Ribeir\u00e3o Claro","bairro":"Cidade Industrial","cidade":"Curitiba","uf":"PR","estado":"Paran\u00e1"});
jsonp({"cep":"89218012","logradouro":"Rua Jos\u00e9 Carlos de Souza","bairro":"Santo Ant\u00f4nio","cidade":"Joinville","uf":"SC","estado":"Santa Catarina"});
jsonp({"cep":"39785000","cidade":"S\u00e3o Jos\u00e9 da Safira","uf":"MG","estado":"Minas Gerais"});
jsonp({"cep":"16901003","logradouro":"Rua Doutor Orensy Rodrigues da Silva","bairro":"Centro","cidade":"Andradina","uf":"SP","estado":"S\u00e3o Paulo"});
#include <octree> #include <bitset> namespace triplet_match { namespace detail { typedef std::bitset<3> octant_mask; uint8_t get_octant(const vec3f_t center, const vec3f_t pos) { std::bitset<3> gt; for (size_t i = 0; i < 3; ++i) { gt.set(i, pos[i] > center[i]); } return static_cast<uint8_t>(gt.to_ulong()); } bbox3_t get_octant_bbox(uint8_t octant, const bbox3_t& bbox) { vec3f_t lower = bbox.min(); vec3f_t upper = bbox.max(); vec3f_t center = 0.5f * (lower + upper); std::bitset<3> mask(octant); return bbox3_t( vec3f_t( mask.test(0) ? center[0] : lower[0], mask.test(1) ? center[1] : lower[1], mask.test(2) ? center[2] : lower[2] ), vec3f_t( mask.test(0) ? upper[0] : center[0], mask.test(1) ? upper[1] : center[1], mask.test(2) ? upper[2] : center[2] ) ); } } // namespace detail base_node* as_base_node(node & n) { return std::visit(overloaded{ [&](branch_node & b) { return &static_cast<base_node &>(b); }, [&](leaf_node & l) { return &static_cast<base_node &>(l); } }, n); } base_node const* as_base_node(node const& n) { return std::visit(overloaded{ [&](branch_node const& b) { return &static_cast<base_node const&>(b); }, [&](leaf_node const& l) { return &static_cast<base_node const&>(l); } }, n); } template <typename Point> inline octree<Point>::impl::impl() { } template <typename Point> inline void octree<Point>::impl::create(typename cloud_t::ConstPtr cloud, uint32_t max_depth, <API key> crit, std::optional<subset_t> subset) { subset_t indices; if (subset) { indices.resize(subset->size()); std::copy(subset->begin(), subset->end(), indices.begin()); } else { indices.resize(cloud->size()); std::iota(indices.begin(), indices.end(), 0); } // bounding box bbox3_t bbox; for (uint32_t idx : indices) { bbox.extend(cloud->points[idx].getVector3fMap()); } bbox_ = bbox; pdebug("level 0 index count: {}", indices.size()); pdebug("level 0 bbox min: {}", bbox.min().transpose()); pdebug("level 0 bbox max: {}", bbox.max().transpose()); std::tie(depth_, root_) = impl::subdivide(cloud, indices, bbox, crit, max_depth); } template <typename Point> inline std::pair<uint32_t, node_ptr_t> octree<Point>::impl::subdivide(typename pcl::PointCloud<Point>::ConstPtr cloud, const subset_t& subset, const bbox3_t& bbox, <API key> crit, uint32_t max_depth, uint32_t depth) { node_ptr_t this_node(new node()); uint32_t max_d = depth; if (depth < max_depth && std::visit(overloaded{ [&](max_voxel_size crit) { return (bbox.max() - bbox.min()).maxCoeff() > crit.value; }, [&](min_voxel_size crit) { return (bbox.max() - bbox.min()).minCoeff() > 2.f * crit.value; }, [&](max_point_count crit) { return subset.size() > crit.value; } }, crit)) { vec3f_t center = 0.5f * (bbox.min() + bbox.max()); std::array<subset_t, 8> child_sets; for (const auto& idx : subset) { child_sets[detail::get_octant(center, cloud->points[idx].getVector3fMap())].push_back(idx); } *this_node = branch_node{}; std::get<branch_node>(*this_node).depth = static_cast<uint8_t>(depth); std::get<branch_node>(*this_node).bbox = bbox; for (uint8_t i = 0; i < 8; ++i) { uint32_t sub_d; std::tie(sub_d, std::get<branch_node>(*this_node).children[i]) = subdivide(cloud, child_sets[i], detail::get_octant_bbox(i, bbox), crit, max_depth, depth + 1); max_d = std::max(max_d, sub_d); } } else { *this_node = leaf_node{static_cast<uint8_t>(depth), bbox, subset}; } return {max_d, std::move(this_node)}; } template <typename Point> inline typename octree<Point>::sptr_t octree<Point>::from_pointcloud(typename cloud_t::ConstPtr cloud, uint32_t max_depth, <API key> crit, std::optional<subset_t> subset) { sptr_t tree(new octree()); tree->impl_->create(cloud, max_depth, crit, subset); return tree; } template <typename Point> inline octree<Point>::~octree() {} template <typename Point> inline octree<Point>::octree() : impl_(new impl()) {} template <typename Point> inline uint32_t octree<Point>::depth() const { return impl_->depth_; } template <typename Point> inline node const& octree<Point>::root() const { return *(impl_->root_); } } // namespace triplet_match
# Cookbook Name:: RServe # Recipe:: <API key> # Description: Adds an RServe user, group and startup scripts user_name = node['RServe']['user_name'] group_name = node['RServe']['group_name'] rserv_home_libs_dir = node['RServe']['home_libs_dir'] ? node['RServe']['home_libs_dir'] : File.join("/home", "#{user_name}", "R_libs") # Create the group and user group group_name user user_name do gid group_name manage_home true end directory rserv_home_libs_dir do owner user_name group group_name end file "/var/log/rserve.log" do owner user_name group group_name action :create_if_missing end # Create the configuration file template "/etc/Rserv.conf" do source "Rserv.conf.erb" owner user_name group group_name variables( :configs => node['RServe']['configuration'] ) end # Create the executable script template '/usr/lib64/R/bin/Rserv.sh' do source 'RServ.sh.erb' owner user_name group group_name mode '0550' variables( :<API key> => node['RServe']['startup_options'], :rserv_home_libs_dir => rserv_home_libs_dir ) end # Create the system service template '/etc/init.d/rserved' do source 'rserved.erb' owner user_name group group_name mode '0550' variables( :user => user_name ) end
<html><head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css"> <link href="http: <link rel="alternate" type="application/atom+xml" href="/atom.xml" title="Atom feed"> <link rel="shortcut icon" href="http://unicornsummer.com/images/icon.png"> <title> </title> </head> <body> <nav class="navbar navbar-default navbar-fixed-top" style="opacity: .9" role="navigation"> <div class="container-fluid"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#<API key>"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href=" </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="<API key>"> <ul class="nav navbar-nav navbar-right"> <li class="active"><a href="#">Blog</a></li> <li><a href="https: <li><a href="https://twitter.com/unicorn19850831" target="_blank">Twitter</a></li> <li><a href="http://mahaijin.github.io/" target="_blank">MHJin</a></li> </ul> </div><!-- /.navbar-collapse --> </div><!-- /.container-fluid --> </nav> <div class="row" style="padding-top: 70px"> <div class="container center-block"> <div class="col-md-2"></div> <div class="col-md-8 col-sm-12"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"></h3> </div> <ul class="list-group"> <li class="list-group-item title"> <a href="../blog/2015-11/application-commons.html" target="_blank"></a> </li> <li class="list-group-item title"> <a href="../blog/2015-08/<API key>.html" target="_blank"></a> </li> <li class="list-group-item title"> <a href="../blog/2015-07/<API key>.html" target="_blank">Java</a> </li> <li class="list-group-item title"> <a href="../blog/2015-07/<API key>.html" target="_blank"></a> </li> <li class="list-group-item title"> <a href="../blog/2014-12/iteration.html" target="_blank"></a> </li> <li class="list-group-item title"> <a href="../blog/2014-11/type-chedan.html" target="_blank"></a> </li> <li class="list-group-item title"> <a href="../blog/2014-03/io-pattern.html" target="_blank">IO</a> </li> <li class="list-group-item title"> <a href="../blog/2013-10/csharp-delegate.html" target="_blank">C </li> <li class="list-group-item title"> <a href="../blog/2013-11/sql-basics.html" target="_blank">SQLMySQL</a> </li> </ul> </div> </div> <div class="col-md-2"> </div> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script> </body></html>
jsonp({"cep":"74473550","logradouro":"Rua VF 59","bairro":"Vila Finsocial","cidade":"Goi\u00e2nia","uf":"GO","estado":"Goi\u00e1s"});
jsonp({"cep":"13478531","logradouro":"Rua Pastor L\u00e1zaro de Campos","bairro":"Vila Israel","cidade":"Americana","uf":"SP","estado":"S\u00e3o Paulo"});
jsonp({"cep":"60870610","logradouro":"Rua Morada Nova","bairro":"Jangurussu","cidade":"Fortaleza","uf":"CE","estado":"Cear\u00e1"});
jsonp({"cep":"88353532","logradouro":"Rua PM - 013","bairro":"Primeiro de Maio","cidade":"Brusque","uf":"SC","estado":"Santa Catarina"});
jsonp({"cep":"21660200","logradouro":"Rua Santo Angilberto","bairro":"Guadalupe","cidade":"Rio de Janeiro","uf":"RJ","estado":"Rio de Janeiro"});
!function($) { "use strict"; var MorrisCharts = function() {}; //creates line chart MorrisCharts.prototype.createLineChart = function(element, data, xkey, ykeys, labels, opacity, Pfillcolor, Pstockcolor, lineColors) { Morris.Line({ element: element, data: data, xkey: xkey, ykeys: ykeys, labels: labels, fillOpacity: opacity, pointFillColors: Pfillcolor, pointStrokeColors: Pstockcolor, behaveLikeLine: true, gridLineColor: '#36404a', hideHover: 'auto', resize: true, //defaulted to true lineColors: lineColors }); }, //creates area chart MorrisCharts.prototype.createAreaChart = function(element, pointSize, lineWidth, data, xkey, ykeys, labels, lineColors) { Morris.Area({ element: element, pointSize: 0, lineWidth: 0, data: data, xkey: xkey, ykeys: ykeys, labels: labels, hideHover: 'auto', resize: true, gridLineColor: '#36404a', lineColors: lineColors }); }, //creates area chart with dotted MorrisCharts.prototype.<API key> = function(element, pointSize, lineWidth, data, xkey, ykeys, labels, Pfillcolor, Pstockcolor, lineColors) { Morris.Area({ element: element, pointSize: 3, lineWidth: 1, data: data, xkey: xkey, ykeys: ykeys, labels: labels, hideHover: 'auto', pointFillColors: Pfillcolor, pointStrokeColors: Pstockcolor, resize: true, gridLineColor: '#36404a', lineColors: lineColors }); }, //creates Bar chart MorrisCharts.prototype.createBarChart = function(element, data, xkey, ykeys, labels, lineColors) { Morris.Bar({ element: element, data: data, xkey: xkey, ykeys: ykeys, labels: labels, hideHover: 'auto', resize: true, //defaulted to true gridLineColor: '#36404a', barColors: lineColors }); }, //creates Stacked chart MorrisCharts.prototype.createStackedChart = function(element, data, xkey, ykeys, labels, lineColors) { Morris.Bar({ element: element, data: data, xkey: xkey, ykeys: ykeys, stacked: true, labels: labels, hideHover: 'auto', resize: true, //defaulted to true gridLineColor: '#36404a', barColors: lineColors }); }, //creates Donut chart MorrisCharts.prototype.createDonutChart = function(element, data, colors) { Morris.Donut({ element: element, data: data, resize: true, //defaulted to true colors: colors, labelColor: '#fff' }); }, MorrisCharts.prototype.init = function() { //create line chart var $data = [ { y: '2010', a: 30, b: 20 , c: 10 }, { y: '2011', a: 50, b: 40 , c: 30 }, { y: '2012', a: 75, b: 65 , c: 50 }, { y: '2013', a: 50, b: 40 , c: 22 }, { y: '2014', a: 75, b: 65 , c: 50 }, { y: '2015', a: 100, b: 90 , c: 65 } ]; this.createLineChart('morris-line-example', $data, 'y', ['a', 'b','c'], ['Series A', 'Series B', 'Series C'],['0.1'],['#ffffff'],['#999999'], ['#ebeff2', '#5fbeaa', '#5d9cec']); //creating area chart var $areaData = [ { y: '2009', a: 10, b: 20, c:30 }, { y: '2010', a: 75, b: 65, c:30 }, { y: '2011', a: 50, b: 40, c:30 }, { y: '2012', a: 75, b: 65, c:30 }, { y: '2013', a: 50, b: 40, c:30 }, { y: '2014', a: 75, b: 65, c:30 }, { y: '2015', a: 90, b: 60, c:30 } ]; this.createAreaChart('morris-area-example', 0, 0, $areaData, 'y', ['a', 'b','c'], ['Series A', 'Series B','Series C'], ['#5fbeaa', '#5d9cec', '#bbbbbb']); //creating area chart with dotted var $areaDotData = [ { y: '2009', a: 10, b: 20 }, { y: '2010', a: 75, b: 65 }, { y: '2011', a: 50, b: 40 }, { y: '2012', a: 75, b: 65 }, { y: '2013', a: 50, b: 40 }, { y: '2014', a: 75, b: 65 }, { y: '2015', a: 90, b: 60 } ]; this.<API key>('<API key>', 0, 0, $areaDotData, 'y', ['a', 'b'], ['Series A', 'Series B'],['#ffffff'],['#999999'], ['#36404a', '#5d9cec']); //creating bar chart var $barData = [ { y: '2009', a: 100, b: 90 , c: 40 }, { y: '2010', a: 75, b: 65 , c: 20 }, { y: '2011', a: 50, b: 40 , c: 50 }, { y: '2012', a: 75, b: 65 , c: 95 }, { y: '2013', a: 50, b: 40 , c: 22 }, { y: '2014', a: 75, b: 65 , c: 56 }, { y: '2015', a: 100, b: 90 , c: 60 } ]; this.createBarChart('morris-bar-example', $barData, 'y', ['a', 'b', 'c'], ['Series A', 'Series B', 'Series C'], ['#5fbeaa', '#5d9cec', '#ebeff2']); //creating Stacked chart var $stckedData = [ { y: '2005', a: 45, b: 180 }, { y: '2006', a: 75, b: 65 }, { y: '2007', a: 100, b: 90 }, { y: '2008', a: 75, b: 65 }, { y: '2009', a: 100, b: 90 }, { y: '2010', a: 75, b: 65 }, { y: '2011', a: 50, b: 40 }, { y: '2012', a: 75, b: 65 }, { y: '2013', a: 50, b: 40 }, { y: '2014', a: 75, b: 65 }, { y: '2015', a: 100, b: 90 } ]; this.createStackedChart('morris-bar-stacked', $stckedData, 'y', ['a', 'b'], ['Series A', 'Series B'], ['#5d9cec', '#ebeff2']); //creating donut chart var $donutData = [ {label: "Download Sales", value: 12}, {label: "In-Store Sales", value: 30}, {label: "Mail-Order Sales", value: 20} ]; this.createDonutChart('<API key>', $donutData, ['#ebeff2', '#5fbeaa', '#5d9cec']); }, //init $.MorrisCharts = new MorrisCharts, $.MorrisCharts.Constructor = MorrisCharts }(window.jQuery), //initializing function($) { "use strict"; $.MorrisCharts.init(); }(window.jQuery);
<div> <h1>Incomplete Todo Items</h1> <pre>{{Zvmm|json}}</pre> <div ng-repeat="todo in vmm.dm.<API key>()"> <div> <input type='checkbox' ng-click="vmm.todoClicked(todo)"/> {{todo.title}} </div> </div> <div> <input type="text" placeholder="new Todo" ng-model="vmm.newTitle"/> <button class="btn-primary btn-small"ng-click="vmm.newTodo()">Save</button> </div> </div>
jsonp({"cep":"73755186","logradouro":"Quadra Quadra 186","bairro":"Jardim Paquet\u00e1 II","cidade":"Planaltina de Goi\u00e1s","uf":"GO","estado":"Goi\u00e1s"});
jsonp({"cep":"50820310","logradouro":"Rua Irm\u00e3 Ana Br\u00edgida","bairro":"Mangueira","cidade":"Recife","uf":"PE","estado":"Pernambuco"});
# Macro Polo - [Why Macro Polo? Unit Testing vs Functional Testing](#<API key>) - [Requirements](#requirements) - [Installation](#installation) - [Testing Macro Polo](#testing-macro-polo) - [Using Macro Polo](#using-macro-polo) - [Quickstart](#quickstart) - [Creating a Base TestCase Class](#<API key>) - [Defining Tests in JSON](#<API key>) - [Defining Tests in Python](#<API key>) - [Running Tests](#running-tests) - [API](#api) - [`MacroTestCase`](#macrotestcase) - [Template Environment Mixins](#<API key>) - [JSON Specification Functions](#<API key>) - [Licensing](#licensing) Macro Polo is a Python library for unit testing template macros created using popular Python templating systems. Templating systems/environments currently supported: - [Jinja2](http://jinja.pocoo.org/) - Jinja2 Templates served via [Sheer](https://github.com/cfpb/sheer) **Status:** Proof of concept ## Why Macro Polo? Unit Testing vs Functional Testing Macro Polo is designed for unit testing template macros. Macro Polo is meant to make it easier to express tests of the resulting HTML of individual template macros (units) within a specific context or with specific inputs. Unit testing macros tests them individually in isolation. If you're looking at a template and want to test browser-related behavior that occurs when interacting with that template's resulting HTML, you want to investigate functional testing tools and frameworks. ## Requirements Requirements can be satisfied with `pip`: shell $ pip install -r requirements.txt - [BeautifulSoup 4](http: handling the HTML resulting from template rendering - [Python mock](http: template filters and context (and unit testing Macro Polo itself) Template Systems/Environments: - [Jinja2](http://jinja.pocoo.org/) - [Sheer](https://github.com/cfpb/sheer) These are not installed by `pip`. It is expected that if you are using these template environments you have them installed already. If not, their respective [environment mixins](#<API key>) will not be available. ## Installation To clone and install Macro Polo locally in an existing Python [`virtualenv`](https://virtualenv.pypa.io/en/latest/): shell $ git clone https://github.com/cfpb/macropolo $ pip install -e macropolo Note: this installs Macro Polo in 'editable' mode. This means that any updates pulled into the git clone will be 'live' without running `pip` again. Macro Polo can also be installed directly from Github: shell $ pip install git+https://github.com/cfpb/macropolo ## Testing Macro Polo Macro Polo's own unit tests can be run from the root of the repository: shell $ python setup.py test If you would prefer to use [nose](https://nose.readthedocs.org/en/latest/): shell $ pip install nose Then you can run the tests: shell $ nosetests macropolo ## Using Macro Polo Quickstart Create a Python file with the rest of your test suite, such as `test_templates.py`. This file will need to define a [base test case](#<API key>), load template tests from JSON, and (optionally) use Python's `unittest.main()` to [run the tests](#running-tests): python from macropolo import MacroTestCase, Jinja2Environment from macropolo import JSONTestCaseLoader class MyBaseTestCase(Jinja2Environment, MacroTestCase): """ A MacroTestCase subclass for my Jinja2 Templates. """ def search_root(self): """ Return the root of the search path for templates. """ # If the tests live under 'site_root/tests'... root_dir = os.path.abspath(os.path.join(os.path.dirname( __file__ ), os.pardir)) return root_dir def search_exceptions(self): """ Return a list of a subdirectory names that should not be searched for templates. """ return ['tests',] # Create MyTestCase subclasses for all JSON tests and add them to the # module's global context. tests_path = os.path.abspath(os.path.join(os.path.dirname( __file__ ), 'template_tests')) JSONTestCaseLoader(tests_path, MyBaseTestCase, globals()) # Run the tests if we're executed if __name__ == '__main__': unittest.main() Then create your [JSON test specifications](#<API key>) in the `template_tests` subdirectory of `tests`. Creating a Base TestCase Class Test Case classes should inherit from a [template environment mixin](#<API key>), the [`MacroTestCase`](#macrotestcase) class, and should provide the following methods: # `search_root()` Return the root of the search path for templates. # `search_exceptions()` Return a list of a subdirectory names that should not be searched for templates. For Example: python from macropolo import MacroTestCase, Jinja2Environment class MyBaseTestCase(Jinja2Environment, MacroTestCase): """ A MacroTestCase subclass for my Jinja2 Templates. """ def search_root(self): """ Return the root of the search path for templates. """ # If the tests live under 'site_root/tests'... root_dir = os.path.abspath(os.path.join(os.path.dirname( __file__ ), os.pardir)) return root_dir def search_exceptions(self): """ Return a list of a subdirectory names that should not be searched for templates. """ return ['tests',] Defining Tests in JSON To reduce the amount of boilerplate Python that needs to be written for macro unit tests, unit tests can be written in JSON. For each template file that defines macros, a single JSON should be created that would look like this: json { "file": "macros.html", "tests": [ { "macro_name": "my_macro", }, { ... }, ] } **`file`** is the template file. The test environment uses the same mechanism that Sheer uses to lookup template files, so the same file specification that's used within templates that use the macros. **`tests`** is a list of individual test case specifications. These corrospond to a single macro. The specification for a test case for an individual macro looks like this: json { "macro_name": "<a macro>", "skip": <true or false>, "arguments": [ ... ], "keyword_arguments": { ... }, "context": { "<context variable>": "<value>", } "filters": { "<filter name>": "<mock value>", "<filter name>": ["<first call mock value>", "<second call mock value>", ...] }, "context_functions": { "<function name>": "<mock value>", "<function name>": ["<first call mock value>", "<second call mock value>", ...] }, "templates": { "<template file>": { "<macro name>(<arguments>)": "<mock value>", "<macro name>()": ["<first call mock value>", "<second call mock value>", ...] } }, "assertions": [ { "selector": "<css selector>", "index": <1>, "value": "<string contained>", "assertion": "<equal>", "attribute": "<attribute name>", " ] } **`macro_name`** is simply the name of the macro within the file in which it is defined. **`skip`**, if true, will skip the macro test. This is optional. **`arguments`** is a list of arguments to pass to the macro in the order they are given. Can be either a list or a JSON object of keys/values; if it is a JSON object of keys/values, it is presumed to be keyword arguments. This is optional. **`keyword_arguments`** is an object containing key/value arguments to pass to the macro if it requires keyword arguments. This is optional. **`context`** is an object containing names of context variables to add to the template's context and values to assign to those variables. **`filters`** is an object that is used to mock template system filters. It contains the name of the filter to be mocked and the value that should be returned when that filter is used. The value can also be a list, in which case the order of the list will corropsond to the order in which the filter is called, i.e. if you want the filter to return `1` the first time it is called, but `2` the second time, the value would be `[1, 2]`. This is optional. *Note:* Here are some Sheer filters you may want to consider mocking: - `<API key>` - `is_filter_selected` **`context_functions`** is an object that is used to mock template context functions. It works the same way that `filters` does above, with the values either being a return value for all calls or a list of return values for each call. This is optional. *Note:* Here are some Sheer context functions you may want to consider mocking: - `queries` - `more_like_this` - `get_document` **`templates`** is an object that is used to mock included template macros called from within the macro being tested. It works the same way that `filters` and `context_functions` do above, with the values either being a return value for all calls or a list of return values for each call. The `<macro name>` should include parenthesis and any arguments the template's macro takes. This will override *the entire `<template file>`*, so make sure to mock all of its macros. This is optional. **`assertions`** defines the assertions to make about the result of rendering the macro. Assertion definitions take a CSS `selector`, an `index` in the list of matches for that selector (default is `0`), an `assertion` to make about the selected element or its `attribute` (if given), and a `value` for comparison (if necessary for the assertion). The `assertion` can be any of the following: - `equal` or `equals` - `not equal` or `not equals` - `exists` - `in` - `not in` Multiple test cases can be defined for the same macro, to test different behavior with different inputs, filter or context funciton output. Defining Tests in Python If there is a more complex scenario you would like to test that cannot be described by the JSON specification format, you can create a test case in Python. python class MyMacrosTestCase(MyBaseTestCase): def test_a_macro(self): self.mock_filter(...) self.<API key>(...) result = self.render_macro('mymacros.html', 'amacro') assert 'something' in result.select('.css-selector')[0] ` Running Tests Using the [`MyBaseTestCase` class defined above](#<API key>) and loading tests [defined in JSON files](#<API key>), the JSON files must be loaded into into a Python context. For example, in a file called `template_tests.py`: python from macropolo import JSONTestCaseLoader # Create MyTestCase subclasses for all JSON tests and add them to the # module's global context. tests_path = os.path.abspath(os.path.join(os.path.dirname( __file__ ), 'template_tests')) JSONTestCaseLoader(tests_path, MyBaseTestCase, globals()) # Run the tests if we're executed if __name__ == '__main__': unittest.main() From there the file can be run as-is: shell $ python template_tests.py Or it can be run using other Python test runners like [nose](https://nose.readthedocs.org/en/latest/): shell $ pip install nose $ nosetests Or [py.test](http://pytest.org/latest/) shell $ pip install pytest $ py.test ## API `MacroTestCase` The `MacroTestCase` class is intended to capture test cases for macros on a modular basis, i.e. you would create one subclass of `MacroTestCase` for each template file containing macros. That subclass can then include `test_[macro_name]()` methods that test each individual macro. This class requires a [templating system environment mixin](#<API key>) that provides `setup_environment()` that creates the templating system environment, `add_filter()` and `add_context()` which add filters and context name/values or functions to the template environment, and finally `render_macro()` which renders the macro using the template system and environment. `MacroTestCase` provides the following convenience methods: # `mock_filter(filter, **values)` Mock a template filter. This will create a mock function for the filter that will return either a single value, or will return each of the given values in turn if there are more than one. # `<API key>(func, **values)` Mock a context function. This will create a mock function that will return either a single value, or will return each of the given values in turn if there are more than one. # `make_assertion(result, selector, index=0, value=None, assertion='exists', attribute='')` Make an assertion based on the BeautifulSoup result object. This method will find the given CSS selector, and make the given assertion about the attribute of selector's match at the given index. If the assertion requires a value to compare to, it should be given. If no attribute is given the assertion is made about the entire match. Template Environment Mixins Template System environment mixin classes should provide four methods: # `setup_environment()` This method should setup the templating system's environment. # `render_macro(macro_file, macro, *args, **kwargs)` Render a given macro with the given arguments and keyword arguments. Should return a BeautifulSoup object. # `add_filter(name, filter)` Add the given filter to the template environment. # `add_context(name, value)` Add the given name/value to the template environment context. JSON Specification Functions # `JSONTestCaseLoader(tests_path, super_class, context)` Load JSON specifications for Jinja2 macro test cases from the given `tests_path`, calls `<API key>()` to create test case classes with the given `super_class` from the JSON files, and adds the resulting test case classes to the given `context` (i.e. `globals()`). # `<API key>(name, super_class, json_file, mixins=[])` Creates a test case class of the given `name` with the given `super_class` and `mixins` from JSON read from the given `json_file`. The test case class is returned. ## Licensing Public Domain/CC0 1.0 1. [Terms](TERMS.md) 2. [License](LICENSE) 3. [CFPB Source Code Policy](https://github.com/cfpb/source-code-policy/)
jsonp({"cep":"72922258","logradouro":"Quadra Quadra 48","bairro":"Jardim Am\u00e9rica II","cidade":"\u00c1guas Lindas de Goi\u00e1s","uf":"GO","estado":"Goi\u00e1s"});
jsonp({"cep":"06056280","logradouro":"Rua Raimundo Jos\u00e9 Nunes","bairro":"Novo Osasco","cidade":"Osasco","uf":"SP","estado":"S\u00e3o Paulo"});
jsonp({"cep":"69074177","logradouro":"Rua Frederico Felline","bairro":"Col\u00f4nia Oliveira Machado","cidade":"Manaus","uf":"AM","estado":"Amazonas"});
ALLPaths-LG (v49414) ## NOTE: add `.fastq` to the PE reads if that extension is not present # create a csv file called in_groups.csv file_name, library_name, group_name ~/g.<API key>*P.fastq, L1, frags1 ~/g.<API key>*.fastq, L2, jump2 # create a csv file called in_libs.csv library_name, project_name, organism_name, type, paired, frag_size, frag_stddev, insert_size, insert_stddev, read_orientation, genomic_start, genomic_end L1, g.morbida_ref_genome, geosmithia, fragment, 1, 300, 50, , , inward, 0, 0 L2, g.morbida_ref_genome, geosmithia, jump, 1, , , 3000, 500, outward, 0, 0 # Run the Preparation script ./<API key>.pl \ DATA_DIR= ~/ \ GENOME_SIZE=26000000 OVERWRITE=True PLOIDY=1 \ HOSTS=36 \ JAVA_MEM_GB=200 # Create the following directories and move files from the preparation step mkdir g.morbida cd g.morbida mkdir <API key> cd ~/ mv frag* ~/g.morbida/<API key> mv jump* ~/g.morbida/<API key> mv ploidy ~/g.morbida/<API key> cd ~/g.morbida/<API key> # Run the assembly pipeline in `~/g.morbida/<API key>` RunAllPathsLG THREADS=24 <API key>=TRUE \ PRE= ~/ \ DATA_SUBDIR=<API key> \ RUN=geosmithia MAXPAR=2 \ REFERENCE_NAME=g.morbida \ TARGETS=standard OVERWRITE=True \ CONNECT_SCAFFOLDS=TRUE HAPLOIDIFY=TRUE # For a short summary of length-based stats cd ~/g.morbida/<API key>/geosmithia/ASSEMBLIES/test abyss-fac linear_scaffolds0.clean.remodel.applied.connected.tag.assembly.fasta
jsonp({"cep":"24467060","logradouro":"Rua Ricardo Severo","bairro":"Boa\u00e7u","cidade":"S\u00e3o Gon\u00e7alo","uf":"RJ","estado":"Rio de Janeiro"});
jsonp({"cep":"14095530","logradouro":"Rua Jos\u00e9 Stupello","bairro":"Parque Anhang\u00fcera","cidade":"Ribeir\u00e3o Preto","uf":"SP","estado":"S\u00e3o Paulo"});
jsonp({"cep":"11674570","logradouro":"Rua Herm\u00ednia Vicente dos Santos","bairro":"Tinga","cidade":"Caraguatatuba","uf":"SP","estado":"S\u00e3o Paulo"});
jsonp({"cep":"68017036","logradouro":"Rua Vit\u00f3ria","bairro":"\u00c1rea Verde","cidade":"Santar\u00e9m","uf":"PA","estado":"Par\u00e1"});
jsonp({"cep":"65081810","logradouro":"Rua Carna\u00faba","bairro":"Residencial Para\u00edso","cidade":"S\u00e3o Lu\u00eds","uf":"MA","estado":"Maranh\u00e3o"});
jsonp({"cep":"18706568","logradouro":"Travessa Miguel Ferrante","bairro":"Jardim Santa M\u00f4nica","cidade":"Avar\u00e9","uf":"SP","estado":"S\u00e3o Paulo"});
jsonp({"cep":"24315155","logradouro":"Estrada Erasmo Braga","bairro":"Sap\u00ea","cidade":"Niter\u00f3i","uf":"RJ","estado":"Rio de Janeiro"});
jsonp({"cep":"89266363","logradouro":"Servid\u00e3o 335","bairro":"Tr\u00eas Rios do Norte","cidade":"Jaragu\u00e1 do Sul","uf":"SC","estado":"Santa Catarina"});
<?php /** * Class ProductFixture * * @package Cake.Test.Fixture */ class ProductFixture extends CakeTestFixture { /** * fields property * * @var array */ public $fields = array( 'id' => array('type' => 'integer', 'key' => 'primary'), 'name' => array('type' => 'string', 'length' => 255, 'null' => false), 'type' => array('type' => 'string', 'length' => 255, 'null' => false), 'price' => array('type' => 'integer', 'null' => false) ); /** * records property * * @var array */ public $records = array( array('name' => 'Park\'s Great Hits', 'type' => 'Music', 'price' => 19), array('name' => 'Silly Puddy', 'type' => 'Toy', 'price' => 3), array('name' => 'Playstation', 'type' => 'Toy', 'price' => 89), array('name' => 'Men\'s T-Shirt', 'type' => 'Clothing', 'price' => 32), array('name' => 'Blouse', 'type' => 'Clothing', 'price' => 34), array('name' => 'Electronica 2002', 'type' => 'Music', 'price' => 4), array('name' => 'Country Tunes', 'type' => 'Music', 'price' => 21), array('name' => 'Watermelon', 'type' => 'Food', 'price' => 9) ); }
jsonp({"cep":"77001715","logradouro":"Quadra 607 Norte Alameda 10","bairro":"Plano Diretor Norte","cidade":"Palmas","uf":"TO","estado":"Tocantins"});
jsonp({"cep":"88052300","logradouro":"Rua Bento Manoel Ferreira","bairro":"Ratones","cidade":"Florian\u00f3polis","uf":"SC","estado":"Santa Catarina"});
jsonp({"cep":"55644842","logradouro":"Rua Dez","bairro":"Ponto Alto","cidade":"Gravat\u00e1","uf":"PE","estado":"Pernambuco"});
var DEMO_WIDTH = 960, DEMO_HEIGHT = 500; var MIN_CLUSTERS = 2, MAX_CLUSTERS = 100, DEFAULT_K = 3; //""" window.onload = function() { console.info("init"); var algo = new JAMS.SequentialLloyds(DEFAULT_K); var demo = new JAMS.IncrementalDemo({ width:DEMO_WIDTH, height:DEMO_HEIGHT }); demo.on('click', function(args) { console.log("Got ", args); }); demo.on('redraw', function() { d3.selectAll('circle').on('click', function() { d3.event.stopPropagation(); var el = d3.select(this); if(el.attr('fill') !== 'rgb(200,200,200);') return; if(!d3.select('#start').attr('disabled')) { d3.select('#start').attr('disabled', true); d3.select('#reset').attr('disabled', null); d3.select('#next').attr('disabled', null); } var best = algo.Reveal(new JAMS.Point(Number.parseFloat(el.attr('cx')), Number.parseFloat(el.attr('cy')))); el.attr('fill', demo.colors(best)); demo.centers = algo.centers; demo.Redraw(); }); }); demo.on('start', function() { d3.select('#next').attr('disabled', null); }); demo.on('reset', function() { d3.select('#next').attr('disabled', true); console.info('yo', algo); d3.selectAll('circle').attr('fill', 'rgb(200,200,200);'); algo.Reset(); demo.centers = []; }); d3.select('#next').on('click', function() { console.log("TESTTTTTT!"); // algo.Reveal() }); }
jsonp({"cep":"13344210","logradouro":"Rua Professora Maria Cec\u00edlia Ifanger","bairro":"Vila Costa e Silva","cidade":"Indaiatuba","uf":"SP","estado":"S\u00e3o Paulo"});
title: Elk Ridge permalink: "/places/utah/elk-ridge/" layout: page 2018 Election {% include 2018-elections.html %} # 2018 Primary Candidates {% assign city = site.data.2018.primary.candidates | where:'city','Elk Ridge' | sort: 'last_name' %} <table> <thead> <th>First Names</th> <th>Last Names</th> <th>Candidate for</th> <th>City</th> <th>County</th> </thead> <tbody> {% for member in city %} <tr> <td><a href="{{ site.url }}/people/{{ member.id }}">{{ member.first_names }}</a></td> <td><a href="{{ site.url }}/people/{{ member.id }}">{{ member.last_names }}</a></td> <td><a href="{{ site.url }}/office/{{ member.office | downcase | replace: ' ','-' | replace: '.','' | replace: '(','' | replace: ')','' }}">{{ member.office }}</a></td> <td><a href="{{ site.url }}/places/{{ member.county | downcase | replace: ' ','-' }}/{{ member.city | downcase | replace: ' ','-' }}">{{ member.city }}</a></td> <td><a href="{{ site.url }}/places/{{ member.county | downcase | replace: ' ','-' }}">{{ member.county }}</a></td> </tr> {% endfor %} </tbody> </table>
jsonp({"cep":"35300079","logradouro":"Vila Modesto","bairro":"Centro","cidade":"Caratinga","uf":"MG","estado":"Minas Gerais"});
jsonp({"cep":"75503280","logradouro":"Avenida Adoniro Andrade","bairro":"Setor Central","cidade":"Itumbiara","uf":"GO","estado":"Goi\u00e1s"});
jsonp({"cep":"28035581","logradouro":"Avenida Alberto Torres","bairro":"Centro","cidade":"Campos dos Goytacazes","uf":"RJ","estado":"Rio de Janeiro"});
package com.github.signal2564.voronoi import java.lang.Math.{abs, acos, pow, signum, sqrt} import com.badlogic.gdx.graphics.Color import scala.collection.immutable.HashMap import scala.util.Random.nextFloat /** * @param color default color is random, with alpha 1 */ case class Point(x: Double, y: Double, color: Color = new Color(nextFloat, nextFloat, nextFloat, 1)) { val sqLength = pow(x, 2) + pow(y, 2) val length = sqrt(sqLength) lazy val normalize = new Point(x / length, y / length) def -(p: Point): Point = new Point(x - p.x, y - p.y) def +(p: Point): Point = new Point(x + p.x, y + p.x) def *(c: Double): Point = new Point(x * c, y * c) def /(c: Double): Point = new Point(x / c, y / c) def x(p: Point): Double = x * p.y - y * p.x def o(p: Point): Double = x * p.x + y * p.y def angleTo(p: Point): Double = signum(this x p) * acos(this.normalize o p.normalize) def distanceTo(p: Point): Double = (this - p).length override def equals(obj: scala.Any): Boolean = { obj match { case p: Point => p.x == x && p.y == y case _ => false } } } sealed trait Edge { val p1: Point val p2: Point val length = (p2 - p1).length } case class DirectedEdge(p1: Point, p2: Point) extends Edge case class UndirectedEdge(p1: Point, p2: Point) extends Edge { override def equals(obj: scala.Any): Boolean = { obj match { case e: UndirectedEdge => (e.p1 == p1 && e.p2 == p2) || (e.p1 == p2 && e.p2 == p1) case _ => false } } } class PowerEdge(p1: Point, p2: Point, var leftPoint: Option[Point] = None, var rightPoint: Option[Point] = None) extends UndirectedEdge(p1, p2) object PowerEdge { def apply(p1: Point, p2: Point, leftPoint: Option[Point] = None, rightPoint: Option[Point] = None): PowerEdge = new PowerEdge(p1, p2, leftPoint, rightPoint) def unapply(e: PowerEdge): Option[(Point, Point, Option[Point], Option[Point])] = Some((e.p1, e.p2, e.leftPoint, e.rightPoint)) } case class Line(p1: Point, p2: Point) { val a = (p2.y - p1.y) / (p2.x - p1.x) val b = - a * p2.x + p1.y def apply(x: Double): Double = a * x + b def intercept(l: Line): Option[Point] = { if (a == l.a) None else { val x = - (l.b - b) / (l.a - a) Some(new Point(x, a * x + b)) } } } case class Circle(center: Point, radius: Double) { def contains(p: Point): Boolean = (p - center).length < radius } object Circle { def fromPoints(p1: Point, p2: Point, p3: Point): Circle = { val cp = (p2 - p1) x (p3 - p1) if (cp != 0.0) { val p1Sq = p1.sqLength val p2Sq = p2.sqLength val p3Sq = p3.sqLength val cx = (p1Sq * (p2.y - p3.y) + p2Sq * (p3.y - p1.y) + p3Sq * (p1.y - p2.y)) / (2.0f * cp) val cy = (p1Sq * (p3.x - p2.x) + p2Sq * (p1.x - p3.x) + p3Sq * (p2.x - p1.x)) / (2.0f * cp) val p = new Point(cx, cy) new Circle(p, p.distanceTo(p1)) } else throw new RuntimeException("points on one line") } } case class Polygon(points: List[Point]) { private val eps = 1E-5 val edges: List[Edge] = { List( List(new UndirectedEdge(points.last, points.head)), for (i <- 0 until points.length - 1) yield new UndirectedEdge(points(i), points(i + 1)) ).flatten } def contains(p: Point): Boolean = abs(2 * Math.PI - edges.foldLeft(0.0) { (a, e) => a + (e.p2 - p).angleTo(e.p1 - p) }) < eps } sealed trait Graph[P <: Point, E <: Edge] { val points: List[P] val edges: List[E] val adjust: Map[P, List[E]] def containsEdges(es: Seq[E]): Boolean def containsPoints(ps: Seq[P]): Boolean } case class UndirectedGraph[P <: Point, E <: UndirectedEdge] (points: List[P], edges: List[E]) extends Graph[P, E] { lazy val adjust = HashMap.newBuilder[P, List[E]] .++=(points.map(p => (p, edges.filter(e => e.p1 == p || e.p2 == p)))) .result() override def containsEdges(es: Seq[E]): Boolean = es.forall(edges.contains) override def containsPoints(ps: Seq[P]): Boolean = ps.forall(points.contains) }
##C++ Primer (5th Edition) exercise answers. Note - Use `-std=c++11`(optional: `-pedantic -Wall`) flag when compiling.(or you can use Visual Studio 2012+) - If you found any bug, please [let me know](https://github.com/Mooophy/Cpp-Primer/issues/new), thanks. - I have downloaded the headers from this book's [web site](http: - In order to test the program in an efficient way, I also put the test data file in the `data` folder. How to contribute - Please **fork**([How?](https://help.github.com/articles/fork-a-repo)) this repository first. - **commit**([How?](https://help.github.com/articles/create-a-repo#<API key>)) in your own repository. - Give me a **pull request**([How?](https://help.github.com/articles/using-pull-requests)). - Syncing with([How?](https://help.github.com/articles/syncing-a-fork/)) the origin repository. This is very **important** because this repo updates frequently. Table of Contents - [Chapter 1. Getting Started](ch01/README.md) - Part I: The Basics - [Chapter 2. Variables and Basic Types](ch02/README.md) - [Chapter 3. Strings, Vectors, and Arrays](ch03/README.md) - [Chapter 4. Expressions](ch04/README.md) - [Chapter 5. Statements](ch05/README.md) - [Chapter 6. Functions](ch06/README.md) - [Chapter 7. Classes](ch07/README.md) - Part II: The C++ Library - [Chapter 8. The IO Library](ch08/README.md) - [Chapter 9. Sequential Containers](ch09) - [Chapter 10. Generic Algorithms](ch10) - [Chapter 11. Associative Containers](ch11) - [Chapter 12. Dynamic Memory](ch12) - Part III: Tools for Class Authors - [Chapter 13. Copy Control](ch13) - [Chapter 14. Overloaded Operations and Conversions](ch14) - [Chapter 15. Object-Oriented Programming](ch15) - [Chapter 16. Templates and Generic Programming](ch16) - Part IV: Advanced Topics - [Chapter 17. Specialized Library Facilities](ch17) - [Chapter 18. Tools for Large Programs](ch18) - Chapter 19. Specialized Tools and Techniques If you speak Chinese 1. [POStackOverflow](http://book.douban.com/review/6500246/) 2. [C++ Primer issues()](http: 3. [C++ Primer 5 by](http:
jsonp({"cep":"64033628","logradouro":"Quadra 21","bairro":"Santo Ant\u00f4nio","cidade":"Teresina","uf":"PI","estado":"Piau\u00ed"});
jsonp({"cep":"94100610","logradouro":"Estrada Santa Tecla","bairro":"\u00c1guas Mortas","cidade":"Gravata\u00ed","uf":"RS","estado":"Rio Grande do Sul"});
jsonp({"cep":"39801512","logradouro":"Rua Leolina Gomes de Matos","bairro":"Pampulhinha","cidade":"Te\u00f3filo Otoni","uf":"MG","estado":"Minas Gerais"});
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace wiseapp.Repository { public interface IUnitOfWork : IDisposable { <summary> Saves all pending changes </summary> <returns>The number of objects in an Added, Modified, or Deleted state</returns> int Commit(); } }
jsonp({"cep":"85195000","cidade":"Reserva do Igua\u00e7u","uf":"PR","estado":"Paran\u00e1"});
jsonp({"cep":"32042090","logradouro":"Rua Petrina Moreira da Silva","bairro":"Alvorada","cidade":"Contagem","uf":"MG","estado":"Minas Gerais"});
jsonp({"cep":"41610640","logradouro":"Alto do Icuara","bairro":"Itapu\u00e3","cidade":"Salvador","uf":"BA","estado":"Bahia"});
<!DOCTYPE html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Expires" content="-1"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Cache-Control" content="no-cache"> <title>105</title> <link href="../css/style.css" rel="stylesheet" type="text/css"> <link href="../css/style2.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="../js/ftiens4.js"></script> <script type="text/javascript" src="../js/ua.js"></script> <script type="text/javascript" src="../js/func.js"></script> <script type="text/javascript" src="../js/treeP1.js"></script> <script type="text/javascript" src="../js/refresh.js"></script> </head> <body id="main-body"> <div id="main-header"> <div id="main-top"> <a class="main-top-logo" href=" <ul class="main-top-list"> <li class="main-top-item"><a class="main-top-link main-top-link-home" href="../index.html"></a></li> <li class="main-top-item"><a class="main-top-link main-top-link-cec" href="http://2016.cec.gov.tw"></a></li> <li class="main-top-item"><a class="main-top-link <API key>" href="../../en/index.html">English</a></li> </ul> </div> </div> <div id="main-wrap"> <div id="main-banner"> <div class="slideshow"> <img src="../img/main_bg_1.jpg" width="1024" height="300" alt="background" title="background"> </div> <div class="main-deco"></div> <div class="main-title"></div> <a class="main-pvpe main-pvpe-current" href="../IDX/indexP1.html"></a> <a class="main-le" href="../IDX/indexT.html"></a> </div> <div id="main-container"> <div id="main-content"> <table width="1024" border="1" cellpadding="0" cellspacing="0"> <tr> <td width="180" valign="top"> <div id="divMenu"> <table border="0"> <tr> <td><a style="text-decoration:none;color:silver" href="http: </tr> </table> <span class="TreeviewSpanArea"> <script>initializeDocument()</script> <noscript>Javascript</noscript> </span> </div> </td> <td width="796" valign="top"> <div id="divContent"> <table width="100%" border="0" cellpadding="0" cellspacing="4"> <tr> <td><img src="../images/search.png" alt="" title="">&nbsp;<b>&nbsp; &nbsp;</b></td> </tr> <tr valign="bottom"> <td> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr valign="bottom"> <td class="fontNumber">&nbsp;<img src="../images/nav.gif" alt="" title="">&nbsp;<img src="../images/nav.gif" alt="" title="">&nbsp;3&nbsp;&nbsp;<img src="../images/nav.gif" alt="" title="">&nbsp;<img src="../images/nav.gif" alt="" title="">&nbsp;1</td> <td align="right"> <select name="selector_order" class="selectC" tabindex="1" id="orderBy" onChange="changeOrder();"> <option value="n"></option> <option value="s"></option> </select> </td> </tr> </table> </td> </tr> <tr valign="top"> <td> <table width="100%" border="0" cellpadding="6" cellspacing="1" class="tableT"> <tr class="trHeaderT"> <td></td> <td></td> <td><table><tr><td></td><td rowspan=2></td></tr><td></td></table></td> <td></td> <td></td> <td>%</td> <td></td> </tr> <tr class="trT"> <td>&nbsp;</td> <td>1</td> <td><br></td> <td><br></td> <td class="tdAlignRight">1,082</td> <td class="tdAlignRight">18.9525</td> <td>&nbsp; </td> </tr> <tr class="trT"> <td>&nbsp;</td> <td>2</td> <td><br></td> <td><br></td> <td class="tdAlignRight">4,133</td> <td class="tdAlignRight">72.3945</td> <td>&nbsp; </td> </tr> <tr class="trT"> <td>&nbsp;</td> <td>3</td> <td><br></td> <td><br></td> <td class="tdAlignRight">494</td> <td class="tdAlignRight">8.6530</td> <td>&nbsp; </td> </tr> <tr class="trFooterT"> <td colspan="7" align="right">/:&nbsp;18/18&nbsp;</td> </tr> </table> </td> </tr> <tr valign="top"> <td> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="10"></td> <td valign="top" class="fontNote"> <table> <tr> <td></td> <td align="center"></td> <td></td> </tr> <tr> <td></td> <td align="center"></td> <td></td> </tr> </table> </td> <td valign="top" class="fontTimer"><img src="../images/clock2.png" alt="Sat, 16 Jan 2016 21:21:11 +0800" title="Sat, 16 Jan 2016 21:21:11 +0800">&nbsp;&nbsp;01/16&nbsp;21:21:06&nbsp;<br>(3)</td> </tr> <tr> <td colspan="3" class="fontNote"></td> </tr> </table> </td> </tr> </table> </div> </td> </tr> </table> </div> <div class="main-footer"></div> <div id="divFooter" align=center>[] </div> <!--main-content </div><!--main-container </div><!--END main-wrap <script>setOrder();</script> <script>setMenuScrollPosY();</script> </body> </html>
jsonp({"cep":"18072853","logradouro":"Rua Jos\u00e9 Fontoura Costa","bairro":"Caguassu","cidade":"Sorocaba","uf":"SP","estado":"S\u00e3o Paulo"});
jsonp({"cep":"36774412","logradouro":"Rua Alencar Fonseca","bairro":"Sol Nascente","cidade":"Cataguases","uf":"MG","estado":"Minas Gerais"});
jsonp({"cep":"13505505","logradouro":"Rua 8","bairro":"Jardim Residencial S\u00e3o Jos\u00e9","cidade":"Rio Claro","uf":"SP","estado":"S\u00e3o Paulo"});
jsonp({"cep":"29041380","logradouro":"Rua Ott\u00edlia Grij\u00f3","bairro":"Rom\u00e3o","cidade":"Vit\u00f3ria","uf":"ES","estado":"Esp\u00edrito Santo"});
jsonp({"cep":"56323450","logradouro":"Rua do Conhecimento","bairro":"Dom Avelar","cidade":"Petrolina","uf":"PE","estado":"Pernambuco"});
jsonp({"cep":"12233630","logradouro":"Rua Jos\u00e9 Armando de Oliveira Gomes","bairro":"Bosque dos Eucaliptos","cidade":"S\u00e3o Jos\u00e9 dos Campos","uf":"SP","estado":"S\u00e3o Paulo"});
jsonp({"cep":"14169257","logradouro":"Rua Tranquilo Pavan","bairro":"Jardim S\u00e3o Sebasti\u00e3o","cidade":"Sert\u00e3ozinho","uf":"SP","estado":"S\u00e3o Paulo"});
jsonp({"cep":"13175180","logradouro":"Rua Presidente Carlos Luz","bairro":"Jardim Monte Santo","cidade":"Sumar\u00e9","uf":"SP","estado":"S\u00e3o Paulo"});
<template> My technologies <!-- Slider main container --> <div class="swiper-container"> <!-- Additional required wrapper --> <div class="swiper-wrapper"> <!-- Slides --> <div class="swiper-slide">Slide 1</div> <div class="swiper-slide">Slide 2</div> <div class="swiper-slide">Slide 3</div> </div> <!-- If we need pagination --> <div class="swiper-pagination"></div> <!-- If we need navigation buttons --> <div class="swiper-button-prev"></div> <div class="swiper-button-next"></div> <!-- If we need scrollbar --> <div class="swiper-scrollbar"></div> </div> </template>
jsonp({"cep":"63010510","logradouro":"Rua S\u00e3o Miguel","bairro":"S\u00e3o Miguel","cidade":"Juazeiro do Norte","uf":"CE","estado":"Cear\u00e1"});
#pragma once #include <stdint.h> template <typename TYPE> void Construct(void* dest) { new ((TYPE*)dest) TYPE; } template <typename TYPE> void Destruct(void* dest) { ((TYPE*)dest)->~TYPE(); } // BaseStack template<class T> class BaseStack { public: BaseStack() : _size(0), _capacity(0), _data(0) { _typeSize = sizeof(T); _constructor = !<API key>(T); _destructor = !<API key>(T); } virtual ~BaseStack() { if (_data != 0) { clear(); delete[] _data; } } virtual bool allowed(int size) = 0; void push(const T& t) { if (allowed(_size)) { if (_size + 1 > _capacity) { grow(_capacity * 2 + 8); } _items[_size++] = t; } } void pop() { if (_size > 0) { uint8_t* ptr = _data + (_size - 1) * _typeSize; Destruct<T>(ptr); --_size; } } const T& top() const { return _items[_size - 1]; } T& top() { return _items[_size - 1]; } const T& at(int index) const { return _items[_size - index - 1]; } T& at(int index) { return _items[_size - index - 1]; } uint32_t size() const { return _size; } bool empty() const { return _size == 0; } void clear() { if (_destructor) { uint8_t* ptr = _data; for (uint32_t i = 0; i < _size; ++i) { Destruct<T>(ptr); ptr += _typeSize; } } _size = 0; } private: void grow(uint32_t newCapacity) { if (newCapacity > _capacity) { uint8_t* newItems = new uint8_t[newCapacity * _typeSize]; if (_data != 0) { memcpy(newItems, _data, _size * _typeSize); } uint8_t* ptr = newItems + _size * _typeSize; if (_data != 0) { delete[] _data; } _data = newItems; _capacity = newCapacity; } } uint32_t _size; uint32_t _capacity; bool _constructor; bool _destructor; uint32_t _typeSize; union { uint8_t* _data; T* _items; }; }; // Stack template<class T> class Stack : public BaseStack<T> { public: Stack() : BaseStack() {} virtual ~Stack() {} bool allowed(int size) { return true; } }; // FixedSizeStack template<class T> class FixedSizeStack : public BaseStack<T> { public: FixedSizeStack(int max) : BaseStack() , _max(max) {} virtual ~FixedSizeStack() {} bool allowed(int size) { if (size >= _max) { return false; } return true; } private: int _max; };
jsonp({"cep":"88702750","logradouro":"Rua Paulo Antunes dos Santos","bairro":"F\u00e1bio Silva","cidade":"Tubar\u00e3o","uf":"SC","estado":"Santa Catarina"});
jsonp({"cep":"29317434","logradouro":"Rua Pedro Calegari","bairro":"S\u00e3o Francisco de Assis","cidade":"Cachoeiro de Itapemirim","uf":"ES","estado":"Esp\u00edrito Santo"});
jsonp({"cep":"58802790","logradouro":"Rua Tenente Zuca","bairro":"S\u00e3o Jos\u00e9","cidade":"Sousa","uf":"PB","estado":"Para\u00edba"});
jsonp({"cep":"74496140","logradouro":"Avenida Jo\u00e3o Carvalho Rezende","bairro":"Loteamento Tropical Ville","cidade":"Goi\u00e2nia","uf":"GO","estado":"Goi\u00e1s"});
jsonp({"cep":"66833880","logradouro":"Rua Paulo Fonteles II","bairro":"Tapan\u00e3 (Icoaraci)","cidade":"Bel\u00e9m","uf":"PA","estado":"Par\u00e1"});
jsonp({"cep":"74989770","logradouro":"Rua 120","bairro":"Jardim Miramar","cidade":"Aparecida de Goi\u00e2nia","uf":"GO","estado":"Goi\u00e1s"});
<!DOCTYPE html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Expires" content="-1"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Cache-Control" content="no-cache"> <title>105</title> <link href="../css/style.css" rel="stylesheet" type="text/css"> <link href="../css/style2.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="../js/ftiens4.js"></script> <script type="text/javascript" src="../js/ua.js"></script> <script type="text/javascript" src="../js/func.js"></script> <script type="text/javascript" src="../js/treeP1.js"></script> <script type="text/javascript" src="../js/refresh.js"></script> </head> <body id="main-body"> <div id="main-header"> <div id="main-top"> <a class="main-top-logo" href=" <ul class="main-top-list"> <li class="main-top-item"><a class="main-top-link main-top-link-home" href="../index.html"></a></li> <li class="main-top-item"><a class="main-top-link main-top-link-cec" href="http://2016.cec.gov.tw"></a></li> <li class="main-top-item"><a class="main-top-link <API key>" href="../../en/index.html">English</a></li> </ul> </div> </div> <div id="main-wrap"> <div id="main-banner"> <div class="slideshow"> <img src="../img/main_bg_1.jpg" width="1024" height="300" alt="background" title="background"> </div> <div class="main-deco"></div> <div class="main-title"></div> <a class="main-pvpe main-pvpe-current" href="../IDX/indexP1.html"></a> <a class="main-le" href="../IDX/indexT.html"></a> </div> <div id="main-container"> <div id="main-content"> <table width="1024" border="1" cellpadding="0" cellspacing="0"> <tr> <td width="180" valign="top"> <div id="divMenu"> <table border="0"> <tr> <td><a style="text-decoration:none;color:silver" href="http: </tr> </table> <span class="TreeviewSpanArea"> <script>initializeDocument()</script> <noscript>Javascript</noscript> </span> </div> </td> <td width="796" valign="top"> <div id="divContent"> <table width="100%" border="0" cellpadding="0" cellspacing="4"> <tr> <td><img src="../images/search.png" alt="" title="">&nbsp;<b>&nbsp; &nbsp;</b></td> </tr> <tr valign="bottom"> <td> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr valign="bottom"> <td class="fontNumber">&nbsp;<img src="../images/nav.gif" alt="" title="">&nbsp;<img src="../images/nav.gif" alt="" title="">&nbsp;3&nbsp;&nbsp;<img src="../images/nav.gif" alt="" title="">&nbsp;<img src="../images/nav.gif" alt="" title="">&nbsp;1</td> <td align="right"> <select name="selector_order" class="selectC" tabindex="1" id="orderBy" onChange="changeOrder();"> <option value="n"></option> <option value="s"></option> </select> </td> </tr> </table> </td> </tr> <tr valign="top"> <td> <table width="100%" border="0" cellpadding="6" cellspacing="1" class="tableT"> <tr class="trHeaderT"> <td></td> <td></td> <td><table><tr><td></td><td rowspan=2></td></tr><td></td></table></td> <td></td> <td></td> <td>%</td> <td></td> </tr> <tr class="trT"> <td>&nbsp;</td> <td>1</td> <td><br></td> <td><br></td> <td class="tdAlignRight">535</td> <td class="tdAlignRight">49.4455</td> <td>&nbsp; </td> </tr> <tr class="trT"> <td>&nbsp;</td> <td>2</td> <td><br></td> <td><br></td> <td class="tdAlignRight">247</td> <td class="tdAlignRight">22.8281</td> <td>&nbsp; </td> </tr> <tr class="trT"> <td>&nbsp;</td> <td>3</td> <td><br></td> <td><br></td> <td class="tdAlignRight">300</td> <td class="tdAlignRight">27.7264</td> <td>&nbsp; </td> </tr> <tr class="trFooterT"> <td colspan="7" align="right">/:&nbsp;4/4&nbsp;</td> </tr> </table> </td> </tr> <tr valign="top"> <td> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="10"></td> <td valign="top" class="fontNote"> <table> <tr> <td></td> <td align="center"></td> <td></td> </tr> <tr> <td></td> <td align="center"></td> <td></td> </tr> </table> </td> <td valign="top" class="fontTimer"><img src="../images/clock2.png" alt="Sat, 16 Jan 2016 19:45:12 +0800" title="Sat, 16 Jan 2016 19:45:12 +0800">&nbsp;&nbsp;01/16&nbsp;19:45:06&nbsp;<br>(3)</td> </tr> <tr> <td colspan="3" class="fontNote"></td> </tr> </table> </td> </tr> </table> </div> </td> </tr> </table> </div> <div class="main-footer"></div> <div id="divFooter" align=center>[] </div> <!--main-content </div><!--main-container </div><!--END main-wrap <script>setOrder();</script> <script>setMenuScrollPosY();</script> </body> </html>
jsonp({"cep":"05596180","logradouro":"Viela D","bairro":"Cidade dos Bandeirantes","cidade":"S\u00e3o Paulo","uf":"SP","estado":"S\u00e3o Paulo"});
jsonp({"cep":"66810490","logradouro":"Vila Matos Costa","bairro":"Cruzeiro (Icoaraci)","cidade":"Bel\u00e9m","uf":"PA","estado":"Par\u00e1"});
jsonp({"cep":"13568658","logradouro":"Rua Jorge Suquisaqui","bairro":"Residencial Parque Douradinho","cidade":"S\u00e3o Carlos","uf":"SP","estado":"S\u00e3o Paulo"});
jsonp({"cep":"40352460","logradouro":"Rua da Fraternidade","bairro":"Fazenda Grande do Retiro","cidade":"Salvador","uf":"BA","estado":"Bahia"});
package org.jboss.shrinkwrap.descriptor.api.facesuicomponent20; import java.util.List; import org.jboss.shrinkwrap.descriptor.api.Child; /** * This interface defines the contract for the <code> <API key> </code> xsd type * @author <a href="mailto:ralf.battenfeld@bluewin.ch">Ralf Battenfeld</a> * @author <a href="mailto:alr@jboss.org">Andrew Lee Rubinger</a> */ public interface <API key><T> extends Child<T> { // ClassName: <API key> ElementName: javaee:<API key> ElementType : attribute // MaxOccurs: -unbounded isGeneric: true isAttribute: false isEnum: false isDataType: false /** * If not already created, a new <code>attribute</code> element will be created and returned. * Otherwise, the first existing <code>attribute</code> element will be returned. * @return the instance defined for the element <code>attribute</code> */ public <API key><<API key><T>> <API key>(); /** * Creates a new <code>attribute</code> element * @return the new created instance of <code><API key><<API key><T>></code> */ public <API key><<API key><T>> createAttribute(); /** * Returns all <code>attribute</code> elements * @return list of <code>attribute</code> */ public List<<API key><<API key><T>>> getAllAttribute(); /** * Removes all <code>attribute</code> elements * @return the current instance of <code><API key><<API key><T>></code> */ public <API key><T> removeAllAttribute(); // ClassName: <API key> ElementName: xsd:string ElementType : name // MaxOccurs: - isGeneric: true isAttribute: true isEnum: false isDataType: true /** * Sets the <code>name</code> attribute * @param name the value for the attribute <code>name</code> * @return the current instance of <code><API key><T></code> */ public <API key><T> name(String name); /** * Returns the <code>name</code> attribute * @return the value defined for the attribute <code>name</code> */ public String getName(); /** * Removes the <code>name</code> attribute * @return the current instance of <code><API key><T></code> */ public <API key><T> removeName(); // ClassName: <API key> ElementName: xsd:string ElementType : displayName // MaxOccurs: - isGeneric: true isAttribute: true isEnum: false isDataType: true /** * Sets the <code>displayName</code> attribute * @param displayName the value for the attribute <code>displayName</code> * @return the current instance of <code><API key><T></code> */ public <API key><T> displayName(String displayName); /** * Returns the <code>displayName</code> attribute * @return the value defined for the attribute <code>displayName</code> */ public String getDisplayName(); /** * Removes the <code>displayName</code> attribute * @return the current instance of <code><API key><T></code> */ public <API key><T> removeDisplayName(); // ClassName: <API key> ElementName: xsd:string ElementType : shortDescription // MaxOccurs: - isGeneric: true isAttribute: true isEnum: false isDataType: true /** * Sets the <code>shortDescription</code> attribute * @param shortDescription the value for the attribute <code>shortDescription</code> * @return the current instance of <code><API key><T></code> */ public <API key><T> shortDescription(String shortDescription); /** * Returns the <code>shortDescription</code> attribute * @return the value defined for the attribute <code>shortDescription</code> */ public String getShortDescription(); /** * Removes the <code>shortDescription</code> attribute * @return the current instance of <code><API key><T></code> */ public <API key><T> <API key>(); // ClassName: <API key> ElementName: xsd:string ElementType : default // MaxOccurs: - isGeneric: true isAttribute: true isEnum: false isDataType: true /** * Sets the <code>default</code> attribute * @param _default the value for the attribute <code>default</code> * @return the current instance of <code><API key><T></code> */ public <API key><T> _default(String _default); /** * Returns the <code>default</code> attribute * @return the value defined for the attribute <code>default</code> */ public String get_Default(); /** * Removes the <code>default</code> attribute * @return the current instance of <code><API key><T></code> */ public <API key><T> remove_Default(); // ClassName: <API key> ElementName: xsd:string ElementType : method-signature // MaxOccurs: - isGeneric: true isAttribute: true isEnum: false isDataType: true /** * Sets the <code>method-signature</code> attribute * @param methodSignature the value for the attribute <code>method-signature</code> * @return the current instance of <code><API key><T></code> */ public <API key><T> methodSignature(String methodSignature); /** * Returns the <code>method-signature</code> attribute * @return the value defined for the attribute <code>method-signature</code> */ public String getMethodSignature(); /** * Removes the <code>method-signature</code> attribute * @return the current instance of <code><API key><T></code> */ public <API key><T> <API key>(); // ClassName: <API key> ElementName: xsd:string ElementType : applyTo // MaxOccurs: - isGeneric: true isAttribute: true isEnum: false isDataType: true /** * Sets the <code>applyTo</code> attribute * @param applyTo the value for the attribute <code>applyTo</code> * @return the current instance of <code><API key><T></code> */ public <API key><T> applyTo(String applyTo); /** * Returns the <code>applyTo</code> attribute * @return the value defined for the attribute <code>applyTo</code> */ public String getApplyTo(); /** * Removes the <code>applyTo</code> attribute * @return the current instance of <code><API key><T></code> */ public <API key><T> removeApplyTo(); // ClassName: <API key> ElementName: xsd:boolean ElementType : required // MaxOccurs: - isGeneric: true isAttribute: true isEnum: false isDataType: true /** * Sets the <code>required</code> attribute * @param required the value for the attribute <code>required</code> * @return the current instance of <code><API key><T></code> */ public <API key><T> required(Boolean required); /** * Returns the <code>required</code> attribute * @return the value defined for the attribute <code>required</code> */ public Boolean isRequired(); /** * Removes the <code>required</code> attribute * @return the current instance of <code><API key><T></code> */ public <API key><T> removeRequired(); // ClassName: <API key> ElementName: xsd:boolean ElementType : preferred // MaxOccurs: - isGeneric: true isAttribute: true isEnum: false isDataType: true /** * Sets the <code>preferred</code> attribute * @param preferred the value for the attribute <code>preferred</code> * @return the current instance of <code><API key><T></code> */ public <API key><T> preferred(Boolean preferred); /** * Returns the <code>preferred</code> attribute * @return the value defined for the attribute <code>preferred</code> */ public Boolean isPreferred(); /** * Removes the <code>preferred</code> attribute * @return the current instance of <code><API key><T></code> */ public <API key><T> removePreferred(); // ClassName: <API key> ElementName: xsd:boolean ElementType : expert // MaxOccurs: - isGeneric: true isAttribute: true isEnum: false isDataType: true /** * Sets the <code>expert</code> attribute * @param expert the value for the attribute <code>expert</code> * @return the current instance of <code><API key><T></code> */ public <API key><T> expert(Boolean expert); /** * Returns the <code>expert</code> attribute * @return the value defined for the attribute <code>expert</code> */ public Boolean isExpert(); /** * Removes the <code>expert</code> attribute * @return the current instance of <code><API key><T></code> */ public <API key><T> removeExpert(); }
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <title>XSSFDataFormat (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="XSSFDataFormat (POI API Documentation)"; } </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <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 class="navBarCell1Rev">Class</li> <li><a href="class-use/XSSFDataFormat.html">Use</a></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><a href="../../../../../org/apache/poi/xssf/usermodel/<API key>.html" title="class in org.apache.poi.xssf.usermodel"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../../org/apache/poi/xssf/usermodel/XSSFDataValidation.html" title="class in org.apache.poi.xssf.usermodel"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/apache/poi/xssf/usermodel/XSSFDataFormat.html" target="_top">Frames</a></li> <li><a href="XSSFDataFormat.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_top"> </a></div> <div class="header"> <div class="subTitle">org.apache.poi.xssf.usermodel</div> <h2 title="Class XSSFDataFormat" class="title">Class XSSFDataFormat</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>org.apache.poi.xssf.usermodel.XSSFDataFormat</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd><a href="../../../../../org/apache/poi/ss/usermodel/DataFormat.html" title="interface in org.apache.poi.ss.usermodel">DataFormat</a></dd> </dl> <hr> <br> <pre>public class <span class="strong">XSSFDataFormat</span> extends java.lang.Object implements <a href="../../../../../org/apache/poi/ss/usermodel/DataFormat.html" title="interface in org.apache.poi.ss.usermodel">DataFormat</a></pre> <div class="block">Handles data formats for XSSF. Per Microsoft Excel 2007+ format limitations: Workbooks support between 200 and 250 "number formats" (POI calls them "data formats") So short or even byte would be acceptable data types to use for referring to data format indices. https://support.office.com/en-us/article/<API key></div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="constructor_summary"> </a> <h3>Constructor Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier</th> <th class="colLast" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>protected </code></td> <td class="colLast"><code><strong><a href="../../../../../org/apache/poi/xssf/usermodel/XSSFDataFormat.html#XSSFDataFormat(org.apache.poi.xssf.model.StylesTable)">XSSFDataFormat</a></strong>(<a href="../../../../../org/apache/poi/xssf/model/StylesTable.html" title="class in org.apache.poi.xssf.model">StylesTable</a>&nbsp;stylesSource)</code>&nbsp;</td> </tr> </table> </li> </ul> <ul class="blockList"> <li class="blockList"><a name="method_summary"> </a> <h3>Method Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../../org/apache/poi/xssf/usermodel/XSSFDataFormat.html#getFormat(int)">getFormat</a></strong>(int&nbsp;index)</code> <div class="block">get the format string that matches the given format index</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../../org/apache/poi/xssf/usermodel/XSSFDataFormat.html#getFormat(short)">getFormat</a></strong>(short&nbsp;index)</code> <div class="block">get the format string that matches the given format index</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>short</code></td> <td class="colLast"><code><strong><a href="../../../../../org/apache/poi/xssf/usermodel/XSSFDataFormat.html#getFormat(java.lang.String)">getFormat</a></strong>(java.lang.String&nbsp;format)</code> <div class="block">Get the format index that matches the given format string, creating a new format entry if required.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../../org/apache/poi/xssf/usermodel/XSSFDataFormat.html#putFormat(short,%20java.lang.String)">putFormat</a></strong>(short&nbsp;index, java.lang.String&nbsp;format)</code> <div class="block">Add a number format with a specific ID into the number format style table.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="<API key>.lang.Object"> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="constructor_detail"> </a> <h3>Constructor Detail</h3> <a name="XSSFDataFormat(org.apache.poi.xssf.model.StylesTable)"> </a> <ul class="blockListLast"> <li class="blockList"> <h4>XSSFDataFormat</h4> <pre>protected&nbsp;XSSFDataFormat(<a href="../../../../../org/apache/poi/xssf/model/StylesTable.html" title="class in org.apache.poi.xssf.model">StylesTable</a>&nbsp;stylesSource)</pre> </li> </ul> </li> </ul> <ul class="blockList"> <li class="blockList"><a name="method_detail"> </a> <h3>Method Detail</h3> <a name="getFormat(java.lang.String)"> </a> <ul class="blockList"> <li class="blockList"> <h4>getFormat</h4> <pre>public&nbsp;short&nbsp;getFormat(java.lang.String&nbsp;format)</pre> <div class="block">Get the format index that matches the given format string, creating a new format entry if required. Aliases text to the proper format as required.</div> <dl> <dt><strong>Specified by:</strong></dt> <dd><code><a href="../../../../../org/apache/poi/ss/usermodel/DataFormat.html#getFormat(java.lang.String)">getFormat</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/poi/ss/usermodel/DataFormat.html" title="interface in org.apache.poi.ss.usermodel">DataFormat</a></code></dd> <dt><span class="strong">Parameters:</span></dt><dd><code>format</code> - string matching a built-in format</dd> <dt><span class="strong">Returns:</span></dt><dd>index of format.</dd></dl> </li> </ul> <a name="getFormat(short)"> </a> <ul class="blockList"> <li class="blockList"> <h4>getFormat</h4> <pre>public&nbsp;java.lang.String&nbsp;getFormat(short&nbsp;index)</pre> <div class="block">get the format string that matches the given format index</div> <dl> <dt><strong>Specified by:</strong></dt> <dd><code><a href="../../../../../org/apache/poi/ss/usermodel/DataFormat.html#getFormat(short)">getFormat</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/poi/ss/usermodel/DataFormat.html" title="interface in org.apache.poi.ss.usermodel">DataFormat</a></code></dd> <dt><span class="strong">Parameters:</span></dt><dd><code>index</code> - of a format</dd> <dt><span class="strong">Returns:</span></dt><dd>string represented at index of format or <code>null</code> if there is not a format at that index</dd></dl> </li> </ul> <a name="getFormat(int)"> </a> <ul class="blockList"> <li class="blockList"> <h4>getFormat</h4> <pre>public&nbsp;java.lang.String&nbsp;getFormat(int&nbsp;index)</pre> <div class="block">get the format string that matches the given format index</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>index</code> - of a format</dd> <dt><span class="strong">Returns:</span></dt><dd>string represented at index of format or <code>null</code> if there is not a format at that index</dd></dl> </li> </ul> <a name="putFormat(short, java.lang.String)"> </a> <ul class="blockListLast"> <li class="blockList"> <h4>putFormat</h4> <pre>public&nbsp;void&nbsp;putFormat(short&nbsp;index, java.lang.String&nbsp;format)</pre> <div class="block">Add a number format with a specific ID into the number format style table. If a format with the same ID already exists, overwrite the format code with <code>fmt</code> This may be used to override built-in number formats.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>index</code> - the number format ID</dd><dd><code>format</code> - the number format code</dd></dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <div class="bottomNav"><a name="navbar_bottom"> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="<API key>"> </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 class="navBarCell1Rev">Class</li> <li><a href="class-use/XSSFDataFormat.html">Use</a></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><a href="../../../../../org/apache/poi/xssf/usermodel/<API key>.html" title="class in org.apache.poi.xssf.usermodel"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../../org/apache/poi/xssf/usermodel/XSSFDataValidation.html" title="class in org.apache.poi.xssf.usermodel"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/apache/poi/xssf/usermodel/XSSFDataFormat.html" target="_top">Frames</a></li> <li><a href="XSSFDataFormat.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_bottom"> </a></div> <p class="legalCopy"><small> <i>Copyright 2016 The Apache Software Foundation or its licensors, as applicable.</i> </small></p> </body> </html>
#!/usr/bin/python # -*- coding: utf-8 -*- # which accompanies this distribution, and is available at from flask import Blueprint from flask import current_app as app from flask import jsonify from flask import request from spectrometer.handlers.gerrit import GerritHandler from spectrometer.utils import check_parameters gerritapi = Blueprint('gerrit', __name__) @gerritapi.route('/branches') def branches(): """Returns a list of branches in a given repository by querying Gerrit. GET /gerrit/branches?param=<value> :arg str project: Project to query branches from. (required) JSON:: { "branches": [ { "ref": "refs/heads/stable/beryllium", "revision": "<SHA1-like>" }, ] } """ mapping = { 'project': request.args.get('project', None), } result = check_parameters(mapping) if not result: gerrit = GerritHandler(app.config['GERRIT_URL']) branches = gerrit.<API key>(mapping['project']) if not branches: result = {'error': 'No branches found for {0}.'.format(mapping['project'])} else: result = {'branches': branches} return jsonify(result) @gerritapi.route('/merged_changes') def merged_changes(): """Returns a list of merged changes in a given repository by querying Gerrit. GET /gerrit/changes?param=<value> :arg str project: Project to query changes from. (required) :arg str branch: Branch to pull changes from. (default: master) JSON:: { "changes": [ { "_number": 37706, "branch": "master", "change_id": "<API key>", "created": "2016-04-18 02:42:33.000000000", "deletions": 0, "hashtags": [], "id": "spectrometer~master~<API key>", "insertions": 119, "owner": { "_account_id": 2759 }, "project": "spectrometer", "status": "MERGED", "subject": "Add API to return commits since ref", "submittable": false, "topic": "git-api", "updated": "2016-04-19 09:03:03.000000000" }, ] } """ mapping = { 'project': request.args.get('project', None), 'branch': request.args.get('branch', 'master') } result = check_parameters(mapping) if not result: gerrit = GerritHandler(app.config['GERRIT_URL']) changes = gerrit.<API key>(mapping['project'], mapping['branch']) if not changes: result = {'error': 'No changes found for {0}.'.format(mapping['project'])} else: result = {'changes': changes} return jsonify(result) @gerritapi.route('/projects') def projects(): """Returns a list of projects by querying Gerrit. GET /gerrit/projects JSON:: { "projects": [ "groupbasedpolicy", "spectrometer", "releng/autorelease", "snmp4sdn", "ovsdb", "nemo", ] } """ gerrit = GerritHandler(app.config['GERRIT_URL']) return jsonify({'projects': gerrit.projects_list()}) @gerritapi.route('/tags') def tags(): """Returns a list of tags in a given repository by querying Gerrit. GET /gerrit/tags?param=<value> :arg str project: Project to query tags from. (required) JSON:: { "tags": [ { "message": "OpenDaylight Beryllium-SR1 release", "object": "<SHA1-like>", "ref": "refs/tags/release/beryllium-sr1", "revision": "<SHA1-like>", "tagger": { "date": "2016-03-23 13:34:09.000000000", "email": "thanh.ha@linuxfoundation.org", "name": "Thanh Ha", "tz": -240 } }, ] } """ mapping = { 'project': request.args.get('project', None), } result = check_parameters(mapping) if not result: gerrit = GerritHandler(app.config['GERRIT_URL']) tags = gerrit.project_tags_list(mapping['project']) if not branches: result = {'error': 'No tags found for {0}.'.format(mapping['project'])} else: result = {'tags': tags} return jsonify(result)
#!/bin/bash rm Dockerfile 2>/dev/null ln -s docker/fetch/Dockerfile Dockerfile docker build -t demas/cowl-crawler .
package org.nasdanika.cdo.web.doc; import java.io.IOException; import java.io.OutputStream; import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.regex.Pattern; import org.apache.commons.lang3.StringEscapeUtils; import org.eclipse.emf.common.util.ECollections; import org.nasdanika.core.CoreUtil; import org.nasdanika.html.Bootstrap.Style; import org.nasdanika.html.Form; import org.nasdanika.html.HTMLFactory; import org.nasdanika.html.Modal; import org.nasdanika.html.Tag; import org.nasdanika.html.TagName; import org.nasdanika.html.TextArea; import org.nasdanika.osgi.model.Element; import org.nasdanika.osgi.model.ModelFactory; import org.nasdanika.osgi.model.Runtime; import org.osgi.framework.Bundle; import org.osgi.framework.BundleException; import org.osgi.service.component.runtime.dto.<API key>; import net.sourceforge.plantuml.SourceStringReader; class <API key> { protected static final String <API key> = "component.id"; protected final DocRoute docRoute; protected final String defaultIncludes; protected final String defaultExcludes; protected <API key>(DocRoute docRoute, String defaultIncludes, String defaultExcludes) { this.docRoute = docRoute; this.defaultIncludes = defaultIncludes; this.defaultExcludes = defaultExcludes; } protected enum Direction { in, out, both } protected enum Types { hide, name, fullyQualifiedName } protected void <API key>( Collection<Object> contextObjects, Direction direction, int depth, boolean dependencies, boolean services, boolean components, boolean allBundleComponents, Types types, boolean <API key>, String width, String includes, String excludes, OutputStream out) throws IOException, BundleException { Runtime runtime = ModelFactory.eINSTANCE.createRuntime(); runtime.load(ECollections.newBasicEList(docRoute.getBundleContext().getBundles()), docRoute.<API key>()); Collection<Pattern> includePatterns = new ArrayList<>(); if (!CoreUtil.isBlank(includes)) { for (String ie: includes.split("\\R")) { if (!CoreUtil.isBlank(ie)) { includePatterns.add(Pattern.compile(ie)); } } } Collection<Pattern> excludePatterns = new ArrayList<>(); if (!CoreUtil.isBlank(excludes)) { for (String ee: excludes.split("\\R")) { if (!CoreUtil.isBlank(ee)) { excludePatterns.add(Pattern.compile(ee)); } } } Set<Element> diagramElements = new HashSet<>(); Set<Element> contextElements = new HashSet<>(); for (Object contextObject: contextObjects) { Element contextElement = null; for (org.nasdanika.osgi.model.Bundle mBundle: runtime.getBundles()) { if (contextObject instanceof Bundle) { if (((Bundle) contextObject).getBundleId() == mBundle.getId()) { contextElement = mBundle; contextElements.add(contextElement); break; } } else { for (org.nasdanika.osgi.model.Component mComponent: mBundle.getComponents()) { if (((<API key>) contextObject).id == mComponent.getId()) { contextElement = mComponent; contextElements.add(contextElement); break; } } } } Set<Element> coInDiagramElements = new HashSet<>(); Set<Element> <API key> = new HashSet<>(); <API key>(contextElement, direction, depth, dependencies, services, includePatterns, excludePatterns, coInDiagramElements, <API key>); if (contextElement instanceof org.nasdanika.osgi.model.Bundle) { for (org.nasdanika.osgi.model.Component cmp: ((org.nasdanika.osgi.model.Bundle) contextElement).getComponents()) { Set<Element> cdeIn = new HashSet<>(); Set<Element> cdeOut = new HashSet<>(); <API key>(cmp, direction, depth, dependencies, services, includePatterns, excludePatterns, cdeIn, cdeOut); coInDiagramElements.addAll(cdeIn); <API key>.addAll(cdeOut); contextElements.add(cmp); } } else { // Component contextElements.add((org.nasdanika.osgi.model.Bundle) contextElement.eContainer()); } diagramElements.addAll(coInDiagramElements); diagramElements.addAll(<API key>); } StringBuilder specBuilder = new StringBuilder("@startuml").append(System.lineSeparator()); if (<API key>) { specBuilder.append("left to right direction").append(System.lineSeparator()); } if (width != null) { specBuilder.append("scale ").append(width).append(" width").append(System.lineSeparator()); } if (diagramElements.isEmpty()) { specBuilder.append("note \"No matching elements\" as <API key>").append(System.lineSeparator()); } else { // Adding component containers for (Element de: new ArrayList<>(diagramElements)) { if (de instanceof org.nasdanika.osgi.model.Component) { diagramElements.add((Element) de.eContainer()); } } // Element definitions for (Element de: diagramElements) { if (de instanceof org.nasdanika.osgi.model.Bundle) { org.nasdanika.osgi.model.Bundle bundle = (org.nasdanika.osgi.model.Bundle) de; if (components) { List<org.nasdanika.osgi.model.Component> bundleComponents = new ArrayList<>(); for (org.nasdanika.osgi.model.Component component: bundle.getComponents()) { if (allBundleComponents || diagramElements.contains(component)) { bundleComponents.add(component); } } if (bundleComponents.isEmpty()) { specBuilder.append("component \""+bundle.getSymbolicName()+" ("+bundle.getVersion()+")\" <<Bundle>> as "+bundle.eClass().getName()+"_"+bundle.getId()); if (!contextElements.contains(bundle)) { specBuilder.append(" #DDDDDD"); } specBuilder.append(System.lineSeparator()); } else { specBuilder.append("package \""+bundle.getSymbolicName()+" "+bundle.getVersion()+"\" as "+bundle.eClass().getName()+"_"+bundle.getId()); if (!contextElements.contains(bundle)) { specBuilder.append(" #DDDDDD"); } specBuilder.append(" {"+System.lineSeparator()); for (org.nasdanika.osgi.model.Component component: bundleComponents) { String componentAlias = component.eClass().getName()+"_"+component.getId(); specBuilder.append("\tcomponent \""+component.getName()+"\" as "+componentAlias+" <<Component>>"); if (!contextElements.contains(component)) { specBuilder.append(" #DDDDDD"); } specBuilder.append(System.lineSeparator()); for (String svc: component.getServices()) { specBuilder.append("\tinterface \""); if (types == Types.name) { specBuilder.append(svc.substring(svc.lastIndexOf('.')+1)); } else { specBuilder.append(svc); } specBuilder.append("\" as "+componentAlias+"_"+svc); if (!contextElements.contains(component)) { specBuilder.append(" #DDDDDD"); } specBuilder.append(System.lineSeparator()); specBuilder.append("\t"+componentAlias+"_"+svc+" -d- ["+componentAlias+"]"); specBuilder.append(System.lineSeparator()); } } specBuilder.append("}").append(System.lineSeparator()); } } else { specBuilder.append("component \""+bundle.getSymbolicName()+"\" <<"+bundle.getVersion()+">> as "+bundle.eClass().getName()+"_"+bundle.getId()); if (!contextElements.contains(de)) { specBuilder.append(" #DDDDDD"); } specBuilder.append(System.lineSeparator()); } } } // Relationships for (Element source: diagramElements) { //System.out.println(source.eClass().getName()); // Require bundle String sourceAlias = source.eClass().getName()+"_"+source.getId(); if (dependencies && source instanceof org.nasdanika.osgi.model.Bundle && (!components || ((org.nasdanika.osgi.model.Bundle) source).getComponents().isEmpty()) ) { // references from packages are not supported - hiding. for (org.nasdanika.osgi.model.Bundle rb: ((org.nasdanika.osgi.model.Bundle) source).getRequires()) { if (diagramElements.contains(rb)) { specBuilder.append(sourceAlias+" .d.> "+rb.eClass().getName()+"_"+rb.getId()).append(System.lineSeparator()); } } } // References if (services) { if (source instanceof org.nasdanika.osgi.model.Bundle) { if (!components || ((org.nasdanika.osgi.model.Bundle) source).getComponents().isEmpty()) { // No support for references from packages - hiding. for (org.nasdanika.osgi.model.ServiceReference ref: source.<API key>()) { Element trg = ref.getReferenceTarget(); if (trg instanceof org.nasdanika.osgi.model.Component && !components) { trg = (Element) trg.eContainer(); } if (trg != source && diagramElements.contains(trg)) { specBuilder.append("["+sourceAlias+"] -d-> "); String targetAlias = trg.eClass().getName()+"_"+trg.getId(); boolean serviceMatched = false; if (trg instanceof org.nasdanika.osgi.model.Component) { for (String svc: ((org.nasdanika.osgi.model.Component) trg).getServices()) { if (svc.equals(ref.getInterfaceName())) { specBuilder.append(targetAlias+"_"+svc); serviceMatched = true; break; } } } if (!serviceMatched) { specBuilder.append("["+targetAlias+"]"); if (types != Types.hide) { for (int i=0; i < ref.getObjectClass().size(); ++i) { specBuilder.append(i == 0 ? " : " : ", "); String oc = ref.getObjectClass().get(i); specBuilder.append(types == Types.fullyQualifiedName ? oc : oc.substring(oc.lastIndexOf('.')+1)); } } } specBuilder.append(System.lineSeparator()); } } if (!components) { for (org.nasdanika.osgi.model.Component cmp: ((org.nasdanika.osgi.model.Bundle) source).getComponents()) { for (org.nasdanika.osgi.model.ServiceReference ref: cmp.<API key>()) { Element trg = ref.getReferenceTarget(); if (trg instanceof org.nasdanika.osgi.model.Component && !components) { trg = (Element) trg.eContainer(); } if (trg != source && diagramElements.contains(trg)) { String targetAlias = trg.eClass().getName()+"_"+trg.getId(); specBuilder.append("["+sourceAlias+"] -d-> ["+targetAlias+"]"); if (types != Types.hide) { for (int i=0; i < ref.getObjectClass().size(); ++i) { specBuilder.append(i == 0 ? " : " : ", "); String oc = ref.getObjectClass().get(i); specBuilder.append(types == Types.fullyQualifiedName ? oc : oc.substring(oc.lastIndexOf('.')+1)); } } specBuilder.append(System.lineSeparator()); } } } } } } else if (components) { for (org.nasdanika.osgi.model.ServiceReference ref: source.<API key>()) { Element trg = ref.getReferenceTarget(); if (diagramElements.contains(trg)) { String targetAlias = trg.eClass().getName()+"_"+trg.getId(); specBuilder.append("["+sourceAlias+"] -d-> "); boolean serviceMatched = false; if (trg instanceof org.nasdanika.osgi.model.Component) { for (String svc: ((org.nasdanika.osgi.model.Component) trg).getServices()) { if (svc.equals(ref.getInterfaceName())) { specBuilder.append(targetAlias+"_"+svc); if (ref.getName() != null) { specBuilder.append(" : ").append(ref.getName()); } serviceMatched = true; break; } } } if (!serviceMatched) { specBuilder.append("["+targetAlias+"] : "); if (types != Types.hide) { for (int i=0; i < ref.getObjectClass().size(); ++i) { if (i > 0) { specBuilder.append(", "); } String oc = ref.getObjectClass().get(i); specBuilder.append(types == Types.fullyQualifiedName ? oc : oc.substring(oc.lastIndexOf('.')+1)); } } if (ref.getName() != null) { specBuilder.append(" (").append(ref.getName()).append(")"); } } specBuilder.append(System.lineSeparator()); } } } } } } specBuilder.append("@enduml").append(System.lineSeparator()); // System.out.println(specBuilder); SourceStringReader reader = new SourceStringReader(specBuilder.toString()); reader.generateImage(out); } private void <API key>( Element candidate, Direction direction, int depth, boolean dependencies, boolean services, Collection<Pattern> includes, Collection<Pattern> excludes, Set<Element> inDiagramElements, Set<Element> outDiagramElements) { if (!excludes.isEmpty() || !includes.isEmpty()) { String symbolicName = ((org.nasdanika.osgi.model.Bundle) (candidate instanceof org.nasdanika.osgi.model.Bundle ? candidate : candidate.eContainer())).getSymbolicName(); boolean matched = includes.isEmpty(); for (Pattern includePattern: includes) { if (includePattern.matcher(symbolicName).matches()) { matched = true; break; } } if (!matched) { return; } for (Pattern excludePattern: excludes) { if (excludePattern.matcher(symbolicName).matches()) { return; } } } if (direction == Direction.in || direction == Direction.both) { if (inDiagramElements.add(candidate) && depth != 0) { if (services) { for (org.nasdanika.osgi.model.ServiceReference ir: candidate.<API key>()) { <API key>( (Element) ir.eContainer(), Direction.in, depth-1, dependencies, services, includes, excludes, inDiagramElements, null); } } if (dependencies && candidate instanceof org.nasdanika.osgi.model.Bundle) { for (org.nasdanika.osgi.model.Bundle rb: ((org.nasdanika.osgi.model.Bundle) candidate).getRequiredBy()) { <API key>( rb, Direction.in, depth-1, dependencies, services, includes, excludes, inDiagramElements, null); } } } } if (direction == Direction.out || direction == Direction.both) { if (outDiagramElements.add(candidate) && depth != 0) { if (services) { for (org.nasdanika.osgi.model.ServiceReference ir: candidate.<API key>()) { <API key>( ir.getReferenceTarget(), Direction.out, depth-1, dependencies, services, includes, excludes, null, outDiagramElements); } } if (dependencies && candidate instanceof org.nasdanika.osgi.model.Bundle) { for (org.nasdanika.osgi.model.Bundle rb: ((org.nasdanika.osgi.model.Bundle) candidate).getRequires()) { <API key>( rb, Direction.out, depth-1, dependencies, services, includes, excludes, null, outDiagramElements); } } } } } protected String valueTypeLink(Object value) { if (value == null) { return ""; } if (value.getClass().isArray()) { return docRoute.javaDocLink(value.getClass().getComponentType().getName(), true, true); } return docRoute.javaDocLink(value.getClass().getName(), true, false); } protected Object renderValue(Object value) { if (value == null) { return ""; } if (value.getClass().isArray()) { Tag ul = getHtmlFactory().tag(TagName.ul); for (int i = 0; i < Array.getLength(value); ++i) { ul.content(getHtmlFactory().tag(TagName.li, renderValue(Array.get(value, i)))); } return ul; } return StringEscapeUtils.escapeHtml4(value.toString()); } protected HTMLFactory getHtmlFactory() { return docRoute.getHtmlFactory(); } protected Modal createFilterModal() { Modal filterModal = getHtmlFactory().modal(); filterModal.title("Filter bundles"); Form filterForm = getHtmlFactory().form(); TextArea formIncludes = getHtmlFactory().textArea().rows(4).knockout().value("formIncludes"); filterForm.formGroup("Includes", formIncludes, "Include bundles regex patterns"); TextArea formExcludes = getHtmlFactory().textArea().rows(4).knockout().value("formExcludes"); filterForm.formGroup("Excludes", formExcludes, "Exclude bundles regex patterns"); filterModal.body(filterForm); filterModal.footer( getHtmlFactory().button("Filter") .style(Style.PRIMARY) .knockout().click("filter") .style().margin().right("10px"), getHtmlFactory().button("Close").attribute("data-dismiss", "modal")); return filterModal; } }
package org.mwc.debrief.core.editors.painters.highlighters; import java.awt.Color; import java.awt.Point; import MWC.GUI.CanvasType; import MWC.GUI.Editable; import MWC.GUI.ExtendedCanvasType; import MWC.GUI.Properties.BoundedInteger; import MWC.GenericData.WorldArea; import MWC.GenericData.WorldLocation; import MWC.GenericData.WorldVector; /** * @author IAN MAYO * @version */ public final class SWTRangeHighlighter implements SWTPlotHighlighter { public static final String <API key> = "Range Ring Highlight"; /** * the radius of the outer ring (yds) */ private double _radius; /** * just plot a ring around the primary track * */ private boolean _justPlotPrimary; /** * where the displayed arcs start (degs) */ private int _arcStart; /** * where the displayed arcs end (degs) */ private int _arcEnd; /** * // how many rings to plot */ private int _numRings; /** * how far apart to plot the spokes (degs) */ private int _spoke_separation; /** * // the colour of the rings */ private java.awt.Color _myColor = Color.darkGray; /** * whether just a plain rectangle should be plotted (ignoring the rings) */ private boolean _plainRectangle = false; private boolean <API key> = false; /** * whether to shade in the arcs * */ private boolean _fillArcs = false; /** * Creates new RangeHighlighter */ public SWTRangeHighlighter() { // do some initialisation _radius = 3000; _arcStart = -180; _arcEnd = 180; _numRings = 3; _spoke_separation = 45; } /** * Draw a highlight around this watchable * * @param proj * the current projection * @param watch * the current data point */ public final void highlightIt(final MWC.Algorithms.PlainProjection proj, final CanvasType dest, final MWC.GenericData.WatchableList list, final MWC.GenericData.Watchable watch, final boolean isPrimary) { boolean doPlot = true; if (isJustPlotPrimary()) doPlot = isPrimary; // are we concerend about primary track? if (doPlot) { // sort out if this is an item that we plot if (watch instanceof Editable.DoNotHighlightMe) { // hey, don't bother... return; } // sort the colors out if (<API key>()) dest.setColor(watch.getColor()); else dest.setColor(_myColor); if (_plainRectangle) { drawRectangle(watch, dest, proj, 5); } else { final WorldLocation center = watch.getLocation(); final int headingDegs = (int) MWC.Algorithms.Conversions.Rads2Degs(watch .getCourse()); drawRangeRings(center, headingDegs, dest); // and the array centre SWTPlotHighlighter.RectangleHighlight.plotArrayCentre(dest, watch, null, 5); } } } /** * the name of this object * * @return the name of this editable object */ public final String getName() { return <API key>; } /** * the name of this object * * @return the name of this editable object */ public final String toString() { return getName(); } /** * whether there is any edit information for this item this is a convenience * function to save creating the EditorType data first * * @return yes/no */ public final boolean hasEditor() { return true; } /** * get the editor for this item * * @return the BeanInfo data for this editable object */ public final Editable.EditorType getInfo() { return new RangeHighlightInfo(this); } private void drawRectangle(final MWC.GenericData.Watchable watch, final CanvasType dest, final MWC.Algorithms.PlainProjection proj, final int mySize) { // get the current area of the watchable final WorldArea wa = watch.getBounds(); // convert to screen coordinates final Point tl = proj.toScreen(wa.getTopLeft()); final int tlx = tl.x; final int tly = tl.y; final Point br = proj.toScreen(wa.getBottomRight()); // get the width final int x = tlx - mySize; final int y = tly - mySize; final int wid = (br.x - tlx) + mySize * 2; final int ht = (br.y - tly) + mySize * 2; // plot the rectangle dest.drawRect(x, y, wid, ht); } private void drawRangeRings(final WorldLocation worldCentre, final int rawAxisDegs, final CanvasType dest) { final MWC.Algorithms.PlainProjection _proj = dest.getProjection(); // sort out the centre in screen coords final Point centrePos = _proj.toScreen(worldCentre); final int centrex = centrePos.x; final int centrey = centrePos.y; // sort out the range in screen coords final WorldLocation worldEdge = worldCentre.add(new WorldVector( MWC.Algorithms.Conversions.Degs2Rads(rawAxisDegs), MWC.Algorithms.Conversions.Yds2Degs(_radius), 0)); final Point screenEdge = _proj.toScreen(worldEdge); final int dx = screenEdge.x - centrex; final int dy = screenEdge.y - centrey; final int radius = (int) Math.sqrt(dx * dx + dy * dy); // check that the axis is in the correct direction (we may be in relative // projection) final int axis = (int) MWC.Algorithms.Conversions.Rads2Degs(Math.atan2(dx, -dy)); final Point edge = new Point(0, 0); // do we do a centre stalk? if ((_arcStart < 0) && (_arcEnd > 0)) { final double axisRads = MWC.Algorithms.Conversions.Degs2Rads(axis + _arcStart); edge.setLocation((int) ((double) radius * Math.sin(axisRads)), -(int) ((double) radius * Math.cos(axisRads))); edge.translate(centrex, centrey); dest.drawLine(centrex, centrey, edge.x, edge.y); } // now the start edge stalk final double startRads = MWC.Algorithms.Conversions.Degs2Rads(axis + _arcStart); edge.setLocation((int) ((double) radius * Math.sin(startRads)), -(int) ((double) radius * Math.cos(startRads))); edge.translate(centrex, centrey); dest.drawLine(centrex, centrey, edge.x, edge.y); // now the end edge stalk /** * NOTE we only draw the end edge stalk if we are NOT drawing arcs of 180 * degrees either side (since in that case drawing it twice effectively * hides it */ final double endRads = MWC.Algorithms.Conversions.Degs2Rads(axis + _arcEnd); if ((_arcStart != -180) && (_arcEnd != 180)) { edge.setLocation((int) ((double) radius * Math.sin(endRads)), -(int) ((double) radius * Math.cos(endRads))); edge.translate(centrex, centrey); dest.drawLine(centrex, centrey, edge.x, edge.y); } // now draw the spokes, working out either side from the axis int thisSpoke = _arcStart; // on the axis double spokeRads1 = 0; final Point edge1 = new Point(); while (thisSpoke < _arcEnd) { // find the left/right angles in rads spokeRads1 = MWC.Algorithms.Conversions.Degs2Rads(axis + thisSpoke); // calculate the offset produced by this angle edge1.setLocation((int) ((double) radius * Math.sin(spokeRads1)), -(int) ((double) radius * Math.cos(spokeRads1))); // add this to the centre edge1.translate(centrex, centrey); // draw the line dest.drawLine(centrex, centrey, edge1.x, edge1.y); // move on to the next spoke thisSpoke += _spoke_separation; } // now the range rings final int ring_separation = radius / _numRings; int thisRadius = ring_separation; final Point origin = new Point(); // sort out the angles and arcs (all in degs) final int startAngle = 90 - (axis + _arcStart); final int angle = -(_arcEnd - _arcStart); for (int i = 0; i < _numRings; i++) { origin.setLocation(new Point(centrex, centrey)); // shift the centre point to the TL corner of the area origin.translate(-thisRadius, -thisRadius); if (_fillArcs) { // draw in the arc itself if (dest instanceof ExtendedCanvasType) { final ExtendedCanvasType ed = (ExtendedCanvasType) dest; ed.semiFillArc(origin.x, origin.y, thisRadius * 2, thisRadius * 2, startAngle, angle); } else dest.drawArc(origin.x, origin.y, thisRadius * 2, thisRadius * 2, startAngle, angle); } else dest.drawArc(origin.x, origin.y, thisRadius * 2, thisRadius * 2, startAngle, angle); // move on to the next radius thisRadius += ring_separation; } } // accessor methods for editing this highlighter /** * /////////////////////////////////////////////////////////// the colour of * the rings * * @param col * the colour, of course */ public final void setColor(final java.awt.Color col) { _myColor = col; } /** * get the colour of the rings * * @return the colour, of course */ public final java.awt.Color getColor() { return _myColor; } /** * /////////////////////////// set the radius of the outer ring (yds) * * @param radius * yds */ public final void setRadius(final double radius) { _radius = radius; } /** * get the radius of the outer ring (yds) * * @return radius of the outer ring (yds) */ public final double getRadius() { return _radius; } /** * /////////////////////////// whether just a plain rectangle should be * plotted (ignoring the rings) */ public final void setPlainRectangle(final boolean val) { _plainRectangle = val; } /** * whether just a plain rectangle should be plotted (ignoring the rings) */ public final boolean getPlainRectangle() { return _plainRectangle; } public boolean getFillArcs() { return _fillArcs; } public void setFillArcs(final boolean fillArcs) { _fillArcs = fillArcs; } public boolean <API key>() { return <API key>; } public void <API key>(final boolean <API key>) { <API key> = <API key>; } /** * determine if we should just plot a ring around the primary track * * @return */ public boolean isJustPlotPrimary() { return _justPlotPrimary; } /** * indicate that we should just plot a ring around the primary track * * @param justPlotPrimary */ public void setJustPlotPrimary(final boolean justPlotPrimary) { _justPlotPrimary = justPlotPrimary; } /** * the start rel brg for the arcs * * @return range of arcs in degrees */ public final Integer getArcStart() { return _arcStart; } /** * the start rel brg for the arcs * * @return range of arcs in degrees */ public final Integer getArcEnd() { return _arcEnd; } /** * the start rel brg for the arcs * * @param val * range of arcs in degrees */ public final void setArcStart(final Integer val) { _arcStart = val; } /** * get the end arc related to ownship heading - convenience method for XML * persistence * * @param val * range of arcs in degrees */ public final void setArcEnd(final Integer val) { _arcEnd = val; } /** * set the size of the spokes * * @param val * separation of arcs in degrees */ public final void setSpokeSeparation(final Integer val) { _spoke_separation = val.intValue(); } /** * get the size of the spokes * * @return val separation of arcs in degrees */ public final Integer getSpokeSeparation() { return new Integer(_spoke_separation); } /** * the number of rings between the centre and the outer spoke * * @param val * number of rings */ public final void setNumRings(final BoundedInteger val) { _numRings = val.getCurrent(); } /** * the number of rings between the centre and the outer spoke - convenience * method for XML persistence * * @param val * number of rings */ public final void setNumRings(final int val) { _numRings = val; } /** * the number of rings between the centre and the outer spoke * * @return the number of rings */ public final BoundedInteger getNumRings() { return new BoundedInteger(_numRings, 1, 10); } // nested class describing how to edit this class /** * the set of editable details for the painter */ public static final class RangeHighlightInfo extends Editable.EditorType { /** * constructor for editable * * @param data * the object we are editing */ public RangeHighlightInfo(final SWTRangeHighlighter data) { super(data, "Range Highlight", ""); } /** * the set of descriptions for this object * * @return the properties */ public final java.beans.PropertyDescriptor[] <API key>() { try { final java.beans.PropertyDescriptor[] res = { prop("Color", "Color to paint highlight", FORMAT), displayProp("<API key>", "Use current track color", "Paint hightlight using current track color", FORMAT), prop("Radius", "Radius of outer ring (yds)", SPATIAL), displayProp("ArcStart", "Arc start", "The rel angle where the arcs start (degs)", SPATIAL), displayProp("ArcEnd", "Arc end", "The rel angle where the arcs end (degs)", SPATIAL), displayProp("FillArcs", "Fill arcs", "whether to shade in the arcs", FORMAT), displayProp("SpokeSeparation", "Spoke separation", "Angle between spokes (degs)", SPATIAL), displayProp("JustPlotPrimary", "Just plot primary", "Only plot range rings around the primary track", FORMAT), displayProp("NumRings", "Number of rings", "Number of range rings to draw (including outer)", SPATIAL), // prop("PlainRectangle", "Draw simple rectangle around point"), }; return res; } catch (final Exception e) { MWC.Utilities.Errors.Trace.trace(e); return super.<API key>(); } } } // testing for this class static public final class testMe extends junit.framework.TestCase { static public final String TEST_ALL_TEST_TYPE = "UNIT"; public testMe(final String val) { super(val); } public final void testMyParams() { Editable ed = new SWTRangeHighlighter(); Editable.<API key>.testParams(ed, this); ed = null; } } }
# which accompanies this distribution, and is available at # Contributors: # Balasko, Jeno # Delic, Adam # Kovacs, Ferenc # Raduly, Csaba # Szabados, Kristof # Szabo, Bence Janos TOPDIR := .. include $(TOPDIR)/Makefile.regression .SUFFIXES: .ttcn .hh .PHONY: all clean dep run TTCN3_LIB = ttcn3$(RT2_SUFFIX)$(DYNAMIC_SUFFIX) TTCN3_MODULES = TsetofMatch.ttcn GENERATED_SOURCES = $(TTCN3_MODULES:.ttcn=.cc) GENERATED_HEADERS = $(GENERATED_SOURCES:.cc=.hh) ifdef CODE_SPLIT GENERATED_SOURCES := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), .cc _seq.cc _set.cc _seqof.cc _setof.cc _union.cc)) else ifdef SPLIT_TO_SLICES POSTFIXES := $(foreach file, $(SPLIT_TO_SLICES), $(addsuffix $(file), _part_)) POSTFIXES := $(foreach file, $(POSTFIXES), $(addprefix $(file), .cc)) GENERATED_SOURCES2 := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), $(POSTFIXES))) GENERATED_SOURCES += $(GENERATED_SOURCES2) endif OBJECTS = $(GENERATED_SOURCES:.cc=.o) TARGET = TsetofMatch$(EXESUFFIX) all: $(TARGET) $(TARGET): $(GENERATED_SOURCES) $(USER_SOURCES) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) -L$(OPENSSL_DIR)/lib -lcrypto $($(PLATFORM)_LIBS) .ttcn.cc .ttcn.hh: $(TTCN3_COMPILER) $< clean distclean: -rm -f $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \ $(GENERATED_SOURCES) *.log Makefile.bak dep: $(GENERATED_SOURCES) makedepend $(CPPFLAGS) $(GENERATED_SOURCES) run: $(TARGET) config.cfg ./$^ .NOTPARALLEL:
using Microsoft.Practices.Prism.MefExtensions.Modularity; using Microsoft.Practices.Prism.Modularity; namespace AirManager.Infrastructure { [ModuleExport(typeof (<API key>))] public class <API key> : IModule { public void Initialize() { } } }
% This file was created by matplotlib2tikz v0.5.4. \begin{tikzpicture} \definecolor{color1}{rgb}{0.105882352941176,0.619607843137255,0.466666666666667} \definecolor{color0}{rgb}{0.917647058823529,0.917647058823529,0.949019607843137} \definecolor{color3}{rgb}{0.589542483660131,0.416993464052288,0.470588235294118} \definecolor{color2}{rgb}{0.719492502883506,0.416147635524798,0.0888119953863898} \definecolor{color5}{rgb}{0.488581314878893,0.654440599769319,0.0982698961937716} \definecolor{color4}{rgb}{0.686735870818916,0.297270280661284,0.61999231064975} \begin{groupplot}[group style={group size=2 by 1}] \nextgroupplot[ xlabel={Simulated Time (mins)}, ylabel={Weighted Trust Value}, xmin=0, xmax=60, ymin=0, ymax=1, ytick={0,0.2,0.4,0.6,0.8,1}, yticklabels={$0.0$,$0.2$,$0.4$,$0.6$,$0.8$,$1.0$}, tick align=outside, xmajorgrids, x grid style={white!50.196078431372548!black}, ymajorgrids, y grid style={white!50.196078431372548!black}, axis line style={white!50.196078431372548!black}, axis background/.style={fill=color0}, legend style={draw=none, fill=color0}, legend cell align={left}, legend entries={{Alfa},{Bravo},{Charlie},{Delta},{Foxtrot}} ] \addplot [color1, opacity=1.0] table {% 0 0.00233709983953188 1 0.00625028653583328 2 0.0122189667375896 3 0.0128508529937832 4 0.013646329109147 5 0.0113264358541522 6 0.00985895380459461 7 0.0124668762039074 8 0.0145955271159749 9 0.147586643855161 10 0.105117241377318 11 0.0752150160526922 12 0.142799062972098 13 0.121341543474045 14 0.184364043197766 15 0.132161564567256 16 0.0972561990122653 17 0.0700646977811044 18 0.0510908879728822 19 0.0450127323372612 20 0.146890027067363 21 0.108046395998163 22 0.187946691732989 23 0.147928839740498 24 0.211249484207671 25 0.153294614701952 26 0.110739355831498 27 0.0800109671267382 28 0.0633689560165773 29 0.0456762337470711 30 0.0604439294061093 31 0.0787464753520847 32 0.0585115472874505 33 0.0457661934016633 34 0.0366283876779537 35 0.0301014179753172 36 0.0511523926632163 37 0.0411815499349903 38 0.0297942297331425 39 0.0216103757688841 40 0.0475994219623195 41 0.034856189278648 42 0.0259736971057332 43 0.102377191598553 44 0.078042061909081 45 0.058140373098218 46 0.0422139496246517 47 0.0324329880592317 48 0.0274325200427184 49 0.0200645980785756 50 0.017842751851439 51 0.0135143866441337 52 0.00994523844875104 53 0.00810226336135272 54 0.00780284948062936 55 0.00688851890936534 56 0.0276186628003294 57 0.0202478828816965 58 0.0192660790860513 }; \addplot [color2, opacity=0.6] table {% 0 0.911912608401678 1 0.505306435395288 2 0.521811422031717 3 0.696904849036567 4 0.781647148821668 5 0.809414747207627 6 0.869034220952663 7 0.875884937075931 8 0.907463267002588 9 0.667688671096062 10 0.679228952713283 11 0.740211891524917 12 0.796423860655223 13 0.703829286247698 14 0.764385453470655 15 0.717559192525119 16 0.722643850778421 17 0.786090531500961 18 0.662921240318486 19 0.721656896922683 20 0.733162626914155 21 0.630817351927893 22 0.601749923808973 23 0.625076050986904 24 0.677155950838632 25 0.69781452301945 26 0.724138461573162 27 0.796879898969541 28 0.849825642289696 29 0.873764580825523 30 0.72676515483246 31 0.635107090288493 32 0.710797030316519 33 0.629170972788506 34 0.686846943149651 35 0.634451402192085 36 0.724872229606895 37 0.757408422027773 38 0.705561040938534 39 0.674645127190295 40 0.631185764582414 41 0.703463824551887 42 0.785443763082979 43 0.57056933086935 44 0.516550405378702 45 0.530542737176248 46 0.634461684541195 47 0.673040782457444 48 0.759867950079905 49 0.608010245418135 50 0.52880742136624 51 0.650791826850092 52 0.67771152269835 53 0.769360254810879 54 0.82619903074361 55 0.847113115479288 56 0.879896498126318 57 0.893687175882952 58 0.88445180840675 }; \addplot [color3, opacity=0.6] table {% 0 0.874789318858901 1 0.6968534742206 2 0.423009745583242 3 0.525561199788266 4 0.515853817120665 5 0.660160414826868 6 0.669226846794558 7 0.500271881307492 8 0.59879050731627 9 0.615585340771814 10 0.727203192475288 11 0.805638952917926 12 0.841388146749262 13 0.809575812368859 14 0.84050284376729 15 0.884703732249854 16 0.910055927331168 17 0.928366211321709 18 0.726779136304577 19 0.599165136176045 20 0.544610659632612 21 0.66663530285096 22 0.737859121497327 23 0.780867382726645 24 0.744900787800449 25 0.631368185482445 26 0.722385452115346 27 0.796041324441406 28 0.589924895678582 29 0.536473238396337 30 0.421728839258963 31 0.34385689059814 32 0.525713755808104 33 0.652749207720065 34 0.734349374572695 35 0.807299194604371 36 0.861122524199692 37 0.779701900397131 38 0.658578597116477 39 0.718426275970112 40 0.726802970662533 41 0.585553109633742 42 0.617056480695646 43 0.608350335283595 44 0.701273223844584 45 0.638686058991339 46 0.729854763239199 47 0.717511403608368 48 0.668886849948675 49 0.755437042390316 50 0.74739021795631 51 0.774775837166407 52 0.804001191716961 53 0.739030102565536 54 0.722397683142851 55 0.772942920028199 56 0.78350838525722 57 0.772728842230382 58 0.836368821390186 }; \addplot [color4, opacity=0.6] table {% 0 0.924097235076917 1 0.96143602497023 2 0.956131484785198 3 0.966749992245621 4 0.672535192883737 5 0.624779391563116 6 0.606432421913689 7 0.542385454260281 8 0.670587406263865 9 0.598882040638122 10 0.469344920080031 11 0.551427464764766 12 0.643890608746111 13 0.713875446956893 14 0.782268528364024 15 0.708013420459675 16 0.647979034080627 17 0.642626268578141 18 0.743825960224631 19 0.81652309019371 20 0.852818620005314 21 0.870925939874496 22 0.626390795148898 23 0.473374417557603 24 0.51575477448874 25 0.514346009612254 26 0.52344951262319 27 0.595138062695778 28 0.697674723116617 29 0.782840456742148 30 0.840949435831938 31 0.880843540633963 32 0.802807969635664 33 0.76342952971032 34 0.797223677486196 35 0.842191920361677 36 0.812481291921645 37 0.596610736979881 38 0.516122382497872 39 0.617992346747214 40 0.592914553433267 41 0.68440924006966 42 0.734653976147649 43 0.706754751743373 44 0.764366421746727 45 0.815954889666691 46 0.846363286215618 47 0.889458955459087 48 0.856491040099098 49 0.618158883322563 50 0.515963225657903 51 0.564584438432511 52 0.659254155800624 53 0.684153327535357 54 0.734579428455588 55 0.733737508238268 56 0.631792145580246 57 0.669315969208429 58 0.622477018191335 }; \addplot [color5, opacity=0.6] table {% 0 0.361366373489361 1 0.253579540857333 2 0.367982407808265 3 0.521831618607948 4 0.670276618966558 5 0.754733170567422 6 0.815708920991686 7 0.863118183409667 8 0.769491467196433 9 0.829985043108111 10 0.720027374387617 11 0.78136882632861 12 0.556942599147795 13 0.531514660115684 14 0.438153925354054 15 0.380684851959034 16 0.4996862543906 17 0.638115089207927 18 0.673292436954173 19 0.531126922584999 20 0.616018707372044 21 0.69314576623898 22 0.724659602854958 23 0.751923129128283 24 0.563871468100927 25 0.553836202716257 26 0.583024577398163 27 0.673103972856838 28 0.709296027831673 29 0.671047681590621 30 0.516511194029298 31 0.602193051558551 32 0.611824269307272 33 0.708196752626862 34 0.734555564509081 35 0.55312666992498 36 0.396166286939952 37 0.409195280799894 38 0.528091975923469 39 0.644960516032139 40 0.65734969046759 41 0.739659066827017 42 0.776453581510125 43 0.74731215723581 44 0.791553054374917 45 0.687530805438211 46 0.687754165032408 47 0.52550914032112 48 0.656077213420311 49 0.736400374080034 50 0.806513394338856 51 0.740882731573986 52 0.648877009800123 53 0.680572633561993 54 0.754940068193518 55 0.821484423563978 56 0.708264587999582 57 0.790831481241456 58 0.796476673157634 }; \path [draw=white, fill opacity=0] (axis cs:0,1) --(axis cs:60,1); \path [draw=white, fill opacity=0] (axis cs:1,0) --(axis cs:1,1); \path [draw=white!50.196078431372548!black, fill opacity=0] (axis cs:0,0) --(axis cs:60,0); \path [draw=white!50.196078431372548!black, fill opacity=0] (axis cs:0,0) --(axis cs:0,1); \nextgroupplot[ xmin=0.5, xmax=5.5, ymin=0, ymax=1, xtick={1,2,3,4,5}, xticklabels={Alfa,Bravo,Charlie,Delta,Foxtrot}, ytick={0,0.2,0.4,0.6,0.8,1}, yticklabels={$0.0$,$0.2$,$0.4$,$0.6$,$0.8$,$1.0$}, tick align=outside, xmajorgrids, x grid style={white!50.196078431372548!black}, ymajorgrids, y grid style={white!50.196078431372548!black}, axis line style={white!50.196078431372548!black}, axis background/.style={fill=color0}, legend style={draw=none, fill=color0}, legend cell align={left}, legend entries={{Alfa},{Bravo},{Charlie},{Delta},{Foxtrot}} ] \addplot [color1, opacity=1] table {% 0.75 0.0185544154687451 1.25 0.0185544154687451 1.25 0.0886335830695018 0.75 0.0886335830695018 0.75 0.0185544154687451 }; \addplot [blue, opacity=1, dashed] table {% 1 0.0185544154687451 1 0.00233709983953188 }; \addplot [blue, opacity=1, dashed] table {% 1 0.0886335830695018 1 0.187946691732989 }; \addplot [black] table {% 0.875 0.00233709983953188 1.125 0.00233709983953188 }; \addplot [black] table {% 0.875 0.187946691732989 1.125 0.187946691732989 }; \addplot [red, opacity=1] table {% 0.75 0.0450127323372612 1.25 0.0450127323372612 }; \addplot [blue, opacity=0.8] table {% 0.75 0.0606272991591046 1.25 0.0606272991591046 }; \addplot [blue, mark=+, mark size=3, mark options={draw=black}, only marks] table {% 1 0.211249484207671 }; \addplot [color2, opacity=1] table {% 1.75 0.642949458569293 2.25 0.642949458569293 2.25 0.78576714729197 1.75 0.78576714729197 1.75 0.642949458569293 }; \addplot [blue, opacity=1, dashed] table {% 2 0.642949458569293 2 0.505306435395288 }; \addplot [blue, opacity=1, dashed] table {% 2 0.78576714729197 2 0.911912608401678 }; \addplot [black] table {% 1.875 0.505306435395288 2.125 0.505306435395288 }; \addplot [black] table {% 1.875 0.911912608401678 2.125 0.911912608401678 }; \addplot [red, opacity=1] table {% 1.75 0.710797030316519 2.25 0.710797030316519 }; \addplot [blue, opacity=0.8] table {% 1.75 0.717104831028256 2.25 0.717104831028256 }; \addplot [blue, mark=+, mark size=3, mark options={draw=black}, only marks] table {% }; \addplot [color3, opacity=1] table {% 2.75 0.61632091073373 3.25 0.61632091073373 3.25 0.780284641561888 2.75 0.780284641561888 2.75 0.61632091073373 }; \addplot [blue, opacity=1, dashed] table {% 3 0.61632091073373 3 0.421728839258963 }; \addplot [blue, opacity=1, dashed] table {% 3 0.780284641561888 3 0.928366211321709 }; \addplot [black] table {% 2.875 0.421728839258963 3.125 0.421728839258963 }; \addplot [black] table {% 2.875 0.928366211321709 3.125 0.928366211321709 }; \addplot [red, opacity=1] table {% 2.75 0.722397683142851 3.25 0.722397683142851 }; \addplot [blue, opacity=0.8] table {% 2.75 0.696790352353738 3.25 0.696790352353738 }; \addplot [blue, mark=+, mark size=3, mark options={draw=black}, only marks] table {% 3 0.34385689059814 }; \addplot [color4, opacity=1] table {% 3.75 0.612212384330451 4.25 0.612212384330451 4.25 0.807644630778655 3.75 0.807644630778655 3.75 0.612212384330451 }; \addplot [blue, opacity=1, dashed] table {% 4 0.612212384330451 4 0.469344920080031 }; \addplot [blue, opacity=1, dashed] table {% 4 0.807644630778655 4 0.966749992245621 }; \addplot [black] table {% 3.875 0.469344920080031 4.125 0.469344920080031 }; \addplot [black] table {% 3.875 0.966749992245621 4.125 0.966749992245621 }; \addplot [red, opacity=1] table {% 3.75 0.68440924006966 4.25 0.68440924006966 }; \addplot [blue, opacity=0.8] table {% 3.75 0.703263402469912 4.25 0.703263402469912 }; \addplot [blue, mark=+, mark size=3, mark options={draw=black}, only marks] table {% }; \addplot [color5, opacity=1] table {% 4.75 0.553481436320618 5.25 0.553481436320618 5.25 0.744097444404898 4.75 0.744097444404898 4.75 0.553481436320618 }; \addplot [blue, opacity=1, dashed] table {% 5 0.553481436320618 5 0.361366373489361 }; \addplot [blue, opacity=1, dashed] table {% 5 0.744097444404898 5 0.863118183409667 }; \addplot [black] table {% 4.875 0.361366373489361 5.125 0.361366373489361 }; \addplot [black] table {% 4.875 0.863118183409667 5.125 0.863118183409667 }; \addplot [red, opacity=1] table {% 4.75 0.673103972856838 5.25 0.673103972856838 }; \addplot [blue, opacity=0.8] table {% 4.75 0.643358936191732 5.25 0.643358936191732 }; \addplot [blue, mark=+, mark size=3, mark options={draw=black}, only marks] table {% 5 0.253579540857333 }; \path [draw=white, fill opacity=0] (axis cs:0.5,1) --(axis cs:5.5,1); \path [draw=white, fill opacity=0] (axis cs:1,0) --(axis cs:1,1); \path [draw=white!50.196078431372548!black, fill opacity=0] (axis cs:0.5,0) --(axis cs:5.5,0); \path [draw=white!50.196078431372548!black, fill opacity=0] (axis cs:0,0) --(axis cs:0,1); \end{groupplot} \end{tikzpicture}
package model.dailybudget; import java.io.Serializable; public class DailyBudget implements Serializable{ private DailyBudgetId dailyBudgetId; private DailyBudgetDate dailyBudgetDate; private Budget budget; public DailyBudget(DailyBudgetId dailyBudgetId, DailyBudgetDate dailyBudgetDate, Budget budge){ this.dailyBudgetId = dailyBudgetId; this.dailyBudgetDate = dailyBudgetDate; this.budget = budge; } public DailyBudget(){ dailyBudgetId = new DailyBudgetId(); dailyBudgetDate = new DailyBudgetDate(); budget = new Budget(); } public DailyBudgetId dailyBudgetId(){ return dailyBudgetId; } public Budget budget(){ return budget; } @Deprecated public DailyBudgetId getDailyBudgetId(){ return dailyBudgetId; } @Deprecated public DailyBudgetDate getDailyBudgetDate(){ return dailyBudgetDate; } @Deprecated public Budget getBudget(){ return budget; } @Override public String toString() { return String.format("DailyBudget [dailyBudgetId=%s, dailyBudgetDate=%s, budget=%s]", dailyBudgetId, dailyBudgetDate, budget); } private static final long serialVersionUID = -<API key>; }
#include <unistd.h> #include <string.h> #include <stdlib.h> #include <dlfcn.h> #include "cimslpCMPI.h" #include "cimslpSLP.h" #include "cimslpUtil.h" #include "trace.h" #include "config.h" #include "control.h" char *interOpNS; typedef int (*getSlpHostname) (char **hostname); extern void libraryName(const char *dir, const char *location, const char *fullName, int buf_size); extern char *configfile; CMPIContext *prepareUpcall(const CMPIContext *ctx); extern int <API key>(char **hn) // helper function ... until better solution is found to get to the // interop Namespace char ** getInterOpNS() { char **retArr; interOpNS = "root/interop"; retArr = malloc(2 * sizeof(char *)); retArr[0] = (char *) malloc((strlen(interOpNS) + 1) * sizeof(char)); strcpy(retArr[0], interOpNS); retArr[1] = NULL; return retArr; } /* this is pulled from SFCC; TODO: combine this with SFCC's (and value.c's as well) */ char * value2Chars (CMPIType type, CMPIValue *value) { char str[2048], *p; CMPIString *cStr; str[0]=0; if (type & CMPI_ARRAY) { } else if (type & CMPI_ENC) { switch (type) { case CMPI_instance: break; case CMPI_ref: if (value->ref) { cStr=value->ref->ft->toString(value->ref,NULL); p = strdup((char *) cStr->hdl); CMRelease(cStr); } else { p = strdup("NULL"); } return p; case CMPI_args: break; case CMPI_filter: break; case CMPI_string: case CMPI_numericString: case CMPI_booleanString: case CMPI_dateTimeString: case <API key>: return strdup((value->string && value->string->hdl) ? (char*)value->string->hdl : "NULL"); case CMPI_dateTime: if (value->dateTime) { cStr=CMGetStringFormat(value->dateTime,NULL); p = strdup((char *) cStr->hdl); CMRelease(cStr); } else p = strdup("NULL"); return p; } } else if (type & CMPI_SIMPLE) { switch (type) { case CMPI_boolean: return strdup(value->boolean ? "true" : "false"); case CMPI_char16: break; } } else if (type & CMPI_INTEGER) { switch (type) { case CMPI_uint8: sprintf(str, "%u", value->uint8); return strdup(str); case CMPI_sint8: sprintf(str, "%d", value->sint8); return strdup(str); case CMPI_uint16: sprintf(str, "%u", value->uint16); return strdup(str); case CMPI_sint16: sprintf(str, "%d", value->sint16); return strdup(str); case CMPI_uint32: sprintf(str, "%u", value->uint32); return strdup(str); case CMPI_sint32: sprintf(str, "%d", value->sint32); return strdup(str); case CMPI_uint64: sprintf(str, "%llu", value->uint64); return strdup(str); case CMPI_sint64: sprintf(str, "%lld", value->sint64); return strdup(str); } } else if (type & CMPI_REAL) { switch (type) { case CMPI_real32: sprintf(str, "%g", value->real32); return strdup(str); case CMPI_real64: sprintf(str, "%g", value->real64); return strdup(str); } } return strdup(str); } CMPIInstance ** myGetInstances(const CMPIBroker *_broker, const CMPIContext * ctx, const char *path, const char *objectname, const char *urlsyntax) { CMPIStatus status; CMPIObjectPath *objectpath; CMPIEnumeration *enumeration; CMPIInstance **retArr = NULL; _SFCB_ENTER(TRACE_SLP, "myGetInstances"); objectpath = CMNewObjectPath(_broker, path, objectname, NULL); enumeration = CBEnumInstances(_broker, ctx, objectpath, NULL, &status); if (status.rc != CMPI_RC_OK) { retArr = NULL; } if (!status.rc) { if (CMHasNext(enumeration, NULL)) { CMPIArray *arr; int n, i; arr = CMToArray(enumeration, NULL); n = CMGetArrayCount(arr, NULL); retArr = malloc(sizeof(CMPIInstance *) * (n + 1)); for (i = 0; i < n; i++) { CMPIData ele = CMGetArrayElementAt(arr, i, NULL); retArr[i] = CMClone(ele.value.inst, NULL); } retArr[n] = NULL; } } if (status.msg) CMRelease(status.msg); if (objectpath) CMRelease(objectpath); if (enumeration) CMRelease(enumeration); _SFCB_RETURN(retArr); } /* CMPIConstClass * myGetClass(CMPIContext * ctx, char *path, char *objectname) { CMPIStatus status; CMPIObjectPath *objectpath; CMPIConstClass *ccls; _SFCB_ENTER(TRACE_SLP, "myGetClass"); objectpath = newCMPIObjectPath(path, objectname, &status); ccls = cc->ft->getClass(cc, objectpath, <API key>, NULL, &status); if (objectpath) CMRelease(objectpath); if (!status.rc) { _SFCB_RETURN(ccls); } else { // printf("Could not get class... ?\n"); // printf("Status: %d\n", status.rc); _SFCB_RETURN(NULL); } } */ cimSLPService getSLPData(cimomConfig cfg, const CMPIBroker *_broker, const CMPIContext *ctx, const char *urlsyntax) { CMPIInstance **ci; //CMPIStatus status; //CMPIConstClass *ccls; cimSLPService rs; // service which is going to be returned // to the calling function char *sn; _SFCB_ENTER(TRACE_SLP, "getSLPData"); memset(&rs, 0, sizeof(cimSLPService)); // first of all, get the interop namespace, needed for all further // connections // this call fills the array as well as sets the global interOpNS // variable rs.<API key> = getInterOpNS(); // extract all relavant stuff for SLP out of CIM_ObjectManager // construct the server string ci = myGetInstances(_broker, ctx, interOpNS, "CIM_ObjectManager", urlsyntax); if (ci) { sn = myGetProperty(ci[0], "SystemName"); #ifdef SLP_HOSTNAME_LIB <API key>(&sn); #endif rs.url_syntax = getUrlSyntax(sn, cfg.commScheme, cfg.port); rs.service_hi_name = myGetProperty(ci[0], "ElementName"); rs.<API key> = myGetProperty(ci[0], "Description"); rs.service_id = myGetProperty(ci[0], "Name"); freeInstArr(ci); } // extract all relavant stuff for SLP out of // <API key> ci = myGetInstances(_broker, ctx, interOpNS, "<API key>", urlsyntax); if (ci) { rs.<API key> = myGetProperty(ci[0], "<API key>"); rs.<API key> = myGetProperty(ci[0], "<API key>"); rs.ProtocolVersion = myGetProperty(ci[0], "Version"); rs.<API key> = myGetPropertyArray(ci[0], "<API key>"); rs.<API key> = myGetPropertyArray(ci[0], "<API key>"); rs.<API key> = myGetProperty(ci[0], "<API key>"); rs.<API key> = myGetPropertyArray(ci[0], "<API key>); rs.<API key> = myGetPropertyArray(ci[0], "<API key>); // do the transformations from numbers to text via the qualifiers //CMPIStatus myRc; //CMPIObjectPath *myOp = CMGetObjectPath(ci[0], &myRc); //CMPIData qd = <API key>(myOp, "<API key>", "ValueMap", &myRc); rs.<API key> = transformValue(rs.<API key>, CMGetObjectPath(ci[0], NULL), "<API key>"); rs.<API key> = transformValueArray(rs.<API key>, CMGetObjectPath(ci[0], NULL), "<API key>"); rs.<API key> = transformValueArray(rs.<API key>, CMGetObjectPath(ci[0], NULL), "<API key>); freeInstArr(ci); } // extract all relavant stuff for SLP out of CIM_Namespace ci = myGetInstances(_broker, ctx, interOpNS, "CIM_Namespace", urlsyntax); if (ci) { rs.Namespace = <API key>(ci, "Name"); rs.Classinfo = <API key>(ci, "ClassInfo"); freeInstArr(ci); } // extract all relavant stuff for SLP out of <API key> //CMPIContext *ctxLocal = prepareUpcall(ctx); //ci = myGetInstances(_broker, ctxLocal, interOpNS, "<API key>", urlsyntax); ci = myGetInstances(_broker, ctx, interOpNS, "<API key>", urlsyntax); if (ci) { rs.<API key> = myGetRegProfiles(_broker, ci, ctx); //rs.<API key> = myGetRegProfiles(_broker, ci, ctxLocal); freeInstArr(ci); } //CMRelease(ctxLocal); _SFCB_RETURN(rs); } char ** myGetRegProfiles(const CMPIBroker *_broker, CMPIInstance **instances, const CMPIContext * ctx) { CMPIObjectPath *objectpath; CMPIEnumeration *enumeration = NULL; CMPIStatus status; char **retArr; int i, j = 0; _SFCB_ENTER(TRACE_SLP, "myGetRegProfiles"); // count instances for (i = 0; instances != NULL && instances[i] != NULL; i++) { } if (i == 0) { _SFCB_RETURN(NULL);; } // allocating memory for the return array // a little too much memory will be allocated, since not each instance // is a RegisteredProfile, for which a // string needs to be constructed ... but allocating dynamically would // involve too much burden and overhead (?) retArr = (char **) malloc((i + 1) * sizeof(char *)); for (i = 0; instances[i] != NULL; i++) { // check to see if this profile wants to be advertised CMPIArray *atArray; atArray = CMGetProperty(instances[i], "AdvertiseTypes", &status).value.array; if (status.rc == <API key> || atArray == NULL || CMGetArrayElementAt(atArray, 0, &status).value.uint16 != 3) { _SFCB_TRACE(1, ("--- profile does not want to be advertised; skipping")); continue; } objectpath = instances[i]->ft->getObjectPath(instances[i], &status); if (status.rc) { // no object path ?? free(retArr); _SFCB_RETURN(NULL); } objectpath->ft->setNameSpace(objectpath, interOpNS); if (enumeration) CMRelease(enumeration); enumeration = CBAssociatorNames(_broker, ctx, objectpath, "<API key>", NULL, "Dependent", NULL, NULL); // if the result is not null, we are operating on a // <API key>, which we don't want if (!enumeration || !CMHasNext(enumeration, &status)) { CMPIData propertyData; propertyData = instances[i]->ft->getProperty(instances[i], "<API key>", &status); char *profilestring; profilestring = value2Chars(propertyData.type, &propertyData.value); profilestring = transformValue(profilestring, CMGetObjectPath(instances[i], NULL), "<API key>"); propertyData = instances[i]->ft->getProperty(instances[i], "RegisteredName", &status); char *tempString = value2Chars(propertyData.type, &propertyData.value); profilestring = realloc(profilestring, strlen(profilestring) + strlen(tempString) + 2); profilestring = strcat(profilestring, ":"); profilestring = strcat(profilestring, tempString); free(tempString); // now search for a <API key> for this instance if (enumeration) CMRelease(enumeration); enumeration = CBAssociators(_broker, ctx, objectpath, "<API key>", NULL, "Antecedent", NULL, NULL, NULL); if (!enumeration || !CMHasNext(enumeration, NULL)) { retArr[j] = strdup(profilestring); j++; } else while (CMHasNext(enumeration, &status)) { CMPIData data = CMGetNext(enumeration, NULL); propertyData = CMGetProperty(data.value.inst, "RegisteredName", &status); char *subprofilestring = value2Chars(propertyData.type, &propertyData. value); retArr[j] = (char *) malloc(strlen(profilestring) + strlen(subprofilestring) + 2); sprintf(retArr[j], "%s:%s", profilestring, subprofilestring); j++; free(subprofilestring); } free(profilestring); } if (objectpath) CMRelease(objectpath); } retArr[j] = NULL; if (enumeration) CMRelease(enumeration); if (status.msg) CMRelease(status.msg); _SFCB_RETURN(retArr); } char ** transformValueArray(char **cssf, CMPIObjectPath * op, char *propertyName) { int i; for (i = 0; cssf[i] != NULL; i++) { cssf[i] = transformValue(cssf[i], op, propertyName); } return cssf; } // transforms numerical values into their string counterpart // utilizing the Values and ValueMap qualifiers char * transformValue(char *cssf, CMPIObjectPath * op, char *propertyName) // cssf = cimSLPService Field in the struct { CMPIData qd; CMPIStatus status; char *valuestr; _SFCB_ENTER(TRACE_SLP, "transformValue"); qd = <API key>(op, propertyName, "ValueMap", &status); if (status.rc) { printf("<API key> failed ... Status: %d\n", status.rc); _SFCB_RETURN(NULL); } if (CMIsArray(qd)) { CMPIArray *arr = qd.value.array; CMPIType eletyp = qd.type & ~CMPI_ARRAY; int j = 0; int n; n = CMGetArrayCount(arr, NULL); CMPIData ele; ele = CMGetArrayElementAt(arr, j, NULL); valuestr = value2Chars(eletyp, &ele.value); j++; while (strcmp(valuestr, cssf)) { free(valuestr); ele = CMGetArrayElementAt(arr, j, NULL); valuestr = value2Chars(eletyp, &ele.value); if (j == n) { free(valuestr); _SFCB_RETURN(cssf); // nothing found, probably "NULL" -> // return it } j++; } free(valuestr); free(cssf); if (j - 1 <= n) { qd = <API key>(op, propertyName, "Values", &status); arr = qd.value.array; eletyp = qd.type & ~CMPI_ARRAY; ele = CMGetArrayElementAt(arr, j - 1, NULL); cssf = value2Chars(eletyp, &ele.value); _SFCB_RETURN(cssf); } else { // printf("No Valuemap Entry for %s in %s. Exiting ...\n", cssf, // propertyName); _SFCB_RETURN(NULL); } } else { // printf("No qualifier found for %s. Exiting ...\n", propertyName); _SFCB_RETURN(NULL); } } char * myGetProperty(CMPIInstance *instance, char *propertyName) { CMPIData propertyData; CMPIStatus status; if (!instance) return NULL; propertyData = instance->ft->getProperty(instance, propertyName, &status); if (!status.rc) { return value2Chars(propertyData.type, &propertyData.value); } else { return NULL; } } char ** <API key>(CMPIInstance **instances, char *propertyName) { int i; char **propertyArray; // count elements for (i = 0; instances != NULL && instances[i] != NULL; i++) { } if (i == 0) { return NULL; } propertyArray = malloc((i + 1) * sizeof(char *)); for (i = 0; instances[i] != NULL; i++) { propertyArray[i] = myGetProperty(instances[i], propertyName); } propertyArray[i] = NULL; return propertyArray; } char ** myGetPropertyArray(CMPIInstance *instance, char *propertyName) { CMPIData propertyData; CMPIStatus status; char **propertyArray = NULL; propertyData = instance->ft->getProperty(instance, propertyName, &status); if (!status.rc && propertyData.state != CMPI_nullValue) { if (CMIsArray(propertyData)) { CMPIArray *arr = propertyData.value.array; CMPIType eletyp = propertyData.type & ~CMPI_ARRAY; int n, i; n = CMGetArrayCount(arr, NULL); propertyArray = malloc(sizeof(char *) * (n + 1)); for (i = 0; i < n; i++) { CMPIData ele = CMGetArrayElementAt(arr, i, NULL); propertyArray[i] = value2Chars(eletyp, &ele.value); } propertyArray[n] = NULL; } } return propertyArray; } char * getUrlSyntax(char *sn, char *cs, char *port) { char *url_syntax; // colon, double slash, colon, \0, service:wbem = 18 url_syntax = (char *) malloc((strlen(sn) + strlen(cs) + strlen(port) + 18) * sizeof(char)); sprintf(url_syntax, "%s://%s:%s", cs, sn, port); free(sn); return url_syntax; } /* MODELINES */ /* DO NOT EDIT BELOW THIS COMMENT */ /* Modelines are added by 'make pretty' */ /* -*- Mode: C; c-basic-offset: 2; indent-tabs-mode: nil; -*- */ /* vi:set ts=2 sts=2 sw=2 expandtab: */
package org.example.xbase.expressions.expressions.impl; import org.eclipse.emf.ecore.EClass; import org.eclipse.xtext.xbase.impl.<API key>; import org.example.xbase.expressions.expressions.ExpressionsModel; import org.example.xbase.expressions.expressions.ExpressionsPackage; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Model</b></em>'. * <!-- end-user-doc --> * <p> * </p> * * @generated */ public class <API key> extends <API key> implements ExpressionsModel { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected <API key>() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return ExpressionsPackage.Literals.EXPRESSIONS_MODEL; } } //<API key>
package fi.uef.envi.wavellite.entity.situation.base; import java.util.UUID; import fi.uef.envi.wavellite.entity.core.EntityVisitor; import fi.uef.envi.wavellite.entity.situation.<API key>; import fi.uef.envi.wavellite.entity.situation.ValueVisitor; import fi.uef.envi.wavellite.vocabulary.STO; public class ValueInteger extends AbstractValue { private static final long serialVersionUID = -<API key>; public ValueInteger() { this(UUID.randomUUID().toString()); } public ValueInteger(Integer value) { this(UUID.randomUUID().toString(), value); } public ValueInteger(String id) { this(id, STO.Value); } public ValueInteger(String id, Integer value) { this(id, STO.Value, value); } public ValueInteger(String id, String type) { super(id, type); } public ValueInteger(String id, String type, Integer value) { super(id, type, value); } @Override public void accept(EntityVisitor visitor) { visitor.visit(this); } @Override public void accept(<API key> visitor) { visitor.visit(this); } @Override public void accept(ValueVisitor visitor) { visitor.visit(this); } @Override public Integer getValue() { return (Integer) value; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((type == null) ? 0 : type.hashCode()); result = prime * result + ((value == null) ? 0 : value.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ValueInteger other = (ValueInteger) obj; if (type == null) { if (other.type != null) return false; } else if (!type.equals(other.type)) return false; if (value == null) { if (other.value != null) return false; } else if (!value.equals(other.value)) return false; return true; } @Override public String toString() { return "ValueInteger [id = " + id + "; type = " + type + "; value = " + value + "]"; } }
package at.medevit.elexis.kassen.core.ui; import java.text.ParseException; import java.util.ArrayList; import org.eclipse.jface.action.Action; import org.eclipse.jface.action.MenuManager; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.preference.BooleanFieldEditor; import org.eclipse.jface.preference.ComboFieldEditor; import org.eclipse.jface.preference.<API key>; import org.eclipse.jface.preference.StringFieldEditor; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.jface.viewers.<API key>; import org.eclipse.jface.viewers.ComboViewer; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.<API key>; import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.ListViewer; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.FontData; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.layout.FormLayout; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Menu; import org.eclipse.swt.widgets.Text; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.<API key>; import at.medevit.elexis.kassen.core.Activator; import at.medevit.elexis.kassen.core.model.<API key>; import at.medevit.elexis.kassen.core.model.KassenCodes; import at.medevit.elexis.kassen.core.model.KassenCodes.FederalState; import at.medevit.elexis.kassen.core.model.KassenCodes.SpecialityCode; import at.medevit.elexis.kassen.core.model.KassenLeistung; import ch.elexis.core.data.activator.CoreHub; import ch.elexis.core.ui.dialogs.KontaktSelektor; import ch.elexis.core.ui.preferences.<API key>; import ch.elexis.data.Kontakt; import ch.elexis.data.Rechnungssteller; public class <API key> extends <API key> implements <API key> { Rechnungssteller <API key>; private ArrayList<KassenCodes.SpecialityCode>fachgebiete = new ArrayList<KassenCodes.SpecialityCode>(); public <API key>() { super(GRID); } @Override public void init(IWorkbench workbench) { setPreferenceStore(new <API key>(CoreHub.mandantCfg, Activator.PLUGIN_ID)); setDescription("Einstellungen für den aktuellen Mandanten und dessen Rechnungssteller."); } @Override protected void createFieldEditors() { Composite parent = <API key>(); // begin of Preferences for actual Mandant Label titel = new Label(parent, SWT.NONE); FontData[]bfd = titel.getFont().getFontData(); bfd[0].setStyle(SWT.BOLD); Font boldFont = new Font(Display.getCurrent(), bfd[0]); titel.setFont(boldFont); titel.setText("Einstellungen für Mandant:"); Label text = new Label(parent, SWT.NONE); text.setFont(boldFont); text.setText(CoreHub.actMandant.getLabel()); // HV Nummer StringFieldEditor hvNrEditor = new StringFieldEditor(<API key>.MANDANT_HVNUMBER, "HV/VP Nummer", parent); addField(hvNrEditor); // Fachgebiet SpecialityCode[] codes = KassenCodes.SpecialityCode.values(); String[][] namevalues = new String[codes.length][2]; for(int i = 0; i < codes.length; i++) { namevalues[i][0] = codes[i].getName(); namevalues[i][1] = Integer.toString(codes[i].getCode()); } ComboFieldEditor specialityEditor = new ComboFieldEditor(<API key>.MANDANT_FACHGEBIET, "Fachgebiet", namevalues, parent); addField(specialityEditor); // Bundesland FederalState[] sates = KassenCodes.FederalState.values(); namevalues = new String[sates.length][2]; for(int i = 0; i < sates.length; i++) { namevalues[i][0] = sates[i].getName(); namevalues[i][1] = Integer.toString(sates[i].getCode()); } ComboFieldEditor stateEditor = new ComboFieldEditor(<API key>.MANDANT_BUNDESLAND, "Bundesland", namevalues, parent); addField(stateEditor); // DVR Nummer StringFieldEditor dvrNrEditor = new StringFieldEditor(<API key>.MANDANT_DVRNUMBER, "DVR Nummer", parent); addField(dvrNrEditor); // Old/New Positions Id BooleanFieldEditor useNewPosId = new BooleanFieldEditor(<API key>.KASSEN_USENEWPOSID, "Neue Positions Id verwenden", parent); useNewPosId.setPreferenceName(<API key>.KASSEN_USENEWPOSID); addField(useNewPosId); Label sep = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL); sep.setLayoutData(new GridData( GridData.FILL, GridData.CENTER, true, false, 2, 0)); // begin of preferences for rechnungssteller <API key> = CoreHub.actMandant.getRechnungssteller(); Label rstitel = new Label(parent, SWT.NONE); rstitel.setFont(boldFont); rstitel.setText("Einstellungen für Rechnungssteller:"); Label rstext = new Label(parent, SWT.NONE); rstext.setFont(boldFont); rstext.setText(<API key>.getLabel()); // HV/VP Nummer if(<API key>.istOrganisation()) { Label lbl = new Label(parent, SWT.NONE); lbl.setText("HV/VP Nummer"); lbl.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 0, 0)); final Text hvNumber = new Text(parent, SWT.BORDER); hvNumber.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 0, 0)); hvNumber.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { <API key>.setInfoElement( <API key>.<API key>, hvNumber.getText()); } }); hvNumber .setText(<API key> .getInfoString(<API key>.<API key>)); } else { Label lbl = new Label(parent, SWT.NONE); lbl.setText("HV/VP Nummer"); lbl.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 0, 0)); final Text hvNumber = new Text(parent, SWT.BORDER); hvNumber.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 0, 0)); hvNumber.setEditable(false); hvNumber.setText(getPreferenceStore().getString(<API key>.MANDANT_HVNUMBER)); } // Kontonummer Label lbl = new Label(parent, SWT.NONE); lbl.setText("Kontonummer"); lbl.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 0, 0)); final Text accountNumber = new Text(parent, SWT.BORDER); accountNumber.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 0, 0)); accountNumber.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { <API key>.setInfoElement( <API key>.<API key>, accountNumber.getText()); } }); accountNumber .setText(<API key> .getInfoString(<API key>.<API key>)); // Bankleitzahl lbl = new Label(parent, SWT.NONE); lbl.setText("Bankleitzahl"); lbl.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 0, 0)); final Text bankCode = new Text(parent, SWT.BORDER); bankCode.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 0, 0)); bankCode.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { <API key>.setInfoElement( <API key>.<API key>, bankCode.getText()); } }); bankCode.setText(<API key> .getInfoString(<API key>.<API key>)); // Bank Kontakt lbl = new Label(parent, SWT.NONE); lbl.setText("Kontakt der Bank:"); Composite contactParent = new Composite(parent, SWT.NONE); contactParent.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 0, 0)); contactParent.setLayout(new FormLayout()); final Text contactTxt = new Text(contactParent, SWT.BORDER); contactTxt.setEditable(false); String bankContactId = <API key>.getInfoString(<API key>.<API key>); if(bankContactId.length() > 1) { Kontakt bvaContact = Kontakt.load(bankContactId); contactTxt.setText(bvaContact.getLabel()); } Button contactBtn = new Button(contactParent, SWT.PUSH); contactBtn.setText("Kontakt"); contactBtn.<API key>(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { KontaktSelektor ksl = new KontaktSelektor(getShell(), Kontakt.class, "Kontakt auswählen", "Kontakt der Bank auswählen, bzw. anlegen.", false, Kontakt.DEFAULT_SORT); if (ksl.open() == Dialog.OK) { Kontakt sel = (Kontakt) ksl.getSelection(); <API key>.setInfoElement(<API key>.<API key>, sel.getId()); contactTxt.setText(sel.getLabel()); } } }); FormData fd = new FormData(); fd.top = new FormAttachment(0, 0); fd.right = new FormAttachment(100, 0); contactBtn.setLayoutData(fd); fd = new FormData(); fd.top = new FormAttachment(contactBtn, 0, SWT.CENTER); fd.left = new FormAttachment(0, 0); fd.right = new FormAttachment(contactBtn, -5); contactTxt.setLayoutData(fd); // Fachgebiete try { fachgebiete .addAll(KassenLeistung.<API key>(<API key> .getInfoString(<API key>.<API key>))); } catch (ParseException e1) { // ignore and build ui to set new fachgebiete } lbl = new Label(parent, SWT.NONE); lbl.setText("Fachgebiete:"); Composite specialityParent = new Composite(parent, SWT.NONE); specialityParent.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 0, 0)); specialityParent.setLayout(new FormLayout()); final ListViewer fachgebieteList = new ListViewer(specialityParent, SWT.BORDER | SWT.V_SCROLL); fachgebieteList.setContentProvider(new <API key>()); fachgebieteList.setInput(fachgebiete); fachgebieteList.setLabelProvider(new LabelProvider() { @Override public String getText(Object element) { KassenCodes.SpecialityCode code = (KassenCodes.SpecialityCode) element; return code.getName(); } }); // First we create a menu Manager MenuManager menuManager = new MenuManager(); menuManager.add(new Action() { @Override public String getText() { return "remove"; } @Override public void run() { ISelection selection = fachgebieteList.getSelection(); if (selection != null & selection instanceof <API key>) { <API key> sel = (<API key>) selection; if(sel==null) { return; } SpecialityCode code = (KassenCodes.SpecialityCode) sel.getFirstElement(); if(code != null) { fachgebiete.remove(code); fachgebieteList.refresh(); } } } }); // set the menu for the list viewer Menu menu = menuManager.createContextMenu(fachgebieteList.getControl()); fachgebieteList.getControl().setMenu(menu); final ComboViewer fachgebieteCombo = new ComboViewer(specialityParent, SWT.BORDER); fachgebieteCombo.setContentProvider(new <API key>()); fachgebieteCombo.setInput(KassenCodes.SpecialityCode.values()); fachgebieteCombo.setLabelProvider(new LabelProvider() { @Override public String getText(Object element) { KassenCodes.SpecialityCode code = (KassenCodes.SpecialityCode) element; return code.getName(); } }); Button fachgebieteBtn = new Button(specialityParent, SWT.PUSH); fachgebieteBtn.setText("<<"); fachgebieteBtn.<API key>(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { <API key> sel = (<API key>) fachgebieteCombo.getSelection(); SpecialityCode code = (KassenCodes.SpecialityCode) sel.getFirstElement(); if(code != null) { fachgebiete.add(code); <API key> .setInfoElement( <API key>.<API key>, KassenLeistung.<API key>(fachgebiete)); fachgebieteList.refresh(); } } }); fd = new FormData(); fd.top = new FormAttachment(0, 0); fd.left = new FormAttachment(0, 0); fd.right = new FormAttachment(55, -5); fd.bottom = new FormAttachment(100, 0); fachgebieteList.getControl().setLayoutData(fd); fd = new FormData(); fd.top = new FormAttachment(0, 0); fd.left = new FormAttachment(55, 5); fd.right = new FormAttachment(90, -5); fd.width = 100; fachgebieteCombo.getControl().setLayoutData(fd); fd = new FormData(); fd.top = new FormAttachment(0, 0); fd.left = new FormAttachment(90, 5); fd.right = new FormAttachment(100, 0); fachgebieteBtn.setLayoutData(fd); } @Override public void propertyChange(PropertyChangeEvent event) { if(event.getSource() instanceof BooleanFieldEditor) { BooleanFieldEditor source = (BooleanFieldEditor) event.getSource(); if(<API key>.KASSEN_USENEWPOSID.equals(source.getPreferenceName())) KassenLeistung.setUseNewPosId((Boolean) event.getNewValue()); } super.propertyChange(event); } }