answer
stringlengths
15
1.25M
package sfs2x.extensions.games.spacewar.core; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import sfs2x.extensions.games.spacewar.<API key>; import sfs2x.extensions.games.spacewar.entities.Velocity; import com.smartfoxserver.v2.entities.data.ISFSObject; import com.smartfoxserver.v2.exceptions.<API key>; public class Game implements Runnable { private <API key> ext; private Map<Integer, Starship> starships; private Map<Integer, WeaponShot> weaponShots; public Game(<API key> ext) { this.ext = ext; this.starships = new ConcurrentHashMap<Integer, Starship>(); this.weaponShots = new ConcurrentHashMap<Integer, WeaponShot>(); } public void createStarship(int ownerId, ISFSObject settings) { Starship ship = new Starship(ownerId, settings); ship.x = (Math.random() * 1000.0D); ship.y = (Math.random() * 800.0D); ship.rotation = ((int) Math.round(Math.random() * 360.0D * 3.141592653589793D / 180.0D)); ship.lastRenderTime = System.currentTimeMillis(); this.starships.put(Integer.valueOf(ownerId), ship); <API key>(ship, true); } public void removeStarship(int ownerId) { this.starships.remove(Integer.valueOf(ownerId)); } public void rotateStarship(int ownerId, int direction) { Starship ship = (Starship) this.starships.get(Integer.valueOf(ownerId)); ship.rotatingDir = direction; if (direction != 0) { this.ext.setStarshipRotating(ownerId, direction); } else { <API key>(ship, true); } } public void thrustStarship(int ownerId, boolean activate) { Starship ship = (Starship) this.starships.get(Integer.valueOf(ownerId)); ship.thrust = activate; <API key>(ship, true); } public void createWeaponShot(int ownerId, ISFSObject settings) { WeaponShot shot = new WeaponShot(ownerId, settings); Starship ship = (Starship) this.starships.get(Integer.valueOf(ownerId)); shot.x = (ship.x + 15.0D * Math.cos(ship.rotation)); shot.y = (ship.y + 15.0D * Math.sin(ship.rotation)); double vx = Math.cos(ship.rotation) * shot.getSpeed(); double vy = Math.sin(ship.rotation) * shot.getSpeed(); Velocity v = new Velocity(vx + ship.getVX(), vy + ship.getVY()); shot.velocity = v; shot.lastRenderTime = System.currentTimeMillis(); int id = this.ext.addWeaponShot(shot.getModel(), shot.x, shot.y, shot.getVX(), shot.getVY()); shot.setMMOItemId(id); this.weaponShots.put(Integer.valueOf(id), shot); } public void run() { try { WeaponShot shot; for (Iterator<Map.Entry<Integer, WeaponShot>> it = this.weaponShots.entrySet().iterator(); it.hasNext();) { shot = (WeaponShot) it.next().getValue(); if (shot.isSelfDestruct()) { it.remove(); removeWeaponShot(shot); } else { renderWeaponShot(shot); <API key>(shot); } } for (Starship ship : this.starships.values()) { renderStarship(ship); List<Integer> shotIDs = this.ext.getWeaponShotsList(ship.x, ship.y); boolean hit = false; for (int i = 0; i < shotIDs.size(); i++) { int shotID = ((Integer) shotIDs.get(i)).intValue(); shot = (WeaponShot) this.weaponShots.get(Integer.valueOf(shotID)); if (getDistance(ship, shot) <= shot.getHitRadius()) { this.weaponShots.remove(Integer.valueOf(shotID)); removeWeaponShot(shot); int dirX = ship.x > shot.x ? 1 : -1; int dirY = ship.y > shot.y ? 1 : -1; ship.velocity.vx += dirX * shot.getHitForce(); ship.velocity.vy += dirY * shot.getHitForce(); hit = true; } } <API key>(ship, hit); } } catch (Exception e) { <API key> emc = new <API key>(e); this.ext.trace(new Object[] { emc.toString() }); } } private void <API key>(Starship ss, boolean doUpdateClients) { this.ext.setStarshipState(ss.getOwnerId(), ss.x, ss.y, ss.getVX(), ss.getVY(), ss.rotation, ss.thrust, ss.rotatingDir, doUpdateClients); } private void <API key>(WeaponShot ws) { this.ext.<API key>(ws.getMMOItemId(), ws.x, ws.y, ws.getVX(), ws.getVY()); } private void removeWeaponShot(WeaponShot shot) { this.ext.removeWeaponShot(shot.getMMOItemId()); this.ext.<API key>(shot.getMMOItemId(), shot.x, shot.y); } private void renderStarship(Starship ship) { long now = System.currentTimeMillis(); long elapsed = now - ship.lastRenderTime; for (long i = 0L; i < elapsed; i += 1L) { ship.rotation += ship.rotatingDir * ship.getRotationSpeed(); if (ship.thrust) { ship.velocity.vx += Math.cos(ship.rotation) * ship.<API key>(); ship.velocity.vy += Math.sin(ship.rotation) * ship.<API key>(); } ship.velocity.limitSpeed(ship.getMaxSpeed()); ship.x += ship.velocity.vx; ship.y += ship.velocity.vy; } ship.lastRenderTime = now; } private void renderWeaponShot(WeaponShot shot) { long now = System.currentTimeMillis(); long elapsed = now - shot.lastRenderTime; for (long i = 0L; i < elapsed; i += 1L) { shot.x += shot.velocity.vx; shot.y += shot.velocity.vy; } shot.lastRenderTime = now; } private double getDistance(GameItem simItem1, GameItem simItem2) { double dist_x = simItem1.x - simItem2.x; double dist_y = simItem1.y - simItem2.y; return Math.sqrt(Math.pow(dist_x, 2.0D) + Math.pow(dist_y, 2.0D)); } }
<?php return array ( 'id' => 'sk_s100_ver1', 'fallback' => '<API key>', 'capabilities' => array ( 'model_name' => 'S100', 'brand_name' => 'SK Telesys', 'marketing_name' => '', 'density_class' => '1.5', ), );
const {describe, it} = global; import {expect} from 'chai'; import {shallow} from 'enzyme'; import Badges from '../badges'; describe('testmod.components.badges', () => { it('should do something'); });
<?php namespace Integrated\Bundle\BlockBundle\Templating; use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\ODM\MongoDB\<API key>; use Doctrine\ODM\MongoDB\Repository\DocumentRepository; use Integrated\Bundle\BlockBundle\Block\BlockHandler; use Integrated\Bundle\BlockBundle\Document\Block\Block; use Integrated\Bundle\ThemeBundle\Templating\ThemeManager; use Integrated\Common\Block\<API key>; use Integrated\Common\Block\<API key>; use Integrated\Common\Block\BlockInterface; use Integrated\Common\Content\ContentInterface; use Symfony\Component\OptionsResolver\OptionsResolver; /** * @author Ger Jan van den Bosch <gerjan@e-active.nl> */ class BlockManager { /** * @var <API key> */ protected $blockRegistry; /** * @var ThemeManager */ protected $themeManager; /** * @var DocumentRepository */ protected $repository; /** * @var \Twig_Environment */ protected $twig; /** * @var ContentInterface */ protected $document; /** * @param <API key> $blockRegistry * @param ThemeManager $themeManager * @param DocumentManager $dm * @param \Twig_Environment $twig */ public function __construct(<API key> $blockRegistry, ThemeManager $themeManager, DocumentManager $dm, \Twig_Environment $twig) { $this->blockRegistry = $blockRegistry; $this->themeManager = $themeManager; $this->repository = $dm->getRepository('<API key>:Block\Block'); $this->twig = $twig; // @todo templating service (INTEGRATED-443) } /** * @param BlockInterface|string $block * @param array $options * * @return string|null */ public function render($block, array $options = []) { if (\is_string($block)) { $block = $this->getBlock($block); } if ($block instanceof BlockInterface) { try { if ($block instanceof Block && (!$block->isPublished() || $block->isDisabled())) { return; } } catch (<API key> $e) { return; } $handler = $this->blockRegistry->getHandler($block->getType()); if ($handler instanceof <API key>) { if ($handler instanceof BlockHandler) { $handler->setTwig($this->twig); if ($this->document instanceof ContentInterface) { $handler->setDocument($this->document); } $handler->configureOptions($resolver = new OptionsResolver()); $options = $resolver->resolve($options); if ($template = $this->themeManager->locateTemplate('blocks/'.$block->getType().'/'.$block->getLayout())) { $handler->setTemplate($template); } } return $handler->execute($block, $options); } } } /** * @param string $id * * @return Block|null */ public function getBlock($id) { return $this->repository->find($id); } /** * @param ContentInterface $document * * @return $this */ public function setDocument(ContentInterface $document) { $this->document = $document; return $this; } }
<?php namespace Lizard\Models; use Illuminate\Database\Eloquent\Model; class Reply extends Model { /** * @var array */ protected $fillable = ['thread_id', 'user_id', 'original_body', 'body', 'user_agent']; /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function thread() { return $this->belongsTo(Thread::class); } public function user() { return $this->belongsTo(User::class); } }
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 30 2020 21:18:12). #import <IDEKit/IDEViewController.h> @interface <API key> : IDEViewController { } @end
package org.charvolant.dossier; import static org.junit.Assert.assertEquals; import java.io.StringWriter; import java.util.ArrayList; import java.util.List; import java.util.Locale; import org.junit.Before; import org.junit.Test; import org.w3c.dom.Document; import com.hp.hpl.jena.ontology.OntModel; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; /** * Test cases for XML generator * * @author Doug Palmer <doug@charvolant.org> * */ public class <API key> extends AbstractTest { private Configuration configuration; private List<OntModel> models; private Model dossier; private SuiteGenerator generator; private SuiteDotDocumenter documenter; private void addModel(String name) { OntModel model; model = ModelFactory.createOntologyModel(); model.getDocumentManager().setProcessImports(false); model.read(this.getClass().getResource(name).toString()); this.models.add(model); } @Before public void setUp() throws Exception { this.dossier = ModelFactory.createDefaultModel(); this.dossier.read(this.getClass().getResource("dossier.rdf").toString()); this.dossier.read(this.getClass().getResource("standard.rdf").toString()); this.configuration = new Configuration(); this.configuration.setDisplayModel(this.dossier); this.configuration.setLocale(Locale.ENGLISH); this.models = new ArrayList<OntModel>(); } @Test public void testgenerateDot1() throws Exception { Document document; StringWriter writer = new StringWriter(); this.addModel("test1.rdf"); this.generator = new SuiteGenerator(this.configuration, this.models); document = this.generator.generate(); this.documenter = new SuiteDotDocumenter(this.configuration, document); this.documenter.generate(writer, Format.DOT); //System.out.println(writer.toString()); assertEquals(this.loadResource("suite-dot-output-1.dot"), this.trim(writer.toString())); } @Test public void testgenerateDot2() throws Exception { Document document; StringWriter writer = new StringWriter(); this.addModel("test1.rdf"); this.addModel("test2.rdf"); this.generator = new SuiteGenerator(this.configuration, this.models); document = this.generator.generate(); this.documenter = new SuiteDotDocumenter(this.configuration, document); this.documenter.generate(writer, Format.DOT); //System.out.println(writer.toString()); assertEquals(this.loadResource("suite-dot-output-2.dot"), this.trim(writer.toString())); } @Test public void testgenerateDot3() throws Exception { Document document; StringWriter writer = new StringWriter(); this.addModel("test4.rdf"); this.addModel("test5.rdf"); this.addModel("test6.rdf"); this.generator = new SuiteGenerator(this.configuration, this.models); document = this.generator.generate(); this.documenter = new SuiteDotDocumenter(this.configuration, document); this.documenter.generate(writer, Format.DOT); //System.out.println(writer.toString()); assertEquals(this.loadResource("suite-dot-output-3.dot"), this.trim(writer.toString())); } }
# This file is part of Indico. # Indico is free software; you can redistribute it and/or from __future__ import unicode_literals import csv from flask import flash, session from indico.core.errors import UserValueError from indico.modules.events.roles.forms import <API key> from indico.modules.users import User from indico.util.i18n import _, ngettext from indico.util.string import to_unicode, validate_email from indico.web.flask.templating import get_template_module from indico.web.util import jsonify_data, jsonify_template class <API key>(object): """Import members from a CSV file into a role.""" logger = None def <API key>(self, f): reader = csv.reader(f.read().splitlines()) emails = set() for num_row, row in enumerate(reader, 1): if len(row) != 1: raise UserValueError(_('Row {}: malformed CSV data').format(num_row)) email = to_unicode(row[0]).strip().lower() if email and not validate_email(email): raise UserValueError(_('Row {row}: invalid email address: {email}').format(row=num_row, email=email)) if email in emails: raise UserValueError(_('Row {}: email address is not unique').format(num_row)) emails.add(email) users = set(User.query.filter(~User.is_deleted, User.all_emails.in_(emails))) users_emails = {user.email for user in users} unknown_emails = emails - users_emails new_members = users - self.role.members return new_members, users, unknown_emails def _process(self): form = <API key>() if form.validate_on_submit(): new_members, users, unknown_emails = self.<API key>(form.source_file.data) if form.remove_existing.data: deleted_members = self.role.members - users for member in deleted_members: self.logger.info('User {} removed from role {} by {}'.format(member, self.role, session.user)) self.role.members = users else: self.role.members |= users for user in new_members: self.logger.info('User {} added to role {} by {}'.format(user, self.role, session.user)) flash(ngettext("{} member has been imported.", "{} members have been imported.", len(users)).format(len(users)), 'success') if unknown_emails: flash(ngettext("There is no user with this email address: {}", "There are no users with these email addresses: {}", len(unknown_emails)).format(', '.join(unknown_emails)), 'warning') tpl = get_template_module('events/roles/_roles.html') return jsonify_data(html=tpl.render_role(self.role, collapsed=False, email_button=False)) return jsonify_template('events/roles/import_members.html', form=form, role=self.role)
[HOME](index.md) **Role:** Level Designer **Name:** Asier Iglesias ![Profile](http://i.imgur.com/7xnXiAj.jpg?1) **Contact:** [Linkedin](https: Mail: asier.iglesias@yahoo.es **My job:** First I started as a kart designer and after giving some concept ideas I knew that it wasn't what I liked, so I changed to level designer. And I loved it! I'm proud to say that I'm the designer of the Umi Gohan level. **What I've done:** - First we did a lot of testing with the technologies we were developing to see how we could start designing the levels, and finilly we came out with the way, by using heightmaps. This is the development of the heightmaps until the actual one: ![HeightmapGif](https://i.imgflip.com/1qgkaa.gif) - After every heighmap I had to put all the colliders, checkpoints, paint the terrain and put some props, where the artists really helped. - Here you have some images of the development of the map with lots of iterations between them: ![map1](http://i.imgur.com/aRDbdkr.jpg?1) ![map2](http://i.imgur.com/I9fEi6y.png?1) ![map3](http://i.imgur.com/TYYRD2S.jpg?1) ![map4](http://i.imgur.com/nQzEiEP.jpg?1) ![map5](http://i.imgur.com/kluKRVR.png?1) ![map6](http://i.imgur.com/KITnvvU.jpg) - And over everything always test! ![QA](http://i.imgur.com/Iozef3R.jpg?2)
module.exports = (() => { 'use strict'; function Calculator() {} Calculator.prototype.add = (a, b) => { return a + b; }; Calculator.prototype.subtract = (a, b) => { return a - b; }; Calculator.prototype.divide = (a, b) => { return a / b; }; Calculator.prototype.multiply = (a, b) => { return a * b; }; return Calculator; })();
class CreateUsernames < ActiveRecord::Migration[5.0] def change create_table :usernames do |t| t.string :department_code t.string :course_number t.string :section_name t.timestamps end end end
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using PlanetarySystem.AstronomicalObjects; using System.IO; namespace PlanetarySystem.CommandPattern { public sealed class SerializeCommand : Command { public ISerializer serializer { get; set; } public List<AstronomicalObject> item; public Stream stream { get; set; } public override void Execute() { if (stream != null) serializer.Serialize(item, stream); } public SerializeCommand(ISerializer serializer, List<AstronomicalObject> item) { this.serializer = serializer; this.item = item; this.stream = stream; } } }
<!DOCTYPE html PUBLIC "- <html xmlns="http: <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.9.1"/> <title>V8 API Reference Guide for node.js v0.12.0 - v0.12.1: Member List</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { init_search(); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">V8 API Reference Guide for node.js v0.12.0 - v0.12.1 </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.9.1 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="<API key>"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="<API key>.html">ScriptCompiler</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">v8::ScriptCompiler Member List</div> </div> </div><!--header <div class="contents"> <p>This is the complete list of members for <a class="el" href="<API key>.html">v8::ScriptCompiler</a>, including all inherited members.</p> <table class="directory"> <tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">Compile</a>(Isolate *isolate, Source *source, CompileOptions options=kNoCompileOptions)</td><td class="entry"><a class="el" href="<API key>.html">v8::ScriptCompiler</a></td><td class="entry"><span class="mlabel">static</span></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>CompileOptions</b> enum name (defined in <a class="el" href="<API key>.html">v8::ScriptCompiler</a>)</td><td class="entry"><a class="el" href="<API key>.html">v8::ScriptCompiler</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="<API key>.html#<API key>">CompileUnbound</a>(Isolate *isolate, Source *source, CompileOptions options=kNoCompileOptions)</td><td class="entry"><a class="el" href="<API key>.html">v8::ScriptCompiler</a></td><td class="entry"><span class="mlabel">static</span></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>kConsumeCodeCache</b> enum value (defined in <a class="el" href="<API key>.html">v8::ScriptCompiler</a>)</td><td class="entry"><a class="el" href="<API key>.html">v8::ScriptCompiler</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>kConsumeParserCache</b> enum value (defined in <a class="el" href="<API key>.html">v8::ScriptCompiler</a>)</td><td class="entry"><a class="el" href="<API key>.html">v8::ScriptCompiler</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>kNoCompileOptions</b> enum value (defined in <a class="el" href="<API key>.html">v8::ScriptCompiler</a>)</td><td class="entry"><a class="el" href="<API key>.html">v8::ScriptCompiler</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>kProduceCodeCache</b> enum value (defined in <a class="el" href="<API key>.html">v8::ScriptCompiler</a>)</td><td class="entry"><a class="el" href="<API key>.html">v8::ScriptCompiler</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>kProduceDataToCache</b> enum value (defined in <a class="el" href="<API key>.html">v8::ScriptCompiler</a>)</td><td class="entry"><a class="el" href="<API key>.html">v8::ScriptCompiler</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>kProduceParserCache</b> enum value (defined in <a class="el" href="<API key>.html">v8::ScriptCompiler</a>)</td><td class="entry"><a class="el" href="<API key>.html">v8::ScriptCompiler</a></td><td class="entry"></td></tr> </table></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Tue Aug 11 2015 23:46:19 for V8 API Reference Guide for node.js v0.12.0 - v0.12.1 by & <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.9.1 </small></address> </body> </html>
AMD CommonJS AMD JavaScript `define`Module. `define` javascript define(id?: String, dependencies?: String[], factory: Function|Object); module. # `dependencies` dependencies module factory dependencies ["require", "exports", "module"] # `factory` factory module myModule jQuery javascript define('myModule', ['jquery'], function($) { // $ is the export of the jquery module. $('body').text('hello world'); }); // and use it require(['myModule'], function(myModule) {}); webpack Require.js module id javascript define(['jquery'], function($) { $('body').text('hello world'); }); javascript define(['jquery', './math.js'], function($, math) { // $ and math are the exports of the jquery module. $('body').text('hello world'); }); . javascript define(['jquery'], function($) { var HelloWorldize = function(selector){ $(selector).text('hello world'); }; return HelloWorldize; }); javascript define(function(require) { var $ = require('jquery'); $('body').text('hello world'); });
(function(window, undefined) { "use strict"; var oldR = window.R; var oldRC = window.RC; var R = { Collection: function(elems) { if (elems) { for (var i = 0; i < elems.length; ++i) { this.push(elems[i]); } } else { this.length = 0; } }, classOf: function(obj) { return {}.toString.call(obj); }, extendCollection: function(fnName, fn) { R.Collection.prototype[fnName] = fn; }, extendElement: function(fnName, fn, flags) { flags = flags || {}; if (flags.usesCollection) { R[fnName] = function() { var args = [].slice.call(arguments); args.push(RC([args.pop()])); return fn.apply(undefined, args); }; R.Collection.prototype[fnName] = function() { var args = [].slice.call(arguments); args.push(RC(this)); return fn.apply(undefined, args); }; } else { R[fnName] = function() { return fn.apply(undefined, arguments); }; R.Collection.prototype[fnName] = function() { var args = [].slice.call(arguments); if (this.guaranteeSingle && flags.canReturnSingle) { return this.length ? fn.apply(undefined, args.concat([this[0]])) : undefined; } else { return RC(this.map(function(elem) { return fn.apply(undefined, args.concat(elem)); }).reduce(function(a, b) { return a.concat( b !== undefined && R.classOf(b) != '[object String]' && !isNaN(b.length) ? [].slice.call(b) : [b] ); }, [])); } }; } }, noConflict: function() { window.R = oldR; window.RC = oldRC; return R; } }; R.Collection.prototype = []; R.Collection.prototype.guaranteeSingle = false; window.Reality = window.R = R; window.RC = function(arr) { return new R.Collection(arr); }; }(window));
<!DOCTYPE html PUBLIC "- <html xmlns="http: <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.6"/> <title>VSCP framework: D:/Daten/projects/github/vscp-framework/vscp/vscp_config_base.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">VSCP framework &#160;<span id="projectnumber">v0.4.1</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.6 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Related&#160;Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File&#160;List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">D:/Daten/projects/github/vscp-framework/vscp/vscp_config_base.h</div> </div> </div><!--header <div class="contents"> <div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div> <div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;<span class="comment">/*</span></div> <div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;<span class="comment"> * Don&#39;t forget to set JAVADOC_AUTOBRIEF to YES in the doxygen file to generate</span></div> <div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;<span class="comment"> * a correct module description.</span></div> <div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;<span class="comment"> */</span></div> <div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;</div> <div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;<span class="preprocessor">#ifndef <API key></span></div> <div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define <API key></span></div> <div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;<span class="preprocessor"></span></div> <div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;</div> <div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div> <div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;<span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span></div> <div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;{</div> <div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;<span class="preprocessor">#endif</span></div> <div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;<span class="preprocessor"></span></div> <div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;</div> <div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="<API key>.html#<API key>"> 68</a></span>&#160;<span class="preprocessor">#define <API key> 0</span></div> <div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;<span class="preprocessor"></span></div> <div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="<API key>.html#<API key>"> 71</a></span>&#160;<span class="preprocessor">#define <API key> 1</span></div> <div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;<span class="preprocessor"></span></div> <div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;</div> <div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="<API key>.html#<API key>"> 78</a></span>&#160;<span class="preprocessor">#define <API key>(__switch) (<API key> == (__switch))</span></div> <div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;<span class="preprocessor"></span></div> <div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="<API key>.html#<API key>"> 81</a></span>&#160;<span class="preprocessor">#define <API key>(__switch) (<API key> == (__switch))</span></div> <div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;<span class="preprocessor"></span></div> <div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;</div> <div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;</div> <div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160;</div> <div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div> <div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160;<span class="preprocessor"></span>}</div> <div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160;<span class="preprocessor">#endif</span></div> <div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;<span class="preprocessor"></span></div> <div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* <API key> */</span><span class="preprocessor"></span></div> <div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;<span class="preprocessor"></span></div> </div><!-- fragment --></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Thu Sep 10 2015 22:19:51 for VSCP framework by & <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.6 </small></address> </body> </html>
import { BuildInfo } from "_generated_/<API key>"; export default BuildInfo;
package org.codehaus.modello.model; import org.codehaus.modello.<API key>; import org.codehaus.modello.metadata.Metadata; import java.util.HashMap; import java.util.Map; import java.util.ArrayList; import java.util.List; /** * This is the base class for all elements of the model. The name attribute is immutable because it's used as the key. * * @author <a href="mailto:jason@modello.org">Jason van Zyl</a> * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a> * @author <a href="mailto:evenisse@codehaus.org">Emmanuel Venisse</a> */ public abstract class BaseElement { private String name; private String description; private String comment; private List<String> annotations = new ArrayList<String>(); private VersionRange versionRange = new VersionRange( "0.0.0+" ); private Version deprecatedVersion; private transient Map<String, Metadata> metadata = new HashMap<String, Metadata>(); private boolean nameRequired; public abstract void validateElement() throws <API key>; public BaseElement( boolean nameRequired ) { this.nameRequired = nameRequired; this.name = null; } public BaseElement( boolean nameRequired, String name ) { this.nameRequired = nameRequired; this.name = name; } public String getName() { return name; } public void setName( String name ) { this.name = name; } public String getDescription() { return description; } public void setDescription( String description ) { this.description = description; } public VersionRange getVersionRange() { return versionRange; } public void setVersionRange( VersionRange versionRange ) { this.versionRange = versionRange; } public void <API key>( Version deprecatedVersion ) { this.deprecatedVersion = deprecatedVersion; } public Version <API key>() { return deprecatedVersion; } public String getComment() { return comment; } public void setComment( String comment ) { this.comment = comment; } public boolean hasMetadata( String key ) { return metadata.containsKey( key ); } public void addMetadata( Metadata metadata ) { this.metadata.put( metadata.getClass().getName(), metadata ); } protected <T extends Metadata> T getMetadata( Class<T> type, String key ) { Metadata metadata = this.metadata.get( key ); if ( metadata == null ) { throw new <API key>( "No such metadata: '" + key + "' for element: '" + getName() + "'." ); } if ( !type.isInstance( metadata ) ) { throw new <API key>( "The metadata is not of the expected type. Key: '" + key + "', expected type: '" + type.getName() + "'." ); } return type.cast( metadata ); } // Validation utils protected void <API key>( String objectName, String fieldName, String value ) throws <API key> { if ( value == null ) { throw new <API key>( "Missing value '" + fieldName + "' from " + objectName + "." ); } if ( isEmpty( value ) ) { throw new <API key>( "Empty value '" + fieldName + "' from " + objectName + "." ); } } public final void validate() throws <API key> { if ( nameRequired ) { <API key>( "Element.name", "name", name ); } validateElement(); } protected boolean isEmpty( String string ) { return string == null || string.trim().length() == 0; } public boolean equals( Object other ) { if ( other == null || !( other instanceof BaseElement ) ) { return false; } // If we don't know how to identify this object it's not equal to any other object if ( !nameRequired ) { return false; } BaseElement baseElem = (BaseElement) other; return name.equals( baseElem.getName() ) && versionRange.equals( baseElem.getVersionRange() ); } public int hashCode() { if ( !nameRequired ) { return System.identityHashCode( this ); } return name.hashCode() + versionRange.toString().hashCode(); } /** * @return the annotations */ public List<String> getAnnotations() { return annotations; } /** * @param annotations the annotations to set */ public void setAnnotations( List<String> annotations ) { this.annotations = annotations; } }
var assert = require("assert"), fbuffer = require('../'); describe('Buffer', function() { var buffer = fbuffer() .byte(1) .sbyte(-1) .ushort(256) .short(-256) .uint(65536) .int(-32769) .ulong(4294967296) .long(-214748365) .double(Number.MAX_VALUE) .string('') .pack(); var reader = fbuffer(buffer) .byte() .sbyte() .ushort() .short() .uint() .int() .ulong() .long() .double() .string() .unpack(); var stepreader = fbuffer(buffer, 'step'); describe('#byte', function() { it('should return 1', function() { assert.equal(1, reader[0]); assert.equal(1, stepreader.byte()); }); }); describe('#sbyte', function() { it('should return -1', function() { assert.equal(-1, reader[1]); assert.equal(-1, stepreader.sbyte()); }) }); describe('#ushort', function() { it('should return 256', function() { assert.equal(256, reader[2]); assert.equal(256, stepreader.ushort()); }) }); describe('#short', function() { it('should return 256', function() { assert.equal(-256, reader[3]); assert.equal(-256, stepreader.short()); }) }); describe('#uint', function() { it('should return 65536', function() { assert.equal(65536, reader[4]); assert.equal(65536, stepreader.uint()); }) }); describe('#int', function() { it('should return -32769', function() { assert.equal(-32769, reader[5]); assert.equal(-32769, stepreader.int()); }) }); describe('#ulong', function() { it('should return 4294967296', function() { assert.equal(4294967296, reader[6]); assert.equal(4294967296, stepreader.ulong()); }) }); describe('#long', function() { it('should return -214748365', function() { assert.equal(-214748365, reader[7]); assert.equal(-214748365, stepreader.long()); }) }); describe('#double', function() { it('should return '+ Number.MAX_VALUE, function() { assert.equal(Number.MAX_VALUE, reader[8]); assert.equal(Number.MAX_VALUE, stepreader.double()); }) }); describe('#double', function() { it('should return ', function() { assert.equal('', reader[9]); assert.equal('', stepreader.string()); }) }); })
// Generated by class-dump 3.5 (64 bit). #import "MMObject.h" #import "<API key>.h" @class NSMutableArray; @interface <API key> : MMObject <<API key>> { _Bool <API key>; _Bool _m_ignoreLimit; unsigned int _m_eventId; id <<API key>> _delegate; NSMutableArray *<API key>; } @property(nonatomic) _Bool m_ignoreLimit; // @synthesize m_ignoreLimit=_m_ignoreLimit; @property(nonatomic) _Bool <API key>; // @synthesize <API key>=<API key>; @property(nonatomic) unsigned int m_eventId; // @synthesize m_eventId=_m_eventId; @property(retain, nonatomic) NSMutableArray *<API key>; // @synthesize <API key>=<API key>; @property(nonatomic) __weak id <<API key>> delegate; // @synthesize delegate=_delegate; - (void).cxx_destruct; - (void)callFailedDelegate; - (void)callOKDelegate; - (void)MessageReturn:(id)arg1 Event:(unsigned int)arg2; - (_Bool)isActive; - (void)<API key>; - (void)setReplaceList:(id)arg1; - (void)startRequest; - (id)init; @end
package p8.group3.ida.aau.p8_group3.Presenter; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import p8.group3.ida.aau.p8_group3.Database.DAO.ParentDAO; import p8.group3.ida.aau.p8_group3.Database.ParentDAOImpl; import p8.group3.ida.aau.p8_group3.Model.Parent; import p8.group3.ida.aau.p8_group3.R; public class ProfilePage extends AppCompatActivity { TextView txProfileUsername; TextView txProfileChildren; TextView <API key>; TextView txProfileCity; TextView txAboutParent; TextView txHobbies; TextView txLanguage; private String loginUsername; private String loginPassword; private ParentDAO parentDAO; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.profile_page); Bundle bundle = getIntent().getExtras(); loginUsername = bundle.getString("loginUsername"); loginPassword = bundle.getString("loginPassword"); parentDAO = new ParentDAOImpl(this); parentDAO.open(); Parent profileParent = parentDAO.<API key>(loginPassword); String profileUsername = profileParent.getUsername(); String <API key> = profileParent.getAgeOfChildren(); int profileChildren = profileParent.getNumberOfChildren(); String profileEmail = profileParent.getEmail(); String <API key> = profileParent.getInfoAboutParent(); String profileParentCity = profileParent.getCityOfResidence(); String profileHobbyList = profileParent.getHobbyList(); String profileLanguageList = profileParent.getLanguageList(); <API key> = (TextView) findViewById(R.id.<API key>); <API key>.setText(<API key>); txProfileUsername = (TextView) findViewById(R.id.profileUsername); txProfileUsername.setText(profileUsername); txProfileChildren = (TextView) findViewById(R.id.profileChildren); txProfileChildren.setText(Integer.toString(profileChildren)); txProfileCity = (TextView) findViewById(R.id.profileParentCity); txProfileCity.setText(profileParentCity); txAboutParent = (TextView) findViewById(R.id.<API key>); txAboutParent.setText(<API key>); txHobbies = (TextView) findViewById(R.id.textHobbies); txHobbies.setText(profileHobbyList); txLanguage = (TextView) findViewById(R.id.allLanguages); txLanguage.setText(profileLanguageList); //methods for menu bar Button logoutButton = (Button) findViewById(R.id.<API key>); logoutButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { Intent profileIntent = new Intent(view.getContext(), LoginPage.class); <API key>(profileIntent, 0); Toast.makeText(ProfilePage.this, "You have been logged out.", Toast.LENGTH_SHORT).show(); } }); Button mapButton = (Button) findViewById(R.id.<API key>); mapButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { Intent profileIntent = new Intent(view.getContext(), MapsPage.class); profileIntent.putExtra("loginUsername", loginUsername); profileIntent.putExtra("loginPassword", loginPassword); <API key>(profileIntent, 0); } }); //method for going to EditProfilePage Button editButton = (Button) findViewById(R.id.editProfile); editButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { Intent editProfileIntent = new Intent(view.getContext(), EditProfilePage.class); editProfileIntent.putExtra("loginUsername", loginUsername); editProfileIntent.putExtra("loginPassword", loginPassword); <API key>(editProfileIntent, 0); } }); } }
(function () { angular .module('angular-c360') .factory('c360Model', c360Model); function c360Model() { var DT = breeze.DataType; // alias return { initialize: initialize }; function initialize(metadataStore) { metadataStore.addEntityType({ shortName: 'UIPart', namespace: 'C360', dataProperties: { refChain: {dataType: DT.String, isPartOfKey: true}, name: {dataType: DT.String}, partType: {dataType: DT.String}, parentRefChain: { dataType: DT.String } }, <API key>: { parent: { entityTypeName: 'UIPart:#C360', isScalar: true, associationName: 'UIPart_UIPart', foreignKeyNames: ['parentRefChain'] }, children: { entityTypeName: 'UIPart:#C360', isScalar: false, associationName: 'UIPart_UIPart' } } }); } } })();
var path = require('path'); var pg = require('pg'); var connectionString = require(path.join(__dirname, '../', '../', 'config')).connectionString; module.exports = function(req, res) { var results = []; // Grab data from the URL parameters var idCompra = req.params.idCompra; // Grab data from http request var data = { estado: req.body.estado }; // Get a Postgres client from the connection pool pg.connect(connectionString, function(err, client, done) { // Handle connection errors if(err) { done(); console.log(err); return res.status(500).send(json({ success: false, data: err})); } // SQL Query > Update Data client.query("UPDATE Compra SET estado=($1) WHERE idCompra=($2)", [data.estado, idCompra]); // SQL Query > Select Data var query = client.query("SELECT * FROM Compra"); // Stream results back one row at a time query.on('row', function(row) { results.push(row); }); // After all data is returned, close connection and return results query.on('end', function() { done(); return res.json(results); }); }); }
define([ 'ractive', 'vendor/ractive-events-tap' ], function ( Ractive ) { 'use strict'; return function () { var fixture, Foo; module( 'Miscellaneous' ); // some set-up fixture = document.getElementById( 'qunit-fixture' ); Foo = function ( content ) { this.content = content; }; Ractive.adaptors.foo = { filter: function ( object ) { return object instanceof Foo; }, wrap: function ( ractive, foo, keypath, prefix ) { return { get: function () { return foo.content; }, teardown: function () { } }; } }; test( 'Subclass instance data extends prototype data', function ( t ) { var Subclass, instance; Subclass = Ractive.extend({ template: '{{foo}} {{bar}}', data: { foo: 1 } }); instance = new Subclass({ el: fixture, data: { bar: 2 } }); t.htmlEqual( fixture.innerHTML, '1 2' ); t.deepEqual( instance.get(), { foo: 1, bar: 2 }); }); test( 'Subclasses of subclasses inherit data, partials and transitions', function ( t ) { var Subclass, SubSubclass, wiggled, shimmied, instance; Subclass = Ractive.extend({ template: '<div intro="wiggle">{{>foo}}{{>bar}}{{>baz}}</div><div intro="shimmy">{{foo}}{{bar}}{{baz}}</div>', data: { foo: 1 }, partials: { foo: 'fooPartial' }, transitions: { wiggle: function ( t ) { wiggled = true; } } }); SubSubclass = Subclass.extend({ data: { bar: 2 }, partials: { bar: 'barPartial' }, transitions: { shimmy: function ( t ) { shimmied = true; } } }); instance = new SubSubclass({ el: fixture, data: { baz: 3 }, partials: { baz: 'bazPartial' } }); t.htmlEqual( fixture.innerHTML, '<div><API key></div><div>123</div>' ); t.ok( wiggled ); t.ok( shimmied ); }); test( 'Multiple identical evaluators merge', function ( t ) { var ractive; ractive = new Ractive({ el: fixture, template: '{{( a+b )}} {{( a+b )}} {{( a+b )}}', data: { a: 1, b: 2 } }); t.htmlEqual( fixture.innerHTML, '3 3 3' ); t.equal( ractive._deps.length, 2 ); t.equal( ractive._deps[1].a.length, 1 ); t.equal( ractive._deps[1].b.length, 1 ); }); test( 'Boolean attributes work as expected', function ( t ) { var ractive; ractive = new Ractive({ el: fixture, template: '<input id="one" type="checkbox" checked="{{falsy}}"><input id="two" type="checkbox" checked="{{truthy}}">', data: { truthy: true, falsy: false } }); t.equal( ractive.nodes.one.checked, false ); t.equal( ractive.nodes.two.checked, true ); }); test( 'Instances can be created without an element', function ( t ) { var ractive; ractive = new Ractive({ template: '<ul>{{#items:i}}<li>{{i}}: {{.}}</li>{{/items}}</ul>', data: { items: [ 'a', 'b', 'c' ] } }); t.ok( ractive ); }); test( 'Instances without an element can render HTML', function ( t ) { var ractive; ractive = new Ractive({ template: '<ul>{{#items:i}}<li>{{i}}: {{.}}</li>{{/items}}</ul>', data: { items: [ 'a', 'b', 'c' ] } }); t.htmlEqual( ractive.toHTML(), '<ul><li>0: a</li><li>1: b</li><li>2: c</li></ul>' ); }); test( 'Triples work with toHTML', function ( t ) { var ractive; ractive = new Ractive({ template: '{{{ triple }}}', data: { triple: '<p>test</p>' } }); t.htmlEqual( ractive.toHTML(), '<p>test</p>' ); }); test( 'If a select\'s value attribute is updated at the same time as the available options, the correct option will be selected', function ( t ) { var ractive; ractive = new Ractive({ el: fixture, template: '<select id="select" value="{{selected}}">{{#options}}<option value="{{.}}">{{.}}</option>{{/options}}</select>' }); t.htmlEqual( fixture.innerHTML, '<select id="select"></select>' ); ractive.set({ selected: 'c', options: [ 'a', 'b', 'c', 'd' ] }); t.equal( ractive.get( 'selected' ), 'c' ); t.equal( ractive.nodes.select.value, 'c' ); }); test( 'Passing in alternative delimiters', function ( t ) { var ractive = new Ractive({ el: fixture, template: '[[ greeting ]], [[recipient]]! [[[ triple ]]]', data: { greeting: 'Hello', recipient: 'world', triple: '<p>here is some HTML</p>' }, delimiters: [ '[[', ']]' ], tripleDelimiters: [ '[[[', ']]]' ] }); t.htmlEqual( fixture.innerHTML, 'Hello, world! <p>here is some HTML</p>' ); }); test( 'Using alternative delimiters in template', function ( t ) { var ractive = new Ractive({ el: fixture, template: '{{=[[ ]]=}} {{{=[[[ ]]]=}}} [[ greeting ]], [[recipient]]! [[[ triple ]]]', data: { greeting: 'Hello', recipient: 'world', triple: '<p>here is some HTML</p>' } }); t.htmlEqual( fixture.innerHTML, 'Hello, world! <p>here is some HTML</p>' ); }); test( '.unshift() works with proxy event handlers, without index references', function ( t ) { var ractive = new Ractive({ el: fixture, template: '{{#items}}<button proxy-tap="bla">Level1: {{ title }}</button>{{/items}}', data: { items: [{ title: 'Title1' }] } }); ractive.get('items').unshift({title: 'Title0'}); t.htmlEqual( fixture.innerHTML, '<button>Level1: Title0</button><button>Level1: Title1</button>' ); }); test( 'If a select value with two-way binding has a selected option at render time, the model updates accordingly', function ( t ) { var ractive; ractive = new Ractive({ el: fixture, template: '<select value="{{color}}"><option value="red">red</option><option value="blue">blue</option><option value="green" selected>green</option></select> <p>selected {{color}}</p>' }); t.equal( ractive.get( 'color' ), 'green' ); t.htmlEqual( fixture.innerHTML, '<select><option value="red">red</option><option value="blue">blue</option><option value="green" selected>green</option></select> <p>selected green</p>' ); }); test( 'If a select value with two-way binding has no selected option at render time, the model defaults to the top value', function ( t ) { var ractive; ractive = new Ractive({ el: fixture, template: '<select value="{{color}}"><option value="red">red</option><option value="blue">blue</option><option value="green">green</option></select> <p>selected {{color}}</p>' }); t.equal( ractive.get( 'color' ), 'red' ); t.htmlEqual( fixture.innerHTML, '<select><option value="red">red</option><option value="blue">blue</option><option value="green">green</option></select> <p>selected red</p>' ); }); test( 'If the value of a select is specified in the model, it overrides the markup', function ( t ) { var ractive; ractive = new Ractive({ el: fixture, template: '<select value="{{color}}"><option value="red">red</option><option id="blue" value="blue">blue</option><option id="green" value="green" selected>green</option></select>', data: { color: 'blue' } }); t.equal( ractive.get( 'color' ), 'blue' ); t.ok( ractive.nodes.blue.selected ); t.ok( !ractive.nodes.green.selected ); }); test( 'A select value with static options with numeric values will show the one determined by the model, whether a string or a number is used', function ( t ) { var ractive = new Ractive({ el: fixture, template: '<select value="{{i}}"><option id="_1" value="1">one</option><option id="_2" value="2">two</option><option id="_3" value="3">three</option></select>', data: { i: 2 } }); t.ok( !ractive.nodes._1.selected ); t.ok( ractive.nodes._2.selected ); t.ok( !ractive.nodes._3.selected ); ractive = new Ractive({ el: fixture, template: '<select value="{{i}}"><option id="_1" value="1">one</option><option id="_2" value="2">two</option><option id="_3" value="3">three</option></select>', data: { i: "3" } }); t.ok( !ractive.nodes._1.selected ); t.ok( !ractive.nodes._2.selected ); t.ok( ractive.nodes._3.selected ); }); test( 'Setting the value of a select works with options added via a triple', function ( t ) { var ractive = new Ractive({ el: fixture, template: '<select value="{{value}}">{{{triple}}}</select>', data: { value: 2, triple: '<option value="1">1</option><option value="2">2</option>' } }); t.equal( ractive.find( 'select' ).value, 2); t.ok( ractive.findAll( 'option' )[1].selected ); ractive.set( 'triple', '<option value="1" selected>1</option><option value="2">2</option>' ); t.equal( ractive.find( 'select' ).value, 1 ); t.equal( ractive.get( 'value' ), 1 ); }); test( 'A two-way select updates to the actual value of its selected option, not the stringified value', function ( t ) { var ractive = new Ractive({ el: fixture, template: '<select value="{{selected}}">{{#options}}<option value="{{.}}">{{description}}</option>{{/options}}</select><p>Selected {{selected.description}}</p>', data: { options: [ { description: 'foo' }, { description: 'bar' }, { description: 'baz' } ] } }); t.deepEqual( ractive.get( 'selected' ), { description: 'foo' }); ractive.findAll( 'option' )[1].selected = true; ractive.updateModel(); t.deepEqual( ractive.get( 'selected' ), { description: 'bar' }); ractive.set( 'selected', ractive.get( 'options[2]' ) ); t.ok( ractive.findAll( 'option' )[2].selected ); }) /* test( 'If a multiple select value with two-way binding has a selected option at render time, the model updates accordingly', function ( t ) { var ractive; ractive = new Ractive({ el: fixture, template: '<select value="{{colors}}" multiple><option value="red">red</option><option value="blue" selected>blue</option><option value="green" selected>green</option></select>' }); t.deepEqual( ractive.get( 'colors' ), [ 'blue', 'green' ] ); }); */ test( 'If a multiple select value with two-way binding has no selected option at render time, the model defaults to an empty array', function ( t ) { var ractive; ractive = new Ractive({ el: fixture, template: '<select value="{{colors}}" multiple><option value="red">red</option><option value="blue">blue</option><option value="green">green</option></select>' }); t.deepEqual( ractive.get( 'colors' ), [] ); }); test( 'If the value of a multiple select is specified in the model, it overrides the markup', function ( t ) { var ractive; ractive = new Ractive({ el: fixture, template: '<select value="{{colors}}" multiple><option id="red" value="red">red</option><option id="blue" value="blue">blue</option><option id="green" value="green" selected>green</option></select>', data: { colors: [ 'red', 'green' ] } }); t.deepEqual( ractive.get( 'colors' ), [ 'red', 'green' ] ); t.ok( ractive.nodes.red.selected ); t.ok( !ractive.nodes.blue.selected ); t.ok( ractive.nodes.green.selected ); }); test( 'The model updates to reflect which checkbox inputs are checked at render time', function ( t ) { var ractive; ractive = new Ractive({ el: fixture, template: 'b<input id="red" type="checkbox" name="{{colors}}" value="red"><input id="green" type="checkbox" name="{{colors}}" value="blue" checked><input id="blue" type="checkbox" name="{{colors}}" value="green" checked>' }); t.deepEqual( ractive.get( 'colors' ), [ 'blue', 'green' ] ); t.ok( !ractive.nodes.red.checked ); t.ok( ractive.nodes.blue.checked ); t.ok( ractive.nodes.green.checked ); ractive = new Ractive({ el: fixture, template: '<input id="red" type="checkbox" name="{{colors}}" value="red"><input id="green" type="checkbox" name="{{colors}}" value="blue"><input id="blue" type="checkbox" name="{{colors}}" value="green">' }); t.deepEqual( ractive.get( 'colors' ), [] ); t.ok( !ractive.nodes.red.checked ); t.ok( !ractive.nodes.blue.checked ); t.ok( !ractive.nodes.green.checked ); }); test( 'The model overrides which checkbox inputs are checked at render time', function ( t ) { var ractive; ractive = new Ractive({ el: fixture, template: '<input id="red" type="checkbox" name="{{colors}}" value="red"><input id="blue" type="checkbox" name="{{colors}}" value="blue" checked><input id="green" type="checkbox" name="{{colors}}" value="green" checked>', data: { colors: [ 'red', 'blue' ] } }); t.deepEqual( ractive.get( 'colors' ), [ 'red', 'blue' ] ); t.ok( ractive.nodes.red.checked ); t.ok( ractive.nodes.blue.checked ); t.ok( !ractive.nodes.green.checked ); }); test( 'The model updates to reflect which radio input is checked at render time', function ( t ) { var ractive; ractive = new Ractive({ el: fixture, template: '<input type="radio" name="{{color}}" value="red"><input type="radio" name="{{color}}" value="blue" checked><input type="radio" name="{{color}}" value="green">' }); t.deepEqual( ractive.get( 'color' ), 'blue' ); ractive = new Ractive({ el: fixture, template: '<input type="radio" name="{{color}}" value="red"><input type="radio" name="{{color}}" value="blue"><input type="radio" name="{{color}}" value="green">' }); t.deepEqual( ractive.get( 'color' ), undefined ); }); test( 'The model overrides which radio input is checked at render time', function ( t ) { var ractive; ractive = new Ractive({ el: fixture, template: '<input id="red" type="radio" name="{{color}}" value="red"><input id="blue" type="radio" name="{{color}}" value="blue" checked><input id="green" type="radio" name="{{color}}" value="green">', data: { color: 'green' } }); t.deepEqual( ractive.get( 'color' ), 'green' ); t.ok( !ractive.nodes.red.checked ); t.ok( !ractive.nodes.blue.checked ); t.ok( ractive.nodes.green.checked ); }); test( 'Updating values with properties corresponding to unresolved references works', function ( t ) { var ractive, user; user = {}; ractive = new Ractive({ el: fixture, template: '{{#user}}{{name}}{{/user}}', data: { user: user } }); t.equal( fixture.innerHTML, '' ); user.name = 'Jim'; ractive.update( 'user' ); t.equal( fixture.innerHTML, 'Jim' ); }); test( 'updateModel correctly updates the value of a text input', function ( t ) { var ractive = new Ractive({ el: fixture, template: '<input value="{{name}}">', data: { name: 'Bob' } }); ractive.find( 'input' ).value = 'Jim'; ractive.updateModel( 'name' ); t.equal( ractive.get( 'name' ), 'Jim' ); }); test( 'updateModel correctly updates the value of a select', function ( t ) { var ractive = new Ractive({ el: fixture, template: '<select value="{{selected}}"><option selected value="red">red</option><option value="blue">blue</option><option value="green">green</option></select>' }); t.equal( ractive.get( 'selected' ), 'red' ); ractive.findAll( 'option' )[1].selected = true; ractive.updateModel(); t.equal( ractive.get( 'selected' ), 'blue' ); }); test( 'updateModel correctly updates the value of a multiple select', function ( t ) { var ractive = new Ractive({ el: fixture, template: '<select multiple value="{{selected}}"><option selected value="red">red</option><option value="blue">blue</option><option value="green">green</option></select>' }); t.deepEqual( ractive.get( 'selected' ), [ 'red' ] ); ractive.findAll( 'option' )[1].selected = true; ractive.updateModel(); t.deepEqual( ractive.get( 'selected' ), [ 'red', 'blue' ] ); }); test( 'updateModel correctly updates the value of a textarea', function ( t ) { var ractive = new Ractive({ el: fixture, template: '<textarea value="{{name}}"></textarea>', data: { name: 'Bob' } }); ractive.find( 'textarea' ).value = 'Jim'; ractive.updateModel( 'name' ); t.equal( ractive.get( 'name' ), 'Jim' ); }); test( 'updateModel correctly updates the value of a checkbox', function ( t ) { var ractive = new Ractive({ el: fixture, template: '<input type="checkbox" checked="{{active}}">', data: { active: true } }); ractive.find( 'input' ).checked = false; ractive.updateModel(); t.equal( ractive.get( 'active' ), false ); }); test( 'updateModel correctly updates the value of a radio', function ( t ) { var ractive = new Ractive({ el: fixture, template: '<input type="radio" checked="{{active}}">', data: { active: true } }); ractive.find( 'input' ).checked = false; ractive.updateModel(); t.equal( ractive.get( 'active' ), false ); }); test( 'updateModel correctly updates the value of an indirect (name-value) checkbox', function ( t ) { var ractive = new Ractive({ el: fixture, template: '<input type="checkbox" name="{{colour}}" value="red"><input type="checkbox" name="{{colour}}" value="blue" checked><input type="checkbox" name="{{colour}}" value="green">' }); t.deepEqual( ractive.get( 'colour' ), [ 'blue' ] ); ractive.findAll( 'input' )[2].checked = true; ractive.updateModel(); t.deepEqual( ractive.get( 'colour' ), [ 'blue', 'green' ] ); }); test( 'updateModel correctly updates the value of an indirect (name-value) radio', function ( t ) { var ractive = new Ractive({ el: fixture, template: '<input type="radio" name="{{colour}}" value="red"><input type="radio" name="{{colour}}" value="blue" checked><input type="radio" name="{{colour}}" value="green">' }); t.deepEqual( ractive.get( 'colour' ), 'blue' ); ractive.findAll( 'input' )[2].checked = true; ractive.updateModel(); t.deepEqual( ractive.get( 'colour' ), 'green' ); }); test( 'Setting nested properties with a keypath correctly updates value of intermediate keypaths', function ( t ) { var ractive = new Ractive({ el: fixture, template: '{{#foo}}{{#bar}}{{baz}}{{/bar}}{{/foo}}' }); ractive.set( 'foo.bar.baz', 'success' ); t.htmlEqual( fixture.innerHTML, 'success' ); }); test( 'Functions are called with the ractive instance as context', function ( t ) { expect( 1 ); var ractive = new Ractive({ el: fixture, template: '{{ foo() }}' }); ractive.set( 'foo', function () { t.equal( this, ractive ); }); }); test( 'Methods are called with their object as context', function ( t ) { expect( 1 ); var foo, run, ractive = new Ractive({ el: fixture, template: '{{ foo.bar() }}' }); foo = { bar: function () { // TODO why is this running twice? if ( !run ) { t.equal( this, foo ); } run = true; } }; ractive.set( 'foo', foo ); }); test( 'Partials can contain inline partials', function ( t ) { var partialStr, ractive; partialStr = '<ul>{{#items}}{{>item}}{{/items}}</ul> <!-- {{>item}} --><li>{{.}}</li><!-- {{/item}} -->'; ractive = new Ractive({ el: fixture, template: '{{>list}}', partials: { list: partialStr }, data: { items: [ 'a', 'b', 'c' ] } }); t.htmlEqual( fixture.innerHTML, '<ul><li>a</li><li>b</li><li>c</li></ul>' ); }); test( 'Delimiters can be reset globally', function ( t ) { var oldDelimiters, <API key>, ractive; oldDelimiters = Ractive.defaults.delimiters; <API key> = Ractive.defaults.tripleDelimiters; Ractive.defaults.delimiters = [ '[[', ']]' ]; Ractive.defaults.tripleDelimiters = [ '[[[', ']]]' ]; ractive = new Ractive({ el: fixture, template: '[[foo]] [[[bar]]]', data: { foo: 'text', bar: '<strong>html</strong>' } }); t.htmlEqual( fixture.innerHTML, 'text <strong>html</strong>' ); Ractive.defaults.delimiters = oldDelimiters; Ractive.defaults.tripleDelimiters = <API key>; }); test( 'Teardown works without throwing an error (#205)', function ( t ) { var ractive = new Ractive({ el: fixture, template: 'a {{generic}} template', data: { generic: 'bog standard' } }); expect( 1 ); try { ractive.teardown(); t.ok( 1 ); } catch ( err ) { t.ok( 0 ); } }); test( 'Options added to a select after the initial render will be selected if the value matches', function ( t ) { var ractive, options; ractive = new Ractive({ el: fixture, template: '<select value="{{value_id}}">{{#post_values}}<option value="{{id}}">{{id}} &mdash; {{name}}</option>{{/post_values}}</select>', data: { value_id: 42, values: [ { id: 1, name: "Boo" }, { id: 42, name: "Here 'tis" } ] } }); options = ractive.findAll( 'option', { live: true }); t.ok( !options.length ); ractive.set('post_values', ractive.get('values')); t.equal( options.length, 2 ); t.ok( !options[0].selected ); t.ok( options[1].selected ); }); test( 'Bindings without explicit keypaths can survive a splice operation', function ( t ) { var items, ractive; items = new Array( 3 ); ractive = new Ractive({ el: fixture, template: '<ul>{{#items}}<li><input value="{{foo}}"></li>{{/items}}</ul>', data: { items: items } }); expect( 1 ); items.splice( 1, 1 ); try { items.splice( 1, 1 ); t.ok( 1 ); } catch ( err ) { t.ok( 0 ); } }); test( 'Keypath resolutions that trigger teardowns don\'t cause the universe to implode', function ( t ) { var ractive = new Ractive({ el: fixture, template: '{{^foo}}not foo{{/foo}}{{#foo}}<widget items="{{items}}"/>{{/foo}}', data: { items: [ 1, 2 ] }, components: { widget: Ractive.extend({ template: 'widget' }) } }); expect( 1 ); try { ractive.set( 'foo', true ); t.ok( 1 ); } catch ( err ) { t.ok( 0 ); } }); test( 'Inverted sections aren\'t broken by unshift operations', function ( t ) { var ractive = new Ractive({ el: fixture, template: '{{^items}}no items{{/items}}{{#items}}{{.}}{{/items}}', data: { items: [] } }); t.htmlEqual( fixture.innerHTML, 'no items' ); ractive.get( 'items' ).unshift( 'foo' ); t.htmlEqual( fixture.innerHTML, 'foo' ); }); test( 'Splice operations that try to remove more items than there are from an array are handled', function ( t ) { var ractive = new Ractive({ el: fixture, template: '{{#items}}{{.}}{{/items}}', data: { items: [ 'a', 'b', 'c' ] } }); t.htmlEqual( fixture.innerHTML, 'abc' ); ractive.get( 'items' ).splice( 2, 2 ); t.htmlEqual( fixture.innerHTML, 'ab' ); }); test( 'If an empty select with a binding has options added to it, the model should update', function ( t ) { var ractive = new Ractive({ el: fixture, template: '<select value="{{id}}">{{#items}}<option value="{{id}}">{{text}}</option>{{/items}}</select><strong>Selected: {{id || "nothing"}}</strong>' }); ractive.set('items', [ { id: 1, text: 'one' }, { id: 2, text: 'two' } ]); t.equal( ractive.get( 'id' ), 1 ); t.htmlEqual( fixture.innerHTML, '<select><option value="1">one</option><option value="2">two</option></select><strong>Selected: 1</strong>' ); }); test( 'Partial templates will be drawn from script tags if not already registered', function ( t ) { var partialScr, ractive; partialScr = document.createElement( 'script' ); partialScr.id = 'thePartial'; partialScr.type = 'text/ractive'; partialScr.text = '{{one}}{{two}}{{three}}'; document.<API key>('body')[0].appendChild( partialScr ); ractive = new Ractive({ el: fixture, template: '{{>thePartial}}', data: { one: 1, two: 2, three: 3 } }); t.htmlEqual( fixture.innerHTML, '123' ); }); // ARGH these tests don't work in phantomJS /*test( 'ractive.detach() removes an instance from the DOM and returns a document fragment', function ( t ) { var ractive, p, docFrag; ractive = new Ractive({ el: fixture, template: '<p>{{foo}}</p>', data: { foo: 'whee!' } }); p = ractive.find( 'p' ); docFrag = ractive.detach(); t.ok( docFrag instanceof DocumentFragment ); t.ok( docFrag.contains( p ) ); }); test( 'ractive.detach() works with a previously unrendered ractive', function ( t ) { var ractive, p, docFrag; ractive = new Ractive({ template: '<p>{{foo}}</p>', data: { foo: 'whee!' } }); p = ractive.find( 'p' ); docFrag = ractive.detach(); t.ok( docFrag instanceof DocumentFragment ); t.ok( docFrag.contains( p ) ); });*/ test( 'ractive.insert() moves an instance to a different location', function ( t ) { var ractive, p, one, two, three; one = document.createElement( 'div' ); two = document.createElement( 'div' ); three = document.createElement( 'div' ); three.innerHTML = '<p>before</p><p class="after">after</p>'; ractive = new Ractive({ el: fixture, template: '<p>{{foo}}</p>', data: { foo: 'whee!' } }); p = ractive.find( 'p' ); ractive.insert( one ); t.ok( one.contains( p ) ); ractive.insert( two ); t.ok( !one.contains( p ) ); t.ok( two.contains( p ) ); ractive.insert( three, three.querySelector( '.after' ) ); t.ok( three.contains( p ) ); t.htmlEqual( three.innerHTML, '<p>before</p><p>whee!</p><p class="after">after</p>' ); }); test( 'Regression test for #271', function ( t ) { var ractive, items; items = [{}]; ractive = new Ractive({ el: fixture, template: '{{#items}}<p>foo</p>{{# items.length > 1 }}<p>bar</p>{{/}}{{/items}}', data: { items: items } }); t.htmlEqual( fixture.innerHTML, '<p>foo</p>' ); try { items.push({}); t.htmlEqual( fixture.innerHTML, '<p>foo</p><p>bar</p><p>foo</p><p>bar</p>' ); items.push({}); t.htmlEqual( fixture.innerHTML, '<p>foo</p><p>bar</p><p>foo</p><p>bar</p><p>foo</p><p>bar</p>' ); items.splice( 1, 1 ); t.htmlEqual( fixture.innerHTML, '<p>foo</p><p>bar</p><p>foo</p><p>bar</p>' ); items.splice( 1, 1 ); t.htmlEqual( fixture.innerHTML, '<p>foo</p>' ); } catch ( err ) { t.ok( false ); } }); test( 'Regression test for #297', function ( t ) { var ractive, items; items = [ 'one', 'two', 'three' ]; ractive = new Ractive({ el: fixture, template: '{{#items}}{{>item}}{{/items}}', data: { items: items }, partials: { item: '<p>{{.}}</p>' } }); t.htmlEqual( fixture.innerHTML, '<p>one</p><p>two</p><p>three</p>' ); items.splice( 1, 1 ); t.htmlEqual( fixture.innerHTML, '<p>one</p><p>three</p>' ); }); test( 'Regression test for #316', function ( t ) { var ractive, a, b; a = []; b = []; ractive = new Ractive({ el: fixture, template: '{{ a.length ? "foo" : b.length ? "bar" : "baz" }}', data: { a: a, b: b } }); t.htmlEqual( fixture.innerHTML, 'baz' ); b.push( 1 ); t.htmlEqual( fixture.innerHTML, 'bar' ); a.push( 1 ); t.htmlEqual( fixture.innerHTML, 'foo' ); }); test( 'Regression test for #321', function ( t ) { var ractive, buttons, expected; ractive = new Ractive({ el: fixture, template: '<button on-click=\'test:{{ ["just a string"] }}\'>test 1</button><button on-click=\'test:{{ {bar: 3} }}\'>test 2</button>' }); ractive.on( 'test', function ( event, arg ) { t.deepEqual( arg, expected ); }); expect( 2 ); buttons = ractive.findAll( 'button' ); expected = ['just a string']; simulant.fire( buttons[0], 'click' ); expected = { bar: 3 }; simulant.fire( buttons[1], 'click' ); }); test( 'Regression test for #339', function ( t ) { var ractive, selects; ractive = new Ractive({ el: fixture, template: '{{#items:i}}<p>{{i}}: <select value="{{.color}}"><option value="red">Red</option></select></p>{{/items}}', data: { items: [{}] } }); selects = ractive.findAll( 'select', { live: true }); t.equal( selects[0].value, 'red' ); ractive.get( 'items' ).push({}); t.htmlEqual( fixture.innerHTML, '<p>0: <select><option value="red">Red</option></select></p><p>1: <select><option value="red">Red</option></select></p>') t.deepEqual( ractive.get(), { items: [ {color: 'red'}, {color: 'red'} ] } ); }); test( 'Evaluators that have a value of undefined behave correctly', function ( t ) { var ractive = new Ractive({ el: fixture, template: '{{ list[index] }}', data: { index: 0, list: [ 'foo' ] } }); t.htmlEqual( fixture.innerHTML, 'foo' ); ractive.set( 'index', 1 ); t.htmlEqual( fixture.innerHTML, '' ); }); test( 'Components inherit adaptors from their parent', function ( t ) { var ractive; Ractive.components.widget = Ractive.extend({ template: '<p>{{wrappedThing}}</p>' }); ractive = new Ractive({ el: fixture, template: '<widget wrappedThing="{{thing}}"/>', adapt: [ 'foo' ], data: { thing: new Foo( 'whee!' ) } }); t.htmlEqual( fixture.innerHTML, '<p>whee!</p>' ); }); test( 'Components made with Ractive.extend() can include adaptors', function ( t ) { var Widget, ractive; Widget = Ractive.extend({ adapt: [ 'foo' ] }); ractive = new Widget({ el: fixture, template: '<p>{{thing}}</p>', data: { thing: new Foo( 'whee!' ) } }); t.deepEqual( ractive.adapt, [ Ractive.adaptors.foo ] ); t.htmlEqual( fixture.innerHTML, '<p>whee!</p>' ); }); test( 'Two-way binding can be set up against expressions that resolve to regular keypaths', function ( t ) { var ractive, input; ractive = new Ractive({ el: fixture, template: '{{#items:i}}<label><input value="{{ proxies[i].name }}"> name: {{ proxies[i].name }}</label>{{/items}}', data: { items: [{}], proxies: [] } }); input = ractive.find( 'input' ); input.value = 'foo'; ractive.updateModel(); t.deepEqual( ractive.get( 'proxies' ), [{name: 'foo' }] ); t.htmlEqual( fixture.innerHTML, '<label><input> name: foo</label>' ); }); test( 'Instances of a subclass do not have access to the default model', function ( t ) { var Subclass, instance; Subclass = Ractive.extend({ data: { foo: 'bar', obj: { one: 1, two: 2 } } }); instance = new Subclass({ el: fixture, template: '{{foo}}{{obj.one}}{{obj.two}}' }); t.htmlEqual( fixture.innerHTML, 'bar12' ); instance.set( 'foo', 'baz' ); instance.set( 'obj.one', 3 ); instance.set( 'obj.two', 4 ); t.htmlEqual( fixture.innerHTML, 'baz34' ); t.deepEqual( Subclass.data, { foo: 'bar', obj: { one: 1, two: 2 } }); }); test( 'Instances of subclasses with non-POJO default models have the correct prototype', function ( t ) { var Model, Subclass, instance; Model = function ( data ) { var key; for ( key in data ) { if ( data.hasOwnProperty( key ) ) { this[ key ] = data[ key ]; } } }; Model.prototype.test = function () { t.ok( true ); }; Subclass = Ractive.extend({ data: new Model({ foo: 'bar' }) }); instance = new Subclass({ el: fixture, template: '{{foo}}{{bar}}', data: { bar: 'baz' } }); t.ok( instance.data instanceof Model ); }); test( 'Regression test for #351', function ( t ) { var ractive = new Ractive({ el: fixture, template: '<select value="{{selected}}" multiple>{{#items}}<option value="{{id}}">{{name}}</option>{{/items}}</select>' }); ractive.set( 'items', [{name:'one', id:1}, {name:'two', id:2}]); t.htmlEqual( fixture.innerHTML, '<select multiple><option value="1">one</option><option value="2">two</option></select>' ); }); asyncTest( 'Subclass instance complete() handlers can call _super', function ( t ) { var Subclass, instance; expect( 1 ); Subclass = Ractive.extend({ complete: function () { return 42; } }); instance = new Subclass({ complete: function () { t.equal( this._super(), 42 ); start(); } }); }); test( 'A string can be supplied instead of an array for the `adapt` option (if there\'s only one adaptor listed', function ( t ) { var Subclass, instance; Subclass = Ractive.extend({ adapt: 'Foo' }); instance = new Subclass(); t.deepEqual( instance.adapt, ['Foo'] ); }); test( 'Regression test for #393', function ( t ) { var View, ractive; View = Ractive.extend({ data: { foo: { a: 1, b: 2 }, bar: [ 'a', 'b', 'c' ] } }); ractive = new View({ el: fixture, template: '{{ JSON.stringify(foo) }} | {{ JSON.stringify(bar) }}' }); t.htmlEqual( fixture.innerHTML, '{"a":1,"b":2} | ["a","b","c"]' ); ractive.set( 'foo.b', 3 ); t.deepEqual( View.data, {foo:{a:1,b:2},bar:['a', 'b', 'c']}); t.htmlEqual( fixture.innerHTML, '{"a":1,"b":3} | ["a","b","c"]' ); ractive.set( 'bar[1]', 'd' ); t.deepEqual( View.data, {foo:{a:1,b:2},bar:['a', 'b', 'c']}); t.htmlEqual( fixture.innerHTML, '{"a":1,"b":3} | ["a","d","c"]' ); }); test( 'ractive.insert() with triples doesn\'t invoke Yoda (#391)', function ( t ) { var ractive = new Ractive({ el: document.createElement( 'div' ), template: '{{{value}}}', data: { 'value': ' you are <i>very puzzled now</i>' } }); ractive.insert( fixture ); t.htmlEqual( fixture.innerHTML, ' you are <i>very puzzled now</i>' ); }); test( '<input value="{{foo}}"> where foo === null should not render a value (#390)', function ( t ) { var ractive = new Ractive({ el: fixture, template: '<input value="{{foo}}">', data: { foo: null } }); t.equal( ractive.find( 'input' ).value, '' ); }); // only run these tests if magic mode is supported try { var obj = {}, _foo; Object.defineProperty( obj, 'foo', { get: function () { return _foo; }, set: function ( value ) { _foo = value; } }); test( 'Array mutators work when `magic` is `true` (#376)', function ( t ) { var ractive, items; items = [ { name: 'one' }, { name: 'two' }, { name: 'three' } ]; ractive = new Ractive({ el: fixture, template: '{{#items}}{{name}}{{/items}}', magic: true, data: { items: items } }); ractive.data.items.push({ name: 'four' }); t.htmlEqual( fixture.innerHTML, 'onetwothreefour' ); }); test( 'Implicit iterators work in magic mode', function ( t ) { var ractive, items; items = [ { name: 'one' }, { name: 'two' }, { name: 'three' } ]; ractive = new Ractive({ el: fixture, template: '{{#.}}{{name}}{{/.}}', magic: true, data: items }); t.htmlEqual( fixture.innerHTML, 'onetwothree' ); ractive.data[2].name = 'threefourfive'; t.htmlEqual( fixture.innerHTML, 'onetwothreefourfive' ); }); obj.foo = 'bar'; } catch ( err ) { // do nothing } test( 'Foo.extend(Bar), where both Foo and Bar are Ractive instances, returns on object that inherits from Foo and Bar', function ( t ) { var Human, Spider, Spiderman, spiderman; Human = Ractive.extend({ template: '<p>type: {{type}}</p>', talk: function () { return 'hello'; } }); Spider = Ractive.extend({ // registries data: { type: 'arachnid' }, // defaults lazy: true, // methods climb: function () { return 'climbing'; }, talk: function () { return this._super() + ' my name is Peter Parker'; } }); Spiderman = Human.extend( Spider ); spiderman = new Spiderman({ el: fixture }); t.htmlEqual( fixture.innerHTML, '<p>type: arachnid</p>' ); t.ok( spiderman.lazy ); t.equal( spiderman.climb(), 'climbing' ); t.equal( spiderman.talk(), 'hello my name is Peter Parker' ); }); test( 'Regression test for #460', function ( t ) { var items, ractive, baz; items = [ { desc: 'foo' }, { desc: 'bar' }, { desc: 'baz' } ] ractive = new Ractive({ el: fixture, template: '{{#items}}<p>{{desc}}:{{missing[data]}}</p>{{/items}}', data: { items: items } }); baz = items.pop(); t.htmlEqual( fixture.innerHTML, '<p>foo:</p><p>bar:</p>' ); items.push( baz ); t.htmlEqual( fixture.innerHTML, '<p>foo:</p><p>bar:</p><p>baz:</p>' ); }); test( 'Regression test for #457', function ( t ) { var ractive = new Ractive({ el: fixture, template: '{{#step.current == step.current}}<p>{{foo}}</p>{{/step.current == step.current}}' }); ractive.set({ "foo": "bar", "step": { "current": 2 } }); t.ok( true ); }); test( 'Triples work inside SVG elements', function ( t ) { var text, ractive = new Ractive({ el: document.createElementNS( 'http: template: '{{{code}}}', data: { code: '<text>works</text>' } }); text = ractive.find( 'text' ); t.ok( !!text ); t.equal( text.namespaceURI, 'http: }); // These tests run fine in the browser but not in PhantomJS. WTF I don't even. // Anyway I can't be bothered to figure it out right now so I'm just commenting // these out so it will build /*test( 'Components with two-way bindings set parent values on initialisation', function ( t ) { var Dropdown, ractive; Dropdown = Ractive.extend({ template: '<select value="{{value}}">{{#options}}<option value="{{this}}">{{ this[ display ] }}</option>{{/options}}</select>' }); ractive = new Ractive({ el: fixture, template: '<h2>Select an option:</h2><dropdown options="{{numbers}}" value="{{number}}" display="word"/><p>Selected: {{number.digit}}</p>', data: { numbers: [ { word: 'one', digit: 1 }, { word: 'two', digit: 2 }, { word: 'three', digit: 3 }, { word: 'four', digit: 4 } ] }, components: { dropdown: Dropdown } }); t.deepEqual( ractive.get( 'number' ), { word: 'one', digit: 1 }); }); { name: 'Tearing down expression mustaches and recreating them does\'t throw errors', test: function () { var ractive; ractive = new Ractive({ el: fixture, template: '{{#condition}}{{( a+b )}} {{( a+b )}} {{( a+b )}}{{/condition}}', data: { a: 1, b: 2, condition: true } }); equal( fixture.innerHTML, '3 3 3' ); ractive.set( 'condition', false ); equal( fixture.innerHTML, '' ); ractive.set( 'condition', true ); equal( fixture.innerHTML, '3 3 3' ); } }, { name: 'Updating an expression section doesn\'t throw errors', test: function () { var ractive, array; array = [{ foo: 1 }, { foo: 2 }, { foo: 3 }, { foo: 4 }, { foo: 5 }]; ractive = new Ractive({ el: fixture, template: '{{#( array.slice( 0, 3 ) )}}{{foo}}{{/()}}', data: { array: array } }); equal( fixture.innerHTML, '123' ); array.push({ foo: 6 }); equal( fixture.innerHTML, '123' ); array.unshift({ foo: 0 }); equal( fixture.innerHTML, '012' ); ractive.set( 'array', [] ); equal( array._ractive, undefined ); equal( fixture.innerHTML, '' ); ractive.set( 'array', array ); ok( array._ractive ); equal( fixture.innerHTML, '012' ); } }, { name: 'Updating a list section with child list expressions doesn\'t throw errors', test: function () { var ractive, array; array = [ { foo: [ 1, 2, 3, 4, 5 ] }, { foo: [ 2, 3, 4, 5, 6 ] }, { foo: [ 3, 4, 5, 6, 7 ] }, { foo: [ 4, 5, 6, 7, 8 ] }, { foo: [ 5, 6, 7, 8, 9 ] } ]; ractive = new Ractive({ el: fixture, template: '{{#array}}<p>{{#( foo.slice( 0, 3 ) )}}{{.}}{{/()}}</p>{{/array}}', data: { array: array } }); equal( fixture.innerHTML, '<p>123</p><p>234</p><p>345</p><p>456</p><p>567</p>' ); array.push({ foo: [ 6, 7, 8, 9, 10 ] }); equal( fixture.innerHTML, '<p>123</p><p>234</p><p>345</p><p>456</p><p>567</p><p>678</p>' ); array.unshift({ foo: [ 0, 1, 2, 3, 4 ] }); equal( fixture.innerHTML, '<p>012</p><p>123</p><p>234</p><p>345</p><p>456</p><p>567</p><p>678</p>' ); ractive.set( 'array', [] ); equal( array._ractive, undefined ); equal( fixture.innerHTML, '' ); ractive.set( 'array', array ); ok( array._ractive ); equal( fixture.innerHTML, '<p>012</p><p>123</p><p>234</p><p>345</p><p>456</p><p>567</p><p>678</p>' ); } }*/ }; });
@import url('http://fonts.googleapis.com/css?family=Open+Sans'); a { color: #7F3734; text-decoration: none; transition: color 0.25s; } a:hover { color: #FFCC5C; } body { /* structure */ margin: 0 auto; padding: 1em; min-height: 100%; width: 80%; /* presentation */ font-family: 'Open Sans', sans-serif; } html { /* structure */ height: 100%; /* presentation */ background-color: #F8FFF2; } h1 { color: #00968B; } caption img { width: 2em; margin-right: 2em; } .order-form-customer { /* structure */ padding: 1em 0; /* presentation */ text-align: right; border-bottom: 2px solid grey; } .standard-table { border-collapse: collapse; width: 100%; } .standard-table caption { /* structure */ padding: 0.5em 0; /* presentation */ font-size: 1.5em; font-weight: bold; text-align: center; } .standard-table tbody tr { transition: background-color 0.25s; } .standard-table tbody tr:nth-child(even), .standard-table tfoot tr:nth-child(even) { background-color: #DFE5DA; } .standard-table tbody tr:nth-child(odd), .standard-table tfoot tr:nth-child(odd) { background-color: #BABFB5; } .standard-table tbody tr:hover { background-color: #998882; cursor: default; } .standard-table td, .standard-table th { padding: 0.25em 0.5em; } .standard-table th { color: #00968B; } .standard-table tfoot tr, .standard-table thead tr { text-align: left; } .standard-table tfoot tr, .standard-table .money-column { text-align: right; }
// SAMMeViewController.h // niceSports #import <UIKit/UIKit.h> @interface SAMMeViewController : UIViewController @end
// <auto-generated> // Dieser Code wurde von einem Tool generiert. // der Code erneut generiert wird. // </auto-generated> namespace OutlookExamplesCS4.Properties { [global::System.Runtime.CompilerServices.<API key>()] [global::System.CodeDom.Compiler.<API key>("Microsoft.VisualStudio.Editors.SettingsDesigner.<API key>", "10.0.0.0")] internal sealed partial class Settings : global::System.Configuration.<API key> { private static Settings defaultInstance = ((Settings)(global::System.Configuration.<API key>.Synchronized(new Settings()))); public static Settings Default { get { return defaultInstance; } } } }
/** * A 'Toast' is a simple modal message that is displayed on the screen and then automatically closed by a timeout or by a user tapping * outside of the toast itself. Think about it like a text only alert box that will self destruct. **A Toast should not be instantiated manually** * but creating by calling 'Ext.toast(message, timeout)'. This will create one reusable toast container and content will be swapped out as * toast messages are queued or displayed. * * # Simple Toast * * @example miniphone * Ext.toast('Hello Sencha!'); // Toast will close in 1000 milliseconds (default) * * # Toast with Timeout * * @example miniphone * Ext.toast('Hello Sencha!', 5000); // Toast will close in 5000 milliseconds * * # Toast with config * * @example miniphone * Ext.toast({message: 'Hello Sencha!', timeout: 2000}); // Toast will close in 2000 milliseconds * * # Multiple Toasts queued * * @example miniphone * Ext.toast('Hello Sencha!'); * Ext.toast('Hello Sencha Again!'); * Ext.toast('Hello Sencha One More Time!'); */ Ext.define('Ext.Toast', { extend: 'Ext.Sheet', requires: [ 'Ext.util.InputBlocker' ], config: { /** * @cfg * @inheritdoc */ ui: 'dark', /** * @cfg * @inheritdoc */ baseCls: Ext.baseCSSPrefix + 'toast', /** * @cfg * @inheritdoc */ showAnimation: { type: 'popIn', duration: 250, easing: 'ease-out' }, /** * @cfg * @inheritdoc */ hideAnimation: { type: 'popOut', duration: 250, easing: 'ease-out' }, /** * Override the default `zIndex` so it is normally always above floating components. */ zIndex: 999, /** * @cfg {String} message * The message to be displayed in the {@link Ext.Toast}. * @accessor */ message: null, /** * @cfg {Number} timeout * The amount of time in milliseconds to wait before destroying the toast automatically */ timeout: 1000, /** * @cfg{Boolean/Object} animation * The animation that should be used between toast messages when they are queued up */ messageAnimation: true, /** * @cfg * @inheritdoc */ hideOnMaskTap: true, /** * @private */ modal: true, /** * @cfg * @inheritdoc */ layout: { type: 'vbox', pack: 'center' } }, /** * @private */ applyMessage: function(config) { config = { html: config, cls: this.getBaseCls() + '-text' }; return Ext.factory(config, Ext.Component, this._message); }, /** * @private */ updateMessage: function(newMessage) { if (newMessage) { this.add(newMessage); } }, /** * @private */ applyTimeout: function(timeout) { if (this._timeoutID) { clearTimeout(this._timeoutID); if (!Ext.isEmpty(timeout)) { this._timeoutID = setTimeout(Ext.bind(this.onTimeout, this), timeout); } } return timeout; }, /** * @private */ next: Ext.emptyFn, /** * @private */ show: function(config) { var me = this, timeout = config.timeout, msgAnimation = me.getMessageAnimation(), message = me.getMessage(); if (me.isRendered() && me.isHidden() === false) { config.timeout = null; message.onAfter({ hiddenchange: function() { me.setMessage(config.message); message = me.getMessage(); message.onAfter({ hiddenchange: function() { // Forces applyTimeout to create a timer this._timeoutID = true; me.setTimeout(timeout); }, scope: me, single: true }); message.show(msgAnimation); }, scope: me, single: true }); message.hide(msgAnimation); } else { Ext.util.InputBlocker.blockInputs(); me.setConfig(config); //if it has not been added to a container, add it to the Viewport. if (!me.getParent() && Ext.Viewport) { Ext.Viewport.add(me); } if (!Ext.isEmpty(timeout)) { me._timeoutID = setTimeout(Ext.bind(me.onTimeout, me), timeout); } me.callParent(arguments); } }, /** * @private */ hide: function(animation) { clearTimeout(this._timeoutID); if (!this.next()) { this.callParent(arguments); } }, /** * @private */ onTimeout: function() { this.hide(); } }, function(Toast) { var _queue = [], _isToasting = false; function next() { var config = _queue.shift(); if (config) { _isToasting = true; this.show(config); } else { _isToasting = false; } return _isToasting; } function getInstance() { if (!Ext.Toast._instance) { Ext.Toast._instance = Ext.create('Ext.Toast'); Ext.Toast._instance.next = next; } return Ext.Toast._instance; } Ext.toast = function(message, timeout) { var toast = getInstance(), config = message; if (Ext.isString(message)) { config = { message: message, timeout: timeout }; } if (config.timeout === undefined) { config.timeout = Ext.Toast.prototype.config.timeout; } _queue.push(config); if (!_isToasting) { toast.next(); } return toast; } });
using SAHB.GraphQL.Client.Introspection.Validation; using SAHB.GraphQL.Client.Testserver.Tests.Schemas.CatOrDog; using SAHB.GraphQL.Client.TestServer; using SAHB.GraphQLClient; using SAHB.GraphQLClient.FieldBuilder; using SAHB.GraphQLClient.FieldBuilder.Attributes; using SAHB.GraphQLClient.Introspection; using System.Linq; using System.Threading.Tasks; using Xunit; namespace SAHB.GraphQL.Client.Introspection.Tests.Interface { public class <API key> : IClassFixture<<API key><<API key>>> { private readonly <API key><<API key>> _factory; public <API key>(<API key><<API key>> factory) { _factory = factory; } [Fact] public async Task Validate_IsValid() { // Arrange var client = _factory.CreateClient(); var graphQLClient = GraphQLHttpClient.Default(client); // Act var introspectionQuery = await graphQLClient.CreateQuery<<API key>>("http://localhost/graphql").Execute(); var validationOutput = introspectionQuery.ValidateGraphQLType<TestHelloInterface>(<API key>.Query); // Assert Assert.Empty(validationOutput); } [Fact] public async Task <API key>() { // Arrange var client = _factory.CreateClient(); var graphQLClient = GraphQLHttpClient.Default(client); // Act var introspectionQuery = await graphQLClient.CreateQuery<<API key>>("http://localhost/graphql").Execute(); var validationOutput = introspectionQuery.ValidateGraphQLType<<API key>>(<API key>.Query); // Assert Assert.Single(validationOutput); Assert.Equal(ValidationType.<API key>, validationOutput.First().ValidationType); } private class TestHelloInterface { public ICatOrDogType Cat { get; set; } public ICatOrDogType Dog { get; set; } } private class <API key> { public <API key> Cat { get; set; } } [<API key>("Cat", typeof(CatType))] [<API key>("Dog", typeof(DogType))] private interface ICatOrDogType { int Number { get; set; } } [<API key>("Cat", typeof(CatType))] [<API key>("Dog", typeof(DogType))] [<API key>("Horse", typeof(HorseType))] private interface <API key> { int Number { get; set; } } private class CatType : ICatOrDogType { public string Cat { get; set; } public int Number { get; set; } } private class DogType : ICatOrDogType { public string Dog { get; set; } public int Number { get; set; } } private class HorseType : ICatOrDogType { public string Horse { get; set; } public int Number { get; set; } } } }
<?php namespace AppBundle\Command; use AppBundle\Entity\Provider; use AppBundle\Entity\Service; use Symfony\Bundle\FrameworkBundle\Command\<API key>; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class FixturesCommand extends <API key> { protected function configure() { $this ->setName('app:fixtures') ->setDescription('Load fixture data used by Dredd'); } protected function execute(InputInterface $input, OutputInterface $output) { $this->addServices($output); $this->addProviders($output); $output->writeln("Fixtures Created"); } private function addServices() { $doctrine = $this->getContainer()->get('doctrine'); $manager = $doctrine->getManager(); $cmd = $manager->getClassMetadata('AppBundle\\Entity\\Service'); $connection = $manager->getConnection(); $connection->beginTransaction(); try { $connection->query('SET FOREIGN_KEY_CHECKS=0'); $connection->query('DELETE FROM ' . $cmd->getTableName()); $connection->query('DELETE FROM service_stage'); $connection->query('DELETE FROM service_issue'); $connection->query('DELETE FROM service_provider'); $connection->query('DELETE FROM service_category'); $connection->query('DELETE FROM <API key>'); $connection->query('ALTER TABLE ' . $cmd->getTableName() . ' AUTO_INCREMENT = 1'); // Beware of ALTER TABLE here--it's another DDL statement and will cause // an implicit commit. $connection->query('SET FOREIGN_KEY_CHECKS=1'); $connection->commit(); } catch (\Exception $e) { $connection->rollback(); } $service = new Service(); $service->setName("My Service"); $service->setDescription("This is a service"); $service->setDataMaintainer("me"); $service->setEndDate(new \DateTime("2018-01-01T00:00:00+0000")); $service->addCategory($manager->getRepository('AppBundle\\Entity\\Category')->find(1)); $service->addStage($manager->getRepository('AppBundle\\Entity\\Stage')->find(1)); $service->addStage($manager->getRepository('AppBundle\\Entity\\Stage')->find(2)); $service->addProvider($manager->getRepository('AppBundle\\Entity\\Provider')->find(1)); $service->addProvider($manager->getRepository('AppBundle\\Entity\\Provider')->find(2)); $service->addServiceUser($manager->getRepository('AppBundle\\Entity\\ServiceUser')->find(2)); $service->addServiceUser($manager->getRepository('AppBundle\\Entity\\ServiceUser')->find(3)); $service->addIssue($manager->getRepository('AppBundle\\Entity\\Issue')->find(2)); $manager->persist($service); $service2 = new Service(); $service2->setName("Another Service"); $service2->setDescription("This is a another service"); $service2->setDataMaintainer("someone else"); $service2->setEndDate(new \DateTime("2018-01-01T00:00:00+0000")); $service2->addCategory($manager->getRepository('AppBundle\\Entity\\Category')->find(6)); $service2->addCategory($manager->getRepository('AppBundle\\Entity\\Category')->find(7)); $service2->addStage($manager->getRepository('AppBundle\\Entity\\Stage')->find(3)); $service2->addProvider($manager->getRepository('AppBundle\\Entity\\Provider')->find(2)); $service2->addServiceUser($manager->getRepository('AppBundle\\Entity\\ServiceUser')->find(1)); $service2->addIssue($manager->getRepository('AppBundle\\Entity\\Issue')->find(3)); $manager->persist($service2); $manager->flush(); } private function addProviders() { $doctrine = $this->getContainer()->get('doctrine'); $manager = $doctrine->getManager(); $cmd = $manager->getClassMetadata('AppBundle\\Entity\\Provider'); $connection = $manager->getConnection(); $connection->beginTransaction(); try { $connection->query('SET FOREIGN_KEY_CHECKS=0'); $connection->query('DELETE FROM ' . $cmd->getTableName()); $connection->query('ALTER TABLE ' . $cmd->getTableName() . ' AUTO_INCREMENT = 1'); // Beware of ALTER TABLE here--it's another DDL statement and will cause // an implicit commit. $connection->query('SET FOREIGN_KEY_CHECKS=1'); $connection->commit(); } catch (\Exception $e) { $connection->rollback(); } $provider = new Provider(); $provider->setName("A provider"); $provider->setDescription("This is a Provider"); $provider->setPhone("0114 2222222"); $provider->setEmail("jeff@example.com"); $provider->setWebsite("http: $provider->setContactName("Jeff Bdager"); $provider->setAddress("Badger House"); $provider->setPostcode("S1 2NS"); $manager->persist($provider); $provider = new Provider(); $provider->setName("Another provider"); $provider->setDescription("This is another Provider"); $provider->setPhone("0114 11111111"); $provider->setEmail("barry@example.com"); $provider->setWebsite("http: $provider->setContactName("Barry Bdager"); $provider->setAddress("Badger Tower"); $provider->setPostcode("S11 8QD"); $manager->persist($provider); $manager->flush(); } }
<!DOCTYPE html> <html> <head> <title>Login - SIMAS - Sistem Manajemen Surat</title> <!-- Meta --> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <!-- Favicon --> <link rel="<API key>" sizes="57x57" href="/res/<API key>.png" /> <link rel="<API key>" sizes="114x114" href="/res/<API key>.png" /> <link rel="<API key>" sizes="72x72" href="/res/<API key>.png" /> <link rel="<API key>" sizes="144x144" href="/res/<API key>.png" /> <link rel="<API key>" sizes="120x120" href="/res/<API key>.png" /> <link rel="<API key>" sizes="152x152" href="/res/<API key>.png" /> <link rel="icon" type="image/png" href="/res/favicon-32x32.png" sizes="32x32" /> <link rel="icon" type="image/png" href="/res/favicon-16x16.png" sizes="16x16" /> <!-- Stylesheet --> <link rel="stylesheet" href="/style/css/perfect-scrollbar.css"> <link rel="stylesheet" href="/style/css/source-sans-pro.css"> <link rel="stylesheet" href="/style/css/font-awesome.css"> <link rel="stylesheet" href="/style/css/stylesheet.css"> <!-- Javascript --> <script src="/style/js/vue.js"></script> <script src="/style/js/axios.js"></script> <script src="/style/js/moment.js"></script> <script src="/style/js/js-cookie.js"></script> <script src="/style/js/perfect-scrollbar.js"></script> </head> <body> <div id="app" class="login" style="display: none"> <div id="container"> <div id="header"> <img src="/res/logo.svg"> <p>Sistem Manajemen Surat</p> </div> <div id="content"> <p class="error-message" v-if="error.visible">{{error.message}}</p> <div class="field"> <label><i class="fa fa-fw fa-user" aria-hidden="true"></i></label> <input id="username" name="username" tabindex="1" v-model.trim="email" type="text" placeholder="Email" autofocus> </div> <div class="field"> <label><i class="fa fa-fw fa-lock" aria-hidden="true"></i></label> <input id="password" name="password" tabindex="2" v-model.trim="password" type="password" @keyup.enter="submitLogin" placeholder="Password" autocomplete="on"> </div> <a id="btn-login" :class="{loading: loading}" @click="submitLogin" @keyup.enter="submitLogin" tabindex="3">Masuk<i class="fa fa-sign-in" aria-hidden="true"></i></a> <div class="field-setting"> <div class="check-area"> <input tabindex="4" id="chk-remember" v-model="remember" type="checkbox"> <label for="chk-remember">Ingat saya</label> </div> <div class="spacer"></div> <a tabindex="5">Lupa password</a> </div> </div> </div> </div> <script> var app = new Vue({ el: '#app', data: { email: '', password: '', remember: false, loading: false, error: { visible: false, message: '' } }, methods: { submitLogin: function() { // If still loading, stop if (this.loading) return; // Hide error this.error.visible = false; // Check if username and password empty if (this.email === '' || this.password === '') { this.error.visible = true; this.error.message = 'Email dan password harus diisi'; return; } // Send login request this.loading = true; axios.post('/api/login', { email: this.email, password: this.password, remember: this.remember }) .then(function(response) { var expiration, token = response.data.token, account = response.data.account; if (app.remember) { expiration = moment().endOf('day'); localStorage.setItem('account', JSON.stringify(account)); } else { expiration = moment().add(2, 'h'); sessionStorage.setItem('account', JSON.stringify(account)); } Cookies.set('token', token, { expires: expiration.toDate() }); location.href = '/'; }) .catch(function(error) { var message; if (error.response) message = error.response.data; else message = error.message; app.loading = false; app.error.visible = true; app.error.message = message; return; }); } } }); document.getElementById('app').removeAttribute('style'); </script> </body> </html>
# Definition for a point. # class Point(object): # def __init__(self, a=0, b=0): # self.x = a # self.y = b class Solution(object): def maxPoints(self, points): """ :type points: List[Point] :rtype: int """ lines = {} n = len(points) if n == 0: return 0 if n == 1: return 1 for i in range(n): for j in range(0, i): li = line(points[i], points[j]) if li in lines: lines[li].add(i) lines[li].add(j) else: lines[li] = {j, i} maxl = max(lines, key=lambda l:len(lines[l])) return len(lines[maxl]) def line(p0, p1): a = p0.y - p1.y b = p1.x - p0.x # test case a==b==0 if a == b == 0: return (p0.x, p0.y) rev = -1 if (a < 0 or (a == 0 and b < 0)) else 1 rev /= (a**2 + b**2)**0.5 a *= rev b *= rev c = a*p0.x + b*p0.y # almost equal prec = lambda x: float('%.12f' % x) a = prec(a) b = prec(b) c = prec(c) return (a, b, c)
<?php declare(strict_types=1); namespace App\Controller; use Payum\Bundle\PayumBundle\Controller\AuthorizeController as <API key>; class AuthorizeController extends <API key> implements <API key> { }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>unicoq: Not compatible </title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file: <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif] </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.12.0 / unicoq - 1.3+8.8</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> unicoq <small> 1.3+8.8 <span class="label label-info">Not compatible </span> </small> </h1> <p> <em><script>document.write(moment("2021-11-26 21:48:02 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-11-26 21:48:02 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils coq 8.12.0 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.08.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.08.1 Official release 4.08.1 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;matthieu.sozeau@inria.fr&quot; authors: [ &quot;Matthieu Sozeau &lt;matthieu.sozeau@inria.fr&gt;&quot; &quot;Beta Ziliani &lt;beta@mpi-sws.org&gt;&quot; ] dev-repo: &quot;git+https://github.com/unicoq/unicoq.git&quot; homepage: &quot;https://github.com/unicoq/unicoq&quot; bug-reports: &quot;https://github.com/unicoq/unicoq/issues&quot; license: &quot;MIT&quot; build: [ [&quot;coq_makefile&quot; &quot;-f&quot; &quot;Make&quot; &quot;-o&quot; &quot;Makefile&quot;] [make &quot;-j%{jobs}%&quot;] ] install: [ [make &quot;install&quot;] ] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.8.0&quot; &amp; &lt; &quot;8.9~&quot;} ] synopsis: &quot;An enhanced unification algorithm for Coq&quot; url { src: &quot;https://github.com/unicoq/unicoq/archive/v1.3-8.8.tar.gz&quot; checksum: &quot;md5=<API key>&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install </h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-unicoq.1.3+8.8 coq.8.12.0</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.12.0). The following dependencies couldn&#39;t be met: - coq-unicoq -&gt; coq &lt; 8.9~ -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-unicoq.1.3+8.8</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install </h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https: </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
package logdb import ( "bytes" "compress/flate" "compress/lzw" "errors" "io/ioutil" ) // A CompressingDB wraps a 'LogDB' with functions to compress and decompress entries, applied transparently // during 'Append', 'AppendEntries', and 'Get'. type CompressingDB struct { LogDB Compress func([]byte) ([]byte, error) Decompress func([]byte) ([]byte, error) } // Append implements the 'LogDB' interface. If the underlying 'LogDB' is also a 'PersistDB', 'BoundedDB', or // 'CloseDB' then those interfaces are also implemented. // With 'BoundedDB' the bounded entry size is that of the compressed byte array; so it may be possible to // insert entries which are larger than the bound. func (db *CompressingDB) Append(entry []byte) (uint64, error) { return db.AppendEntries([][]byte{entry}) } // AppendEntries implements the 'LogDB' interface. If the underlying 'LogDB' is also a 'PersistDB', // 'BoundedDB', or 'CloseDB' then those interfaces are also implemented. // With 'BoundedDB' the bounded entry size is that of the compressed byte array; so it may be possible to // insert entries which are larger than the bound. func (db *CompressingDB) AppendEntries(entries [][]byte) (uint64, error) { compressedEntries := make([][]byte, len(entries)) for i, entry := range entries { compressed, err := db.Compress(entry) if err != nil { return 0, err } compressedEntries[i] = compressed } return db.LogDB.AppendEntries(compressedEntries) } // Get implements the 'LogDB' interface. If the underlying 'LogDB; is also a 'CloseDB' then that interface is // also implemented. // With 'BoundedDB' the bounded entry size is that of the compressed byte array; so it may be possible to // retrieve entries which are larger than the bound. func (db *CompressingDB) Get(id uint64) ([]byte, error) { bs, err := db.LogDB.Get(id) if err != nil { return nil, err } return db.Decompress(bs) } // CompressIdentity create a 'CompressingDB' with the identity compressor/decompressor. func CompressIdentity(logdb LogDB) *CompressingDB { return &CompressingDB{ LogDB: logdb, Compress: func(bs []byte) ([]byte, error) { return bs, nil }, Decompress: func(bs []byte) ([]byte, error) { return bs, nil }, } } // CompressDEFLATE creates a 'CompressingDB' with DEFLATE compression at the given level. // Returns an error if the level is < -2 or > 9. func CompressDEFLATE(logdb LogDB, level int) (*CompressingDB, error) { if level < -2 || level > 9 { return nil, errors.New("flate compression level must be in the range [-2,9]") } return &CompressingDB{ LogDB: logdb, Compress: func(bs []byte) ([]byte, error) { buf := new(bytes.Buffer) w, _ := flate.NewWriter(buf, level) n, err := w.Write(bs) if err != nil { return nil, err } if n < len(bs) { return nil, errors.New("could not compress all bytes") } w.Close() return buf.Bytes(), nil }, Decompress: func(bs []byte) ([]byte, error) { r := flate.NewReader(bytes.NewReader(bs)) out, err := ioutil.ReadAll(r) r.Close() return out, err }, }, nil } // CompressLZW creates a 'CompressingDB' with LZW compression with the given order and literal width. // Returns an error if the lit width is < 2 or > 8. func CompressLZW(logdb LogDB, order lzw.Order, litWidth int) (*CompressingDB, error) { if litWidth < 2 || litWidth > 8 { return nil, errors.New("LZW literal width must be in the range [2,8]") } return &CompressingDB{ LogDB: logdb, Compress: func(bs []byte) ([]byte, error) { buf := new(bytes.Buffer) w := lzw.NewWriter(buf, order, litWidth) n, err := w.Write(bs) if err != nil { return nil, err } if n < len(bs) { return nil, errors.New("could not compress all bytes") } w.Close() return buf.Bytes(), nil }, Decompress: func(bs []byte) ([]byte, error) { r := lzw.NewReader(bytes.NewReader(bs), order, litWidth) out, err := ioutil.ReadAll(r) r.Close() return out, err }, }, nil }
<div class="panel panel-warning"> <div class="panel-heading"> <p class="h4">Solicitudes pendientes</p> </div> <div class="panel-body pre-scrollable"> <?php if (count($pendientes) > 0) { ?> <table class="table table-striped"> <tr> <td>Usuario</td> <td>Fecha de ingreso</td> <td>Fecha de salida</td> <td>Recepción de la solicitud</td> <td>&nbsp;</td> </tr> <?php foreach ($pendientes as $solicitud) { ?> <tr> <td> <a class="primary" href="<?php echo site_url("usuario/$solicitud->id"); ?>">@<?php echo $solicitud->username; ?></a> </td> <td><?php echo $solicitud->ingreso; ?></td> <td><?php echo $solicitud->salida; ?></td> <td><?php echo $solicitud->f_solicitud; ?></td> <td> <?php if (!isset($reservasSinAccion) || $reservasSinAccion === false) { ?> <a class="btn btn-primary" href="<?php echo site_url("reservas/aceptar/$solicitud->id_solicitud"); ?>"> <span class="glyphicon glyphicon-ok-sign"></span> </a> <a class="btn btn-default" href="<?php echo site_url("reservas/rechazar/$solicitud->id_solicitud"); ?>"> <span class="glyphicon glyphicon-remove"></span> </a> <?php } ?> </td> </tr> <?php } ?> </table> <?php } else { ?> <span class="glyphicon glyphicon-ok"></span> No tenés solicitudes pendientes. <?php } ?> </div> </div> <?php
layout: post title: Docker-docker categories: [docker] description: docker keywords: docker tag ID12tag: <!--more bash $ docker run --log-driver=fluentd --log-opt fluentd-address=myhost.local:24224 --log-opt tag="mailer" docker | | | | : | {% raw %}{ { .ID } }{% endraw %} | ID12 | | {% raw %}{ { .FullID } }{% endraw %} | ID | | {% raw %}{ { .Name } }{% endraw %} | | | {% raw %}{ { .ImageID } }{% endraw %} | Image ID 12 | | {% raw %}{ { .ImageFullID } }{% endraw %} | Image ID | | {% raw %}{ { .ImageName } }{% endraw %} | Image | | {% raw %}{ { .DaemonName } }{% endraw %} | docker | `--log-opt tag="{% raw %}{ { .ImageName } }{% endraw %}/{% raw %}{ { .Name } }{% endraw %}/{% raw %}{ { .ID } }{% endraw %}"`,syslog bash Aug 7 18:33:19 HOSTNAME docker/hello-world/foobar/5790672ab6a0[9103]: Hello from Docker `tag``container_name` `{% raw %}{ { .name } }{% endraw %}``docker rename` [go templates](https: syslog, bash $ docker run -it --rm \ --log-driver syslog \ --log-opt tag="{ { (.ExtraAttributes nil).SOME_ENV_VAR } }" \ --log-opt env=SOME_ENV_VAR \ -e SOME_ENV_VAR=logtester.1234 \ flyinprogrammer/logtester bash Apr 1 15:22:17 ip-10-27-39-73 docker/logtester.1234[45499]: + exec app Apr 1 15:22:17 ip-10-27-39-73 docker/logtester.1234[45499]: 2016-04-01 15:22:17.075416751 +0000 UTC stderr msg: 1
# arm7linux The objective of the project was to create a simple operating system to the ARM Evalutator-7T board which uses an ARM7 processor. For more information: http://arm7kinos.wordpress.com/
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Login Page - Photon Admin Panel Theme</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"> <link rel="shortcut icon" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/favicon.ico" /> <link rel="apple-touch-icon" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/iosicon.png" /> <!-- DEVELOPMENT LESS --> <!-- <link rel="stylesheet/less" href="css/photon.less" media="all" /> <link rel="stylesheet/less" href="css/photon-responsive.less" media="all" /> --> <!-- PRODUCTION CSS --> <link rel="stylesheet" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/css/css_compiled/photon-min.css?v1.1" media="all" /> <link rel="stylesheet" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/css/css_compiled/photon-min-part2.css?v1.1" media="all" /> <link rel="stylesheet" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/css/css_compiled/<API key>.css?v1.1" media="all" /> <!--[if IE]> <link rel="stylesheet" type="text/css" href="css/css_compiled/ie-only-min.css?v1.1" /> <![endif] <!--[if lt IE 9]> <link rel="stylesheet" type="text/css" href="css/css_compiled/ie8-only-min.css?v1.1" /> <script type="text/javascript" src="js/plugins/excanvas.js"></script> <script type="text/javascript" src="js/plugins/html5shiv.js"></script> <script type="text/javascript" src="js/plugins/respond.min.js"></script> <script type="text/javascript" src="js/plugins/fixFontIcons.js"></script> <![endif] <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/bootstrap/bootstrap.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/modernizr.custom.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/jquery.pnotify.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/less-1.3.1.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/xbreadcrumbs.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/jquery.maskedinput-1.3.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/jquery.autotab-1.1b.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/charCount.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/jquery.textareaCounter.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/elrte.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/elrte.en.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/select2.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/jquery-picklist.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/jquery.validate.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/additional-methods.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/jquery.form.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/jquery.metadata.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/jquery.mockjax.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/jquery.uniform.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/jquery.tagsinput.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/jquery.rating.pack.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/farbtastic.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/jquery.timeentry.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/jquery.dataTables.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/jquery.jstree.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/dataTables.bootstrap.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/jquery.mousewheel.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/jquery.mCustomScrollbar.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/jquery.flot.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/jquery.flot.stack.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/jquery.flot.pie.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/jquery.flot.resize.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/raphael.2.1.0.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/justgage.1.0.1.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/jquery.qrcode.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/jquery.clock.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/jquery.countdown.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/jquery.jqtweet.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/jquery.cookie.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/<API key>.min.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/prettify/prettify.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/bootstrapSwitch.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/plugins/mfupload.js"></script> <script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/js/common.js"></script> </head> <body class="body-login"> <div class="nav-fixed-topright" style="visibility: hidden"> <ul class="nav nav-user-menu"> <li class="<API key>"> <a href="javascript:;"> <i class="user-icon"></i><span class="nav-user-selection">Theme Options</span><i class="icon-menu-arrow"></i> </a> <ul class="nav user-sub-menu"> <li class="light"> <a href="javascript:;"> <i class='icon-photon stop'></i>Light Version </a> </li> <li class="dark"> <a href="javascript:;"> <i class='icon-photon stop'></i>Dark Version </a> </li> </ul> </li> <li> <a href="javascript:;"> <i class="icon-photon mail"></i> </a> </li> <li> <a href="javascript:;"> <i class="icon-photon comment_alt2_stroke"></i> <div class="notification-count">12</div> </a> </li> </ul> </div> <script> $(function(){ setTimeout(function(){ $('.nav-fixed-topright').removeAttr('style'); }, 300); $(window).scroll(function(){ if($('.<API key>').length){ var scrollState = $(window).scrollTop(); if (scrollState > 0) $('.nav-fixed-topright').addClass('nav-released'); else $('.nav-fixed-topright').removeClass('nav-released') } }); $('.<API key>').on('click', function(){ $(this).toggleClass('active-user-menu'); }); $('.user-sub-menu .light').on('click', function(){ if ($('body').is('.light-version')) return; $('body').addClass('light-version'); setTimeout(function() { $.cookie('themeColor', 'light', { expires: 7, path: '/' }); }, 500); }); $('.user-sub-menu .dark').on('click', function(){ if ($('body').is('.light-version')) { $('body').removeClass('light-version'); $.cookie('themeColor', 'dark', { expires: 7, path: '/' }); } }); }); </script> <div class="container-login"> <div class="<API key>"> <div class="form-window-login"> <div class="<API key>"> <div class="login-logo"> <img src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/js/plugins/prettify/js/bootstrap/js/plugins/js/plugins/images/photon/login-logo@2x.png" alt="Photon UI"/> </div> <h2 class="login-title">Welcome to Photon UI!</h2> <div class="login-member">Not a Member?&nbsp;<a href="jquery.uniform.min.js.html#">Sign Up &#187;</a> <a href="jquery.uniform.min.js.html#" class="btn btn-facebook"><i class="icon-fb"></i>Login with Facebook<i class="icon-fb-arrow"></i></a> </div> <div class="login-or">Or</div> <div class="login-input-area"> <form method="POST" action="dashboard.php"> <span class="help-block">Login With Your Photon Account</span> <input type="text" name="email" placeholder="Email"> <input type="password" name="password" placeholder="Password"> <button type="submit" class="btn btn-large btn-success btn-login">Login</button> </form> <a href="jquery.uniform.min.js.html#" class="forgot-pass">Forgot Your Password?</a> </div> </div> </div> </div> </div> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-1936460-27']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https: var s = document.<API key>('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html>
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace MasterDetailSample { public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } } }
<?php use <API key> as <API key>; class <API key> extends <API key> { // protected function _initAction() { $this->loadLayout() ->_title(Mage::helper('M2ePro')->__('Policies')) ->_title(Mage::helper('M2ePro')->__('Description Policies')); $this->getLayout()->getBlock('head') ->addJs('M2ePro/Template/EditHandler.js') ->addJs('M2ePro/Amazon/Template/EditHandler.js') ->addJs('M2ePro/Amazon/Template/Description/Handler.js') ->addJs('M2ePro/Amazon/Template/Description/DefinitionHandler.js') ->addJs('M2ePro/Amazon/Template/Description/Category/ChooserHandler.js') ->addJs('M2ePro/Amazon/Template/Description/Category/SpecificHandler.js') ->addJs('M2ePro/Amazon/Template/Description/Category/Specific/Renderer.js') ->addJs('M2ePro/Amazon/Template/Description/Category/Specific/Dictionary.js') ->addJs('M2ePro/Amazon/Template/Description/Category/Specific/BlockRenderer.js') ->addJs('M2ePro/Amazon/Template/Description/Category/Specific/Block/GridRenderer.js') ->addJs('M2ePro/Amazon/Template/Description/Category/Specific/Block/AddSpecificRenderer.js') ->addJs('M2ePro/Amazon/Template/Description/Category/Specific/Grid/RowRenderer.js') ->addJs('M2ePro/Amazon/Template/Description/Category/Specific/Grid/<API key>.js') ->addJs('M2ePro/AttributeHandler.js'); $this->_initPopUp(); $this->setPageHelpLink(NULL, NULL, "x/HoMVAQ"); return $this; } protected function _isAllowed() { return Mage::getSingleton('admin/session')->isAllowed( <API key>::MENU_ROOT_NODE_NICK . '/configuration' ); } // public function indexAction() { return $this->_redirect('*/<API key>/index'); } public function gridAction() { $block = $this->loadLayout()->getLayout() ->createBlock('M2ePro/<API key>'); $this->getResponse()->setBody($block->toHtml()); } // public function newAction() { $this->_forward('edit'); } public function editAction() { /** @var <API key> $templateModel */ $id = $this->getRequest()->getParam('id'); $templateModel = Mage::helper('M2ePro/Component_Amazon')->getModel('<API key>')->load($id); if (!$templateModel->getId() && $id) { $this->_getSession()->addError(Mage::helper('M2ePro')->__('Policy does not exist')); return $this->_redirect('*/*/index'); } $marketplaces = Mage::helper('M2ePro/Component_Amazon')-><API key>(); if ($marketplaces->getSize() <= 0) { $message = 'You should select and update at least one Amazon Marketplace.'; $this->_getSession()->addError(Mage::helper('M2ePro')->__($message)); return $this->_redirect('*/*/index'); } Mage::helper('M2ePro/Data_Global')->setValue('temp_data', $templateModel); $this->_initAction() ->_addLeft($this->getLayout()->createBlock('M2ePro/<API key>')) ->_addContent($this->getLayout()->createBlock('M2ePro/<API key>')) ->renderLayout(); } public function saveAction() { if (!$post = $this->getRequest()->getPost()) { return $this->_redirect('*/*/index'); } $id = $this->getRequest()->getParam('id'); // Saving general data $keys = array( 'title', 'marketplace_id', '<API key>', 'category_path', 'product_data_nick', 'browsenode_id', '<API key>', 'worldwide_id_mode', '<API key>' ); $dataForAdd = array(); foreach ($keys as $key) { isset($post['general'][$key]) && $dataForAdd[$key] = $post['general'][$key]; } $dataForAdd['title'] = strip_tags($dataForAdd['title']); /** @var <API key> $descriptionTemplate */ $descriptionTemplate = Mage::helper('M2ePro/Component_Amazon')->getModel('<API key>')->load($id); $oldData = array(); if ($descriptionTemplate->getId()) { $snapshotBuilder = Mage::getModel('M2ePro/<API key>'); $snapshotBuilder->setModel($descriptionTemplate); $oldData = $snapshotBuilder->getSnapshot(); } $descriptionTemplate->addData($dataForAdd)->save(); $id = $descriptionTemplate->getId(); // Saving definition info $keys = array( 'title_mode', 'title_template', 'brand_mode', 'brand_custom_value', '<API key>', 'manufacturer_mode', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', 'msrp_rrp_mode', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', 'package_weight_mode', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', 'target_audience', 'search_terms_mode', 'search_terms', 'image_main_mode', '<API key>', '<API key>', '<API key>', 'gallery_images_mode', '<API key>', '<API key>', 'bullet_points_mode', 'bullet_points', 'description_mode', '<API key>', ); $dataForAdd = array(); foreach ($keys as $key) { isset($post['definition'][$key]) && $dataForAdd[$key] = $post['definition'][$key]; } $dataForAdd['<API key>'] = $id; $helper = Mage::helper('M2ePro'); $dataForAdd['target_audience'] = $helper->jsonEncode(array_filter($dataForAdd['target_audience'])); $dataForAdd['search_terms'] = $helper->jsonEncode(array_filter($dataForAdd['search_terms'])); $dataForAdd['bullet_points'] = $helper->jsonEncode(array_filter($dataForAdd['bullet_points'])); /** @var $<API key> <API key> */ $<API key> = Mage::getModel('M2ePro/<API key>'); $<API key>->load($id); $<API key>->addData($dataForAdd)->save(); /** @var <API key> $<API key> */ $<API key> = $descriptionTemplate->getChildObject(); $<API key>-><API key>($<API key>); // Saving specifics info foreach ($<API key>->getSpecifics(true) as $specific) { $specific->deleteInstance(); } $specifics = !empty($post['specifics']['encoded_data']) ? $post['specifics']['encoded_data'] : ''; $specifics = (array)Mage::helper('M2ePro')->jsonDecode($specifics); $this->sortSpecifics($specifics, $post['general']['product_data_nick'], $post['general']['marketplace_id']); foreach ($specifics as $xpath => $specificData) { if (!$this-><API key>($specificData)) { continue; } $specificInstance = Mage::getModel('M2ePro/<API key>'); $type = isset($specificData['type']) ? $specificData['type'] : ''; $isRequired = isset($specificData['is_required']) ? $specificData['is_required'] : 0; $attributes = isset($specificData['attributes']) ? Mage::helper('M2ePro')->jsonEncode($specificData['attributes']) : '[]'; $recommendedValue = $specificData['mode'] == $specificInstance::<API key> ? $specificData['recommended_value'] : ''; $customValue = $specificData['mode'] == $specificInstance::<API key> ? $specificData['custom_value'] : ''; $customAttribute = $specificData['mode'] == $specificInstance::<API key> ? $specificData['custom_attribute'] : ''; $specificInstance->addData( array( '<API key>' => $id, 'xpath' => $xpath, 'mode' => $specificData['mode'], 'is_required' => $isRequired, 'recommended_value' => $recommendedValue, 'custom_value' => $customValue, 'custom_attribute' => $customAttribute, 'type' => $type, 'attributes' => $attributes ) ); $specificInstance->save(); } // Is Need Synchronize $snapshotBuilder = Mage::getModel('M2ePro/<API key>'); $snapshotBuilder->setModel($<API key>->getParentObject()); $newData = $snapshotBuilder->getSnapshot(); $diff = Mage::getModel('M2ePro/<API key>'); $diff->setNewSnapshot($newData); $diff->setOldSnapshot($oldData); $<API key> = Mage::getModel('M2ePro/<API key>'); $<API key>->setModel($<API key>); $changeProcessor = Mage::getModel('M2ePro/<API key>'); $changeProcessor->process( $diff, $<API key>->getData(array('id', 'status'), array('only_physical_units' => true)) ); // Run Processor for Variation Relation Parents if ($diff->isDetailsDifferent() || $diff->isImagesDifferent()) { /** @var <API key> $<API key> */ $<API key> = Mage::helper('M2ePro/Component_Amazon')->getCollection('Listing_Product') ->addFieldToFilter('<API key>', $id) ->addFieldToFilter( 'is_general_id_owner', <API key>::<API key> ) ->addFieldToFilter('general_id', array('null' => true)) ->addFieldToFilter('<API key>', 1) ->addFieldToFilter('is_variation_parent', 1); $massProcessor = Mage::getModel( 'M2ePro/<API key>' ); $massProcessor->setListingsProducts($<API key>->getItems()); $massProcessor->setForceExecuting(false); $massProcessor->execute(); } $this->_getSession()->addSuccess(Mage::helper('M2ePro')->__('Policy was successfully saved')); return $this->_redirectUrl( Mage::helper('M2ePro')->getBackUrl('list', array(), array('edit' => array('id' => $id))) ); } protected function <API key>($specificData) { if (empty($specificData['mode'])) { return false; } if ($specificData['mode'] == <API key>::<API key> && (!isset($specificData['recommended_value']) || $specificData['recommended_value'] == '')) { return false; } if ($specificData['mode'] == <API key>::<API key> && (!isset($specificData['custom_attribute']) || $specificData['custom_attribute'] == '')) { return false; } if ($specificData['mode'] == <API key>::<API key> && (!isset($specificData['custom_value']) || $specificData['custom_value'] == '')) { return false; } return true; } protected function sortSpecifics(&$specifics, $productData, $marketplaceId) { /** @var $connRead <API key> */ $connRead = Mage::getSingleton('core/resource')->getConnection('core_read'); $table = Mage::helper('M2ePro/<API key>') -><API key>('<API key>'); $dictionarySpecifics = $connRead->select() ->from($table, array('id', 'xpath')) ->where('product_data_nick = ?', $productData) ->where('marketplace_id = ?', $marketplaceId) ->query()->fetchAll(); foreach ($dictionarySpecifics as $key => $specific) { $xpath = $specific['xpath']; unset($dictionarySpecifics[$key]); $dictionarySpecifics[$xpath] = $specific['id']; } Mage::helper('M2ePro/Data_Global')->setValue('<API key>', $dictionarySpecifics); function callback($aXpath, $bXpath) { $dictionarySpecifics = Mage::helper('M2ePro/Data_Global')->getValue('<API key>'); $aXpathParts = explode('/', $aXpath); foreach ($aXpathParts as &$part) { $part = preg_replace('/\-\d+$/', '', $part); } unset($part); $aXpath = implode('/', $aXpathParts); $bXpathParts = explode('/', $bXpath); foreach ($bXpathParts as &$part) { $part = preg_replace('/\-\d+$/', '', $part); } unset($part); $bXpath = implode('/', $bXpathParts); $aIndex = $dictionarySpecifics[$aXpath]; $bIndex = $dictionarySpecifics[$bXpath]; return $aIndex > $bIndex ? 1 : -1; } uksort($specifics, 'callback'); } public function deleteAction() { $ids = $this->getRequestIds(); if (empty($ids)) { $this->_getSession()->addError(Mage::helper('M2ePro')->__('Please select Item(s) to remove.')); $this->_redirect('*/*/index'); return; } $deleted = $locked = 0; foreach ($ids as $id) { $template = Mage::helper('M2ePro/Component')->getUnknownObject('<API key>', $id); if ($template->isLocked()) { $locked++; } else { $template->deleteInstance(); $deleted++; } } $tempString = Mage::helper('M2ePro')->__('%s record(s) were successfully deleted.', $deleted); $deleted && $this->_getSession()->addSuccess($tempString); $tempString = Mage::helper('M2ePro')->__('%s record(s) are used in Listing(s).', $locked) . ' '; $tempString .= Mage::helper('M2ePro')->__('Policy must not be in use to be deleted.'); $locked && $this->_getSession()->addError($tempString); $this->_redirect('*/*/index'); } // public function <API key>() { /** @var <API key> $editBlock */ $blockName = 'M2ePro/<API key>'; $editBlock = $this->getLayout()->createBlock($blockName); $editBlock->setMarketplaceId($this->getRequest()->getPost('marketplace_id')); $browseNodeId = $this->getRequest()->getPost('browsenode_id'); $categoryPath = $this->getRequest()->getPost('category_path'); $<API key> = Mage::helper('M2ePro/<API key>')->getRecent( $this->getRequest()->getPost('marketplace_id'), array('browsenode_id' => $browseNodeId, 'path' => $categoryPath) ); if (empty($<API key>)) { Mage::helper('M2ePro/Data_Global')->setValue('<API key>', true); } if ($browseNodeId && $categoryPath) { $editBlock->setSelectedCategory( array( 'browseNodeId' => $browseNodeId, 'categoryPath' => $categoryPath ) ); } $this->getResponse()->setBody($editBlock->toHtml()); } // public function <API key>() { /** @var $connRead <API key> */ $connRead = Mage::getSingleton('core/resource')->getConnection('core_read'); $queryStmt = $connRead->select() ->from( Mage::helper('M2ePro/<API key>') -><API key>('<API key>') ) ->where('marketplace_id = ?', $this->getRequest()->getPost('marketplace_id')) ->where('browsenode_id = ?', $this->getRequest()->getPost('browsenode_id')) ->query(); $tempCategories = array(); while ($row = $queryStmt->fetch()) { $this->formatCategoryRow($row); $tempCategories[] = $row; } if (empty($tempCategories)) { return $this->getResponse()->setBody(null); } $dbCategoryPath = str_replace(' > ', '>', $this->getRequest()->getPost('category_path')); foreach ($tempCategories as $category) { $tempCategoryPath = $category['path'] !== null ? $category['path'] . '>' . $category['title'] : $category['title']; if ($tempCategoryPath == $dbCategoryPath) { return $this->getResponse()->setBody(Mage::helper('M2ePro')->jsonEncode($category)); } } return $this->getResponse()->setBody(Mage::helper('M2ePro')->jsonEncode($tempCategories[0])); } public function <API key>() { /** @var $connRead <API key> */ $connRead = Mage::getSingleton('core/resource')->getConnection('core_read'); $category = $connRead->select() ->from( Mage::helper('M2ePro/<API key>') -><API key>('<API key>') ) ->where('marketplace_id = ?', $this->getRequest()->getPost('marketplace_id')) ->where('category_id = ?', $this->getRequest()->getPost('category_id')) ->query() ->fetch(); if (!$category) { return $this->getResponse()->setBody(null); } $this->formatCategoryRow($category); return $this->getResponse()->setBody(Mage::helper('M2ePro')->jsonEncode($category)); } public function <API key>() { /** @var $connRead <API key> */ $connRead = Mage::getSingleton('core/resource')->getConnection('core_read'); $select = $connRead->select() ->from( Mage::helper('M2ePro/<API key>') -><API key>('<API key>') ) ->where('marketplace_id = ?', $this->getRequest()->getPost('marketplace_id')) ->order('title ASC'); $parentCategoryId = $this->getRequest()->getPost('parent_category_id'); empty($parentCategoryId) ? $select->where('parent_category_id IS NULL') : $select->where('parent_category_id = ?', $parentCategoryId); $queryStmt = $select->query(); $tempCategories = array(); $sortIndex = 0; while ($row = $queryStmt->fetch()) { $this->formatCategoryRow($row); $this->isItOtherCategory($row) ? $tempCategories[10000] = $row : $tempCategories[$sortIndex++] = $row; } ksort($tempCategories); return $this->getResponse()->setBody(Mage::helper('M2ePro')->jsonEncode(array_values($tempCategories))); } public function <API key>() { if (!$keywords = $this->getRequest()->getParam('query', '')) { $this->getResponse()->setBody(Mage::helper('M2ePro')->jsonEncode(array())); return; } /** @var $connRead <API key> */ $connRead = Mage::getSingleton('core/resource')->getConnection('core_read'); $select = $connRead->select() ->from( Mage::helper('M2ePro/<API key>') -><API key>('<API key>') ) ->where('is_leaf = 1') ->where('marketplace_id = ?', $this->getRequest()->getParam('marketplace_id')); $where = array(); $where[] = "browsenode_id = {$connRead->quote($keywords)}"; foreach (explode(' ', $keywords) as $part) { $part = trim($part); if ($part == '') { continue; } $part = $connRead->quote('%'.$part.'%'); $where[] = "keywords LIKE {$part} OR title LIKE {$part}"; } $select->where(implode(' OR ', $where)) ->limit(200) ->order('id ASC'); $categories = array(); $queryStmt = $select->query(); while ($row = $queryStmt->fetch()) { $this->formatCategoryRow($row); $categories[] = $row; } $this->getResponse()->setBody(Mage::helper('M2ePro')->jsonEncode($categories)); } public function <API key>() { $marketplaceId = $this->getRequest()->getPost('marketplace_id'); $browseNodeId = $this->getRequest()->getPost('browsenode_id'); $categoryPath = $this->getRequest()->getPost('category_path'); if (!$marketplaceId || !$browseNodeId || !$categoryPath) { return $this->getResponse()->setBody(Mage::helper('M2ePro')->jsonEncode(array('result' => false))); } Mage::helper('M2ePro/<API key>')->addRecent( $marketplaceId, $browseNodeId, $categoryPath ); return $this->getResponse()->setBody(Mage::helper('M2ePro')->jsonEncode(array('result' => true))); } public function <API key>() { $marketplaceId = (int)$this->getRequest()->getPost('marketplace_id'); $browsenodeId = $this->getRequest()->getPost('browsenode_id'); $resource = Mage::getSingleton('core/resource'); $tableName = Mage::helper('M2ePro/<API key>') -><API key>('<API key>'); $queryStmt = $resource->getConnection('core_read') ->select() ->from($tableName) ->where('marketplace_id = ?', $marketplaceId) ->where('browsenode_id = ?', $browsenodeId) ->query(); $cachedProductTypes = array(); while ($row = $queryStmt->fetch()) { $cachedProductTypes[$row['product_data_nick']] = array( 'product_data_nick' => $row['product_data_nick'], 'is_applicable' => $row['is_applicable'], 'required_attributes' => $row['required_attributes'] ); } $model = Mage::getModel('M2ePro/<API key>'); $model->setMarketplaceId($marketplaceId); $<API key> = $model->getProductData(); $<API key> = array_diff( array_keys($<API key>), array_keys($cachedProductTypes) ); if (!empty($<API key>)) { $result = $this-><API key>($marketplaceId, $browsenodeId, $<API key>); $cachedProductTypes = array_merge($cachedProductTypes, $result); } foreach ($cachedProductTypes as $nick => &$productTypeInfo) { if (!$productTypeInfo['is_applicable']) { unset($cachedProductTypes[$nick]); continue; } $productTypeInfo['title'] = isset($<API key>[$nick]) ? $<API key>[$nick]['title'] : $nick; $productTypeInfo['group'] = isset($<API key>[$nick]) ? $<API key>[$nick]['group'] : 'Other'; $productTypeInfo['required_attributes'] = (array)Mage::helper('M2ePro')->jsonDecode( $productTypeInfo['required_attributes'] ); } return $this->getResponse()->setBody( Mage::helper('M2ePro')->jsonEncode( array( 'product_data' => $cachedProductTypes, 'grouped_data' => $this-><API key>($cachedProductTypes), 'recent_data' => $this-><API key>($marketplaceId, $cachedProductTypes) ) ) ); } protected function <API key>($marketplaceId, $browsenodeId, $productDataNicks) { $marketplaceNativeId = Mage::helper('M2ePro/Component_Amazon') ->getCachedObject('Marketplace', $marketplaceId) ->getNativeId(); $dispatcherObject = Mage::getModel('M2ePro/<API key>'); $connectorObj = $dispatcherObject->getVirtualConnector( 'category', 'get', 'productsDataInfo', array( 'marketplace' => $marketplaceNativeId, 'browsenode_id' => $browsenodeId, 'product_data_nicks' => $productDataNicks ) ); try { $dispatcherObject->process($connectorObj); } catch (Exception $e) { Mage::helper('M2ePro/Module_Exception')->process($e); return array(); } $response = $connectorObj->getResponseData(); if ($response === false || empty($response['info'])) { return array(); } $insertsData = array(); foreach ($response['info'] as $dataNickKey => $info) { $insertsData[$dataNickKey] = array( 'marketplace_id' => $marketplaceId, 'browsenode_id' => $browsenodeId, 'product_data_nick' => $dataNickKey, 'is_applicable' => (int)$info['applicable'], 'required_attributes' => Mage::helper('M2ePro')->jsonEncode($info['required_attributes']) ); } $resource = Mage::getSingleton('core/resource'); $tableName = Mage::helper('M2ePro/<API key>') -><API key>('<API key>'); $resource->getConnection('core_write')->insertMultiple($tableName, $insertsData); return $insertsData; } protected function <API key>(array $cachedProductTypes) { $groupedData = array(); foreach ($cachedProductTypes as $nick => $productTypeInfo) { $groupedData[$productTypeInfo['group']][$productTypeInfo['title']] = $productTypeInfo; } ksort($groupedData); foreach ($groupedData as $group => &$productTypes) { ksort($productTypes); } return $groupedData; } protected function <API key>($marketplaceId, array $cachedProductTypes) { $<API key> = array(); foreach (Mage::helper('M2ePro/<API key>')->getRecent($marketplaceId) as $nick) { if (!isset($cachedProductTypes[$nick]) || !$cachedProductTypes[$nick]['is_applicable']) { continue; } $<API key>[$nick] = array( 'title' => $cachedProductTypes[$nick]['title'], 'group' => $cachedProductTypes[$nick]['group'], 'product_data_nick' => $nick, 'is_applicable' => 1, 'required_attributes' => $cachedProductTypes[$nick]['required_attributes'] ); } return $<API key>; } public function <API key>() { $marketplaceId = $this->getRequest()->getPost('marketplace_id'); $productDataNick = $this->getRequest()->getPost('product_data_nick'); if (!$marketplaceId || !$productDataNick) { return $this->getResponse()->setBody(Mage::helper('M2ePro')->jsonEncode(array('result' => false))); } Mage::helper('M2ePro/<API key>')->addRecent($marketplaceId, $productDataNick); return $this->getResponse()->setBody(Mage::helper('M2ePro')->jsonEncode(array('result' => true))); } public function <API key>() { $model = Mage::getModel('M2ePro/<API key>'); $model->setMarketplaceId($this->getRequest()->getParam('marketplace_id')); $variationThemes = $model->getVariationThemes($this->getRequest()->getParam('product_data_nick')); return $this->getResponse()->setBody(Mage::helper('M2ePro')->jsonEncode($variationThemes)); } protected function formatCategoryRow(&$row) { $row['product_data_nicks'] = $row['product_data_nicks'] !== null ? (array)Mage::helper('M2ePro')->jsonDecode($row['product_data_nicks']) : array(); } protected function isItOtherCategory($row) { $parentTitle = explode('>', $row['path']); $parentTitle = array_pop($parentTitle); return preg_match("/^.* \({$parentTitle}\)$/i", $row['title']); } // public function <API key>() { /** @var $connRead <API key> */ $connRead = Mage::getSingleton('core/resource')->getConnection('core_read'); $tempSpecifics = $connRead->select() ->from( Mage::helper('M2ePro/<API key>') -><API key>('<API key>') ) ->where('marketplace_id = ?', $this->getRequest()->getParam('marketplace_id')) ->where('product_data_nick = ?', $this->getRequest()->getParam('product_data_nick')) ->query()->fetchAll(); $helper = Mage::helper('M2ePro'); $specifics = array(); foreach ($tempSpecifics as $tempSpecific) { $tempSpecific['values'] = (array)$helper->jsonDecode($tempSpecific['values']); $tempSpecific['recommended_values'] = (array)$helper->jsonDecode($tempSpecific['recommended_values']); $tempSpecific['params'] = (array)$helper->jsonDecode($tempSpecific['params']); $tempSpecific['data_definition'] = (array)$helper->jsonDecode($tempSpecific['data_definition']); $specifics[$tempSpecific['specific_id']] = $tempSpecific; } return $this->getResponse()->setBody(Mage::helper('M2ePro')->jsonEncode($specifics)); } public function <API key>() { /** @var <API key> $addBlock */ $blockName = 'M2ePro/<API key>'; $addBlock = $this->getLayout()->createBlock($blockName); $gridBlock = $this->prepareGridBlock(); $addBlock->setChild('specifics_grid', $gridBlock); $this->getResponse()->setBody($addBlock->toHtml()); } public function <API key>() { $gridBlock = $this->prepareGridBlock(); $this->getResponse()->setBody($gridBlock->toHtml()); } protected function prepareGridBlock() { /** @var Ess_M2ePro_Block_Adminhtml_Amazon_Template_Description_Category_Specific_Add_Grid $grid */ $blockName = 'M2ePro/<API key>'; $grid = $this->getLayout()->createBlock($blockName); $helper = Mage::helper('M2ePro'); $grid->setMarketplaceId($this->getRequest()->getParam('marketplace_id')); $grid->setProductDataNick($this->getRequest()->getParam('product_data_nick')); $grid->setCurrentXpath($this->getRequest()->getParam('<API key>')); $grid-><API key>( (array)$helper->jsonDecode($this->getRequest()->getParam('<API key>')) ); $grid-><API key>( (array)$helper->jsonDecode($this->getRequest()->getParam('<API key>')) ); $grid-><API key>((array)$helper->jsonDecode($this->getRequest()->getParam('selected_specifics'))); $grid->setOnlyDesired($this->getRequest()->getParam('only_desired', false)); $grid->setSearchQuery($this->getRequest()->getParam('query')); return $grid; } public function <API key>() { $model = Mage::getModel('M2ePro/<API key>'); $model->setMarketplaceId($this->getRequest()->getParam('marketplace_id')); $variationThemes = $model->getVariationThemes($this->getRequest()->getParam('product_data_nick')); $attributes = array(); foreach ($variationThemes as $themeName => $themeInfo) { foreach ($themeInfo['attributes'] as $attributeName) { if (isset($attributes[$attributeName]) && in_array($themeName, $attributes[$attributeName])) { continue; } $attributes[$attributeName][] = $themeName; } } return $this->getResponse()->setBody(Mage::helper('M2ePro')->jsonEncode($attributes)); } // }
export VOLTA_HOME="$HOME/.volta" [ -s "$VOLTA_HOME/load.sh" ] || return 0 # Initialize volta . "$VOLTA_HOME/load.sh" export PATH="$VOLTA_HOME/bin:$PATH" volta install node if ( is_osx ); then # Format Markdown quick action requires node & prettier volta install prettier fi
.treeTable tr td .expander { background-position: left center; background-repeat: no-repeat; cursor: pointer; padding: 0; zoom: 1; /* IE7 Hack */ } .treeTable tr.collapsed td .expander { background-image: url(../images/toggle-expand-dark.png); } .treeTable tr.expanded td .expander { background-image: url(../images/<API key>.png); } .treeTable tr.selected td, .treeTable tr.accept td { background-color: #3875d7 !important; color: #fff; } .treeTable tr.selected a, .treeTable tr.accept a { color: #fff !important; } .treeTable tr.collapsed.selected td .expander, .treeTable tr.collapsed.accept td .expander { background-image: url(../images/toggle-expand-light.png); } .treeTable tr.expanded.selected td .expander, .treeTable tr.expanded.accept td .expander { background-image: url(../images/<API key>.png); } .treeTable .<API key> { color: #000; z-index: 1; } table span { background-position: center left; background-repeat: no-repeat; padding: .2em 0 .2em 1.5em; } table span.file { background-image: url(../images/page_white_text.png); cursor: pointer; } table span.folder { background-image: url(../images/folder.png); cursor: pointer; }
\n static inline void <API key>(struct <API key> *state, u32 *out_hw_irq, struct xive_irq_data **out_xd) static inline struct kvm_vcpu *<API key>(struct kvm *kvm, u32 nr) static inline struct <API key> *<API key>(struct kvmppc_xive *xive, u32 irq, u16 *source) static inline u8 <API key>(u8 prio) static inline u8 xive_prio_to_guest(u8 prio) static inline u32 __xive_read_eq(__be32 *qpage, u32 msk, u32 *idx, u32 *toggle) \n 2 u8 prio 1 u32 *toggle 1 u32 *out_hw_irq 1 u32 nr 1 u32 msk 1 u32 irq 1 u32 *idx 1 u16 *source 1 struct xive_irq_data **out_xd 1 struct kvmppc_xive *xive 1 struct <API key> *state 1 struct kvm *kvm 1 __be32 *qpage
var defaults = { // display allDaySlot: false, defaultView: 'month', aspectRatio: 1.35, header: false, //header: { // left: 'title', // center: '', // right: 'today prev,next' weekends: true, // editing //editable: false, //disableDragging: false, //disableResizing: false, allDayDefault: false, ignoreTimezone: true, // event ajax lazyFetching: true, startParam: 'start', endParam: 'end', // time formats titleFormat: { month: 'MMMM yyyy', week: "MMM d[ yyyy]{ '&#8212;'[ MMM] d yyyy}", day: 'dddd, MMM d, yyyy' }, columnFormat: { month: 'ddd', week: 'ddd M/d', day: 'dddd M/d' }, timeFormat: { // for event elements '': 'h(:mm)t' // default }, // locale isRTL: false, firstDay: 0, monthNames: ['January','February','March','April','May','June','July','August','September','October','November','December'], monthNamesShort: ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'], dayNames: ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'], dayNamesShort: ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'], buttonText: { prev: '&nbsp;&#9668;&nbsp;', next: '&nbsp;&#9658;&nbsp;', prevYear: '&nbsp;&lt;&lt;&nbsp;', nextYear: '&nbsp;&gt;&gt;&nbsp;', today: 'today', month: 'month', week: 'week', day: 'day' }, // jquery-ui theming theme: false, buttonIcons: { prev: 'circle-triangle-w', next: 'circle-triangle-e' }, //selectable: false, unselectAuto: true, dropAccept: '*' }; // right-to-left defaults var rtlDefaults = { header: { left: 'next,prev today', center: '', right: 'title' }, buttonText: { prev: '&nbsp;&#9658;&nbsp;', next: '&nbsp;&#9668;&nbsp;', prevYear: '&nbsp;&gt;&gt;&nbsp;', nextYear: '&nbsp;&lt;&lt;&nbsp;' }, buttonIcons: { prev: 'circle-triangle-e', next: 'circle-triangle-w' } };
// Arduino JSON library #include "../include/ArduinoJson/JsonArray.hpp" #include "../include/ArduinoJson/JsonBuffer.hpp" #include "../include/ArduinoJson/JsonObject.hpp" using namespace ArduinoJson; using namespace ArduinoJson::Internals; JsonArray JsonArray::_invalid(NULL); JsonVariant &JsonArray::at(int index) const { node_type *node = _firstNode; while (node && index--) node = node->next; return node ? node->content : JsonVariant::invalid(); } JsonVariant &JsonArray::add() { node_type *node = createNode(); if (!node) return JsonVariant::invalid(); addNode(node); return node->content; } JsonArray &JsonArray::createNestedArray() { if (!_buffer) return JsonArray::invalid(); JsonArray &array = _buffer->createArray(); add(array); return array; } JsonObject &JsonArray::createNestedObject() { if (!_buffer) return JsonObject::invalid(); JsonObject &object = _buffer->createObject(); add(object); return object; } void JsonArray::writeTo(Writer &writer) const { writer.beginArray(size()); const node_type *child = _firstNode; while (child) { child->content.writeTo(writer); child = child->next; if (!child) break; writer.writeComma(); } writer.endArray(); }
module.exports = { getObjectName: function(list, obj) { for(var attr in list) { if (list[attr] === obj) { return attr; } } return ""; } }
const mongoose = require('mongoose'); const Schema = mongoose.Schema; const OrderSchema = new Schema({ ids: { type: String, }, iname: { type: String, }, department: { type: String, }, ename: { type: String, }, unit: { type: String, }, quantity: { type: String, }, rdate: { type: Date, }, }); const Order= mongoose.model('Orderlist', OrderSchema); module.exports = Order;
<?php declare(strict_types=1); use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\File; use LaravelZero\Framework\Contracts\Providers\ComposerContract; afterEach(function () { File::deleteDirectory(database_path()); File::delete(base_path('.gitignore')); touch(base_path('.gitignore')); }); it('installs the required packages', function () { $composerMock = $this->createMock(ComposerContract::class); // database, queue, bus... $composerMock->expects($this->exactly(4)) ->method('require'); $this->app->instance(ComposerContract::class, $composerMock); Artisan::call('app:install', ['component' => 'queue']); });
Dev.Catalysts ========== CatCoder and CCC (C This code is used for training and competitions and therefore may look unnecessary ugly. :-) NOTE: The created examples/levels could not be finished also... CatCoder: https://catcoder.catalysts.cc/ CCC: http://contest.catalysts.cc/
var config = { default: { "baseUrl": "", "paths": { "app": "scripts/app", "bootstrap": "scripts/bootstrap", "config": "scripts/config" }, "packages": [ { "name": "myCourseWidget", "location": "bower_components/myCourseWidget/dist/component/src", "main": "js/component" }, { "name": "<API key>", "location": "bower_components/<API key>/dist/component/src", "main": "js/component" } ], "shim": { "angularAMD": ["angular"], "angular-mocks": ["angular"], "angular-resource": ["angular"], "bootstrap-tpl": ["angular"] }, "priority": ["angular", "angularAMD"], "deps": ["/scripts/bootstrap.js"] } }; module.exports = config;
<?php use pbozzi\correios\Correios; use PHPUnit\Framework\TestCase; class <API key> extends TestCase { const ERROR = 'error'; const MESSAGE = 'message'; const ENDERECO = 'endereco'; const LOGRADOURO = 'logradouro'; const BAIRRO = 'bairro'; const CIDADE = 'cidade'; public function <API key>() { $cep = '01310200'; $ret = Correios::consultarCEPViaCEP($cep); $this->assertFalse($ret[ConsultarCepTest::ERROR]); $this-><API key>(ConsultarCepTest::MESSAGE, $ret); $this->assertArrayHasKey(ConsultarCepTest::ENDERECO, $ret); $this->assertArrayHasKey('cep', $ret[ConsultarCepTest::ENDERECO]); $this->assertEquals($cep, $ret[ConsultarCepTest::ENDERECO]['cep']); $this->assertArrayHasKey(ConsultarCepTest::LOGRADOURO, $ret[ConsultarCepTest::ENDERECO]); $this->assertEquals('Avenida Paulista', $ret[ConsultarCepTest::ENDERECO][ConsultarCepTest::LOGRADOURO]); $this->assertArrayHasKey(ConsultarCepTest::BAIRRO, $ret[ConsultarCepTest::ENDERECO]); $this->assertEquals('Bela Vista', $ret[ConsultarCepTest::ENDERECO][ConsultarCepTest::BAIRRO]); $this->assertArrayHasKey(ConsultarCepTest::CIDADE, $ret[ConsultarCepTest::ENDERECO]); $this->assertEquals('São Paulo', $ret[ConsultarCepTest::ENDERECO][ConsultarCepTest::CIDADE]); $this->assertArrayHasKey('uf', $ret[ConsultarCepTest::ENDERECO]); $this->assertEquals('SP', $ret[ConsultarCepTest::ENDERECO]['uf']); } public function <API key>() { $cep = '01310-200'; $ret = Correios::consultarCEPViaCEP($cep); $this->assertFalse($ret[ConsultarCepTest::ERROR]); $this-><API key>(ConsultarCepTest::MESSAGE, $ret); $this->assertArrayHasKey(ConsultarCepTest::ENDERECO, $ret); $this->assertArrayHasKey('cep', $ret[ConsultarCepTest::ENDERECO]); $this->assertEquals(str_replace('-', '', $cep), $ret[ConsultarCepTest::ENDERECO]['cep']); $this->assertArrayHasKey(ConsultarCepTest::LOGRADOURO, $ret[ConsultarCepTest::ENDERECO]); $this->assertEquals('Avenida Paulista', $ret[ConsultarCepTest::ENDERECO][ConsultarCepTest::LOGRADOURO]); $this->assertArrayHasKey(ConsultarCepTest::BAIRRO, $ret[ConsultarCepTest::ENDERECO]); $this->assertEquals('Bela Vista', $ret[ConsultarCepTest::ENDERECO][ConsultarCepTest::BAIRRO]); $this->assertArrayHasKey(ConsultarCepTest::CIDADE, $ret[ConsultarCepTest::ENDERECO]); $this->assertEquals('São Paulo', $ret[ConsultarCepTest::ENDERECO][ConsultarCepTest::CIDADE]); $this->assertArrayHasKey('uf', $ret[ConsultarCepTest::ENDERECO]); $this->assertEquals('SP', $ret[ConsultarCepTest::ENDERECO]['uf']); } public function <API key>() { $cep = 'aaa'; $ret = Correios::consultarCEPViaCEP($cep); $this->assertTrue($ret[ConsultarCepTest::ERROR]); $this->assertArrayHasKey(ConsultarCepTest::MESSAGE, $ret); $this-><API key>(ConsultarCepTest::ENDERECO, $ret); $this->assertEquals('CEP inválido', $ret[ConsultarCepTest::MESSAGE]); } public function <API key>() { $cep = '99999-999'; $ret = Correios::consultarCEPViaCEP($cep); $this->assertTrue($ret[ConsultarCepTest::ERROR]); $this->assertArrayHasKey(ConsultarCepTest::MESSAGE, $ret); $this-><API key>(ConsultarCepTest::ENDERECO, $ret); $this->assertEquals('CEP não encontrado', $ret[ConsultarCepTest::MESSAGE]); } }
<div class="content-section introduction"> <div> <span class="feature-title">Calendar</span> <span>Calendar is an input component to select a date.</span> </div> </div> <div class="content-section implementation"> <div class="ui-g ui-fluid"> <div class="ui-g-12 ui-md-4"> <h3>Basic</h3> <p-calendar [(ngModel)]="date1"></p-calendar> {{date1|date}} </div> <div class="ui-g-12 ui-md-4"> <h3>Spanish</h3> <p-calendar [(ngModel)]="date2" [locale]="es" dateFormat="dd/mm/yy"></p-calendar> {{date2|date}} </div> <div class="ui-g-12 ui-md-4"> <h3>Icon</h3> <p-calendar [(ngModel)]="date3" [showIcon]="true"></p-calendar>{{date3|date}} </div> <div class="ui-g-12 ui-md-4"> <h3>Min-Max</h3> <p-calendar [(ngModel)]="date4" [minDate]="minDate" [maxDate]="maxDate" readonlyInput="true"></p-calendar> {{date4|date}} </div> <div class="ui-g-12 ui-md-4"> <h3>Disable Days</h3> <p-calendar [(ngModel)]="date5" tabindex="0" [disabledDates]="invalidDates" [disabledDays]="[0,6]" readonlyInput="true"></p-calendar> {{date5|date}} </div> <div class="ui-g-12 ui-md-4"> <h3>Navigators</h3> <p-calendar [(ngModel)]="date6" [monthNavigator]="true" [yearNavigator]="true" yearRange="2000:2030"></p-calendar> {{date6|date}} </div> <div class="ui-g-12 ui-md-4"> <h3>Time</h3> <p-calendar [(ngModel)]="date7" [showTime]="true"></p-calendar> {{date7}} </div> <div class="ui-g-12 ui-md-4"> <h3>Time Only</h3> <p-calendar [(ngModel)]="date8" [timeOnly]="true"></p-calendar> </div> <div class="ui-g-12 ui-md-4"> <h3>Multiple</h3> <p-calendar [(ngModel)]="dates" selectionMode="multiple" readonlyInput="true"></p-calendar> </div> <div class="ui-g-12 ui-md-4"> <h3>Range</h3> <p-calendar [(ngModel)]="rangeDates" selectionMode="range" readonlyInput="true"></p-calendar> </div> <div class="ui-g-12 ui-md-4"> <h3>Button Bar</h3> <p-calendar [(ngModel)]="date9" showButtonBar="true"></p-calendar> </div> <div class="ui-g-12 ui-md-4"> <h3>Date Template</h3> <p-calendar [(ngModel)]="date10"> <ng-template pTemplate="date" let-date> <span [ngStyle]="{backgroundColor: (date.day < 21 && date.day > 10) ? '#7cc67c' : 'inherit'}" style="border-radius:50%">{{date.day}}</span> </ng-template> </p-calendar> </div> </div> <h3>Inline</h3> <p-calendar [(ngModel)]="date11" [inline]="true"></p-calendar> </div> <div class="content-section documentation"> <p-tabView effect="fade"> <p-tabPanel header="Documentation"> <h3>Import</h3> <pre> <code class="language-typescript" pCode ngNonBindable> import &#123;CalendarModule&#125; from 'primeng/calendar'; </code> </pre> <h3>Getting Started</h3> <p>Two-way value binding is defined using the standard ngModel directive referencing to a Date property.</p> <pre> <code class="language-markup" pCode ngNonBindable> &lt;p-calendar [(ngModel)]="value"&gt;&lt;/p-calendar&gt; </code> </pre> <pre> <code class="language-typescript" pCode ngNonBindable> export class MyModel &#123; value: Date; &#125; </code> </pre> <h3>Model Driven Forms</h3> <p>Calendar can be used in a model driven form as well.</p> <pre> <code class="language-markup" pCode ngNonBindable> &lt;p-calendar formControlName="date"&gt;&lt;/p-calendar&gt; </code> </pre> <h3>Popup and Inline</h3> <p>Calendar is displayed in a popup by default and inline property needs to be enabled for inline mode.</p> <pre> <code class="language-markup" pCode ngNonBindable> &lt;p-calendar [(ngModel)]="value" [inline]="true"&gt;&lt;/p-calendar&gt; </code> </pre> <h3>Selection Mode</h3> <p>By default calendar allows selecting one date and multiple dates can be selected by setting selectionMode to multiple. In this case calendar updates the value with an array of dates where optionally number of selectable dates can be restricted with maxDateCount property. Third alternative is the range mode that allows selecting a range based on an array of two values where first value is the start date and second value is the end date.</p> <h3>DateFormat</h3> <p>Default date format is mm/dd/yy, to customize this use dateFormat property.</p> <pre> <code class="language-markup" pCode ngNonBindable> &lt;p-calendar [(ngModel)]="dateValue" dateFormat="dd.mm.yy"&gt;&lt;/p-calendar&gt; </code> </pre> <p>Following options can be a part of the format.</p> <ul> <li>d - day of month (no leading zero)</li> <li>dd - day of month (two digit)</li> <li>o - day of the year (no leading zeros)</li> <li>oo - day of the year (three digit)</li> <li>D - day name short</li> <li>DD - day name long</li> <li>m - month of year (no leading zero)</li> <li>mm - month of year (two digit)</li> <li>M - month name short</li> <li>MM - month name long</li> <li>y - year (two digit)</li> <li>yy - year (four digit)</li> <li>@ - Unix timestamp (ms since 01/01/1970)</li> <li> ! - Windows ticks (100ns since 01/01/0001)</li> <li>'...' - literal text</li> <li>'' - single quote</li> <li>anything else - literal text</li> </ul> <h3>Time</h3> <p>TimePicker is enabled with showTime property and 24 (default) or 12 hour mode is configured using hourFormat option.</p> <pre> <code class="language-markup" pCode ngNonBindable> &lt;p-calendar [(ngModel)]="value" showTime="true" hourFormat="12"&gt;&lt;/p-calendar&gt; &lt;p-calendar [(ngModel)]="value" showTime="true" hourFormat="24"&gt;&lt;/p-calendar&gt; </code> </pre> <h3>Date Restriction</h3> <p>To disable entering dates manually, set readonlyInput to true and to restrict selectable dates use minDate and maxDate options.</p> <pre> <code class="language-markup" pCode ngNonBindable> &lt;p-calendar [(ngModel)]="dateValue" [minDate]="minDateValue" [maxDate]="maxDateValue" readonlyInput="true"&gt;&lt;/p-calendar&gt; </code> </pre> <h3>Disable specific dates and/or days</h3> <p>To disable specific dates or days, set readonlyInput to true and to restrict selectable dates use disabledDates and/or disabledDays options.</p> <pre> <code class="language-markup" pCode ngNonBindable> &lt;p-calendar [(ngModel)]="dateValue" [disabledDates]="invalidDates" [disabledDays]="[0,6]" readonlyInput="true"&gt;&lt;/p-calendar&gt; </code> </pre> <h3>Button Bar</h3> <p>Button bar displays today and clear buttons and enabled using showButtonBar property.</p> <pre> <code class="language-markup" pCode ngNonBindable> &lt;p-calendar [(ngModel)]="dateValue" showButtonBar="true"&gt;&lt;/p-calendar&gt; </code> </pre> <h3>Localization</h3> <p>Localization for different languages and formats is defined by binding the locale settings object to the locale property. Following is the default values for English.</p> <pre> <code class="language-markup" pCode ngNonBindable> &lt;p-calendar [(ngModel)]="dateValue" [locale]="en"&gt;&lt;/p-calendar&gt; </code> </pre> <pre> <code class="language-typescript" pCode ngNonBindable> export class MyModel &#123; en: any; ngOnInit() &#123; this.en = &#123; firstDayOfWeek: 0, dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], dayNamesMin: ["Su","Mo","Tu","We","Th","Fr","Sa"], monthNames: [ "January","February","March","April","May","June","July","August","September","October","November","December" ], monthNamesShort: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun","Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], today: 'Today', clear: 'Clear' &#125;; &#125; &#125; </code> </pre> <h3>Custom Content</h3> <p>Calendar UI accepts custom content using p-header and p-footer components.</p> <pre> <code class="language-markup" pCode ngNonBindable> &lt;p-calendar [(ngModel)]="dateValue"&gt; &lt;p-header&gt;Header&lt;/p-header&gt; &lt;p-footer&gt;Footer&lt;/p-footer&gt; &lt;/p-calendar&gt; </code> </pre> <p>In addition, cell contents can be templated using an ng-template with a pTemplate directive whose value is "date". This is a handy feature to highlight specific dates. Note that the implicit variable passed to the template is not a date instance but a metadata object to represent a Date with "day", "month" and "year" properties. Example below changes the background color of dates between 10th and 21st of each month.</p> <pre> <code class="language-markup" pCode ngNonBindable> &lt;p-calendar [(ngModel)]="date10"&gt; &lt;ng-template pTemplate="date" let-date&gt; &lt;span [ngStyle]="&#123;backgroundColor: (date.day &lt; 21 && date.day &gt; 10) ? '#7cc67c' : 'inherit'&#125;" style="border-radius:50%"&gt;{{date.day}}&lt;/span&gt; &lt;/ng-template&gt; &lt;/p-calendar&gt; </code> </pre> <h3>Properties</h3> <div class="doc-tablewrapper"> <table class="doc-table"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Default</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>defaultDate</td> <td>Date</td> <td>null</td> <td>Set the date to highlight on first opening if the field is blank.</td> </tr> <tr> <td>selectionMode</td> <td>string</td> <td>single</td> <td>Defines the quantity of the selection, valid values are "single", "multiple" and "range".</td> </tr> <tr> <td>style</td> <td>string</td> <td>null</td> <td>Inline style of the component.</td> </tr> <tr> <td>styleClass</td> <td>string</td> <td>null</td> <td>Style class of the component.</td> </tr> <tr> <td>inputStyle</td> <td>string</td> <td>null</td> <td>Inline style of the input field.</td> </tr> <tr> <td>inputStyleClass</td> <td>string</td> <td>null</td> <td>Style class of the input field.</td> </tr> <tr> <td>inputId</td> <td>string</td> <td>null</td> <td>Identifier of the focus input to match a label defined for the component.</td> </tr> <tr> <td>name</td> <td>string</td> <td>null</td> <td>Name of the input element.</td> </tr> <tr> <td>placeholder</td> <td>string</td> <td>null</td> <td>Placeholder text for the input.</td> </tr> <tr> <td>disabled</td> <td>boolean</td> <td>false</td> <td>When specified, disables the component.</td> </tr> <tr> <td>dateFormat</td> <td>string</td> <td>mm/dd/yy</td> <td>Format of the date.</td> </tr> <tr> <td>inline</td> <td>boolean</td> <td>false</td> <td>When enabled, displays the calendar as inline. Default is false for popup mode.</td> </tr> <tr> <td>showOtherMonths</td> <td>boolean</td> <td>true</td> <td>Whether to display dates in other months (non-selectable) at the start or end of the current month. To make these days selectable use the selectOtherMonths option.</td> </tr> <tr> <td>selectOtherMonths</td> <td>boolean</td> <td>false</td> <td>Whether days in other months shown before or after the current month are selectable. This only applies if the showOtherMonths option is set to true.</td> </tr> <tr> <td>showIcon</td> <td>boolean</td> <td>false</td> <td>When enabled, displays a button with icon next to input.</td> </tr> <tr> <td>showOnFocus</td> <td>boolean</td> <td>true</td> <td>When disabled, datepicker will not be visible with input focus.</td> </tr> <tr> <td>icon</td> <td>string</td> <td>pi pi-calendar</td> <td>Icon of the calendar button.</td> </tr> <tr> <td>appendTo</td> <td>any</td> <td>null</td> <td>Target element to attach the overlay, valid values are "body" or a local ng-template variable of another element.</td> </tr> <tr> <td>readonlyInput</td> <td>boolean</td> <td>null</td> <td>When specified, prevents entering the date manually with keyboard.</td> </tr> <tr> <td>shortYearCutoff</td> <td>string</td> <td>+10</td> <td>The cutoff year for determining the century for a date.</td> </tr> <tr> <td>minDate</td> <td>Date</td> <td>null</td> <td>The minimum selectable date.</td> </tr> <tr> <td>maxDate</td> <td>Date</td> <td>null</td> <td>The maximum selectable date.</td> </tr> <tr> <td>disabledDates</td> <td>Array&lt;Date&gt;</td> <td>null</td> <td>Array with dates that should be disabled (not selectable).</td> </tr> <tr> <td>disabledDays</td> <td>Array&lt;number&gt;</td> <td>null</td> <td>Array with weekday numbers that should be disabled (not selectable).</td> </tr> <tr> <td>monthNavigator</td> <td>boolean</td> <td>false</td> <td>Whether the month should be rendered as a dropdown instead of text.</td> </tr> <tr> <td>yearNavigator</td> <td>boolean</td> <td>false</td> <td>Whether the year should be rendered as a dropdown instead of text.</td> </tr> <tr> <td>yearRange</td> <td>string</td> <td>null</td> <td>The range of years displayed in the year drop-down in (nnnn:nnnn) format such as (2000:2020).</td> </tr> <tr> <td>showTime</td> <td>boolean</td> <td>false</td> <td>Whether to display timepicker.</td> </tr> <tr> <td>hourFormat</td> <td>string</td> <td>24</td> <td>Specifies 12 or 24 hour format.</td> </tr> <tr> <td>locale</td> <td>object</td> <td>null</td> <td>An object having regional configuration properties for the calendar.</td> </tr> <tr> <td>timeOnly</td> <td>boolean</td> <td>false</td> <td>Whether to display timepicker only.</td> </tr> <tr> <td>dataType</td> <td>string</td> <td>date</td> <td>Type of the value to write back to ngModel, default is date and alternative is string.</td> </tr> <tr> <td>required</td> <td>boolean</td> <td>false</td> <td>When present, it specifies that an input field must be filled out before submitting the form.</td> </tr> <tr> <td>tabindex</td> <td>number</td> <td>null</td> <td>Index of the element in tabbing order.</td> </tr> <tr> <td>showSeconds</td> <td>boolean</td> <td>false</td> <td>Whether to show the seconds in time picker.</td> </tr> <tr> <td>stepHour</td> <td>number</td> <td>1</td> <td>Hours to change per step.</td> </tr> <tr> <td>stepMinute</td> <td>number</td> <td>1</td> <td>Minutes to change per step.</td> </tr> <tr> <td>stepSecond</td> <td>number</td> <td>1</td> <td>Seconds to change per step.</td> </tr> <tr> <td>utc</td> <td>boolean</td> <td>false</td> <td>Whether to convert date to UTC on selection.</td> </tr> <tr> <td>maxDateCount</td> <td>number</td> <td>null</td> <td>Maximum number of selectable dates in multiple mode.</td> </tr> <tr> <td>showButtonBar</td> <td>boolean</td> <td>false</td> <td>Whether to display today and clear buttons at the footer</td> </tr> <tr> <td><API key></td> <td>string</td> <td>ui-secondary-button</td> <td>Style class of the today button.</td> </tr> <tr> <td><API key></td> <td>string</td> <td>ui-secondary-button</td> <td>Style class of the clear button.</td> </tr> <tr> <td>baseZIndex</td> <td>number</td> <td>0</td> <td>Base zIndex value to use in layering.</td> </tr> <tr> <td>autoZIndex</td> <td>boolean</td> <td>true</td> <td>Whether to automatically manage layering.</td> </tr> <tr> <td>panelStyleClass</td> <td>string</td> <td>null</td> <td>Style class of the datetimepicker container element.</td> </tr> <tr> <td>keepInvalid</td> <td>boolean</td> <td>false</td> <td>Keep invalid value when input blur.</td> </tr> <tr> <td><API key></td> <td>boolean</td> <td>false</td> <td>Whether to hide the overlay on date selection when showTime is enabled.</td> </tr> </tbody> </table> </div> <h3>Events</h3> <div class="doc-tablewrapper"> <table class="doc-table"> <thead> <tr> <th>Name</th> <th>Parameters</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>onSelect</td> <td>value: Selected value </td> <td>Callback to invoke when a date is selected.</td> </tr> <tr> <td>onBlur</td> <td>event: Blur event </td> <td>Callback to invoke on blur of input field.</td> </tr> <tr> <td>onFocus</td> <td>event: Focus event </td> <td>Callback to invoke on focus of input field.</td> </tr> <tr> <td>onClose</td> <td>event: Close event </td> <td>Callback to invoke when datepicker panel is closed.</td> </tr> <tr> <td>onInput</td> <td>event: Input event </td> <td>Callback to invoke when input field is being typed.</td> </tr> <tr> <td>onTodayClick</td> <td>event: Click event </td> <td>Callback to invoke when today button is clicked.</td> </tr> <tr> <td>onClearClick</td> <td>event: Click event </td> <td>Callback to invoke when clear button is clicked.</td> </tr> <tr> <td>onMonthChange</td> <td>event.month: New month <br /> event.year: New year </td> <td>Callback to invoke when a month is changed using the navigators.</td> </tr> <tr> <td>onYearChange</td> <td>event.month: New month <br /> event.year: New year </td> <td>Callback to invoke when a year is changed using the navigators.</td> </tr> </tbody> </table> </div> <h3>Styling</h3> <p>Following is the list of structural style classes, for theming classes visit <a href="#" [routerLink]="['/theming']">theming page</a>.</p> <div class="doc-tablewrapper"> <table class="doc-table"> <thead> <tr> <th>Name</th> <th>Element</th> </tr> </thead> <tbody> <tr> <td>ui-calendar</td> <td>Wrapper of input element</td> </tr> <tr> <td>ui-inputtext</td> <td>Input element</td> </tr> </tbody> </table> </div> <h3>Dependencies</h3> <p>None.</p> </p-tabPanel> <p-tabPanel header="Source"> <a href="https://github.com/primefaces/primeng/tree/master/src/app/showcase/components/calendar" class="btn-viewsource" target="_blank"> <i class="fa fa-github"></i> <span>View on GitHub</span> </a> <pre> <code class="language-markup" pCode ngNonBindable> &lt;div class="ui-g ui-fluid"&gt; &lt;div class="ui-g-12 ui-md-4"&gt; &lt;h3&gt;Basic&lt;/h3&gt; &lt;p-calendar [(ngModel)]="date1"&gt;&lt;/p-calendar&gt; &#123;&#123;date1|date&#125;&#125; &lt;/div&gt; &lt;div class="ui-g-12 ui-md-4"&gt; &lt;h3&gt;Spanish&lt;/h3&gt; &lt;p-calendar [(ngModel)]="date2" [locale]="es" dateFormat="dd/mm/yy"&gt;&lt;/p-calendar&gt; &#123;&#123;date2|date&#125;&#125; &lt;/div&gt; &lt;div class="ui-g-12 ui-md-4"&gt; &lt;h3&gt;Icon&lt;/h3&gt; &lt;p-calendar [(ngModel)]="date3" [showIcon]="true"&gt;&lt;/p-calendar&gt; &lt;span style="margin-left:35px"&gt;&#123;&#123;date3|date&#125;&#125;&lt;/span&gt; &lt;/div&gt; &lt;div class="ui-g-12 ui-md-4"&gt; &lt;h3&gt;Min-Max&lt;/h3&gt; &lt;p-calendar [(ngModel)]="date4" [minDate]="minDate" [maxDate]="maxDate" readonlyInput="true"&gt;&lt;/p-calendar&gt; &#123;&#123;date4|date&#125;&#125; &lt;/div&gt; &lt;div class="ui-g-12 ui-md-4"&gt; &lt;h3&gt;Disable Days&lt;/h3&gt; &lt;p-calendar [(ngModel)]="date5" tabindex="0" [disabledDates]="invalidDates" [disabledDays]="[0,6]" readonlyInput="true"&gt;&lt;/p-calendar&gt; &#123;&#123;date5|date&#125;&#125; &lt;/div&gt; &lt;div class="ui-g-12 ui-md-4"&gt; &lt;h3&gt;Navigators&lt;/h3&gt; &lt;p-calendar [(ngModel)]="date6" [monthNavigator]="true" [yearNavigator]="true" yearRange="2000:2030"&gt;&lt;/p-calendar&gt; &#123;&#123;date6|date&#125;&#125; &lt;/div&gt; &lt;div class="ui-g-12 ui-md-4"&gt; &lt;h3&gt;Time&lt;/h3&gt; &lt;p-calendar [(ngModel)]="date7" [showTime]="true"&gt;&lt;/p-calendar&gt; &#123;&#123;date7&#125;&#125; &lt;/div&gt; &lt;div class="ui-g-12 ui-md-4"&gt; &lt;h3&gt;Time Only &lt;/h3&gt; &lt;p-calendar [(ngModel)]="date8" [timeOnly]="true"&gt;&lt;/p-calendar&gt; &lt;/div&gt; &lt;div class="ui-g-12 ui-md-4"&gt; &lt;h3&gt;Multiple &lt;/h3&gt; &lt;p-calendar [(ngModel)]="dates" selectionMode="multiple" readonlyInput="true"&gt;&lt;/p-calendar&gt; &lt;/div&gt; &lt;div class="ui-g-12 ui-md-4"&gt; &lt;h3&gt;Range&lt;/h3&gt; &lt;p-calendar [(ngModel)]="rangeDates" selectionMode="range" readonlyInput="true"&gt;&lt;/p-calendar&gt; &lt;/div&gt; &lt;div class="ui-g-12 ui-md-4"&gt; &lt;h3&gt;Button Bar&lt;/h3&gt; &lt;p-calendar [(ngModel)]="date9" showButtonBar="true"&gt;&lt;/p-calendar&gt; &lt;/div&gt; &lt;div class="ui-g-12 ui-md-4"&gt; &lt;h3&gt;Date Template&lt;/h3&gt; &lt;p-calendar [(ngModel)]="date10"&gt; &lt;ng-template pTemplate="date" let-date&gt; &lt;span [ngStyle]="&#123;backgroundColor: (date.day &lt; 21 && date.day &gt; 10) ? '#7cc67c' : 'inherit'&#125;" style="border-radius:50%"&gt;{{date.day}}&lt;/span&gt; &lt;/ng-template&gt; &lt;/p-calendar&gt; &lt;/div&gt; &lt;/div&gt; &lt;h3&gt;Inline&lt;/h3&gt; &lt;p-calendar [(ngModel)]="date11" [inline]="true"&gt;&lt;/p-calendar&gt; </code> </pre> <pre> <code class="language-typescript" pCode ngNonBindable> export class CalendarDemo &#123; date1: Date; date2: Date; date3: Date; date4: Date; date5: Date; date6: Date; date7: Date; date8: Date; date9: Date; date10: Date; date11: Date; dates: Date[]; rangeDates: Date[]; minDate: Date; maxDate: Date; es: any; invalidDates: Array&lt;Date&gt; ngOnInit() &#123; this.es = &#123; firstDayOfWeek: 1, dayNames: [ "domingo","lunes","martes","miércoles","jueves","viernes","sábado" ], dayNamesShort: [ "dom","lun","mar","mié","jue","vie","sáb" ], dayNamesMin: [ "D","L","M","X","J","V","S" ], monthNames: [ "enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre" ], monthNamesShort: [ "ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic" ], today: 'Hoy', clear: 'Borrar' &#125; this.tr = &#123; firstDayOfWeek : 1 &#125; let today = new Date(); let month = today.getMonth(); let year = today.getFullYear(); let prevMonth = (month === 0) ? 11 : month -1; let prevYear = (prevMonth === 11) ? year - 1 : year; let nextMonth = (month === 11) ? 0 : month + 1; let nextYear = (nextMonth === 0) ? year + 1 : year; this.minDate = new Date(); this.minDate.setMonth(prevMonth); this.minDate.setFullYear(prevYear); this.maxDate = new Date(); this.maxDate.setMonth(nextMonth); this.maxDate.setFullYear(nextYear); let invalidDate = new Date(); invalidDate.setDate(today.getDate() - 1); this.invalidDates = [today,invalidDate]; &#125; &#125; </code> </pre> </p-tabPanel> </p-tabView> </div>
#!/bin/python def spl_question(arr, n, k): prev_accum = cumm = tot_pg_num = ques = count = 0 for each_chptr in arr: pgs, rem = divmod(each_chptr, k) ques = prev_accum = cumm = 0 for pg in xrange(pgs): tot_pg_num += 1 ques += k cumm = ques if prev_accum < tot_pg_num <= cumm: count += 1 prev_accum = cumm if rem: tot_pg_num += 1 ques += rem cumm = ques if prev_accum < tot_pg_num <= cumm: count += 1 return count if __name__ == "__main__": n, k = raw_input().strip("\n").split() n, k = int(n), int(k) arr = map(int, raw_input().strip("\n").split()) print spl_question(arr, n, k)
<?php namespace EasyCorp\Bundle\EasyAdminBundle\Config; final class KeyValueStore { private $map; private function __construct(array $keyValueMap) { $this->map = $keyValueMap; } public static function new(array $keyValuePairs = []): self { return new self($keyValuePairs); } public function isEmpty(): bool { return 0 === \count($this->map); } public function has(string $key): bool { if (empty($this->map)) { return false; } $items = $this->map; if (\array_key_exists($key, $items)) { return true; } foreach (explode('.', $key) as $segment) { if (!\is_array($items) || !\array_key_exists($segment, $items)) { return false; } $items = $items[$segment]; } return true; } public function get(string $key, $default = null) { if (\array_key_exists($key, $this->map)) { return $this->map[$key]; } if (false === strpos($key, '.')) { return $default; } $items = $this->map; foreach (explode('.', $key) as $segment) { if (!\is_array($items) || !\array_key_exists($segment, $items)) { return $default; } $items = &$items[$segment]; } return $items; } public function set(string $key, $value): void { $items = &$this->map; foreach (explode('.', $key) as $segment) { if (!isset($items[$segment]) || !\is_array($items[$segment])) { $items[$segment] = []; } $items = &$items[$segment]; } $items = $value; } public function setIfNotSet(string $key, $value): void { if (!$this->has($key)) { $this->set($key, $value); } } public function setAll(array $keyValuePairs): void { foreach ($keyValuePairs as $key => $value) { $this->set($key, $value); } } public function delete(string $key): void { if (\array_key_exists($key, $this->map)) { unset($this->map[$key]); return; } $items = &$this->map; $segments = explode('.', $key); $lastSegment = array_pop($segments); foreach ($segments as $segment) { if (!isset($items[$segment]) || !\is_array($items[$segment])) { return; } $items = &$items[$segment]; } unset($items[$lastSegment]); } public function all(): array { return $this->map; } }
<script src="${basePath}/resources/common/js/calculate.js"></script> <script type="text/javascript"> $.fn.modal.Constructor.prototype.enforceFocus = function () {}; </script> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-remove"></li></button> <h5 class="modal-title"></h5> </div> <section class="content"> <div class="row"> <div class="col-xs-12"> <form id="assets-stk-form" name="assets-stk-form" class="form-horizontal"> <input type="hidden" name="id"> <div class="box box-info"> <div class="box-header with-border"> </div> <div class="box-body"> <div class="col-md-12"> <div class="form-group"> <label class="col-sm-3 control-label"><span style="color:red">*</span></label> <div class="col-sm-5"> <select id="assetsStkID" class="form-control select2" name="stkID" style="width:100%;" disabled="disabled"> <option selected="selected" value=""></option> </select> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label"><span style="color:red">*</span></label> <div class="col-sm-5"> <input type="text" class="form-control" id="quantity" name="quantity" placeholder="" onkeyup="value=value.replace(/[^\d.]/g,'')" readonly="readonly"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label"><span style="color:red">*</span></label> <div class="col-sm-5"> <input type="text" class="form-control" id="model" name="model" readonly="readonly"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label"><span style="color:red">*</span></label> <div class="col-sm-5"> <input type="text" class="form-control" id="norm" name="norm" readonly="readonly"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label"><span style="color:red">*</span></label> <div class="col-sm-5"> <input type="text" class="form-control" id="vendor" name="vendor" readonly="readonly"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label"><span style="color:red">*</span></label> <div class="col-sm-5"> <input type="text" class="form-control" id="quantityReturned" name="quantityReturned" placeholder="" onkeyup="value=value.replace(/[^\d.]/g,'')" readonly="readonly"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label"><span style="color:red">*</span></label> <div class="col-sm-5"> <input type="text" class="form-control" id="quantityReturning" name="quantityReturning" placeholder="" onkeyup="value=value.replace(/[^\d.]/g,'')"> </div> </div> </div> </div> <div class="box-footer text-center" id="assetsstksave"> <button type="submit" class="btn btn-primary" data-btn-type="next"></button> </div> </div> </form> </div> </div> </section> <script> $.fn.modal.Constructor.prototype.enforceFocus =function(){}; var assetsstkform = $("#assets-stk-form").form({baseEntity: false}), initData={}; var id="${id?default(0)}"; var stkOptions = '${stkOptions?default(0)}',options=0; if(stkOptions != 0){ faOptions = JSON.parse(stkOptions); } $(function (){ if(faOptions != 0){ for (var i = 0, len = faOptions.length; i < len; i++) { var option = faOptions[i]; $('#assetsStkID').append("<option value=\"" + option.value + "\">" + option.data + "</option>"); } $('#assetsStkID').select2(); } $("#assets-stk-form").bootstrapValidator({ message: '', feedbackIcons: { valid: 'glyphicon glyphicon-ok', invalid: 'glyphicon glyphicon-remove', validating: 'glyphicon glyphicon-refresh' }, submitHandler: function () { var formData = assetsstkform.getFormSimpleData(); console.log(formData); ajaxPost(basePath + '/fixedassets/use/returnsubmit', formData, function (data) { if (data.success) { modals.hideWin(assetsWinId); } else { modals.error(data.message); } }); }, fields: { "quantityReturning": { validators: { notEmpty: {message: ''}, callback : { message: '', callback : function(value, validator) { var sub = accAddition(value, $('#quantityReturned').val()); if(parseFloat(sub) > parseFloat($('#quantity').val())){ return false; } return true; } } } } } }); if(id != 0){ ajaxPost(basePath+"/fixedassets/use/getuse",{id:id},function(data){ assetsstkform.initFormData(data); }) } assetsstkform.initComponent(); }); </script>
<?php return array ( 'id' => '<API key>', 'fallback' => '<API key>', 'capabilities' => array ( 'model_name' => 'SGH-T659', 'brand_name' => 'Samsung', 'release_date' => '2009_september', 'softkey_support' => 'true', 'table_support' => 'true', 'wml_1_1' => 'true', 'wml_1_2' => 'true', 'wml_1_3' => 'true', 'columns' => '20', 'rows' => '16', 'max_image_width' => '228', 'resolution_width' => '240', 'resolution_height' => '320', 'max_image_height' => '280', 'jpg' => 'true', 'gif' => 'true', 'bmp' => 'true', 'wbmp' => 'true', 'png' => 'true', 'colors' => '65536', 'nokia_voice_call' => 'true', 'max_deck_size' => '5000', '<API key>' => '1', '<API key>' => '0', 'wap_push_support' => 'true', 'mms_png' => 'true', 'mms_max_size' => '614400', 'mms_max_width' => '0', 'mms_spmidi' => 'true', 'mms_max_height' => '0', 'mms_gif_static' => 'true', 'mms_wav' => 'true', 'mms_vcard' => 'true', 'mms_midi_monophonic' => 'true', 'mms_bmp' => 'true', 'mms_wbmp' => 'true', 'mms_amr' => 'true', 'mms_jpeg_baseline' => 'true', 'sp_midi' => 'true', 'mp3' => 'true', 'amr' => 'true', 'midi_monophonic' => 'true', 'imelody' => 'true', 'j2me_midp_2_0' => 'true', 'j2me_cldc_1_0' => 'true', 'j2me_cldc_1_1' => 'true', 'j2me_midp_1_0' => 'true', 'max_data_rate' => '1800', 'css_spriting' => 'true', ), );
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>fsets: Not compatible </title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file: <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif] </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.9.0 / fsets - 8.6.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> fsets <small> 8.6.0 <span class="label label-info">Not compatible </span> </small> </h1> <p> <em><script>document.write(moment("2022-01-23 18:18:12 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-01-23 18:18:12 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base camlp5 7.14 <API key> of OCaml conf-findutils 1 Virtual package relying on findutils conf-perl 1 Virtual package relying on perl coq 8.9.0 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.07.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.07.1 Official release 4.07.1 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Hugo.Herbelin@inria.fr&quot; homepage: &quot;https://github.com/coq-contribs/fsets&quot; license: &quot;LGPL 2.1&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/FSets&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.6&quot; &amp; &lt; &quot;8.7~&quot;} ] tags: [ &quot;keyword: finite sets&quot; &quot;keyword: sorted lists&quot; &quot;keyword: balanced trees&quot; &quot;keyword: red-black trees&quot; &quot;keyword: AVL&quot; &quot;keyword: functors&quot; &quot;keyword: data structures&quot; &quot;category: Computer Science/Data Types and Data Structures&quot; &quot;category: Miscellaneous/Extracted Programs/Data structures&quot; ] authors: [ &quot;Pierre Letouzey&quot; &quot;Jean-Christophe Filliâtre&quot; ] bug-reports: &quot;https://github.com/coq-contribs/fsets/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/fsets.git&quot; synopsis: &quot;Finite Sets overs Ordered Types&quot; description: &quot;&quot;&quot; This contribution contains several implementations of finite sets over arbitrary ordered types using functors. Currently, there are 3 implementations: sorted lists, red-black trees and AVLs.&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/fsets/archive/v8.6.0.tar.gz&quot; checksum: &quot;md5=<API key>&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install </h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-fsets.8.6.0 coq.8.9.0</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.9.0). The following dependencies couldn&#39;t be met: - coq-fsets -&gt; coq &lt; 8.7~ -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-fsets.8.6.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install </h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https: </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
<?php namespace HomeBundle\Entity; use Doctrine\ORM\Mapping as ORM; /** * Personnes * * @ORM\Table(name="personnes") * @ORM\Entity */ class Personnes { /** * @var integer * * @ORM\Column(name="idPersonnes", type="integer", nullable=false) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ private $idpersonnes; /** * @var string * * @ORM\Column(name="Nom", type="string", length=45, nullable=true) */ private $nom; /** * @var string * * @ORM\Column(name="Prenom", type="string", length=45, nullable=true) */ private $prenom; /** * @var \Doctrine\Common\Collections\Collection * * @ORM\ManyToMany(targetEntity="Fait", mappedBy="personnes") */ private $fait; /** * Constructor */ public function __construct() { $this->fait = new \Doctrine\Common\Collections\ArrayCollection(); } /** * Get idpersonnes * * @return integer */ public function getIdpersonnes() { return $this->idpersonnes; } /** * Set nom * * @param string $nom * @return Personnes */ public function setNom($nom) { $this->nom = $nom; return $this; } /** * Get nom * * @return string */ public function getNom() { return $this->nom; } /** * Set prenom * * @param string $prenom * @return Personnes */ public function setPrenom($prenom) { $this->prenom = $prenom; return $this; } /** * Get prenom * * @return string */ public function getPrenom() { return $this->prenom; } /** * Add fait * * @param Fait $fait * @return Personnes */ public function addfait(Fait $fait) { $this->fait[] = $fait; return $this; } /** * Remove fait * * @param Fait $fait */ public function removefait(Fait $fait) { $this->fait->removeElement($fait); } /** * Get fait * * @return \Doctrine\Common\Collections\Collection */ public function getfait() { return $this->fait; } }
import os.path from crepehat import SObject class Kitchen(SObject): sources = [] extensions = [] def __init__(self, sources, extensions=None): if not hasattr(sources, "__iter__"): sources = [sources] self.sources = sources if extensions and not hasattr(extensions, "__iter__"): extensions = [extensions] self.extensions = extensions def get(self, path, extensions=None, overridable=True): if self.extensions and extensions != False or extensions: path = os.path.splitext(path)[0] if not hasattr(extensions, "__iter__"): extensions = self.extensions if not overridable: if extensions: if os.path.isfile(os.path.join(self.sources[-1], path+self.extensions[-1])): return os.path.join(self.sources[-1], path+self.extensions[-1]) else: if os.path.isfile(os.path.join(self.sources[-1], path)): return os.path.join(self.sources[-1], path) return False for source in self.sources: j = os.path.join(source, path) if extensions: for ext in extensions: if os.path.isfile(j+ext): return j+ext else: if os.path.isfile(j): return j return False
package org.ojalgo.random; import static org.ojalgo.function.constant.PrimitiveMath.*; import org.ojalgo.array.Array1D; import org.ojalgo.structure.Access1D; /** * A continuous distribution in which the logarithm of a variable has a normal distribution. A log normal * distribution results if the variable is the product of a large number of independent, * <API key> variables in the same way that a normal distribution results if the variable is the * sum of a large number of independent, <API key> variables. * * @author apete */ public class LogNormal extends AbstractContinuous { public static LogNormal estimate(final Access1D<?> rawSamples) { final int size = rawSamples.size(); final Array1D<Double> logSamples = Array1D.PRIMITIVE64.make(size); for (int i = 0; i < size; i++) { logSamples.set(i, LOG.invoke(rawSamples.doubleValue(i))); } final SampleSet sampleSet = SampleSet.wrap(logSamples); return new LogNormal(sampleSet.getMean(), sampleSet.<API key>()); } public static LogNormal make(final double mean, final double variance) { final double tmpVar = LOG1P.invoke(variance / (mean * mean)); final double location = LOG.invoke(mean) - (HALF * tmpVar); final double scale = SQRT.invoke(tmpVar); return new LogNormal(location, scale); } private final Normal myNormal; public LogNormal() { this(ZERO, ONE); } /** * The location and scale parameters are the mean and standard deviation of the variable's logarithm (by * definition, the variable's logarithm is normally distributed). */ public LogNormal(final double location, final double scale) { super(); myNormal = new Normal(location, scale); } public double getDensity(final double value) { return myNormal.getDensity(LOG.invoke(value)) / value; } public double getDistribution(final double value) { return myNormal.getDistribution(LOG.invoke(value)); } public double getExpected() { return EXP.invoke(myNormal.getExpected() + (myNormal.getVariance() * HALF)); } /** * The geometric mean is also the median */ public double getGeometricMean() { return EXP.invoke(myNormal.getExpected()); } public double <API key>() { return EXP.invoke(myNormal.<API key>()); } public double getQuantile(final double probability) { this.checkProbabilty(probability); return EXP.invoke(myNormal.getQuantile(probability)); } @Override public double getVariance() { final double tmpVariance = myNormal.getVariance(); return EXPM1.invoke(tmpVariance) * EXP.invoke((TWO * myNormal.getExpected()) + tmpVariance); } @Override public void setSeed(final long seed) { myNormal.setSeed(seed); } @Override protected double generate() { return EXP.invoke(myNormal.generate()); } }
<?php namespace KZ\controller\interfaces; use KZ\Controller; /** * Prepare response for different type of requests. * For example: * For ajax request - it will renderPartial given template, put it in json and output as JSON. * For simple request - it will render given template and output it. * * Interface Response * @package KZ\controller\interfaces */ interface Response { /** * @param Request $request */ public function __construct(Request $request); /** * Set controller to have access to view instance. * * @param \KZ\Controller $controller * @return $this */ public function setController(Controller $controller); /** * Render template. If it is ajax request - result will be * put in 'html' => $result and outputted as JSON. * * If it is simple request from browser - result will be outputted as string. * * @param $localPath * @param array $data * @return void */ public function render($localPath, array $data = []); /** * if it is ajax request - will be outputted json: 'redirect' => 'url' * if it is simple request - header "Location" will be sent. * * @param \KZ\link\interfaces\Link|string $url * @return void */ public function redirect($url); /** * Set additional data to ajax response. * * @param array $json * @return $this */ public function setJson(array $json); /** * Output Json with special headers. * * @param array $json * @return void */ public function json(array $json = []); /** * @param bool $value * @return $this */ public function exitAfterRedirect($value); /** * @return bool */ public function isExitAfterRedirect(); }
<?php namespace Pvm\ArtisanBeans\Console; class MoveCommand extends BaseCommand { protected $commandName = 'move'; protected $commandArguments = ' {from : Source tube name} {to : Destination tube name} {state=ready : State [ready|delayed|buried] in the source tube} {count=1 : Number of jobs to move} '; protected $commandOptions = ' {--delay=0 : Delay (in seconds)} {--ttr= : New TTR (in seconds)} {--priority= : New priority} '; protected $description = 'Move jobs between tubes'; protected $state; protected $count; protected $delay; protected $priority; protected $ttr; /** * {@inheritdoc} */ public function handle() { $this->parseArguments(); if ($this->count > 1) { if (! $this->confirmToProceed("You are about to move $this->count jobs from '".$this->argument('from')."' to '".$this->argument('to')."'.")) { return; } } $moved = 0; while ($job = $this->getNextJob($this->argument('from'), $this->state)) { if ($this->count > 0 && $moved >= $this->count) { break; } // Read the job's stats in order to preserve priority and ttr $stats = $this->getJobStats($job); $this->putJob($this->argument('to'), $job->getData(), $this->priority ?: $stats['pri'], $this->delay, $this->ttr ?: $stats['ttr']); $this->deleteJob($job); $moved++; } if (0 == $moved) { $this-><API key>($this->argument('from'), $this->state); } else { $this->comment("Moved $moved jobs from '".$this->argument('from')."' to '".$this->argument('to')."'."); } } /** * {@inheritdoc} */ protected function <API key>() { $this->state = strtolower($this->argument('state')); if (! in_array($this->state, ['ready', 'buried', 'delayed'])) { throw new \<API key>("Invalid state '$this->state'."); } if (false === ($this->count = filter_var($this->argument('count'), FILTER_VALIDATE_INT, ['options' => ['min_range' => 1]]))) { throw new \<API key>('Count should be a positive integer.'); } if (false === ($this->delay = filter_var($this->option('delay'), FILTER_VALIDATE_INT, ['options' => ['min_range' => 0]]))) { throw new \<API key>('Delay should be a positive integer or 0.'); } if (! is_null($this->option('ttr'))) { if (false === ($this->ttr = filter_var($this->option('ttr'), FILTER_VALIDATE_INT, ['options' => ['min_range' => 1]]))) { throw new \<API key>('TTR should be a positive integer.'); } } if (! is_null($this->option('priority'))) { if (false === ($this->priority = filter_var($this->option('priority'), FILTER_VALIDATE_INT, ['options' => ['min_range' => 0]]))) { throw new \<API key>('Priority should be a positive integer or 0.'); } } } /** * Fetches the next job from the tube. * For ready jobs do reserve, for delayed and buried - peek. * * @param $tube * @param $state * * @return bool|object|\Pheanstalk\Job|void */ private function getNextJob($tube, $state) { if ('ready' == $this->state) { return $this->reserveJob($tube); } return $this->peekJob($tube, $state); } }
<?php namespace gries\Pokemath\Numbers; use gries\Pokemath\PokeNumber; class Slurpuff extends PokeNumber { public function __construct() { parent::__construct('slurpuff'); } }
from django.apps import AppConfig class GeoTweetsConfig(AppConfig): name = 'geo_tweets'
/*$( window ).resize(function() { location.reload(); }); */ $(document).ready(function(){ });
#icono **icono** is an icon pack that needs no external resources. Every tags can be an icon made with **pure CSS**. [Demo][2] ##How to use To get going with icono you can: * Download [icono.min.css][1] or * Install it with [Bower](http: And then load it in your page: `<link rel="stylesheet" href="icono.min.css">` or You can add icono folder in your project and import icono.less for compile. iconos maincolor can be changed in **variable.less**. and then just add iconos classes to any type of elements that support psuedo-element. #Example: `<i class="icono-mail"></i>` `<div class="icono-mail"></div>` `<span class="icono-mail"></span>` `<whatever class="icono-mail"></whatever>` Also you can change color of icons as simple as set color for an element. #Example: `i.heart{color: red;}` ##Available classes * `icono-home` * `icono-mail` * `icono-rss` * `icono-hamburger` * `icono-plus` * `icono-cross` * `icono-check` * `icono-power` * `icono-heart` * `icono-infinity` * `icono-flag` * `icono-file` * `icono-image` * `icono-video` * `icono-music` * `icono-headphone` * `icono-document` * `icono-folder` * `icono-pin` * `icono-smile` * `icono-eye` * `icono-sliders` * `icono-share` * `icono-sync` * `icono-reset` * `icono-gear` * `icono-signIn` * `icono-signOut` * `icono-support` * `icono-dropper` * `icono-tiles` * `icono-list` * `icono-chain` * `icono-youtube` * `icono-rename` * `icono-search` * `icono-book` * `icono-forbidden` * `icono-trash` * `icono-keyboard` * `icono-mouse` * `icono-user` * `icono-crop` * `icono-display` * `icono-imac` * `icono-iphone` * `icono-macbook` * `icono-imacBold` * `icono-iphoneBold` * `icono-macbookBold` * `icono-nexus` * `icono-microphone` * `icono-asterisk` * `icono-terminal` * `icono-paperClip` * `icono-market` * `icono-clock` * `<API key>` * `<API key>` * `icono-textAlignLeft` * `icono-indent` * `icono-outdent` * `icono-frown` * `icono-meh` * `icono-locationArrow` * `icono-plusCircle` * `icono-checkCircle` * `icono-crossCircle` * `icono-exclamation` * `<API key>` * `icono-comment` * `icono-commentEmpty` * `icono-areaChart` * `icono-pieChart` * `icono-barChart` * `icono-bookmark` * `icono-bookmarkEmpty` * `icono-filter` * `icono-volume` * `icono-volumeLow` * `icono-volumeMedium` * `icono-volumeHigh` * `<API key>` * `<API key>` * `icono-volumeMute` * `icono-tag` * `icono-calendar` * `icono-camera` * `icono-piano` * `icono-ruler` [1]:http://saeedalipoor.github.io/icono/icono.min.css [2]:http://saeedalipoor.github.io/icono
package ru.webim.android.sdk; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.google.gson.annotations.SerializedName; import java.util.List; /** * Abstracts a push notification * @see Webim#<API key>(String) */ public interface <API key> { /** * @return the type of the notification */ @Nullable NotificationType getType(); /** * This method may return of two values: * <ul> * <li>"add" - means that a notification should be added by this push</li> * <li>"del" - means that a notification should be deleted by this push</li> * </ul> * @return the event of this notification */ @NonNull String getEvent(); /** * @return parameters of this notification. Each {@link NotificationType} has specific list of parameters * @see NotificationType */ @Nullable List<String> getParams(); @Nullable String getLocation(); int <API key>(); /** * * @see <API key>#getType() */ enum NotificationType { /** * This notification type indicated that contact information request is sent to a visitor. * Parameters: empty. */ @SerializedName("P.CR") <API key>, /** * This notification type indicated that an operator has connected to a dialogue. * Parameters: * <ul> * <li>operator's name</li> * </ul> */ @SerializedName("P.OA") OPERATOR_ACCEPTED, /** * This notification type indicated that an operator has sent a file. * Parameters: * <ul> * <li>Operator's name</li> * <li>name of a file</li> * </ul> */ @SerializedName("P.OF") OPERATOR_FILE, /** * This notification type indicated that an operator has sent a text message. * Parameters: * <ul> * <li>Operator's name</li> * <li>Text</li> * </ul> */ @SerializedName("P.OM") OPERATOR_MESSAGE, /** * This notification type indicated that an operator has sent a widget message. * This type can be received only if server supports this functionality. * Parameters: empty. */ @SerializedName("P.WM") WIDGET, /** * This notification type indicated that the visitor needs to rate the operator. */ @SerializedName("P.RO") RATE_OPERATOR } }
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class Email_Model extends CI_Model { private $emailTable = 'email'; private $emailColumn = 'email_id'; public function __construct() { parent::__construct(); } public function <API key>($data) { $attributes = array( 'name' => $data, 'id' => $data, 'type' => 'text', 'class' => 'form-control input-md', 'placeholder' => 'insert '.str_replace('_', ' ', $data).' here' ); return $attributes; } public function <API key>($data) { $attributes = array( 'name' => $data, 'id' => $data, 'type' => 'text', 'class' => 'form-control date-picker', 'placeholder' => 'select '.str_replace('_', ' ', $data).' here' ); return $attributes; } public function <API key>($data) { $attributes = array( 'name' => $data, 'id' => $data, 'class' => 'selectpicker', 'data-live-search' => 'true' ); return $attributes; } public function form_select_options($data) { $query = $this->db->get($this->emailTable); $arr[] = array( '0' => 'select '.str_replace('_', ' ', $data).' here', ); foreach ($query->result() as $row) { $arr[] = array( $row->email_id => $row->email_description ); } $array = array(); foreach($arr as $arrs) foreach($arrs as $key => $val) $array[$key] = $val; return $array; } public function <API key>($id) { $this->db->select('*'); $this->db->from($this->emailTable.' as bus'); $this->db->join('customer as cus','bus.email_id = cus.email_id'); $this->db->where('cus.customer_id',$id); $query = $this->db->get(); if($query->num_rows() > 0) { foreach ($query->result() as $row) { $id = $row->email_id; } return $id; } else { return $id = '0'; } } public function <API key>($data, $id) { if(isset($id) && !empty($id)) { $this->db->select('*'); $this->db->from($this->emailTable.' as con_per'); $this->db->join('customer as cus','con_per.customer_id = cus.customer_id'); $this->db->where('cus.customer_id',$id); $query = $this->db->get(); foreach ($query->result() as $row) { $value = $row->$data; } $attributes = array( 'name' => $data, 'id' => $data, 'rows' => '5', 'value' => $value, 'class' => 'auto-size form-control', 'placeholder' => 'insert '.str_replace('_', ' ', $data).' here' ); } else { $attributes = array( 'name' => $data, 'id' => $data, 'rows' => '5', 'class' => 'auto-size form-control', 'placeholder' => 'insert '.str_replace('_', ' ', $data).' here' ); } return $attributes; } public function <API key>($data, $id) { if(isset($id) && !empty($id)) { $this->db->select('*'); $this->db->from('email'); $this->db->where('email_table', 'customer'); $this->db->where('email_table_id', $id); $query = $this->db->get(); foreach ($query->result() as $row) { $value = $row->$data; } $attributes = array( 'name' => $data, 'id' => $data, 'type' => 'text', 'value' => $value, 'class' => 'form-control input-md numeric', 'placeholder' => 'insert '.str_replace('_', ' ', $data).' here' ); } else { $attributes = array( 'name' => $data, 'id' => $data, 'type' => 'text', 'class' => 'form-control input-md', 'placeholder' => 'insert '.str_replace('_', ' ', $data).' here' ); } return $attributes; } public function insert($data) { $this->db->insert($this->emailTable, $data); return $this->db->insert_id(); } public function modify($data, $id) { $this->db->where($this->emailColumn, $id); $this->db->update($this->emailTable, $data); return true; } public function <API key>($start_from=0, $limit=0, $resources_id) { $this->db->select('*'); $this->db->from($this->emailTable. ' as em'); $this->db->join('status as stat','em.email_id = stat.status_table_id'); $this->db->where('stat.status_table', $this->emailTable); $this->db->where('stat.status_code', 1); $this->db->where('em.email_table', 'resources'); $this->db->where('em.email_table_id', $resources_id); $this->db->order_by('em.'.$this->emailColumn, 'DESC'); $query = $this->db->limit( $limit, $start_from )->get(); return $query; } public function <API key>($resources_id) { $this->db->select('*'); $this->db->from($this->emailTable. ' as em'); $this->db->join('status as stat','em.email_id = stat.status_table_id'); $this->db->where('stat.status_table', $this->emailTable); $this->db->where('stat.status_code', 1); $this->db->where('em.email_table', 'resources'); $this->db->where('em.email_table_id', $resources_id); $this->db->order_by('em.'.$this->emailColumn, 'DESC'); $query = $this->db->get(); return $query; } public function <API key>($wildcard, $start_from=0, $limit=0, $resources_id) { $this->db->select('*'); $this->db->from($this->emailTable. ' as em'); $this->db->join('status as stat','em.email_id = stat.status_table_id'); $this->db->where('stat.status_table', $this->emailTable); $this->db->where('stat.status_code', 1); $this->db->where('add.email_table', 'resources'); $this->db->group_start(); $this->db->where('em.email_table_id', $resources_id); $this->db->or_where('em.email_address LIKE', $wildcard . '%'); $this->db->or_where('em.email_description LIKE', $wildcard . '%'); $this->db->group_end(); $this->db->order_by('em.'.$this->emailColumn, 'DESC'); $query = $this->db->limit( $limit, $start_from )->get(); return $query; } public function <API key>($wildcard, $resources_id) { $this->db->select('*'); $this->db->from($this->emailTable. ' as add'); $this->db->join('status as stat','em.email_id = stat.status_table_id'); $this->db->where('stat.status_table', $this->emailTable); $this->db->where('stat.status_code', 1); $this->db->where('em.email_table', 'resources'); $this->db->group_start(); $this->db->where('em.email_table_id', $resources_id); $this->db->or_where('em.email_address LIKE', $wildcard . '%'); $this->db->or_where('em.email_description LIKE', $wildcard . '%'); $this->db->group_end(); $this->db->order_by('em.'.$this->emailColumn, 'DESC'); $query = $this->db->get(); return $query; } public function <API key>($data, $id) { $attributes = array( 'name' => $data, 'id' => $data, 'type' => 'text', 'class' => 'form-control input-md', 'placeholder' => 'insert '.str_replace('_', ' ', $data).' here' ); return $attributes; } public function <API key>($data, $id) { $attributes = array( 'name' => $data, 'id' => $data, 'type' => 'email', 'class' => 'form-control input-md', 'placeholder' => 'insert '.str_replace('_', ' ', $data).' here' ); return $attributes; } public function find($id) { $query = $this->db->where($this->emailColumn, $id)->get($this->emailTable); foreach($query->result() as $row) { $arr[] = array( 'email_address' => $row->email_address, 'email_description' => $row->email_description ); } return $arr; } }
class MessageDefinitions def self.define_message(message_type, opts = {}, &block) definer = DefinedMessage.new definer.load_message_from(&block) @@definitions ||= {} @@definitions[message_type.to_s] ||= [] opts[:version] ||= 1 definer.version = opts[:version] @@definitions[message_type.to_s][opts[:version]] = definer end def self.get_definition_for(message_type, version_or_device = nil) @@definitions ||= {} @@definitions[message_type.to_s] ||= [] if version_or_device.is_a?(Device) version_to_use = version_or_device.<API key>(message_type.to_s) if version_to_use == :latest @@definitions[message_type.to_s].last else @@definitions[message_type.to_s][version_to_use] end elsif version_or_device @@definitions[message_type.to_s][version_or_device] else @@definitions[message_type.to_s].last end end end
$LOAD_PATH.unshift << 'lib' STDOUT.sync = true # Defines our constants APP_ENV = ENV['RACK_ENV'] ||= 'development' unless defined?(APP_ENV) APP_ROOT = File.expand_path('../..', __FILE__) unless defined?(APP_ROOT) # Load our dependencies require 'bundler/setup' Bundler.require(:default, APP_ENV) require '!{projectnamelower}' require !{project_name_camel}.root('config', 'database') require !{project_name_camel}.root('app', 'app') Dir[!{project_name_camel}.root('app', 'controllers', '**/*.rb')].each {|f| require f}
# How to build and deploy for Windows? You *will* need Visual Studio 2015 in order for compilation to work. (We need full C++11 support, not what VS2013 provides) Compiling 32-bit will not be supported officially; if that breaks, nobody cares. It is also possible to build for MinGW-W64, but this is not a focus since it brings with it a lot of extra DLLs. It is available through the `quick-build.sh` target called `mingw.w64`. For setting up an environment, refer to `BUILDING.md` on Windows Makefiles, as it is usable in Visual Studio. **NB**: Note that Windows is not fully supported or tested at all times. # Platform implementation Uses Win32 where Microsoft won't let us use POSIX. Reuses POSIX functions where possible, although this is not always the case.
using Bebbs.Harmonize.With.Component; using EventSourceProxy; using System; using System.Collections.Generic; using System.Linq; using Config = SimpleConfig.Configuration; namespace Bebbs.Harmonize.With.LightwaveRf.Configuration { [<API key>(Name = "<API key>")] public interface IProvider { ISettings GetSettings(); IEnumerable<IDevice> GetDevices(); } internal class Provider : IProvider { private static readonly Lazy<WifiLink> WifiLink = new Lazy<WifiLink>(() => Config.Load<WifiLink>(sectionName: "wifiLink")); public ISettings GetSettings() { return WifiLink.Value.Settings; } public IEnumerable<IDevice> GetDevices() { return WifiLink.Value.Devices.Dimmers; } } }
valgrind -v --track-origins=yes --leak-check=full --show-leak-kinds=all --read-var-info=yes --<API key>=yes ./easyCUnit 2> valgrind_test_00$1.log
console.log('jenks.js'); function httpGet(theUrl) { var xmlHttp = new XMLHttpRequest(); xmlHttp.open( "GET", theUrl, false ); // false for synchronous request xmlHttp.send( null ); // console.log('HTTP - GETR Synchrone: \n' + xmlHttp.responseText); // DEBUG return xmlHttp.responseText; }; function stats(data, the_field, n_jenks) { console.log(data) items = []; $.each(data.features, function (key, val) { $.each(val.properties, function(i,j){ if (i == the_field) { console.log(j); items.push(j); }; }); }); classifier = new geostats(items); jenksResult = classifier.getJenks(n_jenks); ranges = classifier.getRanges(n_jenks); var color_x = chroma.scale('PuRd').colors(n_jenks) console.log(items); console.log(jenksResult); console.log(color_x); // return items, jenksResult, color_x; return { items: items, jenksResult: jenksResult, color_x:color_x, ranges: ranges }; }; function stats_json(json_text, the_field, n_jenks) { console.log('Function stats_json(json_text, the_field, n_jenks)'); var data = jQuery.parseJSON(json_text); items = []; $.each(data.features, function (key, val) { $.each(val.properties, function(i,j){ if (i == the_field) { items.push(j); }; }); }); classifier = new geostats(items); jenksResult = classifier.getJenks(n_jenks); ranges = classifier.getRanges(n_jenks); var color_x = chroma.scale('PuRd').colors(n_jenks) console.log(items); console.log(jenksResult); console.log(color_x); // return items, jenksResult, color_x; return { items: items, jenksResult: jenksResult, color_x:color_x, ranges: ranges }; }; function jenks_stats(json_text, the_field, n_jenks) { /* Ex: var items = resultat.items; var jenksResult = resultat.jenksResult; var color_x = resultat.color_x; var ranges = resultat.ranges; */ console.log('Function stats_json(json_text, the_field, n_jenks)'); var data = json_text; //jQuery.parseJSON(json_text); items = []; $.each(data.features, function (key, val) { $.each(val.properties, function(i,j){ if (i == the_field) { items.push(j); }; }); }); classifier = new geostats(items); jenksResult = classifier.getJenks(n_jenks); ranges = classifier.getRanges(n_jenks); var color_x = chroma.scale('PuRd').colors(n_jenks) console.log(items); console.log(jenksResult); console.log(color_x); // return items, jenksResult, color_x; return { items: items, jenksResult: jenksResult, color_x:color_x, ranges: ranges }; }; function create_ol3_styles(jenksResult, color_x) { /* Creates the ol3 styles liste according to stats Ex: var ol3_styles = create_ol3_styles(jenksResult, color_x); */ var ol3_styles = []; var index, len; for (index = 0, len = jenksResult.length; index < len; ++index) { if (index != 0) { console.log(index, jenksResult[index], color_x[index-1]); var style = new ol.style.Style({ stroke: new ol.style.Stroke({ color: 'rgba(200, 0, 0, 1.)', width: 2 }), fill: new ol.style.Fill({ color: color_x[index-1] }) }); ol3_styles.push(style); }; }; return ol3_styles; } function <API key>(feature, resolution, jenksResult, color_x, ol3_styles) { for (index = 0, len = jenksResult.length; index < len; ++index) { if (index != 0) { if ( feature.get(jenks_field) <= jenksResult[index]) { return ol3_styles[index - 1]; }; }; }; }; function create_wfs_legend(layer_title, jenksResult, color_x) { console.log('Creating legend for ' + layer_title); wfs_layer_legend = layer_title + '<br/>'; var index, len; for (index = 0, len = jenksResult.length; index < len; ++index) { if (index != 0) { wfs_layer_legend += '<div style="color:' + color_x[index-1] + ';">'+ ranges[index-1]+'</div>'; }; }; // wfs_layer_legend = '\ // <svg width="400" height="110">\ // <rect width="300" height="100" style="fill:rgb(0,0,255);stroke-width:3;stroke:rgb(0,0,0)" />\ // </svg>'; // wfs_layer_legend = '\ // <svg width="200" height="50">\ // <rect x="0" y="5" width="20" height="10" style="fill:rgb(0,0,255);stroke-width:3;stroke:rgb(0,0,0)" /><text x="25" y="15" style="fill:black;">Mes classes</text>\ // </svg>'; console.log(' wfs_layer_legend = layer_title + '<svg width="200" height="500">'; var index, len; var y = 15; var compteur = 1; for (index = 0, len = jenksResult.length; index < len; ++index) { if (index != 0) { var y_pos = y * compteur + 1; var y_pos_text = y * compteur + 1 + 10; console.log(y_pos); // wfs_layer_legend += '<div style="color:' + color_x[index-1] + ';">'+ ranges[index-1]+'</div>'; wfs_layer_legend += '<rect x="0" y="' + y_pos + '" width="40" height="10" style="fill:' + color_x[index-1] + ';stroke-width:1;stroke:rgb(0,0,0)" />'; wfs_layer_legend += '<text x="50" y="' + y_pos_text + '" style="fill:black;">' + ranges[index-1] + '</text>'; }; compteur += 1; console.log('Compteur = ' + compteur); }; wfs_layer_legend += '</svg>'; return wfs_layer_legend; };
using System.Web; using System.Web.Mvc; namespace SIM { public class FilterConfig { public static void <API key>(<API key> filters) { filters.Add(new <API key>()); } } }
<!DOCTYPE html> <!--[if lt IE 9]><html class="no-js lt-ie9" lang="en" dir="ltr"><![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en" dir="ltr"> <!--<![endif]--> <!-- Usage: /eic/site/ccc-rec.nsf/tpl-eng/template-1col.html?Open&id=3 (optional: ?Open&page=filename.html&id=x) --> <!-- Created: ; Product Code: 536; Server: stratnotes2.ic.gc.ca --> <head> <title> Stantec - Complete profile - Canadian Company Capabilities - Industries and Business - Industry Canada </title> <!-- Title ends / Fin du titre --> <meta charset="utf-8" /> <meta name="dcterms.language" title="ISO639-2" content="eng" /> <meta name="dcterms.title" content="" /> <meta name="description" content="" /> <meta name="dcterms.description" content="" /> <meta name="dcterms.type" content="report, data set" /> <meta name="dcterms.subject" content="businesses, industry" /> <meta name="dcterms.subject" content="businesses, industry" /> <meta name="dcterms.issued" title="W3CDTF" content="" /> <meta name="dcterms.modified" title="W3CDTF" content="" /> <meta name="keywords" content="" /> <meta name="dcterms.creator" content="" /> <meta name="author" content="" /> <meta name="dcterms.created" title="W3CDTF" content="" /> <meta name="dcterms.publisher" content="" /> <meta name="dcterms.audience" title="icaudience" content="" /> <meta name="dcterms.spatial" title="ISO3166-1" content="" /> <meta name="dcterms.spatial" title="gcgeonames" content="" /> <meta name="dcterms.format" content="HTML" /> <meta name="dcterms.identifier" title="ICsiteProduct" content="536" /> <!-- EPI-11240 --> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- MCG-202 --> <meta content="width=device-width,initial-scale=1" name="viewport"> <!-- EPI-11567 --> <meta name = "format-detection" content = "telephone=no"> <!-- EPI-12603 --> <meta name="robots" content="noarchive"> <!-- EPI-11190 - Webtrends --> <script> var startTime = new Date(); startTime = startTime.getTime(); </script> <!--[if gte IE 9 | !IE ]><!--> <link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="icon" type="image/x-icon"> <link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/wet-boew.min.css"> <!--<![endif]--> <link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/theme.min.css"> <!--[if lt IE 9]> <link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="shortcut icon" /> <link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/ie8-wet-boew.min.css" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/ie8-wet-boew.min.js"></script> <![endif] <!--[if lte IE 9]> <![endif] <noscript><link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/noscript.min.css" /></noscript> <!-- Google Tag Manager DO NOT REMOVE OR MODIFY - NE PAS SUPPRIMER OU MODIFIER --> <script>dataLayer1 = [];</script> <!-- End Google Tag Manager --> <!-- EPI-11235 --> <link rel="stylesheet" href="/eic/home.nsf/css/<API key>.css"> <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> <link href="/app/ccc/srch/css/print.css" media="print" rel="stylesheet" type="text/css" /> </head> <body class="home" vocab="http://schema.org/" typeof="WebPage"> <!-- EPIC HEADER BEGIN --> <!-- Google Tag Manager DO NOT REMOVE OR MODIFY - NE PAS SUPPRIMER OU MODIFIER --> <noscript><iframe title="Google Tag Manager" src=" <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.<API key>(s)[0], j=d.createElement(s),dl=l!='dataLayer1'?'&l='+l:'';j.async=true;j.src=' <!-- End Google Tag Manager --> <!-- EPI-12801 --> <span typeof="Organization"><meta property="legalName" content="<API key>"></span> <ul id="wb-tphp"> <li class="wb-slc"> <a class="wb-sl" href="#wb-cont">Skip to main content</a> </li> <li class="wb-slc visible-sm visible-md visible-lg"> <a class="wb-sl" href="#wb-info">Skip to "About this site"</a> </li> </ul> <header role="banner"> <div id="wb-bnr" class="container"> <section id="wb-lng" class="visible-md visible-lg text-right"> <h2 class="wb-inv">Language selection</h2> <div class="row"> <div class="col-md-12"> <ul class="list-inline mrgn-bttm-0"> <li><a href="nvgt.do?V_TOKEN=1492320924129&V_SEARCH.docsCount=3&V_DOCUMENT.docRank=43624&V_SEARCH.docsStart=43623&V_SEARCH.command=navigate&V_SEARCH.resultsJSP=/prfl.do&lang=fra&redirectUrl=/app/scr/imbs/ccc/rgstrtn/rgstr.sec?_flId?_flxKy=e1s1&amp;estblmntNo=234567041301&amp;profileId=61&amp;_evId=bck&amp;lang=eng&amp;V_SEARCH.showStricts=false&amp;prtl=1&amp;_flId?_flId?_flxKy=e1s1" title="Français" lang="fr">Français</a></li> </ul> </div> </div> </section> <div class="row"> <div class="brand col-xs-8 col-sm-9 col-md-6"> <a href="http: </div> <section class="wb-mb-links col-xs-4 col-sm-3 visible-sm visible-xs" id="wb-glb-mn"> <h2>Search and menus</h2> <ul class="list-inline text-right chvrn"> <li><a href="#mb-pnl" title="Search and menus" aria-controls="mb-pnl" class="overlay-lnk" role="button"><span class="glyphicon glyphicon-search"><span class="glyphicon glyphicon-th-list"><span class="wb-inv">Search and menus</span></span></span></a></li> </ul> <div id="mb-pnl"></div> </section> <!-- Site Search Removed --> </div> </div> <nav role="navigation" id="wb-sm" class="wb-menu visible-md visible-lg" data-trgt="mb-pnl" data-ajax-fetch="//cdn.canada.ca/gcweb-cdn-dev/sitemenu/sitemenu-en.html" typeof="<API key>"> <h2 class="wb-inv">Topics menu</h2> <div class="container nvbar"> <div class="row"> <ul class="list-inline menu"> <li><a href="https: <li><a href="http: <li><a href="https://travel.gc.ca/">Travel</a></li> <li><a href="https: <li><a href="https: <li><a href="http://healthycanadians.gc.ca/index-eng.php">Health</a></li> <li><a href="https: <li><a href="https: </ul> </div> </div> </nav> <!-- EPIC BODY BEGIN --> <nav role="navigation" id="wb-bc" class="" property="breadcrumb"> <h2 class="wb-inv">You are here:</h2> <div class="container"> <div class="row"> <ol class="breadcrumb"> <li><a href="/eic/site/icgc.nsf/eng/home" title="Home">Home</a></li> <li><a href="/eic/site/icgc.nsf/eng/h_07063.html" title="Industries and Business">Industries and Business</a></li> <li><a href="/eic/site/ccc-rec.nsf/tpl-eng/../eng/home" >Canadian Company Capabilities</a></li> </ol> </div> </div> </nav> </header> <main id="wb-cont" role="main" property="mainContentOfPage" class="container"> <!-- End Header --> <!-- Begin Body --> <!-- Begin Body Title --> <!-- End Body Title --> <!-- Begin Body Head --> <!-- End Body Head --> <!-- Begin Body Content --> <br> <!-- Complete Profile --> <!-- Company Information above tabbed area--> <input id="showMore" type="hidden" value='more'/> <input id="showLess" type="hidden" value='less'/> <h1 id="wb-cont"> Company profile - Canadian Company Capabilities </h1> <div class="profileInfo hidden-print"> <ul class="list-inline"> <li><a href="cccSrch.do?lang=eng&profileId=&prtl=1&key.hitsPerPage=25&searchPage=%252Fapp%252Fccc%252Fsrch%252FcccBscSrch.do%253Flang%253Deng%2526amp%253Bprtl%253D1%2526amp%253Btagid%253D&V_SEARCH.scopeCategory=CCC.Root&V_SEARCH.depth=1&V_SEARCH.showStricts=false&V_SEARCH.sortSpec=title+asc&amp;rstBtn.x=" class="btn btn-link">New Search</a>&nbsp;|</li> <li><form name="searchForm" method="post" action="/app/ccc/srch/bscSrch.do"> <input type="hidden" name="lang" value="eng" /> <input type="hidden" name="profileId" value="" /> <input type="hidden" name="prtl" value="1" /> <input type="hidden" name="searchPage" value="%2Fapp%2Fccc%2Fsrch%2FcccBscSrch.do%3Flang%3Deng%26amp%3Bprtl%3D1%26amp%3Btagid%3D" /> <input type="hidden" name="V_SEARCH.scopeCategory" value="CCC.Root" /> <input type="hidden" name="V_SEARCH.depth" value="1" /> <input type="hidden" name="V_SEARCH.showStricts" value="false" /> <input id="repeatSearchBtn" class="btn btn-link" type="submit" value="Return to search results" /> </form></li> <li>|&nbsp;<a href="nvgt.do?V_SEARCH.docsStart=43622&amp;V_DOCUMENT.docRank=43623&amp;V_SEARCH.docsCount=3&amp;lang=eng&amp;prtl=1&amp;sbPrtl=&amp;profile=cmpltPrfl&amp;V_TOKEN=1492320960074&amp;V_SEARCH.command=navigate&amp;V_SEARCH.resultsJSP=%2fprfl.do&amp;estblmntNo=114613650000&amp;profileId=&amp;key.newSearchLabel=">Previous Company</a></li> <li>|&nbsp;<a href="nvgt.do?V_SEARCH.docsStart=43624&amp;V_DOCUMENT.docRank=43625&amp;V_SEARCH.docsCount=3&amp;lang=eng&amp;prtl=1&amp;sbPrtl=&amp;profile=cmpltPrfl&amp;V_TOKEN=1492320960074&amp;V_SEARCH.command=navigate&amp;V_SEARCH.resultsJSP=%2fprfl.do&amp;estblmntNo=123456106414&amp;profileId=&amp;key.newSearchLabel=">Next Company</a></li> </ul> </div> <details> <summary>Third-Party Information Liability Disclaimer</summary> <p>Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.</p> </details> <h2> Stantec Consulting Ltd </h2> <div class="row"> <div class="col-md-5"> <h2 class="h5 mrgn-bttm-0">Legal Name:</h2> <p>Stantec Consulting Ltd</p> <h2 class="h5 mrgn-bttm-0">Operating Name:</h2> <p>Stantec</p> <div class="mrgn-tp-md"></div> <p class="mrgn-bttm-0" ><a href="http: target="_blank" title="Website URL">http: <p><a href="mailto:guelph@stantec.com" title="guelph@stantec.com">guelph@stantec.com</a></p> </div> <div class="col-md-4 mrgn-sm-sm"> <h2 class="h5 mrgn-bttm-0">Mailing Address:</h2> <address class="mrgn-bttm-md"> 1-70 Southgate Dr<br/> GUELPH, Ontario<br/> N1G 4P5 <br/> </address> <h2 class="h5 mrgn-bttm-0">Location Address:</h2> <address class="mrgn-bttm-md"> 1-70 Southgate Dr<br/> GUELPH, Ontario<br/> N1G 4P5 <br/> </address> <p class="mrgn-bttm-0"><abbr title="Telephone">Tel.</abbr>: (519) 836-6050 </p> <p class="mrgn-bttm-lg"><abbr title="Facsimile">Fax</abbr>: (519) 836-2493</p> </div> <div class="col-md-3 mrgn-tp-md"> <h2 class="wb-inv">Logo</h2> <img class="img-responsive text-left" src="https: </div> </div> <div class="row mrgn-tp-md mrgn-bttm-md"> <div class="col-md-12"> <h2 class="wb-inv">Company Profile</h2> <br> We& </div> </div> <!-- <div class="wb-tabs ignore-session update-hash wb-eqht-off print-active"> --> <div class="wb-tabs ignore-session"> <div class="tabpanels"> <details id="details-panel1"> <summary> Full profile </summary> <!-- Tab 1 --> <h2 class="wb-invisible"> Full profile </h2> <!-- Contact Information --> <h3 class="page-header"> Contact information </h3> <section class="container-fluid"> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> David Charlton </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> Senior Principal<br> </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (519) 836-6050 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Facsimile: </strong> </div> <div class="col-md-7"> (519) 836-2493 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> david.charlton@stantec.com </div> </div> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> David Wesenger </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> <!--if client gender is not null or empty we use gender based job title Manager </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (519) 836-6050 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Facsimile: </strong> </div> <div class="col-md-7"> (519) 836-2493 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> david.wesenger@stantec.com </div> </div> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Rob Nadolny </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> Senior Project Manager<br> </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (519) 836-6050 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> rob.nadolny@stantec.com </div> </div> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Dan Eusebi </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> Senior Environmental Planner<br> </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (519) 836-6050 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> dan.eusebi@stantec.com </div> </div> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Brad Wallace </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> Practice Leader, Environmental Remediation - Eastern Canada<br> </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (519) 836-6050 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> brad.wallace@stantec.com </div> </div> </section> <p class="mrgn-tp-lg text-right small hidden-print"> <a href="#wb-cont">top of page</a> </p> <!-- Company Description --> <h3 class="page-header"> Company description </h3> <section class="container-fluid"> <div class="row"> <div class="col-md-5"> <strong> Country of Ownership: </strong> </div> <div class="col-md-7"> Canada &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Exporting: </strong> </div> <div class="col-md-7"> Yes &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Industry (NAICS): </strong> </div> <div class="col-md-7"> 541620 - Environmental Consulting Services </div> </div> <div class="row"> <div class="col-md-5"> <strong> Alternate Industries (NAICS): </strong> </div> <div class="col-md-7"> 541310 - Architectural Services<br> 541320 - Landscape Architectural Services<br> 541330 - Engineering Services<br> 541370 - Surveying and Mapping (except Geophysical) Services<br> 541380 - Testing Laboratories<br> 541410 - Interior Design Services<br> 541619 - Other Management Consulting Services<br> 562910 - Remediation Services<br> 562990 - All Other Waste Management Services<br> </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Business Activity: </strong> </div> <div class="col-md-7"> Services &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Number of Employees: </strong> </div> <div class="col-md-7"> 70&nbsp; </div> </div> </section> <!-- Products / Services / Licensing --> <h3 class="page-header"> Product / Service / Licensing </h3> <section class="container-fluid"> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> We complete EAs for domestic and international clients. <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> ENVIRONMENTAL CONSULTANT - WILDLIFE AND NATURAL HABITAT ENHANCEMENT <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> TOXICITY TESTING <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-12"> Stantec has an established soils ecotoxicity testing laboratory with technical experience in biology, toxicology, environmental chemistry, soil science, remediation, ecological risk assessment, plant science, and agronomy. Services include: <br> •Evaluation of the toxicity of different types of contaminants in soil in support of site-specific risk assessments <br> •Assessment of contaminated lands for the derivation of site-specific remedial benchmarks <br> •Evaluation of the efficacy of bio- or phyto-remediation technologies applied to contaminated soils <br> •Generation of toxicity data for the development of soil quality guidelines for existing or new compounds <br> •Development of terrestrial toxicity test methods <br> •Bioaccumulation testing with soil invertebrate and plant species <br> •Bioaccessibility testing in support of site-specific risk assessments (human health) <br> <br> Stantec has provided terrestrial ecotoxicity services since 1995 and has one of the most well-respected toxicity testing laboratories in Canada. Our staff has conducted testing with many different types of soils, including agricultural soils (sandy, clayey, and silt loams), boreal forest soils, subsurface till, riparian, and wetland soils. Testing has also been conducted with many different types of soil contaminants including petroleum hydrocarbons, metals, pesticides, volatile organic compounds, radiological compounds, decontamination agents, composted materials, and inorganic and organic salts. <br> <br> Stantec has conducted site-specific eco-toxicity testing for area-wide risk assessments in communities impacted by historical mining activities (e.g., Port Colborne and Sudbury, ON, Murdochville and Sandy Beach, QC) as well as generated ecotoxicity data for use in the derivation of site-specific soil quality remedial objectives for contaminated sites (e.g., Deloro and Port Hope, ON; Sandy Beach, QC) and for derivation of soil standards for the direct soil contact exposure pathway (e.g., uranium, barite). We have also participated in research initiatives investigating the impacts of historical smelting emissions on soil-dwelling organisms (MITE-RN), and provided expert advice on the ecotoxicity of metals to soil dwelling organisms in area-wide and community-based risk assessments. <br> <br> Stantec was instrumental in the development of the new biological test methods for assessing contaminated soils for Environment Canada, the Petroleum Technology Alliance Canada and the Canadian Association of Petroleum Producers. Stantec was also instrumental in generating the terrestrial toxicity data used to develop the Tier 1 Canada-wide Standards for Petroleum Hydrocarbons in Soil for the eco-contact exposure pathway. <br> <br> Our research and service testing laboratory has an established Quality Management System which meets the technical requirements of ISO/ISE 17025:2005 and the principles of ISO 9001:2008. The laboratory and terrestrial ecotoxicological test methods are accredited by the Canadian Association of Laboratory Accreditation (CALA) and is compliant with ISO 9001:2008 and 14000:2004. <br> <br> <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> ENVIRONMENTAL CONSULTANT - ARCTIC RESOURCES MANAGEMENT <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> ENVIRONMENTAL CONSULTANT - BIOLOGICAL AND ECOSYSTEM STUDIES <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> ENVIRONMENTAL CONSULTANT - CHEMICAL/PHYSICAL WASTE TREATMENT PLANTS <br> </div> </div> </section> <p class="mrgn-tp-lg text-right small hidden-print"> <a href="#wb-cont">top of page</a> </p> <!-- Technology Profile --> <h3 class="page-header"> Technology profile </h3> <section class="container-fluid"> EQUIPMENT <br> - Full line of electrofishing equipment: stream side, back pack, <br> boat unit. <br> - Full line of water sampling equipment: hydrolab, WTW <br> multimeter. <br> - Full line of fish collection equipment: hapnets, gillnets, etc. <br> - Full line of sediment and benthic sampling equipment: ponar, <br> ednar&#39;s, core, van veen. </section> <!-- Market Profile --> <h3 class="page-header"> Market profile </h3> <section class="container-fluid"> <h4> Alliances: </h4> <ul> <li>Sales/Marketing</li> <li>Technology</li> </ul> <h4> Industry sector market interests: </h4> <ul> <li>Environment</li> </ul> <h4> Geographic markets: </h4> <h5> Export experience: </h5> <ul> <li>Algeria</li> <li>Argentina</li> <li>Bolivia, Plurinational State of</li> <li>Brazil</li> <li>China</li> <li>Costa Rica</li> <li>Ecuador</li> <li>Hong Kong</li> <li>India</li> <li>Japan</li> <li>Kenya</li> <li>Mexico</li> <li>Peru</li> <li>United States</li> <li>Viet Nam</li> <li>Zimbabwe</li> <li>Alabama</li> <li>Michigan</li> </ul> <h5> Actively pursuing: </h5> <ul> <li>Afghanistan</li> <li>Bahamas</li> <li>Barbados</li> <li>Belize</li> <li>Chile</li> <li>Colombia</li> <li>Congo</li> <li>Congo, The Democratic Republic of the</li> <li>Cuba</li> <li>Fiji</li> <li>French Guiana</li> <li>French Polynesia</li> <li>Indonesia</li> <li>Lao People&#39;s Democratic Republic</li> <li>Malawi</li> <li>Malaysia</li> <li>Mauritius</li> <li>Nepal</li> <li>Nicaragua</li> <li>Niger</li> <li>Nigeria</li> <li>Pakistan</li> <li>Panama</li> <li>Papua New Guinea</li> <li>Philippines</li> <li>Saint Pierre and Miquelon</li> <li>Senegal</li> <li>Seychelles</li> <li>Singapore</li> <li>South Africa</li> <li>Suriname</li> <li>Taiwan</li> <li>Tanzania, United Republic of</li> <li>Thailand</li> <li>Trinidad and Tobago</li> <li>Turks and Caicos Islands</li> <li>Uganda</li> <li>Venezuela, Bolivarian Republic of</li> <li>Zambia</li> </ul> </section> <p class="mrgn-tp-lg text-right small hidden-print"> <a href="#wb-cont">top of page</a> </p> <!-- Sector Information --> <details class="mrgn-tp-md mrgn-bttm-md"> <summary> Third-Party Information Liability Disclaimer </summary> <p> Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements. </p> </details> </details> <details id="details-panel2"> <summary> Contacts </summary> <h2 class="wb-invisible"> Contact information </h2> <!-- Contact Information --> <section class="container-fluid"> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> David Charlton </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> Senior Principal<br> </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (519) 836-6050 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Facsimile: </strong> </div> <div class="col-md-7"> (519) 836-2493 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> david.charlton@stantec.com </div> </div> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> David Wesenger </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> <!--if client gender is not null or empty we use gender based job title Manager </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (519) 836-6050 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Facsimile: </strong> </div> <div class="col-md-7"> (519) 836-2493 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> david.wesenger@stantec.com </div> </div> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Rob Nadolny </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> Senior Project Manager<br> </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (519) 836-6050 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> rob.nadolny@stantec.com </div> </div> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Dan Eusebi </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> Senior Environmental Planner<br> </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (519) 836-6050 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> dan.eusebi@stantec.com </div> </div> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Brad Wallace </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> Practice Leader, Environmental Remediation - Eastern Canada<br> </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (519) 836-6050 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> brad.wallace@stantec.com </div> </div> </section> </details> <details id="details-panel3"> <summary> Description </summary> <h2 class="wb-invisible"> Company description </h2> <section class="container-fluid"> <div class="row"> <div class="col-md-5"> <strong> Country of Ownership: </strong> </div> <div class="col-md-7"> Canada &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Exporting: </strong> </div> <div class="col-md-7"> Yes &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Industry (NAICS): </strong> </div> <div class="col-md-7"> 541620 - Environmental Consulting Services </div> </div> <div class="row"> <div class="col-md-5"> <strong> Alternate Industries (NAICS): </strong> </div> <div class="col-md-7"> 541310 - Architectural Services<br> 541320 - Landscape Architectural Services<br> 541330 - Engineering Services<br> 541370 - Surveying and Mapping (except Geophysical) Services<br> 541380 - Testing Laboratories<br> 541410 - Interior Design Services<br> 541619 - Other Management Consulting Services<br> 562910 - Remediation Services<br> 562990 - All Other Waste Management Services<br> </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Business Activity: </strong> </div> <div class="col-md-7"> Services &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Number of Employees: </strong> </div> <div class="col-md-7"> 70&nbsp; </div> </div> </section> </details> <details id="details-panel4"> <summary> Products, services and licensing </summary> <h2 class="wb-invisible"> Product / Service / Licensing </h2> <section class="container-fluid"> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> We complete EAs for domestic and international clients. <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> ENVIRONMENTAL CONSULTANT - WILDLIFE AND NATURAL HABITAT ENHANCEMENT <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> TOXICITY TESTING <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-12"> Stantec has an established soils ecotoxicity testing laboratory with technical experience in biology, toxicology, environmental chemistry, soil science, remediation, ecological risk assessment, plant science, and agronomy. Services include: <br> •Evaluation of the toxicity of different types of contaminants in soil in support of site-specific risk assessments <br> •Assessment of contaminated lands for the derivation of site-specific remedial benchmarks <br> •Evaluation of the efficacy of bio- or phyto-remediation technologies applied to contaminated soils <br> •Generation of toxicity data for the development of soil quality guidelines for existing or new compounds <br> •Development of terrestrial toxicity test methods <br> •Bioaccumulation testing with soil invertebrate and plant species <br> •Bioaccessibility testing in support of site-specific risk assessments (human health) <br> <br> Stantec has provided terrestrial ecotoxicity services since 1995 and has one of the most well-respected toxicity testing laboratories in Canada. Our staff has conducted testing with many different types of soils, including agricultural soils (sandy, clayey, and silt loams), boreal forest soils, subsurface till, riparian, and wetland soils. Testing has also been conducted with many different types of soil contaminants including petroleum hydrocarbons, metals, pesticides, volatile organic compounds, radiological compounds, decontamination agents, composted materials, and inorganic and organic salts. <br> <br> Stantec has conducted site-specific eco-toxicity testing for area-wide risk assessments in communities impacted by historical mining activities (e.g., Port Colborne and Sudbury, ON, Murdochville and Sandy Beach, QC) as well as generated ecotoxicity data for use in the derivation of site-specific soil quality remedial objectives for contaminated sites (e.g., Deloro and Port Hope, ON; Sandy Beach, QC) and for derivation of soil standards for the direct soil contact exposure pathway (e.g., uranium, barite). We have also participated in research initiatives investigating the impacts of historical smelting emissions on soil-dwelling organisms (MITE-RN), and provided expert advice on the ecotoxicity of metals to soil dwelling organisms in area-wide and community-based risk assessments. <br> <br> Stantec was instrumental in the development of the new biological test methods for assessing contaminated soils for Environment Canada, the Petroleum Technology Alliance Canada and the Canadian Association of Petroleum Producers. Stantec was also instrumental in generating the terrestrial toxicity data used to develop the Tier 1 Canada-wide Standards for Petroleum Hydrocarbons in Soil for the eco-contact exposure pathway. <br> <br> Our research and service testing laboratory has an established Quality Management System which meets the technical requirements of ISO/ISE 17025:2005 and the principles of ISO 9001:2008. The laboratory and terrestrial ecotoxicological test methods are accredited by the Canadian Association of Laboratory Accreditation (CALA) and is compliant with ISO 9001:2008 and 14000:2004. <br> <br> <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> ENVIRONMENTAL CONSULTANT - ARCTIC RESOURCES MANAGEMENT <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> ENVIRONMENTAL CONSULTANT - BIOLOGICAL AND ECOSYSTEM STUDIES <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> ENVIRONMENTAL CONSULTANT - CHEMICAL/PHYSICAL WASTE TREATMENT PLANTS <br> </div> </div> </section> </details> <details id="details-panel5"> <summary> Technology </summary> <h2 class="wb-invisible"> Technology profile </h2> <section class="container-fluid"> EQUIPMENT <br> - Full line of electrofishing equipment: stream side, back pack, <br> boat unit. <br> - Full line of water sampling equipment: hydrolab, WTW <br> multimeter. <br> - Full line of fish collection equipment: hapnets, gillnets, etc. <br> - Full line of sediment and benthic sampling equipment: ponar, <br> ednar&#39;s, core, van veen. </section> </details> <details id="details-panel6"> <summary> Market </summary> <h2 class="wb-invisible"> Market profile </h2> <section class="container-fluid"> <h4> Alliances: </h4> <ul> <li>Sales/Marketing</li> <li>Technology</li> </ul> <h4> Industry sector market interests: </h4> <ul> <li>Environment</li> </ul> <h4> Geographic markets: </h4> <h5> Export experience: </h5> <ul> <li>Algeria</li> <li>Argentina</li> <li>Bolivia, Plurinational State of</li> <li>Brazil</li> <li>China</li> <li>Costa Rica</li> <li>Ecuador</li> <li>Hong Kong</li> <li>India</li> <li>Japan</li> <li>Kenya</li> <li>Mexico</li> <li>Peru</li> <li>United States</li> <li>Viet Nam</li> <li>Zimbabwe</li> <li>Alabama</li> <li>Michigan</li> </ul> <h5> Actively pursuing: </h5> <ul> <li>Afghanistan</li> <li>Bahamas</li> <li>Barbados</li> <li>Belize</li> <li>Chile</li> <li>Colombia</li> <li>Congo</li> <li>Congo, The Democratic Republic of the</li> <li>Cuba</li> <li>Fiji</li> <li>French Guiana</li> <li>French Polynesia</li> <li>Indonesia</li> <li>Lao People&#39;s Democratic Republic</li> <li>Malawi</li> <li>Malaysia</li> <li>Mauritius</li> <li>Nepal</li> <li>Nicaragua</li> <li>Niger</li> <li>Nigeria</li> <li>Pakistan</li> <li>Panama</li> <li>Papua New Guinea</li> <li>Philippines</li> <li>Saint Pierre and Miquelon</li> <li>Senegal</li> <li>Seychelles</li> <li>Singapore</li> <li>South Africa</li> <li>Suriname</li> <li>Taiwan</li> <li>Tanzania, United Republic of</li> <li>Thailand</li> <li>Trinidad and Tobago</li> <li>Turks and Caicos Islands</li> <li>Uganda</li> <li>Venezuela, Bolivarian Republic of</li> <li>Zambia</li> </ul> </section> </details> </div> </div> <div class="row"> <div class="col-md-12 text-right"> Last Update Date 2015-11-03 </div> </div> <! - Artifact ID: CBW - IMBS - CCC Search WAR - Group ID: ca.gc.ic.strategis.imbs.ccc.search - Version: 3.26 - Built-By: bamboo - Build Timestamp: 2017-03-02T21:29:28Z <!-- End Body Content --> <!-- Begin Body Foot --> <!-- End Body Foot --> <!-- END MAIN TABLE --> <!-- End body --> <!-- Begin footer --> <div class="row pagedetails"> <div class="col-sm-5 col-xs-12 datemod"> <dl id="wb-dtmd"> <dt class=" hidden-print">Date Modified:</dt> <dd class=" hidden-print"> <span><time>2017-03-02</time></span> </dd> </dl> </div> <div class="clear visible-xs"></div> <div class="col-sm-4 col-xs-6"> </div> <div class="col-sm-3 col-xs-6 text-right"> </div> <div class="clear visible-xs"></div> </div> </main> <footer role="contentinfo" id="wb-info"> <nav role="navigation" class="container wb-navcurr"> <h2 class="wb-inv">About government</h2> <!-- EPIC FOOTER BEGIN --> <!-- EPI-11638 Contact us --> <ul class="list-unstyled colcount-sm-2 colcount-md-3"> <li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07026.html#pageid=E048-H00000&amp;from=Industries">Contact us</a></li> <li><a href="https: <li><a href="https: <li><a href="https: <li><a href="https: <li><a href="https: <li><a href="http://pm.gc.ca/eng">Prime Minister</a></li> <li><a href="https: <li><a href="http://open.canada.ca/en/">Open government</a></li> </ul> </nav> <div class="brand"> <div class="container"> <div class="row"> <nav class="col-md-10 ftr-urlt-lnk"> <h2 class="wb-inv">About this site</h2> <ul> <li><a href="https: <li><a href="https: <li><a href="http://www1.canada.ca/en/newsite.html">About Canada.ca</a></li> <li><a href="http: <li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07033.html#p1">Privacy</a></li> </ul> </nav> <div class="col-xs-6 visible-sm visible-xs tofpg"> <a href="#wb-cont">Top of Page <span class="glyphicon <API key>"></span></a> </div> <div class="col-xs-6 col-md-2 text-right"> <object type="image/svg+xml" tabindex="-1" role="img" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/wmms-blk.svg" aria-label="Symbol of the Government of Canada"></object> </div> </div> </div> </div> </footer> <!--[if gte IE 9 | !IE ]><!--> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/wet-boew.min.js"></script> <!--<![endif]--> <!--[if lt IE 9]> <script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/ie8-wet-boew2.min.js"></script> <![endif] <script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/theme.min.js"></script> <!-- EPI-10519 --> <span class="wb-sessto" data-wb-sessto='{"inactivity": 1800000, "reactionTime": 180000, "sessionalive": 1800000, "logouturl": "/app/ccc/srch/cccSrch.do?lang=eng&prtl=1"}'></span> <script src="/eic/home.nsf/js/jQuery.<API key>.js"></script> <!-- EPI-11190 - Webtrends --> <script src="/eic/home.nsf/js/webtrends.js"></script> <script>var endTime = new Date();</script> <noscript> <div><img alt="" id="DCSIMG" width="1" height="1" src=" </noscript> <!-- /Webtrends --> <!-- JS deps --> <script src="/eic/home.nsf/js/jquery.imagesloaded.js"></script> <!-- EPI-11262 - Util JS --> <script src="/eic/home.nsf/js/<API key>.min.js"></script> <!-- EPI-11383 --> <script src="/eic/home.nsf/js/jQuery.icValidationErrors.js"></script> <span style="display:none;" id='app-info' <API key>='' <API key>='' <API key>='' <API key>='' data-issue-tracking='' data-scm-sha1='' <API key>='' data-scm-branch='' <API key>=''></span> </body></html> <!-- End Footer --> <! - Artifact ID: CBW - IMBS - CCC Search WAR - Group ID: ca.gc.ic.strategis.imbs.ccc.search - Version: 3.26 - Built-By: bamboo - Build Timestamp: 2017-03-02T21:29:28Z
using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; using System.Linq.Expressions; using System.Reflection; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNet.SignalR.Hosting; using Microsoft.AspNet.SignalR.Infrastructure; using Microsoft.AspNet.SignalR.Json; using Newtonsoft.Json; namespace Microsoft.AspNet.SignalR.Hubs { <summary> Handles all communication over the hubs persistent connection. </summary> [SuppressMessage("Microsoft.Maintainability", "CA1506:<API key>", Justification = "This dispatcher makes use of many interfaces.")] public class HubDispatcher : <API key> { private const string HubsSuffix = "/hubs"; private const string JsSuffix = "/js"; private readonly List<HubDescriptor> _hubs = new List<HubDescriptor>(); private readonly bool <API key>; private readonly bool <API key>; private <API key> _proxyGenerator; private IHubManager _manager; private IHubRequestParser _requestParser; private JsonSerializer _serializer; private IParameterResolver _binder; private IHubPipelineInvoker _pipelineInvoker; private <API key> _counters; private bool _isDebuggingEnabled; private static readonly MethodInfo _continueWithMethod = typeof(HubDispatcher).GetMethod("ContinueWith", BindingFlags.NonPublic | BindingFlags.Static); <summary> Initializes an instance of the <see cref="HubDispatcher"/> class. </summary> <param name="configuration">Configuration settings determining whether to enable JS proxies and provide clients with detailed hub errors.</param> public HubDispatcher(HubConfiguration configuration) { if (configuration == null) { throw new <API key>("configuration"); } <API key> = configuration.<API key>; <API key> = configuration.<API key>; } protected override TraceSource Trace { get { return TraceManager["SignalR.HubDispatcher"]; } } internal override string GroupPrefix { get { return PrefixHelper.HubGroupPrefix; } } public override void Initialize(IDependencyResolver resolver) { if (resolver == null) { throw new <API key>("resolver"); } _proxyGenerator = <API key> ? resolver.Resolve<<API key>>() : new <API key>(); _manager = resolver.Resolve<IHubManager>(); _binder = resolver.Resolve<IParameterResolver>(); _requestParser = resolver.Resolve<IHubRequestParser>(); _serializer = resolver.Resolve<JsonSerializer>(); _pipelineInvoker = resolver.Resolve<IHubPipelineInvoker>(); _counters = resolver.Resolve<<API key>>(); base.Initialize(resolver); } protected override bool AuthorizeRequest(IRequest request) { if (request == null) { throw new <API key>("request"); } // Populate _hubs string data = request.QueryString["connectionData"]; if (!String.IsNullOrEmpty(data)) { var clientHubInfo = JsonSerializer.Parse<IEnumerable<ClientHubInfo>>(data); // If there's any hubs then perform the auth check if (clientHubInfo != null && clientHubInfo.Any()) { var hubCache = new Dictionary<string, HubDescriptor>(StringComparer.OrdinalIgnoreCase); foreach (var hubInfo in clientHubInfo) { if (hubCache.ContainsKey(hubInfo.Name)) { throw new <API key>(Resources.<API key>); } // Try to find the associated hub type HubDescriptor hubDescriptor = _manager.EnsureHub(hubInfo.Name, _counters.<API key>, _counters.<API key>, _counters.ErrorsAllTotal, _counters.ErrorsAllPerSec); if (_pipelineInvoker.AuthorizeConnect(hubDescriptor, request)) { // Add this to the list of hub descriptors this connection is interested in hubCache.Add(hubDescriptor.Name, hubDescriptor); } } _hubs.AddRange(hubCache.Values); // If we have any hubs in the list then we're authorized return _hubs.Count > 0; } } return base.AuthorizeRequest(request); } <summary> Processes the hub's incoming method calls. </summary> protected override Task OnReceived(IRequest request, string connectionId, string data) { HubRequest hubRequest = _requestParser.Parse(data, _serializer); // Create the hub HubDescriptor descriptor = _manager.EnsureHub(hubRequest.Hub, _counters.<API key>, _counters.<API key>, _counters.ErrorsAllTotal, _counters.ErrorsAllPerSec); IJsonValue[] parameterValues = hubRequest.ParameterValues; // Resolve the method MethodDescriptor methodDescriptor = _manager.GetHubMethod(descriptor.Name, hubRequest.Method, parameterValues); if (methodDescriptor == null) { // Empty (noop) method descriptor // Use: Forces the hub pipeline module to throw an error. This error is encapsulated in the HubDispatcher. // Encapsulating it in the HubDispatcher prevents the error from bubbling up to the transport level. // Specifically this allows us to return a faulted task (call .fail on client) and to not cause the // transport to unintentionally fail. IEnumerable<MethodDescriptor> availableMethods = _manager.GetHubMethods(descriptor.Name, m => m.Name == hubRequest.Method); methodDescriptor = new <API key>(descriptor, hubRequest.Method, availableMethods); } // Resolving the actual state object var tracker = new StateChangeTracker(hubRequest.State); var hub = CreateHub(request, descriptor, connectionId, tracker, <API key>: true); return InvokeHubPipeline(hub, parameterValues, methodDescriptor, hubRequest, tracker) .<API key>(task => hub.Dispose(), <API key>.<API key>); } [SuppressMessage("Microsoft.Design", "CA1031:<API key>", Justification = "Exceptions are flown to the caller.")] private Task InvokeHubPipeline(IHub hub, IJsonValue[] parameterValues, MethodDescriptor methodDescriptor, HubRequest hubRequest, StateChangeTracker tracker) { // TODO: Make adding parameters here pluggable? IValueProvider? ;) <API key> progress = GetProgressInstance(methodDescriptor, value => SendProgressUpdate(hub.Context.ConnectionId, tracker, value, hubRequest)); Task<object> piplineInvocation; try { var args = _binder.<API key>(methodDescriptor, parameterValues); // We need to add the IProgress<T> instance after resolving the method as the resolution // itself looks for overload matches based on the incoming arg values if (progress != null) { args = args.Concat(new [] { progress }).ToList(); } var context = new HubInvokerContext(hub, tracker, methodDescriptor, args); // Invoke the pipeline and save the task piplineInvocation = _pipelineInvoker.Invoke(context); } catch (Exception ex) { piplineInvocation = TaskAsyncHelper.FromError<object>(ex); } // Determine if we have a faulted task or not and handle it appropriately. return piplineInvocation.<API key>(task => { if (progress != null) { // Stop ability to send any more progress updates progress.SetComplete(); } if (task.IsFaulted) { return ProcessResponse(tracker, result: null, request: hubRequest, error: task.Exception); } else if (task.IsCanceled) { return ProcessResponse(tracker, result: null, request: hubRequest, error: new <API key>()); } else { return ProcessResponse(tracker, task.Result, hubRequest, error: null); } }) .FastUnwrap(); } private static <API key> GetProgressInstance(MethodDescriptor methodDescriptor, Func<object, Task> sendProgressFunc) { <API key> progress = null; if (methodDescriptor.<API key> != null) { progress = <API key>.Create(methodDescriptor.<API key>, sendProgressFunc); } return progress; } public override Task ProcessRequest(HostContext context) { if (context == null) { throw new <API key>("context"); } // Trim any trailing slashes string normalized = context.Request.LocalPath.TrimEnd('/'); int suffixLength = -1; if (normalized.EndsWith(HubsSuffix, StringComparison.OrdinalIgnoreCase)) { suffixLength = HubsSuffix.Length; } else if (normalized.EndsWith(JsSuffix, StringComparison.OrdinalIgnoreCase)) { suffixLength = JsSuffix.Length; } if (suffixLength != -1) { // Generate the proper JS proxy url string hubUrl = normalized.Substring(0, normalized.Length - suffixLength); // Generate the proxy context.Response.ContentType = JsonUtility.JavaScriptMimeType; return context.Response.End(_proxyGenerator.GenerateProxy(hubUrl)); } _isDebuggingEnabled = context.Environment.IsDebugEnabled(); return base.ProcessRequest(context); } internal static Task Connect(IHub hub) { return hub.OnConnected(); } internal static Task Reconnect(IHub hub) { return hub.OnReconnected(); } internal static Task Disconnect(IHub hub, bool stopCalled) { return hub.OnDisconnected(stopCalled); } [SuppressMessage("Microsoft.Design", "CA1031:<API key>", Justification = "A faulted task is returned.")] internal static Task<object> Incoming(<API key> context) { var tcs = new <API key><object>(); try { object result = context.MethodDescriptor.Invoker(context.Hub, context.Args.ToArray()); Type returnType = context.MethodDescriptor.ReturnType; if (typeof(Task).IsAssignableFrom(returnType)) { var task = (Task)result; if (!returnType.IsGenericType) { task.ContinueWith(tcs); } else { // Get the <T> in Task<T> Type resultType = returnType.GetGenericArguments().Single(); Type genericTaskType = typeof(Task<>).MakeGenericType(resultType); // Get the correct ContinueWith overload var parameter = Expression.Parameter(typeof(object)); // TODO: Cache this whole thing // Action<object> callback = result => ContinueWith((Task<T>)result, tcs); MethodInfo continueWithMethod = _continueWithMethod.MakeGenericMethod(resultType); Expression body = Expression.Call(continueWithMethod, Expression.Convert(parameter, genericTaskType), Expression.Constant(tcs)); var continueWithInvoker = Expression.Lambda<Action<object>>(body, parameter).Compile(); continueWithInvoker.Invoke(result); } } else { tcs.TrySetResult(result); } } catch (Exception ex) { tcs.<API key>(ex); } return tcs.Task; } internal static Task Outgoing(<API key> context) { ConnectionMessage message = context.<API key>(); return context.Connection.Send(message); } protected override Task OnConnected(IRequest request, string connectionId) { return ExecuteHubEvent(request, connectionId, hub => _pipelineInvoker.Connect(hub)); } protected override Task OnReconnected(IRequest request, string connectionId) { return ExecuteHubEvent(request, connectionId, hub => _pipelineInvoker.Reconnect(hub)); } protected override IList<string> OnRejoiningGroups(IRequest request, IList<string> groups, string connectionId) { return _hubs.Select(hubDescriptor => { string groupPrefix = hubDescriptor.Name + "."; var hubGroups = groups.Where(g => g.StartsWith(groupPrefix, StringComparison.OrdinalIgnoreCase)) .Select(g => g.Substring(groupPrefix.Length)) .ToList(); return _pipelineInvoker.RejoiningGroups(hubDescriptor, request, hubGroups) .Select(g => groupPrefix + g); }).SelectMany(groupsToRejoin => groupsToRejoin).ToList(); } protected override Task OnDisconnected(IRequest request, string connectionId, bool stopCalled) { return ExecuteHubEvent(request, connectionId, hub => _pipelineInvoker.Disconnect(hub, stopCalled)); } protected override IList<string> GetSignals(string userId, string connectionId) { var signals = _hubs.SelectMany(info => { var items = new List<string> { PrefixHelper.GetHubName(info.Name), PrefixHelper.GetHubConnectionId(info.CreateQualifiedName(connectionId)), }; if (!String.IsNullOrEmpty(userId)) { items.Add(PrefixHelper.GetHubUserId(info.CreateQualifiedName(userId))); } return items; }) .Concat(new[] { PrefixHelper.GetConnectionId(connectionId), PrefixHelper.GetAck(connectionId) }); return signals.ToList(); } private Task ExecuteHubEvent(IRequest request, string connectionId, Func<IHub, Task> action) { var hubs = GetHubs(request, connectionId).ToList(); var operations = hubs.Select(instance => action(instance).OrEmpty().Catch()).ToArray(); if (operations.Length == 0) { DisposeHubs(hubs); return TaskAsyncHelper.Empty; } var tcs = new <API key><object>(); Task.Factory.ContinueWhenAll(operations, tasks => { DisposeHubs(hubs); var faulted = tasks.FirstOrDefault(t => t.IsFaulted); if (faulted != null) { tcs.<API key>(faulted.Exception); } else if (tasks.Any(t => t.IsCanceled)) { tcs.SetCanceled(); } else { tcs.SetResult(null); } }); return tcs.Task; } private IHub CreateHub(IRequest request, HubDescriptor descriptor, string connectionId, StateChangeTracker tracker = null, bool <API key> = false) { try { var hub = _manager.ResolveHub(descriptor.Name); if (hub != null) { tracker = tracker ?? new StateChangeTracker(); hub.Context = new HubCallerContext(request, connectionId); hub.Clients = new <API key>(_pipelineInvoker, Connection, descriptor.Name, connectionId, tracker); hub.Groups = new GroupManager(Connection, PrefixHelper.GetHubGroupName(descriptor.Name)); } return hub; } catch (Exception ex) { Trace.TraceInformation(String.Format(CultureInfo.CurrentCulture, Resources.<API key> + ex.Message, descriptor.Name)); if (<API key>) { throw; } return null; } } private IEnumerable<IHub> GetHubs(IRequest request, string connectionId) { return from descriptor in _hubs select CreateHub(request, descriptor, connectionId) into hub where hub != null select hub; } private static void DisposeHubs(IEnumerable<IHub> hubs) { foreach (var hub in hubs) { hub.Dispose(); } } private Task SendProgressUpdate(string connectionId, StateChangeTracker tracker, object value, HubRequest request) { var hubResult = new HubResponse { State = tracker.GetChanges(), Progress = new { I = request.Id, D = value }, // We prefix the ID here to ensure old clients treat this as a hub response // but fail to lookup a corresponding callback and thus no-op Id = "P|" + request.Id, }; return Connection.Send(connectionId, hubResult); } private Task ProcessResponse(StateChangeTracker tracker, object result, HubRequest request, Exception error) { var hubResult = new HubResponse { State = tracker.GetChanges(), Result = result, Id = request.Id, }; if (error != null) { _counters.<API key>.Increment(); _counters.<API key>.Increment(); _counters.ErrorsAllTotal.Increment(); _counters.ErrorsAllPerSec.Increment(); var hubError = error.InnerException as HubException; if (<API key> || hubError != null) { var exception = error.InnerException ?? error; hubResult.StackTrace = _isDebuggingEnabled ? exception.StackTrace : null; hubResult.Error = exception.Message; if (hubError != null) { hubResult.IsHubException = true; hubResult.ErrorData = hubError.ErrorData; } } else { hubResult.Error = String.Format(CultureInfo.CurrentCulture, Resources.<API key>, request.Hub, request.Method); } } return Transport.Send(hubResult); } private static void ContinueWith<T>(Task<T> task, <API key><object> tcs) { if (task.IsCompleted) { // Fast path for tasks that completed synchronously ContinueSync<T>(task, tcs); } else { ContinueAsync<T>(task, tcs); } } private static void ContinueSync<T>(Task<T> task, <API key><object> tcs) { if (task.IsFaulted) { tcs.<API key>(task.Exception); } else if (task.IsCanceled) { tcs.TrySetCanceled(); } else { tcs.TrySetResult(task.Result); } } private static void ContinueAsync<T>(Task<T> task, <API key><object> tcs) { task.<API key>(t => { if (t.IsFaulted) { tcs.<API key>(t.Exception); } else if (t.IsCanceled) { tcs.TrySetCanceled(); } else { tcs.TrySetResult(t.Result); } }); } [SuppressMessage("Microsoft.Performance", "CA1812:<API key>", Justification = "It is instantiated through JSON deserialization.")] private class ClientHubInfo { public string Name { get; set; } } } }
#pragma once #include <FalconEngine/Core/Macro.h> #include <memory> #include <FalconEngine/Core/Object.h> #include <FalconEngine/Math/Color.h> #include <FalconEngine/Math/Vector2.h> namespace FalconEngine { namespace Detail { #pragma pack(push, 4) struct FALCON_ENGINE_API MaterialColorData { public: Vector3f mAmbient; float mShininess; Vector3f mDiffuse; float _Pad0; Vector3f mEmissive; float _Pad1; Vector3f mSpecular; float _Pad2; }; #pragma pack(pop) #pragma pack(push, 4) struct FALCON_ENGINE_API MaterialTextureData { int mAmbientExist; int mDiffuseExist; int mEmissiveExist; int mSpecularExist; int mShininessExist; int _Pad0; int _Pad1; int _Pad2; }; #pragma pack(pop) } class Texture2d; class Sampler; <API key> Material : public Object { <API key>; public: /* Constructors and Destructor */ Material(); virtual ~Material() = default; public: Color mAmbientColor = ColorPalette::Transparent; Color mDiffuseColor = ColorPalette::Transparent; Color mEmissiveColor = ColorPalette::Transparent; Color mSpecularColor = ColorPalette::Transparent; float mShininess = 0.0f; std::shared_ptr<Texture2d> mAmbientTexture; std::shared_ptr<Texture2d> mDiffuseTexture; std::shared_ptr<Texture2d> mEmissiveTexture; std::shared_ptr<Texture2d> mSpecularTexture; std::shared_ptr<Texture2d> mShininessTexture; std::shared_ptr<Sampler> mAmbientSampler; std::shared_ptr<Sampler> mDiffuseSampler; std::shared_ptr<Sampler> mEmissiveSampler; std::shared_ptr<Sampler> mSpecularSampler; std::shared_ptr<Sampler> mShininessSampler; }; <API key> }
// This file is automatically generated. package adila.db; /* * Vivo Y31 * * DEVICE: Y31 * MODEL: vivo Y31 */ final class y31_vivo20y31 { public static final String DATA = "Vivo|Y31|"; }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>hammer: 32 s </title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file: <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif] </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.11.2 / hammer - 1.3.1+8.11</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> hammer <small> 1.3.1+8.11 <span class="label label-success">32 s </span> </small> </h1> <p> <em><script>document.write(moment("2021-12-25 14:20:56 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-12-25 14:20:56 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils coq 8.11.2 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.11.2 The OCaml compiler (virtual package) ocaml-base-compiler 4.11.2 Official release 4.11.2 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;palmskog@gmail.com&quot; homepage: &quot;https://github.com/lukaszcz/coqhammer&quot; dev-repo: &quot;git+https://github.com/lukaszcz/coqhammer.git&quot; bug-reports: &quot;https://github.com/lukaszcz/coqhammer/issues&quot; license: &quot;LGPL-2.1-only&quot; synopsis: &quot;General-purpose automated reasoning hammer tool for Coq&quot; description: &quot;&quot;&quot; A general-purpose automated reasoning hammer tool for Coq that combines learning from previous proofs with the translation of problems to the logics of automated systems and the reconstruction of successfully found proofs. &quot;&quot;&quot; build: [make &quot;-j%{jobs}%&quot; &quot;plugin&quot;] install: [ [make &quot;install-plugin&quot;] [make &quot;test-plugin&quot;] {with-test} ] depends: [ &quot;ocaml&quot; { &gt;= &quot;4.08&quot; } &quot;coq&quot; {&gt;= &quot;8.11&quot; &amp; &lt; &quot;8.12~&quot;} (&quot;conf-g++&quot; {build} | &quot;conf-clang&quot; {build}) &quot;coq-hammer-tactics&quot; {= version} ] tags: [ &quot;category:Miscellaneous/Coq Extensions&quot; &quot;keyword:automation&quot; &quot;keyword:hammer&quot; &quot;logpath:Hammer.Plugin&quot; &quot;date:2021-05-20&quot; ] authors: [ &quot;Lukasz Czajka &lt;lukaszcz@mimuw.edu.pl&gt;&quot; &quot;Cezary Kaliszyk &lt;cezary.kaliszyk@uibk.ac.at&gt;&quot; ] url { src: &quot;https://github.com/lukaszcz/coqhammer/archive/v1.3.1-coq8.11.tar.gz&quot; checksum: &quot;sha512=5e5d01b0f2b19268b038e89cebd41103442987cd11a81b6b615553167444f2081e92bebd483e464ff3d47f080784f1104858ad170fc188124a066b55a1fea722&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install </h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-hammer.1.3.1+8.11 coq.8.11.2</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam list; echo; ulimit -Sv 4000000; timeout 4h opam install -y --deps-only coq-hammer.1.3.1+8.11 coq.8.11.2</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>36 s</dd> </dl> <h2>Install </h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam list; echo; ulimit -Sv 16000000; timeout 4h opam install -y -v coq-hammer.1.3.1+8.11 coq.8.11.2</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>32 s</dd> </dl> <h2>Installation size</h2> <p>Total: 969 K</p> <ul> <li>689 K <code>../ocaml-base-compiler.4.11.2/lib/coq/user-contrib/Hammer/Plugin/hammer_plugin.cmxs</code></li> <li>149 K <code>../ocaml-base-compiler.4.11.2/bin/predict</code></li> <li>40 K <code>../ocaml-base-compiler.4.11.2/lib/coq/user-contrib/Hammer/Plugin/hammer_plugin.cmi</code></li> <li>35 K <code>../ocaml-base-compiler.4.11.2/lib/coq/user-contrib/Hammer/Plugin/hammer_plugin.cmx</code></li> <li>31 K <code>../ocaml-base-compiler.4.11.2/lib/coq/user-contrib/Hammer/Plugin/Hammer.vo</code></li> <li>17 K <code>../ocaml-base-compiler.4.11.2/bin/htimeout</code></li> <li>8 K <code>../ocaml-base-compiler.4.11.2/lib/coq/user-contrib/Hammer/Plugin/hammer_plugin.cmxa</code></li> <li>1 K <code>../ocaml-base-compiler.4.11.2/lib/coq/user-contrib/Hammer/Plugin/Hammer.glob</code></li> <li>1 K <code>../ocaml-base-compiler.4.11.2/lib/coq/user-contrib/Hammer/Plugin/Hammer.v</code></li> </ul> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq-hammer.1.3.1+8.11</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https: </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>area-method: Not compatible </title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file: <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif] </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.14.0 / area-method - 8.10.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> area-method <small> 8.10.0 <span class="label label-info">Not compatible </span> </small> </h1> <p> <em><script>document.write(moment("2021-12-17 13:03:57 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-12-17 13:03:57 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils conf-gmp 3 Virtual package relying on a GMP lib system installation coq 8.14.0 Formal proof management system dune 2.9.1 Fast, portable, and opinionated build system ocaml 4.08.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.08.1 Official release 4.08.1 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.1 A library manager for OCaml zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Hugo.Herbelin@inria.fr&quot; homepage: &quot;https://github.com/coq-contribs/area-method&quot; license: &quot;Unknown&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/AreaMethod&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.10&quot; &amp; &lt; &quot;8.11~&quot;} ] tags: [ &quot;keyword: geometry&quot; &quot;keyword: Chou Gao Zhang area method&quot; &quot;keyword: decision procedure&quot; &quot;keyword: automatic theorem proving&quot; &quot;date: 2004-2010&quot; ] authors: [ &quot;Julien Narboux&quot; ] bug-reports: &quot;https://github.com/coq-contribs/area-method/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/area-method.git&quot; synopsis: &quot;The Chou, Gao and Zhang area method&quot; description: &quot;&quot;&quot; This contribution is the implementation of the Chou, Gao and Zhang&#39;s area method decision procedure for euclidean plane geometry. This development contains a partial formalization of the book &quot;Machine Proofs in Geometry, Automated Production of Readable Proofs for Geometry Theorems&quot; by Chou, Gao and Zhang. The examples shown automatically (there are more than 100 examples) includes the Ceva, Desargues, Menelaus, Pascal, Centroïd, Pappus, Gauss line, Euler line, Napoleon theorems. Changelog 2.1 : remove some not needed assumptions in some elimination lemmas (2010) 2.0 : extension implementation to Euclidean geometry (2009-2010) 1.0 : first implementation for affine geometry (2004)&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/area-method/archive/v8.10.0.tar.gz&quot; checksum: &quot;md5=<API key>&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install </h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-area-method.8.10.0 coq.8.14.0</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.14.0). The following dependencies couldn&#39;t be met: - coq-area-method -&gt; coq &lt; 8.11~ -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-area-method.8.10.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install </h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https: </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>switch: Not compatible</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file: <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif] </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.10.2 / switch - 1.0.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> switch <small> 1.0.0 <span class="label label-info">Not compatible</span> </small> </h1> <p><em><script>document.write(moment("2020-07-11 07:20:54 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-07-11 07:20:54 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils conf-m4 1 Virtual package relying on m4 coq 8.10.2 Formal proof management system num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.05.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.05.0 Official 4.05.0 release ocaml-config 1 OCaml Switch Configuration ocamlfind 1.8.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; version: &quot;1.0.0&quot; maintainer: &quot;vzaliva@cmu.edu&quot; homepage: &quot;https://github.com/vzaliva/coq-switch&quot; dev-repo: &quot;git+https://github.com/vzaliva/coq-switch.git&quot; bug-reports: &quot;https://github.com/vzaliva/coq-switch/issues&quot; authors: [&quot;Vadim Zaliva &lt;vzaliva@cmu.edu&gt;&quot;] license: &quot;MIT&quot; build: [ [make &quot;-j%{jobs}%&quot;] ] install: [ [make &quot;install&quot;] ] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/Switch&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.8&quot;} &quot;coq-template-coq&quot; {&gt;= &quot;2.1~beta3&quot;} ] tags: [ &quot;category:Miscellaneous/Coq Extensions&quot; &quot;date:2018-09-27&quot; ] synopsis: &quot;A plugin to implement functionality similar to `switch` statement in C&quot; description: &quot;&quot;&quot; language. It allows easier dispatch on several constant values of a type with decidable equality. Given a type, boolean equality predicate, and list of choices, it will generate (using TemplateCoq) an inductive type with constructors, one for each of the choices, and a function mapping values to this type.&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/vzaliva/coq-switch/archive/v1.0.0.tar.gz&quot; checksum: &quot;md5=<API key>&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-switch.1.0.0 coq.8.10.2</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.10.2). The following dependencies couldn&#39;t be met: - coq-switch -&gt; coq-template-coq &gt;= 2.1~beta3 -&gt; coq &lt; 8.9~ -&gt; ocaml &lt; 4.03.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-switch.1.0.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> <small>Sources are on <a href="https: </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
package cmd import ( "fmt" "github.com/bitrise-io/depman/depman" "github.com/spf13/cobra" ) // initCmd represents the init command var initCmd = &cobra.Command{ Use: "init", Short: "Initialize the base config for depman", Long: `Initialize the base config for depman`, RunE: func(cmd *cobra.Command, args []string) error { deplist := depman.DepList{ Deps: []depman.DepStruct{ depman.DepStruct{ URL: "http://repo.url", StorePath: "relative/store/path", Branch: "master", }, }, } err := depman.WriteDepListToFile("./deplist.json", deplist) if err != nil { return err } fmt.Println("deplist.json file saved") return nil }, } func init() { RootCmd.AddCommand(initCmd) // Here you will define your flags and configuration settings. // Cobra supports Persistent Flags which will work for this command // and all subcommands, e.g.: // initCmd.PersistentFlags().String("foo", "", "A help for foo") // Cobra supports local flags which will only run when this command // is called directly, e.g.: // initCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>User agent detail - SAMSUNG-SGH-E700A</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link href="../circle.css" rel="stylesheet"> </head> <body> <div class="container"> <div class="section"> <h1 class="header center orange-text">User agent detail</h1> <div class="row center"> <h5 class="header light"> SAMSUNG-SGH-E700A </h5> </div> </div> <div class="section"> <table class="striped"><tr><th></th><th colspan="3">General</th><th colspan="5">Device</th><th colspan="3">Bot</th><th colspan="2"></th></tr><tr><th>Provider</th><th>Browser</th><th>Engine</th><th>OS</th><th>Brand</th><th>Model</th><th>Type</th><th>Is mobile</th><th>Is touch</th><th>Is bot</th><th>Name</th><th>Type</th><th>Parse time</th><th>Actions</th></tr><tr><th colspan="14" class="green lighten-3">Test suite</th></tr><tr><td>UAParser<br /><small>v0.5.0.2</small><br /><small>vendor/thadafinser/uap-core/tests/test_device.yaml</small></td><td> </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">Samsung</td><td>SGH-E700A</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#<API key>">Detail</a> <!-- Modal Structure --> <div id="<API key>" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>UAParser result detail</h4> <p><pre><code class="php">Array ( [user_agent_string] => SAMSUNG-SGH-E700A [family] => Samsung SGH-E700A [brand] => Samsung [model] => SGH-E700A ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><th colspan="14" class="green lighten-3">Providers</th></tr><tr><td>BrowscapFull<br /><small>6014</small><br /></td> <td colspan="12" class="center-align red lighten-1"> <strong>No result found</strong> </td> </tr><tr><td>BrowscapLite<br /><small>6014</small><br /></td> <td colspan="12" class="center-align red lighten-1"> <strong>No result found</strong> </td> </tr><tr><td>BrowscapPhp<br /><small>6014</small><br /></td> <td colspan="12" class="center-align red lighten-1"> <strong>No result found</strong> </td> </tr><tr><td>DonatjUAParser<br /><small>v0.5.1</small><br /></td><td>SAMSUNG-SGH-E700A </td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#<API key>">Detail</a> <!-- Modal Structure --> <div id="<API key>" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>DonatjUAParser result detail</h4> <p><pre><code class="php">Array ( [platform] => [browser] => SAMSUNG-SGH-E700A [version] => ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>JenssegersAgent<br /><small>v2.3.3</small><br /></td><td> </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.001</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#<API key>">Detail</a> <!-- Modal Structure --> <div id="<API key>" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>JenssegersAgent result detail</h4> <p><pre><code class="php">Array ( [browserName] => [browserVersion] => [osName] => [osVersion] => [deviceModel] => Samsung [isMobile] => 1 [isRobot] => [botName] => ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>NeutrinoApiCom<br /><small></small><br /></td><td> </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">Samsung</td><td>SGH-E700A</td><td>mobile-browser</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.21301</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#<API key>">Detail</a> <!-- Modal Structure --> <div id="<API key>" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>NeutrinoApiCom result detail</h4> <p><pre><code class="php">stdClass Object ( [<API key>] => 0 [is_mobile] => 1 [type] => mobile-browser [mobile_brand] => Samsung [mobile_model] => SGH-E700A [version] => [is_android] => [browser_name] => unknown [<API key>] => unknown [<API key>] => [is_ios] => [producer] => Samsung [operating_system] => unknown [mobile_screen_width] => 0 [mobile_browser] => ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>PiwikDeviceDetector<br /><small>3.6.1</small><br /></td><td> </td><td> </td><td> </td><td style="border-left: 1px solid #555">Samsung</td><td>SGH-E700A</td><td>smartphone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.008</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#<API key>">Detail</a> <!-- Modal Structure --> <div id="<API key>" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>PiwikDeviceDetector result detail</h4> <p><pre><code class="php">Array ( [client] => [operatingSystem] => Array ( ) [device] => Array ( [brand] => SA [brandName] => Samsung [model] => SGH-E700A [device] => 1 [deviceName] => smartphone ) [bot] => [extra] => Array ( [isBot] => [isBrowser] => [isFeedReader] => [isMobileApp] => [isPIM] => [isLibrary] => [isMediaPlayer] => [isCamera] => [isCarBrowser] => [isConsole] => [isFeaturePhone] => [isPhablet] => [<API key>] => [isSmartDisplay] => [isSmartphone] => 1 [isTablet] => [isTV] => [isDesktop] => [isMobile] => 1 [isTouchEnabled] => ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td><API key><br /><small>6.0.1</small><br /></td> <td colspan="12" class="center-align red lighten-1"> <strong>No result found</strong> </td> </tr><tr><td>UAParser<br /><small>v3.4.5</small><br /></td><td> </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">Samsung</td><td>SGH-E700A</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.005</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#<API key>">Detail</a> <!-- Modal Structure --> <div id="<API key>" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>UAParser result detail</h4> <p><pre><code class="php">UAParser\Result\Client Object ( [ua] => UAParser\Result\UserAgent Object ( [major] => [minor] => [patch] => [family] => Other ) [os] => UAParser\Result\OperatingSystem Object ( [major] => [minor] => [patch] => [patchMinor] => [family] => Other ) [device] => UAParser\Result\Device Object ( [brand] => Samsung [model] => SGH-E700A [family] => Samsung SGH-E700A ) [originalUserAgent] => SAMSUNG-SGH-E700A ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>UserAgentApiCom<br /><small></small><br /></td> <td colspan="12" class="center-align red lighten-1"> <strong>No result found</strong> </td> </tr><tr><td>UserAgentStringCom<br /><small></small><br /></td> <td colspan="12" class="center-align red lighten-1"> <strong>No result found</strong> </td> </tr><tr><td>WhatIsMyBrowserCom<br /><small></small><br /></td><td> </td><td> </td><td> </td><td style="border-left: 1px solid #555">Samsung</td><td></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.23301</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#<API key>">Detail</a> <!-- Modal Structure --> <div id="<API key>" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>WhatIsMyBrowserCom result detail</h4> <p><pre><code class="php">stdClass Object ( [<API key>] => [<API key>] => [<API key>] => [browser_version] => [extra_info] => Array ( ) [operating_platform] => [extra_info_table] => Array ( ) [layout_engine_name] => [detected_addons] => Array ( ) [<API key>] => [<API key>] => [<API key>] => [<API key>] => Array ( ) [browser_name_code] => [<API key>] => [<API key>] => Samsung SGH-E700A [is_abusive] => [<API key>] => [<API key>] => Array ( ) [<API key>] => Samsung [operating_system] => [<API key>] => [<API key>] => SGH-E700A [browser_name] => [<API key>] => [user_agent] => SAMSUNG-SGH-E700A [<API key>] => [browser] => ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>WhichBrowser<br /><small>v2.0.18</small><br /></td><td> </td><td> </td><td> </td><td style="border-left: 1px solid #555">Samsung</td><td>SGH-E700A</td><td>mobile:feature</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.002</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#<API key>">Detail</a> <!-- Modal Structure --> <div id="<API key>" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>WhichBrowser result detail</h4> <p><pre><code class="php">Array ( [device] => Array ( [type] => mobile [subtype] => feature [manufacturer] => Samsung [model] => SGH-E700A ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>Woothee<br /><small>v1.2.0</small><br /></td> <td colspan="12" class="center-align red lighten-1"> <strong>No result found</strong> </td> </tr><tr><td>Wurfl<br /><small>1.7.1.0</small><br /></td><td> </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">Samsung</td><td>SGH-E700A</td><td>Feature Phone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.019</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#<API key>">Detail</a> <!-- Modal Structure --> <div id="<API key>" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>Wurfl result detail</h4> <p><pre><code class="php">Array ( [virtual] => Array ( [is_android] => false [is_ios] => false [is_windows_phone] => false [is_app] => false [is_full_desktop] => false [is_largescreen] => false [is_mobile] => true [is_robot] => false [is_smartphone] => false [is_touchscreen] => false [is_wml_preferred] => false [<API key>] => true [is_html_preferred] => false [<API key>] => [<API key>] => [advertised_browser] => [<API key>] => [<API key>] => Samsung SGH-E700A [device_name] => Samsung SGH-E700A [form_factor] => Feature Phone [is_phone] => true [is_app_webview] => false ) [all] => Array ( [brand_name] => Samsung [model_name] => SGH-E700A [unique] => true [<API key>] => [is_wireless_device] => true [<API key>] => false [has_qwerty_keyboard] => false [<API key>] => true [uaprof] => http://wap.samsungmobile.com/uaprof/SGH-E700.xml [uaprof2] => [uaprof3] => [nokia_series] => 0 [nokia_edition] => 0 [device_os] => [mobile_browser] => Openwave Mobile Browser [<API key>] => 6.2 [device_os_version] => [pointing_method] => [release_date] => 2003_january [marketing_name] => [model_extra_info] => [nokia_feature_pack] => 0 [<API key>] => true [is_tablet] => false [manufacturer_name] => [is_bot] => false [is_google_glass] => false [proportional_font] => true [<API key>] => true [card_title_support] => false [softkey_support] => true [table_support] => true [numbered_menus] => true [<API key>] => true [<API key>] => false [<API key>] => true [<API key>] => false [access_key_support] => true [wrap_mode_support] => true [<API key>] => true [<API key>] => true [<API key>] => false [wizards_recommended] => true [<API key>] => false [<API key>] => false [<API key>] => false [<API key>] => false [<API key>] => true [<API key>] => wtai://wp/mc; [<API key>] => false [emoji] => false [<API key>] => false [<API key>] => false [imode_region] => none [<API key>] => tel: [chtml_table_support] => false [<API key>] => false [<API key>] => false [<API key>] => false [<API key>] => true [<API key>] => false [<API key>] => false [<API key>] => false [<API key>] => false [<API key>] => true [<API key>] => true [<API key>] => true [<API key>] => true [<API key>] => true [<API key>] => true [<API key>] => true [xhtml_nowrap_mode] => true [<API key>] => true [<API key>] => #99CCFF [<API key>] => #FFFFFF [<API key>] => true [<API key>] => true [<API key>] => iso8859 [<API key>] => true [<API key>] => wtai://wp/mc; [<API key>] => application/vnd.wap.xhtml+xml [xhtml_table_support] => true [<API key>] => none [<API key>] => none [xhtml_file_upload] => supported [cookie_support] => true [<API key>] => false [<API key>] => none [<API key>] => false [<API key>] => none [<API key>] => false [ajax_manipulate_css] => false [<API key>] => false [<API key>] => false [ajax_xhr_type] => none [ajax_manipulate_dom] => false [ajax_support_events] => false [<API key>] => false [<API key>] => none [xhtml_support_level] => 3 [preferred_markup] => <API key> [wml_1_1] => true [wml_1_2] => true [wml_1_3] => true [<API key>] => true [<API key>] => true [<API key>] => true [<API key>] => true [<API key>] => true [<API key>] => false [<API key>] => false [<API key>] => true [<API key>] => false [<API key>] => true [html_web_3_2] => false [html_web_4_0] => false [voicexml] => false [multipart_support] => true [<API key>] => false [<API key>] => true [resolution_width] => 128 [resolution_height] => 160 [columns] => 16 [max_image_width] => 116 [max_image_height] => 120 [rows] => 8 [<API key>] => 27 [<API key>] => 27 [dual_orientation] => false [density_class] => 1.0 [wbmp] => true [bmp] => false [epoc_bmp] => false [gif_animated] => true [jpg] => true [png] => true [tiff] => false [<API key>] => false [<API key>] => false [svgt_1_1] => false [svgt_1_1_plus] => false [greyscale] => false [gif] => true [colors] => 65536 [webp_lossy_support] => false [<API key>] => false [post_method_support] => true [basic_<API key>] => true [<API key>] => false [emptyok] => false [nokia_voice_call] => false [wta_voice_call] => true [wta_phonebook] => false [wta_misc] => false [wta_pdc] => false [https_support] => true [phone_id_provided] => false [max_data_rate] => 40 [wifi] => false [sdio] => false [vpn] => false [has_cellular_radio] => true [max_deck_size] => 8192 [<API key>] => 256 [<API key>] => 0 [<API key>] => 0 [<API key>] => 0 [<API key>] => 0 [max_no_of_bookmarks] => 0 [<API key>] => 0 [<API key>] => 0 [max_object_size] => 0 [downloadfun_support] => true [<API key>] => true [inline_support] => true [oma_support] => true [ringtone] => true [ringtone_3gpp] => false [<API key>] => true [<API key>] => true [ringtone_imelody] => true [ringtone_digiplug] => false [<API key>] => false [ringtone_mmf] => true [ringtone_rmf] => false [ringtone_xmf] => false [ringtone_amr] => true [ringtone_awb] => false [ringtone_aac] => false [ringtone_wav] => false [ringtone_mp3] => false [ringtone_spmidi] => true [ringtone_qcelp] => false [ringtone_voices] => 40 [<API key>] => 30000 [<API key>] => 0 [<API key>] => 0 [<API key>] => 0 [wallpaper] => true [wallpaper_max_width] => 0 [<API key>] => 0 [<API key>] => 128 [<API key>] => 126 [wallpaper_resize] => none [wallpaper_wbmp] => false [wallpaper_bmp] => false [wallpaper_gif] => true [wallpaper_jpg] => true [wallpaper_png] => true [wallpaper_tiff] => false [wallpaper_greyscale] => false [wallpaper_colors] => 16 [<API key>] => 15360 [<API key>] => 15360 [<API key>] => 15360 [<API key>] => 0 [screensaver] => false [<API key>] => 0 [<API key>] => 0 [<API key>] => 0 [<API key>] => 0 [screensaver_resize] => none [screensaver_wbmp] => false [screensaver_bmp] => false [screensaver_gif] => false [screensaver_jpg] => false [screensaver_png] => false [<API key>] => false [screensaver_colors] => 2 [<API key>] => 0 [<API key>] => 0 [<API key>] => 0 [<API key>] => 0 [picture] => false [picture_max_width] => 0 [picture_max_height] => 0 [<API key>] => 0 [<API key>] => 0 [picture_resize] => none [picture_wbmp] => false [picture_bmp] => false [picture_gif] => false [picture_jpg] => false [picture_png] => false [picture_greyscale] => false [picture_colors] => 2 [<API key>] => 0 [<API key>] => 0 [<API key>] => 0 [<API key>] => 0 [video] => false [<API key>] => true [<API key>] => false [<API key>] => false [streaming_video] => false [streaming_3gpp] => false [streaming_mp4] => false [streaming_mov] => false [<API key>] => 0 [<API key>] => none [streaming_flv] => false [streaming_3g2] => false [<API key>] => -1 [<API key>] => -1 [<API key>] => -1 [<API key>] => -1 [<API key>] => -1 [<API key>] => none [<API key>] => none [streaming_wmv] => none [<API key>] => rtsp [<API key>] => none [wap_push_support] => true [<API key>] => true [<API key>] => false [<API key>] => true [<API key>] => true [<API key>] => true [<API key>] => true [<API key>] => true [<API key>] => true [<API key>] => true [utf8_support] => true [ascii_support] => false [iso8859_support] => false [expiration_date] => true [j2me_cldc_1_0] => true [j2me_cldc_1_1] => true [j2me_midp_1_0] => true [j2me_midp_2_0] => true [doja_1_0] => false [doja_1_5] => false [doja_2_0] => false [doja_2_1] => false [doja_2_2] => false [doja_3_0] => false [doja_3_5] => false [doja_4_0] => false [j2me_jtwi] => false [j2me_mmapi_1_0] => false [j2me_mmapi_1_1] => false [j2me_wmapi_1_0] => false [j2me_wmapi_1_1] => false [j2me_wmapi_2_0] => false [j2me_btapi] => false [j2me_3dapi] => false [j2me_locapi] => false [j2me_nokia_ui] => false [j2me_motorola_lwt] => false [<API key>] => false [<API key>] => false [j2me_heap_size] => 491520 [j2me_max_jar_size] => 102400 [j2me_storage_size] => 0 [<API key>] => 0 [j2me_screen_width] => 128 [j2me_screen_height] => 160 [j2me_canvas_width] => 128 [j2me_canvas_height] => 140 [j2me_bits_per_pixel] => 16 [<API key>] => false [<API key>] => false [<API key>] => false [<API key>] => none [j2me_http] => false [j2me_https] => false [j2me_socket] => false [j2me_udp] => false [j2me_serial] => false [j2me_gif] => false [j2me_gif89a] => false [j2me_jpg] => false [j2me_png] => true [j2me_bmp] => false [j2me_bmp3] => false [j2me_wbmp] => false [j2me_midi] => false [j2me_wav] => false [j2me_amr] => false [j2me_mp3] => false [j2me_mp4] => false [j2me_imelody] => false [j2me_rmf] => false [j2me_au] => false [j2me_aac] => false [j2me_realaudio] => false [j2me_xmf] => false [j2me_wma] => false [j2me_3gpp] => false [j2me_h263] => false [j2me_svgt] => false [j2me_mpeg4] => false [j2me_realvideo] => false [j2me_real8] => false [j2me_realmedia] => false [<API key>] => 0 [<API key>] => 0 [<API key>] => 0 [<API key>] => 0 [<API key>] => 0 [j2me_clear_key_code] => 0 [<API key>] => false [<API key>] => false [receiver] => true [sender] => true [mms_max_size] => 81920 [mms_max_height] => 160 [mms_max_width] => 128 [built_in_recorder] => false [built_in_camera] => false [mms_jpeg_baseline] => true [<API key>] => false [mms_gif_static] => true [mms_gif_animated] => false [mms_png] => true [mms_bmp] => false [mms_wbmp] => true [mms_amr] => true [mms_wav] => false [mms_midi_monophonic] => true [mms_midi_polyphonic] => true [<API key>] => 40 [mms_spmidi] => false [mms_mmf] => true [mms_mp3] => false [mms_evrc] => false [mms_qcelp] => false [mms_ota_bitmap] => false [mms_nokia_wallpaper] => false [<API key>] => false [<API key>] => false [<API key>] => false [mms_rmf] => false [mms_xmf] => false [mms_symbian_install] => false [mms_jar] => false [mms_jad] => false [mms_vcard] => false [mms_vcalendar] => false [mms_wml] => false [mms_wbxml] => false [mms_wmlc] => false [mms_video] => false [mms_mp4] => false [mms_3gpp] => false [mms_3gpp2] => false [mms_max_frame_rate] => 0 [nokiaring] => false [picturemessage] => false [operatorlogo] => false [largeoperatorlogo] => false [callericon] => false [nokiavcard] => false [nokiavcal] => false [sckl_ringtone] => false [sckl_operatorlogo] => false [sckl_groupgraphic] => false [sckl_vcard] => false [sckl_vcalendar] => false [text_imelody] => false [ems] => true [<API key>] => false [ems_imelody] => false [ems_odi] => false [ems_upi] => false [ems_version] => 0 [siemens_ota] => false [siemens_logo_width] => 101 [siemens_logo_height] => 29 [<API key>] => 101 [<API key>] => 50 [gprtf] => false [sagem_v1] => false [sagem_v2] => false [panasonic] => false [sms_enabled] => true [wav] => false [mmf] => true [smf] => false [mld] => false [midi_monophonic] => true [midi_polyphonic] => true [sp_midi] => true [rmf] => false [xmf] => false [compactmidi] => false [digiplug] => false [nokia_ringtone] => false [imelody] => true [au] => false [amr] => false [awb] => false [aac] => false [mp3] => false [voices] => 40 [qcelp] => false [evrc] => false [flash_lite_version] => [fl_wallpaper] => false [fl_screensaver] => false [fl_standalone] => false [fl_browser] => false [fl_sub_lcd] => false [full_flash_support] => false [<API key>] => true [css_border_image] => none [css_rounded_corners] => none [css_gradient] => none [css_spriting] => false [css_gradient_linear] => none [is_transcoder] => false [<API key>] => user-agent [rss_support] => false [pdf_support] => false [<API key>] => false [<API key>] => -1 [<API key>] => -1 [<API key>] => -1 [<API key>] => -1 [<API key>] => -1 [playback_real_media] => none [playback_3gpp] => false [playback_3g2] => false [playback_mp4] => false [playback_mov] => false [playback_acodec_amr] => none [playback_acodec_aac] => none [<API key>] => 0 [<API key>] => 0 [<API key>] => 0 [<API key>] => 0 [<API key>] => false [playback_wmv] => none [<API key>] => false [html_preferred_dtd] => xhtml_mp1 [viewport_supported] => false [viewport_width] => [<API key>] => [<API key>] => [<API key>] => [<API key>] => [mobileoptimized] => false [handheldfriendly] => false [canvas_support] => none [image_inlining] => false [is_smarttv] => false [is_console] => false [nfc_support] => false [ux_full_desktop] => false [jqm_grade] => none [is_sencha_touch_ok] => false ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>Zsxsoft<br /><small>1.3</small><br /></td><td> </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">Samsung</td><td>SGH-E700A</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.001</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#<API key>">Detail</a> <!-- Modal Structure --> <div id="<API key>" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>Zsxsoft result detail</h4> <p><pre><code class="php">Array ( [browser] => Array ( [link] => [title] => Unknown [name] => Unknown [version] => [code] => null [image] => img/16/browser/null.png ) [os] => Array ( [link] => [name] => [version] => [code] => null [x64] => [title] => [type] => os [dir] => os [image] => img/16/os/null.png ) [device] => Array ( [link] => http: [title] => Samsung SGH-E700A [model] => SGH-E700A [brand] => Samsung [code] => samsung [dir] => device [type] => device [image] => img/16/device/samsung.png ) [platform] => Array ( [link] => http: [title] => Samsung SGH-E700A [model] => SGH-E700A [brand] => Samsung [code] => samsung [dir] => device [type] => device [image] => img/16/device/samsung.png ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr></table> </div> <div class="section"> <h1 class="header center orange-text">About this comparison</h1> <div class="row center"> <h5 class="header light"> The primary goal of this project is simple<br /> I wanted to know which user agent parser is the most accurate in each part - device detection, bot detection and so on...<br /> <br /> The secondary goal is to provide a source for all user agent parsers to improve their detection based on this results.<br /> <br /> You can also improve this further, by suggesting ideas at <a href="https://github.com/ThaDafinser/<API key>">ThaDafinser/<API key></a><br /> <br /> The comparison is based on the abstraction by <a href="https://github.com/ThaDafinser/UserAgentParser">ThaDafinser/UserAgentParser</a> </h5> </div> </div> <div class="card"> <div class="card-content"> Comparison created <i>2016-05-10 08:02:09</i> | by <a href="https://github.com/ThaDafinser">ThaDafinser</a> </div> </div> </div> <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/js/materialize.min.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/list.js/1.2.0/list.min.js"></script> <script> $(document).ready(function(){ // the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered $('.modal-trigger').leanModal(); }); </script> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>User agent detail - Mozilla/5.0 (iPod; CPU iPhone OS 6_1_5 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10B400 [FBAN/FBIOS;FBAV/10.0.0.26.21;FBBV/2441354;FBDV/iPod4,1;FBMD/iPod touch;FBSN/iPhone OS;FBSV/6.1.5;FBSS/2; FBCR/;FBID/phone;FBLC/it_IT;FBOP/5]</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link href="../circle.css" rel="stylesheet"> </head> <body> <div class="container"> <div class="section"> <h1 class="header center orange-text">User agent detail</h1> <div class="row center"> <h5 class="header light"> Mozilla/5.0 (iPod; CPU iPhone OS 6_1_5 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10B400 [FBAN/FBIOS;FBAV/10.0.0.26.21;FBBV/2441354;FBDV/iPod4,1;FBMD/iPod touch;FBSN/iPhone OS;FBSV/6.1.5;FBSS/2; FBCR/;FBID/phone;FBLC/it_IT;FBOP/5] </h5> </div> </div> <div class="section"> <table class="striped"><tr><th></th><th colspan="3">General</th><th colspan="5">Device</th><th colspan="3">Bot</th><th colspan="2"></th></tr><tr><th>Provider</th><th>Browser</th><th>Engine</th><th>OS</th><th>Brand</th><th>Model</th><th>Type</th><th>Is mobile</th><th>Is touch</th><th>Is bot</th><th>Name</th><th>Type</th><th>Parse time</th><th>Actions</th></tr><tr><th colspan="14" class="green lighten-3">Test suite</th></tr><tr><td>Browscap<br /><small>6014</small><br /><small>vendor/browscap/browscap/tests/fixtures/issues/issue-310.php</small></td><td>Facebook App 0.0</td><td>WebKit unknown</td><td>iOS 6.1</td><td style="border-left: 1px solid #555">Apple</td><td>iPod Touch</td><td>Mobile Device</td><td>yes</td><td>yes</td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#<API key>">Detail</a> <!-- Modal Structure --> <div id="<API key>" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>Browscap result detail</h4> <p><pre><code class="php">Array ( [Comment] => Facebook App for iOS [Browser] => Facebook App [Browser_Type] => Application [Browser_Bits] => 32 [Browser_Maker] => Facebook [Browser_Modus] => unknown [Version] => 0.0 [MajorVer] => 0 [MinorVer] => 0 [Platform] => iOS [Platform_Version] => 6.1 [<API key>] => iPod, iPhone & iPad [Platform_Bits] => 32 [Platform_Maker] => Apple Inc [Alpha] => [Beta] => [Win16] => [Win32] => [Win64] => [Frames] => 1 [IFrames] => 1 [Tables] => 1 [Cookies] => 1 [BackgroundSounds] => [JavaScript] => 1 [VBScript] => [JavaApplets] => 1 [ActiveXControls] => [isMobileDevice] => 1 [isTablet] => [isSyndicationReader] => [Crawler] => [isFake] => [isAnonymized] => [isModified] => [CssVersion] => 3 [AolVersion] => 0 [Device_Name] => iPod Touch [Device_Maker] => Apple Inc [Device_Type] => Mobile Device [<API key>] => touchscreen [Device_Code_Name] => iPod Touch [Device_Brand_Name] => Apple [<API key>] => WebKit [<API key>] => unknown [<API key>] => Apple Inc ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><th colspan="14" class="green lighten-3">Providers</th></tr><tr><td>BrowscapFull<br /><small>6014</small><br /></td><td>Facebook App </td><td>WebKit </td><td>iOS 6.1</td><td style="border-left: 1px solid #555">Apple</td><td>iPod Touch</td><td>Mobile Device</td><td>yes</td><td>yes</td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.036</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#<API key>">Detail</a> <!-- Modal Structure --> <div id="<API key>" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>BrowscapFull result detail</h4> <p><pre><code class="php">stdClass Object ( [browser_name_regex] => /^mozilla\/5\.0 \(ipod.*cpu iphone os 6.1.* like mac os x.*\) applewebkit.* \(khtml,.*like gecko.*\).*mobile.*fb.*$/ [<API key>] => mozilla/5.0 (ipod*cpu iphone os 6?1* like mac os x*) applewebkit* (khtml,*like gecko*)*mobile*fb* [parent] => Facebook App for iOS [comment] => Facebook App for iOS [browser] => Facebook App [browser_type] => Application [browser_bits] => 32 [browser_maker] => Facebook [browser_modus] => unknown [version] => 0.0 [majorver] => 0 [minorver] => 0 [platform] => iOS [platform_version] => 6.1 [<API key>] => iPod, iPhone & iPad [platform_bits] => 32 [platform_maker] => Apple Inc [alpha] => [beta] => [win16] => [win32] => [win64] => [frames] => 1 [iframes] => 1 [tables] => 1 [cookies] => 1 [backgroundsounds] => [javascript] => 1 [vbscript] => [javaapplets] => 1 [activexcontrols] => [ismobiledevice] => 1 [istablet] => [issyndicationreader] => [crawler] => [isfake] => [isanonymized] => [ismodified] => [cssversion] => 3 [aolversion] => 0 [device_name] => iPod Touch [device_maker] => Apple Inc [device_type] => Mobile Device [<API key>] => touchscreen [device_code_name] => iPod Touch [device_brand_name] => Apple [<API key>] => WebKit [<API key>] => unknown [<API key>] => For Google Chrome, iOS (including both mobile Safari, WebViews within third-party apps, and web clips), Safari, Arora, Midori, OmniWeb, Shiira, iCab since version 4, Web, SRWare Iron, Rekonq, and in Maxthon 3. [<API key>] => Apple Inc ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>BrowscapLite<br /><small>6014</small><br /></td><td>Mobile Safari UIWebView </td><td><i class="material-icons">close</i></td><td>iOS </td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>Mobile Device</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.005</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#<API key>">Detail</a> <!-- Modal Structure --> <div id="<API key>" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>BrowscapLite result detail</h4> <p><pre><code class="php">stdClass Object ( [browser_name_regex] => /^mozilla\/5\.0.*\(ipod.*cpu.*os.* like mac os x.*\).*applewebkit\/.*\(.*khtml.* like gecko.*\).*mobile.*$/
#include <string> #include <map> #include <set> #include <vector> #include <algorithm> using namespace std; class Person { public: explicit Person(const string& f_name, const string& l_name, int year) { birthday = year; ChangeFirstName(year, f_name); ChangeLastName(year, l_name); } void ChangeFirstName(int year, const string& first_name) { if (year < birthday) return; first_names[year] = first_name; } void ChangeLastName(int year, const string& last_name) { if (year < birthday) return; last_names[year] = last_name; } string GetFullName(int year) const { if (year < birthday) return "No person"; int first_year = GetYear(first_names, year); int last_year = GetYear(last_names, year); bool first_name_changed = first_names.count(first_year); bool last_name_changed = last_names.count(last_year); if (first_name_changed && last_name_changed) { return first_names.at(first_year) + " " + last_names.at(last_year); } else if (first_name_changed && !last_name_changed) { return first_names.at(first_year) + " with unknown last name"; } else if (!first_name_changed && last_name_changed) { return last_names.at(last_year) + " with unknown first name"; } else { return "Incognito"; } } string <API key>(int year) const { if (year < birthday) return "No person"; auto f_names = GetNames(first_names, year); auto l_names = GetNames(last_names, year); if (!f_names.size() && !l_names.size()) { return "Incognito"; } else if (!f_names.size() && l_names.size()) { return GetName(l_names) + " with unknown first name"; } else if (f_names.size() && !l_names.size()) { return GetName(f_names) + " with unknown last name"; } else { return GetName(f_names) + " " + GetName(l_names); } } private: map<int, string> first_names; map<int, string> last_names; int birthday; int GetYear(const map<int, string>& m, int year) const { int last_year = 0; for (auto& i : m) { if (i.first <= year) { last_year = i.first; } else { break; } } return last_year; } vector<string> GetNames(const map<int, string>& m, int year) const { vector<string> names; for (const auto& i : m) { if (i.first <= year) { names.push_back(i.second); } else { break; } } reverse(begin(names), end(names)); return names; } string GetName(const vector<string>& names) const { string result = names[0]; string prev = names[0]; string s; for (int i = 1; i < names.size(); ++i) { if (prev != names[i]) { if (!s.empty()) { s += ", "; } prev = names[i]; s += names[i]; } } if (!s.empty()) { result = result + " (" + s + ")"; } return result; } };
{% load keeper %} <html> <head> <meta charset="UTF-8"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+<API key>" crossorigin="anonymous"> </head> <body> <nav class="navbar navbar-light bg-light navbar-expand-lg"> <ul class="navbar-nav mr-auto container"> <li> <a class="nav-link" href="{% url 'dashboard' %}">Dashboard</a> </li> {% has_permission request.user.team 'view' as team_view%} {% if team_view %} <li> <a class="nav-link" href="{% url 'team_dashboard' %}">Team</a> </li> {% endif %} </ul> </nav> {% block content %} {% endblock %} </body> </html>
from __future__ import absolute_import import pytest from openpyxl.xml.functions import fromstring, tostring from openpyxl.tests.helper import compare_xml @pytest.fixture def Reference(): from ..reference import Reference return Reference @pytest.fixture def Worksheet(): class DummyWorksheet: def __init__(self, title="dummy"): self.title = title return DummyWorksheet class TestReference: def test_ctor(self, Reference, Worksheet): ref = Reference( worksheet=Worksheet(), min_col=1, min_row=1, max_col=10, max_row=12 ) assert str(ref) == "dummy!$A$1:$J$12" def test_single_cell(self, Reference, Worksheet): ref = Reference(Worksheet(), min_col=1, min_row=1) assert str(ref) == "dummy!$A$1" def test_from_string(self, Reference): ref = Reference(range_string="Sheet1!$A$1:$A$10") assert (ref.min_col, ref.min_row, ref.max_col, ref.max_row) == (1,1, 1,10) assert str(ref) == "Sheet1!$A$1:$A$10" def test_cols(self, Reference): ref = Reference(range_string="Sheet!A1:B2") assert list(ref.cols) == [ ('A1', 'A2'), ('B1', 'B2') ] def test_rows(self, Reference): ref = Reference(range_string="Sheet!A1:B2") assert list(ref.rows) == [ ('A1', 'B1'), ('A2', 'B2') ] @pytest.mark.parametrize("range_string, cells", [ ("Sheet!A1:A5", ['A1', 'A2', 'A3', 'A4', 'A5']), ("Sheet!A1:E1", ['A1', 'B1', 'C1', 'D1', 'E1']), ] ) def test_cells(self, Reference, range_string, cells): ref = Reference(range_string=range_string) assert list(ref.cells) == cells @pytest.mark.parametrize("range_string, cell, min_col, min_row", [ ("Sheet1!A1:A10", 'A1', 1, 2), ("Sheet!A1:E1", 'A1', 2, 1), ] ) def test_pop(self, Reference, range_string, cell, min_col, min_row): ref = Reference(range_string=range_string) assert cell == ref.pop() assert (ref.min_col, ref.min_row) == (min_col, min_row) @pytest.mark.parametrize("range_string, length", [ ("Sheet1!A1:A10", 10), ("Sheet!A1:E1", 5), ] ) def test_length(self, Reference, range_string, length): ref = Reference(range_string=range_string) assert len(ref) == length
/** \file * * Main source file for the RNDISEthernetHost demo. This file contains the main tasks of * the demo and is responsible for the initial application hardware configuration. */ #include "RNDISEthernetHost.h" /** Main program entry point. This routine configures the hardware required by the application, then * enters a loop to run the application tasks in sequence. */ int main(void) { SetupHardware(); puts_P(PSTR(ESC_FG_CYAN "RNDIS Host Demo running.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(<API key>); for (;;) { RNDIS_Host_Task(); USB_USBTask(); } } /** Configures the board hardware and chip peripherals for the demo's functionality. */ void SetupHardware(void) { /* Disable watchdog if enabled by bootloader/fuses */ MCUSR &= ~(1 << WDRF); wdt_disable(); /* Disable clock division */ clock_prescale_set(clock_div_1); /* Hardware Initialization */ SerialStream_Init(9600, false); LEDs_Init(); USB_Init(); } /** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and * starts the library USB task to begin the enumeration and USB management process. */ void <API key>(void) { puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(<API key>); } /** Event handler for the <API key> event. This indicates that a device has been removed from the host, and * stops the library USB task management process. */ void <API key>(void) { puts_P(PSTR(ESC_FG_GREEN "\r\nDevice Unattached.\r\n" ESC_FG_WHITE)); LEDs_SetAllLEDs(<API key>); } /** Event handler for the <API key> event. This indicates that a device has been successfully * enumerated by the host and is now ready to be used by the application. */ void <API key>(void) { LEDs_SetAllLEDs(LEDMASK_USB_READY); } /** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */ void <API key>(const uint8_t ErrorCode) { USB_ShutDown(); printf_P(PSTR(ESC_FG_RED "Host Mode Error\r\n" " -- Error Code %d\r\n" ESC_FG_WHITE), ErrorCode); LEDs_SetAllLEDs(LEDMASK_USB_ERROR); for(;;); } /** Event handler for the <API key> event. This indicates that a problem occurred while * enumerating an attached USB device. */ void <API key>(const uint8_t ErrorCode, const uint8_t SubErrorCode) { printf_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n" " -- Error Code %d\r\n" " -- Sub Error Code %d\r\n" " -- In State %d\r\n" ESC_FG_WHITE), ErrorCode, SubErrorCode, USB_HostState); LEDs_SetAllLEDs(LEDMASK_USB_ERROR); } void <API key>(void) { uint8_t ErrorCode; LEDs_SetAllLEDs(LEDMASK_USB_BUSY); uint16_t PacketLength; if ((ErrorCode = <API key>(&PacketLength)) != <API key>) { printf_P(PSTR(ESC_FG_RED "Packet Reception Error.\r\n" " -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode); return; } if (!(PacketLength)) return; Pipe_Unfreeze(); printf_P(PSTR("***PACKET (Size %d)***\r\n"), PacketLength); if (PacketLength > 1024) { puts_P(PSTR(ESC_FG_RED "Packet too large.\r\n" ESC_FG_WHITE)); Pipe_Discard_Stream(PacketLength); } else { uint8_t PacketBuffer[PacketLength]; Pipe_Read_Stream_LE(&PacketBuffer, PacketLength); for (uint16_t i = 0; i < PacketLength; i++) printf("%02x ", PacketBuffer[i]); } Pipe_ClearIN(); Pipe_Freeze(); printf("\r\n\r\n"); LEDs_SetAllLEDs(LEDMASK_USB_READY); } /** Task to set the configuration of the attached device after it has been enumerated, and to read in * data received from the attached RNDIS device and print it to the serial port. */ void RNDIS_Host_Task(void) { uint8_t ErrorCode; switch (USB_HostState) { case <API key>: puts_P(PSTR("Getting Config Data.\r\n")); /* Get and process the configuration descriptor data */ if ((ErrorCode = <API key>()) != <API key>) { if (ErrorCode == ControlError) puts_P(PSTR(ESC_FG_RED "Control Error (Get Configuration).\r\n")); else puts_P(PSTR(ESC_FG_RED "Invalid Device.\r\n")); printf_P(PSTR(" -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode); /* Indicate error via status LEDs */ LEDs_SetAllLEDs(LEDMASK_USB_ERROR); /* Wait until USB device disconnected */ USB_HostState = <API key>; break; } /* Set the device configuration to the first configuration (rarely do devices use multiple configurations) */ if ((ErrorCode = <API key>(1)) != <API key>) { printf_P(PSTR(ESC_FG_RED "Control Error (Set Configuration).\r\n" " -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode); /* Indicate error via status LEDs */ LEDs_SetAllLEDs(LEDMASK_USB_ERROR); /* Wait until USB device disconnected */ USB_HostState = <API key>; break; } uint16_t DeviceMaxPacketSize; if ((ErrorCode = <API key>(1024, &DeviceMaxPacketSize)) != <API key>) { printf_P(PSTR(ESC_FG_RED "Error Initializing Device.\r\n" " -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode); /* Indicate error via status LEDs */ LEDs_SetAllLEDs(LEDMASK_USB_ERROR); /* Wait until USB device disconnected */ USB_HostState = <API key>; break; } printf_P(PSTR("Device Max Transfer Size: %lu bytes.\r\n"), DeviceMaxPacketSize); /* We set the default filter to only receive packets we would be interested in */ uint32_t PacketFilter = (<API key> | <API key> | <API key>); if ((ErrorCode = <API key>(<API key>, &PacketFilter, sizeof(PacketFilter))) != <API key>) { printf_P(PSTR(ESC_FG_RED "Error Setting Device Packet Filter.\r\n" " -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode); /* Indicate error via status LEDs */ LEDs_SetAllLEDs(LEDMASK_USB_ERROR); /* Wait until USB device disconnected */ USB_HostState = <API key>; break; } uint32_t VendorID; if ((ErrorCode = <API key>(OID_GEN_VENDOR_ID, &VendorID, sizeof(VendorID))) != <API key>) { printf_P(PSTR(ESC_FG_RED "Error Getting Vendor ID.\r\n" " -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode); /* Indicate error via status LEDs */ LEDs_SetAllLEDs(LEDMASK_USB_ERROR); /* Wait until USB device disconnected */ USB_HostState = <API key>; break; } printf_P(PSTR("Device Vendor ID: 0x%08lX\r\n"), VendorID); puts_P(PSTR("RNDIS Device Enumerated.\r\n")); USB_HostState = <API key>; break; case <API key>: <API key>(); break; } }
<!DOCTYPE html PUBLIC "- <html xmlns="http: <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.9.1"/> <title>V8 API Reference Guide for node.js v0.10.24: Member List</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { init_search(); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">V8 API Reference Guide for node.js v0.10.24 </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.9.1 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="<API key>"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="<API key>.html">UnicodeInputStream</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">v8::UnicodeInputStream Member List</div> </div> </div><!--header <div class="contents"> <p>This is the complete list of members for <a class="el" href="<API key>.html">v8::UnicodeInputStream</a>, including all inherited members.</p> <table class="directory"> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Next</b>()=0 (defined in <a class="el" href="<API key>.html">v8::UnicodeInputStream</a>)</td><td class="entry"><a class="el" href="<API key>.html">v8::UnicodeInputStream</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>~UnicodeInputStream</b>() (defined in <a class="el" href="<API key>.html">v8::UnicodeInputStream</a>)</td><td class="entry"><a class="el" href="<API key>.html">v8::UnicodeInputStream</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr> </table></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Tue Aug 11 2015 23:45:09 for V8 API Reference Guide for node.js v0.10.24 by & <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.9.1 </small></address> </body> </html>
require "spec_helper" require "json" describe Eshealth::Metrics do describe "Attributes" do metrics = Eshealth::Metrics.new it "Allows reading and writing for :url" do metrics.url = "something_stupid" expect(metrics.url).to eq("something_stupid") end it "Allows reading and writing for :type" do metrics.type = "something_stupid" expect(metrics.type).to eq("something_stupid") end it "Allows reading and writing for :metrics and metrics must be an array" do metrics.metrics = ["something_stupid"] expect(metrics.metrics).to eq(["something_stupid"]) expect { metrics.metrics = "something_stupid" }.to raise_error("metrics must be an Array not a String") end it "Allows reading and writing for :prefix" do metrics.prefix = "something_stupid" expect(metrics.prefix).to eq("something_stupid") end it "Allows reading and writing for :lastmsg" do metrics.lastmsg = "something_stupid" expect(metrics.lastmsg).to eq("something_stupid") end describe ".requestfactory" do it "Allows reading and writing for :requestfactory" do metrics.requestfactory = Eshealth::FakeRequest.new expect(metrics.requestfactory).to be_a(Eshealth::FakeRequest) end it "And it must be a Eshealth::RequestFactory" do expect { metrics.requestfactory = "something_stupid" }.to raise_error("requestfactory must be a 'Eshealth::Requestfactory' not a Object") end end end describe "Methods" do describe "#healthstatus" do response = { "nodes" => { "host" => { "name" => "something_stupid", "something_stupid" => "something_stupid" } } }.to_json requestfactory = Eshealth::FakeRequest.new(:response => response ) metrics = Eshealth::Metrics.new( :url => "localhost", :metrics => ["something_stupid"], :prefix => "something_stupid", :requestfactory => requestfactory ) it "Should return 'metrics checked'" do expect(metrics.healthstatus).to eq("metrics checked") end end end end
package com.microsoft.azure.management.cdn.v2020_04_15; import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; /** * Defines the parameters for Cookies match conditions. */ public class <API key> { /** * The odatatype property. */ @JsonProperty(value = "@odata\\.type", required = true) private String odatatype; /** * Name of Cookies to be matched. */ @JsonProperty(value = "selector", required = true) private String selector; /** * Describes operator to be matched. Possible values include: 'Any', * 'Equal', 'Contains', 'BeginsWith', 'EndsWith', 'LessThan', * 'LessThanOrEqual', 'GreaterThan', 'GreaterThanOrEqual'. */ @JsonProperty(value = "operator", required = true) private CookiesOperator operator; /** * Describes if this is negate condition or not. */ @JsonProperty(value = "negateCondition") private Boolean negateCondition; /** * The match value for the condition of the delivery rule. */ @JsonProperty(value = "matchValues", required = true) private List<String> matchValues; /** * List of transforms. */ @JsonProperty(value = "transforms") private List<Transform> transforms; /** * Creates an instance of <API key> class. * @param selector name of Cookies to be matched. * @param operator describes operator to be matched. Possible values include: 'Any', 'Equal', 'Contains', 'BeginsWith', 'EndsWith', 'LessThan', 'LessThanOrEqual', 'GreaterThan', 'GreaterThanOrEqual'. * @param matchValues the match value for the condition of the delivery rule. */ public <API key>() { odatatype = "#Microsoft.Azure.Cdn.Models.<API key>"; } /** * Get the odatatype value. * * @return the odatatype value */ public String odatatype() { return this.odatatype; } /** * Set the odatatype value. * * @param odatatype the odatatype value to set * @return the <API key> object itself. */ public <API key> withOdatatype(String odatatype) { this.odatatype = odatatype; return this; } /** * Get name of Cookies to be matched. * * @return the selector value */ public String selector() { return this.selector; } /** * Set name of Cookies to be matched. * * @param selector the selector value to set * @return the <API key> object itself. */ public <API key> withSelector(String selector) { this.selector = selector; return this; } /** * Get describes operator to be matched. Possible values include: 'Any', 'Equal', 'Contains', 'BeginsWith', 'EndsWith', 'LessThan', 'LessThanOrEqual', 'GreaterThan', 'GreaterThanOrEqual'. * * @return the operator value */ public CookiesOperator operator() { return this.operator; } /** * Set describes operator to be matched. Possible values include: 'Any', 'Equal', 'Contains', 'BeginsWith', 'EndsWith', 'LessThan', 'LessThanOrEqual', 'GreaterThan', 'GreaterThanOrEqual'. * * @param operator the operator value to set * @return the <API key> object itself. */ public <API key> withOperator(CookiesOperator operator) { this.operator = operator; return this; } /** * Get describes if this is negate condition or not. * * @return the negateCondition value */ public Boolean negateCondition() { return this.negateCondition; } /** * Set describes if this is negate condition or not. * * @param negateCondition the negateCondition value to set * @return the <API key> object itself. */ public <API key> withNegateCondition(Boolean negateCondition) { this.negateCondition = negateCondition; return this; } /** * Get the match value for the condition of the delivery rule. * * @return the matchValues value */ public List<String> matchValues() { return this.matchValues; } /** * Set the match value for the condition of the delivery rule. * * @param matchValues the matchValues value to set * @return the <API key> object itself. */ public <API key> withMatchValues(List<String> matchValues) { this.matchValues = matchValues; return this; } /** * Get list of transforms. * * @return the transforms value */ public List<Transform> transforms() { return this.transforms; } /** * Set list of transforms. * * @param transforms the transforms value to set * @return the <API key> object itself. */ public <API key> withTransforms(List<Transform> transforms) { this.transforms = transforms; return this; } }
'use strict'; /** * Module dependencies. */ var mongoose = require('mongoose'), Schema = mongoose.Schema, crypto = require('crypto'); /** * A Validation function for local strategy properties */ var <API key> = function(property) { return ((this.provider !== 'local' && !this.updated) || property.length); }; /** * A Validation function for local strategy password */ var <API key> = function(password) { return (this.provider !== 'local' || (password && password.length > 6)); }; /** * User Schema */ var UserSchema = new Schema({ firstName: { type: String, trim: true, default: '' }, lastName: { type: String, trim: true, default: '' }, phone: { type: String, trim: true, default: '', validate: [<API key>, 'Debe ingresar un teléfono de contacto'] }, displayName: { type: String, trim: true }, email: { type: String, trim: true, default: '', validate: [<API key>, 'Por favor, introduzca su email'], match: [/.+\@.+\..+/, 'Por favor introduzca un email válido'] }, username: { type: String, unique: 'mensaje de error', required: 'Por favor, introduzca un nombre de usuario', trim: true }, password: { type: String, default: '', validate: [<API key>, 'La contraseña debe ser más larga'] }, salt: { type: String }, provider: { type: String, required: 'Provider is required' }, providerData: {}, <API key>: {}, roles: { type: [{ type: String, enum: ['user', 'admin'] }], default: ['user'] }, updated: { type: Date }, created: { type: Date, default: Date.now }, /* For reset password */ resetPasswordToken: { type: String }, <API key>: { type: Date } }); /** * Hook a pre save method to hash the password */ UserSchema.pre('save', function(next) { if (this.password && this.password.length > 6) { this.salt = new Buffer(crypto.randomBytes(16).toString('base64'), 'base64'); this.password = this.hashPassword(this.password); } next(); }); /** * Create instance method for hashing a password */ UserSchema.methods.hashPassword = function(password) { if (this.salt && password) { return crypto.pbkdf2Sync(password, this.salt, 10000, 64).toString('base64'); } else { return password; } }; /** * Create instance method for authenticating user */ UserSchema.methods.authenticate = function(password) { return this.password === this.hashPassword(password); }; /** * Find possible not used username */ UserSchema.statics.findUniqueUsername = function(username, suffix, callback) { var _this = this; var possibleUsername = username + (suffix || ''); _this.findOne({ username: possibleUsername }, function(err, user) { if (!err) { if (!user) { callback(possibleUsername); } else { return _this.findUniqueUsername(username, (suffix || 0) + 1, callback); } } else { callback(null); } }); }; mongoose.model('User', UserSchema);
<?php namespace AntiMattr\Tests\ETL\Transform\Transformer\MongoDB; use AntiMattr\ETL\Transform\Transformer\MongoDB\<API key>; use AntiMattr\TestCase\AntiMattrTestCase; use MongoId; class <API key> extends AntiMattrTestCase { private $transformation; private $transformer; protected function setUp() { $this->transformation = $this->getMock('AntiMattr\ETL\Transform\<API key>'); $this->transformer = new <API key>(); $this->transformer->options['field'] = 'foo'; } public function testConstructor() { $this->assertInstanceOf('AntiMattr\ETL\Transform\Transformer\<API key>', $this->transformer); } /** * @expectedException \AntiMattr\ETL\Exception\TransformException */ public function testRequiredOptions() { $this->transformer = new <API key>(); $this->assertNull($this->transformer->transform(null, $this->transformation)); } public function testNull() { $this->assertNull($this->transformer->transform(null, $this->transformation)); } }
define(['handlebars'], function ( Handlebars ){ function genderValue (value) { var out = ""; if (value != null) { if (value === 1) { out = "Female"; } else if (value === 2) { out = "Male"; } } return out; } Handlebars.registerHelper( 'genderValue', genderValue ); return genderValue; });
using System; using System.Collections; using System.Collections.Generic; using System.Threading; using System.Runtime.InteropServices; public class Toggleref { public int __test; public string id; public List<object> link = new List<object> (); public const int DROP = 0; public const int STRONG = 1; public const int WEAK = 2; ~Toggleref () { } } [StructLayout (LayoutKind.Explicit)] public struct Helper { [FieldOffset(0)] IntPtr ptr; [FieldOffset(0)] object obj; public static IntPtr ObjToPtr (object obj) { Helper h = default (Helper); h.obj = obj; return h.ptr; } } class Driver { static WeakReference<Toggleref> root, child; [DllImport ("__Internal", EntryPoint="<API key>")] static extern int <API key> (IntPtr ptr, bool strong_ref); static void Register (object obj) { <API key> (Helper.ObjToPtr (obj), true); } static void SetupLinks () { var a = new Toggleref () { id = "root" }; var b = new Toggleref () { id = "child" }; a.link.Add (b); a.__test = Toggleref.STRONG; b.__test = Toggleref.WEAK; Register (a); Register (b); root = new WeakReference<Toggleref> (a, false); child = new WeakReference<Toggleref> (b, false); } static Toggleref a, b; static int Main () { var t = new Thread (SetupLinks); t.Start (); t.Join (); GC.Collect (); GC.<API key> (); Console.WriteLine ("try get A {0}", root.TryGetTarget (out a)); Console.WriteLine ("try get B {0}", child.TryGetTarget (out b)); Console.WriteLine ("a is null {0}", a == null); Console.WriteLine ("b is null {0}", b == null); if (a == null || b == null) return 1; Console.WriteLine ("a test {0}", a.__test); Console.WriteLine ("b test {0}", b.__test); //now we break the link and switch b to strong a.link.Clear (); b.__test = Toggleref.STRONG; a = b = null; GC.Collect (); GC.<API key> (); Console.WriteLine ("try get A {0}", root.TryGetTarget (out a)); Console.WriteLine ("try get B {0}", child.TryGetTarget (out b)); Console.WriteLine ("a is null {0}", a == null); Console.WriteLine ("b is null {0}", b == null); if (a == null || b == null) return 2; Console.WriteLine ("a test {0}", a.__test); Console.WriteLine ("b test {0}", b.__test); return 0; } }
import {ObjectType, Root, Field} from "type-graphql" import {Page, PageParams} from "api/type/abstract/Page" import {Chapter} from "entity/Chapter" export type ChapterPageParams = PageParams<Chapter> @ObjectType() export class ChapterPage extends Page<Chapter> { @Field(() => [Chapter], {nullable: "items"}) list(@Root() {rows}: ChapterPageParams): Chapter[] { return rows } }
//$Id: examplewindow.cc 836 2007-05-09 03:02:38Z jjongsma $ -*- c++ -*- #include "examplewindow.h" #include <gtkmm.h> #include <iostream> ExampleWindow::ExampleWindow() { set_title("main_menu example"); set_default_size(200, 200); add(m_Box); //We can put a MenuBar at the top of the box and other stuff below it. //Define the actions: m_refActionGroup = Gtk::ActionGroup::create(); m_refActionGroup->add( Gtk::Action::create("MenuFile", "_File") ); m_refActionGroup->add( Gtk::Action::create("New", Gtk::Stock::NEW), sigc::mem_fun(*this, &ExampleWindow::on_action_file_new) ); m_refActionGroup->add( Gtk::Action::create("Open", Gtk::Stock::OPEN), sigc::mem_fun(*this, &ExampleWindow::on_action_others) ); <API key>(); //Makes the "example_stock_rain" stock item available. m_refActionGroup->add( Gtk::ToggleAction::create("Rain", Gtk::StockID("example_stock_rain") ), sigc::mem_fun(*this, &ExampleWindow::on_action_others) ); m_refActionGroup->add( Gtk::Action::create("Quit", Gtk::Stock::QUIT), sigc::mem_fun(*this, &ExampleWindow::on_action_file_quit) ); m_refActionGroup->add( Gtk::Action::create("MenuEdit", "_Edit") ); m_refActionGroup->add( Gtk::Action::create("Cut", Gtk::Stock::CUT), sigc::mem_fun(*this, &ExampleWindow::on_action_others) ); m_refActionGroup->add( Gtk::Action::create("Copy", Gtk::Stock::COPY), sigc::mem_fun(*this, &ExampleWindow::on_action_others) ); m_refActionGroup->add( Gtk::Action::create("Paste", Gtk::Stock::PASTE), sigc::mem_fun(*this, &ExampleWindow::on_action_others) ); //Define how the actions are presented in the menus and toolbars: Glib::RefPtr<Gtk::UIManager> m_refUIManager = Gtk::UIManager::create(); m_refUIManager->insert_action_group(m_refActionGroup); add_accel_group(m_refUIManager->get_accel_group()); //Layout the actions in a menubar and toolbar: Glib::ustring ui_info = "<ui>" " <menubar name='MenuBar'>" " <menu action='MenuFile'>" " <menuitem action='New'/>" " <menuitem action='Open'/>" " <separator/>" " <menuitem action='Rain'/>" " <separator/>" " <menuitem action='Quit'/>" " </menu>" " <menu action='MenuEdit'>" " <menuitem action='Cut'/>" " <menuitem action='Copy'/>" " <menuitem action='Paste'/>" " </menu>" " </menubar>" " <toolbar name='ToolBar'>" " <toolitem action='Open'/>" " <toolitem action='Rain'/>" " <toolitem action='Quit'/>" " </toolbar>" "</ui>"; try { m_refUIManager->add_ui_from_string(ui_info); } catch(const Glib::Error& ex) { std::cerr << "building menus and toolbars failed: " << ex.what(); } // catch Gtk::Widget* pMenuBar = m_refUIManager->get_widget("/MenuBar") ; //Add the MenuBar to the window: m_Box.pack_start(*pMenuBar, Gtk::PACK_SHRINK); Gtk::Widget* pToolbar = m_refUIManager->get_widget("/ToolBar") ; //Add the MenuBar to the window: m_Box.pack_start(*pToolbar, Gtk::PACK_SHRINK); show_all_children(); } // ExampleWindow::ExampleWindow ExampleWindow::~ExampleWindow() {} void ExampleWindow::on_action_file_quit() { hide(); //Closes the main window to stop the Gtk::Main::run(). } void ExampleWindow::on_action_file_new() { std::cout << "A File|New menu item was selected." << std::endl; } void ExampleWindow::on_action_others() { std::cout << "A menu item was selected." << std::endl; } void ExampleWindow::add_stock_item( const Glib::RefPtr<Gtk::IconFactory>& factory, const std::string& filepath, const Glib::ustring& id, const Glib::ustring& label) { Gtk::IconSource source; try { // This throws an exception if the file is not found: source.set_pixbuf( Gdk::Pixbuf::create_from_file(filepath) ); } catch(const Glib::Exception& ex) { std::cout << ex.what() << std::endl; } // catch source.set_size(Gtk::<API key>); source.set_size_wildcarded(); //Icon may be scaled. Gtk::IconSet icon_set; icon_set.add_source(source); //More than one source per set is allowed. const Gtk::StockID stock_id(id); factory->add(stock_id, icon_set); Gtk::Stock::add(Gtk::StockItem(stock_id, label)); } // ExampleWindow::add_stock_item void ExampleWindow::<API key>() { Glib::RefPtr<Gtk::IconFactory> factory = Gtk::IconFactory::create(); add_stock_item(factory, "rain.png", "example_stock_rain", "Stay dry"); factory->add_default(); //Add factory to list of factories. } // ExampleWindow::<API key>
#include "stdafx.h" #include "MaskDesktop.h" #include <CDEvents.h> using namespace std::placeholders; #include <CDAPI.h> #include "Config.h" #include <thread> #include <shellapi.h> MaskDesktop::MaskDesktop(HMODULE hModule) : m_module(hModule), m_menuID(cd::GetMenuID()) { InitImg(); cd::<API key>.AddListener(std::bind(&MaskDesktop::OnFileListWndProc, this, _1, _2, _3, _4, _5), m_module); cd::g_postDrawIconEvent.AddListener(std::bind(&MaskDesktop::OnPostDrawIcon, this, _1), m_module); cd::<API key>.AddListener(std::bind(&MaskDesktop::OnAppendTrayMenu, this, _1), m_module); cd::<API key>.AddListener(std::bind(&MaskDesktop::OnChooseMenuItem, this, _1, _2), m_module); cd::RedrawDesktop(); } void MaskDesktop::InitImg() { CImage img; img.Load(g_config.m_imagePath.c_str()); if (!m_img.IsNull()) m_img.Destroy(); m_img.Create(g_config.m_size, g_config.m_size, 32, CImage::createAlphaChannel); img.Draw(m_img.GetDC(), -5, -5, g_config.m_size + 10, g_config.m_size + 10); m_img.ReleaseDC(); } void MaskDesktop::OnFileListWndProc(UINT message, WPARAM wParam, LPARAM lParam, LRESULT& res, bool& pass) { if (message == WM_MOUSEMOVE) { const auto lastPos = m_curPos; m_curPos = MAKEPOINTS(lParam); RECT rect; if (m_curPos.x < lastPos.x) { rect.left = m_curPos.x - g_config.m_size / 2 - 1; rect.right = lastPos.x + g_config.m_size / 2 + 1; } else { rect.left = lastPos.x - g_config.m_size / 2 - 1; rect.right = m_curPos.x + g_config.m_size / 2 + 1; } if (m_curPos.y < lastPos.y) { rect.top = m_curPos.y - g_config.m_size / 2 - 1; rect.bottom = lastPos.y + g_config.m_size / 2 + 1; } else { rect.top = lastPos.y - g_config.m_size / 2 - 1; rect.bottom = m_curPos.y + g_config.m_size / 2 + 1; } cd::RedrawDesktop(&rect); } } void MaskDesktop::OnPostDrawIcon(HDC& hdc) { if (m_img.IsNull()) return; m_img.AlphaBlend(hdc, m_curPos.x - g_config.m_size / 2, m_curPos.y - g_config.m_size / 2); const HBRUSH brush = static_cast<HBRUSH>(GetStockObject(BLACK_BRUSH)); SIZE scrSize; cd::GetDesktopSize(scrSize); RECT rect; rect = { 0, 0, m_curPos.x - g_config.m_size / 2 + 1, scrSize.cy }; FillRect(hdc, &rect, brush); rect = { m_curPos.x - g_config.m_size / 2 + 1, 0, m_curPos.x + g_config.m_size / 2 - 1, m_curPos.y - g_config.m_size / 2 + 1 }; FillRect(hdc, &rect, brush); rect = { m_curPos.x + g_config.m_size / 2 - 1, 0, scrSize.cx, scrSize.cy }; FillRect(hdc, &rect, brush); rect = { m_curPos.x - g_config.m_size / 2 + 1, m_curPos.y + g_config.m_size / 2 - 1, m_curPos.x + g_config.m_size / 2 - 1, scrSize.cy }; FillRect(hdc, &rect, brush); } void MaskDesktop::OnAppendTrayMenu(HMENU menu) { AppendMenu(menu, MF_STRING, m_menuID, APPNAME); } void MaskDesktop::OnChooseMenuItem(UINT menuID, bool& pass) { if (menuID != m_menuID) return; std::thread([this]{ SHELLEXECUTEINFOW info = {}; info.cbSize = sizeof(info); info.fMask = <API key> | SEE_MASK_NOASYNC; info.lpVerb = L"open"; info.lpFile = L"notepad.exe"; std::wstring param = cd::GetPluginDir() + L"\\Data\\MaskDesktop.ini"; info.lpParameters = param.c_str(); info.nShow = SW_SHOWNORMAL; ShellExecuteExW(&info); WaitForSingleObject(info.hProcess, INFINITE); CloseHandle(info.hProcess); cd::ExecInMainThread([this]{ Config newConfig; int oldSize = g_config.m_size; g_config = newConfig; if (newConfig.m_size != oldSize) InitImg(); }); }).detach(); pass = false; }