code
stringlengths
3
1.01M
repo_name
stringlengths
5
116
path
stringlengths
3
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
3
1.01M
<?php /** * File containing the Fixed Dictionary Object class. * * @package Frozensheep\Synthesize * @author Jacob Wyke <jacob@frozensheep.com> * @license MIT * */ namespace Frozensheep\Synthesize\Type; use Frozensheep\Synthesize\Type\DictionaryObject; /** * Fixed Dictionary Object Class * * An abstract data type for a fixed dictionaries. * * @package Frozensheep\Synthesize * */ abstract class FixedDictionaryObject extends DictionaryObject { /** * @var array $arrKeys The allowed keys. */ protected $arrKeys = array(); /** * @var array $arrDefaults The default values. */ protected $arrDefaults = array(); /** * Class Constructore * * @param array $arrDictionary The array of values for the dictionary. * @return self */ public function __construct(Array $arrDictionary = array()){ $this->replace($arrDictionary); } /** * Replace Method * * Replaces all the values in the dictionary. * @param array $arrDictionary The array of values for the dictionary. * @return void */ public function replace(Array $arrDictionary){ $this->setValue(array()); foreach($this->arrKeys as $strKey){ if(isset($arrDictionary[$strKey])){ $mixValue = $arrDictionary[$strKey]; }else{ $mixValue = $this->arrDefaults[$strKey]; } parent::set($strKey, $mixValue); } $this->updateKeys(); } /** * Set Method * * Sets the value for the given key. * @param string $strKey The key name. * @param mixed $mixValue The value to set. * @return void */ public function set($strKey, $mixValue){ if($this->has($strKey)){ $this->getValue()[$strKey] = $mixValue; $this->updateKeys(); }else{ throw new \Exception(); } } }
frozensheep/synthesize
src/Type/FixedDictionaryObject.php
PHP
mit
1,673
from webhelpers import * from datetime import datetime def time_ago( x ): return date.distance_of_time_in_words( x, datetime.utcnow() ) def iff( a, b, c ): if a: return b else: return c
dbcls/dbcls-galaxy
lib/galaxy/web/framework/helpers/__init__.py
Python
mit
220
// Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Author: kenton@google.com (Kenton Varda) // Based on original Protocol Buffers design by // Sanjay Ghemawat, Jeff Dean, and others. // // This file contains the ZeroCopyInputStream and ZeroCopyOutputStream // interfaces, which represent abstract I/O streams to and from which // protocol buffers can be read and written. For a few simple // implementations of these interfaces, see zero_copy_stream_impl.h. // // These interfaces are different from classic I/O streams in that they // try to minimize the amount of data copying that needs to be done. // To accomplish this, responsibility for allocating buffers is moved to // the stream object, rather than being the responsibility of the caller. // So, the stream can return a buffer which actually points directly into // the final data structure where the bytes are to be stored, and the caller // can interact directly with that buffer, eliminating an intermediate copy // operation. // // As an example, consider the common case in which you are reading bytes // from an array that is already in memory (or perhaps an mmap()ed file). // With classic I/O streams, you would do something like: // char buffer[BUFFER_SIZE]; // input->Read(buffer, BUFFER_SIZE); // DoSomething(buffer, BUFFER_SIZE); // Then, the stream basically just calls memcpy() to copy the data from // the array into your buffer. With a ZeroCopyInputStream, you would do // this instead: // const void* buffer; // int size; // input->Next(&buffer, &size); // DoSomething(buffer, size); // Here, no copy is performed. The input stream returns a pointer directly // into the backing array, and the caller ends up reading directly from it. // // If you want to be able to read the old-fashion way, you can create // a CodedInputStream or CodedOutputStream wrapping these objects and use // their ReadRaw()/WriteRaw() methods. These will, of course, add a copy // step, but Coded*Stream will handle buffering so at least it will be // reasonably efficient. // // ZeroCopyInputStream example: // // Read in a file and print its contents to stdout. // int fd = open("myfile", O_RDONLY); // ZeroCopyInputStream* input = new FileInputStream(fd); // // const void* buffer; // int size; // while (input->Next(&buffer, &size)) { // cout.write(buffer, size); // } // // delete input; // close(fd); // // ZeroCopyOutputStream example: // // Copy the contents of "infile" to "outfile", using plain read() for // // "infile" but a ZeroCopyOutputStream for "outfile". // int infd = open("infile", O_RDONLY); // int outfd = open("outfile", O_WRONLY); // ZeroCopyOutputStream* output = new FileOutputStream(outfd); // // void* buffer; // int size; // while (output->Next(&buffer, &size)) { // int bytes = read(infd, buffer, size); // if (bytes < size) { // // Reached EOF. // output->BackUp(size - bytes); // break; // } // } // // delete output; // close(infd); // close(outfd); #ifndef GOOGLE_PROTOBUF_IO_ZERO_COPY_STREAM_H__ #define GOOGLE_PROTOBUF_IO_ZERO_COPY_STREAM_H__ #include <string> #include <google/protobuf/stubs/common.h> namespace google { namespace protobuf { namespace io { // Defined in this file. class ZeroCopyInputStream; class ZeroCopyOutputStream; // Abstract interface similar to an input stream but designed to minimize // copying. class PROTOBUF_API ZeroCopyInputStream { public: ZeroCopyInputStream() {} virtual ~ZeroCopyInputStream() {} // Obtains a chunk of data from the stream. // // Preconditions: // * "size" and "data" are not NULL. // // Postconditions: // * If the returned value is false, there is no more data to return or // an error occurred. All errors are permanent. // * Otherwise, "size" points to the actual number of bytes read and "data" // points to a pointer to a buffer containing these bytes. // * Ownership of this buffer remains with the stream, and the buffer // remains valid only until some other method of the stream is called // or the stream is destroyed. // * It is legal for the returned buffer to have zero size, as long // as repeatedly calling Next() eventually yields a buffer with non-zero // size. virtual bool Next(const void** data, int* size) = 0; // Backs up a number of bytes, so that the next call to Next() returns // data again that was already returned by the last call to Next(). This // is useful when writing procedures that are only supposed to read up // to a certain point in the input, then return. If Next() returns a // buffer that goes beyond what you wanted to read, you can use BackUp() // to return to the point where you intended to finish. // // Preconditions: // * The last method called must have been Next(). // * count must be less than or equal to the size of the last buffer // returned by Next(). // // Postconditions: // * The last "count" bytes of the last buffer returned by Next() will be // pushed back into the stream. Subsequent calls to Next() will return // the same data again before producing new data. virtual void BackUp(int count) = 0; // Skips a number of bytes. Returns false if the end of the stream is // reached or some input error occurred. In the end-of-stream case, the // stream is advanced to the end of the stream (so ByteCount() will return // the total size of the stream). virtual bool Skip(int count) = 0; // Returns the total number of bytes read since this object was created. virtual int64 ByteCount() const = 0; private: GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ZeroCopyInputStream); }; // Abstract interface similar to an output stream but designed to minimize // copying. class PROTOBUF_API ZeroCopyOutputStream { public: ZeroCopyOutputStream() {} virtual ~ZeroCopyOutputStream() {} // Obtains a buffer into which data can be written. Any data written // into this buffer will eventually (maybe instantly, maybe later on) // be written to the output. // // Preconditions: // * "size" and "data" are not NULL. // // Postconditions: // * If the returned value is false, an error occurred. All errors are // permanent. // * Otherwise, "size" points to the actual number of bytes in the buffer // and "data" points to the buffer. // * Ownership of this buffer remains with the stream, and the buffer // remains valid only until some other method of the stream is called // or the stream is destroyed. // * Any data which the caller stores in this buffer will eventually be // written to the output (unless BackUp() is called). // * It is legal for the returned buffer to have zero size, as long // as repeatedly calling Next() eventually yields a buffer with non-zero // size. virtual bool Next(void** data, int* size) = 0; // Backs up a number of bytes, so that the end of the last buffer returned // by Next() is not actually written. This is needed when you finish // writing all the data you want to write, but the last buffer was bigger // than you needed. You don't want to write a bunch of garbage after the // end of your data, so you use BackUp() to back up. // // Preconditions: // * The last method called must have been Next(). // * count must be less than or equal to the size of the last buffer // returned by Next(). // * The caller must not have written anything to the last "count" bytes // of that buffer. // // Postconditions: // * The last "count" bytes of the last buffer returned by Next() will be // ignored. virtual void BackUp(int count) = 0; // Returns the total number of bytes written since this object was created. virtual int64 ByteCount() const = 0; // Write a given chunk of data to the output. Some output streams may // implement this in a way that avoids copying. Check AllowsAliasing() before // calling WriteAliasedRaw(). It will GOOGLE_CHECK fail if WriteAliasedRaw() is // called on a stream that does not allow aliasing. // // NOTE: It is caller's responsibility to ensure that the chunk of memory // remains live until all of the data has been consumed from the stream. virtual bool WriteAliasedRaw(const void* data, int size); virtual bool AllowsAliasing() const { return false; } private: GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ZeroCopyOutputStream); }; } // namespace io } // namespace protobuf } // namespace google #endif // GOOGLE_PROTOBUF_IO_ZERO_COPY_STREAM_H__
qq83387856/xiaomo-web
Plugins/ue4-protobuf/Source/Protobuf/ThirdParty/protobuf/include/google/protobuf/io/zero_copy_stream.h
C
mit
10,163
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("03-CableGuy")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("03-CableGuy")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("56d236cb-4c13-47b0-9b01-cc174da87050")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
todorm85/TelerikAcademy
Courses/Programming/Data-Structures-and-Algorithms/Homework/15-GraphAlgos/03-CableGuy/Properties/AssemblyInfo.cs
C#
mit
1,398
import React from "react"; import { shallow } from "enzyme"; import TableRow from "./TableRow"; describe("TableRow", () => { it("matches snapshot", () => { const aTableRow = shallow(<TableRow />); expect(aTableRow).toMatchSnapshot(); }); });
DecipherNow/gm-fabric-dashboard
src/components/Main/components/TableRow.test.js
JavaScript
mit
255
### Gavin's notes on getting gitian builds up and running using KVM:### These instructions distilled from: [ https://help.ubuntu.com/community/KVM/Installation]( https://help.ubuntu.com/community/KVM/Installation) ... see there for complete details. You need the right hardware: you need a 64-bit-capable CPU with hardware virtualization support (Intel VT-x or AMD-V). Not all modern CPUs support hardware virtualization. You probably need to enable hardware virtualization in your machine's BIOS. You need to be running a recent version of 64-bit-Ubuntu, and you need to install several prerequisites: sudo apt-get install ruby apache2 git apt-cacher-ng python-vm-builder qemu-kvm Sanity checks: sudo service apt-cacher-ng status # Should return apt-cacher-ng is running ls -l /dev/kvm # Should show a /dev/kvm device Once you've got the right hardware and software: git clone git://github.com/supcoin/supcoin.git git clone git://github.com/devrandom/gitian-builder.git mkdir gitian-builder/inputs cd gitian-builder/inputs # Create base images cd gitian-builder bin/make-base-vm --suite precise --arch amd64 cd .. # Get inputs (see doc/release-process.md for exact inputs needed and where to get them) ... # For further build instructions see doc/release-notes.md ... --------------------- `gitian-builder` now also supports building using LXC. See [ https://help.ubuntu.com/12.04/serverguide/lxc.html]( https://help.ubuntu.com/12.04/serverguide/lxc.html) ... for how to get LXC up and running under Ubuntu. If your main machine is a 64-bit Mac or PC with a few gigabytes of memory and at least 10 gigabytes of free disk space, you can `gitian-build` using LXC running inside a virtual machine. Here's a description of Gavin's setup on OSX 10.6: 1. Download and install VirtualBox from [https://www.virtualbox.org/](https://www.virtualbox.org/) 2. Download the 64-bit Ubuntu Desktop 12.04 LTS .iso CD image from [http://www.ubuntu.com/](http://www.ubuntu.com/) 3. Run VirtualBox and create a new virtual machine, using the Ubuntu .iso (see the [VirtualBox documentation](https://www.virtualbox.org/wiki/Documentation) for details). Create it with at least 2 gigabytes of memory and a disk that is at least 20 gigabytes big. 4. Inside the running Ubuntu desktop, install: sudo apt-get install debootstrap lxc ruby apache2 git apt-cacher-ng python-vm-builder 5. Still inside Ubuntu, tell gitian-builder to use LXC, then follow the "Once you've got the right hardware and software" instructions above: export USE_LXC=1 git clone git://github.com/supcoin/supcoin.git ... etc
supcoin/supcoin
contrib/gitian-descriptors/README.md
Markdown
mit
2,661
//Get /question exports.question = function (req, res, next) { var answer = req.query.answer || ''; res.render('quizzes/question', {question: "Capital de Italia", answer: answer}); }; //GET /check exports.check = function(req,res, next) { var answer = req.query.answer || ''; var result = ((answer === 'Roma') ? 'Correcta' : 'Incorrecta'); res.render('quizzes/result', {result: result, answer: answer}); }; //GET /author exports.author = function(req, res, next) { res.render('author'); };
verynrivas/quiz
controllers/quiz_controller.js
JavaScript
mit
499
<div class="panel panel-default" > <div class="panel-heading">Dilución</div> <div class="panel-body"> <form class="form-horizontal" role="form"> <div class="form-group"> <label class="col-sm-4 control-label"></label> <div class="col-sm-4"> <label class="control-label">Gravity</label> </div> <div class="col-sm-4"> <label class="control-label">Plato</label> </div> </div> <div class="form-group"> <label class="col-sm-4 control-label">Lts de mosto</label> <div class="col-sm-4"> <input type="number" step="0.1" ng-model="dilution.currentVol" class="form-control input-sm"/> </div> </div> <div class="form-group"> <label class="col-sm-4 control-label">Dens. act.</label> <div class="col-sm-4"> <input type="number" step="0.001" ng-model="dilution.currentGrav" class="form-control input-sm"/> </div> <div class="col-sm-4"> <input ng-blur="updateOG()" type="number" step="0.01" ng-model="dilution.currentGravP" class="form-control input-sm"/> </div> </div> <div class="form-group"> <label class="col-sm-4 control-label">Dens. busc.</label> <div class="col-sm-4"> <input type="number" step="0.001" ng-model="dilution.finalGrav" class="form-control input-sm"/> </div> <div class="col-sm-4"> <input ng-blur="updateFG()" type="number" step="0.01" ng-model="dilution.finalGravP" class="form-control input-sm"/> </div> </div> <div class="form-group"> <label class="col-sm-4 control-label" title="valor ajustado">Volumen final</label> <div class="col-sm-4"> <span class="gt-calculated form-control input-sm"> {{dilution.finalVol|number:1}} </span> </div> </div> <div class="form-group"> <label class="col-sm-4 control-label" title="valor ajustado">Lts Agua</label> <div class="col-sm-4"> <span class="gt-calculated form-control input-sm"> {{dilution.finalVol-dilution.currentVol|number:1}} </span> </div> </div> </form> </div> </div>
lautarobock/brew-o-matic
public/partial/calculator/calculator-dilution.html
HTML
mit
2,648
<!DOCTYPE html><html><head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta name="description"> <meta name="keywords" content="static content generator,static site generator,static site,HTML,web development,.NET,C#,Razor,Markdown,YAML"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="shortcut icon" href="/StrideToolkit/assets/img/favicon.ico" type="image/x-icon"> <link rel="icon" href="/StrideToolkit/assets/img/favicon.ico" type="image/x-icon"> <title>StrideToolkit - API - ScriptSystemExtensions.AddOverTimeAction(ScriptSystem, Action&lt;float&gt;, TimeSpan, long) Method</title> <link href="/StrideToolkit/assets/css/highlight.css" rel="stylesheet"> <link href="/StrideToolkit/assets/css/bootstrap/bootstrap.css" rel="stylesheet"> <link href="/StrideToolkit/assets/css/adminlte/AdminLTE.css" rel="stylesheet"> <link href="/StrideToolkit/assets/css/theme/theme.css" rel="stylesheet"> <link href="//fonts.googleapis.com/css?family=Roboto+Mono:400,700|Roboto:400,400i,700,700i" rel="stylesheet"> <link href="/StrideToolkit/assets/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <link href="/StrideToolkit/assets/css/override.css" rel="stylesheet"> <script src="/StrideToolkit/assets/js/jquery-2.2.3.min.js"></script> <script src="/StrideToolkit/assets/js/bootstrap.min.js"></script> <script src="/StrideToolkit/assets/js/app.min.js"></script> <script src="/StrideToolkit/assets/js/highlight.pack.js"></script> <script src="/StrideToolkit/assets/js/jquery.slimscroll.min.js"></script> <script src="/StrideToolkit/assets/js/jquery.sticky-kit.min.js"></script> <script src="/StrideToolkit/assets/js/mermaid.min.js"></script> <script src="/StrideToolkit/assets/js/svg-pan-zoom.min.js"></script> <!--[if lt IE 9]> <script src="/StrideToolkit/assets/js/html5shiv.min.js"></script> <script src="/StrideToolkit/assets/js/respond.min.js"></script> <![endif]--> </head> <body class="hold-transition wyam layout-boxed "> <div class="top-banner"></div> <div class="wrapper with-container"> <!-- Header --> <header class="main-header"> <a href="/StrideToolkit/" class="logo"> <!-- mini logo for sidebar mini 50x50 pixels --> <span class="logo-mini"><img src="/StrideToolkit/assets/img/logo.png"></span> <!-- logo for regular state and mobile devices --> <span class="logo-lg"><img src="/StrideToolkit/assets/img/logo.png"></span> </a> <nav class="navbar navbar-static-top" role="navigation"> <!-- Sidebar toggle button--> <a href="#" class="sidebar-toggle visible-xs-block" data-toggle="offcanvas" role="button"> <span class="sr-only">Toggle side menu</span> <i class="fa fa-chevron-circle-right"></i> </a> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse"> <span class="sr-only">Toggle side menu</span> <i class="fa fa-chevron-circle-down"></i> </button> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse pull-left" id="navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="/StrideToolkit/docs">Documentation</a></li> <li class="active"><a href="/StrideToolkit/api">API</a></li> <li><a href="https://github.com/dfkeenan/StrideToolkit"><i class="fa fa-github"></i> Source</a></li> </ul> </div> <!-- /.navbar-collapse --> <!-- Navbar Right Menu --> </nav> </header> <!-- Left side column. contains the logo and sidebar --> <aside class="main-sidebar "> <section class="infobar" data-spy="affix" data-offset-top="60" data-offset-bottom="200"> <div id="infobar-headings"><h6>On This Page</h6><p><a href="#Summary">Summary</a></p> <p><a href="#Syntax">Syntax</a></p> <p><a href="#Remarks">Remarks</a></p> <p><a href="#Parameters">Parameters</a></p> <p><a href="#ReturnValue">Return Value</a></p> <hr class="infobar-hidden"> </div> </section> <section class="sidebar"> <script src="/StrideToolkit/assets/js/lunr.min.js"></script> <script src="/StrideToolkit/assets/js/searchIndex.js"></script> <div class="sidebar-form"> <div class="input-group"> <input type="text" name="search" id="search" class="form-control" placeholder="Search Types..."> <span class="input-group-btn"> <button class="btn btn-flat"><i class="fa fa-search"></i></button> </span> </div> </div> <div id="search-results"> </div> <script> function runSearch(query){ $("#search-results").empty(); if( query.length < 2 ){ return; } var results = searchModule.search("*" + query + "*"); var listHtml = "<ul class='sidebar-menu'>"; listHtml += "<li class='header'>Type Results</li>"; if(results.length == 0 ){ listHtml += "<li>No results found</li>"; } else { for(var i = 0; i < results.length; ++i){ var res = results[i]; listHtml += "<li><a href='" + res.url + "'>" + htmlEscape(res.title) + "</a></li>"; } } listHtml += "</ul>"; $("#search-results").append(listHtml); } $(document).ready(function(){ $("#search").on('input propertychange paste', function() { runSearch($("#search").val()); }); }); function htmlEscape(html) { return document.createElement('div') .appendChild(document.createTextNode(html)) .parentNode .innerHTML; } </script> <hr> <ul class="sidebar-menu"> <li class="header">Namespace</li> <li><a href="/StrideToolkit/api/StrideToolkit.Engine">StrideToolkit<wbr>.Engine</a></li> <li class="header">Type</li> <li><a href="/StrideToolkit/api/StrideToolkit.Engine/ScriptSystemExtensions">Script<wbr>System<wbr>Extensions</a></li> <li role="separator" class="divider"></li> <li class="header">Method Members</li> <li><a href="/StrideToolkit/api/StrideToolkit.Engine/ScriptSystemExtensions/51572382">AddAction<wbr>(ScriptSystem, <wbr>Action, <wbr>TimeSpan, <wbr>long)<wbr></a></li> <li><a href="/StrideToolkit/api/StrideToolkit.Engine/ScriptSystemExtensions/31B903AF">AddAction<wbr>(ScriptSystem, <wbr>Action, <wbr>TimeSpan, <wbr>TimeSpan, <wbr>long)<wbr></a></li> <li><a href="/StrideToolkit/api/StrideToolkit.Engine/ScriptSystemExtensions/B2C0F472">AddOnEventAction<wbr>&lt;T&gt;<wbr><wbr>(ScriptSystem, <wbr>EventKey<wbr>&lt;T&gt;<wbr>, <wbr>Action<wbr>&lt;T&gt;<wbr>, <wbr>long)<wbr></a></li> <li><a href="/StrideToolkit/api/StrideToolkit.Engine/ScriptSystemExtensions/B0067AA5">AddOnEventAction<wbr>&lt;T&gt;<wbr><wbr>(ScriptSystem, <wbr>EventReceiver<wbr>&lt;T&gt;<wbr>, <wbr>Action<wbr>&lt;T&gt;<wbr>, <wbr>long)<wbr></a></li> <li><a href="/StrideToolkit/api/StrideToolkit.Engine/ScriptSystemExtensions/487569C5">AddOnEventTask<wbr>&lt;T&gt;<wbr><wbr>(ScriptSystem, <wbr>EventKey<wbr>&lt;T&gt;<wbr>, <wbr>Func<wbr>&lt;T, <wbr>Task&gt;<wbr>, <wbr>long)<wbr></a></li> <li><a href="/StrideToolkit/api/StrideToolkit.Engine/ScriptSystemExtensions/68FF4F9E">AddOnEventTask<wbr>&lt;T&gt;<wbr><wbr>(ScriptSystem, <wbr>EventReceiver<wbr>&lt;T&gt;<wbr>, <wbr>Func<wbr>&lt;T, <wbr>Task&gt;<wbr>, <wbr>long)<wbr></a></li> <li class="selected"><a href="/StrideToolkit/api/StrideToolkit.Engine/ScriptSystemExtensions/3186D483">AddOverTimeAction<wbr>(ScriptSystem, <wbr>Action<wbr>&lt;float&gt;<wbr>, <wbr>TimeSpan, <wbr>long)<wbr></a></li> <li><a href="/StrideToolkit/api/StrideToolkit.Engine/ScriptSystemExtensions/DF17F5A3">AddTask<wbr>(ScriptSystem, <wbr>Func<wbr>&lt;Task&gt;<wbr>, <wbr>TimeSpan, <wbr>long)<wbr></a></li> <li><a href="/StrideToolkit/api/StrideToolkit.Engine/ScriptSystemExtensions/AA24D52B">AddTask<wbr>(ScriptSystem, <wbr>Func<wbr>&lt;Task&gt;<wbr>, <wbr>TimeSpan, <wbr>TimeSpan, <wbr>long)<wbr></a></li> <li><a href="/StrideToolkit/api/StrideToolkit.Engine/ScriptSystemExtensions/A14A61ED">CancelAll<wbr>(ICollection<wbr>&lt;MicroThread&gt;<wbr>)<wbr></a></li> <li><a href="/StrideToolkit/api/StrideToolkit.Engine/ScriptSystemExtensions/D682A10C">WaitFor<wbr>(ScriptSystem, <wbr>TimeSpan)<wbr></a></li> </ul> </section> </aside> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <section class="content-header"> <h3><a href="/StrideToolkit/api/StrideToolkit.Engine/ScriptSystemExtensions">Script<wbr>System<wbr>Extensions</a>.</h3> <h1>AddOverTimeAction<wbr>(ScriptSystem, <wbr>Action<wbr>&lt;float&gt;<wbr>, <wbr>TimeSpan, <wbr>long)<wbr> <small>Method</small></h1> </section> <section class="content"> <h1 id="Summary">Summary</h1> <div class="lead"> Adds a micro thread function to the <span name="scriptSystem" class="paramref">scriptSystem</span> that executes after waiting specified delay and repeats execution. </div> <div class="panel panel-default"> <div class="panel-body"> <dl class="dl-horizontal"> <dt>Namespace</dt> <dd><a href="/StrideToolkit/api/StrideToolkit.Engine">StrideToolkit<wbr>.Engine</a></dd> <dt>Containing Type</dt> <dd><a href="/StrideToolkit/api/StrideToolkit.Engine/ScriptSystemExtensions">Script<wbr>System<wbr>Extensions</a></dd> </dl> </div> </div> <h1 id="Syntax">Syntax</h1> <pre><code>public static MicroThread AddOverTimeAction(this ScriptSystem scriptSystem, Action&lt;float&gt; action, TimeSpan duration, long priority = 0)</code></pre> <h1 id="Remarks">Remarks</h1> <div> If the <span name="action" class="paramref">action</span> is a <code class="cs">ScriptComponent</code> instance method the micro thread will be automatically stopped if the <code class="cs">ScriptComponent</code> or <code class="cs">Entity</code> is removed. </div> <h1 id="Parameters">Parameters</h1> <div class="box"> <div class="box-body no-padding table-responsive"> <table class="table table-striped table-hover three-cols"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody><tr> <td>scriptSystem</td> <td>ScriptSystem</td> <td>The <code class="cs">ScriptSystem</code>.</td> </tr> <tr> <td>action</td> <td>Action<wbr>&lt;float&gt;<wbr></td> <td>The micro thread function to execute. The parameter is the progress over time from 0.0f to 1.0f.</td> </tr> <tr> <td>duration</td> <td>TimeSpan</td> <td>The duration of the time to execute the micro thread function for.</td> </tr> <tr> <td>priority</td> <td>long</td> <td>The priority of the micro thread action being added.</td> </tr> </tbody></table> </div> </div> <h1 id="ReturnValue">Return Value</h1> <div class="box"> <div class="box-body no-padding table-responsive"> <table class="table table-striped table-hover two-cols"> <thead> <tr> <th>Type</th> <th>Description</th> </tr> </thead> <tbody><tr> <td>MicroThread</td> <td>The <code class="cs">MicroThread</code>.</td> </tr> </tbody></table> </div> </div> </section> </div> <!-- Footer --> <footer class="main-footer"> </footer> </div> <div class="wrapper bottom-wrapper"> <footer class="bottom-footer"> <p class="text-muted"> <a href="https://github.com/dfkeenan/StrideToolkit"><i class="fa fa-github"></i> GitHub</a> | <a href="https://twitter.com/dfkeenan"><i class="fa fa-twitter"></i> Twitter</a> <br> Copyright © Daniel Keenan. <br> Generated by <a href="http://wyam.io">Wyam</a> </p> <script> anchors.add(); </script> </footer> </div> <a href="javascript:" id="return-to-top"><i class="fa fa-chevron-up"></i></a> <script> // Close the sidebar if we select an anchor link $(".main-sidebar a[href^='#']:not('.expand')").click(function(){ $(document.body).removeClass('sidebar-open'); }); $(document).ready(function() { mermaid.initialize( { flowchart: { useMaxWidth: false }, startOnLoad: false, cloneCssStyles: false }); mermaid.init(undefined, ".mermaid"); // Remove the max-width setting that Mermaid sets var mermaidSvg = $('.mermaid svg'); mermaidSvg.addClass('img-responsive'); mermaidSvg.css('max-width', ''); // Make it scrollable var target = document.querySelector(".mermaid svg"); if(target !== null) { var panZoom = window.panZoom = svgPanZoom(target, { zoomEnabled: true, controlIconsEnabled: true, fit: true, center: true, maxZoom: 20, zoomScaleSensitivity: 0.6 }); // Do the reset once right away to fit the diagram panZoom.resize(); panZoom.fit(); panZoom.center(); $(window).resize(function(){ panZoom.resize(); panZoom.fit(); panZoom.center(); }); } $('pre code').each(function(i, block) { hljs.highlightBlock(block); }); }); hljs.initHighlightingOnLoad(); // Back to top $(window).scroll(function() { if ($(this).scrollTop() >= 200) { // If page is scrolled more than 50px $('#return-to-top').fadeIn(1000); // Fade in the arrow } else { $('#return-to-top').fadeOut(1000); // Else fade out the arrow } }); $('#return-to-top').click(function() { // When arrow is clicked $('body,html').animate({ scrollTop : 0 // Scroll to top of body }, 500); }); </script> </body></html>
dfkeenan/XenkoToolkit
docs/api/StrideToolkit.Engine/ScriptSystemExtensions/3186D483.html
HTML
mit
16,074
<!DOCTYPE html> <link rel="import" href="../polymer/polymer.html"> <dom-module id="paper-divider"> <style> :host { display: block; width: 100%; height: 1px; background: rgba(0,0,0,.12); } :host.margin { margin: 16px 0; } :host.relative { position: relative; top: -1px; } </style> <template></template> </dom-module> <script> Polymer({ is: "paper-divider", properties: { margin: { value: false, type: Boolean, observer: "_marginChanged" }, relative: { value: false, type: Boolean, observer: "_relativeChanged" } }, _marginChanged: function (newValue, oldValue) { this.toggleClass("margin", newValue); }, _relativeChanged: function (newValue, oldValue) { this.toggleClass("relative", newValue); } }); </script>
marcus7777/paper-divider
paper-divider.html
HTML
mit
1,076
package com.equalinformation.bpm.poc.producer; import javax.servlet.annotation.WebServlet; import com.vaadin.annotations.Theme; import com.vaadin.annotations.VaadinServletConfiguration; import com.vaadin.annotations.Widgetset; import com.vaadin.server.VaadinRequest; import com.vaadin.server.VaadinServlet; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; import com.vaadin.ui.UI; import com.vaadin.ui.VerticalLayout; /** * */ @Theme("mytheme") @Widgetset("com.equalinformation.bpm.poc.producer.MyAppWidgetset") public class MyUI extends UI { @Override protected void init(VaadinRequest vaadinRequest) { final VerticalLayout layout = new VerticalLayout(); layout.setMargin(true); setContent(layout); Button button = new Button("Click Me"); button.addClickListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { layout.addComponent(new Label("Thank you for clicking")); } }); layout.addComponent(button); } @WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true) @VaadinServletConfiguration(ui = MyUI.class, productionMode = false) public static class MyUIServlet extends VaadinServlet { } }
bpupadhyaya/ActivitiProducer
src/main/java/com/equalinformation/bpm/poc/producer/MyUI.java
Java
mit
1,341
package me.isaacjordan.TrekPlusPlus.Compiler; import java.io.DataOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.InputStream; import java.io.PrintStream; import org.antlr.v4.runtime.ANTLRInputStream; import org.antlr.v4.runtime.CommonTokenStream; import org.antlr.v4.runtime.tree.ParseTree; import me.isaacjordan.TrekPlusPlus.Generated.TrekPlusPlusLexer; import me.isaacjordan.TrekPlusPlus.Generated.TrekPlusPlusParser; /** * Main class to begin complete compilation of a Trek++ program. * * @author Isaac Jordan (Sheepzez) * */ public class TrekPPCompile { private static boolean tracing = true; private static PrintStream out = System.out; static String sourceFileName; public static void main(String[] args) { try { if (args.length == 0) throw new TrekPPException("No source file provided."); File sourceFile = new File(args[0]); if (!sourceFile.exists()) System.out.println("Error: File '" + sourceFile.getPath() + "' cannot be found."); sourceFileName = sourceFile.getName().replace(".trekpp", ""); System.out.println("Compiling source file: " + sourceFileName); InputStream sourceStream = new FileInputStream(sourceFile); DataOutputStream dout = new DataOutputStream(new FileOutputStream(sourceFile.getParentFile() + "/" + sourceFileName + ".class")); dout.write(compile(sourceStream)); dout.flush(); dout.close(); } catch (TrekPPException x) { out.println("Compilation failed"); } catch (Exception x) { x.printStackTrace(out); } } private static byte[] compile (InputStream source) throws Exception { TrekPlusPlusLexer lexer = new TrekPlusPlusLexer(new ANTLRInputStream(source)); CommonTokenStream tokens = new CommonTokenStream(lexer); ParseTree ast = syntacticAnalyse(tokens); contextualAnalyse(ast,tokens); byte[] objprog = codeGenerate(ast); return objprog; } private static ParseTree syntacticAnalyse(CommonTokenStream tokens) throws Exception { out.println("Syntactic analysis ..."); TrekPlusPlusParser parser = new TrekPlusPlusParser(tokens); ParseTree ast = parser.program(); int errors = parser.getNumberOfSyntaxErrors(); out.println(errors + " syntactic errors"); if (errors > 0) throw new TrekPPException(); return ast; } private static void contextualAnalyse (ParseTree ast, CommonTokenStream tokens) throws Exception { out.println("Contextual analysis ..."); TrekPPCheckerVisitor checker = new TrekPPCheckerVisitor(tokens); checker.visit(ast); int errors = checker.getNumberOfContextualErrors(); out.println(errors + " scope/type errors"); if (errors > 0) throw new TrekPPException(); } private static byte[] codeGenerate (ParseTree ast) throws Exception { out.println("Code generation ..."); TrekPPEncoderVisitor encoder = new TrekPPEncoderVisitor(); encoder.programFileName = sourceFileName; encoder.visit(ast); byte[] result = encoder.getClassByteArray(); return result; } }
Sheepzez/trek-plus-plus
parser/me/isaacjordan/TrekPlusPlus/Compiler/TrekPPCompile.java
Java
mit
2,991
using UnityEngine; using System.Collections; public class StructuredSampling3DTest : MonoBehaviour { /* v 0.000000 1.000000 0.000000 v 0.723600 -0.447215 0.525720 v -0.276385 -0.447215 0.850640 v -0.894425 -0.447215 0.000000 v -0.276385 -0.447215 -0.850640 v 0.723600 -0.447215 -0.525720 */ Vector3[] dirs = new Vector3[] { new Vector3( 0.000000f, 1.000000f, 0.000000f), -new Vector3( 0.723600f, -0.447215f, 0.525720f), -new Vector3(-0.276385f, -0.447215f, 0.850640f), -new Vector3(-0.894425f, -0.447215f, 0.000000f), -new Vector3(-0.276385f, -0.447215f, -0.850640f), -new Vector3( 0.723600f, -0.447215f, -0.525720f), }; Vector3[] alldirs = new Vector3[] { new Vector3( 0.000000f, 1.000000f, 0.000000f), new Vector3( 0.723600f, -0.447215f, 0.525720f), new Vector3(-0.276385f, -0.447215f, 0.850640f), new Vector3(-0.894425f, -0.447215f, 0.000000f), new Vector3(-0.276385f, -0.447215f, -0.850640f), new Vector3( 0.723600f, -0.447215f, -0.525720f), -new Vector3( 0.000000f, 1.000000f, 0.000000f), -new Vector3( 0.723600f, -0.447215f, 0.525720f), -new Vector3(-0.276385f, -0.447215f, 0.850640f), -new Vector3(-0.894425f, -0.447215f, 0.000000f), -new Vector3(-0.276385f, -0.447215f, -0.850640f), -new Vector3( 0.723600f, -0.447215f, -0.525720f), }; Vector3 _rndDir; void Start() { _rndDir = Random.onUnitSphere; float ma = 10000f; for( int i = 0; i < dirs.Length; i++ ) { for( int j = i+1; j < dirs.Length; j++ ) { float a; a = Vector3.Angle( dirs[i], dirs[j] ); Debug.Log( i + ", " + j + ": " + a ); ma = Mathf.Min( ma, a ); a = Vector3.Angle( dirs[i], -dirs[j] ); Debug.Log( i + ", -" + j + ": " + a ); ma = Mathf.Min( ma, a ); a = Vector3.Angle( -dirs[i], -dirs[j] ); Debug.Log( "-" + i + ", -" + j + ": " + a ); ma = Mathf.Min( ma, a ); a = Vector3.Angle( -dirs[i], dirs[j] ); Debug.Log( "-" + i + ", " + j + ": " + a ); ma = Mathf.Min( ma, a ); } } Debug.Log( "Min angle: " + ma ); } void Update () { _rndDir = Random.onUnitSphere; for( int i = 0; i < alldirs.Length; i++ ) { Debug.Log( i + ": " + Vector3.Dot( _rndDir, alldirs[i] ) ); } int[] closestI = new int[] { 0, 1, 2 }; for( int i = 3; i < alldirs.Length; i++ ) { int minInd = 0; float minDp = Vector3.Dot( _rndDir, alldirs[closestI[minInd]] ); for( int j = 1; j < 3; j++ ) { float tdp = Vector3.Dot( _rndDir, alldirs[closestI[j]] ); if( tdp < minDp ) { minInd = j; minDp = tdp; } } if( Vector3.Dot( _rndDir, alldirs[i] ) > minDp ) { closestI[minInd] = i; } } float totaldp = 0f; for( int i = 0; i < closestI.Length; i++ ) { totaldp += Vector3.Dot( _rndDir, alldirs[closestI[i]] ); } Debug.Log( "TDP: " + totaldp ); for( int i = 0; i < alldirs.Length; i++ ) { Color col = Color.white; for( int j = 0; j < 3; j++ ) { if( closestI[j] == i ) { col = Color.red; col *= Vector3.Dot( _rndDir, alldirs[closestI[j]] ) / totaldp; //col.a = 1f; } } Debug.DrawRay( transform.position + alldirs[i], alldirs[i], col ); } //float maxAngle = 63.435f; //for( int i = 0; i < dirs.Length; i++ ) //{ // Color col; // col = Vector3.Angle( dirs[i], _rndDir ) < maxAngle ? Color.red : Color.white; // Debug.DrawRay( dirs[i] + transform.position, dirs[i], col ); // col = Vector3.Angle( -dirs[i], _rndDir ) < maxAngle ? Color.red : Color.white; // Debug.DrawRay( -dirs[i] + transform.position, -dirs[i], col ); //} Debug.DrawRay( transform.position + _rndDir, _rndDir, Color.green ); ////if( _firstTime ) //{ // for( int i = 0; i < dirs.Length; i++ ) // { // float a0 = Vector3.Angle( _rndDir, dirs[i] ); // float a1 = Vector3.Angle( _rndDir, -dirs[i] ); // float a = Mathf.Min( a0, a1 ); // Debug.Log( i.ToString() + ": " + a ); // } // _firstTime = false; //} } }
huwb/volsample
src/unity/Assets/Scripts/Experimental/StructuredSampling3DTest.cs
C#
mit
5,087
yaml_file = File.expand_path('../../faye.yml', __FILE__) yaml_env = ENV["RAILS_ENV"] || "development" yaml_config = YAML.load_file(yaml_file)[yaml_env] raise ArgumentError, "The #{yaml_env} environment does not exist in #{yaml_file}" if yaml_config.nil? ::FAYE_CONFIG = {} yaml_config.each { |k, v| ::FAYE_CONFIG[k.to_sym] = v }
tixerapp/tixerapp-rails-settings
public/config/initializers/faye.rb
Ruby
mit
330
import * as util from "./util"; const path = require("path"); /** * Creates a toc object * @param {Array} items All items of the toc * @param {Array} root Only the root items * @return {Object} Toc object */ const createToc = function (items, root) { if (items == null) items = []; if (root == null) root = []; return { items, root, }; }; const findByPath = util.findBy("path"); export const createTocFromFolderP = function (pathParam, toc, rootPath) { if (toc == null) toc = createToc(); if (rootPath == null) rootPath = pathParam; return util.readdirP(pathParam).then((files) => { var localItemIds = []; var prom = Promise.resolve(); files.forEach((f) => { var fullPath = path.join(pathParam, f); prom = prom .then(() => { return util.lstatP(fullPath); }) .then((stats) => { var id = toc.items.push({ ext: path.extname(f), isDir: stats.isDirectory(), absolutePath: fullPath, path: fullPath.replace(rootPath + path.sep, ""), name: f, }) - 1; localItemIds.push(id); if (toc.items[id].isDir) { return createTocFromFolderP(fullPath, toc, rootPath).then( (newToc) => { toc = newToc; toc.items[id].children = toc.root; toc.root = []; } ); } }); }); prom = prom.then(() => { toc.root = localItemIds; return toc; }); return prom; }); }; export const mergeTocConfigWithToc = function (toc, tocConfig) { var newToc = createToc(); var addChildren = function (children) { var ids = []; children.forEach(function (childId) { var childItem = toc.items[childId]; var id = newToc.items.push(childItem) - 1; ids.push(id); if (childItem.children != null) { childItem.children = addChildren(childItem.children); } }); return ids; }; var mergeItems = function (items, basePath) { if (basePath == null) basePath = ""; var localItemIds = []; items.forEach((tocItem) => { var item = {}; if (tocItem.path != null) { tocItem.path = path.join(basePath, tocItem.path); var origId = findByPath(toc.items, tocItem.path); if (origId !== false) { item = toc.items[origId]; } } item.href = tocItem.href; if (tocItem.title != null) { item.title = tocItem.title; } var id = newToc.items.push(item) - 1; if (tocItem.children != null) { newToc.items[id].children = mergeItems(tocItem.children, tocItem.path); newToc.items[id].isDir = true; } else if (item.children != null) { newToc.items[id].children = addChildren(item.children); } localItemIds.push(id); }); return localItemIds; }; newToc.root = mergeItems(tocConfig); return newToc; }; export const calculateItemLevels = function (toc, items, level) { if (level == null) level = 0; if (items == null) items = toc.root; items.forEach(function (itemId) { let item = toc.items[itemId]; item.level = level; if (item.children != null) { calculateItemLevels(toc, item.children, level + 1); } }); return toc; }; export const getHtmlChapters = function (html) { const chapters = { root: [], items: [], }; const headingRegexStr = '<h(\\d*)(?: id="(.*?)")?.*?>([\\s\\S]*?)<\\/h\\1(?: .*?)?>'; const headingGlobalRegex = new RegExp(headingRegexStr, "g"); const headingRegex = new RegExp(headingRegexStr); const htmlTagsRegex = /<(?:.|\n)*?>/gm; let matches = html.match(headingGlobalRegex); if (matches != null && matches.length > 0) { matches = matches.map(function (match) { const subMatches = match.match(headingRegex); const hash = subMatches[2]; const heading = subMatches[3].replace(htmlTagsRegex, ""); return { level: subMatches[1], heading: heading, hash }; }); const pushHeadingsRecursive = function (matches) { var head = matches[0]; var tail = matches.slice(1); var rest = []; var broken = false; var children = []; tail.forEach(function (item) { if (item.level === head.level) { rest.push(item); broken = true; } else if (broken === false && head.level < item.level) { children.push(item); } else { rest.push(item); } }); if (children.length > 0) { children = pushHeadingsRecursive(children); } head.children = children; if (rest.length > 0) { rest = pushHeadingsRecursive(rest); } return [head, ...rest]; }; const recursiveHeadings = pushHeadingsRecursive(matches); const normalizeRecursive = function (items) { return items.map(function (chapter) { const idx = chapters.items.push(chapter) - 1; chapter.id = idx; chapter.children = normalizeRecursive(chapter.children); return idx; }); }; chapters.root = normalizeRecursive(recursiveHeadings); } return chapters; };
malleryjs/mallery
lib/toc.js
JavaScript
mit
5,264
<?php namespace Sdmx\api\client\rest; use InvalidArgumentException; use Sdmx\api\client\http\HttpClient; use Sdmx\api\client\rest\query\SdmxQueryBuilder; use Sdmx\api\client\SdmxClient; use Sdmx\api\entities\Dataflow; use Sdmx\api\entities\DataflowStructure; use Sdmx\api\entities\DsdIdentifier; use Sdmx\api\entities\PortableTimeSeries; use Sdmx\api\parser\CodelistParser; use Sdmx\api\parser\DataflowParser; use Sdmx\api\parser\DataParser; use Sdmx\api\parser\DataStructureParser; class RestSdmxV21Client implements SdmxClient { /** * @const ALL_AGENCIES */ const ALL_AGENCIES = 'all'; /** * @const ALL_FLOWS */ const ALL_FLOWS = 'all'; /** * @const LATEST_VERSION */ const LATEST_VERSION = 'latest'; /** * @var string $name */ private $name; /** * @var SdmxQueryBuilder $queryBuilder */ private $queryBuilder; /** * @var HttpClient $httpClient */ private $httpClient; /** * @var DataflowParser $dataflowParser */ private $dataflowParser; /** * @var DataStructureParser $datastructureParser */ private $datastructureParser; /** * @var CodelistParser $codelistParser */ private $codelistParser; /** * @var DataParser $dataParser */ private $dataParser; /** * RestSdmxClient constructor. * @param string $name * @param SdmxQueryBuilder $queryBuilder * @param HttpClient $httpClient * @param DataflowParser $dataflowParser * @param DataStructureParser $datastructureParser * @param CodelistParser $codelistParser * @param DataParser $dataParser */ public function __construct($name, SdmxQueryBuilder $queryBuilder, HttpClient $httpClient, DataflowParser $dataflowParser, DataStructureParser $datastructureParser, CodelistParser $codelistParser, DataParser $dataParser) { $this->name = $name; $this->queryBuilder = $queryBuilder; $this->httpClient = $httpClient; $this->dataflowParser = $dataflowParser; $this->datastructureParser = $datastructureParser; $this->codelistParser = $codelistParser; $this->dataParser = $dataParser; } /** * Gets all dataflows. * @return Dataflow[] */ public function getDataflows() { $url = $this->queryBuilder->getDataflowQuery(self::ALL_AGENCIES, self::ALL_FLOWS, self::LATEST_VERSION); $response = $this->httpClient->get($url); if (empty($response)) { return []; } return $this->dataflowParser->parse($response); } /** * Gets the dataflow information for a given dataflow. * @param string $dataflow * @param string $agency * @param string $version * @return Dataflow */ public function getDataflow($dataflow, $agency, $version) { $url = $this->queryBuilder->getDataflowQuery($agency, $dataflow, $version); $response = $this->httpClient->get($url); if (empty($response)) { return null; } $dataflows = $this->dataflowParser->parse($response); return count($dataflows) > 0 ? $dataflows[0] : null; } /** * Gets the structure for a given dataflow. * @param DsdIdentifier $dsd * @param bool $full if true, for 2.1 providers it retrieves the full dsd, with all the codelists. * @return DataflowStructure * @throws InvalidArgumentException */ public function getDataflowStructure(DsdIdentifier $dsd, $full = false) { $url = $this->queryBuilder->getDsdQuery($dsd->getId(), $dsd->getAgency(), $dsd->getVersion(), $full); $response = $this->httpClient->get($url); if (empty($response)) { return null; } $dataflowStructures = $this->datastructureParser->parse($response); return count($dataflowStructures) > 0 ? $dataflowStructures[0] : null; } /** * Gets all the codes from this provider for a given codelist. * @param string $codelist * @param string $agency * @param string $version * @return string[] */ public function getCodes($codelist, $agency, $version) { $url = $this->queryBuilder->getCodelistQuery($codelist, $agency, $version); $response = $this->httpClient->get($url); if (empty($response)) { return []; } return $this->codelistParser->parseCodes($response); } /** * @param Dataflow $dataflow The dataflow of the time series to be gathered * @param DataflowStructure $dsd The structure of the dataflow of the time series to be gathered * @param string $resource The id of the time series * @param array $options * ```php * $options = array( * 'startPeriod' => 'string', //Start time of the observations to be gathered * 'endPeriod' => 'string', //End time of the observations to be gathered * 'seriesKeysOnly' => 'boolean', //Flag for disabling data and attributes processing (usually for getting the only dataflow contents) * 'lastNObservations' => 'integer' //The last 'n' observations to return for each matched series. * ) * ``` * @return PortableTimeSeries[] */ public function getTimeSeries(Dataflow $dataflow, DataflowStructure $dsd, $resource, array $options = array()) { $query = $this->queryBuilder->getDataQuery($dataflow, $resource, $options); $response = $this->httpClient->get($query); if (empty($response)) { return []; } $containsData = array_key_exists('seriesKeysOnly', $options) ? !$options['seriesKeysOnly'] : true; return $this->dataParser->parse($response, $dsd, $dataflow->getId(), $containsData); } /** * @param string $dataflow The dataflow of the time series to be gathered * @param string $agency The agency of the dataflow of the time series to be gathered * @param string $version The version of the dataflow of the time series to be gathered * @param string $resource The id of the time series * @param array $options * ```php * $options = array( * 'startPeriod' => 'string', //Start time of the observations to be gathered * 'endPeriod' => 'string', //End time of the observations to be gathered * 'seriesOnly' => 'boolean', //Flag for disabling data and attributes processing (usually for getting the only dataflow contents) * 'lastNObservations' => 'integer' //The last 'n' observations to return for each matched series. * ) * ``` * @return PortableTimeSeries[] */ public function getTimeSeries2($dataflow, $agency, $version, $resource, array $options = array()) { $dataflowData = $this->getDataflow($dataflow, $agency, $version); $dsd = $this->getDataflowStructure($dataflowData->getDsdIdentifier()); return $this->getTimeSeries($dataflowData, $dsd, $resource, $options); } }
juangabreil/php-sdmx
src/Sdmx/api/client/rest/RestSdmxV21Client.php
PHP
mit
7,067
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="zh"> <head> <!-- Generated by javadoc (version 1.7.0_71) on Sat Dec 27 00:37:43 CST 2014 --> <title>类 com.gopersist.service.BaseServiceForHibernate的使用</title> <meta name="date" content="2014-12-27"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="\u7C7B com.gopersist.service.BaseServiceForHibernate\u7684\u4F7F\u7528"; } //--> </script> <noscript> <div>您的浏览器已禁用 JavaScript。</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="跳过导航链接"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="导航"> <li><a href="../../../../overview-summary.html">概览</a></li> <li><a href="../package-summary.html">程序包</a></li> <li><a href="../../../../com/gopersist/service/BaseServiceForHibernate.html" title="com.gopersist.service中的类">类</a></li> <li class="navBarCell1Rev">使用</li> <li><a href="../package-tree.html">树</a></li> <li><a href="../../../../deprecated-list.html">已过时</a></li> <li><a href="../../../../index-files/index-1.html">索引</a></li> <li><a href="../../../../help-doc.html">帮助</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>上一个</li> <li>下一个</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/gopersist/service/class-use/BaseServiceForHibernate.html" target="_top">框架</a></li> <li><a href="BaseServiceForHibernate.html" target="_top">无框架</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">所有类</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="类 com.gopersist.service.BaseServiceForHibernate 的使用" class="title">类 com.gopersist.service.BaseServiceForHibernate<br>的使用</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table border="0" cellpadding="3" cellspacing="0" summary="使用表, 列表程序包和解释"> <caption><span>使用<a href="../../../../com/gopersist/service/BaseServiceForHibernate.html" title="com.gopersist.service中的类">BaseServiceForHibernate</a>的程序包</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">程序包</th> <th class="colLast" scope="col">说明</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#com.gopersist.action">com.gopersist.action</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#com.gopersist.service.demo">com.gopersist.service.demo</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="com.gopersist.action"> <!-- --> </a> <h3><a href="../../../../com/gopersist/action/package-summary.html">com.gopersist.action</a>中<a href="../../../../com/gopersist/service/BaseServiceForHibernate.html" title="com.gopersist.service中的类">BaseServiceForHibernate</a>的使用</h3> <table border="0" cellpadding="3" cellspacing="0" summary="使用表, 列表类和解释"> <caption><span>类型参数类型为<a href="../../../../com/gopersist/service/BaseServiceForHibernate.html" title="com.gopersist.service中的类">BaseServiceForHibernate</a>的<a href="../../../../com/gopersist/action/package-summary.html">com.gopersist.action</a>中的类</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">限定符和类型</th> <th class="colLast" scope="col">类和说明</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../com/gopersist/action/Struts2ExtjsBaseAction.html" title="com.gopersist.action中的类">Struts2ExtjsBaseAction</a>&lt;T extends <a href="../../../../com/gopersist/entity/BaseEntity.html" title="com.gopersist.entity中的接口">BaseEntity</a>,X extends <a href="../../../../com/gopersist/service/BaseServiceForHibernate.html" title="com.gopersist.service中的类">BaseServiceForHibernate</a>&lt;T&gt;&gt;</strong></code> <div class="block">struts2与extjs交互抽象类 完成基本增删改查分页等功能,子类继承时只需设置entity中属性的set。</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="com.gopersist.service.demo"> <!-- --> </a> <h3><a href="../../../../com/gopersist/service/demo/package-summary.html">com.gopersist.service.demo</a>中<a href="../../../../com/gopersist/service/BaseServiceForHibernate.html" title="com.gopersist.service中的类">BaseServiceForHibernate</a>的使用</h3> <table border="0" cellpadding="3" cellspacing="0" summary="使用表, 列表子类和解释"> <caption><span><a href="../../../../com/gopersist/service/demo/package-summary.html">com.gopersist.service.demo</a>中<a href="../../../../com/gopersist/service/BaseServiceForHibernate.html" title="com.gopersist.service中的类">BaseServiceForHibernate</a>的子类</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">限定符和类型</th> <th class="colLast" scope="col">类和说明</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../com/gopersist/service/demo/DemoService.html" title="com.gopersist.service.demo中的类">DemoService</a></strong></code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="跳过导航链接"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="导航"> <li><a href="../../../../overview-summary.html">概览</a></li> <li><a href="../package-summary.html">程序包</a></li> <li><a href="../../../../com/gopersist/service/BaseServiceForHibernate.html" title="com.gopersist.service中的类">类</a></li> <li class="navBarCell1Rev">使用</li> <li><a href="../package-tree.html">树</a></li> <li><a href="../../../../deprecated-list.html">已过时</a></li> <li><a href="../../../../index-files/index-1.html">索引</a></li> <li><a href="../../../../help-doc.html">帮助</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>上一个</li> <li>下一个</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/gopersist/service/class-use/BaseServiceForHibernate.html" target="_top">框架</a></li> <li><a href="BaseServiceForHibernate.html" target="_top">无框架</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">所有类</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
gpleo/HSSEADemo
doc/com/gopersist/service/class-use/BaseServiceForHibernate.html
HTML
mit
7,783
package pages; import java.util.ArrayList; import java.util.HashMap; public class GenreList implements java.io.Serializable { public ArrayList<String> genreLabels; private static final long serialVersionUID = 114L; public HashMap<String, Integer> genreIndex; public GenreList() { genreLabels = new ArrayList<String>(); genreLabels.add("begin"); genreLabels.add("end"); // Whenever you create a new GenreList, it must have entries for the "begin" and "end" genres, // because every Markov sequence has these as endposts. } public void addLabel(String newLabel) { if (!genreLabels.contains(newLabel)) { genreLabels.add(newLabel); } } public int getIndex(String genre) { return genreLabels.indexOf(genre); } public int getSize() { return genreLabels.size(); } /** * Compares this GenreList to another to decide whether they are equal. * For this purpose we treat the lists as if they were sets. Two lists * are equal if they are the same length, and if every member of list A * is present in list B. * * Since the addLabel method does not allow duplicate labels, it is not * necessary to test the converse (every member of B also present in A). * * @param otherList The GenreList to be compared to this one. * @return */ public boolean equals(GenreList otherList) { ArrayList<String> otherLabels = otherList.genreLabels; if (otherLabels.size() == genreLabels.size()) { boolean theyareequal = true; for (String label : genreLabels) { boolean matchfound = false; for (String otherLabel : otherLabels) { if (label.equals(otherLabel)) matchfound = true; } if (!matchfound){ theyareequal = false; } } return theyareequal; } else { return false; } } public void makeIndex() { int numGenres = genreLabels.size(); genreIndex = new HashMap<String, Integer>(numGenres); for (int i = 0; i < numGenres; ++ i) { genreIndex.put(genreLabels.get(i), i); } } }
tedunderwood/genre
pages/GenreList.java
Java
mit
1,996
<?php /* * This file is part of the Sylius package. * * (c) Paweł Jędrzejewski * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ declare(strict_types=1); namespace Sylius\Bundle\CoreBundle\Installer\Requirement; use Symfony\Component\Translation\TranslatorInterface; final class SettingsRequirements extends RequirementCollection { const RECOMMENDED_PHP_VERSION = '7.0'; /** * @param TranslatorInterface $translator */ public function __construct(TranslatorInterface $translator) { parent::__construct($translator->trans('sylius.installer.settings.header', [])); $this ->add(new Requirement( $translator->trans('sylius.installer.settings.timezone', []), $this->isOn('date.timezone'), true )) ->add(new Requirement( $translator->trans('sylius.installer.settings.version_recommended', []), version_compare(phpversion(), self::RECOMMENDED_PHP_VERSION, '>='), false )) ->add(new Requirement( $translator->trans('sylius.installer.settings.detect_unicode', []), !$this->isOn('detect_unicode'), false )) ->add(new Requirement( $translator->trans('sylius.installer.settings.session.auto_start', []), !$this->isOn('session.auto_start'), false )) ; } /** * @param string $key * * @return bool */ private function isOn($key) { $value = ini_get($key); return !empty($value) && $value !== 'off'; } }
gruberro/Sylius
src/Sylius/Bundle/CoreBundle/Installer/Requirement/SettingsRequirements.php
PHP
mit
1,779
#pragma once #include "onmt/nn/Module.h" namespace onmt { namespace nn { template <typename MatFwd, typename MatIn, typename MatEmb, typename ModelT> class SoftMax: public Module<MatFwd, MatIn, MatEmb, ModelT> { public: SoftMax() : Module<MatFwd, MatIn, MatEmb, ModelT>("nn.SoftMax") { } SoftMax(const SoftMax& other) : Module<MatFwd, MatIn, MatEmb, ModelT>(other) { } Module<MatFwd, MatIn, MatEmb, ModelT>* clone(const ModuleFactory<MatFwd, MatIn, MatEmb, ModelT>*) const override { return new SoftMax(*this); } void forward_impl(const MatFwd& input) { this->_output.resizeLike(input); for (int i = 0; i < input.rows(); ++i) { auto v = input.row(i); double max = v.maxCoeff(); this->_output.row(i) = ((v.array() - (log((v.array() - max).exp().sum()) + max)).exp()); } } }; } }
OpenNMT/CTranslate
include/onmt/nn/SoftMax.h
C
mit
970
/* * This is the builder for word bean. * * @author shisj * @email senjia1988@126.com * @version 0.1 * @date 2013.12.24 */ package cn.edu.ustc.shisj.builder; import java.util.List; import cn.edu.ustc.shisj.search.SuperWordSearch; public interface WordBuilder { public SuperWordSearch builder(); public char[][] getWordGrid(); public void setWordGrid(char[][] wordGrid); public boolean isWrap(); public void setWrap(boolean wrap); public int getRow(); public void setRow(int row); public int getColumn(); public void setColumn(int column); public List<String> getSearchWords(); public void setSearchWords(List<String> searchWords); }
koll00/searchWord
SuperWordSerach/src/cn/edu/ustc/shisj/builder/WordBuilder.java
Java
mit
658
<html> <head> <meta name="viewport" content="width=device-width" /> <link href="/css/main.css" rel="stylesheet"/> </head> <body> {{things}} </body> </html>
mattbooks/mattbooks.github.io
index_template.html
HTML
mit
173
// Fill out your copyright notice in the Description page of Project Settings. #include "UE4CookbookEditor.h" #include "MyCustomAsset.h" #include "MyCustomAssetActions.h" bool FMyCustomAssetActions::HasActions(const TArray<UObject*>& InObjects) const { return true; } void FMyCustomAssetActions::GetActions(const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder) { MenuBuilder.AddMenuEntry( FText::FromString("CustomAssetAction"), FText::FromString("Action from Cookbook Recipe"), FSlateIcon(FEditorStyle::GetStyleSetName(), "LevelEditor.ViewOptions"), FUIAction( FExecuteAction::CreateRaw(this, &FMyCustomAssetActions::MyCustomAssetContext_Clicked), FCanExecuteAction() )); } /* void FMyCustomAssetActions::OpenAssetEditor(const TArray<UObject*>& InObjects, TSharedPtr<IToolkitHost> EditWithinLevelEditor / *= TSharedPtr<IToolkitHost>()* /) { FAssetTypeActions_Base::OpenAssetEditor(InObjects, EditWithinLevelEditor); }*/ uint32 FMyCustomAssetActions::GetCategories() { return EAssetTypeCategories::Misc; } FText FMyCustomAssetActions::GetName() const { return FText::FromString(TEXT("My Custom Asset")); } UClass* FMyCustomAssetActions::GetSupportedClass() const { return UMyCustomAsset::StaticClass(); } FColor FMyCustomAssetActions::GetTypeColor() const { return FColor::Emerald; }
sunithshetty/Unreal-Engine-4-Scripting-with-CPlusPlus-Cookbook
Chapter08/source/Chapter8Editor/MyCustomAssetActions.cpp
C++
mit
1,327
<?php /** * JavaScript generator function companion (for generators passed from JavaScript to PHP). */ final class V8Generator implements Iterator { /** * V8Generator must not be constructed directly. * * @throws V8JsException */ public function __construct() {} /** * {@inheritdoc} */ public function current() { } /** * {@inheritdoc} */ public function next() { } /** * Return the key of the current element * @return false */ public function key() { } /** * {@inheritdoc} */ public function valid() { } /** * JavaScript generators cannot be rewound. * * This methods throws an exception if called after generator has been started. * * @throws V8JsException * @return false */ public function rewind() { } }
phpv8/v8js-stubs
src/V8Generator.php
PHP
mit
889
using System.IO; using ITGlobal.CommandLine.Parsing; using ITGlobal.MarkDocs.Tools.Lint; namespace ITGlobal.MarkDocs.Tools { public static class LintCommand { public static void Setup(ICliCommandRoot app, CliOption<string> tempDir, CliSwitch quiet) { var command = app.Command("lint") .HelpText("Run a linter on a documentation"); var pathParameter = command .Argument("path") .DefaultValue(".") .HelpText("Path to documentation root directory") .Required(); var summary = command .Switch('s', "summary") .HelpText("Display summary"); command.OnExecute(_ => { var path = Path.GetFullPath(pathParameter); Linter.Run(path, Program.DetectTempDir(tempDir, path, "lint"), quiet, summary); }); } } }
ITGlobal/MarkDocs
src/markdocs/LintCommand.cs
C#
mit
949
/**************************************************************************** ** Meta object code from reading C++ file 'transactionfilterproxy.h' ** ** Created: Fri Jan 10 21:30:56 2014 ** by: The Qt Meta Object Compiler version 63 (Qt 4.8.2) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ #include "../src/qt/transactionfilterproxy.h" #if !defined(Q_MOC_OUTPUT_REVISION) #error "The header file 'transactionfilterproxy.h' doesn't include <QObject>." #elif Q_MOC_OUTPUT_REVISION != 63 #error "This file was generated using the moc from 4.8.2. It" #error "cannot be used with the include files from this version of Qt." #error "(The moc has changed too much.)" #endif QT_BEGIN_MOC_NAMESPACE static const uint qt_meta_data_TransactionFilterProxy[] = { // content: 6, // revision 0, // classname 0, 0, // classinfo 0, 0, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount 0 // eod }; static const char qt_meta_stringdata_TransactionFilterProxy[] = { "TransactionFilterProxy\0" }; void TransactionFilterProxy::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { Q_UNUSED(_o); Q_UNUSED(_id); Q_UNUSED(_c); Q_UNUSED(_a); } const QMetaObjectExtraData TransactionFilterProxy::staticMetaObjectExtraData = { 0, qt_static_metacall }; const QMetaObject TransactionFilterProxy::staticMetaObject = { { &QSortFilterProxyModel::staticMetaObject, qt_meta_stringdata_TransactionFilterProxy, qt_meta_data_TransactionFilterProxy, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &TransactionFilterProxy::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *TransactionFilterProxy::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *TransactionFilterProxy::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_TransactionFilterProxy)) return static_cast<void*>(const_cast< TransactionFilterProxy*>(this)); return QSortFilterProxyModel::qt_metacast(_clname); } int TransactionFilterProxy::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QSortFilterProxyModel::qt_metacall(_c, _id, _a); if (_id < 0) return _id; return _id; } QT_END_MOC_NAMESPACE
notecc/note
build/moc_transactionfilterproxy.cpp
C++
mit
2,604
<?php interface SPODNOTIFICATION_CLASS_ISender { public function __construct($notification, $targets); function send(); }
routetopa/spod-plugin-notification-system
classes/i_sender.php
PHP
mit
130
/* eslint no-console:0 */ var Hapi = require('hapi'), Path = require('path'), Swig = require('swig'), Routes = require('./routes'); Swig.setDefaults({ cache: false }); var server = new Hapi.Server(); server.connection({ port: 3000 }); server.views({ engines: { swig: Swig }, path: Path.join(__dirname, 'views') }); server.route({ method: 'GET', path: '/', handler: Routes.index }); server.route({ method: 'GET', path: '/action', handler: Routes.action }); server.route({ method: 'GET', path: '/responsive', handler: Routes.responsive}); server.route({ method: 'GET', path: '/form', handler: Routes.form }); server.route({ method: 'GET', path: '/keys', handler: Routes.keys }); server.route({ method: 'GET', path: '/angular', handler: Routes.angular }); server.route({ method: 'GET', path: '/pace', handler: Routes.pace }); server.route({ method: 'GET', path: '/pace-theme-center-simple.css', handler: function (request, reply) { reply.file(Path.join(__dirname, 'pace-theme-center-simple.css')); } }); server.route({ method: 'GET', path: '/pace.js', handler: function (request, reply) { reply.file(Path.join(__dirname, 'pace.js')); } }); server.route({ method: 'GET', path: '/angular/data', handler: Routes.angularData}); server.route({ method: 'POST', path: '/result', handler: Routes.result }); server.route({ method: 'GET', path: '/post/{id}', handler: Routes.post }); server.route({ method: 'GET', path: '/generate/{number}', handler: Routes.generate }); server.route({ method: 'GET', path: '/delay/{number}', handler: Routes.delay }); server.start(function () { console.log('Server running at:', server.info.uri); });
ctrees/msfeature
test/site/server.js
JavaScript
mit
1,838
// // InterfaceViewController.h // autoCoding // // Created by 李玉峰 on 15/6/25. // Copyright (c) 2015年 liyufeng. All rights reserved. // #import <UIKit/UIKit.h> @interface InterfaceViewController : UIViewController @end
caicai0/CAIAutoCoding
autoCoding/autoCoding/InterfaceViewController.h
C
mit
234
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is JavaScript Engine testing utilities. * * The Initial Developer of the Original Code is * Mozilla Foundation. * Portions created by the Initial Developer are Copyright (C) 2008 * the Initial Developer. All Rights Reserved. * * Contributor(s): Jesse Ruderman * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ //----------------------------------------------------------------------------- var BUGNUMBER = 452476; var summary = 'Do not assert with JIT: !cx->runningJittedCode'; var actual = 'No Crash'; var expect = 'No Crash'; printBugNumber(BUGNUMBER); printStatus (summary); jit(true); for (var j = 0; j < 10; j++) { for (var i = 0; i < j; ++i) this["n" + i] = 1; __defineGetter__('w', (function(){})); [1 for each (g in this) for each (t in /x/g)]; } jit(false); reportCompare(expect, actual, summary);
havocp/hwf
deps/spidermonkey/tests/js1_8/extensions/regress-452476.js
JavaScript
mit
2,314
var crime = { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.921416,54.579826 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.9332,54.596372 ] }, "properties": { "Month":"2016-08", "Location":"On or near Wellington Street", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.921416,54.579826 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -6.003543,54.577768 ] }, "properties": { "Month":"2016-08", "Location":"On or near Tullagh Park", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.933651,54.595113 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.92591,54.598233 ] }, "properties": { "Month":"2016-08", "Location":"On or near Victoria Square", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.934945,54.592484 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -6.00513,54.549734 ] }, "properties": { "Month":"2016-08", "Location":"On or near Auburn Place", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.976456,54.595324 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.92635,54.607549 ] }, "properties": { "Month":"2016-08", "Location":"On or near Molyneaux Street", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.940413,54.620548 ] }, "properties": { "Month":"2016-08", "Location":"On or near Richmond Square", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.919789,54.606583 ] }, "properties": { "Month":"2016-08", "Location":"On or near Clarendon Road", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.937253,54.587231 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.94568,54.618957 ] }, "properties": { "Month":"2016-08", "Location":"On or near Linden Gardens", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.922639,54.597431 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.915548,54.568134 ] }, "properties": { "Month":"2016-08", "Location":"On or near Acorn Hill", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.913961,54.572564 ] }, "properties": { "Month":"2016-08", "Location":"On or near Rosetta Park", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.932404,54.586753 ] }, "properties": { "Month":"2016-08", "Location":"On or near Botanic Avenue", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.935911,54.596328 ] }, "properties": { "Month":"2016-08", "Location":"On or near Murray Street", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.926802,54.598958 ] }, "properties": { "Month":"2016-08", "Location":"On or near Ann Street", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.927313,54.599865 ] }, "properties": { "Month":"2016-08", "Location":"On or near High Street", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.88166,54.60522 ] }, "properties": { "Month":"2016-08", "Location":"On or near Wellwood Avenue", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.931149,54.595941 ] }, "properties": { "Month":"2016-08", "Location":"On or near Donegall Square West", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.928374,54.601518 ] }, "properties": { "Month":"2016-08", "Location":"On or near Donegall Street", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.884378,54.602357 ] }, "properties": { "Month":"2016-08", "Location":"On or near Park Avenue", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.929684,54.602853 ] }, "properties": { "Month":"2016-08", "Location":"On or near Academy Street", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.932781,54.587541 ] }, "properties": { "Month":"2016-08", "Location":"On or near Botanic Avenue", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.933066,54.591086 ] }, "properties": { "Month":"2016-08", "Location":"On or near Dublin Road", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.944067,54.582477 ] }, "properties": { "Month":"2016-08", "Location":"On or near Cussick Street", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.92635,54.607549 ] }, "properties": { "Month":"2016-08", "Location":"On or near Molyneaux Street", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.931955,54.603844 ] }, "properties": { "Month":"2016-08", "Location":"On or near Union Street", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.930149,54.591854 ] }, "properties": { "Month":"2016-08", "Location":"On or near Maryville Street", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.930154,54.597254 ] }, "properties": { "Month":"2016-08", "Location":"On or near Donegall Square North", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.914895,54.573343 ] }, "properties": { "Month":"2016-08", "Location":"On or near Bell Tower", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.929306,54.600232 ] }, "properties": { "Month":"2016-08", "Location":"On or near Rosemary Street", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.933461,54.593357 ] }, "properties": { "Month":"2016-08", "Location":"On or near Hope Street", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.9333,54.597155 ] }, "properties": { "Month":"2016-08", "Location":"On or near Wellington Place", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.941305,54.614219 ] }, "properties": { "Month":"2016-08", "Location":"On or near Cliftonpark Court", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.977077,54.572503 ] }, "properties": { "Month":"2016-08", "Location":"On or near Stockmans Way", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.977077,54.572503 ] }, "properties": { "Month":"2016-08", "Location":"On or near Stockmans Way", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.923358,54.600947 ] }, "properties": { "Month":"2016-08", "Location":"On or near Queens Square", "Crime type":"Bicycle theft" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.955547,54.595727 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.958293,54.672828 ] }, "properties": { "Month":"2016-08", "Location":"On or near Glenbourne Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.937466,54.627065 ] }, "properties": { "Month":"2016-08", "Location":"On or near Fortwilliam Court", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -6.021209,54.573898 ] }, "properties": { "Month":"2016-08", "Location":"On or near Suffolk Court", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.92889,54.586181 ] }, "properties": { "Month":"2016-08", "Location":"On or near University Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.935537,54.64069 ] }, "properties": { "Month":"2016-08", "Location":"On or near Downview Manor", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.933119,54.58088 ] }, "properties": { "Month":"2016-08", "Location":"On or near Pretoria Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.819791,54.640889 ] }, "properties": { "Month":"2016-08", "Location":"On or near Woodlands", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.932543,54.587061 ] }, "properties": { "Month":"2016-08", "Location":"On or near Botanic Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.905306,54.590222 ] }, "properties": { "Month":"2016-08", "Location":"On or near Jocelyn Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.938416,54.630954 ] }, "properties": { "Month":"2016-08", "Location":"On or near Antrim Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.977372,54.524088 ] }, "properties": { "Month":"2016-08", "Location":"On or near Drumbeg Mews", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.934431,54.627364 ] }, "properties": { "Month":"2016-08", "Location":"On or near Somerton Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.942624,54.625203 ] }, "properties": { "Month":"2016-08", "Location":"On or near Rigby Close", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.938347,54.61425 ] }, "properties": { "Month":"2016-08", "Location":"On or near Cliftonville Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -6.021313,54.56664 ] }, "properties": { "Month":"2016-08", "Location":"On or near Hazelwood Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.884634,54.601004 ] }, "properties": { "Month":"2016-08", "Location":"On or near Parkgate Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.936724,54.623683 ] }, "properties": { "Month":"2016-08", "Location":"On or near Glandore Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.948269,54.581974 ] }, "properties": { "Month":"2016-08", "Location":"On or near Edinburgh Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.924978,54.62811 ] }, "properties": { "Month":"2016-08", "Location":"On or near Fortwilliam Crescent", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.930305,54.598533 ] }, "properties": { "Month":"2016-08", "Location":"On or near Donegall Place", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.935533,54.625191 ] }, "properties": { "Month":"2016-08", "Location":"On or near Skegoneill Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.963412,54.61392 ] }, "properties": { "Month":"2016-08", "Location":"On or near Brompton Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.939583,54.623804 ] }, "properties": { "Month":"2016-08", "Location":"On or near Kansas Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.943389,54.583966 ] }, "properties": { "Month":"2016-08", "Location":"On or near Lisburn Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.913844,54.671936 ] }, "properties": { "Month":"2016-08", "Location":"On or near Friars Wood", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.932993,54.63831 ] }, "properties": { "Month":"2016-08", "Location":"On or near Innisfayle Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.932536,54.603072 ] }, "properties": { "Month":"2016-08", "Location":"On or near Union Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.926512,54.597057 ] }, "properties": { "Month":"2016-08", "Location":"On or near Montgomery Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.913332,54.563684 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.953796,54.622608 ] }, "properties": { "Month":"2016-08", "Location":"On or near Deanby Gardens", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.951541,54.621869 ] }, "properties": { "Month":"2016-08", "Location":"On or near Cardigan Drive", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.949134,54.616769 ] }, "properties": { "Month":"2016-08", "Location":"On or near Oldpark Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.820225,54.612809 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.926983,54.584136 ] }, "properties": { "Month":"2016-08", "Location":"On or near Jerusalem Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.93091,54.587824 ] }, "properties": { "Month":"2016-08", "Location":"On or near Wolseley Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -6.023339,54.567275 ] }, "properties": { "Month":"2016-08", "Location":"On or near Pembroke Manor", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.94876,54.579592 ] }, "properties": { "Month":"2016-08", "Location":"On or near Derryvolgie Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.925874,54.670426 ] }, "properties": { "Month":"2016-08", "Location":"On or near Dunanney", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -6.002459,54.705066 ] }, "properties": { "Month":"2016-08", "Location":"On or near Ballycraigy Road North", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -6.036951,54.687067 ] }, "properties": { "Month":"2016-08", "Location":"On or near Lylehill Road East", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.960259,54.572652 ] }, "properties": { "Month":"2016-08", "Location":"On or near Lislea Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.93116,54.571924 ] }, "properties": { "Month":"2016-08", "Location":"On or near Laganvale Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.990838,54.562831 ] }, "properties": { "Month":"2016-08", "Location":"On or near Ashton Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.909178,54.582311 ] }, "properties": { "Month":"2016-08", "Location":"On or near Broughton Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.910356,54.571082 ] }, "properties": { "Month":"2016-08", "Location":"On or near Rosetta Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.986358,54.560547 ] }, "properties": { "Month":"2016-08", "Location":"On or near Orpen Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.977794,54.523987 ] }, "properties": { "Month":"2016-08", "Location":"On or near Drumbeg Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.928467,54.638673 ] }, "properties": { "Month":"2016-08", "Location":"On or near Downview Drive", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.986358,54.560547 ] }, "properties": { "Month":"2016-08", "Location":"On or near Orpen Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -6.034855,54.552899 ] }, "properties": { "Month":"2016-08", "Location":"On or near Lagmore Meadows", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.950814,54.561477 ] }, "properties": { "Month":"2016-08", "Location":"On or near Piney Hills", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.988477,54.58344 ] }, "properties": { "Month":"2016-08", "Location":"On or near Gransha Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.924398,54.584469 ] }, "properties": { "Month":"2016-08", "Location":"On or near Agincourt Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.89073,54.67849 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.901266,54.599892 ] }, "properties": { "Month":"2016-08", "Location":"On or near Finmore Court", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.908908,54.661195 ] }, "properties": { "Month":"2016-08", "Location":"On or near Doagh Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.924715,54.585229 ] }, "properties": { "Month":"2016-08", "Location":"On or near The Cloisters", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.946341,54.568032 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.960765,54.611755 ] }, "properties": { "Month":"2016-08", "Location":"On or near Bray Close", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.927918,54.628771 ] }, "properties": { "Month":"2016-08", "Location":"On or near Dunlambert Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.923238,54.596012 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.924402,54.627866 ] }, "properties": { "Month":"2016-08", "Location":"On or near Fortwilliam Crescent", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.982679,54.586209 ] }, "properties": { "Month":"2016-08", "Location":"On or near Norfolk Drive", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.95909,54.607476 ] }, "properties": { "Month":"2016-08", "Location":"On or near Enfield Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.925134,54.584598 ] }, "properties": { "Month":"2016-08", "Location":"On or near Rugby Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.893962,54.591796 ] }, "properties": { "Month":"2016-08", "Location":"On or near Foxglove Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -6.02177,54.557528 ] }, "properties": { "Month":"2016-08", "Location":"On or near Glasvey Crescent", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.98195,54.610951 ] }, "properties": { "Month":"2016-08", "Location":"On or near Westway Gardens", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.951786,54.588655 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.970205,54.590026 ] }, "properties": { "Month":"2016-08", "Location":"On or near Rockville Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.977018,54.597409 ] }, "properties": { "Month":"2016-08", "Location":"On or near Springfield Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.938485,54.618871 ] }, "properties": { "Month":"2016-08", "Location":"On or near Antrim Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.979208,54.609431 ] }, "properties": { "Month":"2016-08", "Location":"On or near Lyndhurst Drive", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.927652,54.584057 ] }, "properties": { "Month":"2016-08", "Location":"On or near Palestine Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -6.020586,54.565685 ] }, "properties": { "Month":"2016-08", "Location":"On or near Hazelwood Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.945534,54.613258 ] }, "properties": { "Month":"2016-08", "Location":"On or near Manor Court", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.97034,54.62028 ] }, "properties": { "Month":"2016-08", "Location":"On or near Wheatfield Gardens", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.929138,54.634012 ] }, "properties": { "Month":"2016-08", "Location":"On or near Lansdowne Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.924101,54.577527 ] }, "properties": { "Month":"2016-08", "Location":"On or near Haywood Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.933869,54.622269 ] }, "properties": { "Month":"2016-08", "Location":"On or near Ashfield Court", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.930703,54.587335 ] }, "properties": { "Month":"2016-08", "Location":"On or near Wolseley Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.92468,54.616631 ] }, "properties": { "Month":"2016-08", "Location":"On or near Castleton Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.928591,54.584756 ] }, "properties": { "Month":"2016-08", "Location":"On or near Carmel Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.951297,54.583588 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.897223,54.575356 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.98048,54.563432 ] }, "properties": { "Month":"2016-08", "Location":"On or near Upper Lisburn Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.930074,54.635107 ] }, "properties": { "Month":"2016-08", "Location":"On or near Bristol Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.934815,54.625304 ] }, "properties": { "Month":"2016-08", "Location":"On or near Somerton Court", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.908498,54.589226 ] }, "properties": { "Month":"2016-08", "Location":"On or near London Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.926474,54.592618 ] }, "properties": { "Month":"2016-08", "Location":"On or near Joy Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.862614,54.593564 ] }, "properties": { "Month":"2016-08", "Location":"On or near Knockhill Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.92249,54.577571 ] }, "properties": { "Month":"2016-08", "Location":"On or near Fernwood Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.927712,54.553015 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.813983,54.649518 ] }, "properties": { "Month":"2016-08", "Location":"On or near Orchard Way", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.930703,54.587335 ] }, "properties": { "Month":"2016-08", "Location":"On or near Wolseley Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.940372,54.5852 ] }, "properties": { "Month":"2016-08", "Location":"On or near Elmwood Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.885914,54.590936 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.947632,54.633375 ] }, "properties": { "Month":"2016-08", "Location":"On or near Upper Cavehill Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.894489,54.598364 ] }, "properties": { "Month":"2016-08", "Location":"On or near Newtownards Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.868965,54.595203 ] }, "properties": { "Month":"2016-08", "Location":"On or near Upper Newtownards Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.900185,54.583008 ] }, "properties": { "Month":"2016-08", "Location":"On or near Willowholme Drive", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.936543,54.628793 ] }, "properties": { "Month":"2016-08", "Location":"On or near Fortwilliam Gardens", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.930443,54.586675 ] }, "properties": { "Month":"2016-08", "Location":"On or near Wolseley Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.953211,54.577502 ] }, "properties": { "Month":"2016-08", "Location":"On or near Brookland Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.993776,54.678884 ] }, "properties": { "Month":"2016-08", "Location":"On or near Trench Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.922721,54.57851 ] }, "properties": { "Month":"2016-08", "Location":"On or near Ava Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.945861,54.582795 ] }, "properties": { "Month":"2016-08", "Location":"On or near Tates Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.867581,54.605413 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -6.015857,54.55735 ] }, "properties": { "Month":"2016-08", "Location":"On or near Credenhill Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.932635,54.591645 ] }, "properties": { "Month":"2016-08", "Location":"On or near Ventry Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.923238,54.585967 ] }, "properties": { "Month":"2016-08", "Location":"On or near Ormeau Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.897098,54.590979 ] }, "properties": { "Month":"2016-08", "Location":"On or near Clara Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.930906,54.591274 ] }, "properties": { "Month":"2016-08", "Location":"On or near Ashburne Mews", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.92881,54.585317 ] }, "properties": { "Month":"2016-08", "Location":"On or near Carmel Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.924895,54.638558 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -6.013086,54.557116 ] }, "properties": { "Month":"2016-08", "Location":"On or near Credenhill Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.990649,54.589594 ] }, "properties": { "Month":"2016-08", "Location":"On or near Monagh Drive", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -6.018005,54.560243 ] }, "properties": { "Month":"2016-08", "Location":"On or near Corrina Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.89912,54.585677 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.990459,54.596905 ] }, "properties": { "Month":"2016-08", "Location":"On or near New Barnsley Crescent", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.931537,54.619093 ] }, "properties": { "Month":"2016-08", "Location":"On or near Alexandra Park Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.90149,54.588611 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.900596,54.686209 ] }, "properties": { "Month":"2016-08", "Location":"On or near Lynda Gardens", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.922247,54.574135 ] }, "properties": { "Month":"2016-08", "Location":"On or near Ailesbury Drive", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -6.023872,54.555613 ] }, "properties": { "Month":"2016-08", "Location":"On or near Glasvey Walk", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.937336,54.612202 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.983691,54.585768 ] }, "properties": { "Month":"2016-08", "Location":"On or near Norfolk Parade", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.811046,54.597224 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.873832,54.5998 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.978968,54.602087 ] }, "properties": { "Month":"2016-08", "Location":"On or near Highfern Gardens", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.956972,54.565103 ] }, "properties": { "Month":"2016-08", "Location":"On or near Shrewsbury Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.94338,54.581064 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -6.015609,54.559593 ] }, "properties": { "Month":"2016-08", "Location":"On or near Corrina Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.929357,54.552567 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.977268,54.597988 ] }, "properties": { "Month":"2016-08", "Location":"On or near Dunboyne Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.96465,54.563067 ] }, "properties": { "Month":"2016-08", "Location":"On or near Bristow Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.925189,54.583206 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.977268,54.597988 ] }, "properties": { "Month":"2016-08", "Location":"On or near Dunboyne Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.932289,54.623805 ] }, "properties": { "Month":"2016-08", "Location":"On or near Queen Victoria Gardens", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.923238,54.596012 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.949097,54.583668 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.940606,54.60294 ] }, "properties": { "Month":"2016-08", "Location":"On or near Boundary Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.961088,54.559458 ] }, "properties": { "Month":"2016-08", "Location":"On or near Bristow Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.902627,54.598101 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.961001,54.604544 ] }, "properties": { "Month":"2016-08", "Location":"On or near Caledon Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.938649,54.621452 ] }, "properties": { "Month":"2016-08", "Location":"On or near Willowbank Gardens", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.851909,54.620537 ] }, "properties": { "Month":"2016-08", "Location":"On or near Richmond Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.909378,54.581721 ] }, "properties": { "Month":"2016-08", "Location":"On or near Broughton Gardens", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.889414,54.571437 ] }, "properties": { "Month":"2016-08", "Location":"On or near Cregagh Park East", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.903877,54.5545 ] }, "properties": { "Month":"2016-08", "Location":"On or near Burnside Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.964697,54.676216 ] }, "properties": { "Month":"2016-08", "Location":"On or near Rose Drive", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.923758,54.574233 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.94748,54.632402 ] }, "properties": { "Month":"2016-08", "Location":"On or near Cavehill Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.954585,54.576016 ] }, "properties": { "Month":"2016-08", "Location":"On or near Lisburn Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.931196,54.594091 ] }, "properties": { "Month":"2016-08", "Location":"On or near Clarence Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.904914,54.582497 ] }, "properties": { "Month":"2016-08", "Location":"On or near Pirrie Park Gardens", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.944767,54.583325 ] }, "properties": { "Month":"2016-08", "Location":"On or near Ashley Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.939027,54.62622 ] }, "properties": { "Month":"2016-08", "Location":"On or near Kenbella Parade", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.983394,54.626204 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.955547,54.595727 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.940621,54.627452 ] }, "properties": { "Month":"2016-08", "Location":"On or near Chichester Park South", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.940605,54.600811 ] }, "properties": { "Month":"2016-08", "Location":"On or near Fingals Court", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -6.049108,54.556427 ] }, "properties": { "Month":"2016-08", "Location":"On or near Mount Eagles Crescent", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.964411,54.579955 ] }, "properties": { "Month":"2016-08", "Location":"On or near Boucher Place", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.971792,54.591104 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.905016,54.547655 ] }, "properties": { "Month":"2016-08", "Location":"On or near Saintfield Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.902186,54.556717 ] }, "properties": { "Month":"2016-08", "Location":"On or near Colby Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.938882,54.659992 ] }, "properties": { "Month":"2016-08", "Location":"On or near Whitewell Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.951854,54.574029 ] }, "properties": { "Month":"2016-08", "Location":"On or near Marlborough Park South", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.902186,54.556717 ] }, "properties": { "Month":"2016-08", "Location":"On or near Colby Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.93423,54.63409 ] }, "properties": { "Month":"2016-08", "Location":"On or near Somerton Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.911626,54.571041 ] }, "properties": { "Month":"2016-08", "Location":"On or near Rosetta Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.934828,54.628099 ] }, "properties": { "Month":"2016-08", "Location":"On or near Fortwilliam Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.956158,54.568693 ] }, "properties": { "Month":"2016-08", "Location":"On or near Maryville Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.937879,54.577583 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.860149,54.586278 ] }, "properties": { "Month":"2016-08", "Location":"On or near Knock Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.960674,54.679149 ] }, "properties": { "Month":"2016-08", "Location":"On or near Burnthill Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -6.029332,54.558424 ] }, "properties": { "Month":"2016-08", "Location":"On or near Woodside Walk", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.947817,54.584509 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.983574,54.667915 ] }, "properties": { "Month":"2016-08", "Location":"On or near Mayfield Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.907931,54.5505 ] }, "properties": { "Month":"2016-08", "Location":"On or near Saintfield Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.934968,54.599367 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.934003,54.614427 ] }, "properties": { "Month":"2016-08", "Location":"On or near Syringa Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.885828,54.598563 ] }, "properties": { "Month":"2016-08", "Location":"On or near Cheviot Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.964814,54.593889 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.930747,54.602952 ] }, "properties": { "Month":"2016-08", "Location":"On or near Royal Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.979367,54.555605 ] }, "properties": { "Month":"2016-08", "Location":"On or near Benmore Walk", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.984865,54.563244 ] }, "properties": { "Month":"2016-08", "Location":"On or near Diamond Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.85374,54.584305 ] }, "properties": { "Month":"2016-08", "Location":"On or near Shandon Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.85374,54.584305 ] }, "properties": { "Month":"2016-08", "Location":"On or near Shandon Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.939684,54.61323 ] }, "properties": { "Month":"2016-08", "Location":"On or near Brucevale Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.861436,54.578259 ] }, "properties": { "Month":"2016-08", "Location":"On or near Ravenswood Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -6.030117,54.554008 ] }, "properties": { "Month":"2016-08", "Location":"On or near Altan Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.89866,54.593099 ] }, "properties": { "Month":"2016-08", "Location":"On or near Trillick Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -6.018446,54.56326 ] }, "properties": { "Month":"2016-08", "Location":"On or near Upper Dunmurry Lane", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.919916,54.682355 ] }, "properties": { "Month":"2016-08", "Location":"On or near Cherrylands", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.851884,54.587237 ] }, "properties": { "Month":"2016-08", "Location":"On or near Wynard Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -6.024072,54.55788 ] }, "properties": { "Month":"2016-08", "Location":"On or near Glasvey Close", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.92587,54.5832 ] }, "properties": { "Month":"2016-08", "Location":"On or near Agincourt Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.978145,54.596853 ] }, "properties": { "Month":"2016-08", "Location":"On or near Sliabh Dubh View", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.84326,54.589995 ] }, "properties": { "Month":"2016-08", "Location":"On or near Gortin Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.924922,54.583283 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.901266,54.599892 ] }, "properties": { "Month":"2016-08", "Location":"On or near Finmore Court", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.941847,54.582332 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.941255,54.57322 ] }, "properties": { "Month":"2016-08", "Location":"On or near Cleaver Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.939583,54.623804 ] }, "properties": { "Month":"2016-08", "Location":"On or near Kansas Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.955848,54.572425 ] }, "properties": { "Month":"2016-08", "Location":"On or near Cranmore Gardens", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.884668,54.592586 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.929349,54.60822 ] }, "properties": { "Month":"2016-08", "Location":"On or near Mccleery Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.871808,54.598255 ] }, "properties": { "Month":"2016-08", "Location":"On or near Earlswood Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.98006,54.665332 ] }, "properties": { "Month":"2016-08", "Location":"On or near Mayfield Village", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.904654,54.594192 ] }, "properties": { "Month":"2016-08", "Location":"On or near The Mount", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.945273,54.578796 ] }, "properties": { "Month":"2016-08", "Location":"On or near Derryvolgie Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -6.032761,54.552397 ] }, "properties": { "Month":"2016-08", "Location":"On or near Lagmore Meadows", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.93075,54.60014 ] }, "properties": { "Month":"2016-08", "Location":"On or near Berry Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.869627,54.60208 ] }, "properties": { "Month":"2016-08", "Location":"On or near Edgcumbe Gardens", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.874522,54.695494 ] }, "properties": { "Month":"2016-08", "Location":"On or near Gortlane Drive", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.898585,54.597851 ] }, "properties": { "Month":"2016-08", "Location":"On or near Montrose Walk", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.801218,54.593802 ] }, "properties": { "Month":"2016-08", "Location":"On or near Burton Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.922347,54.577353 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.9485,54.617387 ] }, "properties": { "Month":"2016-08", "Location":"On or near Oldpark Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.964814,54.593889 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.924518,54.583626 ] }, "properties": { "Month":"2016-08", "Location":"On or near Penrose Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.964381,54.588302 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.930747,54.602952 ] }, "properties": { "Month":"2016-08", "Location":"On or near Royal Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.943393,54.62563 ] }, "properties": { "Month":"2016-08", "Location":"On or near Cavehill Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.962651,54.590726 ] }, "properties": { "Month":"2016-08", "Location":"On or near Fallswater Drive", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.93533,54.548176 ] }, "properties": { "Month":"2016-08", "Location":"On or near Minnowburn Gardens", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.936066,54.627805 ] }, "properties": { "Month":"2016-08", "Location":"On or near Fortwilliam Gardens", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.925134,54.584598 ] }, "properties": { "Month":"2016-08", "Location":"On or near Rugby Avenue", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.920189,54.544404 ] }, "properties": { "Month":"2016-08", "Location":"On or near Purdysburn Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.9332,54.596372 ] }, "properties": { "Month":"2016-08", "Location":"On or near Wellington Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.982295,54.598351 ] }, "properties": { "Month":"2016-08", "Location":"On or near Moyard Park", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.927095,54.60262 ] }, "properties": { "Month":"2016-08", "Location":"On or near Hill Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.961696,54.616353 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.929548,54.58754 ] }, "properties": { "Month":"2016-08", "Location":"On or near Lawrence Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.868892,54.601636 ] }, "properties": { "Month":"2016-08", "Location":"On or near Edgcumbe Drive", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.911571,54.605066 ] }, "properties": { "Month":"2016-08", "Location":"On or near Queens Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.978278,54.667809 ] }, "properties": { "Month":"2016-08", "Location":"On or near Mayfield Drive", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.934686,54.59637 ] }, "properties": { "Month":"2016-08", "Location":"On or near Murray Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.906516,54.684784 ] }, "properties": { "Month":"2016-08", "Location":"On or near Hollybank Way", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.943389,54.583966 ] }, "properties": { "Month":"2016-08", "Location":"On or near Lisburn Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.934834,54.614235 ] }, "properties": { "Month":"2016-08", "Location":"On or near Hallidays Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.975774,54.543891 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.952969,54.577714 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.937263,54.619155 ] }, "properties": { "Month":"2016-08", "Location":"On or near Castleton Gardens", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.974456,54.664564 ] }, "properties": { "Month":"2016-08", "Location":"On or near Hollybrook Manor", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.955031,54.577605 ] }, "properties": { "Month":"2016-08", "Location":"On or near Rathcool Street", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.836559,54.58301 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.860149,54.586278 ] }, "properties": { "Month":"2016-08", "Location":"On or near Knock Road", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.903647,54.591802 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.888088,54.526793 ] }, "properties": { "Month":"2016-08", "Location":"On or near Burnview Drive", "Crime type":"Burglary" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.947648,54.59863 ] }, "properties": { "Month":"2016-08", "Location":"On or near Ross Street", "Crime type":"Robbery" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -6.036521,54.565172 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Robbery" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.933559,54.594177 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Robbery" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.964788,54.613646 ] }, "properties": { "Month":"2016-08", "Location":"On or near Crumlin Road", "Crime type":"Robbery" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.925288,54.602256 ] }, "properties": { "Month":"2016-08", "Location":"On or near Dunbar Street", "Crime type":"Robbery" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.936644,54.59192 ] }, "properties": { "Month":"2016-08", "Location":"On or near Sandy Row", "Crime type":"Robbery" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.938064,54.626878 ] }, "properties": { "Month":"2016-08", "Location":"On or near Antrim Road", "Crime type":"Robbery" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.933906,54.599241 ] }, "properties": { "Month":"2016-08", "Location":"On or near College Court", "Crime type":"Robbery" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.929328,54.598579 ] }, "properties": { "Month":"2016-08", "Location":"On or near Castle Lane", "Crime type":"Robbery" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.933906,54.599241 ] }, "properties": { "Month":"2016-08", "Location":"On or near College Court", "Crime type":"Robbery" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.933906,54.599241 ] }, "properties": { "Month":"2016-08", "Location":"On or near College Court", "Crime type":"Robbery" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.879861,54.59933 ] }, "properties": { "Month":"2016-08", "Location":"On or near Dundela Drive", "Crime type":"Robbery" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.951174,54.684577 ] }, "properties": { "Month":"2016-08", "Location":"On or near Carnvue Road", "Crime type":"Robbery" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.897717,54.58107 ] }, "properties": { "Month":"2016-08", "Location":"On or near Haddington Gardens", "Crime type":"Robbery" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.948986,54.56371 ] }, "properties": { "Month":"2016-08", "Location":"On or near Newforge Grange", "Crime type":"Robbery" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.928221,54.608794 ] }, "properties": { "Month":"2016-08", "Location":"On or near Earl Close", "Crime type":"Robbery" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.917032,54.59693 ] }, "properties": { "Month":"2016-08", "Location":"On or near Mays Meadow", "Crime type":"Robbery" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.991581,54.573176 ] }, "properties": { "Month":"2016-08", "Location":"On or near Andersonstown Road", "Crime type":"Robbery" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.928221,54.608794 ] }, "properties": { "Month":"2016-08", "Location":"On or near Earl Close", "Crime type":"Robbery" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.960765,54.611755 ] }, "properties": { "Month":"2016-08", "Location":"On or near Bray Close", "Crime type":"Robbery" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.928221,54.608794 ] }, "properties": { "Month":"2016-08", "Location":"On or near Earl Close", "Crime type":"Robbery" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.92881,54.585317 ] }, "properties": { "Month":"2016-08", "Location":"On or near Carmel Street", "Crime type":"Robbery" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.955547,54.595727 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Robbery" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.945368,54.583066 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Robbery" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.932232,54.611207 ] }, "properties": { "Month":"2016-08", "Location":"On or near New Lodge Road", "Crime type":"Robbery" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.946673,54.586026 ] }, "properties": { "Month":"2016-08", "Location":"On or near Dunluce Avenue", "Crime type":"Robbery" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.943917,54.633959 ] }, "properties": { "Month":"2016-08", "Location":"On or near Merryfield Drive", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.987968,54.571185 ] }, "properties": { "Month":"2016-08", "Location":"On or near Riverdale Gardens", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.927755,54.613692 ] }, "properties": { "Month":"2016-08", "Location":"On or near Glenrosa Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.819791,54.640889 ] }, "properties": { "Month":"2016-08", "Location":"On or near Woodlands", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.944929,54.631083 ] }, "properties": { "Month":"2016-08", "Location":"On or near Ophir Gardens", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.967521,54.618445 ] }, "properties": { "Month":"2016-08", "Location":"On or near Ardoyne Road", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.978876,54.558355 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.952378,54.60491 ] }, "properties": { "Month":"2016-08", "Location":"On or near Edwina Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.933779,54.603588 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.988721,54.677632 ] }, "properties": { "Month":"2016-08", "Location":"On or near Cloughmore Road", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.980405,54.585569 ] }, "properties": { "Month":"2016-08", "Location":"On or near Divis Drive", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.936572,54.608029 ] }, "properties": { "Month":"2016-08", "Location":"On or near Annesley Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.935929,54.610633 ] }, "properties": { "Month":"2016-08", "Location":"On or near Kinnaird Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.936452,54.587146 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.947112,54.597902 ] }, "properties": { "Month":"2016-08", "Location":"On or near Roumania Rise", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.928538,54.595555 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.912672,54.579011 ] }, "properties": { "Month":"2016-08", "Location":"On or near Ravenhill Road", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.930157,54.594127 ] }, "properties": { "Month":"2016-08", "Location":"On or near Clarence Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.930157,54.594127 ] }, "properties": { "Month":"2016-08", "Location":"On or near Clarence Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.945343,54.598007 ] }, "properties": { "Month":"2016-08", "Location":"On or near Albert Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.901849,54.589165 ] }, "properties": { "Month":"2016-08", "Location":"On or near Willowfield Parade", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.945343,54.598007 ] }, "properties": { "Month":"2016-08", "Location":"On or near Albert Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.921379,54.623376 ] }, "properties": { "Month":"2016-08", "Location":"On or near St. Aubyn Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.986013,54.533685 ] }, "properties": { "Month":"2016-08", "Location":"On or near Ballyskeagh Road", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.955366,54.59594 ] }, "properties": { "Month":"2016-08", "Location":"On or near Springfield Road", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.939027,54.62622 ] }, "properties": { "Month":"2016-08", "Location":"On or near Kenbella Parade", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.939027,54.62622 ] }, "properties": { "Month":"2016-08", "Location":"On or near Kenbella Parade", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.92567,54.616639 ] }, "properties": { "Month":"2016-08", "Location":"On or near North Queen Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.93895,54.598042 ] }, "properties": { "Month":"2016-08", "Location":"On or near Galway Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -6.029587,54.558923 ] }, "properties": { "Month":"2016-08", "Location":"On or near Woodside View", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.932499,54.598004 ] }, "properties": { "Month":"2016-08", "Location":"On or near College Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.932958,54.621912 ] }, "properties": { "Month":"2016-08", "Location":"On or near Ashfield Gardens", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.983375,54.574927 ] }, "properties": { "Month":"2016-08", "Location":"On or near Andersonstown Road", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.958365,54.580527 ] }, "properties": { "Month":"2016-08", "Location":"On or near Wildflower Way", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -6.029035,54.560432 ] }, "properties": { "Month":"2016-08", "Location":"On or near Glenwood Court", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.935911,54.596328 ] }, "properties": { "Month":"2016-08", "Location":"On or near Murray Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.933559,54.594177 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.981361,54.608784 ] }, "properties": { "Month":"2016-08", "Location":"On or near Lyndhurst Way", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.90357,54.58968 ] }, "properties": { "Month":"2016-08", "Location":"On or near Willowfield Avenue", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.911582,54.584302 ] }, "properties": { "Month":"2016-08", "Location":"On or near Ravenhill Road", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.933461,54.593357 ] }, "properties": { "Month":"2016-08", "Location":"On or near Hope Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.868604,54.572204 ] }, "properties": { "Month":"2016-08", "Location":"On or near Grey Castle Manor", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.979746,54.582944 ] }, "properties": { "Month":"2016-08", "Location":"On or near Glen Parade", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.979208,54.609431 ] }, "properties": { "Month":"2016-08", "Location":"On or near Lyndhurst Drive", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.902171,54.582001 ] }, "properties": { "Month":"2016-08", "Location":"On or near Ardenlee Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.927349,54.592462 ] }, "properties": { "Month":"2016-08", "Location":"On or near Ormeau Avenue", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.977268,54.597988 ] }, "properties": { "Month":"2016-08", "Location":"On or near Dunboyne Park", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.989392,54.592503 ] }, "properties": { "Month":"2016-08", "Location":"On or near Norglen Court", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.867913,54.599947 ] }, "properties": { "Month":"2016-08", "Location":"On or near Clonallon Court", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.934968,54.599367 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.936677,54.593421 ] }, "properties": { "Month":"2016-08", "Location":"On or near Sandy Row", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.934968,54.599367 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.905009,54.677022 ] }, "properties": { "Month":"2016-08", "Location":"On or near Fernagh Parade", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.880215,54.600262 ] }, "properties": { "Month":"2016-08", "Location":"On or near Holywood Road", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.936878,54.611152 ] }, "properties": { "Month":"2016-08", "Location":"On or near Kinnaird Terrace", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.934968,54.599367 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.888249,54.576313 ] }, "properties": { "Month":"2016-08", "Location":"On or near Stirling Avenue", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.89381,54.591137 ] }, "properties": { "Month":"2016-08", "Location":"On or near Grove Street East", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.955547,54.595727 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.943605,54.583054 ] }, "properties": { "Month":"2016-08", "Location":"On or near Wellington Park", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.915195,54.658886 ] }, "properties": { "Month":"2016-08", "Location":"On or near Ardgart Place", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.94628,54.610117 ] }, "properties": { "Month":"2016-08", "Location":"On or near Shannon Court", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.973843,54.61741 ] }, "properties": { "Month":"2016-08", "Location":"On or near Abbeydale Gardens", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.928966,54.58346 ] }, "properties": { "Month":"2016-08", "Location":"On or near Rugby Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.911138,54.656094 ] }, "properties": { "Month":"2016-08", "Location":"On or near Merville Garden Village", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.9512,54.613866 ] }, "properties": { "Month":"2016-08", "Location":"On or near Antigua Court", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.973531,54.623065 ] }, "properties": { "Month":"2016-08", "Location":"On or near Tedburn Park", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.973531,54.623065 ] }, "properties": { "Month":"2016-08", "Location":"On or near Tedburn Park", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.975737,54.619796 ] }, "properties": { "Month":"2016-08", "Location":"On or near Abbeydale Parade", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.942369,54.582709 ] }, "properties": { "Month":"2016-08", "Location":"On or near Wellington Park", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.934898,54.591881 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.928653,54.601811 ] }, "properties": { "Month":"2016-08", "Location":"On or near Donegall Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.928735,54.609953 ] }, "properties": { "Month":"2016-08", "Location":"On or near Hardinge Place", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -6.022716,54.56545 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.935911,54.596328 ] }, "properties": { "Month":"2016-08", "Location":"On or near Murray Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.966682,54.617263 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.931465,54.585731 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.940995,54.580206 ] }, "properties": { "Month":"2016-08", "Location":"On or near Malone Avenue", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -6.031369,54.54312 ] }, "properties": { "Month":"2016-08", "Location":"On or near Derriaghy Road", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.942684,54.616965 ] }, "properties": { "Month":"2016-08", "Location":"On or near Orient Gardens", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.898526,54.592396 ] }, "properties": { "Month":"2016-08", "Location":"On or near Beersbridge Road", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.957205,54.611425 ] }, "properties": { "Month":"2016-08", "Location":"On or near Leopold Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -6.030852,54.551279 ] }, "properties": { "Month":"2016-08", "Location":"On or near Lagmore Drive", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.949153,54.598548 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.968221,54.688234 ] }, "properties": { "Month":"2016-08", "Location":"On or near Sentry Hill Drive", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.891862,54.551577 ] }, "properties": { "Month":"2016-08", "Location":"On or near Briar Hill", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.945343,54.598007 ] }, "properties": { "Month":"2016-08", "Location":"On or near Albert Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.935466,54.634156 ] }, "properties": { "Month":"2016-08", "Location":"On or near Lansdowne Mews", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.936644,54.59192 ] }, "properties": { "Month":"2016-08", "Location":"On or near Sandy Row", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.935911,54.596328 ] }, "properties": { "Month":"2016-08", "Location":"On or near Murray Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.904702,54.58421 ] }, "properties": { "Month":"2016-08", "Location":"On or near Chesham Park", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.924252,54.579722 ] }, "properties": { "Month":"2016-08", "Location":"On or near Candahar Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.960516,54.676424 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.933992,54.611588 ] }, "properties": { "Month":"2016-08", "Location":"On or near Hartwell Place", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.930563,54.594988 ] }, "properties": { "Month":"2016-08", "Location":"On or near Franklin Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.923364,54.581369 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.936322,54.613586 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.843072,54.640641 ] }, "properties": { "Month":"2016-08", "Location":"On or near Kinnegar Road", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.943065,54.633648 ] }, "properties": { "Month":"2016-08", "Location":"On or near Old Cavehill Road", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.936427,54.59835 ] }, "properties": { "Month":"2016-08", "Location":"On or near College Place North", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.942657,54.624872 ] }, "properties": { "Month":"2016-08", "Location":"On or near Indiana Avenue", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.816774,54.648624 ] }, "properties": { "Month":"2016-08", "Location":"On or near Old Cultra Lane", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.917677,54.694572 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.891737,54.598019 ] }, "properties": { "Month":"2016-08", "Location":"On or near Connswater Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.9485,54.617387 ] }, "properties": { "Month":"2016-08", "Location":"On or near Oldpark Avenue", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.908939,54.657278 ] }, "properties": { "Month":"2016-08", "Location":"On or near Merville Mews", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.85168,54.616965 ] }, "properties": { "Month":"2016-08", "Location":"On or near Knocknagoney Avenue", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.920026,54.578275 ] }, "properties": { "Month":"2016-08", "Location":"On or near Blackwood Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.942436,54.622181 ] }, "properties": { "Month":"2016-08", "Location":"On or near Cavehill Road", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.963162,54.594121 ] }, "properties": { "Month":"2016-08", "Location":"On or near Ardnaclowney Drive", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.915933,54.662322 ] }, "properties": { "Month":"2016-08", "Location":"On or near Rathcoole Drive", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.932244,54.591126 ] }, "properties": { "Month":"2016-08", "Location":"On or near Salisbury Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.910344,54.568898 ] }, "properties": { "Month":"2016-08", "Location":"On or near Knockbreda Park", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.942436,54.622181 ] }, "properties": { "Month":"2016-08", "Location":"On or near Cavehill Road", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.911571,54.605066 ] }, "properties": { "Month":"2016-08", "Location":"On or near Queens Road", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.93091,54.587824 ] }, "properties": { "Month":"2016-08", "Location":"On or near Wolseley Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.946507,54.613607 ] }, "properties": { "Month":"2016-08", "Location":"On or near Southport Court", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.934633,54.597106 ] }, "properties": { "Month":"2016-08", "Location":"On or near College Square East", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.893291,54.556832 ] }, "properties": { "Month":"2016-08", "Location":"On or near Windrush Park", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.947277,54.585084 ] }, "properties": { "Month":"2016-08", "Location":"On or near Ulsterville Gardens", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.958833,54.585719 ] }, "properties": { "Month":"2016-08", "Location":"On or near Glenmachan Pl Roundabout", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.93091,54.587824 ] }, "properties": { "Month":"2016-08", "Location":"On or near Wolseley Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.899176,54.592093 ] }, "properties": { "Month":"2016-08", "Location":"On or near Castlereagh Road", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.910282,54.586112 ] }, "properties": { "Month":"2016-08", "Location":"On or near Ravenhill Court", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.958659,54.625062 ] }, "properties": { "Month":"2016-08", "Location":"On or near Marmount Gardens", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.929421,54.590341 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.929041,54.594171 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.951776,54.619968 ] }, "properties": { "Month":"2016-08", "Location":"On or near Cliftonville Road", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.91058,54.624394 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.933906,54.599241 ] }, "properties": { "Month":"2016-08", "Location":"On or near College Court", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.978149,54.561155 ] }, "properties": { "Month":"2016-08", "Location":"On or near Locksley Park", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.923238,54.596012 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.889215,54.600105 ] }, "properties": { "Month":"2016-08", "Location":"On or near Lewis Park", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.926248,54.599505 ] }, "properties": { "Month":"2016-08", "Location":"On or near Pottingers Entry", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.9554,54.606372 ] }, "properties": { "Month":"2016-08", "Location":"On or near Dewey Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.929041,54.594171 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.933066,54.591086 ] }, "properties": { "Month":"2016-08", "Location":"On or near Dublin Road", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.898907,54.572375 ] }, "properties": { "Month":"2016-08", "Location":"On or near The Straight", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.957335,54.62397 ] }, "properties": { "Month":"2016-08", "Location":"On or near Dunblane Avenue", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.950679,54.581413 ] }, "properties": { "Month":"2016-08", "Location":"On or near Lower Windsor Avenue", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.946151,54.585325 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.981031,54.593253 ] }, "properties": { "Month":"2016-08", "Location":"On or near Whitecliff Crescent", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.887872,54.597934 ] }, "properties": { "Month":"2016-08", "Location":"On or near Westminister Avenue", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.926474,54.592618 ] }, "properties": { "Month":"2016-08", "Location":"On or near Joy Street", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.938347,54.61425 ] }, "properties": { "Month":"2016-08", "Location":"On or near Cliftonville Road", "Crime type":"Vehicle crime" } }, { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ -5.976532,54.576008 ] }, "properties": { "Month":"2016-08", "Location":"On or near ", "Crime type":"Vehicle crime" } } ] };
roseKQ/gaffgame
data/crime.js
JavaScript
mit
115,862
/* Copyright (c) 2012. Adobe Systems Incorporated. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of Adobe Systems Incorporated nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ (function(a,b){function c(){}var d={version:0.1,inherit:function(a,b){var c=function(){};c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.prototype._super=b},ensureArray:function(){var b=[],c=arguments.length;c>0&&(b=c>1||!a.isArray(arguments[0])?a.makeArray(arguments):arguments[0]);return b},scopedFind:function(b,c,d,h){for(var d=" "+d+" ",l=[],b=a(b).find(c),c=b.length,h=a(h)[0],j=0;j<c;j++)for(var i=b[j],n=i;n;){if(n.className&&(" "+n.className+" ").indexOf(d)!==-1){n===h&& l.push(i);break}n=n.parentNode}return a(l)}};a.extend(c.prototype,{bind:function(b,c,d){return a(this).bind(b,c,d)},unbind:function(b,c){return a(this).unbind(b,c)},trigger:function(b,c){var d=a.Event(b);a(this).trigger(d,c);return d}});d.EventDispatcher=c;b.WebPro=d})(jQuery,window,document); (function(a,b){var c=1;b.ImageLoader=function(c){b.EventDispatcher.call();var f=this;this.options=a.extend({},this.defaultOptions,c);this._currentEntry=null;this._queue=[];this._isRunning=this._needsSort=!1;this._loader=new Image;this._loadFunc=function(){f._handleLoad()};this._loadErrorFunc=function(){f._handleError()};this._timeoutFunc=function(){f.trigger("wp-image-loader-timeout",this._currentEntry);f._loadNext()}};b.inherit(b.ImageLoader,b.EventDispatcher);a.extend(b.ImageLoader.prototype,{defaultOptions:{timeoutInterval:1E3}, add:function(d,f){if(d){urls=b.ensureArray(d);for(var g=0;g<urls.length;g++){var k=a.extend({reqId:c++,src:urls[g],width:0,height:0,priority:50,callback:null,data:null},f);this._queue.push(k);this._needsSort=!0;this.trigger("wp-image-loader-add",k)}this._isRunning&&!this._currentEntry&&this._loadNext()}},reprioritize:function(a,b){if(!(this._currentEntry&&this._currentEntry.src==a)){var c;for(c=0;c<this._queue.length;++c)if(this._queue[c].src==a)break;if(c!=0&&c<this._queue.length)this._queue=this._queue.splice(c, b?this._queue.length-c:1).concat(this._queue)}},start:function(){if(!this._isRunning)this._isRunning=!0,this._loadNext(),this.trigger("wp-image-loader-start")},stop:function(){if(this._isRunning)this._currentEntry&&this._queue.unshift(this._currentEntry),this._resetLoader(),this._isRunning=!1,this.trigger("wp-image-loader-stop")},clearQueue:function(){var a=this._isRunning;this.stop();this._queue.length=0;a&&this.start()},isQueueEmpty:function(){return this._queue.length==0},_loadNext:function(){var d; this._resetLoader();var a=this._queue;if(a.length){if(this._needsSort)d=this._queue=a.sort(function(a,b){var c=a.priority-b.priority;return c?c:a.reqId-b.reqId}),a=d,this._needsSort=!1;this._currentEntry=a=a.shift();var b=this._loader;b.onload=this._loadFunc;b.onerror=this._loadErrorFunc;b.src=a.src}},_resetLoader:function(){var a=this._loader;a.onload=null;a.onerror=null;this._currentEntry=a.src=null;if(this._timeoutTimerId)clearTimeout(this._timeoutTimerId),this._timeoutTimerId=0},_handleLoad:function(){var a= this._loader,b=this._currentEntry;b.width=a.width;b.height=a.height;b.callback&&b.callback(b.src,b.width,b.height,b.data);this.trigger("wp-image-loader-load-success",b);this._loadNext()},_handleError:function(){this.trigger("wp-image-loader-load-error",this._currentEntry);this._loadNext()}})})(jQuery,WebPro,window,document); (function(a,b){function c(){b.EventDispatcher.call(this);this._initialize.apply(this,arguments)}b.inherit(c,b.EventDispatcher);a.extend(c.prototype,{defaultOptions:{},_widgetName:"Widget",_initialize:function(){var b;this.plugins=[];var c=this.trigger("before-setup");c.isDefaultPrevented()||(b=this._setUp.apply(this,arguments),this.trigger("setup"));c=this.trigger("before-init-plugins");c.isDefaultPrevented()||(this._initializePlugins(b),this.trigger("init-plugins"));this.options=a.extend({},this.defaultOptions, b);c=this.trigger("before-extract-data");c.isDefaultPrevented()||(this._extractData(),this.trigger("extract-data"));c=this.trigger("before-transform-markup");c.isDefaultPrevented()||(this._transformMarkup(),this.trigger("transform-markup"));c=this.trigger("before-attach-behavior");c.isDefaultPrevented()||(this._attachBehavior(),this.trigger("attach-behavior"));c=this.trigger("before-ready");c.isDefaultPrevented()||(this._ready(),this.trigger("ready"))},_setUp:function(b,c){this.$element=a(b);return c}, _initializePlugins:function(a){for(var a=a||{},b=((typeof a.useDefaultPlugins==="undefined"||a.useDefaultPlugins)&&this.defaultPlugins?this.defaultPlugins:[]).concat(a.plugins||[]),b=b.sort(function(a,b){a=typeof a.priority==="number"?a.priority:50;b=typeof b.priority==="number"?b.priority:50;return a-b}),c=0;c<b.length;c++){var k=b[c];k&&k.initialize&&k.initialize(this,a)}this.plugins=b},_extractData:function(){},_transformMarkup:function(){},_attachBehavior:function(){},_ready:function(){}});b.Widget= c;b.widget=function(c,f,g){var k=g&&f||b.Widget,g=g||f||{},f=function(){k.apply(this,arguments);this._widgetName=c};b.inherit(f,k);a.extend(f.prototype,g);f.prototype.defaultOptions=a.extend({},k.prototype.defaultOptions,g.defaultOptions);var g=c.split("."),h=g.length;namespace=h>1&&g[0]||"Widget";c=g[h-1];b[namespace][c]=f}})(jQuery,WebPro,window,document); (function(a,b){b.widget("Widget.Button",b.Widget,{defaultOptions:{hoverClass:"wp-button-hover",activeClass:"wp-button-down",disabledClass:"wp-button-disabled",disabled:!1,callback:null},_attachBehavior:function(){var b=this,d=function(f){b.$element.removeClass(b.options.activeClass);!b.options.disabled&&b.options.callback&&b.mouseDown&&b.options.callback.call(this,f);a(b.$element).off("mouseup pointerup",d);b.mouseDown=!1};this.mouseDown=!1;this.$element.on("mouseover",function(){b.options.disabled|| b.$element.addClass(b.options.hoverClass+(b.mouseDown?" "+b.options.activeClass:""))}).on("mouseleave",function(){b.$element.removeClass(b.options.hoverClass+" "+b.options.activeClass);a(b.$element).off("mouseup",d)}).on("mousedown pointerdown",function(){if(!b.options.disabled)b.mouseDown=!0,b.$element.addClass(b.options.activeClass),a(b.$element).on("mouseup pointerup",d)});this.disabled(this.options.disabled)},disabled:function(a){if(typeof a==="boolean")this.options.disabled=a,this.$element[a? "addClass":"removeClass"](this.options.disabledClass);return this.options.disabled}});a.fn.wpButton=function(a){this.each(function(){new b.Widget.Button(this,a)});return this}})(jQuery,WebPro,window,document); (function(a,b){b.widget("Widget.RadioGroup",b.Widget,{_widgetName:"radio-group",defaultOptions:{defaultIndex:0,hoverClass:"wp-radio-hover",downClass:"wp-radio-down",disabledClass:"wp-radio-disabled",checkedClass:"wp-radio-checked",disabled:!1,toggleStateEnabled:!1},_attachBehavior:function(){var a=this;this.buttons=[];this.activeElement=null;this.activeIndex=-1;this.$element.each(function(){a.buttons.push(a._addButtonBehavior(this))});this.disabled(this.options.disabled)},_addButtonBehavior:function(a){var d= this,f=new b.Widget.Button(a,{hoverClass:this.options.hoverClass,downClass:this.options.downClass,disabledClass:this.options.disabledClass,callback:function(b){return d._handleClick(b,f,a)}});return f},_handleClick:function(a,b,f){this.options.disabled||this.checkButton(f)},_getElementIndex:function(b){return b?a.inArray(b,this.$element.get()):-1},_getElementByIndex:function(a){return a>=0?this.$element.eq(a)[0]:null},_getElement:function(a){return typeof a==="number"?this._getElementByIndex(a):a}, checkButton:function(b){var b=this._getElement(b),d=this.activeElement,f=this.options.checkedClass;b!==d?(d&&a(d).removeClass(f),b&&a(b).addClass(f)):this.options.toggleStateEnabled&&b&&(a(b).removeClass(f),b=null);this.activeElement=b;this.activeIndex=this._getElementIndex(b)},disabled:function(b){if(typeof b==="boolean")this.disabled=b,a.each(this.buttons,function(){this.disabled(b)});return this.options.disabled}});a.fn.wpRadioGroup=function(a){new b.Widget.RadioGroup(this,a);return this}})(jQuery, WebPro,window,document); (function(a,b){b.widget("Widget.TabGroup",b.Widget.RadioGroup,{defaultOptions:{defaultIndex:0,hoverClass:"wp-tab-hover",downClass:"wp-tab-down",disabledClass:"wp-tab-disabled",checkedClass:"wp-tab-active",disabled:!1,toggleStateEnabled:!1},selectTab:function(a){this.checkButton(a)},checkButton:function(a){var b=this._getElement(a),f=this._getElementIndex(b),b={tab:b,tabIndex:f};this.trigger("wp-tab-before-select",b);this._super.prototype.checkButton.apply(this,arguments);this.trigger("wp-tab-select",b)}}); a.fn.wpTabGroup=function(a){new b.Widget.TabGroup(this,a);return this}})(jQuery,WebPro,window,document); (function(a,b){b.widget("Widget.PanelGroup",b.Widget,{_widgetName:"panel-group",defaultOptions:{defaultIndex:0,panelClass:"wp-panel",activeClass:"wp-panel-active",toggleStateEnabled:!1,tabGroups:null},_setUp:function(){var a=this;this.tabGroups=[];this._tabCallback=function(b,f){a._handleTabSelect(b,f)};this.showLock=0;this.tabDriver=null;return this._super.prototype._setUp.apply(this,arguments)},_attachBehavior:function(){this.activeElement=null;this.activeIndex=-1;this.$element.addClass(this.options.panelClass); var a=this.options.defaultIndex;typeof a==="number"&&a>=0&&this.showPanel(a);this.addTabGroup(this.options.tabGroups)},_getElementIndex:function(b){return b?a.inArray(b,this.$element.get()):-1},_getElementByIndex:function(a){return this.$element.eq(a)[0]},_getElement:function(a){return typeof a==="number"?this._getElementByIndex(a):a},showPanel:function(b){if(!this.showLock){++this.showLock;var d=this._getElement(b),f=this.activeElement,g=this.options.activeClass;if(d)if(d!==f){b={panel:d,panelIndex:this._getElementIndex(d)}; this.trigger("wp-panel-before-show",b);f&&this.hidePanel(f);a(d).addClass(g);this.activeElement=d;this.activeIndex=this._getElementIndex(d);d=this.tabGroups;for(f=0;f<d.length;f++)g=d[f],g!==this.tabDriver&&g.selectTab(this.activeIndex);this.trigger("wp-panel-show",b)}else this.options.toggleStateEnabled&&this.hidePanel(d);--this.showLock}},hidePanel:function(b){if(b=typeof b==="number"?this.$element.eq(b)[0]:b){var d={panel:b,panelIndex:this._getElementIndex(b)};this.trigger("wp-panel-before-hide", d);a(b).removeClass(this.options.activeClass);if(b===this.activeElement)this.activeElement=null,this.activeIndex=-1;this.trigger("wp-panel-hide",d)}},_handleTabSelect:function(a,b){if(!this.showLock)this.tabDriver=a.target,this.showPanel(b.tabIndex),this.tabDriver=null},addTabGroup:function(c){if(c)for(var c=b.ensureArray(c),d=c.length,f=0;f<d;f++){var g=c[f];a.inArray(this.tabGroups,g)===-1&&(this.tabGroups.push(g),g.selectTab(this.activeIndex),g.bind("wp-tab-select",this._tabCallback))}},removeTabGroup:function(c){for(var c= b.ensureArray(c),d=c.length,f=0;f<d;f++){var g=c[f];sets=this.tabGroups;loc=a.inArray(sets,g);loc!==-1&&sets.splice(loc,1)}}});a.fn.wpPanelGroup=function(a){new b.Widget.PanelGroup(this,a);return this}})(jQuery,WebPro,window,document); (function(a,b){b.widget("Widget.Disclosure",b.Widget,{defaultOptions:{widgetClassName:"wp-disclosure-panels",tabClassName:"wp-disclosure-panels-tab",tabHoverClassName:"wp-disclosure-panels-tab-hover",tabDownClassName:"wp-disclosure-panels-tab-down",panelClassName:"wp-disclosure-panels-panel",tabActiveClassName:"wp-disclosure-panels-tab-active",panelActiveClassName:"wp-disclosure-panels-panel-active",defaultIndex:0,toggleStateEnabled:!1},_attachBehavior:function(){var a=this.$element[0],d=this.options.widgetClassName, f=b.scopedFind(a,"."+this.options.tabClassName,d,a),a=b.scopedFind(a,"."+this.options.panelClassName,d,a);this.tabs=new b.Widget.TabGroup(f,{hoverClass:this.options.tabHoverClassName,downClass:this.options.tabDownClassName,checkedClass:this.options.tabActiveClassName,toggleStateEnabled:this.options.toggleStateEnabled});this.panels=new b.Widget.PanelGroup(a,{panelClass:this.options.panelClassName,activeClass:this.options.panelActiveClassName,defaultIndex:this.options.defaultIndex,toggleStateEnabled:this.options.toggleStateEnabled}); this.panels.addTabGroup(this.tabs)}});b.widget("Widget.TabbedPanels",b.Widget.Disclosure,{defaultOptions:{widgetClassName:"wp-tabbed-panels-panels",tabClassName:"wp-tabbed-panels-panels-tab",tabHoverClassName:"wp-tabbed-panels-panels-tab-hover",tabDownClassName:"wp-tabbed-panels-panels-tab-down",tabActiveClassName:"wp-tabbed-panels-panels-tab-active",panelClassName:"wp-tabbed-panels-panels-panel",panelActiveClassName:"wp-tabbed-panels-panels-panel-active",toggleStateEnabled:!1}});b.widget("Widget.Accordion", b.Widget.Disclosure,{defaultOptions:{widgetClassName:"wp-accordion",tabClassName:"wp-accordion-tab",tabHoverClassName:"wp-accordion-tab-hover",tabDownClassName:"wp-accordion-tab-down",tabActiveClassName:"wp-accordion-tab-active",panelClassName:"wp-accordion-panel",panelActiveClassName:"wp-accordion-panel-active",toggleStateEnabled:!1}})})(jQuery,WebPro,window,document); (function(a,b){b.Widget.Disclosure.DisplayPropertyTransitionPlugin={defaultOptions:{},initialize:function(b,d){var f=this;a.extend(d,a.extend({},f.defaultOptions,d));b.bind("attach-behavior",function(){f._attachBehavior(b)})},_attachBehavior:function(a){var a=a.panels,b=a.$element,f=a.activeIndex;a.bind("wp-panel-show",function(a,b){b.panel.style.display="block"});a.bind("wp-panel-hide",function(a,b){b.panel.style.display="none"});b.each(function(a){this.style.display=a!==f?"none":"block"})}};b.Widget.Disclosure.AccordionTransitionPlugin= {defaultOptions:{transitionDirection:"vertical",transitionDuration:500,dispatchTransitionEvents:!0},initialize:function(b,d){var f=this;a.extend(d,a.extend({},f.defaultOptions,d));b.bind("attach-behavior",function(){f._attachBehavior(b)})},_attachBehavior:function(b){var d=this,f=b.panels,g=f.$element,k=f.activeIndex,h=b.options.transitionDirection,l=b.options.widgetClassName==="AccordionWidget"?a(g[0]).closest("*[data-rotate]"):null;if(l&&l.length>0)b.options.marginBottom=Muse.Utils.getCSSIntValue(l, "margin-bottom"),b.options.originalHeight=l[0].scrollHeight;b.options.rotatedAccordion=l;f.bind("wp-panel-show",function(a,g){d._showPanel(b,g)});f.bind("wp-panel-hide",function(a,g){d._hidePanel(b,g)});g.each(function(b){if(b!==k){a(this).css("overflow","hidden");if(h==="vertical"||h==="both")this.style.height="0";if(h==="horizontal"||h==="both")this.style.width="0"}})},_updateMarginBottomForRotatedAccordion:function(a){a.options.rotatedAccordion.css("margin-bottom",Math.round(a.options.marginBottom- (a.options.rotatedAccordion[0].scrollHeight-a.options.originalHeight))+"px")},_transitionPanel:function(b,d,f){a("body").trigger("wp-page-height-change",d-b);if((b=f.options.rotatedAccordion)&&b.length>0){if(f.options.originalHeight==0&&"undefined"!==typeof d)f.options.marginBottom=Muse.Utils.getCSSIntValue(b,"margin-bottom"),f.options.originalHeight=b[0].scrollHeight;this._updateMarginBottomForRotatedAccordion(f)}},_showPanel:function(b,d){var f=b.options,g=f.transitionDirection,k=a(d.panel),h={}, l=f.dispatchTransitionEvents,j=this,i=k.height(),n=function(a){a=parseInt(a.elem.style.height);j._transitionPanel(i,a,b);i=a};if(g==="vertical"||g==="both")h.height=k[0].scrollHeight+"px";if(g==="horizontal"||g==="both")h.width=k[0].scrollWidth+"px";k.stop(!0,!0).queue("animationFrameFx",a.animationFrameFx).animate(h,{duration:f.transitionDuration,progress:l?n:null,queue:"animationFrameFx",complete:function(){var a={overflow:""};if(g==="vertical"||g==="both")a.height="auto";if(g==="horizontal"||g=== "both")a.width="auto";k.css(a);(a=b.options.rotatedAccordion)&&a.length>0&&j._updateMarginBottomForRotatedAccordion(b)}}).dequeue("animationFrameFx")},_hidePanel:function(b,d){var f=b.options,g=f.transitionDirection,k=a(d.panel),h={},l=f.dispatchTransitionEvents,j=this,i=k.height(),n=function(a){a=parseInt(a.elem.style.height);j._transitionPanel(i,a,b);i=a};if(g==="vertical"||g==="both")h.height="0";if(g==="horizontal"||g==="both")h.width="0";k.stop(!0,!0).queue("animationFrameFx",a.animationFrameFx).animate(h, {duration:f.transitionDuration,queue:"animationFrameFx",progress:l?n:null,complete:function(){k.css("overflow","hidden");var a=b.options.rotatedAccordion;a&&a.length>0&&j._updateMarginBottomForRotatedAccordion(b)}}).dequeue("animationFrameFx")}}})(jQuery,WebPro,window,document); (function(a,b){b.widget("Widget.SlideShowBase",b.Widget,{_widgetName:"slideshow-base",defaultOptions:{displayInterval:6E3,autoPlay:!1,loop:!0,playOnce:!1},_setUp:function(){var a=this;this._ssTimer=0;this._ssTimerTriggered=!1;this._ssTimerCallback=function(){a._ssTimerTriggered=!0;a.next();a._ssTimerTriggered=!1};return b.Widget.prototype._setUp.apply(this,arguments)},_ready:function(){this.options.autoPlay&&this.play()},play:function(a){e=this.trigger("wp-slideshow-before-play");e.isDefaultPrevented()|| (this._startTimer(!1,a),this.trigger("wp-slideshow-play"))},stop:function(){e=this.trigger("wp-slideshow-before-stop");e.isDefaultPrevented()||(this._stopTimer(),this.trigger("wp-slideshow-stop"))},isPlaying:function(){return this._ssTimer!==0},_startTimer:function(a,b){this._stopTimer();var f=b?0:this.options.displayInterval;a&&(f+=this.options.transitionDuration);this._ssTimer=setTimeout(this._ssTimerCallback,f)},_stopTimer:function(){this._ssTimer&&clearTimeout(this._ssTimer);this._ssTimer=0}, _executeCall:function(a,b){e=this.trigger("wp-slideshow-before-"+a);e.isDefaultPrevented()||(this["_"+a].apply(this,b)&&this.stop(),this.isPlaying()&&this._startTimer(!0),this.trigger("wp-slideshow-"+a))},first:function(){return this._executeCall("first",arguments)},last:function(){return this._executeCall("last",arguments)},previous:function(){return this._executeCall("previous",arguments)},next:function(){return this._executeCall("next",arguments)},goTo:function(){return this._executeCall("goTo", arguments)},close:function(){return this._executeCall("close",arguments)},_first:function(){},_last:function(){},_previous:function(){},_next:function(){},_goTo:function(){},_close:function(){}})})(jQuery,WebPro,window,document); (function(a,b){b.widget("Widget.ContentSlideShow",b.Widget.SlideShowBase,{_widgetName:"content-slideshow",defaultOptions:{slideshowClassName:"wp-slideshow",clipClassName:"wp-slideshow-clip",viewClassName:"wp-slideshow-view",slideClassName:"wp-slideshow-slide",slideLinkClassName:"wp-slideshow-slide-link",firstBtnClassName:"wp-slideshow-first-btn",lastBtnClassName:"wp-slideshow-last-btn",prevBtnClassName:"wp-slideshow-prev-btn",nextBtnClassName:"wp-slideshow-next-btn",playBtnClassName:"wp-slideshow-play-btn", stopBtnClassName:"wp-slideshow-stop-btn",closeBtnClassName:"wp-slideshow-close-btn",playingClassName:"wp-slideshow-playing"},_findWidgetElements:function(a){var d=this.$element[0];return b.scopedFind(d,a,this.options.slideshowClassName,d)},_attachBtnHandler:function(a,b){var f=this;this["$"+b+"Btn"]=this._findWidgetElements("."+a).bind("click",function(a){f[b]();a.preventDefault()})},_getAjaxSrcForImage:function(a){return a.data("src")},_reprioritizeImageLoadingIfRequired:function(b){!this._isLoaded(b)&& this._cssilLoader&&!this._cssilLoader.isQueueEmpty()&&(b=a(this.slides.$element[b]),this._cssilLoader.reprioritize(this._getAjaxSrcForImage(b.is("img")?b:b.find("img")),this.isPlaying()))},_attachBehavior:function(){var a=this,d=this.options;this._super.prototype._attachBehavior.call(this);this._panelShowCallback=function(){a._ssTimerTriggered||a.isPlaying()&&a._startTimer(!1)};this.$element.addClass(d.slideshowClassName);var f=this._findWidgetElements("."+d.slideClassName),g=this._findWidgetElements("."+ d.slideLinkClassName),k=d.event==="click"&&d.deactivationEvent==="mouseout_click";this.slides=new b.Widget.PanelGroup(f,{defaultIndex:d.defaultIndex||0,toggleStateEnabled:k});this.slides.bind("wp-panel-show",this._panelShowCallback);this.tabs=null;if(g.length)this.tabs=new b.Widget.TabGroup(g,{defaultIndex:d.defaultIndex||0,toggleStateEnabled:k}),this.slides.addTabGroup(this.tabs);this.slides.bind("wp-panel-before-show",function(b,g){a._reprioritizeImageLoadingIfRequired(g.panelIndex)});this._attachBtnHandler(d.firstBtnClassName, "first");this._attachBtnHandler(d.lastBtnClassName,"last");this._attachBtnHandler(d.prevBtnClassName,"previous");this._attachBtnHandler(d.nextBtnClassName,"next");this._attachBtnHandler(d.playBtnClassName,"play");this._attachBtnHandler(d.stopBtnClassName,"stop");this._attachBtnHandler(d.closeBtnClassName,"close");this.bind("wp-slideshow-play",function(){this.$element.addClass(d.playingClassName)});this.bind("wp-slideshow-stop",function(){this.$element.removeClass(d.playingClassName)})},_first:function(){this.slides.showPanel(0)}, _last:function(){var a=this.slides;a.showPanel(a.$element.length-1)},_previous:function(){var a=this.slides,b=a.$element.length,f=a.activeIndex,b=(f<1?b:f)-1;!this.options.loop&&0==f?this.isPlaying()&&this.stop():a.showPanel(b)},_next:function(){var a=this.slides,b=a.activeIndex,f=(b+1)%a.$element.length;!this.options.loop&&0==f?this.isPlaying()&&this.stop():this.options.playOnce&&0==f&&this.isPlaying()?this.stop():(!this.isPlaying()||this._isLoaded(b)&&this._isLoaded(f))&&a.showPanel(f)},_goTo:function(){var a= this.slides;a.showPanel.apply(a,arguments)},_close:function(){var a=this.slides;a.hidePanel(a.activeElement)},_isLoaded:function(b){if(this._csspIsImageSlideShow&&(b=a(this.slides.$element[b]),b=b.is("img")?b:b.find("img"),b.length>0&&(b.hasClass(this.options.imageIncludeClassName)||!b[0].complete)))return!1;return!0}})})(jQuery,WebPro,window,document); (function(a,b,c,d,f){b.Widget.ContentSlideShow.fadingTransitionPlugin={defaultOptions:{transitionDuration:500},initialize:function(b,c){var d=this;a.extend(c,a.extend({},d.defaultOptions,c));b.bind("attach-behavior",function(){d.attachBehavior(b)})},attachBehavior:function(b){var k=this,h=b.slides,l=h.$element,j=h.activeIndex,i=b._findWidgetElements("."+b.options.viewClassName);h.bind("wp-panel-show",function(c,d){k._showElement(b,a(d.panel));b.options.contentLayout_runtime==="stack"&&k._showElement(b, b.$closeBtn)}).bind("wp-panel-hide",function(c,d){k._hideElement(b,a(d.panel))});b.options.contentLayout_runtime==="stack"&&b.bind("wp-slideshow-close",function(){k._hideElement(b,b.$closeBtn)});for(var n=0;n<l.length;n++)if(n!==j)l[n].style.display="none";if(b.options.elastic==="fullWidth"){var o=a(c),p=a(d.body),q=function(c){c===f&&(c=Math.max(o.width(),parseInt(p.css("min-width"))));b.options.contentLayout_runtime!=="lightbox"&&i.css("left",i.position().left-i.offset().left);i.width(c);k._showElement(b, a(h.activeElement))};q();for(n=0;n<l.length;n++){var m=a(l[n]);m.width("100%");m.addClass("borderbox")}if(b.options.contentLayout_runtime==="lightbox")b._fstpPositionSlides=q;else o.on("orientationchange resize",function(){q()})}j===-1&&b.options.contentLayout_runtime==="stack"&&b.$closeBtn.hide();if(Muse.Browser.Features.Touch&&b.options.enableSwipe===!0){var r=b.options.transitionDuration;b._ftpSwipeNoInterrupt=!1;l.each(function(){var c=a(this);c.data("opacity",c.css("opacity"));var d=Muse.Utils.getCanvasDirection(c, "horizontal"),h=d.dir==="horizontal",f=d.reverse;if(d=c.swipe.defaults.excludedElements){var d=d.split(/\s*,\s*/),j=d.indexOf("a");if(0<=j)d.splice(j,1),c.swipe.defaults.excludedElements=d.join(", ")}c.swipe({triggerOnTouchEnd:!0,allowPageScroll:h?"vertical":"horizontal",threshold:75,swipeStatus:function(a,c,d,j){b.stop();if(c=="move"&&(h&&(d=="left"||d=="right")||!h&&(d=="up"||d=="down")))k._scrollTo(b,-1,j*(!f&&(d=="left"||d=="up")||f&&(d=="right"||d=="down")?1:-1),0);else if(c=="cancel")k._scrollTo(b, b.slides.activeIndex,0,r);else if(c=="end"){a=b.slides.activeIndex;c=-1;if(h&&(d=="right"&&!f||d=="left"&&f)||!h&&(d=="down"&&!f||d=="up"&&f))c=a-1<0?l.length-1:a-1;else if(h&&(d=="left"&&!f||d=="right"&&f)||!h&&(d=="up"&&!f||d=="down"&&f))c=a+1>l.length-1?0:a+1;c!=-1&&k._scrollTo(b,c,0,r)}}})})}},_showElement:function(a,b){var c=!1,d=function(){c||(c=!0,b.show().css("opacity",""))},f=setTimeout(d,a.options.transitionDuration+10);b.stop(!1,!0).fadeIn(a.options.transitionDuration,function(){clearTimeout(f); d()})},_hideElement:function(a,b){var c=!1,d=function(){c||(c=!0,b.hide().css("opacity",""))},f=setTimeout(d,a.options.transitionDuration+10);b.stop(!1,!0).fadeOut(a.options.transitionDuration,function(){clearTimeout(f);d()})},_scrollTo:function(b,c,d,f){if(!b._ftpSwipeNoInterrupt){var j=b.slides.$element,i=b.slides.activeIndex,n=c==-1;c==-1&&(c=d<0?i-1<0?j.length-1:i-1:i+1>j.length-1?0:i+1);var o=a(j[i]),p=a(j[c]);if(!n&&d==0||i==c){b._ftpSwipeNoInterrupt=!0;var q=0,m=!1,r=function(){if(!m&&(m=!0, p.show().css("opacity",""),c!=i&&b.slides.showPanel(c),++q==j.length))b._ftpSwipeNoInterrupt=!1};if(p.css("opacity")!=p.data("opacity")){var t=setTimeout(r,f+10);p.stop(!1,!0).animate({opacity:p.data("opacity")},f,function(){clearTimeout(t);r()})}else r();j.each(function(d){var h=a(this),o=!1,i=function(){if(!o&&(o=!0,h.hide().css("opacity",""),++q==j.length))b._ftpSwipeNoInterrupt=!1},p;d!=c&&(h.css("display")!="none"&&h.css("opacity")!=0?(p=setTimeout(i,f+10),h.stop(!1,!0).animate({opacity:0},f, function(){clearTimeout(p);i()})):i())})}else d=Math.abs(d),n=o.width(),d>n&&(d=n),d=p.data("opacity")*(d/n),n=o.data("opacity")*(1-d),o.stop(!1,!0).animate({opacity:n},f),p.stop(!1,!0).show().animate({opacity:d},f)}}};b.Widget.ContentSlideShow.filmstripTransitionPlugin={defaultOptions:{transitionDuration:500,transitionStyle:"horizontal"},initialize:function(b,c){var d=this;a.extend(c,a.extend({},d.defaultOptions,c));b.bind("attach-behavior",function(){d.attachBehavior(b)})},attachBehavior:function(b){var k= this,h=a(c),l=a(d.body),j=function(){return i.elastic==="fullWidth"?Math.max(h.width(),parseInt(l.css("min-width"))):q.width()},i=b.options,n=i.transitionStyle==="horizontal",o=b.slides,p=o.$element,q=b._findWidgetElements("."+i.clipClassName),m=b._findWidgetElements("."+i.viewClassName),r=j(),t=q.height(),x={top:"0",left:"0"},y=q.css("position");y!=="absolute"&&y!=="fixed"&&i.elastic!=="fullScreen"&&q.css("position","relative");m.css("position")!=="absolute"&&(x.position="relative");b._fstp$Clip= q;b._fstp$View=m;b._fstpStyleProp=n?"left":"top";b._fstpStylePropZero=n?"top":"left";o.bind("wp-panel-show",function(a,c){k._goToSlide(b,c.panel,i.transitionDuration);b.options.contentLayout_runtime==="stack"&&b.$closeBtn.stop(!0).fadeIn(i.transitionDuration)});b.options.contentLayout_runtime==="stack"&&b.bind("wp-slideshow-close",function(){q.css({opacity:0.99}).stop(!0).animate({opacity:0},{queue:!1,duration:i.transitionDuration,complete:function(){x[b._fstpStyleProp]=(n?q.width():q.height())+"px"; x[b._fstpStylePropZero]="0";m.css(x);q.css({opacity:""})}});b.$closeBtn.stop(!0).fadeOut(i.transitionDuration)});b._fstpRequestType=null;b.bind("wp-slideshow-before-previous wp-slideshow-before-next",function(a){b._fstpRequestType=a.type.replace(/.*-/,"");b._fstpOldActiveIndex=b.slides.activeIndex}).bind("wp-slideshow-previous wp-slideshow-next",function(){b._fstpRequestType=null;b._fstpOldActiveIndex=-1});var F=function(a,c){if(a===f||c===f)a=j(),c=q.height();i.elastic==="fullWidth"&&(c=q.height(), q.width(a),i.contentLayout_runtime!=="lightbox"&&q.css("left",q.position().left-q.offset().left),m.width(a));for(var d=0,h=n?a:c,l=b._fstpStyleProp,r=b._fstpStylePropZero,t=0;t<p.length;t++){var v=p[t].style;v[r]="0";v[l]=d+"px";v.margin="0";v.position="absolute";d+=h}k._goToSlide(b,o.activeElement,0);return d},y=F();if(i.elastic==="fullWidth")for(var v=0;v<p.length;v++){var C=a(p[v]);C.width("100%");C.addClass("borderbox")}if(i.elastic!=="off")if(i.contentLayout_runtime==="lightbox")b._fstpPositionSlides= F;else h.on("orientationchange resize",function(){F()});else x[n?"width":"height"]=y+"px",x[n?"height":"width"]=(n?t:r)+"px";o.activeElement||(x[b._fstpStyleProp]=(n?r:t)+"px",x[b._fstpStylePropZero]="0",b.options.contentLayout_runtime==="stack"&&b.$closeBtn.hide());x.overflow="visible";m.css(x);k._goToSlide(b,o.activeElement,i.transitionDuration)},_goToSlide:function(b,c,d){if(b){var f=a(c),j=b._fstp$View,i=b._fstpStyleProp,n=i==="left"?"offsetLeft":"offsetTop",o=i==="left"?"offsetWidth":"offsetHeight", p=c?-c[n]:b._fstp$Clip[0][o],q={};q[i]=p+"px";var m=b._fstpRequestType,r=b._fstpOldActiveIndex;if(m&&r!==-1){var t=b.slides.activeIndex,x=b.slides.$element.length-1;if(t!==r){var y=0;m==="previous"&&r===0&&t===x?y=-c[o]:m==="next"&&r===x&&t===0&&(b=b.slides.$element[r],y=b[n]+b[o]);y&&(q[i]=-y+"px",f.css(i,y+"px"))}}j.stop(!1,!0).animate(q,d,function(){y&&(f.css(i,-p+"px"),j.css(i,p+"px"))})}}};b.Widget.ContentSlideShow.alignPartsToPagePlugin={defaultOptions:{alignPartToPageClassName:"wp-slideshow-align-part-to-page"}, initialize:function(b,c){var d=this;a.extend(c,a.extend({},d.defaultOptions,c));b.bind("attach-behavior",function(){d.attachBehavior(b)})},attachBehavior:function(b){if(!("fullWidth"!==b.options.elastic||!b.$element.hasClass("align_parts_to_page")||"fixed"!==b.$element.css("position")||b.options.contentLayout_runtime==="lightbox")){var d=a(c),f=a("#page"),l=b.options,j=function(){var c=f.offset().left+"px";a("."+l.alignPartToPageClassName,b.$element).each(function(){a(this).css("margin-left",c)})}; b.$element.children().each(function(){var b=a(this);0<a("."+l.viewClassName,b).length||b.addClass(l.alignPartToPageClassName)});j();d.on("orientationchange resize",function(){j()})}}};b.Widget.ContentSlideShow.swipeTransitionPlugin={defaultOptions:{transitionDuration:500,transitionStyle:"horizontal"},initialize:function(b,c){var d=this;a.extend(c,a.extend({},d.defaultOptions,c));b.bind("attach-behavior",function(){d.attachBehavior(b)})},attachBehavior:function(b){var k=this,h=a(c),l=a(d.body),j=function(){return i.elastic=== "fullWidth"?Math.max(h.width(),parseInt(l.css("min-width"))):q.width()},i=b.options,n=i.transitionStyle==="horizontal",o=b.slides,p=o.$element,q=b._findWidgetElements("."+i.clipClassName),m=b._findWidgetElements("."+i.viewClassName),r=j(),t=q.height(),x=function(a,b){if(a===f||b===f)a=j(),b=q.height();return n?a:b},y=x();viewProps={top:"0",left:"0"};q.css("position")!=="absolute"&&i.elastic!=="fullScreen"&&q.css("position","relative");m.css("position")!=="absolute"&&(viewProps.position="relative"); b._fstp$Clip=q;b._fstp$View=m;b._fstpStyleProp=n?"left":"top";b._fstpStylePropZero=n?"top":"left";o.bind("wp-panel-show",function(){var a=b.slides.activeIndex*x(),c=b.options.transitionDuration;a==0&&b.slides.activeIndex==0&&!i.shuffle&&b.isPlaying()&&(c=0);k._scrollTo(b,a,c);b.options.contentLayout_runtime==="stack"&&b.$closeBtn.stop(!0).fadeIn(c)});b.options.contentLayout_runtime==="stack"&&b.bind("wp-slideshow-close",function(){q.css({opacity:0.99}).stop(!0).animate({opacity:0},{queue:!1,duration:i.transitionDuration, complete:function(){k._scrollTo(b,-x(),0);q.css({opacity:""})}});b.$closeBtn.stop(!0).fadeOut(b.options.transitionDuration)});b._fstpRequestType=null;b.bind("wp-slideshow-before-previous wp-slideshow-before-next",function(a){b._fstpRequestType=a.type.replace(/.*-/,"");b._fstpOldActiveIndex=b.slides.activeIndex}).bind("wp-slideshow-previous wp-slideshow-next",function(){b._fstpRequestType=null;b._fstpOldActiveIndex=-1});var F=function(a,c){if(a===f||c===f)a=j(),c=q.height();i.elastic==="fullWidth"&& (c=q.height(),q.width(a),i.contentLayout_runtime!=="lightbox"&&q.css("left",q.position().left-q.offset().left),m.width(a));for(var d=0,h=n?a:c,l=b._fstpStyleProp,r=b._fstpStylePropZero,t=0;t<p.length;t++){var s=p[t].style;s[r]="0";s[l]=d+"px";s.margin="0";s.position="absolute";d+=h}m.css(n?"width":"height",d);k._scrollTo(b,o.activeIndex*h,0);return d},v=F();if(i.elastic==="fullWidth")for(var C=0;C<p.length;C++){var z=a(p[C]);z.width("100%");z.addClass("borderbox")}if(i.elastic!=="off")if(i.lightboxEnabled_runtime)b._fstpPositionSlides= F;else h.on("orientationchange resize",function(){F()});else viewProps[n?"width":"height"]=v+"px",viewProps[n?"height":"width"]=(n?t:r)+"px";viewProps.overflow="visible";m.css(viewProps);var r=Muse.Utils.getCanvasDirection(m,i.transitionStyle),s=r.dir==="horizontal",E=r.reverse,M=b.options.transitionDuration;if(r=m.swipe.defaults.excludedElements)if(r=r.split(/\s*,\s*/),t=r.indexOf("a"),0<=t)r.splice(t,1),m.swipe.defaults.excludedElements=r.join(", ");m.swipe({triggerOnTouchEnd:!0,allowPageScroll:s? "vertical":"horizontal",threshold:75,swipeStatus:function(a,c,d,f){b.stop();y=x();if(c=="move"&&(s&&(d=="left"||d=="right")||!s&&(d=="up"||d=="down")))d=y*b.slides.activeIndex+f*(!E&&(d=="left"||d=="up")||E&&(d=="right"||d=="down")?1:-1),k._scrollTo(b,d,0);else if(c=="cancel")d=y*b.slides.activeIndex,k._scrollTo(b,d,M);else if(c=="end"){a=-1;if(s&&(d=="right"&&!E||d=="left"&&E)||!s&&(d=="down"&&!E||d=="up"&&E))a=Math.max(b.slides.activeIndex-1,0);else if(s&&(d=="left"&&!E||d=="right"&&E)||!s&&(d== "up"&&!E||d=="down"&&E))a=Math.min(b.slides.activeIndex+1,m.children().length-1);a!=-1&&(d=y*a,k._scrollTo(b,d,M),a!=b.slides.activeIndex&&b.slides.showPanel(a))}}});o.activeElement?(r=o.activeIndex*y,k._scrollTo(b,r,0)):(k._scrollTo(b,-y,0),b.options.contentLayout_runtime==="stack"&&b.$closeBtn.hide())},_scrollTo:function(a,b,c){var g;var d=Muse.Browser.Features.checkCSSFeature("transition-duration"),f=Muse.Browser.Features.checkCSSFeature("transform");if(!(d===!1||f===!1)){var i=a._fstp$View.get(0); i.style[(d===!0?"":"-"+d.toLowerCase()+"-")+"transition-duration"]=(c/1E3).toFixed(1)+"s";b=-b;g=(c=a.options.transitionStyle==="horizontal")?b:0,a=g;b=c?0:b;f=(f===!0?"":"-"+f.toLowerCase()+"-")+"transform";c="translate3d("+a+"px, "+b+"px, 0px)";d=i.style[f];i.style[f]=c;i.style[f]===d&&d!==c&&(i.style[f]="translate("+a+"px, "+b+"px)")}}};b.Widget.ContentSlideShow.slideImageIncludePlugin={defaultOptions:{imageIncludeClassName:"wp-slideshow-slide-image-include",slideLoadingClassName:"wp-slideshow-slide-loading"}, initialize:function(c,d){var f=this;a.extend(d,a.extend({},f.defaultOptions,d));c._cssilLoader=new b.ImageLoader;c.bind("attach-behavior",function(){f._attachBehavior(c)})},_attachBehavior:function(a){for(var b=this,c=a._cssilLoader,d=a._findWidgetElements("."+a.options.slideClassName),f=d.length,i="."+a.options.imageIncludeClassName,n=a.options.slideLoadingClassName,o=function(c,d,f,h){b._handleImageLoad(a,c,d,f,h)},p=0;p<f;p++){var q=d.eq(a._shuffleArray?a._shuffleArray[p]:p),m=q.is("img")?q:q.find(i), r=m[0];if(r){var t=a._getAjaxSrcForImage(m)||r.href;if(t)m={width:m.data("width"),height:m.data("height"),$ele:m,$slide:q},r.style.visibility="hidden",c.add(t,{callback:o,data:m}),q.addClass(n)}}a._cssilLoader.start()},_handleImageLoad:function(a,b,c,d,f){var i=f.$ele,n=i[0];n.src=b;a.options.elastic!=="off"?(i.data("imageWidth",c),i.data("imageHeight",d),a._csspPositionImage(n,a.options.heroFitting,a.options.elastic,c,d)):(n.width=f.width||c,n.height=f.height||d);n.style.visibility="";i.removeClass(a.options.imageIncludeClassName); f.$slide.removeClass(a.options.slideLoadingClassName);a.isPlaying()&&a.slides.$element[a.slides.activeIndex]==f.$slide[0]&&a._startTimer(!1)}};b.Widget.ContentSlideShow.shufflePlayPlugin={defaultOptions:{randomDefaultIndex:!0},initialize:function(b,c){var d=this;a.extend(c,a.extend({},d.defaultOptions,c));b._shuffleArray=[];b._shuffleNextDict={};b._realNext=b._next;b._next=function(){d._handleNext(b)};b._shufflePlayCount=1;b.bind("before-attach-behavior",function(){d._reshuffle(b);if(c.randomDefaultIndex&& typeof c.defaultIndex==="undefined")b.options.defaultIndex=b._shuffleArray[0]})},_fisherYatesArrayShuffle:function(a){if(a&&a.length)for(var b=a.length;--b;){var c=Math.floor(Math.random()*(b+1)),d=a[c];a[c]=a[b];a[b]=d}},_reshuffle:function(a){var b=a._shuffleArray,c={},d=a.slides?a.slides.$element.length:a._findWidgetElements("."+a.options.slideClassName).length;if(b.length!==d)for(var f=b.length=0;f<d;f++)b[f]=f;this._fisherYatesArrayShuffle(b);for(f=0;f<d;f++)c[b[f]]=b[(f+1)%d];a._shuffleNextDict= c;a._shufflePlayCount=1},_handleNext:function(a){if(a.isPlaying()){var b=a.slides.activeIndex,c=a._shuffleNextDict[b]||0;a._isLoaded(b)&&a._isLoaded(c)&&(a._goTo(c),++a._shufflePlayCount>=a.slides.$element.length&&(this._reshuffle(a),(!a.options.loop||a.options.playOnce)&&a.stop()))}else a._realNext()}}})(jQuery,WebPro,window,document); (function(a,b,c){b.widget("Widget.Form",b.Widget,{_widgetName:"form",defaultOptions:{validationEvent:"blur",errorStateSensitivity:"low",ajaxSubmit:!0,fieldWrapperClass:"field",formErrorClass:"form-error",formSubmittedClass:"form-submitted",formDeliveredClass:"form-delivered",focusClass:"focus",notEmptyClass:"not-empty",emptyClass:"empty",validClass:"valid",invalidClass:"invalid",requiredClass:"required"},validationTypes:{"always-valid":/.*/,email:/^[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, alpha:/^[A-z\s]+$/,numeric:/^[0-9]+$/,phone:/^([0-9])?(\s)?(\([0-9]{3}\)|[0-9]{3}(\-)?)(\s)?[0-9]{3}(\s|\-)?[0-9]{4}(\s|\sext|\sx)?(\s)?[0-9]*$/,captcha:function(a){return a.data("captchaValid")},recaptcha:function(){if("undefined"==typeof Recaptcha)return!1;var a=Recaptcha.get_response();return a&&0<a.length},checkbox:function(){return!0},time:function(a){var a=a.find("input, textarea"),b=a.val().replace(/[^0-9:APM]/g,"");if(b.indexOf(":")!=-1&&b.match(/:/).length==1){var c=b.split(":"),k=parseInt(c[0]), c=parseInt(c[1]);if(k<0||k>24)return!0;if(c<0||c>59)return!0}else return!1;a.val(b);return!0}},_transformMarkup:function(){var b=this;b.hasCAPTCHA=!1;b.hasReCAPTCHA=!1;this.$element.find("."+this.options.fieldWrapperClass).each(function(){var c=a(this);switch(c.attr("data-type")){case "captcha":b.hasCAPTCHA=!0;c.find('input[name="CaptchaV2"]').remove();c.find('input[name="muse_CaptchaV2"]').attr("name","CaptchaV2");break;case "recaptcha":b.hasReCAPTCHA=!0}})},_extractData:function(){this.event=this.options.validationEvent; this.errorSensitivity=this.options.errorStateSensitivity;this.classNames={focus:this.options.focusClass,blur:this.options.emptyClass,keydown:this.options.notEmptyClass}},_attachBehavior:function(){var b=this;this.$element.find("input, textarea").each(function(){var c=a(this);c.val()!=""&&c.removeClass(b.options.emptyClass)});this.$element.find("."+this.options.fieldWrapperClass).each(function(){var c=a(this);c.attr("data-type")=="captcha"&&(c.data("captchaValid",!1),c.find('input[name="CaptchaV2"]').keyup(function(){var g= a(this).val(),k=c.find('input[name="CaptchaHV2"]').val();b._validateCaptcha(k,g,function(a){c.data("captchaValid",a);c.data("error-state")&&b.errorSensitivity=="high"&&b._validate(c)})}));c.find("input, textarea").val()!=""&&c.addClass(b.classNames.keydown)});this.$element.find("input, textarea").bind("focus blur keydown change propertychange",function(c){var g=b.classNames[c.type],k=b.classNames.focus,h=b.classNames.keydown,l=b.classNames.blur,j=a(this),i=j.closest("."+b.options.fieldWrapperClass); switch(c.type){case "focus":i.addClass(g).removeClass(l);break;case "blur":i.removeClass(k);j.val()==""&&i.addClass(g).removeClass(h);break;case "keydown":i.addClass(g).removeClass(l);break;case "change":case "propertychange":j.val()!=""?i.addClass(h).removeClass(l):i.addClass(l).removeClass(h)}});switch(this.event){case "blur":case "keyup":this.$element.find("."+this.options.fieldWrapperClass+" input, ."+this.options.fieldWrapperClass+" textarea").bind(this.event,function(){b._validate(a(this).closest("."+ b.options.fieldWrapperClass))});case "submit":this.$element.submit(function(c){var g=!0,k=b.$element.find("."+b.options.fieldWrapperClass).length-1;b.$element.find("."+b.options.fieldWrapperClass).each(function(h){if((g=b._validate(a(this))?g:!1)&&h==k&&b.options.ajaxSubmit)c.preventDefault(),b._submitForm();g||c.preventDefault()})})}},_validateCaptcha:function(b,c,g){c.length!=6?g(!1):a.get("/ValidateCaptcha.ashx",{key:b,answer:c},function(a){g(a=="true")})},_validateReCaptcha:function(b,c){a.get("/ValidateCaptcha.ashx", {key:Recaptcha.get_challenge(),answer:Recaptcha.get_response(),imageVerificationType:"recaptcha"},function(a){a=="true"?b():c()})},_submitForm:function(){var b=this,c=a("#ReCaptchaAnswer",b.$element),g=a("#ReCaptchaChallenge",b.$element);b.hasReCAPTCHA&&1==c.length&&1==g.length?(c.val(Recaptcha.get_response()),g.val(Recaptcha.get_challenge()),b._validateReCaptcha(function(){b._submitFormInternal()},function(){a("."+b.options.fieldWrapperClass,b.$element).each(function(){var c=a(this);c.attr("data-type")== "recaptcha"&&b._switchState("invalid",c)});Recaptcha.reload()})):b._submitFormInternal()},_submitFormInternal:function(){var b=this,f=this.options.formSubmittedClass,g=this.options.formDeliveredClass,k=this.options.formErrorClass,h=f+" "+g+" "+k,l=this.$element.find("input[type=submit], button");a.ajax({url:this.$element.attr("action"),type:"post",data:this.$element.serialize(),beforeSend:function(){b.$element.removeClass(h);b.$element.addClass(f);b.$element.find("."+b.options.fieldWrapperClass).removeClass(b.options.focusClass); l.attr("disabled","disabled")},complete:function(h){h&&(h.status>=400||h.responseText&&h.responseText.indexOf("<?php")>=0)&&alert("Form PHP script is missing from web server, or PHP is not configured correctly on your web hosting provider. Check if the form PHP script has been uploaded correctly, then contact your hosting provider about PHP configuration.");b.$element.removeClass(f);var i=null;if(h&&h.responseText)try{i=jQuery.parseJSON(h.responseText),i=i.FormProcessV2Response||i.FormResponse||i.MusePHPFormResponse|| i}catch(n){}if(i&&i.success){b.$element.addClass(g);if(i.redirect){c.location.href=i.redirect;return}b.$element[0].reset();b.hasCAPTCHA&&b.$element.find("input:not([type=submit]), textarea").each(function(){a(this).attr("disabled","disabled")})}else if(h=b._getFieldsWithError(i))for(i=0;i<h.length;i++)b._switchState("invalid",h[i]);else b.$element.addClass(k);b.hasCAPTCHA||l.removeAttr("disabled");b.hasReCAPTCHA&&Recaptcha.reload()}})},_getFieldsWithError:function(b){if(!b||!b.error||!b.error.fields|| !b.error.fields.length)return null;for(var c=[],g=0;g<b.error.fields.length;g++){var k=a('[name="'+b.error.fields[g].field+'"]',this.$element).parents("."+this.options.fieldWrapperClass);1==k.length&&c.push(k)}return c},_validate:function(a){var b=a.attr("data-type")||"always-valid",c=a.find("input, textarea"),k=this.validationTypes[b],b=a.attr("data-required")==="true",h="checkbox"==c.attr("type")?typeof c.attr("checked")==="undefined":c.val()=="",c=k instanceof RegExp?Boolean(c.val().match(k)): k(a);if(b&&h)return this._switchState("required",a);if(!c)return this._switchState("invalid",a);return this._switchState("valid",a)},_switchState:function(a,b){function c(){i._validate(b)}var k=b.attr("data-type"),h=this.options.validClass,l=this.options.invalidClass,j=this.options.requiredClass;b.removeClass(h+" "+l+" "+j);if(a=="required"||a=="invalid"){a=="invalid"?b.addClass(l):b.addClass(j);if("recaptcha"!=k&&this.errorSensitivity!="low"){var i=this,k=this.errorSensitivity=="high"?"keyup":"blur"; b.data("error-state")||(b.data("error-state",!0),b.find("input, textarea").bind(k,c))}return!1}b.data("error-state")&&(this.errorSensitivity=="high"?this.event!="keyup"&&b.data("error-state",!1).find("input, textarea").unbind("keyup",c):this.errorSensitivity=="medium"&&this.event!="blur"&&b.data("error-state",!1).find("input, textarea").unbind("blur",c));b.addClass(h);return!0}});a.fn.wpForm=function(a){new b.Widget.Form(this,a);return this}})(jQuery,WebPro,window,document); ;(function(){if(!("undefined"==typeof Muse||"undefined"==typeof Muse.assets)){var a=function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]==b)return c;return-1}(Muse.assets.required,"webpro.js");if(-1!=a){Muse.assets.required.splice(a,1);for(var a=document.getElementsByTagName("meta"),b=0,c=a.length;b<c;b++){var d=a[b];if("generator"==d.getAttribute("name")){"2014.3.2.295"!=d.getAttribute("content")&&Muse.assets.outOfDate.push("webpro.js");break}}}}})();
printzard/RAHOTAN
scripts/webpro.js
JavaScript
mit
45,435
<?php /* Unsafe sample input : get the field userData from the variable $_GET via an object Uses an email_filter via filter_var function construction : use of sprintf via a %s with simple quote */ /*Copyright 2015 Bertrand STIVALET Permission is hereby granted, without written agreement or royalty fee, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following three paragraphs appear in all copies of this software. IN NO EVENT SHALL AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. AUTHORS SPECIFICALLY DISCLAIM ANY WARRANTIES INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND AUTHORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.*/ class Input{ public function getInput(){ return $_GET['UserData'] ; } } $temp = new Input(); $tainted = $temp->getInput(); $sanitized = filter_var($tainted, FILTER_SANITIZE_EMAIL); if (filter_var($sanitized, FILTER_VALIDATE_EMAIL)) $tainted = $sanitized ; else $tainted = "" ; $query = sprintf("(&(objectCategory=person)(objectClass=user)(mail='%s'))", $tainted); //flaw $ds=ldap_connect("localhost"); $r=ldap_bind($ds); $sr=ldap_search($ds,"o=My Company, c=US", $query); ldap_close($ds); ?>
stivalet/PHP-Vulnerability-test-suite
Injection/CWE_90/unsafe/CWE_90__object-directGet__func_FILTER-CLEANING-email_filter__userByMail-sprintf_%s_simple_quote.php
PHP
mit
1,621
/* * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef CSSValuePool_h #define CSSValuePool_h #include "CSSPropertyNames.h" #include "CSSValueKeywords.h" #include "core/css/CSSInheritedValue.h" #include "core/css/CSSInitialValue.h" #include "core/css/CSSPrimitiveValue.h" #include "wtf/HashMap.h" #include "wtf/RefPtr.h" #include "wtf/text/AtomicStringHash.h" namespace WebCore { class CSSValueList; class CSSValuePool { WTF_MAKE_FAST_ALLOCATED; public: PassRefPtr<CSSValueList> createFontFaceValue(const AtomicString&); PassRefPtr<CSSPrimitiveValue> createFontFamilyValue(const String&); PassRefPtr<CSSInheritedValue> createInheritedValue() { return m_inheritedValue; } PassRefPtr<CSSInitialValue> createImplicitInitialValue() { return m_implicitInitialValue; } PassRefPtr<CSSInitialValue> createExplicitInitialValue() { return m_explicitInitialValue; } PassRefPtr<CSSPrimitiveValue> createIdentifierValue(CSSValueID identifier); PassRefPtr<CSSPrimitiveValue> createIdentifierValue(CSSPropertyID identifier); PassRefPtr<CSSPrimitiveValue> createColorValue(unsigned rgbValue); PassRefPtr<CSSPrimitiveValue> createValue(double value, CSSPrimitiveValue::UnitTypes); PassRefPtr<CSSPrimitiveValue> createValue(const String& value, CSSPrimitiveValue::UnitTypes type) { return CSSPrimitiveValue::create(value, type); } PassRefPtr<CSSPrimitiveValue> createValue(const Length& value, const RenderStyle&); PassRefPtr<CSSPrimitiveValue> createValue(const Length& value, float zoom) { return CSSPrimitiveValue::create(value, zoom); } template<typename T> static PassRefPtr<CSSPrimitiveValue> createValue(T value) { return CSSPrimitiveValue::create(value); } private: CSSValuePool(); RefPtr<CSSInheritedValue> m_inheritedValue; RefPtr<CSSInitialValue> m_implicitInitialValue; RefPtr<CSSInitialValue> m_explicitInitialValue; RefPtr<CSSPrimitiveValue> m_identifierValueCache[numCSSValueKeywords]; typedef HashMap<unsigned, RefPtr<CSSPrimitiveValue> > ColorValueCache; ColorValueCache m_colorValueCache; RefPtr<CSSPrimitiveValue> m_colorTransparent; RefPtr<CSSPrimitiveValue> m_colorWhite; RefPtr<CSSPrimitiveValue> m_colorBlack; static const int maximumCacheableIntegerValue = 255; RefPtr<CSSPrimitiveValue> m_pixelValueCache[maximumCacheableIntegerValue + 1]; RefPtr<CSSPrimitiveValue> m_percentValueCache[maximumCacheableIntegerValue + 1]; RefPtr<CSSPrimitiveValue> m_numberValueCache[maximumCacheableIntegerValue + 1]; typedef HashMap<AtomicString, RefPtr<CSSValueList> > FontFaceValueCache; FontFaceValueCache m_fontFaceValueCache; typedef HashMap<String, RefPtr<CSSPrimitiveValue> > FontFamilyValueCache; FontFamilyValueCache m_fontFamilyValueCache; friend CSSValuePool& cssValuePool(); }; CSSValuePool& cssValuePool(); } #endif
lordmos/blink
Source/core/css/CSSValuePool.h
C
mit
4,182
import pt from './pt/pt' const messages = { pt } export default messages
fmoliveira/rexql-boilerplate
client/src/messages/index.js
JavaScript
mit
77
# whereuat Adds a slide out panel to your rails app that directs clients to test stories that have been marked as 'delivered' in Pivotal Tracker. ![whereuat demo](http://img.skitch.com/20100806-gug4f5uapk6ixh64sk16qenf9s.jpg) ## Installing Add whereuat to your Gemfile: gem 'whereuat' Create an initializer to add the Whereuat::RackApp to your middleware stack and configure your pivotal tracker api token and project id: require 'whereuat' Whereuat.configure do |config| config.pivotal_tracker_token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" config.pivotal_tracker_project = 123456 end Use the following helper somewhere in your application layout (we recommend at the end of the body): = whereuat The helper will insert a smidgeon of javascript that will add a tiny tab on the LHS of each page. **Please note** that whereuat requires `jQuery` to be included in your layout or templates already. Reload a page from your app and give it a whirl. ## Note on Patches/Pull Requests * Fork the project. * Make your feature addition or bug fix. * Add tests for it. This is important so I don't break it in a future version unintentionally. * Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull) * Send me a pull request. Bonus points for topic branches. ### rake dev If you'd like to contribute to `whereuat` you can get started by running rake dev This sets up the correct configuration and environment (follow the instructions), then starts a sinatra app under shotgun. You can use this sinatra app to verify your work on `whereuat`. All assets are regenerated from their constituents on each request. The constituents are located in the `dev` directory. ## Contributors * Ben Askins * Lachie Cox * Ben Webster * Daniel Neighman ## Copyright Copyright &copy; 2010 Plus2. See LICENSE for details.
plus2/whereuat
README.md
Markdown
mit
1,977
// IKOverlayList.cpp: implementation of the IKOverlayList class. // ////////////////////////////////////////////////////////////////////// #include "IKCommon.h" #include "IKUtil.h" #include "IKOverlayList.h" ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// IKOverlayList::IKOverlayList() { m_count = 0; m_selected = 0; } IKOverlayList::IKOverlayList(IKString &encoded) { m_count = 0; m_selected = 0; // get the encoded string IKString strEncoded = encoded; // decode it. int part = 0; int start = 0; int index = 0; for (int i=0;i<strEncoded.GetLength();i++) { if (strEncoded.GetAt(i)==CHAR('|')) { IKString s = strEncoded.Mid(start,i-start); part++; if (part==1) { // it's the index m_selected = IKUtil::StringToInt(s); } else { m_entries[part-2] = s; m_count++; } start = i+1; } } if (m_selected<=0) m_selected = 0; if (m_selected>m_count) m_selected = 0; } IKOverlayList::~IKOverlayList() { } bool IKOverlayList::GetEntry(int numEntry, IKString &value, bool &bSelected) { value = IKString(TEXT("")); bSelected = false; if (numEntry<=0) return false; if (numEntry>m_count) return false; value = m_entries[numEntry-1]; if (numEntry==m_selected) bSelected = true; return true; } IKString IKOverlayList::GetSelectedOverlay () { if (m_selected<=0) return IKString(TEXT("")); return m_entries[m_selected-1]; } int IKOverlayList::GetNumSelected () { return m_selected; } void IKOverlayList::SetNumSelected (int n) { if (n>GetCount()) return; m_selected = n; } IKString IKOverlayList::GetNumberedEntry (int n) { if (n>GetCount()) return IKString(TEXT("")); return m_entries[n-1]; } IKString IKOverlayList::GetEncodedList() { //if (GetCount()<=0) //return IKString(TEXT("")); IKString result; result += IKUtil::IntToString(m_selected); result += TEXT("|"); for (int i=0;i<GetCount();i++) { result += m_entries[i]; result += TEXT("|"); } return result; } void IKOverlayList::AddEntry ( IKString entry, bool bSelected /*=false*/ ) { int i = Find(entry); if (i==-1) { m_count++; m_entries[m_count-1] = entry; if (bSelected) SetNumSelected(m_count); } } int IKOverlayList::Find(IKString &entry) { int n = GetCount(); if (n<=0) return -1; for (int i=0;i<n;i++) { if (m_entries[i].CompareNoCase(entry)==0) return i; } return -1; } void IKOverlayList::RemoveEntry ( IKString entry ) { // find it first int i = Find(entry); if (i==-1) return; // move 'em down for (int n=i+1;i<m_count;i++) m_entries[n-1] = m_entries[n]; m_count--; // reset selected if (m_selected==i+1) m_selected = 0; if (m_selected>i+1) m_selected--; }
ATMakersOrg/OpenIKeys
original/IntelliKeys/MacOSX/common/IKOverlayList.cpp
C++
mit
2,832
#include "joedb/journal/Stream_File.h" #include "joedb/Exception.h" namespace joedb { ///////////////////////////////////////////////////////////////////////////// Stream_File::Stream_File ///////////////////////////////////////////////////////////////////////////// ( std::streambuf &streambuf, Open_Mode mode, bool shared ): Generic_File(mode, shared), streambuf(streambuf) { } ///////////////////////////////////////////////////////////////////////////// int64_t Stream_File::raw_get_size() const ///////////////////////////////////////////////////////////////////////////// { const auto pos = streambuf.pubseekoff ( 0, std::ios_base::cur, std::ios_base::in ); const auto result = streambuf.pubseekoff ( 0, std::ios_base::end, std::ios_base::in ); streambuf.pubseekoff ( pos, std::ios_base::beg, std::ios_base::in ); return int64_t(result); } ///////////////////////////////////////////////////////////////////////////// size_t Stream_File::raw_read(char *buffer, size_t size) ///////////////////////////////////////////////////////////////////////////// { return size_t(streambuf.sgetn(buffer, std::streamsize(size))); } ///////////////////////////////////////////////////////////////////////////// void Stream_File::raw_write(const char *buffer, size_t size) ///////////////////////////////////////////////////////////////////////////// { size_t written = 0; while (written < size) { const auto result = streambuf.sputn ( buffer + written, std::streamsize(size - written) ); if (result <= 0) throw Exception("Could not write to stream"); written += size_t(result); } streambuf.pubsync(); } ///////////////////////////////////////////////////////////////////////////// int Stream_File::raw_seek(int64_t offset) ///////////////////////////////////////////////////////////////////////////// { if (offset < 0) return 1; const auto pos = streambuf.pubseekoff(offset, std::ios_base::beg); return pos != offset; } }
Remi-Coulom/joedb
src/joedb/journal/Stream_File.cpp
C++
mit
2,057
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import datetime from collections import namedtuple import mock import six from django.conf import settings from django.test import TestCase from django.utils import timezone from wagtail.wagtailcore.models import Page from articles.models import ArticleCategory, ArticlePage from images.models import AttributedImage from people.models import ContributorPage from wordpress_importer.management.commands import import_from_wordpress from wordpress_importer.models import (ImageImport, ImportDownloadError, PostImport) class ImageCleanUp(object): def delete_images(self): # clean up any image files that were created. images = AttributedImage.objects.all() for image in images: storage, path = image.file.storage, image.file.path image.delete() storage.delete(path) FakeResponse = namedtuple('FakeResponse', 'status_code, content') def local_get_successful(url): "Fetch a stream from local files." p_url = six.moves.urllib.parse.urlparse(url) if p_url.scheme != 'file': raise ValueError("Expected file scheme") filename = six.moves.urllib.request.url2pathname(p_url.path) response = FakeResponse(200, open(filename, 'rb').read()) return response def local_get_404(url): "Fetch a stream from local files." response = FakeResponse(404, None) return response test_image_url = 'file:///{}/wordpress_importer/tests/files/testcat.jpg'.format( settings.PROJECT_ROOT) test_image_url_with_unicode = 'file:///{}/wordpress_importer/tests/files/testcat♥.jpg'.format( settings.PROJECT_ROOT) class TestCommandImportFromWordPressLoadContributors(TestCase, ImageCleanUp): def setUp(self): import_from_wordpress.Command.get_contributor_data = self.get_test_contributor_data def tearDown(self): self.delete_images() @mock.patch('requests.get', local_get_successful) def testLoadContributorsCreatesContributor(self): command = import_from_wordpress.Command() command.load_contributors() contributors = ContributorPage.objects.filter(email='bob@example.com') self.assertEqual(1, contributors.count()) @mock.patch('requests.get', local_get_successful) def testLoadContributorsSetsFirstName(self): command = import_from_wordpress.Command() command.load_contributors() contributors = ContributorPage.objects.filter(email='bob@example.com') self.assertEqual('Bob', contributors.first().first_name) @mock.patch('requests.get', local_get_successful) def testLoadContributorsSetsLastName(self): command = import_from_wordpress.Command() command.load_contributors() contributors = ContributorPage.objects.filter(email='bob@example.com') self.assertEqual('Smith', contributors.first().last_name) @mock.patch('requests.get', local_get_successful) def testLoadContributorsSetsNickname(self): command = import_from_wordpress.Command() command.load_contributors() contributors = ContributorPage.objects.filter(email='bob@example.com') self.assertEqual('Bobby Smith', contributors.first().nickname) @mock.patch('requests.get', local_get_successful) def testLoadContributorsSetsTwitterHandle(self): command = import_from_wordpress.Command() command.load_contributors() contributors = ContributorPage.objects.filter(email='bob@example.com') self.assertEqual('@bobsmith', contributors.first().twitter_handle) @mock.patch('requests.get', local_get_successful) def testLoadContributorsSetsTwitterHandleFromUrl(self): import_from_wordpress.Command.get_contributor_data = self.get_test_contributor_data_twitter_url command = import_from_wordpress.Command() command.load_contributors() contributors = ContributorPage.objects.filter(email='bob@example.com') self.assertEqual('@bobsmith', contributors.first().twitter_handle) @mock.patch('requests.get', local_get_successful) def testLoadContributorsSetsLongBio(self): command = import_from_wordpress.Command() command.load_contributors() contributors = ContributorPage.objects.filter(email='bob@example.com') self.assertEqual('Bob Smith is a person who does stuff.', contributors.first().long_bio) @mock.patch('requests.get', local_get_successful) def testLoadContributorsSetsShortBio(self): command = import_from_wordpress.Command() command.load_contributors() contributors = ContributorPage.objects.filter(email='bob@example.com') self.assertEqual('He does stuff.', contributors.first().short_bio) # @mock.patch('requests.get', local_get_successful) # def testLoadContributorsSetsImageFile(self): # command = import_from_wordpress.Command() # command.load_contributors() # contributors = ContributorPage.objects.filter(email='bob@example.com') # # images = AttributedImage.objects.filter(title='testcat.jpg') # self.assertEqual(1, images.count()) # self.assertEqual(images.first(), contributors.first().headshot) # # @mock.patch('requests.get', local_get_404) # def testDownloadErrorLoggedWhenErrorGettingImage(self): # command = import_from_wordpress.Command() # command.load_contributors() # # errors = ImportDownloadError.objects.all() # self.assertEqual(1, errors.count()) # self.assertEqual(404, errors.first().status_code) # self.assertEqual(settings.WP_IMPORTER_USER_PHOTO_URL_PATTERN.format("testcat.jpg"), errors.first().url) def get_test_contributor_data(self): data = [ ('bob@example.com', 'first_name', 'Bob'), ('bob@example.com', 'last_name', 'Smith'), ('bob@example.com', 'nickname', 'Bobby Smith'), ('bob@example.com', 'twitter', '@bobsmith'), ('bob@example.com', 'description', 'Bob Smith is a person who does stuff.'), ('bob@example.com', 'SHORT_BIO', 'He does stuff.'), ('bob@example.com', 'userphoto_image_file', 'testcat.jpg'), ] return data def get_test_contributor_data_twitter_url(self): data = [ ('bob@example.com', 'first_name', 'Bob'), ('bob@example.com', 'last_name', 'Smith'), ('bob@example.com', 'nickname', 'Bobby Smith'), ('bob@example.com', 'TWITTER', 'https://twitter.com/bobsmith'), ('bob@example.com', 'description', 'Bob Smith is a person who does stuff.'), ('bob@example.com', 'SHORT_BIO', 'He does stuff.'), ('bob@example.com', 'userphoto_image_file', 'testcat.jpg'), ] return data @mock.patch('requests.get', local_get_successful) class TestCommandImportFromWordPressUnicodeSlug(TestCase, ImageCleanUp): def setUp(self): import_from_wordpress.Command.get_post_data = self.get_test_post_data import_from_wordpress.Command.get_post_image_data = self.get_test_post_image_data import_from_wordpress.Command.get_data_for_topics = self.get_test_data_for_topics def tearDown(self): self.delete_images() def testCreatesPageWithAsciiSlug(self): command = import_from_wordpress.Command() command.load_posts() pages = ArticlePage.objects.filter( slug='crisis-at-home-for-canadas-armed-forces') self.assertEqual(1, pages.count()) def get_test_post_data(self, post_type): data = [ (1, 'Crisis At Home', 'Test?', 'Body.', "crisis-at-home-for-canadas-armed-forces%e2%80%a8", 'bob@example.com', datetime.datetime(2011, 2, 22, 5, 48, 31), ), ] return data def get_test_post_image_data(self, post_id): return None def get_test_data_for_topics(self, post_id, primary_topic=False): return ( ('Topic 1', 'topic-1'), ) class TestCommandImportFromWordPressLoadPosts(TestCase, ImageCleanUp): fixtures = ['test.json'] def setUp(self): import_from_wordpress.Command.get_post_data = self.get_test_post_data import_from_wordpress.Command.get_post_image_data = self.get_test_post_image_data import_from_wordpress.Command.get_data_for_topics = self.get_test_data_for_topics import_from_wordpress.Command.get_category_data = self.get_test_category_data def tearDown(self): self.delete_images() @mock.patch('requests.get', local_get_successful) def testCreatesPageWithSlug(self): command = import_from_wordpress.Command() command.load_posts() pages = ArticlePage.objects.filter( slug='is-nato-ready-for-putin') self.assertEqual(1, pages.count()) @mock.patch('requests.get', local_get_successful) def testPageIsChildOfFeatures(self): command = import_from_wordpress.Command() command.load_posts() pages = ArticlePage.objects.filter( slug='is-nato-ready-for-putin') features_page = Page.objects.get(slug='features') self.assertTrue(pages.first().is_descendant_of(features_page)) @mock.patch('requests.get', local_get_successful) def testPageSetsTitle(self): command = import_from_wordpress.Command() command.load_posts() pages = ArticlePage.objects.filter( slug='is-nato-ready-for-putin') self.assertEqual('Is NATO Ready for Putin?', pages.first().title) @mock.patch('requests.get', local_get_successful) def testPageSetsBody(self): command = import_from_wordpress.Command() command.load_posts() pages = ArticlePage.objects.filter( slug='is-nato-ready-for-putin') self.assertEqual( [{'type': "Paragraph", 'value': {"text": "<p>Vladimir Putin has challenged</p>", "use_dropcap": False}}, ], pages.first().body.stream_data) @mock.patch('requests.get', local_get_successful) def testPageSetsExcerptContainingUnicode(self): command = import_from_wordpress.Command() command.load_posts() pages = ArticlePage.objects.filter( slug='is-nato-ready-for-putin') self.assertEqual( 'Political hurdles hold NATO back — how convenient for Russian tactics.', pages.first().excerpt) @mock.patch('requests.get', local_get_successful) def testPageImportsHTML(self): command = import_from_wordpress.Command() command.load_posts() pages = ArticlePage.objects.filter(slug='html-post') self.assertEqual('The excerpt also has some <strong>HTML</strong>.', pages.first().excerpt) self.assertEqual( [{"type": "Paragraph", "value": {'text': '<p>This <strong>is</strong></p>', 'use_dropcap': False}}, {"type": "Paragraph", "value": {'text': '<p><img src="http://www.example.com/test.jpg"/></p>', 'use_dropcap': False}}, {"type": "Paragraph", "value": {'text': '<p>a <a href="http://www.example.com">post</a><span class="special">that has html</span></p>', 'use_dropcap': False}}, {"type": "Paragraph", "value": {'text': '<p>Yay!</p>', 'use_dropcap': False}}, ], pages.first().body.stream_data) @mock.patch('requests.get', local_get_successful) def testPageUpdatesLocalImageUrls(self): command = import_from_wordpress.Command() command.load_posts() pages = ArticlePage.objects.filter(slug='html-local-image-post') images = AttributedImage.objects.filter(title='testcat.jpg') self.assertEqual( [{'type': 'Image', 'value': {'image': images.first().id, 'placement': 'full', 'expandable': False, 'label': None}}, {'type': "Paragraph", 'value': {"text": "<p>a cat</p>", 'use_dropcap': False}}, ], pages.first().body.stream_data) @mock.patch('requests.get', local_get_404) def testDownloadErrorLoggedWhenErrorGettingImage(self): command = import_from_wordpress.Command() command.load_posts() errors = ImportDownloadError.objects.filter(url=test_image_url) self.assertEqual(404, errors.first().status_code) @mock.patch('requests.get', local_get_successful) def testPageNullFields(self): command = import_from_wordpress.Command() command.load_posts() pages = ArticlePage.objects.filter(slug='null-fields') self.assertEqual('', pages.first().excerpt) self.assertEqual([], pages.first().body.stream_data) self.assertEqual('', pages.first().title) @mock.patch('requests.get', local_get_successful) def testPageBlankFields(self): command = import_from_wordpress.Command() command.load_posts() pages = ArticlePage.objects.filter(slug='blank-fields') self.assertEqual('', pages.first().excerpt) self.assertEqual([], pages.first().body.stream_data) self.assertEqual('', pages.first().title) @mock.patch('requests.get', local_get_successful) def testPageHasAuthor(self): command = import_from_wordpress.Command() command.load_posts() pages = ArticlePage.objects.filter( slug='is-nato-ready-for-putin') contributors = ContributorPage.objects.filter(email='bob@example.com') self.assertEqual(pages.first().author_links.count(), 1) self.assertEqual(pages.first().author_links.first().author, contributors.first()) @mock.patch('requests.get', local_get_successful) def testPageAuthorNotSet(self): command = import_from_wordpress.Command() command.load_posts() pages = ArticlePage.objects.filter(slug='null-author') self.assertEqual(pages.first().author_links.count(), 0) @mock.patch('requests.get', local_get_successful) def testPageEmptyAuthor(self): command = import_from_wordpress.Command() command.load_posts() pages = ArticlePage.objects.filter(slug='empty-author') self.assertEqual(pages.first().author_links.count(), 0) @mock.patch('requests.get', local_get_successful) def testPageNonExistantAuthor(self): # TODO: should this cause an error command = import_from_wordpress.Command() command.load_posts() pages = ArticlePage.objects.filter(slug='nonexistant-author') self.assertEqual(pages.first().author_links.count(), 0) @mock.patch('requests.get', local_get_successful) def testUpdatesDuplicateSlug(self): command = import_from_wordpress.Command() command.load_posts() pages = ArticlePage.objects.filter(slug='duplicate') self.assertEqual(pages.count(), 1) self.assertEqual(pages.first().title, "title 2") @mock.patch('requests.get', local_get_successful) def testImportTrackingCreated(self): command = import_from_wordpress.Command() command.load_posts() imports = PostImport.objects.filter(post_id=5) self.assertEqual(imports.count(), 1) @mock.patch('requests.get', local_get_successful) def testSetsDate(self): command = import_from_wordpress.Command() command.load_posts() pages = ArticlePage.objects.filter( slug='is-nato-ready-for-putin') self.assertEqual( timezone.datetime(2011, 2, 22, 5, 48, 31, tzinfo=timezone.pytz.timezone('GMT')), pages.first().first_published_at) @mock.patch('requests.get', local_get_successful) def testDefaultCategorySet(self): command = import_from_wordpress.Command() command.load_posts() page = ArticlePage.objects.filter( slug='is-nato-ready-for-putin').first() default_category = ArticleCategory.objects.get(slug="feature") self.assertEqual(default_category, page.category) @mock.patch('requests.get', local_get_successful) def testSetsPrimaryTopic(self): command = import_from_wordpress.Command() command.load_posts() page = ArticlePage.objects.filter( slug='is-nato-ready-for-putin').first() self.assertEqual("Primary Topic 1", page.primary_topic.name) @mock.patch('requests.get', local_get_successful) def testSetsSecondaryTopics(self): command = import_from_wordpress.Command() command.load_posts() page = ArticlePage.objects.filter( slug='is-nato-ready-for-putin').first() self.assertEqual(1, page.topic_links.count()) self.assertEqual("Secondary Topic 1", page.topic_links.first().topic.name) def get_test_post_image_data(self, post_id): return None def get_test_category_data(self): return ( ("Features", 1, "features", 0), ("Essays", 3, "essays", 0), ("101s", 4, "101", 0), ("Roundtable", 5, "roundtable", 0), ("Dispatch", 6, "roundtable", 0), ("Comments", 7, "roundtable", 0), ("Essays", 6, "roundtable", 0), ("Visualizations", 9, "roundtable", 0), ("Interviews", 10, "roundtable", 0), ("Rapid Response Group", 11, "roundtable", 0), ("Graphics", 2, "graphics", 1), ) def get_test_data_for_topics(self, post_id, primary_topic=False): if primary_topic: return ( ('Primary Topic 1', 'primary-topic-1'), ) else: return ( ('Secondary Topic 1', 'secondary-topic-1'), ) def get_test_post_data(self, post_type): if post_type == "Features": data = [ (1, 'Vladimir Putin has challenged', 'Is NATO Ready for Putin?', 'Political hurdles hold NATO back — how convenient for Russian tactics.', 'is-nato-ready-for-putin', 'bob@example.com', datetime.datetime(2011, 2, 22, 5, 48, 31), ), (2, '<p>This <strong>is</strong> <img src="http://www.example.com/test.jpg" /> a <a href="http://www.example.com">post</a><span class="special">that has html</span></p><div>Yay!</div>', 'HTML Works?', 'The excerpt also has some <strong>HTML</strong>.', 'html-post', 'bob@example.com', datetime.datetime(2011, 2, 22, 5, 48, 31), ), (3, None, None, None, 'null-fields', 'bob@example.com', datetime.datetime(2011, 2, 22, 5, 48, 31), ), (5, '', '', '', 'blank-fields', 'bob@example.com', datetime.datetime(2011, 2, 22, 5, 48, 31), ), (6, 'body', 'title', 'excerpt', 'null-author', None, datetime.datetime(2011, 2, 22, 5, 48, 31), ), (7, 'body', 'title', 'excerpt', 'empty-author', '', datetime.datetime(2011, 2, 22, 5, 48, 31), ), (8, 'body', 'title', 'excerpt', 'nonexistant-author', 'doesnotexist@here.com', datetime.datetime(2011, 2, 22, 5, 48, 31), ), (9, 'body', 'title', 'excerpt', 'duplicate', 'bob@example.com', datetime.datetime(2011, 2, 22, 5, 48, 31), ), (10, 'body', 'title 2', 'excerpt', 'duplicate', 'bob@example.com', datetime.datetime(2011, 2, 22, 5, 48, 31), ), (11, '<div><img src="{}" />a cat</div>'.format(test_image_url), 'title', 'excerpt', 'html-local-image-post', 'bob@example.com', datetime.datetime(2011, 2, 22, 5, 48, 31), ), ] else: data = [] return data class TestCommandImportProcessHTMLForImages(TestCase, ImageCleanUp): def tearDown(self): self.delete_images() @mock.patch('requests.get', local_get_successful) def testHTMLHasImageImageCreatedWhenDownloaded(self): command = import_from_wordpress.Command() html = "<img src='{}'/>".format(test_image_url) command.process_html_for_images(html) images = AttributedImage.objects.filter(title='testcat.jpg') self.assertEqual(1, images.count()) @mock.patch('requests.get', local_get_successful) def testHTMLImageSourceUpdatedWhenDownloaded(self): command = import_from_wordpress.Command() html = "<img src='{}'/>".format(test_image_url) html = command.process_html_for_images(html) images = AttributedImage.objects.filter(title='testcat.jpg') self.assertEqual(html, "<img src='{}'/>".format( images.first().get_rendition('width-100').url)) @mock.patch('requests.get', local_get_successful) def testImageNotDownloadedForRemote(self): command = import_from_wordpress.Command() html = "<img src='http://upload.wikimedia.org/wikipedia/en/b/bd/Test.jpg'/>" command.process_html_for_images(html) images = AttributedImage.objects.filter(title='Test.jpg') self.assertEqual(0, images.count()) @mock.patch('requests.get', local_get_successful) def testHTMLNotUpdatedForRemote(self): command = import_from_wordpress.Command() html = "<img src='http://upload.wikimedia.org/wikipedia/en/b/bd/Test.jpg'/>" html = command.process_html_for_images(html) self.assertEqual(html, "<img src='http://upload.wikimedia.org/wikipedia/en/b/bd/Test.jpg'/>") @mock.patch('requests.get', local_get_successful) def testHTMLWithUnicodeNoUpload(self): command = import_from_wordpress.Command() html = "<p>€</p><img src='http://upload.wikimedia.org/wikipedia/en/b/bd/Test€.jpg'/>" html = command.process_html_for_images(html) self.assertEqual(html, "<p>€</p><img src='http://upload.wikimedia.org/wikipedia/en/b/bd/Test€.jpg'/>") @mock.patch('requests.get', local_get_successful) def testHTMLWithUnicodeImageSourceUpdatedWhenDownloaded(self): command = import_from_wordpress.Command() html = "<img src='{}' />".format(test_image_url_with_unicode) html = command.process_html_for_images(html) images = AttributedImage.objects.filter(title='testcat♥.jpg') self.assertEqual(1, images.count()) self.assertEqual(html, "<img src='{}' />".format( images.first().get_rendition('width-100').url)) @mock.patch('requests.get', local_get_404) def testDownloadErrorLoggedWhenError(self): command = import_from_wordpress.Command() html = "<img src='{}' />".format(test_image_url_with_unicode) html = command.process_html_for_images(html) errors = ImportDownloadError.objects.filter(url=test_image_url_with_unicode) self.assertEqual(1, errors.count()) self.assertEqual(404, errors.first().status_code) class TestCommandImportDownloadImage(TestCase, ImageCleanUp): def tearDown(self): self.delete_images() @mock.patch('requests.get', local_get_successful) def testImageCreatedWhenDownloaded(self): command = import_from_wordpress.Command() command.download_image(test_image_url, 'testcat.jpg') images = AttributedImage.objects.filter(title='testcat.jpg') self.assertEqual(1, images.count()) @mock.patch('requests.get', local_get_404) def testDownloadExceptionWhenError(self): command = import_from_wordpress.Command() with self.assertRaises(import_from_wordpress.DownloadException): command.download_image( 'file:///{}/wordpress_importer/tests/files/purple.jpg'.format( settings.PROJECT_ROOT), 'purple.jpg' ) @mock.patch('requests.get', local_get_404) def testDownloadExceptionHasDetails(self): command = import_from_wordpress.Command() try: command.download_image( 'file:///{}/wordpress_importer/tests/files/purple.jpg'.format( settings.PROJECT_ROOT), 'purple.jpg' ) except import_from_wordpress.DownloadException as e: self.assertEqual( 'file:///{}/wordpress_importer/tests/files/purple.jpg'.format( settings.PROJECT_ROOT), e.url) self.assertEqual(e.response.status_code, 404) @mock.patch('requests.get', local_get_successful) def testImageImportRecordCreatedWhenDownloaded(self): command = import_from_wordpress.Command() command.download_image(test_image_url, 'testcat.jpg') image_records = ImageImport.objects.filter(name='testcat.jpg') self.assertEqual(1, image_records.count()) @mock.patch('requests.get', local_get_successful) class TestCommandProcessHTLMForStreamField(TestCase, ImageCleanUp): def tearDown(self): self.delete_images() def testSimpleParagraph(self): command = import_from_wordpress.Command() html = "<p>This is a simple paragraph.</p>" processed = command.process_html_for_stream_field(html) self.assertEqual( [{"type": "Paragraph", "value": {"text": "<p>This is a simple paragraph.</p>", 'use_dropcap': False}}], processed ) def testImageUploadedLocally(self): command = import_from_wordpress.Command() html = "<img src='{}' />".format(test_image_url) processed = command.process_html_for_stream_field(html) images = AttributedImage.objects.filter(title='testcat.jpg') self.assertEqual(1, images.count()) self.assertEqual(processed, [{"type": "Image", "value": {'image': 1, 'placement': 'full'}}, ]) def testImageWithParagraphs(self): command = import_from_wordpress.Command() html = "<p>This is a simple paragraph.</p><img src='{}' /><p>This is a second paragraph.</p>".format( test_image_url) processed = command.process_html_for_stream_field(html) self.assertEqual( [{"type": "Paragraph", "value": {"text": "<p>This is a simple paragraph.</p>", 'use_dropcap': False}}, {"type": "Image", "value": {'image': 1, 'placement': 'full'}}, {"type": "Paragraph", "value": {"text": "<p>This is a second paragraph.</p>", 'use_dropcap': False}}, ], processed ) def testImageInParagraph(self): command = import_from_wordpress.Command() html = "<p>This is a paragraph. <img src='{}' /> This is a second paragraph.</p>".format( test_image_url) processed = command.process_html_for_stream_field(html) self.assertEqual( [{"type": "Paragraph", "value": {"text": "<p>This is a paragraph.</p>", 'use_dropcap': False}}, {"type": "Image", "value": {'image': 1, 'placement': 'full'}}, {"type": "Paragraph", "value": {"text": "<p>This is a second paragraph.</p>", 'use_dropcap': False}}, ], processed ) def testExternalImage(self): command = import_from_wordpress.Command() html = "<p>This is a simple paragraph.</p><img src='http://upload.wikimedia.org/wikipedia/en/b/bd/Test.jpg' /><p>This is a second paragraph.</p>" processed = command.process_html_for_stream_field(html) self.assertEqual( [{"type": "Paragraph", "value": {"text": "<p>This is a simple paragraph.</p>", 'use_dropcap': False}}, {"type": "Paragraph", "value": {"text": '<p><img src="http://upload.wikimedia.org/wikipedia/en/b/bd/Test.jpg"/></p>', 'use_dropcap': False}}, {"type": "Paragraph", "value": {"text": "<p>This is a second paragraph.</p>", 'use_dropcap': False}}, ], processed ) def testDivs(self): command = import_from_wordpress.Command() html = "<div><div>This is a simple paragraph.</div><img src='{}' /><div>This is a second paragraph.<img src='{}' /></div></div>".format( test_image_url, test_image_url) processed = command.process_html_for_stream_field(html) self.assertEqual( [{"type": "Paragraph", "value": {"text": "<p>This is a simple paragraph.</p>", 'use_dropcap': False}}, {"type": "Image", "value": {'image': 1, 'placement': 'full'}}, {"type": "Paragraph", "value": {"text": "<p>This is a second paragraph.</p>", 'use_dropcap': False}}, {"type": "Image", "value": {'image': 1, 'placement': 'full'}}, ], processed ) def testHeaders(self): command = import_from_wordpress.Command() html = "<h1>This is a header 1</h1><h2>This is a header 2</h2>" \ "<h3>This is a header 3</h3><h4>This is a header 4</h4>" \ "<h5>This is a header 5</h5><h6>This is a header 6</h6>" processed = command.process_html_for_stream_field(html) self.assertEqual( [{"type": "Heading", "value": {'text': "This is a header 1", 'heading_level': 2}}, {"type": "Heading", "value": {'text': "This is a header 2", 'heading_level': 2}}, {"type": "Heading", "value": {'text': "This is a header 3", 'heading_level': 2}}, {"type": "Heading", "value": {'text': "This is a header 4", 'heading_level': 2}}, {"type": "Heading", "value": {'text': "This is a header 5", 'heading_level': 2}}, {"type": "Heading", "value": {'text': "This is a header 6", 'heading_level': 2}}, ], processed ) def testImagesInHeaders(self): command = import_from_wordpress.Command() html = "<h2><img src='{}' />This is the heading</h2>".format( test_image_url) processed = command.process_html_for_stream_field(html) self.assertEqual( [{"type": "Image", "value": {'image': 1, 'placement': 'full'}}, {"type": "Heading", "value": {'text': "This is the heading", 'heading_level': 2}}, ], processed ) def testImagesInHeadersFollowingText(self): command = import_from_wordpress.Command() html = "<h2>This is the heading<img src='{}' /></h2>".format( test_image_url) processed = command.process_html_for_stream_field(html) self.assertEqual( [ {"type": "Heading", "value": {'text': "This is the heading", 'heading_level': 2}}, {"type": "Image", "value": {'image': 1, 'placement': 'full'}}, ], processed ) def testImagesInHeadersWrappedInText(self): command = import_from_wordpress.Command() html = "<h2>This is the heading<img src='{0}' />This is more heading<img src='{0}' />This is even more heading</h2>".format( test_image_url) processed = command.process_html_for_stream_field(html) self.assertEqual( [ {"type": "Heading", "value": {'text': "This is the heading", 'heading_level': 2}}, {"type": "Image", "value": {'image': 1, 'placement': 'full'}}, {"type": "Heading", "value": {'text': "This is more heading", 'heading_level': 2}}, {"type": "Image", "value": {'image': 1, 'placement': 'full'}}, {"type": "Heading", "value": {'text': "This is even more heading", 'heading_level': 2}}, ], processed ) def testNonBlockTagStrong(self): command = import_from_wordpress.Command() html = "<p>This is a <strong>simple paragraph.</strong></p>" processed = command.process_html_for_stream_field(html) self.assertEqual( [{"type": "Paragraph", "value": {"text": "<p>This is a <strong>simple paragraph.</strong></p>", 'use_dropcap': False}}, ], processed ) def testNonAndBlockSubTags(self): command = import_from_wordpress.Command() html = '<p>This <strong>is</strong> <img src="http://www.example.com/test.jpg" /></p>' processed = command.process_html_for_stream_field(html) self.assertEqual( [{"type": "Paragraph", "value": {"text": '<p>This <strong>is</strong></p>', 'use_dropcap': False}}, {"type": "Paragraph", "value": {"text": '<p><img src="http://www.example.com/test.jpg"/></p>', 'use_dropcap': False}}, ], processed) def testExtraWhiteSpaceIsRemoved(self): command = import_from_wordpress.Command() html = " <p>Test</p> <div>Second</div> &nbsp; <p>Third</p>" processed = command.process_html_for_stream_field(html) self.assertEqual( [{'type': 'Paragraph', 'value': {"text": '<p>Test</p>', 'use_dropcap': False}}, {'type': 'Paragraph', 'value': {"text": '<p>Second</p>', 'use_dropcap': False}}, {'type': 'Paragraph', 'value': {"text": '<p>Third</p>', 'use_dropcap': False}}, ], processed ) def testCommentsOutsideStructureAreRemoved(self): command = import_from_wordpress.Command() html = '&nbsp;<!--more--> <p>This has a <!--more--> comment</p>' processed = command.process_html_for_stream_field(html) self.assertEqual( [{'type': 'Paragraph', 'value': {'text': '<p>This has a comment</p>', 'use_dropcap': False}}], processed ) def testSimpleCommentsAreRemoved(self): command = import_from_wordpress.Command() html = '<p>This has a <!--more--> comment</p>' processed = command.process_html_for_stream_field(html) self.assertEqual( [{'type': 'Paragraph', 'value': {"text": '<p>This has a comment</p>', 'use_dropcap': False}}], processed ) def testStringsWithNoTagsWithRNBreaks(self): command = import_from_wordpress.Command() html = "This is text.\r\n\r\nThat should be in paragraphs." processed = command.process_html_for_stream_field(html) self.assertEqual( [{'type': 'Paragraph', 'value': {"text": '<p>This is text.</p>', 'use_dropcap': False}}, {'type': 'Paragraph', 'value': {"text": '<p>That should be in paragraphs.</p>', 'use_dropcap': False}}], processed ) def testStringsWithNoTagsWithNNBreaks(self): command = import_from_wordpress.Command() html = "This is text.\n\nThat should be in paragraphs." processed = command.process_html_for_stream_field(html) self.assertEqual( [{'type': 'Paragraph', 'value': {"text": '<p>This is text.</p>', 'use_dropcap': False}}, {'type': 'Paragraph', 'value': {"text": '<p>That should be in paragraphs.</p>', 'use_dropcap': False}}], processed ) def testStringsWithNoTagsWithNBreaks(self): command = import_from_wordpress.Command() html = """This is text.\nThat should be in paragraphs.""" processed = command.process_html_for_stream_field(html) self.assertEqual( [{'type': 'Paragraph', 'value': {"text": '<p>This is text.<br/>That should be in paragraphs.</p>', 'use_dropcap': False}}], processed ) def testNoExtraLineBreakks(self): command = import_from_wordpress.Command() html = """As one of Canada's principal security and intelligence agencies. <h4>What is CSE?</h4> Little is known about CSE because of secrecy.""" processed = command.process_html_for_stream_field(html) self.assertEqual( [{'type': 'Paragraph', 'value': {"text": "<p>As one of Canada's principal security and intelligence agencies.</p>", 'use_dropcap': False}}, {'type': 'Heading', 'value': {"text": 'What is CSE?', 'heading_level': 2}}, {'type': 'Paragraph', 'value': {"text": '<p>Little is known about CSE because of secrecy.</p>', 'use_dropcap': False}} ], processed ) class TestProcessForLineBreaks(TestCase): def testStringNoTags(self): command = import_from_wordpress.Command() html = "This is a string." processed = command.process_for_line_breaks(html) self.assertEqual("<p>This is a string.</p>", processed) def testStringsWithNoTagsWithRNBreaks(self): command = import_from_wordpress.Command() html = "This is text.\r\n\r\nThat should be in paragraphs." processed = command.process_for_line_breaks(html) self.assertEqual( "<p>This is text.</p><p>That should be in paragraphs.</p>", processed ) def testStringsWithNoTagsWithNNBreaks(self): command = import_from_wordpress.Command() html = "This is text.\n\nThat should be in paragraphs." processed = command.process_for_line_breaks(html) self.assertEqual( "<p>This is text.</p><p>That should be in paragraphs.</p>", processed ) def testStringsWithNoTagsWithNBreaks(self): command = import_from_wordpress.Command() html = "This is text.\nThat has a line break." processed = command.process_for_line_breaks(html) self.assertEqual( "<p>This is text.<br/>That has a line break.</p>", processed ) class TestGetDownloadPathAndFilename(TestCase): def testNoSubFolderReturnsFilenameAndUrl(self): command = import_from_wordpress.Command() url, filename = command.get_download_path_and_filename( "http://example.com/uploads/my_image.jpg", "http://newdomain.com/images/{}" ) self.assertEqual("http://newdomain.com/images/my_image.jpg", url) self.assertEqual("my_image.jpg", filename) def testSubFolderReturnsFilenameAndUrlWithSubfolders(self): command = import_from_wordpress.Command() url, filename = command.get_download_path_and_filename( "http://example.com/uploads/2011/04/my_image.jpg", "http://newdomain.com/images/{}" ) self.assertEqual("http://newdomain.com/images/2011/04/my_image.jpg", url) self.assertEqual("2011_04_my_image.jpg", filename) class TestParseEmbed(TestCase): def testParagraphWithStreamDataReturnsURL(self): command = import_from_wordpress.Command() pre, url, post = command.parse_string_for_embed('[stream provider=youtube flv=http%3A//www.youtube.com/watch%3Fv%3DdiTubVRKdz0 embed=false share=false width=646 height=390 dock=true controlbar=over bandwidth=high autostart=false /]') self.assertEqual('http://www.youtube.com/watch?v=diTubVRKdz0', url) self.assertEqual('', pre) self.assertEqual('', post) def testEmbedWithPreAndPost(self): command = import_from_wordpress.Command() pre, url, post = command.parse_string_for_embed('Stuff before the embed. [stream provider=youtube flv=http%3A//www.youtube.com/watch%3Fv%3DdiTubVRKdz0 embed=false share=false width=646 height=390 dock=true controlbar=over bandwidth=high autostart=false /] Stuff after the embed.') self.assertEqual('http://www.youtube.com/watch?v=diTubVRKdz0', url) self.assertEqual('Stuff before the embed.', pre) self.assertEqual('Stuff after the embed.', post) def testNoEmbed(self): command = import_from_wordpress.Command() pre, url, post = command.parse_string_for_embed('Just a regular paragraph.') self.assertEqual('', url) self.assertEqual('Just a regular paragraph.', pre) self.assertEqual('', post)
albertoconnor/website
wordpress_importer/tests/test_import_command.py
Python
mit
41,498
import { validate, URL_REX, TITLE_REX } from '../validator'; import db from '../connection'; import getUserById from '../loaders/get-user-by-id'; import sanitizeHtml from 'sanitize-html'; export default async (userId, rawTitle, rawLink, rawBody) => { const body = sanitizeHtml(rawBody, { allowedTags: ['b', 'i', 'em', 'strong', 'a', 'p', 'br', 'div', 'h2', 'h3'], allowedAttributes: { a: ['href'], }, }); const link = (validate(URL_REX, rawLink)) ? rawLink : null; const title = (validate(TITLE_REX, rawTitle)) ? rawTitle.trim() : null; const urlStringRoot = title.toLowerCase().replace(/ /g, '-').replace(/[^a-z-1234567890]/g, ''); if (userId && body && body !== '') { const urlStringLike = `${urlStringRoot}%`; const countResult = await db.one( 'select count(*) as count from t_post where urlstring like $(urlStringLike)', { urlStringLike } ); const urlString = (Number(countResult.count) === 0) ? urlStringRoot : `${urlStringRoot}-${countResult.count}`; const user = await getUserById(userId); if (user && user.status > 0) { const insertResult = await db.one( `insert into t_post (user_id, title, urlstring, body, url) values ($(userId), $(title), $(urlString), $(body), $(link)) returning id`, { userId, title, urlString, body, link } ); if (insertResult) { return { success: true, post: { urlstring: urlString } }; } return { success: false, message: 'Insert failed' }; } return { success: false, message: 'No permissions' }; } return { success: false, message: 'Didn\'t validate' }; };
marcusdarmstrong/cloth-io
src/api/add-post.js
JavaScript
mit
1,656
'use strict'; //NOTE:Methods used to do HTTP requests. To use an HTTP request listed here just call the method angular.module('announcements').factory('Announcements', ['$http', function($http) { var methods = { getAllAnnouncements: function(announcements) { return $http.get('/api/announcements', announcements); }, getOneAnnouncement: function(id) { return $http.get('/api/announcements/' + id); }, createAnnouncement: function(announcement) { $http.post('/api/announcements', announcement); }, deleteAnnouncement: function(id) { return $http.delete('/api/announcements/' + id); }, updateAnnouncement: function(id, announcement) { return $http.put('/api/announcements/' + id, announcement); }, }; return methods; }]);
benchen88888888/uag-website-version2
modules/announcements/client/factory/annoucement.client.factory.js
JavaScript
mit
839
# encoding: utf-8 module Mongoid # :nodoc: module Relations #:nodoc: module Embedded #:nodoc: # This class handles the behaviour for a document that embeds many other # documents within in it as an array. class Many < Relations::Many include Atomic # Appends a document or array of documents to the relation. Will set # the parent and update the index in the process. # # @example Append a document. # person.addresses << address # # @example Push a document. # person.addresses.push(address) # # @example Concat with other documents. # person.addresses.concat([ address_one, address_two ]) # # @param [ Document, Array<Document> ] *args Any number of documents. def <<(*args) atomically(:$pushAll) do args.flatten.each do |doc| next unless doc append(doc) doc.save if persistable? && !assigning? end end end alias :concat :<< alias :push :<< # Builds a new document in the relation and appends it to the target. # Takes an optional type if you want to specify a subclass. # # @example Build a new document on the relation. # person.people.build(:name => "Bozo") # # @param [ Hash ] attributes The attributes to build the document with. # @param [ Class ] type Optional class to build the document with. # # @return [ Document ] The new document. def build(attributes = {}, type = nil) Factory.build(type || metadata.klass, attributes).tap do |doc| doc.identify append(doc) yield(doc) if block_given? end end alias :new :build # Clear the relation. Will delete the documents from the db if they are # already persisted. # # @example Clear the relation. # person.addresses.clear # # @return [ Many ] The empty relation. def clear tap do |proxy| atomically(:$unset) { proxy.delete_all } end end # Returns a count of the number of documents in the association that have # actually been persisted to the database. # # Use #size if you want the total number of documents. # # @example Get the count of persisted documents. # person.addresses.count # # @return [ Integer ] The total number of persisted embedded docs, as # flagged by the #persisted? method. def count target.select { |doc| doc.persisted? }.size end # Create a new document in the relation. This is essentially the same # as doing a #build then #save on the new document. # # @example Create a new document in the relation. # person.movies.create(:name => "Bozo") # # @param [ Hash ] attributes The attributes to build the document with. # @param [ Class ] type Optional class to create the document with. # # @return [ Document ] The newly created document. def create(attributes = {}, type = nil, &block) build(attributes, type, &block).tap { |doc| doc.save } end # Create a new document in the relation. This is essentially the same # as doing a #build then #save on the new document. If validation # failed on the document an error will get raised. # # @example Create the document. # person.addresses.create!(:street => "Unter der Linden")</tt> # # @param [ Hash ] attributes The attributes to build the document with. # @param [ Class ] type Optional class to create the document with. # # @raise [ Errors::Validations ] If a validation error occured. # # @return [ Document ] The newly created document. def create!(attributes = {}, type = nil, &block) build(attributes, type, &block).tap { |doc| doc.save! } end # Delete the supplied document from the target. This method is proxied # in order to reindex the array after the operation occurs. # # @example Delete the document from the relation. # person.addresses.delete(address) # # @param [ Document ] document The document to be deleted. # # @return [ Document, nil ] The deleted document or nil if nothing deleted. # # @since 2.0.0.rc.1 def delete(document) target.delete_one(document).tap do |doc| if doc && !binding? if assigning? base.add_atomic_pull(doc) else doc.delete(:suppress => true) end unbind_one(doc) end reindex end end # Delete all the documents in the association without running callbacks. # # @example Delete all documents from the relation. # person.addresses.delete_all # # @example Conditionally delete documents from the relation. # person.addresses.delete_all(:conditions => { :street => "Bond" }) # # @param [ Hash ] conditions Conditions on which documents to delete. # # @return [ Integer ] The number of documents deleted. def delete_all(conditions = {}) atomically(:$pull) { remove_all(conditions, :delete) } end # Destroy all the documents in the association whilst running callbacks. # # @example Destroy all documents from the relation. # person.addresses.destroy_all # # @example Conditionally destroy documents from the relation. # person.addresses.destroy_all(:conditions => { :street => "Bond" }) # # @param [ Hash ] conditions Conditions on which documents to destroy. # # @return [ Integer ] The number of documents destroyed. def destroy_all(conditions = {}) atomically(:$pull) { remove_all(conditions, :destroy) } end # Finds a document in this association through several different # methods. # # @example Find a document by its id. # person.addresses.find(BSON::ObjectId.new) # # @example Find documents for multiple ids. # person.addresses.find([ BSON::ObjectId.new, BSON::ObjectId.new ]) # # @example Find documents based on conditions. # person.addresses.find(:all, :conditions => { :number => 10 }) # person.addresses.find(:first, :conditions => { :number => 10 }) # person.addresses.find(:last, :conditions => { :number => 10 }) # # @param [ Array<Object> ] args Various arguments. # # @return [ Array<Document>, Document ] A single or multiple documents. def find(*args) criteria.find(*args) end # Instantiate a new embeds_many relation. # # @example Create the new relation. # Many.new(person, addresses, metadata) # # @param [ Document ] base The document this relation hangs off of. # @param [ Array<Document> ] target The child documents of the relation. # @param [ Metadata ] metadata The relation's metadata # # @return [ Many ] The proxy. def initialize(base, target, metadata) init(base, target, metadata) do target.each_with_index do |doc, index| integrate(doc) doc._index = index end end end # Get all the documents in the relation that are loaded into memory. # # @example Get the in memory documents. # relation.in_memory # # @return [ Array<Document> ] The documents in memory. # # @since 2.1.0 def in_memory target end # Substitutes the supplied target documents for the existing documents # in the relation. # # @example Substitute the relation's target. # person.addresses.substitute([ address ]) # # @param [ Array<Document> ] new_target The replacement array. # @param [ true, false ] building Are we in build mode? # # @return [ Many ] The proxied relation. # # @since 2.0.0.rc.1 def substitute(replacement) tap do |proxy| if replacement.blank? if assigning? base.atomic_unsets.push(proxy.first.atomic_path) end proxy.clear else atomically(:$set) do if replacement.first.is_a?(Hash) replacement = Many.builder(metadata, replacement).build end proxy.target = replacement.compact proxy.target.each_with_index do |doc, index| integrate(doc) doc._index = index doc.save if base.persisted? && !assigning? end end end end end # Get this relation as as its representation in the database. # # @example Convert the relation to an attributes hash. # person.addresses.as_document # # @return [ Array<Hash> ] The relation as stored in the db. # # @since 2.0.0.rc.1 def as_document [].tap do |attributes| target.each do |doc| attributes << doc.as_document end end end # Get a criteria for the embedded documents without the default scoping # applied. # # @example Get the unscoped criteria. # person.addresses.unscoped # # @return [ Criteria ] The unscoped criteria. # # @since 2.2.1 def unscoped criteria(false) end private # Appends the document to the target array, updating the index on the # document at the same time. # # @example Append to the document. # relation.append(document) # # @param [ Document ] document The document to append to the target. # # @since 2.0.0.rc.1 def append(document) target.push(document) integrate(document) document._index = target.size - 1 end # Instantiate the binding associated with this relation. # # @example Create the binding. # relation.binding([ address ]) # # @param [ Array<Document> ] new_target The new documents to bind with. # # @return [ Binding ] The many binding. # # @since 2.0.0.rc.1 def binding Bindings::Embedded::Many.new(base, target, metadata) end # Returns the criteria object for the target class with its documents set # to target. # # @example Get a criteria for the relation. # relation.criteria # # @return [ Criteria ] A new criteria. def criteria(scoped = true) klass.criteria(true, scoped).tap do |criterion| criterion.documents = target end end # Integrate the document into the relation. will set its metadata and # attempt to bind the inverse. # # @example Integrate the document. # relation.integrate(document) # # @param [ Document ] document The document to integrate. # # @since 2.1.0 def integrate(document) characterize_one(document) bind_one(document) end # If the target array does not respond to the supplied method then try to # find a named scope or criteria on the class and send the call there. # # If the method exists on the array, use the default proxy behavior. # # @param [ Symbol, String ] name The name of the method. # @param [ Array ] args The method args # @param [ Proc ] block Optional block to pass. # # @return [ Criteria, Object ] A Criteria or return value from the target. def method_missing(name, *args, &block) return super if target.respond_to?(name) klass.send(:with_scope, criteria) do criteria.send(name, *args, &block) end end # Are we able to persist this relation? # # @example Can we persist the relation? # relation.persistable? # # @return [ true, false ] If the relation is persistable. # # @since 2.1.0 def persistable? base.persisted? && !binding? end # Reindex all the target elements. This is useful when performing # operations on the proxied target directly and the indices need to # match that on the database side. # # @example Reindex the relation. # person.addresses.reindex # # @since 2.0.0.rc.1 def reindex target.each_with_index do |doc, index| doc._index = index end end # Remove all documents from the relation, either with a delete or a # destroy depending on what this was called through. # # @example Destroy documents from the relation. # relation.remove_all(:conditions => { :num => 1 }, true) # # @param [ Hash ] conditions Conditions to filter by. # @param [ true, false ] destroy If true then destroy, else delete. # # @return [ Integer ] The number of documents removed. def remove_all(conditions = {}, method = :delete) criteria = find(:all, conditions || {}) criteria.size.tap do criteria.each do |doc| target.delete_one(doc) doc.send(method, :suppress => true) unless assigning? unbind_one(doc) end reindex end end class << self # Return the builder that is responsible for generating the documents # that will be used by this relation. # # @example Get the builder. # Embedded::Many.builder(meta, object) # # @param [ Metadata ] meta The metadata of the relation. # @param [ Document, Hash ] object A document or attributes to build # with. # # @return [ Builder ] A newly instantiated builder object. # # @since 2.0.0.rc.1 def builder(meta, object, loading = false) Builders::Embedded::Many.new(meta, object, loading) end # Returns true if the relation is an embedded one. In this case # always true. # # @example Is the relation embedded? # Embedded::Many.embedded? # # @return [ true ] true. # # @since 2.0.0.rc.1 def embedded? true end # Returns the macro for this relation. Used mostly as a helper in # reflection. # # @example Get the relation macro. # Mongoid::Relations::Embedded::Many.macro # # @return [ Symbol ] :embeds_many # # @since 2.0.0.rc.1 def macro :embeds_many end # Return the nested builder that is responsible for generating the # documents that will be used by this relation. # # @example Get the nested builder. # NestedAttributes::Many.builder(attributes, options) # # @param [ Metadata ] metadata The relation metadata. # @param [ Hash ] attributes The attributes to build with. # @param [ Hash ] options The builder options. # # @option options [ true, false ] :allow_destroy Can documents be # deleted? # @option options [ Integer ] :limit Max number of documents to # create at once. # @option options [ Proc, Symbol ] :reject_if If documents match this # option then they are ignored. # @option options [ true, false ] :update_only Only existing documents # can be modified. # # @return [ NestedBuilder ] The nested attributes builder. # # @since 2.0.0.rc.1 def nested_builder(metadata, attributes, options) Builders::NestedAttributes::Many.new(metadata, attributes, options) end # Get the path calculator for the supplied document. # # @example Get the path calculator. # Proxy.path(document) # # @param [ Document ] document The document to calculate on. # # @return [ Mongoid::Atomic::Paths::Embedded::Many ] # The embedded many atomic path calculator. # # @since 2.1.0 def path(document) Mongoid::Atomic::Paths::Embedded::Many.new(document) end # Tells the caller if this relation is one that stores the foreign # key on its own objects. # # @example Does this relation store a foreign key? # Embedded::Many.stores_foreign_key? # # @return [ false ] false. # # @since 2.0.0.rc.1 def stores_foreign_key? false end # Get the valid options allowed with this relation. # # @example Get the valid options. # Relation.valid_options # # @return [ Array<Symbol> ] The valid options. # # @since 2.1.0 def valid_options [ :as, :cyclic, :order, :versioned ] end # Get the default validation setting for the relation. Determines if # by default a validates associated will occur. # # @example Get the validation default. # Proxy.validation_default # # @return [ true, false ] The validation default. # # @since 2.1.9 def validation_default true end end end end end end
cbrauchli/mongoid
lib/mongoid/relations/embedded/many.rb
Ruby
mit
18,609
//document.write("It works."); document.write(require("./content.js"));
cestr/webpack-tutorials
01-welcome-2/entry.js
JavaScript
mit
72
<h3>add arena</h3> <?php $nama = array( 'name' => 'nama', 'id' => 'nama', 'value' => set_value('nama'), 'maxlength' => 80, 'size' => 30, 'class' => 'form-control', 'autofocus' => 1, 'required' => 'required' ); $harga_per_jam = array( 'name' => 'harga_per_jam', 'id' => 'harga_per_jam', 'value' => set_value('harga_per_jam'), 'maxlength' => 11, 'size' => 30, 'class' => 'form-control', 'autofocus' => 1, 'required' => 'required' ); $lapangan_id = array( // this is a dropdown 'name' => 'lapangan_id', 'id' => 'lapangan_id', 'options' => $daftarLapangan, 'value' => set_value('lapangan_id') ); // id_pemilik ?> <?php echo form_open( site_url(implode('/', $this->uri->segment_array()), is_https() ? 'https' : 'http')); ?> <?php echo form_label('Nama', $nama['id']); ?> <?php echo form_input($nama); ?> <?php echo form_error($nama['name']); ?> <br> <?php echo form_label('Harga per Jam', $harga_per_jam['id']); ?> <?php echo form_input($harga_per_jam); ?> <?php echo form_error($harga_per_jam['name']); ?> <br> <?php echo form_label('Lapangan', $lapangan_id['id']); ?> <?php echo form_dropdown($lapangan_id['name'], $lapangan_id['options'], $lapangan_id['value'], "id='$lapangan_id[id]'"); ?> <?php echo form_error($lapangan_id['name']); ?> <br> <?php echo form_submit("mysumbit", "Submit"); echo form_close(); ?>
gifff/wheresmycourt
application/views/superuser/add_arena.php
PHP
mit
1,408
package it.golem.model.events; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import org.joda.time.DateTime; import com.googlecode.objectify.annotation.Entity; import com.googlecode.objectify.annotation.Id; import com.googlecode.objectify.annotation.Index; @Entity @Data @AllArgsConstructor @NoArgsConstructor public class Event { @Id private Long id; @Index private DateTime received; }
riccardotommasini/GDA
src/it/golem/model/events/Event.java
Java
mit
437
/* Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'find', 'ro', { find: 'Găseşte', findOptions: 'Find Options', findWhat: 'Găseşte:', matchCase: 'Deosebeşte majuscule de minuscule (Match case)', matchCyclic: 'Potrivește ciclic', matchWord: 'Doar cuvintele întregi', notFoundMsg: 'Textul specificat nu a fost găsit.', replace: 'Înlocuieşte', replaceAll: 'Înlocuieşte tot', replaceSuccessMsg: '%1 căutări înlocuite.', replaceWith: 'Înlocuieşte cu:', title: 'Găseşte şi înlocuieşte' } );
Kunstmaan/BootstrapCK4-Skin
plugins/find/lang/ro.js
JavaScript
mit
659
/* * compact c compiler * **/ #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <stdarg.h> #include <string.h> #define BUFLEN 256 FILE *fp; enum { AST_INT, AST_STR, }; typedef struct Ast { int type; union { int ival; char *sval; struct { struct Ast *left; struct Ast *right; }; }; } Ast; Ast *read_prim(void); void emit_binop(Ast *ast); void error(char *fmt,...){ va_list args; va_start(args,fmt); vfprintf(stderr,fmt,args); fprintf(stderr,"\n"); va_end(args); exit(1); } Ast *make_ast_str(char *str){ Ast *r = malloc(sizeof(Ast)); r->type=AST_STR; r->sval=str; return r; } Ast *read_string(){ char *buf=malloc(BUFLEN); int i=0; for(;;){ int c=getc(stdin); if (c==EOF){ error("Unterminated string"); } if (c =='"'){ break;//finish string } buf[i++]=c; if(i==BUFLEN-1) error("String too long"); } //generate assembler buf[i]='\0'; return make_ast_str(buf); } Ast *make_ast_op(int type, Ast *left, Ast *right){ Ast *r = malloc(sizeof(Ast)); r->type=type; r->left=left; r->right=right; return r; } Ast *make_ast_int(int val){ Ast *r = malloc(sizeof(Ast)); r->type=AST_INT; r->ival=val; return r; } Ast *read_number(int n){ for (;;){ int c = getc(stdin); if (!isdigit(c)){ //数字ではないものが来たら、stdinに戻して数字を返す ungetc(c, stdin); return make_ast_int(n); } n = n * 10 +(c-'0'); } return 0; //not happen } void skip_space(void){ int c; while ((c = getc(stdin)) != EOF){ if (isspace(c)) continue; ungetc(c,stdin); return; } } int get_priority(char c){ if(c == '+'){ return 2; } else if(c == '-'){ return 2; } else if(c == '*'){ return 3; } else if(c == '/'){ return 3; } else{ return -1; } return 0; } Ast *read_expr2(int prec){ skip_space(); Ast *ast = read_prim(); if (!ast) return NULL; for(;;){ skip_space(); int c = getc(stdin); if (c == EOF){ return ast; } int prec2=get_priority(c); if (prec2 < prec){ ungetc(c, stdin); return ast; } skip_space(); ast = make_ast_op(c, ast, read_expr2(prec2+1)); } return ast; } Ast *read_prim(void){ int c=getc(stdin); if(isdigit(c)){ return read_number(c-'0'); } else if (c == '"'){ return read_string(); } else if (c==EOF){ return NULL; } error("Don't know how to handle '%c'",c); return 0; } void ensure_intexpr(Ast *ast) { if (ast->type == '+') return; else if (ast->type == '-') return; else if (ast->type == '*') return; else if (ast->type == '/') return; else if (ast->type == AST_INT) return; else error("integer or binary operator expected"); } void emit_intexpr(Ast *ast){ ensure_intexpr(ast); if (ast->type == AST_INT){ printf("mov $%d, %%eax\n\t", ast->ival); } else{ emit_binop(ast); } } void emit_binop(Ast *ast){ char *op; if(ast->type == '+'){ op= "add"; } else if(ast->type== '-'){ op= "sub"; } else if(ast->type== '*'){ op= "imul"; } else if(ast->type == '/'){ //do nothing } else{ error("invalid operand"); } emit_intexpr(ast->left); printf("push %%rax\n\t"); emit_intexpr(ast->right); if (ast->type == '/'){ printf("mov %%eax, %%ebx\n\t"); printf("pop %%rax\n\t"); printf("mov $0, %%edx\n\t"); printf("idiv %%ebx\n\t"); } else{ printf("pop %%rbx\n\t"); printf("%s %%ebx, %%eax\n\t", op); } } Ast *read_expr(void){ Ast *r = read_expr2(0); if(!r) return NULL; skip_space(); int c = getc(stdin); if (c != ';'){ error("Unterminated experssion"); } return r; } void print_quote(char *p){ while(*p){ if (*p=='\"' || *p == '\\') printf("\\"); printf("%c",*p); p++; } } void emit_string(Ast *ast) { printf("\t.data\n" ".mydata:\n\t" ".string \""); print_quote(ast->sval); printf("\"\n\t" ".text\n\t" ".global stringfn\n" "stringfn:\n\t" "lea .mydata(%%rip), %%rax\n\t" "ret\n" ); return; } void compile(Ast *ast){ if (ast->type == AST_STR){ emit_string(ast); } else{ printf(".text\n\t" ".global intfn\n" "intfn:\n\t"); emit_intexpr(ast); printf("ret\n"); } } void print_ast(Ast *ast){ switch(ast->type){ case AST_INT: printf("%d", ast->ival); break; case AST_STR: print_quote(ast->sval); break; default: printf("(%c ", ast->type); print_ast(ast->left); printf(" "); print_ast(ast->right); printf(")"); } } int main(int argc, char **argv){ fp = fopen( "debug.txt", "w" ); int want_ast=(argc > 1 && !strcmp(argv[1], "-a")); if(!want_ast){ printf(".text\n\t" ".global mymain\n" "mymain:\n\t"); } /* for(;;){ */ Ast *ast = read_expr(); /* if(!ast) break; */ if(want_ast){ print_ast(ast); } else{ compile(ast); } /* } */ if(!want_ast){ printf("ret\n"); } fclose(fp); return 0; }
AtsushiSakai/ccc
ccc.c
C
mit
5,181
--- title: aeo30 type: products image: /img/Screen Shot 2017-05-09 at 11.56.54 AM.png heading: o30 description: lksadjf lkasdjf lksajdf lksdaj flksadj flksa fdj main: heading: Foo Bar BAz description: |- ***This is i a thing***kjh hjk kj # Blah Blah ## Blah![undefined](undefined) ### Baah image1: alt: kkkk ---
pblack/kaldi-hugo-cms-template
site/content/pages2/aeo30.md
Markdown
mit
339
/** * @copyright * The MIT License (MIT) * * Copyright (c) 2014 Cosmic Dynamo LLC * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * @module jazzHands.query.function.boolean */ define([ "./_boolean" ], function (_boolean) { /** * Returns true if var is bound to a value. Returns false otherwise. Variables with the value NaN or INF are considered bound. * @see http://www.w3.org/TR/sparql11-query/#func-bound * @param {Object} execData * @param {jazzHands.query.DataRow} dataRow * @param {jazzHands.query.Variable} variable * @return {RdfJs.node.Literal<Boolean>} * @throws err:FORG0006, Invalid argument type */ function bound(execData, dataRow, variable) { return _boolean(variable.resolve(execData, dataRow) !== null); } return bound; });
CosmicDynamo/jazzHands
query/function/bound.js
JavaScript
mit
1,848
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using ApiPortVS.Contracts; using ApiPortVS.Resources; using Microsoft.Fx.Portability.Reporting; using Microsoft.VisualStudio.Shell.Interop; using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Threading.Tasks; namespace ApiPortVS.Reporting { public class VsBrowserReportViewer : IReportViewer { private readonly IFileSystem _fileSystem; private readonly TextWriter _output; private readonly IVsWebBrowsingService _browserService; public VsBrowserReportViewer(IFileSystem fileSystem, TextWriter output, IVsWebBrowsingService webBrowsingService) { _fileSystem = fileSystem; _output = output; _browserService = webBrowsingService; } public async Task ViewAsync(IEnumerable<string> urls) { foreach (var url in urls) { if (IsHtml(url)) { await ShowHtmlAsync(url).ConfigureAwait(false); } else { Process.Start(url); } } } private static bool IsHtml(string url) { var extension = Path.GetExtension(url); return string.Equals(".html", extension, StringComparison.OrdinalIgnoreCase) || string.Equals(".htm", extension, StringComparison.OrdinalIgnoreCase); } private async Task ShowHtmlAsync(string url) { const uint REUSE_EXISTING_BROWSER_IF_AVAILABLE = 0; await Microsoft.VisualStudio.Shell.ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); if (!_fileSystem.FileExists(url)) { _output.WriteLine(LocalizedStrings.CannotSaveReport, url); } else if (_browserService == null) { _output.WriteLine(LocalizedStrings.CannotViewReport); } else { IVsWindowFrame browserFrame; var errCode = _browserService.Navigate(url, REUSE_EXISTING_BROWSER_IF_AVAILABLE, out browserFrame); } } } }
JJVertical/dotnet-apiport
src/ApiPort.VisualStudio/Reporting/VsBrowserReportViewer.cs
C#
mit
2,366
<!DOCTYPE html> <!--[if lt IE 7]> <html lang="en" ng-app="myApp" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if IE 7]> <html lang="en" ng-app="myApp" class="no-js lt-ie9 lt-ie8"> <![endif]--> <!--[if IE 8]> <html lang="en" ng-app="myApp" class="no-js lt-ie9"> <![endif]--> <!--[if gt IE 8]><!--> <html lang="en" ng-app="myApp" class="no-js"> <!--<![endif]--> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>My AngularJS App</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="bower_components/html5-boilerplate/css/normalize.css"> <link rel="stylesheet" href="bower_components/html5-boilerplate/css/main.css"> <link rel="stylesheet" href="css/app.css"/> <script src="bower_components/html5-boilerplate/js/vendor/modernizr-2.6.2.min.js"></script> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> </head> <body> <!-- Nav Bar --> <ng-include src="'partials/ui-components/navbar.html'"> </ng-include> <!--[if lt IE 7]> <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> <![endif]--> <div ng-view> </div> <div>Angular seed app: v<span app-version></span></div> <!-- In production use: <script src="//ajax.googleapis.com/ajax/libs/angularjs/x.x.x/angular.min.js"></script> --> <script src="bower_components/angular/angular.js"></script> <script src="bower_components/angular-route/angular-route.js"></script> <script src="js/app.js"></script> <script src="js/services.js"></script> <script src="js/controllers.js"></script> <script src="js/filters.js"></script> <script src="js/directives.js"></script> </body> </html>
vbhartia/angular-test
app/index.html
HTML
mit
2,100
import React from 'react'; import { Link } from 'react-router-dom'; export default class Combatant extends React.Component { render() { return ( <div key={ this.props.id } className={this.props.index === 0 ? 'col-xs-6 col-sm-6 col-md-5 col-md-offset-1' : 'col-xs-6 col-sm-6 col-md-5'}> <div className='thumbnail fadeInUp animated'> <div className="image-container"> <div className="inner-container"> <img onClick={ this.props.upVote.bind(null, this.props.id) } src={ this.props.imageUrl } alt="cats"/> </div> </div> <div className='caption text-center'> <p>{ this.props.description }</p> <h4> <Link to={ `/characters/${ this.props.id }` }> <strong>{this.props.name}</strong> </Link> </h4> {this.props.isReported? null : <span onClick={ this.props.report.bind(null, this.props.id) } className="pull-right report">Report</span> } </div> </div> </div> ) } }
teamNOne/showdown
src/components/combatant/Combatant.js
JavaScript
mit
1,438
#CCB-X-Reader for Cocos2d-X This C++ class helps processing **ccb** files for your Cocos2d-X project. It's ported from the original CCBReader class of the popular **CocosBuilder** project. Note: the newly introduced **.ccbi** format is currently not supported. Basically, CCB-X-Reader reads and parses the **ccb** files and creates and initilizes correspoding Cocos2d instances for your Cocos2d-X project. It's just like its CCBReader.m counterpart in a Cocos2d-iPhone project. Once again, as of now, CCB-X-Reader only supports parsing **ccb** files. The newer and smaller **ccbi** format is currently not supported. #How to Play with the Example Project 1. The enclosing example project is a standard Cocos2d-X project based on Cocos2d-1.0.1-x-0.13.0 beta. It was written and tested on both iPhone and Android. 2. How to play with it: build and run. # How to Export CCB Files Using CocosBuilder 1. If you are using CocosBuilder 1.0, there's one and only one export format, and it's **ccb**. 2. However, if you are using CocosBuilder 1.1 or an even newer future version, the only export format is **ccbi**. But don't worry, take a look at the project file, it's actually right what we need, the **ccb** file. #How To Use CCB-X-Reader 1. Add these two classes to your Cocos2d-X project. CCBReader.h CCBClassGenerator.h 2. Make sure all the .ccb/.png/.jpg etc files are properly copied and added into your Cocos2d-X project. 3. Try parse a .ccb file with one line of code. //Here we initialize a customized CCScene instance from *example.ccb* created from CocosBuilder CCScene *pScene = CCBReader::sceneWithNodeGraphFromFile("example.ccb"); 4. C++ is not as dynamically implemented as Objective-C. For example, C++ is unable to create a class solely based on the class name string at runtime. Therefore we need a customized **CCBClassGenerator** class to handle all the Objective-C style dynamic stuff for us. The logic behind **CCBClassGenerator** is very simple. Basically all it does is string lookup. Make sure you have properly implemented the **CCBClassGenerator** class before running. YouTube Demo (running on an Android device): <http://www.youtube.com/watch?v=QgA0fkse-AA> #Known Issues 1. Due to some underlying bug in the Cocos2d-X implementation, when running on an iPhone 4s device, the example code will make the screen flicker. 2. This project is not finished yet. If you take a close look at the implementation, you'll see things like this: if (extraProps) { // To be implemented soon... } As the comments indicate, those missing parts will be implemented soon. At the same time, **You are welcome to contribute.** #Contact Email: <diwufet@gmail.com> Blog post: <http://diwublog.com/archives/262> ![Screenshot](http://pic.yupoo.com/diwup_v/BVXXyLqY/11Z8la.jpg)
diwu/CCB-X-Reader
README.md
Markdown
mit
2,808
package com.ch.configuration; import com.fasterxml.jackson.annotation.JsonProperty; import io.dropwizard.Configuration; import io.dropwizard.client.JerseyClientConfiguration; import javax.validation.Valid; import javax.validation.constraints.NotNull; /** * Created by Aaron.Witter on 07/03/2016. */ public class FormsServiceConfiguration extends Configuration { @Valid @NotNull @JsonProperty private final JerseyClientConfiguration jerseyClient = new JerseyClientConfiguration(); @JsonProperty private int rateLimit; @JsonProperty private SalesforceConfiguration salesforceConfiguration; @JsonProperty private CompaniesHouseConfiguration companiesHouseConfiguration; @JsonProperty private FluentLoggingConfiguration fluentLogging; @NotNull @JsonProperty private Log4jConfiguration log4jConfiguration; @NotNull @JsonProperty private String mongoDbUri; @NotNull @JsonProperty private String mongoDbName; @NotNull @JsonProperty private String mongoDbPackagesCollectionName; @NotNull @JsonProperty private String mongoDbFormsCollectionName; @JsonProperty private boolean testMode; public int getRateLimit() { return rateLimit; } public SalesforceConfiguration getSalesforceConfiguration() { return salesforceConfiguration; } public CompaniesHouseConfiguration getCompaniesHouseConfiguration() { return companiesHouseConfiguration; } public FluentLoggingConfiguration getFluentLoggingConfiguration() { return fluentLogging; } @JsonProperty("jerseyClient") public JerseyClientConfiguration getJerseyClientConfiguration() { return jerseyClient; } public Log4jConfiguration getLog4jConfiguration() { return log4jConfiguration; } public String getMongoDbUri() { return mongoDbUri; } public String getMongoDbName() { return mongoDbName; } public String getMongoDbPackagesCollectionName() { return mongoDbPackagesCollectionName; } public String getMongoDbFormsCollectionName() { return mongoDbFormsCollectionName; } public boolean isTestMode() { return testMode; } }
companieshouse/forms-enablement-api
src/main/java/com/ch/configuration/FormsServiceConfiguration.java
Java
mit
2,130
/* * This file is part of the React Redux starter repo. * * (c) Magnus Bergman <hello@magnus.sexy> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ import React, { PropTypes } from 'react' import { Provider } from 'react-redux' import { Router } from 'react-router' import routes from 'routes/routes' import DevTools from '../DevTools' /** * This is the Root component. * * @author Magnus Bergman <hello@magnus.sexy> */ const Root = ({ store, history }) => <Provider store={store}> <div> <Router history={history} routes={routes} /> <DevTools /> </div> </Provider> Root.propTypes = { store: PropTypes.object.isRequired, history: PropTypes.object.isRequired } export default Root
magnus-bergman/react-redux-starter
client/scripts/containers/Root/Root.dev.js
JavaScript
mit
805
require 'graphy' require 'json' RSpec.configure do |config| config.mock_with :mocha end
mackuba/graphy
spec/spec_helper.rb
Ruby
mit
91
module EightPuzzle class PuzzleSolver def initialize(strategy) @strategy = strategy @solution = nil end def solve until @strategy.solved_puzzle @strategy.check_next_node end end def solved? @strategy.solved_puzzle ? true : false end def solution return nil unless solved? return @solution if @solution str = "" solution = [] puzzle = @strategy.solved_puzzle while (puzzle) solution << puzzle puzzle = puzzle.parent end solution.reverse! str += "Total Steps: #{solution.count}\n" str += "Nodes Searched: #{@strategy.nodes_searched}\n\n" solution.each do |state| str += "#{state}\n\n" end @solution = str end end end
akmassey/ruby-eightpuzzle
lib/eightpuzzle/puzzle_solver.rb
Ruby
mit
800
# -*- coding:utf-8 -*- # Copyright (c) 2013, Theo Crevon # Copyright (c) 2013, Greg Leclercq # # See the file LICENSE for copying permission. from itertools import groupby from swf.models.event import EventFactory, CompiledEventFactory from swf.models.event.workflow import WorkflowExecutionEvent from swf.utils import cached_property class History(object): """Execution events history container History object is an Event subclass objects container which can be built directly against an amazon json response using it's from_event_list method. It is iterable and exposes a list-like __getitem__ for easier manipulation. :param events: Events list to build History upon :type events: list Typical amazon response looks like: .. code-block:: json { "events": [ { 'eventId': 1, 'eventType': 'WorkflowExecutionStarted', 'workflowExecutionStartedEventAttributes': { 'taskList': { 'name': 'test' }, 'parentInitiatedEventId': 0, 'taskStartToCloseTimeout': '300', 'childPolicy': 'TERMINATE', 'executionStartToCloseTimeout': '6000', 'workflowType': { 'version': '0.1', 'name': 'test-1' }, }, 'eventTimestamp': 1365177769.585, }, { 'eventId': 2, 'eventType': 'DecisionTaskScheduled', 'decisionTaskScheduledEventAttributes': { 'startToCloseTimeout': '300', 'taskList': { 'name': 'test' } }, 'eventTimestamp': 1365177769.585 } ] } """ def __init__(self, *args, **kwargs): self.events = kwargs.pop('events', []) self.raw = kwargs.pop('raw', None) self.it_pos = 0 def __len__(self): return len(self.events) def __getitem__(self, val): if isinstance(val, int): return self.events[val] elif isinstance(val, slice): return History(events=self.events[val]) raise TypeError("Unknown slice format: %s" % type(val)) def __repr__(self): events_repr = '\n\t'.join( map(lambda e: e.__repr__(), self.events) ) repr_str = '<History\n\t%s\n>' % events_repr return repr_str def __iter__(self): return self def next(self): try: next_event = self.events[self.it_pos] self.it_pos += 1 except IndexError: self.it_pos = 0 raise StopIteration return next_event @property def last(self): """Returns the last stored event :rtype: swf.models.event.Event """ return self.events[-1] def latest(self, n): """Returns the n latest events stored in the History :param n: latest events count to return :type n: int :rtype: list """ end_pos = len(self.events) start_pos = len(self.events) - n return self.events[start_pos:end_pos] @property def first(self): """Returns the first stored event :rtype: swf.models.event.Event """ return self.events[0] @property def finished(self): """Checks if the History matches with a finished Workflow Execution history state. """ completion_states = ( 'completed', 'failed', 'canceled', 'terminated' ) if (isinstance(self.last, WorkflowExecutionEvent) and self.last.state in completion_states): return True return False def filter(self, **kwargs): """Filters the history based on kwargs events attributes Basically, allows to filter the history events upon their types and states. Can be used for example to retrieve every 'DecisionTask' in the history, to check the presence of a specific event and so on... example: .. code-block:: python >>> history_obj.filter(type='ActivityTask', state='completed') # doctest: +SKIP <History <Event 23 ActivityTask : completed> <Event 42 ActivityTask : completed> <Event 61 ActivityTask : completed> > >>> history_obj.filter(type='DecisionTask') # doctest: +SKIP <History <Event 2 DecisionTask : scheduled> <Event 3 DecisionTask : started> <Event 7 DecisionTask : scheduled> <Event 8 DecisionTask : started> <Event 20 DecisionTask : scheduled> <Event 21 DecisionTask : started> > :rtype: swf.models.history.History """ return filter( lambda e: all(getattr(e, k) == v for k, v in kwargs.iteritems()), self.events ) @property def reversed(self): for i in xrange(len(self.events) - 1, -1, -1): yield self.events[i] @property def distinct(self): """Extracts distinct history events based on their types :rtype: list of swf.models.event.Event """ distinct_events = [] for key, group in groupby(self.events, lambda e: e.type): g = list(group) # Merge every WorkflowExecution events into same group if (len(g) == 1 and len(distinct_events) >= 1 and g[0].type == "WorkflowExecution"): # WorfklowExecution group will always be in first position distinct_events[0].extend(g) else: distinct_events.append(list(g)) return distinct_events def compile(self): """Compiles history events into a stateful History based on events types and states transitions. Every events stored in the resulting history are stateful CompiledEvent subclasses instances then. :rtype: swf.models.history.History made of swf.models.event.CompiledEvent """ distinct_events = self.distinct compiled_history = [] for events_list in distinct_events: if len(events_list) > 0: compiled_event = CompiledEventFactory(events_list[0]) for event in events_list[1:]: compiled_event.transit(event) compiled_history.append(compiled_event) return History(events=compiled_history) @cached_property def compiled(self): """Compiled history version :rtype: swf.models.history.History made of swf.models.event.CompiledEvent """ return self.compile() @classmethod def from_event_list(cls, data): """Instantiates a new ``swf.models.history.History`` instance from amazon service response. Every member of the History are ``swf.models.event.Event`` subclasses instances, exposing their type, state, and so on to facilitate decisions according to the history. :param data: event history description (typically, an amazon response) :type data: dict :returns: History model instance built upon data description :rtype : swf.model.event.History """ events_history = [] for index, d in enumerate(data): event = EventFactory(d) events_history.append(event) return cls(events=events_history, raw=data)
botify-labs/python-simple-workflow
swf/models/history/base.py
Python
mit
7,957
# atom-package-config-observer changelog ## 0.0.7 * Rename editorsForObservedScopes -> editorsByScope ## 0.0.6 * Fix issue where disposable wouldn't dispose ## 0.0.5 * Fix issue when disposable wouldn't dispose ## 0.0.4 * Add onDidDisposeScope public API ## 0.0.3 * Fix issue where `editorsForObservedScopes` would return `null` for scopes without an associated editor ## 0.0.2 * initial release
olmokramer/atom-package-config-observer
CHANGELOG.md
Markdown
mit
402
--- title: aed12 type: products image: /img/Screen Shot 2017-05-09 at 11.56.54 AM.png heading: d12 description: lksadjf lkasdjf lksajdf lksdaj flksadj flksa fdj main: heading: Foo Bar BAz description: |- ***This is i a thing***kjh hjk kj # Blah Blah ## Blah![undefined](undefined) ### Baah image1: alt: kkkk ---
pblack/kaldi-hugo-cms-template
site/content/pages2/aed12.md
Markdown
mit
339
using System.Web; using System.Web.Mvc; #pragma warning disable 1591 namespace LocalizacaoApi { /// <summary> /// Filters Configurations /// </summary> public class FilterConfig { /// <summary> /// Global filters. /// </summary> /// <param name="filters">Filters</param> public static void RegisterGlobalFilters(GlobalFilterCollection filters) { filters.Add(new ErrorHandler.AiHandleErrorAttribute()); } } }
GuilhermeMorais/LocalizacaoApi
LocalizacaoApi/LocalizacaoApi/App_Start/FilterConfig.cs
C#
mit
504
import { OnInit, EventEmitter, OnChanges } from '@angular/core'; export declare class DatePickerInnerComponent implements OnInit, OnChanges { datepickerMode: string; startingDay: number; yearRange: number; minDate: Date; maxDate: Date; minMode: string; maxMode: string; showWeeks: boolean; formatDay: string; formatMonth: string; formatYear: string; formatDayHeader: string; formatDayTitle: string; formatMonthTitle: string; onlyCurrentMonth: boolean; shortcutPropagation: boolean; customClass: Array<{ date: Date; mode: string; clazz: string; }>; dateDisabled: any; initDate: Date; selectionDone: EventEmitter<Date>; stepDay: any; stepMonth: any; stepYear: any; private modes; private dateFormatter; private uniqueId; private _activeDate; private selectedDate; private activeDateId; private refreshViewHandlerDay; private compareHandlerDay; private refreshViewHandlerMonth; private compareHandlerMonth; private refreshViewHandlerYear; private compareHandlerYear; private update; activeDate: Date; ngOnInit(): void; ngOnChanges(): void; setCompareHandler(handler: Function, type: string): void; compare(date1: Date, date2: Date): number; setRefreshViewHandler(handler: Function, type: string): void; refreshView(): void; dateFilter(date: Date, format: string): string; isActive(dateObject: any): boolean; createDateObject(date: Date, format: string): any; split(arr: Array<any>, size: number): Array<any>; fixTimeZone(date: Date): Date; select(date: Date): void; move(direction: number): void; toggleMode(direction: number): void; private getCustomClassForDate(date); private isDisabled(date); }
tom-schier/Angular2
node_modules/ng2-bootstrap/components/datepicker/datepicker-inner.component.d.ts
TypeScript
mit
1,836
# sln-opener [![npm version](https://badge.fury.io/js/sln-opener.svg)](https://badge.fury.io/js/sln-opener) A simple command line tool for opening solution files via the console. It will look for solution files (.sln) and open them. If multiple solution files are found, they will be listed as a menu to pick from. The first menu option allows you to open all solutions found. When this tool initially loads it will ask for the path to your Visual Studio instance. It also requires you to run your CLI in administrative mode. ## Install ``` npm install -g sln-opener ``` ## Usage In a directory that has visual studio solution files type: ``` os ```
shaneom/sln-opener
readme.md
Markdown
mit
661
var assert = require('chai').assert; var ss = require('../../../script_sanitize'); var describe = require('mocha/lib/mocha.js').describe; var it = require('mocha/lib/mocha.js').it; var script_sanitize = ss.sanitize; module.exports = function () { describe("attributes", function () { it('should replace the attribute specified', function() { var a = script_sanitize("<h1 onload=''></h1>", { attributes: ["onload"], tags: [] }); assert.isOk(!a.includes("onload")); }); it('should support multiple attributes', function() { var a = script_sanitize("<h1 onload='' onmouseover=''></h1>", { attributes: ["onload", "onmouseover"], tags: [] }); assert.isOk(!a.includes("onload")); assert.isOk(!a.includes("onmouseover")); }); it('should remove nested attributes', function () { var a = script_sanitize("<h1 onload='onload='''></h1>", { attributes: ["onload", "onmouseover"], tags: [] }); assert.isOk(!a.includes("onload")); }); }); };
EverlessDrop41/script_sanitizer.js
test/script_sanitize_tests/options_tests/attributes_test.js
JavaScript
mit
1,001
import resource from 'resource-router-middleware'; import model from '../models/users'; export default ({ config, db }) => resource({ /** Property name to store preloaded entity on `request`. */ id : 'user', mergeParams: true, /** For requests with an `id`, you can auto-load the entity. * Errors terminate the request, success sets `req[id] = data`. */ load(req, id, callback) { let query = { select: '-_id -__v' }; model.findOne({id: id}, query.select, function(err, record) { let error = record ? null : 'Not found'; callback(error, record); }); }, /** GET / - List all entities */ index(params, res) { let urlQuery = {}; let searchable = ['fullName', 'email', 'workPhone', 'personalPhone']; params.query.select = { '_id': 0, 'id': 1, 'fullName': 1, 'email': 1, 'workPhone': 1, 'personalPhone': 1 }; if(!params.query.active || params.query.active === 'false') { urlQuery.active = false; } else { urlQuery.active = true; } if(!params.query.limit) { params.query.limit = config.pagination; } if(!params.query.sort) { params.query.sort = 'id'; } if(params.query.sort) { params.query.sort = params.query.sort; } for(var key in params.query) { if(!isNaN(parseFloat((params.query[key])))) { params.query[key] = parseInt(params.query[key]); } } if(params.query.find) { let parsed = JSON.parse(params.query.find); let queryArray = []; for ( let property in parsed ) { if( (searchable.indexOf(property) > -1) ) { let userSearch = new RegExp(parsed[property], 'i'); let tempObj = {}; tempObj[property] = userSearch; queryArray.push(tempObj); } } //we ensure we only search for proper active/inactive records let activeQuery = { 'active': urlQuery.active } queryArray.push(activeQuery); urlQuery = { $and: queryArray, }; } model.paginate( urlQuery ,params.query, function(err, result) { if(err) { console.log(err); res.sendStatus(500); } res.json(result); }); }, /** POST / - Create a new entity */ create(req, res) { console.log(req.body); let newModel = new model(req.body); newModel.save((err, user) => { if(err) { console.error(err); if (err.name === 'MongoError' && err.code === 11000) { // Duplicate username return res.status(400).send({ success: false, message: 'Email is not unique' }); } return res.status(400).send({ success: false, message: err }); } else { return res.status(200).send({success: true}); } }); }, /** GET /:id - Return a given entity */ read( record , res) { res.status(200).json(record['user']); }, /** PUT /:id - Update a given entity */ update({ facet, body }, res) { for (let key in body) { if (key!=='id') { facet[key] = body[key]; } } res.sendStatus(204); }, /** DELETE /:id - Delete a given entity */ delete({ facet }, res) { facets.splice(facets.indexOf(facet), 1); res.sendStatus(204); }, });
Matt1024961/mock-server
src/api/users.js
JavaScript
mit
3,293
namespace ScriptLoader.Core { public static class ScriptLoader { public static IScriptStore DefaultScriptStore = new HttpContextStore(); public static IScriptRegistrationConfig Header() { return new ScriptRegistrationConfig(ScriptPosition.Header, DefaultScriptStore); } public static IScriptRegistrationConfig Footer() { return new ScriptRegistrationConfig(ScriptPosition.Footer, DefaultScriptStore); } } }
JosephWoodward/ScriptLoader
ScriptLoader.Core/ScriptLoader.cs
C#
mit
519
<?php (defined('BASEPATH')) OR exit('No direct script access allowed'); /* load the MX_Router class */ require APPPATH."third_party/MX/Router.php"; class MY_Router extends MX_Router { }
nugroup/nuCMS
application/core/MY_Router.php
PHP
mit
194
<?php return [ '@class' => 'Grav\\Common\\File\\CompiledYamlFile', 'filename' => '/Applications/MAMP/htdocs/aquamu/user/config/plugins/admin.yaml', 'modified' => 1479238366, 'data' => [ 'enabled' => true, 'route' => '/admin', 'cache_enabled' => false, 'theme' => 'grav', 'sidebar' => [ 'activate' => 'tab', 'hover_delay' => 100, 'size' => 'auto' ], 'dashboard' => [ 'days_of_stats' => 7 ], 'widgets' => [ 'dashboard-maintenance' => false, 'dashboard-statistics' => true, 'dashboard-notifications' => true, 'dashboard-feed' => false, 'dashboard-pages' => true ], 'session' => [ 'timeout' => 1800 ], 'warnings' => [ 'delete_page' => true ], 'edit_mode' => 'normal', 'show_github_msg' => true, 'google_fonts' => true, 'enable_auto_updates_check' => true, 'notifications' => [ 'feed' => true, 'dashboard' => true, 'plugins' => true, 'themes' => true ], 'popularity' => [ 'enabled' => true, 'ignore' => [ 0 => '/test*', 1 => '/modular' ], 'history' => [ 'daily' => '30', 'monthly' => '12', 'visitors' => '20' ] ] ] ];
alexstomp/aquamu
cache/compiled/files/56599d33452e452baea13f4c0d501704.yaml.php
PHP
mit
1,529
using System.Linq; namespace SoftwarePatterns.Core.EventAggregator { public interface IEventAggregator { void Publish<TEvent>(TEvent eventToPublish); void Subscribe(object subscriber); } }
feanz/SoftwarePatterns
src/SoftwarePatterns.Core/EventAggregator/IEventAggregator.cs
C#
mit
199
;(function(dragula){ 'use strict'; angular.module('angular-dragula', []) .factory('ngDragulaFactory', ['$timeout', function($timeout){ function get(name){ return $timeout(function(){ if(name === 'get'){ throw new Error('RESERVE_WORD'); } if(this[name]){ return this[name] }else{ throw new Error('NOT_FOUND'); } }.bind(this), 500) }; return { get: get }; }]) .directive('ngDragula', ['ngDragulaFactory', function(ngDragulaFactory){ return { restrict: 'A', scope: { config: '=' }, link: function(scope, element, attrs){ var drag = scope.config; ngDragulaFactory[drag.name] = dragula(drag.elements, drag); }; } }]); }(dragula));
realmike33/angular-dragula
src/angular-dragula.js
JavaScript
mit
866
import csv import re import datetime import string import collections def get_nr_data(): ''' returns a list of lists each entry represents one row of NiceRide data in form -- [[11/1/2015, 21:55], '4th Street & 13th Ave SE', '30009', [11/1/2015, 22:05], 'Logan Park', '30104', '565', 'Casual'] where the indices are 0: [start_date, start_time] 1: start_station, 2: start_terminal, 3: [end_date, end_time] 4: end_station, 5: end_terminal, 6: duration (seconds), 7: account_type (member/casual) ''' nr_datafile = open('NiceRideData2015.csv', 'r') nr_data = [] reader = csv.reader(nr_datafile) for line in reader: nr_data.append(reader.next()) nr_datafile.close() nr_data = nr_data[1:] index = 0 for line in nr_data: # print line date_data = re.match('(\d+)/(\d+)/(\d+) (\d+):(\d+)', line[0]) start_date = datetime.date(int(date_data.group(3)), int(date_data.group(1)), int(date_data.group(2))) start_time = datetime.time(int(date_data.group(4)), int(date_data.group(5)), 0) nr_data[index][0] = [start_date, start_time] date_data = re.match('(\d+)/(\d+)/(\d+) (\d+):(\d+)', line[3]) end_date = datetime.date(int(date_data.group(3)), int(date_data.group(1)), int(date_data.group(2))) end_time = datetime.time(int(date_data.group(4)), int(date_data.group(5)), 0) nr_data[index][3] = [end_date, end_time] index += 1 return nr_data def get_wx_data(filename): ''' returns a list of lists, each entry represents a day of weather data in the form -- ['1', '30', '11', '21', '5', '44', '0', 'T', 'T', '3', '10.4', '20', '330', 'M', 'M', '8', '26', '330'] where the indices are 0: day_of_month, 1: max_temp, 2: min_temp, 3: avg_temp, 4: dev_from_norm, 5: heating/cooling_day, 6: tot_precip, 7: tot_snowfall, 8: snow_depth, 9: avg_wind_speed, 10: max_wind_speed, 11: wind_dir, 12: min_sun (if reported), 13: percent_possible_sun (if reported), 14: avg_sky_cover [0(clear) - 10(cloudy)], 15: wx_event [ 1: fog, 2: fog reducing vis to < 1/4 mile, 3: thunder, 4: ice pellets, 5: hail, 6: glaze/rime, 7: blowing particulate < 1/4 mile vis, 8:smoke/haze, 9: blowing snow, X: tornado ], 16: max_wind_gust, 17: max_wind_gust_dir ''' wxfile = open('wx_data/%s' % filename, 'r') wxdata = wxfile.readlines() wxfile.close() wxdata = wxdata[13:] index = 0 for line in wxdata: wxdata[index] = [x for x in string.split(line.strip()) if x != ''] index += 1 # print wxdata return wxdata def get_all_wx_data(): '''combines all months of weather data into a dict with month abbrevs as keys''' wx_data = collections.OrderedDict() wx_data['jan'] = get_wx_data('1_wx.dat') wx_data['feb'] = get_wx_data('2_wx.dat') wx_data['mar'] = get_wx_data('3_wx.dat') wx_data['apr'] = get_wx_data('4_wx.dat') wx_data['may'] = get_wx_data('5_wx.dat') wx_data['jun'] = get_wx_data('6_wx.dat') wx_data['jul'] = get_wx_data('7_wx.dat') wx_data['aug'] = get_wx_data('8_wx.dat') wx_data['sep'] = get_wx_data('9_wx.dat') wx_data['oct'] = get_wx_data('10_wx.dat') wx_data['nov'] = get_wx_data('11_wx.dat') wx_data['dec'] = get_wx_data('12_wx.dat') return wx_data def monthindex(month): ''' given a three char month abbreviation, return the integer month index''' if month == 'jan': return 1 elif month == 'feb': return 2 elif month == 'mar': return 3 elif month == 'apr': return 4 elif month == 'may': return 5 elif month == 'jun': return 6 elif month == 'jul': return 7 elif month == 'aug': return 8 elif month == 'sep': return 9 elif month == 'oct': return 10 elif month == 'nov': return 11 else: return 12 def main(): '''main, do all the things''' # load nr_data nr_data = get_nr_data() # load each month wx data into a dict wx_data = get_all_wx_data() combined_data_table = collections.OrderedDict() for month in wx_data: # print month for day in wx_data[month]: # print day[0] this_day = datetime.date(2015, monthindex(month), int(day[0])) # print this_day # print day # rides = [x for x in nr_data if x[0][0] == this_day] rides = [] for row in nr_data: # print row[0][0] if row[0][0] == this_day: rides.append(row) data = {'avg_temp': int(day[3]), 'precip': int(day[6]), 'ride_count': len(rides)} combined_data_table['%s_%s' % (month, day[0])] = data # print_data(combined_data_table) new_print(combined_data_table) def new_print(table): outfile = open('NiceRideDataOut.dat', 'w') for row in table: outfile.write("{'%s': %s}\n" % (row, table[row])) # print row, ": ", table[row] outfile.close() def print_data(table): jan_data = {} feb_data = {} mar_data = {} apr_data = {} may_data = {} jun_data = {} jul_data = {} aug_data = {} sep_data = {} oct_data = {} nov_data = {} dec_data = {} for row in table: if row.startswith('jan'): jan_data[row] = table[row] elif row.startswith('feb'): feb_data[row] = table[row] elif row.startswith('mar'): mar_data[row] = table[row] elif row.startswith('apr'): apr_data[row] = table[row] elif row.startswith('may'): may_data[row] = table[row] elif row.startswith('jun'): jun_data[row] = table[row] elif row.startswith('jul'): jul_data[row] = table[row] elif row.startswith('aug'): aug_data[row] = table[row] elif row.startswith('sep'): sep_data[row] = table[row] elif row.startswith('oct'): oct_data[row] = table[row] elif row.startswith('nov'): nov_data[row] = table[row] elif row.startswith('dec'): dec_data[row] = table[row] for key in sorted(jan_data): print "%s: %s" % (key, jan_data[key]) for key in sorted(feb_data): print "%s: %s" % (key, feb_data[key]) for key in sorted(mar_data): print "%s: %s" % (key, mar_data[key]) for key in sorted(apr_data): print "%s: %s" % (key, apr_data[key]) for key in sorted(may_data): print "%s: %s" % (key, may_data[key]) for key in sorted(jun_data): print "%s: %s" % (key, jun_data[key]) for key in sorted(jul_data): print "%s: %s" % (key, jul_data[key]) for key in sorted(aug_data): print "%s: %s" % (key, aug_data[key]) for key in sorted(sep_data): print "%s: %s" % (key, sep_data[key]) for key in sorted(oct_data): print "%s: %s" % (key, oct_data[key]) for key in sorted(nov_data): print "%s: %s" % (key, nov_data[key]) for key in sorted(dec_data): print "%s: %s" % (key, dec_data[key]) if __name__ == '__main__': main()
stinbetz/nice_ride_charting
datify.py
Python
mit
7,682
class OuterClass { int i = 10; //Non-static Field of OuterClass static void methodOne() { System.out.println("Static method of OuterClass"); } static class NestedClassOne { int i = 20; //Non-static Field of NestedClassOne static void methodOne() { System.out.println("Static method of NestedClassOne"); } } static class NestedClassTwo { int i = 30; //Non-static Field of NestedClassTwo static void methodOne() { System.out.println("static method of NestedClassTwo"); } } } class Runner { public static void main(String[] args) { OuterClass.methodOne(); //static member can be accessed directly through class name. OuterClass outer = new OuterClass(); System.out.println(outer.i); //Instance member must be accessed through object reference OuterClass.NestedClassOne.methodOne(); //static member can be accessed directly through class name. OuterClass.NestedClassOne nestedOne = new OuterClass.NestedClassOne(); System.out.println(nestedOne.i); //Instance member must be accessed through object reference OuterClass.NestedClassTwo.methodOne(); //static member can be accessed directly through class name. OuterClass.NestedClassTwo nestedTwo = new OuterClass.NestedClassTwo(); System.out.println(nestedTwo.i); //Instance member must be accessed through object reference } }
wolfdale/30Days
Day24/AccessNestedClass.java
Java
mit
1,531
/*! * * Super simple WYSIWYG editor v0.8.19 * https://summernote.org * * * Copyright 2013- Alan Hong and contributors * Summernote may be freely distributed under the MIT license. * * Date: 2021-10-13T19:41Z * */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else { var a = factory(); for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; } })(self, function() { return /******/ (() => { // webpackBootstrap var __webpack_exports__ = {}; (function ($) { $.extend($.summernote.lang, { 'cs-CZ': { font: { bold: 'Tučné', italic: 'Kurzíva', underline: 'Podtržené', clear: 'Odstranit styl písma', height: 'Výška řádku', strikethrough: 'Přeškrtnuté', size: 'Velikost písma' }, image: { image: 'Obrázek', insert: 'Vložit obrázek', resizeFull: 'Původní velikost', resizeHalf: 'Poloviční velikost', resizeQuarter: 'Čtvrteční velikost', floatLeft: 'Umístit doleva', floatRight: 'Umístit doprava', floatNone: 'Neobtékat textem', shapeRounded: 'Tvar: zaoblený', shapeCircle: 'Tvar: kruh', shapeThumbnail: 'Tvar: náhled', shapeNone: 'Tvar: žádný', dragImageHere: 'Přetáhnout sem obrázek', dropImage: 'Přetáhnout obrázek nebo text', selectFromFiles: 'Vybrat soubor', url: 'URL obrázku', remove: 'Odebrat obrázek', original: 'Originál' }, video: { video: 'Video', videoLink: 'Odkaz videa', insert: 'Vložit video', url: 'URL videa?', providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion nebo Youku)' }, link: { link: 'Odkaz', insert: 'Vytvořit odkaz', unlink: 'Zrušit odkaz', edit: 'Upravit', textToDisplay: 'Zobrazovaný text', url: 'Na jaké URL má tento odkaz vést?', openInNewWindow: 'Otevřít v novém okně' }, table: { table: 'Tabulka', addRowAbove: 'Přidat řádek nad', addRowBelow: 'Přidat řádek pod', addColLeft: 'Přidat sloupec vlevo', addColRight: 'Přidat sloupec vpravo', delRow: 'Smazat řádek', delCol: 'Smazat sloupec', delTable: 'Smazat tabulku' }, hr: { insert: 'Vložit vodorovnou čáru' }, style: { style: 'Styl', p: 'Normální', blockquote: 'Citace', pre: 'Kód', h1: 'Nadpis 1', h2: 'Nadpis 2', h3: 'Nadpis 3', h4: 'Nadpis 4', h5: 'Nadpis 5', h6: 'Nadpis 6' }, lists: { unordered: 'Odrážkový seznam', ordered: 'Číselný seznam' }, options: { help: 'Nápověda', fullscreen: 'Celá obrazovka', codeview: 'HTML kód' }, paragraph: { paragraph: 'Odstavec', outdent: 'Zvětšit odsazení', indent: 'Zmenšit odsazení', left: 'Zarovnat doleva', center: 'Zarovnat na střed', right: 'Zarovnat doprava', justify: 'Zarovnat oboustranně' }, color: { recent: 'Aktuální barva', more: 'Další barvy', background: 'Barva pozadí', foreground: 'Barva písma', transparent: 'Průhlednost', setTransparent: 'Nastavit průhlednost', reset: 'Obnovit', resetToDefault: 'Obnovit výchozí', cpSelect: 'Vybrat' }, shortcut: { shortcuts: 'Klávesové zkratky', close: 'Zavřít', textFormatting: 'Formátování textu', action: 'Akce', paragraphFormatting: 'Formátování odstavce', documentStyle: 'Styl dokumentu' }, help: { 'insertParagraph': 'Vložit odstavec', 'undo': 'Vrátit poslední příkaz', 'redo': 'Opakovat poslední příkaz', 'tab': 'Tab', 'untab': 'Untab', 'bold': 'Nastavit tučně', 'italic': 'Nastavit kurzívu', 'underline': 'Nastavit podtrhnutí', 'strikethrough': 'Nastavit přeškrtnutí', 'removeFormat': 'Ostranit nastavený styl', 'justifyLeft': 'Nastavit zarovnání vlevo', 'justifyCenter': 'Nastavit zarovnání na střed', 'justifyRight': 'Nastavit zarovnání vpravo', 'justifyFull': 'Nastavit zarovnání do bloku', 'insertUnorderedList': 'Aplikovat odrážkový seznam', 'insertOrderedList': 'Aplikovat číselný seznam', 'outdent': 'Zmenšit odsazení aktuálního odstavec', 'indent': 'Odsadit aktuální odstavec', 'formatPara': 'Změnit formátování aktuálního bloku na odstavec (P tag)', 'formatH1': 'Změnit formátování aktuálního bloku na Nadpis 1', 'formatH2': 'Změnit formátování aktuálního bloku na Nadpis 2', 'formatH3': 'Změnit formátování aktuálního bloku na Nadpis 3', 'formatH4': 'Změnit formátování aktuálního bloku na Nadpis 4', 'formatH5': 'Změnit formátování aktuálního bloku na Nadpis 5', 'formatH6': 'Změnit formátování aktuálního bloku na Nadpis 6', 'insertHorizontalRule': 'Vložit horizontální čáru', 'linkDialog.show': 'Zobrazit dialog pro odkaz' }, history: { undo: 'Krok vzad', redo: 'Krok vpřed' }, specialChar: { specialChar: 'SPECIÁLNÍ ZNAKY', select: 'Vyberte speciální znaky' } } }); })(jQuery); /******/ return __webpack_exports__; /******/ })() ; }); //# sourceMappingURL=summernote-cs-CZ.js.map
cdnjs/cdnjs
ajax/libs/summernote/0.8.19/lang/summernote-cs-CZ.js
JavaScript
mit
5,895
<?php namespace App\Controller; use App\Service\JiraService; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\HttpException; class DefaultController extends Controller { /** * @Route("/sprint_report") * @Method("GET") */ public function sprintReportListAction(JiraService $jira) { try { $projects = $jira->get('/rest/api/2/project'); /* $activeProjects = []; foreach ($projects as $project) { if (!isset($project->projectCategory) || $project->projectCategory->name != 'Lukket') { $activeProjects[] = $project; } } */ return $this->render( 'jira/sprint_report_list.html.twig', [ 'projects' => $projects, ] ); } catch (HttpException $e) { return new RedirectResponse('/login'); } } /** * @Route("/sprint_report/project/{pid}") * @Method("GET") */ public function sprintReportAction(JiraService $jira, $pid) { try { $project = $jira->get('/rest/api/2/project/'.$pid); return $this->render( 'jira/sprint_report.html.twig', [ 'project' => $project, ] ); } catch (HttpException $e) { return new RedirectResponse('/login'); } } /** * @Route("/sprint_report/version/{vid}") * @Method("GET") */ public function sprintReportVersionAction(JiraService $jira, $vid) { try { $sprintReport = $jira->getSprintReport($vid); return $this->render( 'jira/sprint_report_version.html.twig', $sprintReport ); } catch (HttpException $e) { return new RedirectResponse('/login'); } } /** * @Route("/planning") * @Method("GET") */ public function planningOverviewAction(JiraService $jira) { $jiraUrl = getenv('JIRA_URL'); // Get current user to make sure that the user is logged in. try { $jira->get('/rest/auth/1/session'); } catch (HttpException $e) { return new RedirectResponse('/login'); } return $this->render( 'jira/planning.html.twig', [ 'jiraUrl' => $jiraUrl, ] ); } /** * @Route("/future_sprints") * @Method("GET") */ public function futureSprints(JiraService $jira) { $sprints = $jira->getFutureSprints(); return new JsonResponse(['sprints' => $sprints]); } /** * @Route("/issues/{sprintId}") * @Method("GET") */ public function issuesInSprint(JiraService $jira, $sprintId) { $issues = $jira->getIssuesInSprint($sprintId); return new JsonResponse(['issues' => $issues]); } /** * @Route("/") * @Method("GET") */ public function indexAction(JiraService $jira) { return $this->render( 'jira/index.html.twig', [] ); } }
aakb/jira-report
src/Controller/DefaultController.php
PHP
mit
3,549
angular.module('contatooh').factory('Contato',function($resource){ return $resource('/contatos/:id'); });
thiagoalvesp/MEAN
contatooh/public/js/services/ContatoService.js
JavaScript
mit
111
## Project Maintainer Maintainers are members who support our project leads to review all code being submitted to our repositories. Maintainers may work across projects or specialize on a single project. They are available in Slack to answer questions and help people with pull requests. Guiding philosophy taken from our readme: * **We believe good code is reviewed code.** All commits to this repository are approved by project maintainers and/or leads. The goal here is *not* to criticize or judge your abilities! Rather, we aim to share insights and achievements. Code reviews help us continually refine the project's scope and direction, as well as encourage the discussion we need for it to thrive. #### Opportunities: * Build deeper relationships with project team. * Participate in discussions to determine project direction and focus. * Hone your communication, collaboration and development skills. * Reviewing code can be much more challenging than writing code. Grow your skill set by teaching and mentoring. #### Responsibilities: * Able to commit at least 5 hours a week (on average) to the project. * Listed in the project readme as a resource. * Perform code reviews, manage pull requests & branches. * Make sure issue list stays organized. Close old issues, add proper issue labels, assign issues. * Open `beginner-friendly` and `first-pr`. Mentor people who volunteer to take on these issues. * Define milestones and help people to meet them. * Be patient, kind and welcoming. #### First tasks: * Work with project lead to make the announcement in Slack, let people know they can reach out to you. * Add yourself to the project readme. * Start reviewing pull requests & grooming issues. (We are also knights who say Ni!)
jss367/assemble
roles/project_maintainer.md
Markdown
mit
1,746
import { MJMLElement } from 'mjml-core' import React, { Component } from 'react' const tagName = 'mj-table' const parentTag = ['mj-column', 'mj-hero-content'] const endingTag = true const defaultMJMLDefinition = { content: '', attributes: { 'align': 'left', 'cellpadding': '0', 'cellspacing': '0', 'color': '#000', 'container-background-color': null, 'font-family': 'Ubuntu, Helvetica, Arial, sans-serif', 'font-size': '13px', 'line-height': '22px', 'padding-bottom': null, 'padding-left': null, 'padding-right': null, 'padding-top': null, 'padding': '10px 25px', 'table-layout': 'auto', 'vertical-align': null, 'width': '100%' } } @MJMLElement class Table extends Component { styles = this.getStyles() getStyles () { const { mjAttribute, defaultUnit } = this.props return { table: { cellpadding: mjAttribute('cellspadding'), cellspacing: mjAttribute('cellspacing'), color: mjAttribute('color'), fontFamily: mjAttribute('font-family'), fontSize: defaultUnit(mjAttribute('font-size')), lineHeight: mjAttribute('line-height'), tableLayout: mjAttribute('table-layout') } } } render () { const { mjAttribute, mjContent } = this.props return ( <table cellPadding={mjAttribute('cellpadding')} cellSpacing={mjAttribute('cellspacing')} dangerouslySetInnerHTML={{__html: mjContent() }} data-legacy-border="0" style={this.styles.table} width={mjAttribute('width')} /> ) } } Table.tagName = tagName Table.parentTag = parentTag Table.endingTag = endingTag Table.defaultMJMLDefinition = defaultMJMLDefinition export default Table
rogierslag/mjml
packages/mjml-table/src/index.js
JavaScript
mit
1,753
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'PushResult' db.create_table(u'notos_pushresult', ( (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('response_code', self.gf('django.db.models.fields.PositiveIntegerField')(null=True, blank=True)), )) db.send_create_signal(u'notos', ['PushResult']) # Adding model 'ScheduledPush' db.create_table(u'notos_scheduledpush', ( (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('scheduled_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), ('send_at', self.gf('django.db.models.fields.DateTimeField')()), ('canceled_at', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)), ('registration_id', self.gf('django.db.models.fields.CharField')(max_length=4095)), ('result', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['notos.PushResult'], unique=True, null=True, blank=True)), ('attempt_no', self.gf('django.db.models.fields.PositiveSmallIntegerField')(default=1)), ('content_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['contenttypes.ContentType'])), ('object_id', self.gf('django.db.models.fields.PositiveIntegerField')()), ('data', self.gf('json_field.fields.JSONField')(default=u'null')), )) db.send_create_signal(u'notos', ['ScheduledPush']) def backwards(self, orm): # Deleting model 'PushResult' db.delete_table(u'notos_pushresult') # Deleting model 'ScheduledPush' db.delete_table(u'notos_scheduledpush') models = { u'contenttypes.contenttype': { 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) }, u'notos.pushresult': { 'Meta': {'object_name': 'PushResult'}, u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'response_code': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}) }, u'notos.scheduledpush': { 'Meta': {'object_name': 'ScheduledPush'}, 'attempt_no': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '1'}), 'canceled_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), 'data': ('json_field.fields.JSONField', [], {'default': "u'null'"}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}), 'registration_id': ('django.db.models.fields.CharField', [], {'max_length': '4095'}), 'result': ('django.db.models.fields.related.OneToOneField', [], {'to': u"orm['notos.PushResult']", 'unique': 'True', 'null': 'True', 'blank': 'True'}), 'scheduled_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), 'send_at': ('django.db.models.fields.DateTimeField', [], {}) } } complete_apps = ['notos']
Sigmapoint/notos
src/notos/migrations/0001_initial.py
Python
mit
3,961
import * as gulp from 'gulp'; import * as gulpLoadPlugins from 'gulp-load-plugins'; import { join } from 'path'; import { APP_SRC, APP_DEST, TOOLS_DIR } from '../../config'; import { templateLocals, makeTsProject } from '../../utils'; const plugins = <any>gulpLoadPlugins(); export = () => { let tsProject = makeTsProject(); let src = [ 'typings/browser.d.ts', TOOLS_DIR + '/manual_typings/**/*.d.ts', join(APP_SRC, '**/*.ts'), '!' + join(APP_SRC, '**/*.spec.ts') ]; let result = gulp.src(src) .pipe(plugins.plumber()) .pipe(plugins.sourcemaps.init()) .pipe(plugins.typescript(tsProject)); return result.js .pipe(plugins.sourcemaps.write()) .pipe(plugins.template(templateLocals())) .pipe(gulp.dest(APP_DEST)); }
aditya5a2/Tiny360
tools/tasks/seed/build.js.e2e.ts
TypeScript
mit
766
/* * Guerilla * Copyright 2015, Yahoo Inc. * Copyrights licensed under the MIT License. * * Retrieves the Logcat from an Android device. */ var path = require('path'); var fs = require('fs-extra'); function Logcat (context, exec) { this.context = context; this.exec = exec; this.file = path.join(context.output_dir, 'logcat.txt'); } Logcat.prototype.start = function (callback) { var self = this; var cmd = 'adb'; var args = []; args.push('-s'); args.push(self.context.device.identifier); args.push('logcat'); args.push('-v'); args.push('time'); var options = { log: [true, false, false, false], file: this.file }; self.process = self.exec(cmd, args, options, function () {}); if (callback) callback(); }; Logcat.prototype.stop = function (callback) { if (this.process) this.process.kill(); if (callback) callback(); }; module.exports = Logcat;
yahoo/guerilla
services/logcat.js
JavaScript
mit
875
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package lab3_diego_danilo; public class LaComarca extends Lugar{ int numeroCasa; public LaComarca() { super(); } public LaComarca(int numeroCasa) { this.numeroCasa = numeroCasa; } public LaComarca(int numeroCasa, int extension, int numeroInt, String lugar) { super(extension, numeroInt, lugar); this.numeroCasa = numeroCasa; } public int getNumeroCasa() { return numeroCasa; } public void setNumeroCasa(int numeroCasa) { this.numeroCasa = numeroCasa; } @Override public String toString() { return super.toString(); } }
mata889/Lab3_DaniloSosa_DiegoMatamoros
Lab3_Diego_Danilo/src/lab3_diego_danilo/LaComarca.java
Java
mit
844
zInput ========= This jQuery plugin turns your plain checkboxes and radio buttons (with title attributes) into elements that are easily clickable. Each input can be easily styled within the stylesheet and automatically vertically centers the title Radio Inputs ---- Radio inputs toggle easily between classes. .zInput and .zSelected. ![Radio buttons with default stylesheet](readme_images/radio.png) Checkboxes with same name ----------- Checkboxes with the same name (i.e. name="check[]") are included in the same outer wrapper for clear usability. ![Checkboxes with default stylesheet](readme_images/checkbox_multi.png) Uniquely named checkboxes -------------- Uniquely named checkboxes come with their own outer wrapper. ![Checkboxes with default stylesheet](readme_images/checkbox_singles.png) Implemented fastclick.js -------------- The external repo [fastclick](https://github.com/ftlabs/fastclick/) has been implemented for faster performance on mobile devices. Usage -------------- Apply it to a selected parent's children: `$("#affected").zInput();` Or apply the function to the whole document: `$("*").zInput();` License ---- MIT
zapplebee/zInput
README.md
Markdown
mit
1,157
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Lesson 41 - NeHe, three.js and WebGL - Tutorial - GeoFX</title> <meta name="description" content="NeHe Lesson 34 in three.js and WebGL, developed by Geo-F/X - GeoFX"/> <meta name="author" content="Richard K. Wright richardkylewright" /> <meta name="keywords" content="NeHe WebGL three.js GIS 3D Digital Publishing EPUB eBooks Readium SVG Graphics Geo-F/X Consulting - GeoFX" /> <meta charset="utf-8" /> <link href="../../../../css/styles.css" rel="stylesheet" type="text/css" /> <link href="../../../../css/nav.css" rel="stylesheet" type="text/css" /> <link href="../../css/NeHe-EPUB.css" rel="stylesheet" type="text/css"/> <link href="../../css/prism.css" rel="stylesheet" type="text/css"/> <link href="../../../../images/favicon.png" rel="shortcut icon" type="image/png" /> <script src="../../../../js/jquery-3.1.1.min.js"></script> <script src="../../../../js/flaunt.js"></script> <script src="../../../../js/prism.js"></script> </head> <body> <div class="wrapper"> <div class="main"> <!--#include virtual="/includes/banner_nav2.shtml" --> <div class="content"> <div class="content-text"> <h3>Lesson 41 - Volumetric Fog </h3> <p>&nbsp;</p> <h4>Introduction</h4> <p>This lesson is a little bit of a cheat in the sense that it is based largely on code that I neither wrote and barely understand the inner workings. But it looks pretty cool!</p> <h4>The Algorithm</h4> <p>The basic algorithm is rather simple: First, render the part of the light source geometry that is not occluded, then blur it from the center of the light source outwards to produce the characteristic light streaks. All this is done in 2D image space instead of the 3D world as computing how the light rays propagate in the medium would be way to expensive for realtime rendering. So the goal is to look cool, not be physically correct!<br> </p> <p>Inventing a new shader effect from scratch is quite a daunting task. Luckily, shader technology has been used on graphics cards for more than a decade now and there is an abundance of books and internet tutorials. So instead of trying to re-invent the wheel, we just hunt around to find an example in the three.js space. And voila, <a href="https://threejs.org/examples/webgl_postprocessing_godrays.html" title="Godray Example in three.js" target="_self">there</a> we are.</p> <h4>The Demo<br> </h4> <p> All we have done here is adapt the three.js example to use a GFXScene and replace the original scene with a simple torus-knot that slowly rotates.</p> <p>And that's it! Click on <a href="lesson41webgl.html" title="Lesson 41" target="_self">this link</a> to see the actual rendered demo in all it's crepuscular glory!</p> <p>As always, the original sources are on github <a href="https://github.com/rkwright/nehe-three-js" target="_blank" rel="noopener noreferrer">here</a>.</p> <!--#include virtual="/includes/footer.shtml" --> </div> </div></div></div> </body> </html>
rkwright/geofx_site
graphics/nehe-three-js/lessons41-48/lesson41/lesson41.html
HTML
mit
3,018
package com.njd5475.github.slim.material.renderer; import java.awt.Color; import com.njd5475.github.slim.material.BorderMaterial; import com.njd5475.github.slim.material.Material; import com.njd5475.github.slim.material.MaterialGroup; import com.njd5475.github.slim.material.SolidMaterial; public interface MaterialRenderer { public void render(BorderMaterial bordered); public void render(MaterialGroup group); public void render(SolidMaterial solidMaterial); public void fill(Material m, Color clr); public void renderText(String text, Material material); }
njd5475/slim-ide
src/main/java/com/njd5475/github/slim/material/renderer/MaterialRenderer.java
Java
mit
573
package com.ctrctr.imgscramble; import java.math.BigInteger; /** * Factorial Class */ public class Factorial { BigInteger[] dict; boolean memo = true; public Factorial(int n) { //Set n to zero if you dont want to initialize dict if (n == 0) { this.memo = false; } //Initialize memoisation dictionary else { this.dict = new BigInteger[n]; for (int e = 0; e < n; e++) { dict[e] = BigInteger.ZERO; } dict[0] = BigInteger.ONE; dict[1] = BigInteger.ONE; } } public BigInteger factorial(int n) { if (memo) { if (dict[n].compareTo(BigInteger.ZERO) == 0) { BigInteger fact = BigInteger.ONE; for (int i = 2; i <= n; i++) { fact = fact.multiply(BigInteger.valueOf(i)); dict[i] = fact; } return fact; } else { return dict[n]; } } else { BigInteger fact = BigInteger.ONE; for (int i = 1; i <= n; i++) { fact = fact.multiply(BigInteger.valueOf(i)); } return fact; } } }
calvinku96/imgScramble
app/src/main/java/com/ctrctr/imgscramble/Factorial.java
Java
mit
1,263
(function () { define(["jquery", "datatables", "datatables-tabletools", "datatables-colvis"], function ($) { var achilles_heel = {}; achilles_heel.render = function (datasource) { $('#reportAchillesHeel svg').remove(); $.ajax({ type: "GET", url: getUrlFromData(datasource, "achillesheel"), contentType: "application/json; charset=utf-8", success: function (data) { table_data = []; for (i = 0; i < data.MESSAGES.ATTRIBUTEVALUE.length; i++) { temp = data.MESSAGES.ATTRIBUTEVALUE[i]; message_type = temp.substring(0, temp.indexOf(':')); message_content = temp.substring(temp.indexOf(':') + 1); // RSD - A quick hack to put commas into large numbers. // Found the regexp at: // https://stackoverflow.com/questions/23104663/knockoutjs-format-numbers-with-commas message_content = message_content.replace(/\B(?=(\d{3})+(?!\d))/g, ','); table_data[i] = { 'type': message_type, 'content': message_content }; } datatable = $('#achillesheel_table').DataTable({ dom: 'lfrt<"row"<"col-sm-4" i ><"col-sm-4" T ><"col-sm-4" p >>', tableTools: { "sSwfPath": "js/swf/copy_csv_xls_pdf.swf" }, data: table_data, columns: [ { data: 'type', visible: true, width:200 }, { data: 'content', visible: true } ], pageLength: 15, lengthChange: false, deferRender: true, destroy: true }); $('#reportAchillesHeel').show(); } }); } return achilles_heel; }); })();
shalmalijoshi/AchillesWeb
js/app/reports/achilles_heel.js
JavaScript
mit
1,734
package controllers import java.util.{Date, UUID} import javax.inject.Inject import com.hbc.svc.sundial.v2 import com.hbc.svc.sundial.v2.models.json._ import controllers.ModelConverter.toInternalNotification import dao.SundialDaoFactory import model._ import play.api.libs.json.Json import play.api.mvc.InjectedController import util.CycleDetector class ProcessDefinitions @Inject()(daoFactory: SundialDaoFactory) extends InjectedController { def get() = Action { val result: Seq[v2.models.ProcessDefinition] = daoFactory.withSundialDao { implicit dao => val definitions = dao.processDefinitionDao.loadProcessDefinitions() definitions.map(ModelConverter.toExternalProcessDefinition) } Ok(Json.toJson(result)) } def getByProcessDefinitionName(processDefinitionName: String) = Action { val resultOpt: Option[v2.models.ProcessDefinition] = daoFactory.withSundialDao { implicit dao => val definition = dao.processDefinitionDao.loadProcessDefinition(processDefinitionName) definition.map(ModelConverter.toExternalProcessDefinition) } resultOpt match { case Some(result) => Ok(Json.toJson(result)) case _ => NotFound } } def putByProcessDefinitionName(processDefinitionName: String) = Action(parse.json[v2.models.ProcessDefinition]) { request => if (processDefinitionName != request.body.processDefinitionName) { BadRequest( s"URL process definition name ($processDefinitionName) does not match body process definitiion name (${request.body.processDefinitionName})") } else { daoFactory.withSundialDao { implicit dao => val taskDefinitionsByName = request.body.taskDefinitions .map(taskDef => taskDef.taskDefinitionName -> taskDef) .toMap val hasCycle = request.body.taskDefinitions.exists { taskDef => CycleDetector .hasCycle[v2.models.TaskDefinition](taskDef, current => { current.dependencies .map(_.taskDefinitionName) .map(taskDefinitionsByName) }) } if (hasCycle) { BadRequest("Process definition contains a cycle") } else { val existing = dao.processDefinitionDao.loadProcessDefinition( processDefinitionName) val existingTaskDefinitions = dao.processDefinitionDao .loadTaskDefinitionTemplates(processDefinitionName) val processNotifications = request.body.notifications .fold(Seq.empty[model.Notification])( _.map(toInternalNotification)) val processDefinition = model.ProcessDefinition( processDefinitionName, request.body.processDescription, request.body.schedule.map(ModelConverter.toInternalSchedule), ModelConverter.toInternalOverlapAction( request.body.overlapAction), processNotifications, existing.map(_.createdAt).getOrElse(new Date()), request.body.paused.getOrElse(false) ) val taskDefinitions = request.body.taskDefinitions.map { externalTaskDefinition => val (required, optional) = externalTaskDefinition.dependencies .partition(_.successRequired) model.TaskDefinitionTemplate( externalTaskDefinition.taskDefinitionName, processDefinitionName, ModelConverter.toInternalExecutable( externalTaskDefinition.executable), TaskLimits(externalTaskDefinition.maxAttempts, externalTaskDefinition.maxRuntimeSeconds), TaskBackoff(externalTaskDefinition.backoffBaseSeconds, externalTaskDefinition.backoffExponent), TaskDependencies(required.map(_.taskDefinitionName), optional.map(_.taskDefinitionName)), externalTaskDefinition.requireExplicitSuccess ) } // Save the process definition record dao.processDefinitionDao.saveProcessDefinition(processDefinition) // Delete all task definition templates that no longer exist existingTaskDefinitions .filterNot(taskDefinitionsByName contains _.name) .foreach { taskDefinitionToRemove => dao.processDefinitionDao.deleteTaskDefinitionTemplate( processDefinitionName, taskDefinitionToRemove.name) } // Save or update task definitions that are still around taskDefinitions.foreach { taskDefinition => dao.processDefinitionDao.saveTaskDefinitionTemplate( taskDefinition) } Created } } } } def deleteByProcessDefinitionName(processDefinitionName: String) = Action { //TODO Archive rather than delete so that we don't break old processes daoFactory.withSundialDao { implicit dao => dao.processDefinitionDao.deleteAllTaskDefinitionTemplates( processDefinitionName) dao.processDefinitionDao.deleteProcessDefinition(processDefinitionName) } NoContent } def postTriggerByProcessDefinitionName(processDefinitionName: String, taskDefinitionName: Option[String]) = Action { daoFactory.withSundialDao { implicit dao => val trigger = ProcessTriggerRequest(UUID.randomUUID(), processDefinitionName, new Date(), taskDefinitionName.map(Seq(_)), None) dao.triggerDao.saveProcessTriggerRequest(trigger) } Created } def postPauseByProcessDefinitionName(processDefinitionName: String) = Action { daoFactory.withSundialDao { implicit dao => val definition = dao.processDefinitionDao .loadProcessDefinition(processDefinitionName) .get val newDefinition = definition.copy(isPaused = true) dao.processDefinitionDao.saveProcessDefinition(newDefinition) } Ok } def postResumeByProcessDefinitionName(processDefinitionName: String) = Action { daoFactory.withSundialDao { implicit dao => val definition = dao.processDefinitionDao .loadProcessDefinition(processDefinitionName) .get val newDefinition = definition.copy(isPaused = false) dao.processDefinitionDao.saveProcessDefinition(newDefinition) } Ok } }
gilt/sundial
app/controllers/ProcessDefinitions.scala
Scala
mit
6,830
<?php namespace SlimAuryn\Response; class EmptyResponse implements StubResponse { private $headers; /** @var int */ private $status; const DEFAULT_STATUS = 204; public function __construct(array $headers = [], int $status = self::DEFAULT_STATUS) { $standardHeaders = []; $this->headers = array_merge($standardHeaders, $headers); $this->status = $status; } public function getStatus() : int { return $this->status; } public function getBody() : string { return ""; } public function getHeaders() : array { return $this->headers; } }
Danack/SlimAurynInvoker
lib/SlimAuryn/Response/EmptyResponse.php
PHP
mit
654
Write a bash script to calculate the frequency of each word in a text file words.txt. For simplicity sake, you may assume: + words.txt contains only lowercase characters and space ' ' characters. + Each word must consist of lowercase characters only. + Words are separated by one or more whitespace characters. For example, assume that words.txt has the following content: + the day is sunny the the + the sunny is is Your script should output the following, sorted by descending frequency: + the 4 + is 3 + sunny 2 + day 1 ####Note: Don't worry about handling ties, it is guaranteed that each word's frequency count is unique.
hecate-xw/LeetCode
Shell/Problems/001WordFrequency.md
Markdown
mit
630
using GameTimer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; namespace FontBuddyLib { /// <summary> /// This dude writes the text in big pulsating letters, with the outline below it. /// </summary> public class PulsateBuddy : ShadowTextBuddy { #region Fields private float _pulsateSpeed; private GameClock _timer; #endregion //Fields #region Members /// <summary> /// how big the pulsate the text. Default value is 1f /// </summary> public float PulsateSize { get; set; } /// <summary> /// How fast to pulsate the speed. Default value is 4f /// </summary> public float PulsateSpeed { get { return _pulsateSpeed; } set { _pulsateSpeed = value; if (null != _timer) { _timer.TimerSpeed = _pulsateSpeed; } } } public bool StraightPulsate { get; set; } #endregion //Members /// <summary> /// Constructor /// </summary> public PulsateBuddy() : base() { StraightPulsate = true; PulsateSize = 1.0f; PulsateSpeed = 4.0f; _timer = new GameClock() { TimerSpeed = PulsateSpeed }; } public override float Write(string text, Vector2 position, Justify justification, float scale, Color color, SpriteBatch spriteBatch, GameClock time) { if (string.IsNullOrEmpty(text)) { return position.X; } //First draw the shadow Font.Write(text, position, justification, ShadowSize * scale, ShadowColor, spriteBatch, time); _timer.Update(time); var currentTime = _timer.CurrentTime; //Pulsate the size of the text var pulsate = PulsateSize * (float)(Math.Sin(currentTime - (Math.PI * 0.5)) + 1.0f); pulsate *= 0.15f; //make it waaay smaller pulsate += 1; //bump it up so it starts at 1 //adjust the y position so it pulsates straight out var textSize = Font.MeasureString(text.ToString()); var adjust = ((textSize * scale * pulsate) - (textSize * scale)) / 2f; if (StraightPulsate) { switch (justification) { case Justify.Left: { position.X -= adjust.X; } break; case Justify.Right: { position.X += adjust.X; } break; }; } position.Y -= adjust.Y; //Draw the menu item, with the pulsing return Font.Write(text, position, justification, scale * pulsate, color, spriteBatch, time); } } }
dmanning23/FontBuddy
FontBuddy/FontBuddy.SharedProject/PulsateBuddy.cs
C#
mit
2,456
<div class="col-sm-9" id="contenido"> <?php if($this->session->flashdata('success')) {?> <div class="alert alert-success"> <i class="fa fa-check-square-o" aria-hidden="true"></i> <?php echo $this->session->flashdata('success');?> </div> <?php } ?> <?php if($this->session->flashdata('danger')) {?> <div class="alert alert-danger"> <i class="fa fa-check-square-o" aria-hidden="true"></i> <?php echo $this->session->flashdata('danger');?> </div> <?php } ?> <h3>Editar horario</h3> <?php echo form_open('admin_horarios/guardar_edicion', array('method' => 'post')) ?> <!--<div class="row"> <div class="col-sm-10 col-sm-offset-1"> <div class="form-group"> <div class="text-effect"> <span>Nombre</span> <input type="text" name="nombre" class="form-control focus-text" /> </div> </div> </div> </div> --> <div class="row"> <div class="col-sm-10 col-sm-offset-1"> <div class="form-group"> <div class="col-sm-5 "> <?php echo form_error('fecha_inicio'); ?> <h4><span>Fecha de inicio</span></h4> <div class="input-group date" data-provide="datepicker"> <input type="text" class="form-control" name="fecha_inicio" value="<?php echo date('m/d/Y', strtotime($horario[0]->fecha_inicio)); ?>" style="border-left: 0px; border-top: 0px; border-right: 0px;"> </div> </div> <div class="col-sm-5"> <?php echo form_error('fecha_fin'); ?> <h4><span>Fecha de finalización</span></h4> <div class="input-group date" data-provide="datepicker"> <input type="text" class="form-control" name="fecha_fin" value="<?php echo date('m/d/Y', strtotime($horario[0]->fecha_fin));?>" style="border-left: 0px; border-top: 0px; border-right: 0px;"> </div> </div> </div> </div> </div> <div class="row"> <div class="col-sm-10 col-sm-offset-1"> <div class="form-group"> <?php echo form_error('hora'); ?> <div class="text-effect focus-t"> <h4><span>Hora</span></h4> <input type="text" name="hora" id="t1" value="<?php echo date('h:i A', strtotime($horario[0]->hora));?>" class="form-control focus-text" data-format="hh:mm A" class="input-small"> </div> </div> </div> </div> <br> <div class="row"> <div class="col-sm-10 col-sm-offset-1"> <div class="form-group"> <button type="submit" class="btn btn-primary" id="submit" style="margin-top: 20px;">Editar</button> </div> </div> </div> </form> </div>
aeespinosao/Tramitennis
application/views/administrador/editar_horario.php
PHP
mit
2,883
\documentclass[11pt, includeaddress]{classes/cthit} \usepackage{titlesec} \usepackage{verbatimbox} \usepackage{tabularx} \usepackage{hyperref} \usepackage{pgfkeys} % Set up the keys. Only the ones directly under /mytextfield % can be accepted as options to the \mytextfield macro. \pgfkeys{ /mytextfield/.is family, /mytextfield, % Here are the options that a user can pass default/.style = {borderwidth = 0, dotwidth = 2cm, name=herp}, borderwidth/.estore in = \mytextfieldBorderwidth, dotwidth/.estore in = \mytextfieldDotwidth, name/.estore in = \mytextfieldName, } \newdimen\longline \longline=\textwidth\advance\longline-6cm \def\LayoutTextField#1#2{#2} % override default in hyperref \def\lbl#1{\hbox to \mytextfieldDotwidth{#1\dotfill\strut}}% \def\labelline#1#2{\lbl{#1}\vbox{\hbox{\TextField[name=\mytextfieldName,width=#2, borderwidth=\mytextfieldBorderwidth]{\null}}\kern2pt\hrule}} % We process the options first, then pass them to `\parbox` in the form of macros. \newcommand\mytextfield[2][]{% \pgfkeys{/mytextfield, default, #1}% \hbox to \hsize{\labelline{#2}{\longline}}\vskip1.4ex } \titleformat{\paragraph}[hang]{\normalfont\normalsize\bfseries}{\theparagraph}{1em}{} \titlespacing*{\paragraph}{0pt}{3.25ex plus 1ex minus 0.2ex}{0.7em} \graphicspath{ {images/} } \begin{document} \begin{Form} \title{Äskningsansökan} \makeheadfoot% \section*{Sökande} För- och efternamn på den sökande eller kommitté-/föreningsnamn om äskningen kommer från ett organ inom sektionen. \\[14pt] \mytextfield[name=namn1]{Namn:} \section*{Ansvarig för äskningen} \mytextfield[name=namn2]{Namn:} \mytextfield[name=tel]{Telefon:} \mytextfield[name=mail]{Mail:} \section*{Motivering} \TextField[multiline,width=\textwidth,height=11cm,bordercolor=black]{\mbox{ }} \newpage \setlength{\extrarowheight}{12pt} \section*{Budget} \begin{tabular}{ | p{12cm} | p{3cm} |} \multicolumn{1}{l}{\large{\textbf{Artikel}}} & \multicolumn{1}{l}{\large{\textbf{Utgift}}} \\ \hline {\TextField[name=art1, borderwidth=0,width=12cm]{ }} & {\TextField[name=bug1, borderwidth=0,width=3cm]{ }} \\ \hline {\TextField[name=art2, borderwidth=0,width=12cm]{ }} & {\TextField[name=bug2, borderwidth=0,width=3cm]{ }} \\ \hline {\TextField[name=art3, borderwidth=0,width=12cm]{ }} & {\TextField[name=bug3, borderwidth=0,width=3cm]{ }} \\ \hline {\TextField[name=art4, borderwidth=0,width=12cm]{ }} & {\TextField[name=bug4, borderwidth=0,width=3cm]{ }} \\ \hline {\TextField[name=art5, borderwidth=0,width=12cm]{ }} & {\TextField[name=bug5, borderwidth=0,width=3cm]{ }} \\ \hline {\TextField[name=art6, borderwidth=0,width=12cm]{ }} & {\TextField[name=bug6, borderwidth=0,width=3cm]{ }} \\ \hline {\TextField[name=art7, borderwidth=0,width=12cm]{ }} & {\TextField[name=bug7, borderwidth=0,width=3cm]{ }} \\ \hline {\TextField[name=art8, borderwidth=0,width=12cm]{ }} & {\TextField[name=bug8, borderwidth=0,width=3cm]{ }} \\ \hline {\TextField[name=art9, borderwidth=0,width=12cm]{ }} & {\TextField[name=bug9, borderwidth=0,width=3cm]{ }} \\ \hline \multicolumn{1}{r|}{ \large{\textbf{Total:}} } & \TextField[name=total, borderwidth=0,width=3cm]{ }\\ \cline{2-2} \end{tabular} \vspace{2cm} \mytextfield[name=ort, dotwidth=5cm]{Ort och datum:} \mytextfield[name=sig, dotwidth=5cm]{Signatur firmatecknare:} \mytextfield[name=fort, dotwidth=5cm]{Namnförtydligande:} \end{Form} \end{document}
cthit/dokument
mallar/askningsmall/askningsmall.tex
TeX
mit
3,421
from distutils.core import setup setup( name='bumpversion_demo', version='0.1.0', packages=[''], url='https://github.com/tantale/bumpversion_demo', license='MIT License', author='Tantale', author_email='tantale.solution@gmail.com', description='Demonstration of ``bumpversion`` usage in the context of a Python project.' )
tantale/bumpversion_demo
setup.py
Python
mit
356
/*! Lightning Design System 2.12.0 */ @charset "UTF-8"; @media (pointer: coarse) and (hover: none){ body{ font-size: 1rem } .slds-button.slds-accordion__summary-action{ line-height: 1.875rem } .slds-button{ line-height: 2.625rem; font-weight: 700 } .slds-button_icon, .slds-button--icon, .slds-button_icon-inverse, .slds-button--icon-inverse, .slds-button_icon-container, .slds-button--icon-container, .slds-button_icon-border, .slds-button--icon-border, .slds-button_icon-border-filled, .slds-button--icon-border-filled, .slds-button_icon-border-inverse, .slds-button--icon-border-inverse, .slds-button_icon-more, .slds-button--icon-more, .slds-button_icon-error, .slds-button--icon-error{ width: 2.75rem; height: 2.75rem } .slds-button_icon-container, .slds-button--icon-container, .slds-button_icon-border, .slds-button--icon-border, .slds-button_icon-border-filled, .slds-button--icon-border-filled, .slds-button_icon-border-inverse, .slds-button--icon-border-inverse, .slds-button_icon-brand, .slds-button_icon-more, .slds-button--icon-more, .slds-button_icon-container-more, .slds-button--icon-container-more{ width: 2.75rem; height: 2.75rem } .slds-button_icon-small, .slds-button--icon-small{ width: 2.75rem; height: 2.75rem } .slds-button_icon-x-small, .slds-button--icon-x-small{ width: 2.75rem; height: 2.75rem } .slds-button_icon-xx-small, .slds-button--icon-xx-small{ width: 2.75rem; height: 2.75rem } .slds-button_icon-more, .slds-button--icon-more{ width: 2.75rem; height: 2.75rem } .slds-card{ border-color: transparent; border-radius: 0 } .slds-card__header-title{ font-size: 1.125rem; font-weight: 700 } .slds-checkbox_button-group, .slds-checkbox--button-group{ display: block } .slds-checkbox_button-group .slds-checkbox_button, .slds-checkbox_button-group .slds-checkbox--button, .slds-checkbox--button-group .slds-checkbox_button, .slds-checkbox--button-group .slds-checkbox--button{ display: block } .slds-checkbox_button-group .slds-checkbox_button + .slds-checkbox_button, .slds-checkbox_button-group .slds-checkbox--button + .slds-checkbox--button, .slds-checkbox--button-group .slds-checkbox_button + .slds-checkbox_button, .slds-checkbox--button-group .slds-checkbox--button + .slds-checkbox--button{ border-left: 0; border-top: 1px solid #dddbda } .slds-checkbox_button-group .slds-checkbox_button:first-child > .slds-checkbox_button__label, .slds-checkbox_button-group .slds-checkbox--button:first-child > .slds-checkbox--button__label, .slds-checkbox--button-group .slds-checkbox_button:first-child > .slds-checkbox_button__label, .slds-checkbox--button-group .slds-checkbox--button:first-child > .slds-checkbox--button__label{ border-radius: 0.25rem 0.25rem 0 0 } .slds-checkbox_button-group .slds-checkbox_button:last-child > .slds-checkbox_button__label, .slds-checkbox_button-group .slds-checkbox--button:last-child > .slds-checkbox--button__label, .slds-checkbox--button-group .slds-checkbox_button:last-child > .slds-checkbox_button__label, .slds-checkbox--button-group .slds-checkbox--button:last-child > .slds-checkbox--button__label{ border-radius: 0 0 0.25rem 0.25rem } .slds-checkbox_button-group .slds-checkbox_button__label, .slds-checkbox_button-group .slds-checkbox--button__label, .slds-checkbox--button-group .slds-checkbox_button__label, .slds-checkbox--button-group .slds-checkbox--button__label{ display: block; text-align: center } .slds-checkbox_button, .slds-checkbox--button{ line-height: 2.625rem } .slds-checkbox-button{ width: 2.75rem; height: 2.75rem } .slds-checkbox_add-button, .slds-checkbox--add-button{ width: 2.75rem; height: 2.75rem; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center } .slds-checkbox_add-button .slds-checkbox_faux, .slds-checkbox_add-button .slds-checkbox--faux, .slds-checkbox--add-button .slds-checkbox_faux, .slds-checkbox--add-button .slds-checkbox--faux{ width: 2rem; height: 2rem } .slds-checkbox_toggle, .slds-checkbox--toggle{ padding: 0.125rem 0 } .slds-checkbox_toggle .slds-form-element__label, .slds-checkbox--toggle .slds-form-element__label{ -webkit-box-align: start; -ms-flex-align: start; align-items: flex-start; font-size: 1rem } .slds-checkbox_toggle [type=checkbox] + .slds-checkbox_faux_container, .slds-checkbox_toggle [type=checkbox] + .slds-checkbox--faux_container, .slds-checkbox--toggle [type=checkbox] + .slds-checkbox_faux_container, .slds-checkbox--toggle [type=checkbox] + .slds-checkbox--faux_container{ font-size: 0.75rem } .slds-checkbox .slds-checkbox_faux, .slds-checkbox .slds-checkbox--faux{ width: 1.5rem; height: 1.5rem; -ms-flex-negative: 0; flex-shrink: 0 } .slds-checkbox .slds-checkbox__label{ display: -webkit-inline-box; display: -ms-inline-flexbox; display: inline-flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; vertical-align: middle; min-height: 2.75rem } .slds-checkbox .slds-checkbox__label .slds-form-element__label{ display: -webkit-inline-box; display: -ms-inline-flexbox; display: inline-flex; font-size: 1rem } .slds-checkbox [type=checkbox]:checked + .slds-checkbox_faux:after, .slds-checkbox [type=checkbox]:checked + .slds-checkbox--faux:after, .slds-checkbox [type=checkbox]:checked ~ .slds-checkbox_faux:after, .slds-checkbox [type=checkbox]:checked ~ .slds-checkbox--faux:after, .slds-checkbox [type=checkbox]:checked + .slds-checkbox__label .slds-checkbox_faux:after, .slds-checkbox [type=checkbox]:checked + .slds-checkbox__label .slds-checkbox--faux:after{ height: 0.375rem; width: 0.75rem; margin-top: -1px } .slds-checkbox [type=checkbox]:indeterminate + .slds-checkbox_faux:after, .slds-checkbox [type=checkbox]:indeterminate + .slds-checkbox--faux:after, .slds-checkbox [type=checkbox]:indeterminate ~ .slds-checkbox_faux:after, .slds-checkbox [type=checkbox]:indeterminate ~ .slds-checkbox--faux:after, .slds-checkbox [type=checkbox]:indeterminate + .slds-checkbox__label .slds-checkbox_faux:after, .slds-checkbox [type=checkbox]:indeterminate + .slds-checkbox__label .slds-checkbox--faux:after{ width: 0.75rem } .slds-checkbox.slds-checkbox_stacked .slds-form-element__label{ font-size: 0.875rem } .slds-checkbox_standalone{ min-height: 2.75rem } .slds-checkbox_standalone [type=checkbox]{ width: 2.75rem; height: 2.75rem; position: absolute; top: 50%; -webkit-transform: translateY(-50%); transform: translateY(-50%) } .slds-checkbox_standalone .slds-checkbox_faux{ position: absolute; top: 50%; -webkit-transform: translateY(-50%); transform: translateY(-50%) } .slds-listbox_horizontal li + li, .slds-listbox--horizontal li + li{ padding-left: 0.25rem } .slds-listbox__option-header{ font-size: 1rem } .slds-listbox_vertical .slds-listbox__option_plain, .slds-listbox_vertical .slds-listbox__option--plain, .slds-listbox--vertical .slds-listbox__option_plain, .slds-listbox--vertical .slds-listbox__option--plain{ line-height: 2.75rem; padding-top: 0; padding-bottom: 0; -webkit-box-align: center; -ms-flex-align: center; align-items: center } .slds-listbox_vertical .slds-listbox__option_plain .slds-media__figure, .slds-listbox_vertical .slds-listbox__option--plain .slds-media__figure, .slds-listbox--vertical .slds-listbox__option_plain .slds-media__figure, .slds-listbox--vertical .slds-listbox__option--plain .slds-media__figure{ margin-right: 0.5rem } .slds-listbox_object-switcher, .slds-listbox--object-switcher{ padding: 0 } .slds-combobox_object-switcher .slds-combobox__input{ font-size: 1rem } .slds-listbox_selection-group{ height: 2.75rem } .slds-listbox_selection-group .slds-listbox{ padding: 0 0.25rem 0.375rem } .slds-listbox_selection-group .slds-listbox-item{ padding: 0.375rem 0.125rem 0 } .slds-has-inline-listbox .slds-combobox__input, .slds-has-object-switcher .slds-combobox__input{ line-height: 2.5rem; min-height: 2.75rem } .slds-has-inline-listbox [role=listbox]{ padding: 0 0.375rem } .slds-th__action{ padding-right: 1.25rem } .slds-form-element__label{ display: -webkit-inline-box; display: -ms-inline-flexbox; display: inline-flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; min-height: 2rem; padding-top: 0; margin-bottom: 0; font-size: 0.875rem } .slds-form-element__label + .slds-form-element__icon .slds-button_icon{ height: 2rem } .slds-form-element__icon{ padding-top: 0 } .slds-form-element_edit .slds-form-element__static, .slds-form-element--edit .slds-form-element__static{ width: calc(100% - 2.75rem) } .slds-form-element_readonly .slds-icon{ width: 1.5rem; height: 1.5rem } .slds-form-element__static{ font-size: 1rem } .slds-form-element_horizontal .slds-button_icon, .slds-form_horizontal .slds-form-element .slds-button_icon, .slds-form_stacked .slds-form-element_horizontal .slds-button_icon{ vertical-align: top } .slds-form-element_stacked .slds-form-element__icon, .slds-form_stacked .slds-form-element .slds-form-element__icon, .slds-form_horizontal .slds-form-element_stacked .slds-form-element__icon{ padding-top: 0 } .slds-input{ line-height: 2.625rem } .slds-input[readonly]{ font-size: 1rem } .slds-input[type=text], .slds-input[type=email], .slds-input[type=url], .slds-input[type=tel]{ -webkit-appearance: none } .slds-input[type=date], .slds-input[type=datetime], .slds-input[type=datetime-local], .slds-input[type=time], .slds-input[type=week], .slds-input[type=month]{ display: -webkit-inline-box; display: -ms-inline-flexbox; display: inline-flex } .slds-input[type=date], .slds-input[type=datetime-local], .slds-input[type=month], .slds-input[type=time]{ height: 2.75rem } .slds-input-has-icon .slds-input__icon{ width: 1rem; height: 1rem; margin-top: -0.5rem } .slds-input-has-icon_left .slds-input__icon, .slds-input-has-icon--left .slds-input__icon{ left: 0.5rem } .slds-input-has-icon_right .slds-input__icon, .slds-input-has-icon--right .slds-input__icon{ right: 0.5rem } .slds-input-has-icon_left-right .slds-input__icon_left, .slds-input-has-icon_left-right .slds-input__icon--left, .slds-input-has-icon--left-right .slds-input__icon_left, .slds-input-has-icon--left-right .slds-input__icon--left{ left: 0.5rem } .slds-input-has-icon_left-right .slds-input__icon_right, .slds-input-has-icon_left-right .slds-input__icon--right, .slds-input-has-icon--left-right .slds-input__icon_right, .slds-input-has-icon--left-right .slds-input__icon--right{ right: 0.5rem } .slds-input__icon-group_right .slds-input__spinner{ right: calc(1.5rem + 0.25rem) } .slds-map_container{ padding: 1rem 1rem 0 } .slds-map{ min-width: 21.75rem } .slds-has-coordinates{ max-height: none } .slds-coordinates__title{ font-size: 1.125rem } .slds-dropdown{ padding: 0; font-size: 1rem } .slds-dropdown__item > a{ line-height: 2.75rem; padding: 0 0.75rem } .slds-dropdown__header{ font-size: 1rem } .slds-modal .slds-modal__title{ font-weight: 700 } .slds-modal__close{ width: 2.75rem; height: 2.75rem; top: -2.75rem; right: 0 } .slds-path__nav .slds-is-current:first-child .slds-path__link{ height: calc(2.75rem - 0.25rem) } .slds-path__nav .slds-is-active:first-child .slds-path__link{ height: 2.75rem } .slds-path__item{ margin-left: 0.5rem; margin-right: 0.5625rem } .slds-path__item:before, .slds-path__item:after{ left: -0.3125rem; right: -0.375rem } .slds-path__item:before{ height: calc((2.75rem / 2) + 0.0625rem) } .slds-path__item:after{ height: 1.375rem } .slds-path__item:first-child:before, .slds-path__item:first-child:after{ left: 1.625rem } .slds-path__item:last-child:before, .slds-path__item:last-child:after{ right: 1.125rem } .slds-path__link{ height: 2.75rem } .slds-pill{ line-height: 1.875rem; padding: 0 0.75rem } .slds-pill + .slds-pill{ margin-left: 0.25rem } .slds-pill__container, .slds-pill-container, .slds-pill_container{ padding: 0.25rem } .slds-pill__label{ font-size: 0.875rem } .slds-pill__icon ~ .slds-pill__action, .slds-pill__icon_container ~ .slds-pill__action{ padding-left: calc(1.25rem + 0.75rem + 0.25rem) } .slds-pill_link .slds-pill__icon_container, .slds-pill--link .slds-pill__icon_container{ left: 0.75rem } .slds-pill_link .slds-pill__remove, .slds-pill--link .slds-pill__remove{ right: 0.75rem } .slds-pill__action{ padding: 0; padding-left: 0.75rem; padding-right: calc(1rem + 0.75rem + 2px) } .slds-popover_prompt__heading{ font-size: 1.25rem } .slds-progress__item{ position: relative; -webkit-box-align: center; -ms-flex-align: center; align-items: center; min-height: 2.75rem } .slds-progress__item .slds-button:before{ content: ""; position: absolute; height: 2.75rem; width: calc(100% + 8px) } .slds-progress__marker{ width: 1.25rem; height: 1.25rem; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center } .slds-progress__marker_icon .slds-button__icon, .slds-progress__marker_icon .slds-icon, .slds-progress__marker--icon .slds-button__icon, .slds-progress__marker--icon .slds-icon{ width: 1.25rem; height: 1.25rem } .slds-progress_vertical .slds-progress__item:before, .slds-progress_vertical .slds-progress__item:after{ left: calc((1.25rem / 2) - 1px) } .slds-progress_vertical .slds-progress__item_content{ font-size: 0.875rem } .slds-radio_button-group, .slds-radio--button-group{ display: block } .slds-radio_button-group .slds-radio_button, .slds-radio_button-group .slds-radio--button, .slds-radio--button-group .slds-radio_button, .slds-radio--button-group .slds-radio--button{ display: block } .slds-radio_button-group .slds-radio_button + .slds-radio_button, .slds-radio_button-group .slds-radio--button + .slds-radio--button, .slds-radio--button-group .slds-radio_button + .slds-radio_button, .slds-radio--button-group .slds-radio--button + .slds-radio--button{ border-left: 0; border-top: 1px solid #dddbda } .slds-radio_button-group .slds-radio_button:first-child > .slds-radio_button__label, .slds-radio_button-group .slds-radio--button:first-child > .slds-radio--button__label, .slds-radio--button-group .slds-radio_button:first-child > .slds-radio_button__label, .slds-radio--button-group .slds-radio--button:first-child > .slds-radio--button__label{ border-radius: 0.25rem 0.25rem 0 0 } .slds-radio_button-group .slds-radio_button:last-child > .slds-radio_button__label, .slds-radio_button-group .slds-radio--button:last-child > .slds-radio--button__label, .slds-radio--button-group .slds-radio_button:last-child > .slds-radio_button__label, .slds-radio--button-group .slds-radio--button:last-child > .slds-radio--button__label{ border-radius: 0 0 0.25rem 0.25rem } .slds-radio_button-group .slds-radio_button__label, .slds-radio_button-group .slds-radio--button__label, .slds-radio--button-group .slds-radio_button__label, .slds-radio--button-group .slds-radio--button__label{ display: block; text-align: center } .slds-radio_button, .slds-radio--button{ line-height: 2.69rem } .slds-radio .slds-radio__label{ display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; min-height: 2.75rem } .slds-radio .slds-radio_faux, .slds-radio .slds-radio--faux{ width: 1.5rem; height: 1.5rem } .slds-radio .slds-form-element__label{ display: -webkit-inline-box; display: -ms-inline-flexbox; display: inline-flex; font-size: 1rem } .slds-slider{ -webkit-box-align: center; -ms-flex-align: center; align-items: center; margin-top: 0.5rem; min-height: 2rem } .slds-slider__range::-webkit-slider-thumb{ height: 2rem; width: 2rem; margin-top: calc(((2rem / 2) - (4px / 2)) * -1) } .slds-slider__range::-moz-range-thumb{ height: 2rem; width: 2rem } .slds-slider__range::-ms-thumb{ height: 2rem; width: 2rem } .slds-slider_vertical{ -webkit-box-align: initial; -ms-flex-align: initial; align-items: initial } .slds-slider_vertical .slds-slider__range{ margin-left: calc((2rem - 1rem) / 2) } .slds-slider_vertical .slds-slider__value{ left: calc((2rem - 1rem) / 2) } .slds-tabs-mobile__item .slds-button:active, .slds-tabs-mobile__item .slds-button:hover{ color: currentColor } .slds-text-body_regular, .slds-text-body--regular{ font-size: 1rem } .slds-text-body_small, .slds-text-body--small{ font-size: 0.875rem } .slds-text-heading_large, .slds-text-heading--large{ font-size: 2rem } .slds-text-heading_medium, .slds-text-heading--medium{ font-size: 1.5rem } .slds-text-heading_small, .slds-text-heading--small{ font-size: 1.25rem } } @media (pointer: coarse) and (hover: none) and (min-width: 48em){ .slds-form-element_horizontal .slds-form-element__label, .slds-form_horizontal .slds-form-element .slds-form-element__label, .slds-form_stacked .slds-form-element_horizontal .slds-form-element__label{ display: block; max-width: calc(33% - 2.75rem); -ms-flex-preferred-size: calc(33% - 2.75rem); flex-basis: calc(33% - 2.75rem); padding-top: 0.25rem } .slds-form-element_horizontal .slds-form-element__control, .slds-form_horizontal .slds-form-element .slds-form-element__control, .slds-form_stacked .slds-form-element_horizontal .slds-form-element__control{ display: block; min-height: 0 } .slds-form-element_horizontal .slds-form-element__icon, .slds-form_horizontal .slds-form-element .slds-form-element__icon, .slds-form_stacked .slds-form-element_horizontal .slds-form-element__icon{ padding-top: 0 } .slds-form-element_horizontal .slds-checkbox__label, .slds-form_horizontal .slds-form-element .slds-checkbox__label, .slds-form_stacked .slds-form-element_horizontal .slds-checkbox__label{ display: block } }
cdnjs/cdnjs
ajax/libs/design-system/2.12.0/styles/salesforce-lightning-design-system_touch.css
CSS
mit
20,308
package qub; public class MapIndexableTests { public static void test(TestRunner runner) { runner.testGroup(MapIndexable.class, () -> { IndexableTests.test(runner, (Integer count) -> { final List<String> innerIterable = new ArrayList<>(); for (int i = 0; i < count; ++i) { innerIterable.add(Integer.toString(i)); } return new MapIndexable<>(innerIterable, Integer::parseInt); }); }); } }
danschultequb/qub-java
tests/qub/MapIndexableTests.java
Java
mit
561
require "rubygems" MOON_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(MOON_ROOT) CONFIG = YAML.load_file(File.join(MOON_ROOT, 'config', 'config.yml')) module MoonwalkAir class << self def boot! gem 'moonwalkair' require 'initializer' end end end MoonwalkAir.boot!
danielvlopes/moonwalkair
lib/moonwalkair/templates/config/boot.rb
Ruby
mit
301
import {Component} from 'angular2/core'; import {DataService} from './services/data.service'; import {UserService} from './services/user.service'; import {ToolService} from './services/tools.service'; import {Router, ROUTER_DIRECTIVES} from 'angular2/router'; @Component({ selector: 'my-login', templateUrl: './templates/login.tpl.html', styleUrls: ['../src/css/login.css'], directives: [ROUTER_DIRECTIVES] }) export class LoginComponent { show_error: Object; constructor( private _dataService: DataService, private _router: Router, private _userService: UserService, private _tools: ToolService) {} onSubmit(form) { this._dataService.postData(form.value, 'login') .subscribe( data => this.loginUser(data), error => this.handleError(error) ); } loginUser(data) { this._tools.setCookie('user_session', data.response.user.session_id); this._tools.setCookie('username', data.response.user.username); this._userService.setUserData() .subscribe( success => { this._router.navigate(['MyClients', {group: 'all'}]); }, error => console.log(error) ); } handleError(error) { this.show_error = error; console.log(error); } }
evildj67/new-new-agentology-com
dev/login.component.ts
TypeScript
mit
1,369
using OfficeOpenXml; using System; using System.Collections; using System.Collections.Generic; namespace EEPlusWrappers { public interface IExcelRange : IEnumerator, IEnumerator<IExcelRange>, IEnumerable, IEnumerable<IExcelRange> { ExcelRange Range { get; } IExcelRange this[int Row, int Col] { get; } string Text { get; } object Value { get; } } public class ExcelRangeWrapper : IExcelRange { public ExcelRange Range { get; private set; } private IDictionary<Tuple<int, int>, IExcelRange> _cells; public ExcelRangeWrapper(ExcelRange range) { Range = range; } [Obsolete] /// <summary> /// Unit testing constructor /// </summary> public ExcelRangeWrapper() { _cells = new Dictionary<Tuple<int, int>, IExcelRange>(); } public IExcelRange this[int Row, int Col] { get { if (Range != null) { var range = Range[Row, Col]; return new ExcelRangeWrapper(range); } return _cells[new Tuple<int, int>(Row, Col)]; } } public void AddRange(IExcelRange range, int row, int column) { _cells[new Tuple<int, int>(row, column)] = range; } public string Text { get { return Range.Text; } } public object Value { get { return Range.Value; } } object IEnumerator.Current { get { return this.Current; } } public IExcelRange Current { get { return new ExcelRangeWrapper(Range); } } public bool MoveNext() { return Range.MoveNext(); } public void Reset() { Range.Reset(); } IEnumerator IEnumerable.GetEnumerator() { return this.GetEnumerator(); } public IEnumerator<IExcelRange> GetEnumerator() { Reset(); return this; } public void Dispose() { } } }
lukezaparaniuk-onalytica/epplus-wrappers
EEPlusWrappers/ExcelRangeWrapper.cs
C#
mit
2,410
<?php namespace kosssi\ExampleDoctrineEventsBundle\Tests\Controller; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class DefaultControllerTest extends WebTestCase { public function testIndex() { $client = static::createClient(); $crawler = $client->request('GET', '/'); $this->assertTrue($crawler->filter('html:contains("Example doctrine events!")')->count() > 0); } }
kosssi/doctrineEvents
src/kosssi/ExampleDoctrineEventsBundle/Tests/Controller/DefaultControllerTest.php
PHP
mit
417
import struct from . import crc16 class PacketWriter: MAX_PAYLOAD = 1584 MIN_LEN = 6 MAX_LEN = 1590 SOF = 0x01 OFFSET_SOF = 0 OFFSET_LENGTH = 1 OFFSET_CMD = 3 OFFSET_PAYLOAD = 4 def __init__(self): self._packet = None def Clear(self): self._packet = None def NewSOF(self, v): self._packet[0] = chr(v) def PacketString(self): return "".join(self._packet) def AppendCrc(self): self.SetLength() ps = self.PacketString() crc = crc16.crc16(ps, 0, len(ps)) for x in struct.pack("H", crc): self._packet.append(x) def SetLength(self): self._packet[1] = chr(len(self._packet) + 2) def _Add(self, x): try: len(x) for y in x: self._Add(y) except: # noqa: E722 self._packet.append(x) def ComposePacket(self, command, payload=None): assert self._packet is None self._packet = ["\x01", None, "\x00", chr(command)] if payload: self._Add(payload) self.AppendCrc()
openaps/dexcom_reader
dexcom_reader/packetwriter.py
Python
mit
1,120