code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
3
942
language
stringclasses
30 values
license
stringclasses
15 values
size
int32
3
1.05M
<!doctype html> <html class="no-js" lang=""> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title></title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="apple-touch-icon" href="apple-touch-icon.png"> <!-- Place favicon.ico in the root directory --> <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="css/main.css"> <script src="js/vendor/modernizr-2.8.3.min.js"></script> <link href="css/bootstrap.min.css" rel="stylesheet" /> <!--<style> * { padding: 0; margin: 0; } .fit { /* set relative picture size */ max-width: 100%; max-height: 100%; } .center { display: block; margin: auto; } .content{ position: absolute; top: 50%; left: 50%; } </style>--> </head> <body> <!--[if lt IE 8]> <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> <![endif]--> <!-- Add your site or application content here --> <div class="container-fluid"> <div class="row"> <div class="col-lg-4 col-lg-offset-9"> <a href="#">Home</a> &nbsp;&nbsp; <a href="#">How it works?</a> &nbsp;&nbsp; <a href="#">About us</a> </div> </div> <div class="row"> <div class="col-lg-12">&nbsp;</div> </div> <div class="row"> <div class="col-lg-12"> <div style="background-color:lightblue; height:100px;"> <p class="text-center">Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p> </div> </div> </div> <div class="row"> <div class="col-lg-12">&nbsp;</div> </div> <div class="row"> <div class="col-lg-2 col-lg-offset-4"> <a class="btn btn-default" href="#" role="button">I'm a car park owner</a> </div> <div class="col-lg-2"> <a class="btn btn-default" href="Find.html" role="button">I'm looking for a car park</a> </div> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.3.min.js"><\/script>')</script> <script src="js/plugins.js"></script> <script src="js/main.js"></script> <!-- Google Analytics: change UA-XXXXX-X to be your site's ID. --> <script> (function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]= function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date; e=o.createElement(i);r=o.getElementsByTagName(i)[0]; e.src='https://www.google-analytics.com/analytics.js'; r.parentNode.insertBefore(e,r)}(window,document,'script','ga')); ga('create','UA-XXXXX-X','auto');ga('send','pageview'); </script> </body> </html> <script type="text/javascript" language="JavaScript"> function set_body_height() { // set body height = window height $('body').height($(window).height()); } $(document).ready(function () { $(window).bind('resize', set_body_height); set_body_height(); }); </script>
fraygit/shareparking
index.html
HTML
mit
3,762
// Calendar SK language // Author: Peter Valach ([email protected]) // Encoding: utf-8 // Last update: 2003/10/29 // full day names Calendar._DN = new Array ("NedeÄľa", "Pondelok", "Utorok", "Streda", "Ĺ tvrtok", "Piatok", "Sobota", "NedeÄľa"); // short day names Calendar._SDN = new Array ("Ned", "Pon", "Uto", "Str", "Ĺ tv", "Pia", "Sob", "Ned"); // full month names Calendar._MN = new Array ("Január", "Február", "Marec", "AprĂ­l", "Máj", "JĂşn", "JĂşl", "August", "September", "OktĂłber", "November", "December"); // short month names Calendar._SMN = new Array ("Jan", "Feb", "Mar", "Apr", "Máj", "JĂşn", "JĂşl", "Aug", "Sep", "Okt", "Nov", "Dec"); // tooltips Calendar._TT = {}; Calendar._TT["INFO"] = "O kalendári"; Calendar._TT["ABOUT"] = "DHTML Date/Time Selector\n" + "(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + "PoslednĂş verziu nájdete na: http://www.dynarch.com/projects/calendar/\n" + "DistribuovanĂ© pod GNU LGPL. ViÄŹ http://gnu.org/licenses/lgpl.html pre detaily." + "\n\n" + "VĂ˝ber dátumu:\n" + "- PouĹľite tlaÄŤidlá \xab, \xbb pre vĂ˝ber roku\n" + "- PouĹľite tlaÄŤidlá " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " pre vĂ˝ber mesiaca\n" + "- Ak ktorĂ©koÄľvek z tĂ˝chto tlaÄŤidiel podržíte dlhšie, zobrazĂ­ sa rĂ˝chly vĂ˝ber."; Calendar._TT["ABOUT_TIME"] = "\n\n" + "VĂ˝ber ÄŤasu:\n" + "- Kliknutie na niektorĂş poloĹľku ÄŤasu ju zvýši\n" + "- Shift-klik ju znĂ­Ĺľi\n" + "- Ak podržíte tlaÄŤĂ­tko stlaÄŤenĂ©, posĂşvanĂ­m menĂ­te hodnotu."; Calendar._TT["PREV_YEAR"] = "PredošlĂ˝ rok (podrĹľte pre menu)"; Calendar._TT["PREV_MONTH"] = "PredošlĂ˝ mesiac (podrĹľte pre menu)"; Calendar._TT["GO_TODAY"] = "PrejsĹĄ na dnešok"; Calendar._TT["NEXT_MONTH"] = "Nasl. mesiac (podrĹľte pre menu)"; Calendar._TT["NEXT_YEAR"] = "Nasl. rok (podrĹľte pre menu)"; Calendar._TT["SEL_DATE"] = "ZvoÄľte dátum"; Calendar._TT["DRAG_TO_MOVE"] = "PodrĹľanĂ­m tlaÄŤĂ­tka zmenĂ­te polohu"; Calendar._TT["PART_TODAY"] = " (dnes)"; Calendar._TT["MON_FIRST"] = "ZobraziĹĄ pondelok ako prvĂ˝"; Calendar._TT["SUN_FIRST"] = "ZobraziĹĄ nedeÄľu ako prvĂş"; Calendar._TT["CLOSE"] = "ZavrieĹĄ"; Calendar._TT["TODAY"] = "Dnes"; Calendar._TT["TIME_PART"] = "(Shift-)klik/ĹĄahanie zmenĂ­ hodnotu"; // date formats Calendar._TT["DEF_DATE_FORMAT"] = "$d. %m. %Y"; Calendar._TT["TT_DATE_FORMAT"] = "%a, %e. %b"; Calendar._TT["WK"] = "týž";
JoAutomation/todo-for-you
lib/js/jscalendar/lang/calendar-sk-utf8.js
JavaScript
mit
2,589
@charset "utf-8"; body { color: #7d7d7d; /*background: #f5f4f2;*/ font-size: .875rem; line-height: 24px; background: #eeede8; } h1, h2, h3, h4, h5, h6, ul, li, ol, p { margin: 0; padding: 0; } a { color: #7d7d7d; text-decoration: none; cursor: pointer; } a:hover { color: #54abd4; } h1, h2, h3, h4, h5, h6 { color: #666; /*font-weight: bold;*/ } h4 { margin: 0 0 10px 0; } li { display: list-item; text-align: -webkit-match-parent; } ul { list-style-type: none; margin: 0; padding: 0; } p { margin: 12px 0; } input[type="text"], input[type="password"], input[type="email"], input[type="date"], textarea { height: 40px; /*line-height: 40px;*/ padding: 6px 10px; background: #f5f5f5; border: 1px solid #f5f5f5; border-radius: 2px; box-shadow: none; color: #777; } input:focus, input:active, input:hover, input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus, input[type="date"]:focus, textarea:focus, textarea:active, textarea:hover { background: #fff; border: 1px solid #54abd4; box-shadow: none; transition: all .25s ease-in-out; } /*蓝色矩形*/ .tag-info { display: inline-block; margin: 0 4px 4px 0; padding: 0 8px; color: #fff; background: #88C5E1; border-radius: 4px; } .tag-info:hover { color: #fff; background: #54abd4; text-decoration: none; } /*字体设置工具类*/ .tag-sm { padding: 0 6px; font-size: .75rem; } .f-12 { font-size: .75rem; } .f-14 { font-size: .875rem; } .f-16 { font-size: 1rem; } .f-18 { font-size: 1.125rem; } .f-weight{ font-weight: 600; } .f-hot{ color:#333; } .f-main { color: #88C5E1; } .f-sub { color: #f9ca5a; } .f-light { color: #b5b5b5; } .f-orange{ color: #fbd16f; } .f-white { color: #fff; } .f-user{ color: #54abd4; } .f-ln18{ line-height: 1.8em; } /*content*/ .content { margin: 80px 0 0 0; min-height: 720px; } /*section*/ .section { margin: 0 0 20px 0; padding: 40px 25px 30px 25px; background-color: #FFFFFF; -moz-border-radius: 1px 1px 1px 1px; -webkit-border-radius: 1px 1px 1px 1px; border-radius: 1px 1px 1px 1px; box-shadow: 0 14px 10px -10px rgba(0,0,0,0.1); } .section h4 { margin: 0 0 24px 0; padding: 8px 16px; border-left: 3px solid #88C5E1; } /*item*/ .item { padding: 12px 0 20px 0; } .score img{ display: inline; width: 12px; } /*汉堡菜单*/ .nav-hamburger { height: 40px; padding: 0 10px; color: #fff; border: 1px solid #fff; border-radius: 2px; font-size: 1.125rem; line-height: 40px; } .nav-hamburger a { display: block; color: #fff; } .navbar{ padding: 12px 0; background-color: #88c5e1; border: none; border-bottom: 5px solid #54abd4; } .navbar-nav > li > a { font-size: 1rem; color: #fff; margin: 0 0 0 8px; background: transparent; padding: 10px; } .navbar-nav > .active > a{ background: none; color: #fff; border-bottom: 2px solid #fff; } .navbar-nav > li > a:hover{ color: #fff; border-bottom: 2px solid #fff; } .navbar-brand-mc{ padding: 6px 0; font-weight: 100; } .navbar-brand-mc img{ height: 40px; display: inline-block; margin-right: 3px; } .navbar-default .navbar-nav>.active>a, .navbar-default .navbar-nav>.active>a:focus, .navbar-default .navbar-nav>.active>a:hover{ background: transparent; color: #fff; } .nav>li>a:focus, .nav>li>a:hover{ background: transparent; } .navbar-form-mc .input-group { width: 100%; } #input-search { border-radius: 2px; } .input-group-nav .input-group-btn:last-child > .btn, .input-group-nav .input-group-btn:last-child > .btn-group { z-index: 2; margin-left: -42px; } .input-group-nav .input-group-btn .btn { background: #f5f5f5; border: 1px solid #f5f5f5; border-radius: 2px; color: #54abd4; } .navbar-toggle{ margin: 18px 10px 8px 10px; } .home .content{ margin: 60px 0 0 0; } .wrapper{ padding: 35px 0; margin: 40px auto; background: url(../images/homeImg.png); background-size: cover; } .wrapper .form-control{ margin: 15px 0; } .wrapper .wrapper-intro{ text-align: center; } .wrapper .wrapper-intro img:first-child{ margin: -10px 0 20px 0; } .wrapper .wrapper-title{ margin: 7px 0; font-size: 20px; } .wrapper .wrapper-slogan{ font-size: 16px; } .wrapper .log-or-sign{ padding-left: 20px; } .wrapper .log-or-sign a{ color: #fff; } .wrapper .checkbox{ color: #333; } .section h4 small { margin-left: 8px; } .hot-course .item{ margin: 0 0 20px 0; padding: 0 10px; border: none; } .item-card{ background-color:#f5f5f5; text-align: center; padding: 52px 16px; box-shadow: 0 1px 2px #ddd; } .card-icon { display: inline-block; width: 64px; padding: 12px 0 4px 0; } .card-name { display: block; padding: 2px 0 16px 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .score img{ width: 12px; } .nav-tabs { border: none; border-bottom: 2px solid transparent; } .nav-tabs>li.active>a,.log-or-sign .nav-tabs>li.active>a:focus, .log-or-sign .nav-tabs>li.active>a:hover{ border: none; border-bottom: 2px solid transparent; } .log-or-sign .nav-tabs>li>a, .log-or-sign .nav-tabs>li>a:focus, .log-or-sign .nav-tabs>li>a:hover{ border-bottom: 2px solid #fff; } .log-or-sign .nav-tabs>li.active>a:hover{ border-bottom: 2px solid #fff; } .log-or-sign .nav-tabs>li>a{ border: none; border-bottom: 2px solid transparent; } .log-or-sign .nav-tabs{ /*border-bottom: 2px solid #eee;*/ } .log-or-sign .nav-tabs li{ padding: 0 0 10px 0; } .log-or-sign .nav-tabs li a{ padding: 10px 0 3px 0; margin-right: 15px; font-size: 16px; text-align: center; } .log-or-sign .nav-tabs li.active a{ color: #fff; background-color: transparent; border-bottom: 2px solid #fff; } .tab-info { display: none; padding: 12px 12px; color: #fff; background: #88c5e1; border-radius: 2px; } .tag-section { padding: 0 0 18px 0; } .tag-section h5 { padding: 8px 0 12px 0; } .thumbnail { padding: 0; background-color: #f5f5f5; border: none; box-shadow: 1px 1px 2px #ddd; } .carousel-inner .thumbnail .caption{ margin: 8px 0 20px 0; color: #999; font-size: 1rem; text-align: center; } .carousel-indicators{ bottom: -10px; } .carousel-indicators li{ width: 13px; height: 13px; } .carousel-indicators .active{ width: 15px; height: 15px; } .caption p{ margin-bottom: 20px; } .carousel-indicators li{ border: 1px solid #f8c038; } .carousel-indicators .active{ background-color: #f8c038; } @media screen and (max-width: 768px){ .wrapper .log-or-sign{ border-left: none; margin-left: 0px; padding-left: 15px; padding-top: 20px; } .wrapper-intro img{ display:none; } } @media (min-width: 992px){ .wrapper { padding: 96px 0; } } /*footer部分*/ footer { padding: 28px 0 18px 0; background: #eeece1; } .footer-icon { width: 10%; } .footer-seg { width: 88%; padding: 0 0 12px 0; } .footer-seg h5 { padding: 3px 0 7px 0; font-size: .875rem; } .footer-seg p { margin: 0; padding: 0; font-size: .75rem; line-height: 1.125rem; } .footer-info { font-size: .75rem; text-align: center; line-height: 1.125rem; } .footer-info p { margin: 0; padding: 0; }
HAobINA/HAobINA.github.io
mike/css/index.css
CSS
mit
7,676
.highlight { padding: 1px 3px; font-weight: bold; background-color: #fff34d; -moz-border-radius: 6px; -webkit-border-radius: 6px; border-radius: 6px; -moz-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.8); -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.8); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.8); }
riki343/Zectra_new
web/bundles/zectranet/css/search.css
CSS
mit
327
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. Rage Quit")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("03. Rage Quit")] [assembly: AssemblyCopyright("Copyright © 2017")] [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("102e97e8-a5dc-4989-9bff-d9818c2cabbf")] // 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")]
viktor4o4o/Homework
Exam Preparation III - Taking a Sample Exam/03. Rage Quit/Properties/AssemblyInfo.cs
C#
mit
1,402
module Jdt class GeneratorCLI < Thor desc "library NAME", "generate library with NAME" def library(name) LibraryGenerator.new.generate(name) end end end
Fekide/joomlatools
lib/jdt/cli/new/library.rb
Ruby
mit
179
/* * Hibernate, Relational Persistence for Idiomatic Java * * Copyright (c) 2011, Red Hat Inc. or third-party contributors as * indicated by the @author tags or express copyright attribution * statements applied by the authors. All third-party contributions are * distributed under license by Red Hat Inc. * * This copyrighted material is made available to anyone wishing to use, modify, * copy, or redistribute it subject to the terms and conditions of the GNU * Lesser General Public License, as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this distribution; if not, write to: * Free Software Foundation, Inc. * 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301 USA */ package org.hibernate.test.annotations.cascade; import java.util.HashSet; import org.junit.Test; import org.hibernate.HibernateException; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import static org.junit.Assert.fail; /** * @author Jeff Schnitzer * @author Gail Badner */ @SuppressWarnings("unchecked") public class NonNullableCircularDependencyCascadeTest extends BaseCoreFunctionalTestCase { @Test public void testIdClassInSuperclass() throws Exception { Session s = openSession(); Transaction tx = s.beginTransaction(); Parent p = new Parent(); p.setChildren( new HashSet<Child>() ); Child ch = new Child(p); p.getChildren().add(ch); p.setDefaultChild(ch); try { s.persist(p); s.flush(); fail( "should have failed because of transient entities have non-nullable, circular dependency." ); } catch ( HibernateException ex) { // expected } tx.rollback(); s.close(); } @Override protected Class[] getAnnotatedClasses() { return new Class[]{ Child.class, Parent.class }; } }
HerrB92/obp
OpenBeaconPackage/libraries/hibernate-release-4.2.7.SP1/project/hibernate-core/src/test/java/org/hibernate/test/annotations/cascade/NonNullableCircularDependencyCascadeTest.java
Java
mit
2,167
System.config({ baseURL: ".", defaultJSExtensions: true, transpiler: "babel", babelOptions: { "optional": [ "runtime", "optimisation.modules.system" ] }, paths: { "github:*": "jspm_packages/github/*", "npm:*": "jspm_packages/npm/*" }, bundles: { "build.js": [ "lib/main.js", "lib/filelayer/ajaxUtil.js", "lib/filelayer/corslite.js", "github:shramov/[email protected]", "npm:[email protected]", "npm:[email protected]", "lib/filelayer/leaflet.filelayer.js", "github:mholt/[email protected]", "npm:[email protected]/css/font-awesome.min.css!github:systemjs/[email protected]", "github:shramov/[email protected]/control/Distance", "npm:[email protected]/dist/leaflet-src", "npm:[email protected]/togeojson", "github:mholt/[email protected]/papaparse", "github:jspm/[email protected]", "github:jspm/[email protected]/index", "npm:[email protected]", "npm:[email protected]/browser" ] }, map: { "adm-zip": "npm:[email protected]", "babel": "npm:[email protected]", "babel-runtime": "npm:[email protected]", "clean-css": "npm:[email protected]", "core-js": "npm:[email protected]", "css": "github:systemjs/[email protected]", "font-awesome": "npm:[email protected]", "gildas-lormeau/zip.js": "github:gildas-lormeau/zip.js@master", "leaflet": "npm:[email protected]", "mapbox/togeojson": "github:mapbox/[email protected]", "mholt/PapaParse": "github:mholt/[email protected]", "shramov/leaflet-plugins": "github:shramov/[email protected]", "togeojson": "npm:[email protected]", "github:jspm/[email protected]": { "assert": "npm:[email protected]" }, "github:jspm/[email protected]": { "buffer": "npm:[email protected]" }, "github:jspm/[email protected]": { "constants-browserify": "npm:[email protected]" }, "github:jspm/[email protected]": { "crypto-browserify": "npm:[email protected]" }, "github:jspm/[email protected]": { "events": "npm:[email protected]" }, "github:jspm/[email protected]": { "Base64": "npm:[email protected]", "events": "github:jspm/[email protected]", "inherits": "npm:[email protected]", "stream": "github:jspm/[email protected]", "url": "github:jspm/[email protected]", "util": "github:jspm/[email protected]" }, "github:jspm/[email protected]": { "https-browserify": "npm:[email protected]" }, "github:jspm/[email protected]": { "os-browserify": "npm:[email protected]" }, "github:jspm/[email protected]": { "path-browserify": "npm:[email protected]" }, "github:jspm/[email protected]": { "process": "npm:[email protected]" }, "github:jspm/[email protected]": { "stream-browserify": "npm:[email protected]" }, "github:jspm/[email protected]": { "string_decoder": "npm:[email protected]" }, "github:jspm/[email protected]": { "url": "npm:[email protected]" }, "github:jspm/[email protected]": { "util": "npm:[email protected]" }, "github:jspm/[email protected]": { "vm-browserify": "npm:[email protected]" }, "github:jspm/[email protected]": { "browserify-zlib": "npm:[email protected]" }, "npm:[email protected]": { "buffer": "github:jspm/[email protected]", "fs": "github:jspm/[email protected]", "path": "github:jspm/[email protected]", "process": "github:jspm/[email protected]", "zlib": "github:jspm/[email protected]" }, "npm:[email protected]": { "fs": "github:jspm/[email protected]", "module": "github:jspm/[email protected]", "path": "github:jspm/[email protected]", "process": "github:jspm/[email protected]" }, "npm:[email protected]": { "assert": "github:jspm/[email protected]", "bn.js": "npm:[email protected]", "buffer": "github:jspm/[email protected]", "inherits": "npm:[email protected]", "minimalistic-assert": "npm:[email protected]", "vm": "github:jspm/[email protected]" }, "npm:[email protected]": { "util": "npm:[email protected]" }, "npm:[email protected]": { "process": "github:jspm/[email protected]" }, "npm:[email protected]": { "buffer": "github:jspm/[email protected]", "buffer-xor": "npm:[email protected]", "cipher-base": "npm:[email protected]", "create-hash": "npm:[email protected]", "crypto": "github:jspm/[email protected]", "evp_bytestokey": "npm:[email protected]", "fs": "github:jspm/[email protected]", "inherits": "npm:[email protected]", "systemjs-json": "github:systemjs/[email protected]" }, "npm:[email protected]": { "browserify-aes": "npm:[email protected]", "browserify-des": "npm:[email protected]", "buffer": "github:jspm/[email protected]", "crypto": "github:jspm/[email protected]", "evp_bytestokey": "npm:[email protected]" }, "npm:[email protected]": { "buffer": "github:jspm/[email protected]", "cipher-base": "npm:[email protected]", "crypto": "github:jspm/[email protected]", "des.js": "npm:[email protected]", "inherits": "npm:[email protected]" }, "npm:[email protected]": { "bn.js": "npm:[email protected]", "buffer": "github:jspm/[email protected]", "constants": "github:jspm/[email protected]", "crypto": "github:jspm/[email protected]", "randombytes": "npm:[email protected]" }, "npm:[email protected]": { "bn.js": "npm:[email protected]", "browserify-rsa": "npm:[email protected]", "buffer": "github:jspm/[email protected]", "create-hash": "npm:[email protected]", "create-hmac": "npm:[email protected]", "crypto": "github:jspm/[email protected]", "elliptic": "npm:[email protected]", "inherits": "npm:[email protected]", "parse-asn1": "npm:[email protected]", "stream": "github:jspm/[email protected]" }, "npm:[email protected]": { "assert": "github:jspm/[email protected]", "buffer": "github:jspm/[email protected]", "pako": "npm:[email protected]", "process": "github:jspm/[email protected]", "readable-stream": "npm:[email protected]", "util": "github:jspm/[email protected]" }, "npm:[email protected]": { "buffer": "github:jspm/[email protected]", "systemjs-json": "github:systemjs/[email protected]" }, "npm:[email protected]": { "base64-js": "npm:[email protected]", "child_process": "github:jspm/[email protected]", "fs": "github:jspm/[email protected]", "ieee754": "npm:[email protected]", "isarray": "npm:[email protected]", "process": "github:jspm/[email protected]" }, "npm:[email protected]": { "buffer": "github:jspm/[email protected]", "inherits": "npm:[email protected]", "stream": "github:jspm/[email protected]", "string_decoder": "github:jspm/[email protected]" }, "npm:[email protected]": { "buffer": "github:jspm/[email protected]", "commander": "npm:[email protected]", "fs": "github:jspm/[email protected]", "http": "github:jspm/[email protected]", "https": "github:jspm/[email protected]", "os": "github:jspm/[email protected]", "path": "github:jspm/[email protected]", "process": "github:jspm/[email protected]", "source-map": "npm:[email protected]", "url": "github:jspm/[email protected]", "util": "github:jspm/[email protected]" }, "npm:[email protected]": { "child_process": "github:jspm/[email protected]", "events": "github:jspm/[email protected]", "fs": "github:jspm/[email protected]", "graceful-readlink": "npm:[email protected]", "path": "github:jspm/[email protected]", "process": "github:jspm/[email protected]" }, "npm:[email protected]": { "buffer": "github:jspm/[email protected]", "inherits": "npm:[email protected]", "readable-stream": "npm:[email protected]", "typedarray": "npm:[email protected]" }, "npm:[email protected]": { "systemjs-json": "github:systemjs/[email protected]" }, "npm:[email protected]": { "fs": "github:jspm/[email protected]", "path": "github:jspm/[email protected]", "process": "github:jspm/[email protected]", "systemjs-json": "github:systemjs/[email protected]" }, "npm:[email protected]": { "buffer": "github:jspm/[email protected]" }, "npm:[email protected]": { "bn.js": "npm:[email protected]", "buffer": "github:jspm/[email protected]", "crypto": "github:jspm/[email protected]", "elliptic": "npm:[email protected]" }, "npm:[email protected]": { "buffer": "github:jspm/[email protected]", "cipher-base": "npm:[email protected]", "crypto": "github:jspm/[email protected]", "fs": "github:jspm/[email protected]", "inherits": "npm:[email protected]", "ripemd160": "npm:[email protected]", "sha.js": "npm:[email protected]" }, "npm:[email protected]": { "buffer": "github:jspm/[email protected]", "create-hash": "npm:[email protected]", "crypto": "github:jspm/[email protected]", "inherits": "npm:[email protected]", "stream": "github:jspm/[email protected]" }, "npm:[email protected]": { "browserify-cipher": "npm:[email protected]", "browserify-sign": "npm:[email protected]", "create-ecdh": "npm:[email protected]", "create-hash": "npm:[email protected]", "create-hmac": "npm:[email protected]", "diffie-hellman": "npm:[email protected]", "inherits": "npm:[email protected]", "pbkdf2": "npm:[email protected]", "public-encrypt": "npm:[email protected]", "randombytes": "npm:[email protected]" }, "npm:[email protected]": { "buffer": "github:jspm/[email protected]", "inherits": "npm:[email protected]", "minimalistic-assert": "npm:[email protected]" }, "npm:[email protected]": { "bn.js": "npm:[email protected]", "buffer": "github:jspm/[email protected]", "crypto": "github:jspm/[email protected]", "miller-rabin": "npm:[email protected]", "randombytes": "npm:[email protected]", "systemjs-json": "github:systemjs/[email protected]" }, "npm:[email protected]": { "bn.js": "npm:[email protected]", "brorand": "npm:[email protected]", "hash.js": "npm:[email protected]", "inherits": "npm:[email protected]", "systemjs-json": "github:systemjs/[email protected]" }, "npm:[email protected]": { "buffer": "github:jspm/[email protected]", "create-hash": "npm:[email protected]", "crypto": "github:jspm/[email protected]" }, "npm:[email protected]": { "css": "github:systemjs/[email protected]" }, "npm:[email protected]": { "fs": "github:jspm/[email protected]" }, "npm:[email protected]": { "inherits": "npm:[email protected]" }, "npm:[email protected]": { "http": "github:jspm/[email protected]" }, "npm:[email protected]": { "util": "github:jspm/[email protected]" }, "npm:[email protected]": { "buffer": "github:jspm/[email protected]", "crypto": "github:jspm/[email protected]", "fs": "github:jspm/[email protected]", "path": "github:jspm/[email protected]", "process": "github:jspm/[email protected]", "util": "github:jspm/[email protected]", "zlib": "github:jspm/[email protected]" }, "npm:[email protected]": { "bn.js": "npm:[email protected]", "brorand": "npm:[email protected]" }, "npm:[email protected]": { "os": "github:jspm/[email protected]" }, "npm:[email protected]": { "buffer": "github:jspm/[email protected]", "process": "github:jspm/[email protected]" }, "npm:[email protected]": { "asn1.js": "npm:[email protected]", "browserify-aes": "npm:[email protected]", "buffer": "github:jspm/[email protected]", "create-hash": "npm:[email protected]", "evp_bytestokey": "npm:[email protected]", "pbkdf2": "npm:[email protected]", "systemjs-json": "github:systemjs/[email protected]" }, "npm:[email protected]": { "process": "github:jspm/[email protected]" }, "npm:[email protected]": { "buffer": "github:jspm/[email protected]", "child_process": "github:jspm/[email protected]", "create-hmac": "npm:[email protected]", "crypto": "github:jspm/[email protected]", "path": "github:jspm/[email protected]", "process": "github:jspm/[email protected]", "systemjs-json": "github:systemjs/[email protected]" }, "npm:[email protected]": { "process": "github:jspm/[email protected]" }, "npm:[email protected]": { "assert": "github:jspm/[email protected]" }, "npm:[email protected]": { "bn.js": "npm:[email protected]", "browserify-rsa": "npm:[email protected]", "buffer": "github:jspm/[email protected]", "create-hash": "npm:[email protected]", "crypto": "github:jspm/[email protected]", "parse-asn1": "npm:[email protected]", "randombytes": "npm:[email protected]" }, "npm:[email protected]": { "process": "github:jspm/[email protected]" }, "npm:[email protected]": { "buffer": "github:jspm/[email protected]", "crypto": "github:jspm/[email protected]", "process": "github:jspm/[email protected]" }, "npm:[email protected]": { "buffer": "github:jspm/[email protected]", "core-util-is": "npm:[email protected]", "events": "github:jspm/[email protected]", "inherits": "npm:[email protected]", "isarray": "npm:[email protected]", "process": "github:jspm/[email protected]", "stream-browserify": "npm:[email protected]", "string_decoder": "npm:[email protected]" }, "npm:[email protected]": { "buffer": "github:jspm/[email protected]", "core-util-is": "npm:[email protected]", "events": "github:jspm/[email protected]", "inherits": "npm:[email protected]", "isarray": "npm:[email protected]", "process": "github:jspm/[email protected]", "process-nextick-args": "npm:[email protected]", "string_decoder": "npm:[email protected]", "util-deprecate": "npm:[email protected]" }, "npm:[email protected]": { "buffer": "github:jspm/[email protected]", "process": "github:jspm/[email protected]" }, "npm:[email protected]": { "buffer": "github:jspm/[email protected]", "fs": "github:jspm/[email protected]", "inherits": "npm:[email protected]", "process": "github:jspm/[email protected]" }, "npm:[email protected]": { "amdefine": "npm:[email protected]", "process": "github:jspm/[email protected]" }, "npm:[email protected]": { "events": "github:jspm/[email protected]", "inherits": "npm:[email protected]", "readable-stream": "npm:[email protected]" }, "npm:[email protected]": { "buffer": "github:jspm/[email protected]" }, "npm:[email protected]": { "concat-stream": "npm:[email protected]", "minimist": "npm:[email protected]", "process": "github:jspm/[email protected]" }, "npm:[email protected]": { "assert": "github:jspm/[email protected]", "punycode": "npm:[email protected]", "querystring": "npm:[email protected]", "util": "github:jspm/[email protected]" }, "npm:[email protected]": { "util": "github:jspm/[email protected]" }, "npm:[email protected]": { "inherits": "npm:[email protected]", "process": "github:jspm/[email protected]" }, "npm:[email protected]": { "indexof": "npm:[email protected]" } } });
p4535992/Leaflet.FileLayer-1
config.js
JavaScript
mit
16,544
// languages index var localeIndex = { "en" : 0, "ja" : 1, "es" : 2, "hu" : 3, "lt" : 4, "ru" : 5, "it" : 6, "pt" : 7, "sp_ch" : 8, "fr" : 9, "ge" : 10, "ua" : 11, "lv" : 12, "no" : 13, "pt_br" : 14 };
miya2000/Twippera-OAuth
js/lng.js
JavaScript
mit
251
<?php /** * This file is part of gh-dashboard. * * (c) Daniel Londero <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ function includeIfExists($file) { return file_exists($file) ? include $file : false; } if ((!$loader = includeIfExists(__DIR__.'/../vendor/autoload.php')) && (!$loader = includeIfExists(__DIR__.'/../../../autoload.php'))) { echo "Cannot find an autoload.php file, have you executed composer install command?" . PHP_EOL; exit(1); } return $loader;
dlondero/gh-dashboard
src/bootstrap.php
PHP
mit
597
<html><body> <h4>Windows 10 x64 (18363.836)</h4><br> <h2>_LUID</h2> <font face="arial"> +0x000 LowPart : Uint4B<br> +0x004 HighPart : Int4B<br> </font></body></html>
epikcraw/ggool
public/Windows 10 x64 (18363.836)/_LUID.html
HTML
mit
192
/******************************************************************************* * Filename: irc_comm.h * * These are functions and definitions that can be used for both the client * and the server programs. * * Written by: James Ross ******************************************************************************/ #ifndef _IRC_COMM_H_ #define _IRC_COMM_H_ #include "utility_sys.h" /* useful macros, definitions and libraries */ #define NO_FLAGS 0 /* used for functions where no flag argument is used. */ /* Server connectivity information */ #define _COM_SERV_ADDR "10.200.248.135" #define _COM_SERV_LEN sizeof(_COM_SERV_ADDR) #define _COM_SERV_PORT 50059 /* port listening on server */ #define _COM_NET_DOMAIN AF_INET /* network domain we are using. IPV4 */ #define _COM_SOCK_TYPE SOCK_STREAM /* tcp socket */ #define _COM_IP_PROTOCOL 0 /* Default for type in socket() */ #define _COM_IO_BUFF 512 /* max bytes that can be sent/recieved */ #define _NAME_SIZE_MAX 11 /* includes '\0' */ #define MSG_TYPE_SIZE 1 /****************************************************************************** * Command Code Definition ******************************************************************************/ #define RC_FA 0x1 #define RC_FL 0x2 #define RC_JOIN 0x7 #define RC_EXIT 0x8 #define RC_LOGOUT 0xA #define RC_RL 0xC #define RC_FR 0x10 #define RC_LOGON 0x11 #define RC_LEAVE 0x15 #define RC_MSG 0x16 #define RC_RUL 0x17 /* list users in a room */ #define RESERVED_Z 0x0 /* was useful to reserve for error checking */ #define RESERVE_CR 0x13 /* reserved since we use \r in messages */ /* server to client reply success/failure */ #define _REPLY_SUCCESS 1 #define _REPLY_FAILURE 0 /* length of the reply to logon. */ #define _LOGON_REPLY_SIZE 3 typedef struct server_info { in_addr_t addr; /* network binary of server address */ char *dot_addr; /* dotted representation of IP address */ in_port_t port; /* port used at IP address, network ordered */ int domain; /* AF_INET or AF_INET6 */ int sock_type; /* type of socket, socket() definition. */ int pcol; /* Protocol argument used in socket() */ int sockfd; /* socket file descriptior */ struct sockaddr_in *socket_info; /* socket API struct, IPV4 */ } struct_serv_info; typedef struct parsed_cli_message { char *cli_name; int type; char *msg; } struct_cli_message; typedef struct parsed_serv_message { uint8_t type; char *msg; } struct_serv_message; struct_serv_info* _com_init_serv_info(void); void _com_free_serv_info(struct_serv_info *dest); void _com_free_cli_message(struct_cli_message *rem); void _com_free_serv_message(struct_serv_message *rem); /******************************************************************************* * TODO: Maybe make these functions since they are long, though my current * protocol with them just calls a seperate stack frame and just calls the * inline, which the compiler should notice and just make that 1 stack frame * this code... * * An analyze binary size, which i think is okay since it is only called in a * single line function that returns this. Other issues though? Memory * imprint in a different way? ******************************************************************************/ static inline ssize_t socket_transmit(int sockfd, uint8_t *tx, size_t len, int flags) { ssize_t sent; /* number of bytes written to socket */ size_t remaining = len; /* number of bytes left to write */ sent = send(sockfd, tx, remaining, flags); if (_usrUnlikely(sent == FAILURE)) { err_msg("socket_transmit: send() failed"); return FAILURE; } /* in case there was something not written, try again */ remaining -= sent; tx += sent; return (len - remaining); } /* end socket_transmit */ static inline ssize_t socket_receive(int sockfd, uint8_t *rx, size_t len, int flags) { ssize_t received = 1; /* bytes read from a socket, non-EOF init */ size_t remaining = len; /* bytes still in buffer */ received = recv(sockfd, rx, remaining, flags); if (received == FAILURE) { err_msg("socket_recieve: recv() failed"); return FAILURE; } remaining -= received; rx += received; return (len - remaining); } /* end socket_recieve */ #endif
sedihglow/scratch_IRC_server
shared/include/irc_comm.h
C
mit
4,551
import React, { PropTypes, Component } from 'react'; import { Breadcrumb, Table, Button, Col } from 'react-bootstrap'; import cx from 'classnames'; import _ from 'lodash'; import withStyles from 'isomorphic-style-loader/lib/withStyles'; import s from './ProductList.css'; import Link from '../Link'; class ProductList extends Component { static propTypes = { isFetching: PropTypes.bool, rs: PropTypes.array, popAddApp: PropTypes.func, }; static defaultProps = { isFetching: true, rs: [], popAddApp: () => {}, }; constructor() { super(); this.renderRow = this.renderRow.bind(this); } renderRow(rowData, index) { const appName = _.get(rowData, 'name'); return ( <tr key={_.get(rowData, 'name')}> <td> <Link to={`/apps/${appName}`}>{appName}</Link> </td> <td style={{ textAlign: 'left' }}> <ul> { _.map(_.get(rowData, 'collaborators'), (item, email) => ( <li key={email}> {email} <span className={s.permission}> (<em>{_.get(item, 'permission')}</em>) </span> { _.get(item, 'isCurrentAccount') ? <span className={cx(s.label, s.labelSuccess)}> it's you </span> : null } </li> )) } </ul> </td> <td> <ul> { _.map(_.get(rowData, 'deployments'), (item, email) => ( <li key={email} style={item === 'Production' ? { color: 'green' } : null} > <Link to={`/apps/${appName}/${item}`}>{item}</Link> </li> )) } </ul> </td> <td /> </tr> ); } render() { const self = this; const tipText = '暂无数据'; return ( <div className={s.root}> <div className={s.container}> <Breadcrumb> <Breadcrumb.Item active> 应用列表 </Breadcrumb.Item> </Breadcrumb> <Col style={{ marginBottom: '20px' }}> <Button onClick={this.props.popAddApp} bsStyle="primary" > 添加应用 </Button> </Col> <Table striped bordered condensed hover responsive> <thead> <tr> <th style={{ textAlign: 'center' }} >产品名</th> <th style={{ textAlign: 'center' }} >成员</th> <th style={{ textAlign: 'center' }} >Deployments</th> <th style={{ textAlign: 'center' }} >操作</th> </tr> </thead> <tbody> { this.props.rs.length > 0 ? _.map(this.props.rs, (item, index) => self.renderRow(item, index)) : <tr> <td colSpan="4" >{tipText}</td> </tr> } </tbody> </Table> </div> </div> ); } } export default withStyles(s)(ProductList);
lisong/code-push-web
src/components/ProductList/ProductList.js
JavaScript
mit
3,199
# Scala Documentation * [Command Line Input](command-line-input/command-line-input.md) * [String](string/string.md) * [Array](array/array.md) * [List](list/list.md) * [Vector](vector/vector.md) * [Iterator](iterator/iterator.md) * [HashMap](hashmap/hashmap.md) * [Math](math/math.md)
pk-scala/scala-doc
README.md
Markdown
mit
292
define(['exports'], function (exports) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var globalExtraOptions = exports.globalExtraOptions = { mappingDataStructure: { class: 'class', content: 'content', disabled: 'disabled', divider: 'divider', groupLabel: 'group', groupDisabled: 'disabled', icon: 'icon', maxOptions: 'maxOptions', option: 'option', subtext: 'subtext', style: 'style', title: 'title', tokens: 'tokens' } }; var globalPickerOptions = exports.globalPickerOptions = { dropupAuto: true, showTick: true, width: 'auto' }; });
ghiscoding/Aurelia-Bootstrap-Plugins
aurelia-bootstrap-select/dist/amd/picker-global-options.js
JavaScript
mit
686
//================================================================================================= /*! // \file blaze/math/views/subvector/SubvectorData.h // \brief Header file for the implementation of the SubvectorData class template // // Copyright (C) 2012-2020 Klaus Iglberger - All Rights Reserved // // This file is part of the Blaze library. You can redistribute it and/or modify it under // the terms of the New (Revised) BSD License. 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. // 3. Neither the names of the Blaze development group 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 HOLDER 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. */ //================================================================================================= #ifndef _BLAZE_MATH_VIEWS_SUBVECTOR_SUBVECTORDATA_H_ #define _BLAZE_MATH_VIEWS_SUBVECTOR_SUBVECTORDATA_H_ //************************************************************************************************* // Includes //************************************************************************************************* #include <blaze/util/MaybeUnused.h> #include <blaze/util/Types.h> namespace blaze { //================================================================================================= // // CLASS DEFINITION // //================================================================================================= //************************************************************************************************* /*!\brief Auxiliary class template for the data members of the Subvector class. // \ingroup subvector // // The auxiliary SubvectorData class template represents an abstraction of the data members of // the Subvector class template. The necessary set of data members is selected depending on the // number of compile time subvector arguments. */ template< size_t... CSAs > // Compile time subvector arguments class SubvectorData {}; //************************************************************************************************* //================================================================================================= // // CLASS TEMPLATE SPECIALIZATION FOR ZERO COMPILE TIME ARGUMENTS // //================================================================================================= //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Specialization of the SubvectorData class template for zero compile time subvector // arguments. // \ingroup subvector // // This specialization of SubvectorData adapts the class template to the requirements of zero // compile time subvector arguments. */ template<> class SubvectorData<> { public: //**Compile time flags************************************************************************** //! Compilation flag for compile time optimization. /*! The \a compileTimeArgs compilation flag indicates whether the view has been created by means of compile time arguments and whether these arguments can be queried at compile time. In that case, the \a compileTimeArgs compilation flag is set to \a true, otherwise it is set to \a false. */ static constexpr bool compileTimeArgs = false; //********************************************************************************************** //**Constructors******************************************************************************** /*!\name Constructors */ //@{ template< typename... RSAs > inline SubvectorData( size_t index, size_t n, RSAs... args ); SubvectorData( const SubvectorData& ) = default; //@} //********************************************************************************************** //**Destructor********************************************************************************** /*!\name Destructor */ //@{ ~SubvectorData() = default; //@} //********************************************************************************************** //**Assignment operators************************************************************************ /*!\name Assignment operators */ //@{ SubvectorData& operator=( const SubvectorData& ) = delete; //@} //********************************************************************************************** //**Utility functions*************************************************************************** /*!\name Utility functions */ //@{ inline size_t offset() const noexcept; inline size_t size () const noexcept; //@} //********************************************************************************************** private: //**Member variables**************************************************************************** /*!\name Member variables */ //@{ const size_t offset_; //!< The offset of the subvector within the vector. const size_t size_; //!< The size of the subvector. //@} //********************************************************************************************** }; /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief The constructor for SubvectorData. // // \param index The offset of the subvector within the given vector. // \param n The size of the subvector. // \param args The optional subvector arguments. */ template< typename... RSAs > // Optional subvector arguments inline SubvectorData<>::SubvectorData( size_t index, size_t n, RSAs... args ) : offset_( index ) // The offset of the subvector within the vector , size_ ( n ) // The size of the subvector { MAYBE_UNUSED( args... ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Returns the offset of the subvector within the underlying vector. // // \return The offset of the subvector. */ inline size_t SubvectorData<>::offset() const noexcept { return offset_; } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Returns the current size/dimension of the subvector. // // \return The size of the subvector. */ inline size_t SubvectorData<>::size() const noexcept { return size_; } /*! \endcond */ //************************************************************************************************* //================================================================================================= // // CLASS TEMPLATE SPECIALIZATION FOR TWO COMPILE TIME ARGUMENTS // //================================================================================================= //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Specialization of the SubvectorData class template for two compile time subvector // arguments. // \ingroup subvector // // This specialization of SubvectorData adapts the class template to the requirements of two // compile time arguments. */ template< size_t I // Index of the first element , size_t N > // Number of elements class SubvectorData<I,N> { public: //**Compile time flags************************************************************************** //! Compilation flag for compile time optimization. /*! The \a compileTimeArgs compilation flag indicates whether the view has been created by means of compile time arguments and whether these arguments can be queried at compile time. In that case, the \a compileTimeArgs compilation flag is set to \a true, otherwise it is set to \a false. */ static constexpr bool compileTimeArgs = true; //********************************************************************************************** //**Constructors******************************************************************************** /*!\name Constructors */ //@{ template< typename... RSAs > explicit inline SubvectorData( RSAs... args ); SubvectorData( const SubvectorData& ) = default; //@} //********************************************************************************************** //**Destructor********************************************************************************** /*!\name Destructor */ //@{ ~SubvectorData() = default; //@} //********************************************************************************************** //**Assignment operators************************************************************************ /*!\name Assignment operators */ //@{ SubvectorData& operator=( const SubvectorData& ) = delete; //@} //********************************************************************************************** //**Utility functions*************************************************************************** /*!\name Utility functions */ //@{ static constexpr size_t offset() noexcept; static constexpr size_t size () noexcept; //@} //********************************************************************************************** }; /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief The constructor for SubvectorData. // // \param args The optional subvector arguments. */ template< size_t I // Index of the first element , size_t N > // Number of elements template< typename... RSAs > // Optional subvector arguments inline SubvectorData<I,N>::SubvectorData( RSAs... args ) { MAYBE_UNUSED( args... ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Returns the offset of the subvector within the underlying vector. // // \return The offset of the subvector. */ template< size_t I // Index of the first element , size_t N > // Number of elements constexpr size_t SubvectorData<I,N>::offset() noexcept { return I; } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Returns the current size/dimension of the subvector. // // \return The size of the subvector. */ template< size_t I // Index of the first element , size_t N > // Number of elements constexpr size_t SubvectorData<I,N>::size() noexcept { return N; } /*! \endcond */ //************************************************************************************************* } // namespace blaze #endif
camillescott/boink
include/goetia/sketches/sketch/vec/blaze/blaze/math/views/subvector/SubvectorData.h
C
mit
12,696
# frozen_string_literal: true require 'sunrise/config/base' require 'sunrise/config/has_fields' module Sunrise module Config class Form < Base include Sunrise::Config::HasFields include Sunrise::Config::HasGroups # List of permissible attributes register_instance_option :permited_attributes do :all end end end end
galetahub/sunrise
lib/sunrise/config/form.rb
Ruby
mit
369
""" Given a string that contains only digits 0-9 and a target value, return all possibilities to add binary operators (not unary) +, -, or * between the digits so they evaluate to the target value. Examples: "123", 6 -> ["1+2+3", "1*2*3"] "232", 8 -> ["2*3+2", "2+3*2"] "105", 5 -> ["1*0+5","10-5"] "00", 0 -> ["0+0", "0-0", "0*0"] "3456237490", 9191 -> [] """ __author__ = 'Daniel' class Solution(object): def addOperators(self, num, target): """ Adapted from https://leetcode.com/discuss/58614/java-standard-backtrace-ac-solutoin-short-and-clear Algorithm: 1. DFS 2. Special handling for multiplication 3. Detect invalid number with leading 0's :type num: str :type target: int :rtype: List[str] """ ret = [] self.dfs(num, target, 0, "", 0, 0, ret) return ret def dfs(self, num, target, pos, cur_str, cur_val, mul, ret): if pos >= len(num): if cur_val == target: ret.append(cur_str) else: for i in xrange(pos, len(num)): if i != pos and num[pos] == "0": continue nxt_val = int(num[pos:i+1]) if not cur_str: self.dfs(num, target, i+1, "%d"%nxt_val, nxt_val, nxt_val, ret) else: self.dfs(num, target, i+1, cur_str+"+%d"%nxt_val, cur_val+nxt_val, nxt_val, ret) self.dfs(num, target, i+1, cur_str+"-%d"%nxt_val, cur_val-nxt_val, -nxt_val, ret) self.dfs(num, target, i+1, cur_str+"*%d"%nxt_val, cur_val-mul+mul*nxt_val, mul*nxt_val, ret) if __name__ == "__main__": assert Solution().addOperators("232", 8) == ["2+3*2", "2*3+2"]
algorhythms/LeetCode
282 Expression Add Operators.py
Python
mit
1,769
package softuni.io; import org.springframework.stereotype.Component; import java.io.*; @Component public class FileParser { public String readFile(String path) throws IOException { StringBuilder stringBuilder = new StringBuilder(); try (InputStream is = this.getClass().getResourceAsStream(path); BufferedReader bfr = new BufferedReader(new InputStreamReader(is))) { String line = bfr.readLine(); while (line != null) { stringBuilder.append(line); line = bfr.readLine(); } } return stringBuilder.toString(); } public void writeFile(String path, String content) throws IOException { File file = new File(System.getProperty("user.dir") + File.separator + path); if (!file.exists()) { file.createNewFile(); } try (OutputStream os = new FileOutputStream(System.getProperty("user.dir")+ File.separator + path); BufferedWriter bfw = new BufferedWriter(new OutputStreamWriter(os))) { bfw.write(content); } } }
yangra/SoftUni
Java-DB-Fundamentals/DatabasesFrameworks-Hibernate&SpringData/EXAMS/exam/src/main/java/softuni/io/FileParser.java
Java
mit
1,123
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>bignums: 2 m 35 s 🏆</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.14.0 / bignums - 8.14.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> bignums <small> 8.14.0 <span class="label label-success">2 m 35 s 🏆</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-01-22 01:07:46 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-01-22 01:07:46 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils conf-gmp 4 Virtual package relying on a GMP lib system installation coq 8.14.0 Formal proof management system dune 2.9.1 Fast, portable, and opinionated build system ocaml 4.12.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.12.1 Official release 4.12.1 ocaml-config 2 OCaml Switch Configuration ocaml-options-vanilla 1 Ensure that OCaml is compiled with no special options enabled ocamlfind 1.9.1 A library manager for OCaml zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;[email protected]&quot; homepage: &quot;https://github.com/coq/bignums&quot; dev-repo: &quot;git+https://github.com/coq/bignums.git&quot; bug-reports: &quot;https://github.com/coq/bignums/issues&quot; license: &quot;LGPL-2.1-only&quot; synopsis: &quot;Bignums, the Coq library of arbitrary large numbers&quot; description: &quot;&quot;&quot; Provides BigN, BigZ, BigQ that used to be part of Coq standard library &lt; 8.6 &quot;&quot;&quot; build: [make &quot;-j%{jobs}%&quot; {ocaml:version &gt;= &quot;4.06&quot;}] install: [make &quot;install&quot;] depends: [ &quot;ocaml&quot; {&gt;= &quot;4.05&quot;} &quot;coq&quot; {&gt;= &quot;8.14&quot; &amp; &lt; &quot;8.15~&quot;} ] tags: [ &quot;category:Miscellaneous/Coq Extensions&quot; &quot;category:Mathematics/Arithmetic and Number Theory/Number theory&quot; &quot;category:Mathematics/Arithmetic and Number Theory/Rational numbers&quot; &quot;keyword:integer numbers&quot; &quot;keyword:rational numbers&quot; &quot;keyword:arithmetic&quot; &quot;keyword:arbitrary-precision&quot; &quot;logpath:Bignums&quot; &quot;date:2021-09-17&quot; ] authors: [ &quot;Laurent Théry&quot; &quot;Benjamin Grégoire&quot; &quot;Arnaud Spiwack&quot; &quot;Evgeny Makarov&quot; &quot;Pierre Letouzey&quot; ] url { src: &quot;https://github.com/coq/bignums/archive/V8.14.0.tar.gz&quot; checksum: &quot;sha512=72be63a6be2600026ee4f5f24ea3479ff4c5d3f2a67ab65ec96ede56fbc35380ef6c721ad467c1b6d39f1447c28fe594fa5570d4228f1a05c6386b2b9955f2bc&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-bignums.8.14.0 coq.8.14.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam list; echo; ulimit -Sv 4000000; timeout 4h opam install -y --deps-only coq-bignums.8.14.0 coq.8.14.0</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>12 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam list; echo; ulimit -Sv 16000000; timeout 4h opam install -y -v coq-bignums.8.14.0 coq.8.14.0</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>2 m 35 s</dd> </dl> <h2>Installation size</h2> <p>Total: 8 M</p> <ul> <li>935 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/BigN/BigN.vo</code></li> <li>562 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleDiv.glob</code></li> <li>543 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/BigZ/BigZ.vo</code></li> <li>493 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/BigN/NMake.vo</code></li> <li>344 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleSqrt.glob</code></li> <li>290 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleCyclic.vo</code></li> <li>277 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/BigN/NMake.glob</code></li> <li>264 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleDiv.vo</code></li> <li>258 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/BigQ/QMake.vo</code></li> <li>246 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/BigN/NMake_gen.vo</code></li> <li>209 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/BigN/NMake_gen.glob</code></li> <li>204 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleDivn1.glob</code></li> <li>201 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleCyclic.glob</code></li> <li>197 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleSqrt.vo</code></li> <li>187 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleMul.glob</code></li> <li>176 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/SpecViaZ/ZSigZAxioms.vo</code></li> <li>168 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/SpecViaZ/NSigNAxioms.vo</code></li> <li>167 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/BigQ/BigQ.vo</code></li> <li>154 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleLift.glob</code></li> <li>151 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/BigQ/QMake.glob</code></li> <li>149 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/BigZ/ZMake.vo</code></li> <li>127 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/SpecViaQ/QSig.vo</code></li> <li>123 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleMul.vo</code></li> <li>122 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/BigZ/ZMake.glob</code></li> <li>108 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleDivn1.vo</code></li> <li>98 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleLift.vo</code></li> <li>89 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleSub.glob</code></li> <li>79 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/BigN/Nbasic.vo</code></li> <li>77 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleBase.glob</code></li> <li>75 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/BigN/Nbasic.glob</code></li> <li>74 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleAdd.glob</code></li> <li>67 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/BigNumPrelude.vo</code></li> <li>66 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleSub.vo</code></li> <li>66 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/SpecViaZ/NSigNAxioms.glob</code></li> <li>66 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/SpecViaZ/ZSigZAxioms.glob</code></li> <li>64 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/BigNumPrelude.glob</code></li> <li>64 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleBase.vo</code></li> <li>58 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/plugin/bignums_syntax_plugin.cmxs</code></li> <li>57 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleAdd.vo</code></li> <li>55 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleDiv.v</code></li> <li>54 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/SpecViaZ/ZSig.vo</code></li> <li>52 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/BigN/NMake.v</code></li> <li>50 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/SpecViaZ/NSig.vo</code></li> <li>44 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleSqrt.v</code></li> <li>40 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/SpecViaQ/QSig.glob</code></li> <li>37 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/SpecViaZ/ZSig.glob</code></li> <li>35 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/BigQ/QMake.v</code></li> <li>33 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/SpecViaZ/NSig.glob</code></li> <li>33 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/BigN/NMake_gen.v</code></li> <li>28 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleCyclic.v</code></li> <li>24 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleMul.v</code></li> <li>22 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/BigZ/ZMake.v</code></li> <li>20 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleDivn1.v</code></li> <li>19 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleLift.v</code></li> <li>16 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/BigZ/BigZ.glob</code></li> <li>16 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/BigN/Nbasic.v</code></li> <li>14 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/BigN/BigN.glob</code></li> <li>13 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleBase.v</code></li> <li>13 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/BigQ/BigQ.glob</code></li> <li>13 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleSub.v</code></li> <li>12 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/SpecViaZ/ZSigZAxioms.v</code></li> <li>11 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/SpecViaZ/NSigNAxioms.v</code></li> <li>11 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/CyclicDouble/DoubleAdd.v</code></li> <li>11 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/BigNumPrelude.v</code></li> <li>10 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/plugin/bignums_syntax_plugin.cmi</code></li> <li>9 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/plugin/bignums_syntax_plugin.cmx</code></li> <li>7 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/SpecViaQ/QSig.v</code></li> <li>6 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/BigZ/BigZ.v</code></li> <li>6 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/BigN/BigN.v</code></li> <li>5 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/BigQ/BigQ.v</code></li> <li>5 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/SpecViaZ/ZSig.v</code></li> <li>5 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/plugin/bignums_syntax_plugin.cmxa</code></li> <li>5 K <code>../ocaml-base-compiler.4.12.1/lib/coq/user-contrib/Bignums/SpecViaZ/NSig.v</code></li> </ul> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq-bignums.8.14.0</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
coq-bench/coq-bench.github.io
clean/Linux-x86_64-4.12.1-2.0.8/released/8.14.0/bignums/8.14.0.html
HTML
mit
16,134
<# .SYNOPSIS Automated unit test for MSFT_SqlServerSecureConnection DSC resource. .NOTES To run this script locally, please make sure to first run the bootstrap script. Read more at https://github.com/PowerShell/SqlServerDsc/blob/dev/CONTRIBUTING.md#bootstrap-script-assert-testenvironment #> Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\TestHelpers\CommonTestHelper.psm1') if (Test-SkipContinuousIntegrationTask -Type 'Unit') { return } $script:dscModuleName = 'SqlServerDsc' $script:dscResourceName = 'MSFT_SqlServerSecureConnection' #region HEADER # Unit Test Template Version: 1.2.0 $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or ` (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) ) { & git @('clone', 'https://github.com/PowerShell/DscResource.Tests.git', (Join-Path -Path $script:moduleRoot -ChildPath '\DSCResource.Tests\')) } Import-Module -Name (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1') -Force $TestEnvironment = Initialize-TestEnvironment ` -DSCModuleName $script:dscModuleName ` -DSCResourceName $script:dscResourceName ` -TestType Unit #endregion HEADER function Invoke-TestSetup { # Importing SQLPS stubs Import-Module -Name (Join-Path -Path (Join-Path -Path $PSScriptRoot -ChildPath 'Stubs') -ChildPath 'SQLPSStub.psm1') -Force -Global } function Invoke-TestCleanup { Restore-TestEnvironment -TestEnvironment $TestEnvironment } # Begin Testing try { Invoke-TestSetup InModuleScope $script:dscResourceName { class MockedAccessControl { [hashtable]$Access = @{ IdentityReference = 'Everyone' FileSystemRights = @{ value__ = '131209' } } [void] AddAccessRule([System.Security.AccessControl.FileSystemAccessRule] $object) { } } class MockedGetItem { [string] $Thumbprint = '12345678' [string] $PSPath = 'PathToItem' [string] $Path = 'PathToItem' [MockedAccessControl]$ACL = [MockedAccessControl]::new() [hashtable]$PrivateKey = @{ CspKeyContainerInfo = @{ UniqueKeyContainerName = 'key' } } [MockedGetItem] GetAccessControl() { return $this } } $mockNamedInstanceName = 'INSTANCE' $mockDefaultInstanceName = 'MSSQLSERVER' $mockThumbprint = '123456789' $mockServiceAccount = 'SqlSvc' Describe 'SqlServerSecureConnection\Get-TargetResource' -Tag 'Get' { BeforeAll { $mockDynamic_SqlBuildVersion = '13.0.4001.0' $defaultParameters = @{ InstanceName = $mockNamedInstanceName Thumbprint = $mockThumbprint ServiceAccount = $mockServiceAccount ForceEncryption = $true Ensure = 'Present' } } Context 'When the system is in the desired state and Ensure is Present' { Mock -CommandName Get-EncryptedConnectionSetting -MockWith { return @{ ForceEncryption = $true Certificate = $mockThumbprint } } -Verifiable Mock -CommandName Test-CertificatePermission -MockWith { return $true } It 'Should return the the state of present' { $resultGetTargetResource = Get-TargetResource @defaultParameters $resultGetTargetResource.InstanceName | Should -Be $mockNamedInstanceName $resultGetTargetResource.Thumbprint | Should -Be $mockThumbprint $resultGetTargetResource.ServiceAccount | Should -Be $mockServiceAccount $resultGetTargetResource.ForceEncryption | Should -Be $true $resultGetTargetResource.Ensure | Should -Be 'Present' Assert-MockCalled -CommandName Get-EncryptedConnectionSetting -Exactly -Times 1 -Scope It } } Context 'When the system is not in the desired state and Ensure is Present' { Mock -CommandName Get-EncryptedConnectionSetting -MockWith { return @{ ForceEncryption = $false Certificate = '987654321' } } -Verifiable Mock -CommandName Test-CertificatePermission -MockWith { return $false } It "Should return the state of absent when certificate thumbprint and certificate permissions don't match." { $resultGetTargetResource = Get-TargetResource @defaultParameters $resultGetTargetResource.InstanceName | Should -Be $mockNamedInstanceName $resultGetTargetResource.Thumbprint | Should -Not -Be $mockThumbprint $resultGetTargetResource.ServiceAccount | Should -Be $mockServiceAccount $resultGetTargetResource.ForceEncryption | Should -Be $false $resultGetTargetResource.Ensure | Should -Be 'Absent' Assert-MockCalled -CommandName Get-EncryptedConnectionSetting -Exactly -Times 1 -Scope It } } Context 'When the system is not in the desired state and Ensure is Present' { Mock -CommandName Get-EncryptedConnectionSetting -MockWith { return @{ ForceEncryption = $true Certificate = '987654321' } } -Verifiable Mock -CommandName Test-CertificatePermission -MockWith { return $true } It 'Should return the state of absent when certificate permissions match but encryption settings dont' { $resultGetTargetResource = Get-TargetResource @defaultParameters $resultGetTargetResource.InstanceName | Should -Be $mockNamedInstanceName $resultGetTargetResource.Thumbprint | Should -Not -Be $mockThumbprint $resultGetTargetResource.ServiceAccount | Should -Be $mockServiceAccount $resultGetTargetResource.ForceEncryption | Should -Be $true $resultGetTargetResource.Ensure | Should -Be 'Absent' Assert-MockCalled -CommandName Get-EncryptedConnectionSetting -Exactly -Times 1 -Scope It } } Context 'When the system is not in the desired state and Ensure is Present' { Mock -CommandName Get-EncryptedConnectionSetting -MockWith { return @{ ForceEncryption = $true Certificate = $mockThumbprint } } -Verifiable Mock -CommandName Test-CertificatePermission -MockWith { return $false } It 'Should return the state of absent when certificate permissions dont match but encryption settings do' { $resultGetTargetResource = Get-TargetResource @defaultParameters $resultGetTargetResource.InstanceName | Should -Be $mockNamedInstanceName $resultGetTargetResource.Thumbprint | Should -Be $mockThumbprint $resultGetTargetResource.ServiceAccount | Should -Be $mockServiceAccount $resultGetTargetResource.ForceEncryption | Should -Be $true $resultGetTargetResource.Ensure | Should -Be 'Absent' Assert-MockCalled -CommandName Get-EncryptedConnectionSetting -Exactly -Times 1 -Scope It } } $defaultParameters.Ensure = 'Absent' Context 'When the system is in the desired state and Ensure is Absent' { Mock -CommandName Get-EncryptedConnectionSetting -MockWith { return @{ ForceEncryption = $false Certificate = '' } } -Verifiable Mock -CommandName Test-CertificatePermission -MockWith { return $true } It 'Should return the the state of absent' { $resultGetTargetResource = Get-TargetResource @defaultParameters $resultGetTargetResource.InstanceName | Should -Be $mockNamedInstanceName $resultGetTargetResource.Thumbprint | Should -BeNullOrEmpty $resultGetTargetResource.ServiceAccount | Should -Be $mockServiceAccount $resultGetTargetResource.ForceEncryption | Should -Be $false $resultGetTargetResource.Ensure | Should -Be 'Absent' Assert-MockCalled -CommandName Get-EncryptedConnectionSetting -Exactly -Times 1 -Scope It } } Context 'When the system is not in the desired state and Ensure is Absent' { Mock -CommandName Get-EncryptedConnectionSetting -MockWith { return @{ ForceEncryption = $true Certificate = $mockThumbprint } } -Verifiable Mock -CommandName Test-CertificatePermission -MockWith { return $true } It 'Should return the the state of present' { $resultGetTargetResource = Get-TargetResource @defaultParameters $resultGetTargetResource.InstanceName | Should -Be $mockNamedInstanceName $resultGetTargetResource.Thumbprint | Should -Be $mockThumbprint $resultGetTargetResource.ServiceAccount | Should -Be $mockServiceAccount $resultGetTargetResource.ForceEncryption | Should -Be $true $resultGetTargetResource.Ensure | Should -Be 'Present' Assert-MockCalled -CommandName Get-EncryptedConnectionSetting -Exactly -Times 1 -Scope It } } Context 'When the system is not in the desired state and Ensure is Absent' { Mock -CommandName Get-EncryptedConnectionSetting -MockWith { return @{ ForceEncryption = $false Certificate = $mockThumbprint } } -Verifiable Mock -CommandName Test-CertificatePermission -MockWith { return $true } It 'Should return the the state of present when ForceEncryption is False but a thumbprint exist.' { $resultGetTargetResource = Get-TargetResource @defaultParameters $resultGetTargetResource.InstanceName | Should -Be $mockNamedInstanceName $resultGetTargetResource.Thumbprint | Should -Be $mockThumbprint $resultGetTargetResource.ServiceAccount | Should -Be $mockServiceAccount $resultGetTargetResource.ForceEncryption | Should -Be $false $resultGetTargetResource.Ensure | Should -Be 'Present' Assert-MockCalled -CommandName Get-EncryptedConnectionSetting -Exactly -Times 1 -Scope It } } Context 'When the system is not in the desired state and Ensure is Absent' { Mock -CommandName Get-EncryptedConnectionSetting -MockWith { return @{ ForceEncryption = $true Certificate = '' } } -Verifiable Mock -CommandName Test-CertificatePermission -MockWith { return $true } It 'Should return the the state of present when Certificate is null but ForceEncryption is True.' { $resultGetTargetResource = Get-TargetResource @defaultParameters $resultGetTargetResource.InstanceName | Should -Be $mockNamedInstanceName $resultGetTargetResource.Thumbprint | Should -BeNullOrEmpty $resultGetTargetResource.ServiceAccount | Should -Be $mockServiceAccount $resultGetTargetResource.ForceEncryption | Should -Be $true $resultGetTargetResource.Ensure | Should -Be 'Present' Assert-MockCalled -CommandName Get-EncryptedConnectionSetting -Exactly -Times 1 -Scope It } } } Describe 'SqlServerSecureConnection\Set-TargetResource' -Tag 'Set' { BeforeAll { $defaultParameters = @{ InstanceName = $mockNamedInstanceName Thumbprint = $mockThumbprint ServiceAccount = $mockServiceAccount ForceEncryption = $true Ensure = 'Present' } $defaultAbsentParameters = @{ InstanceName = $mockNamedInstanceName Thumbprint = $mockThumbprint ServiceAccount = $mockServiceAccount ForceEncryption = $true Ensure = 'Absent' } Mock -CommandName Set-EncryptedConnectionSetting -Verifiable Mock -CommandName Set-CertificatePermission -Verifiable Mock -CommandName Restart-SqlService -Verifiable } Context 'When the system is not in the desired state' { Context 'When only certificate permissions are set' { Mock -CommandName Get-TargetResource -MockWith { return @{ InstanceName = $mockNamedInstanceName Thumbprint = '987654321' ServiceAccount = $mockServiceAccount ForceEncryption = $false Ensure = 'Present' } } Mock -CommandName Test-CertificatePermission -MockWith { return $true } It 'Should configure only ForceEncryption and Certificate thumbprint' { { Set-TargetResource @defaultParameters } | Should -Not -Throw Assert-MockCalled -CommandName Set-EncryptedConnectionSetting -Exactly -Times 1 -Scope It Assert-MockCalled -CommandName Set-CertificatePermission -Exactly -Times 0 -Scope It Assert-MockCalled -CommandName Restart-SqlService -Exactly -Times 1 -Scope It } } Context 'When there is no certificate permissions set' { Mock -CommandName Get-TargetResource -MockWith { return @{ InstanceName = $mockNamedInstanceName Thumbprint = $mockThumbprint ServiceAccount = $mockServiceAccount ForceEncryption = $true Ensure = 'Present' } } Mock -CommandName Test-CertificatePermission -MockWith { return $false } It 'Should configure only certificate permissions' { { Set-TargetResource @defaultParameters } | Should -Not -Throw Assert-MockCalled -CommandName Set-EncryptedConnectionSetting -Exactly -Times 0 -Scope It Assert-MockCalled -CommandName Set-CertificatePermission -Exactly -Times 1 -Scope It Assert-MockCalled -CommandName Restart-SqlService -Exactly -Times 1 -Scope It } } Context 'When no settings are configured' { Mock -CommandName Get-TargetResource -MockWith { return @{ InstanceName = $mockNamedInstanceName Thumbprint = '987654321' ServiceAccount = $mockServiceAccount ForceEncryption = $false Ensure = 'Present' } } Mock -CommandName Test-CertificatePermission -MockWith { return $false } It 'Should configure Encryption settings and certificate permissions' { { Set-TargetResource @defaultParameters } | Should -Not -Throw Assert-MockCalled -CommandName Set-EncryptedConnectionSetting -Exactly -Times 1 -Scope It Assert-MockCalled -CommandName Set-CertificatePermission -Exactly -Times 1 -Scope It Assert-MockCalled -CommandName Restart-SqlService -Exactly -Times 1 -Scope It } } Context 'When ensure is absent' { Mock -CommandName Get-TargetResource -MockWith { return @{ InstanceName = $mockNamedInstanceName Thumbprint = $mockThumbprint ServiceAccount = $mockServiceAccount ForceEncryption = $true Ensure = 'Absent' } } Mock -CommandName Test-CertificatePermission -MockWith { return $false } It 'Should configure Encryption settings setting certificate to empty string' { { Set-TargetResource @defaultAbsentParameters } | Should -Not -Throw Assert-MockCalled -CommandName Set-EncryptedConnectionSetting -Exactly -Times 1 -Scope It Assert-MockCalled -CommandName Set-CertificatePermission -Exactly -Times 0 -Scope It Assert-MockCalled -CommandName Restart-SqlService -Exactly -Times 1 -Scope It } } } } Describe 'SqlServerSecureConnection\Test-TargetResource' -Tag 'Test' { Context 'When the system is not in the desired state' { Context 'When ForceEncryption is not configured properly' { BeforeAll { Mock -CommandName Get-TargetResource -MockWith { return @{ InstanceName = $mockNamedInstanceName Thumbprint = $mockThumbprint ServiceAccount = $mockServiceAccount ForceEncryption = $false Ensure = 'Absent' } } -Verifiable $testParameters = @{ InstanceName = $mockNamedInstanceName Thumbprint = $mockThumbprint ServiceAccount = $mockServiceAccount ForceEncryption = $true Ensure = 'Present' } } It 'Should return state as not in desired state' { $resultTestTargetResource = Test-TargetResource @testParameters $resultTestTargetResource | Should -Be $false } } Context 'When Thumbprint is not configured properly' { BeforeAll { Mock -CommandName Get-TargetResource -MockWith { return @{ InstanceName = $mockNamedInstanceName Thumbprint = '987654321' ServiceAccount = $mockServiceAccount ForceEncryption = $true Ensure = 'Absent' } } -Verifiable $testParameters = @{ InstanceName = $mockNamedInstanceName Thumbprint = $mockThumbprint ServiceAccount = $mockServiceAccount ForceEncryption = $true Ensure = 'Present' } } It 'Should return state as not in desired state' { $resultTestTargetResource = Test-TargetResource @testParameters $resultTestTargetResource | Should -Be $false } } Context 'When certificate permission is not set' { BeforeAll { Mock -CommandName Get-TargetResource -MockWith { return @{ InstanceName = $mockNamedInstanceName Thumbprint = $mockThumbprint ServiceAccount = $mockServiceAccount ForceEncryption = $true Ensure = 'Absent' } } -Verifiable Mock -CommandName Test-CertificatePermission -MockWith { return $false } $testParameters = @{ InstanceName = $mockNamedInstanceName Thumbprint = $mockThumbprint ServiceAccount = $mockServiceAccount ForceEncryption = $true Ensure = 'Present' } } It 'Should return state as not in desired state' { $resultTestTargetResource = Test-TargetResource @testParameters $resultTestTargetResource | Should -Be $false } } Context 'When Ensure is Absent' { BeforeAll { Mock -CommandName Get-TargetResource -MockWith { return @{ InstanceName = $mockNamedInstanceName Thumbprint = $mockThumbprint ServiceAccount = $mockServiceAccount ForceEncryption = $true Ensure = 'Absent' } } -Verifiable $testParameters = @{ InstanceName = $mockNamedInstanceName Thumbprint = $mockThumbprint ServiceAccount = $mockServiceAccount ForceEncryption = $true Ensure = 'Present' } } It 'Should return state as not in desired state' { $resultTestTargetResource = Test-TargetResource @testParameters $resultTestTargetResource | Should -Be $false } } } Context 'When the system is in the desired state' { BeforeAll { Mock -CommandName Get-TargetResource -MockWith { return @{ InstanceName = $mockNamedInstanceName Thumbprint = $mockThumbprint ServiceAccount = $mockServiceAccount ForceEncryption = $true Ensure = 'Present' } } -Verifiable Mock -CommandName Test-CertificatePermission -MockWith { return $true } $testParameters = @{ InstanceName = $mockNamedInstanceName Thumbprint = $mockThumbprint ServiceAccount = $mockServiceAccount ForceEncryption = $true Ensure = 'Present' } } It 'Should return state as in desired state' { $resultTestTargetResource = Test-TargetResource @testParameters $resultTestTargetResource | Should -Be $true } } } Describe 'SqlServerSecureConnection\Get-EncryptedConnectionSetting' -Tag 'Helper' { Mock -CommandName 'Get-ItemProperty' -MockWith { return @{ ForceEncryption = '1' } } -ParameterFilter { $Name -eq 'ForceEncryption' } -Verifiable Mock -CommandName 'Get-ItemProperty' -MockWith { return @{ Certificate = '12345678' } } -ParameterFilter { $Name -eq 'Certificate' } -Verifiable Context 'When calling a method that execute successfully' { BeforeAll { Mock -CommandName 'Get-SqlEncryptionValue' -MockWith { return [MockedGetItem]::new() } -Verifiable } It 'Should return hashtable with ForceEncryption and Certificate' { $result = Get-EncryptedConnectionSetting -InstanceName 'NamedInstance' $result.Certificate | Should -Be '12345678' $result.ForceEncryption | Should -Be 1 $result | Should -BeOfType [Hashtable] Assert-VerifiableMock } } Context 'When calling a method that executes unsuccesfuly' { BeforeAll { Mock -CommandName 'Get-SqlEncryptionValue' -MockWith { return $null } } It 'Should return null' { $result = Get-EncryptedConnectionSetting -InstanceName 'NamedInstance' $result | Should -BeNullOrEmpty Assert-VerifiableMock } } } Describe 'SqlServerSecureConnection\Set-EncryptedConnectionSetting' -Tag 'Helper' { Context 'When calling a method that execute successfully' { BeforeAll { Mock -CommandName 'Get-SqlEncryptionValue' -MockWith { return [MockedGetItem]::new() } Mock -CommandName 'Set-ItemProperty' -Verifiable } It 'Should not throw' { { Set-EncryptedConnectionSetting -InstanceName 'NamedInstance' -Thumbprint '12345678' -ForceEncryption $true } | Should -Not -Throw Assert-VerifiableMock } } Context 'When calling a method that executes unsuccesfuly' { BeforeAll { Mock -CommandName 'Get-SqlEncryptionValue' -MockWith { return $null } -Verifiable Mock -CommandName 'Set-ItemProperty' } It 'Should throw' { { Set-EncryptedConnectionSetting -InstanceName 'NamedInstance' -Thumbprint '12345678' -ForceEncryption $true } | Should -Throw Assert-MockCalled -CommandName 'Set-ItemProperty' -Times 0 Assert-VerifiableMock } } } Describe 'SqlServerSecureConnection\Test-CertificatePermission' -Tag 'Helper' { Context 'When calling a method that execute successfully' { BeforeAll { Mock -CommandName 'Get-CertificateAcl' -MockWith { return [MockedGetItem]::new() } -Verifiable } It 'Should return True' { $result = Test-CertificatePermission -Thumbprint '12345678' -ServiceAccount 'Everyone' $result | Should -be $true Assert-VerifiableMock } } Context 'When calling a method that execute successfully' { BeforeAll { Mock -CommandName 'Get-CertificateAcl' -MockWith { $mockedItem = [MockedGetItem]::new() $mockedItem.ACL = $null return $mockedItem } -Verifiable } It 'Should return False when no permissions were found' { $result = Test-CertificatePermission -Thumbprint '12345678' -ServiceAccount 'Everyone' $result | Should -be $false Assert-VerifiableMock } } Context 'When calling a method that execute successfully' { BeforeAll { Mock -CommandName 'Get-CertificateAcl' -MockWith { $mockedItem = [MockedGetItem]::new() $mockedItem.ACL.FileSystemRights.Value__ = 1 return $mockedItem } -Verifiable } It 'Should return False when the wrong permissions are added' { $result = Test-CertificatePermission -Thumbprint '12345678' -ServiceAccount 'Everyone' $result | Should -be $false Assert-VerifiableMock } } Context 'When calling a method that executes unsuccesfuly' { BeforeAll { Mock -CommandName 'Get-CertificateAcl' -MockWith { return $null } -Verifiable } It 'Should return False' { $result = Test-CertificatePermission -Thumbprint '12345678' -ServiceAccount 'Everyone' $result | Should -be $false Assert-VerifiableMock } } } Describe 'SqlServerSecureConnection\Set-CertificatePermission' -Tag 'Helper' { Context 'When calling a method that execute successfully' { BeforeAll { Mock -CommandName 'Get-CertificateAcl' -MockWith { return [MockedGetItem]::new() } -Verifiable Mock -CommandName 'Set-Acl' -Verifiable } It 'Should not throw' { { Set-CertificatePermission -Thumbprint '12345678' -ServiceAccount 'Everyone' } | Should -Not -Throw Assert-VerifiableMock } } Context 'When calling a method that executes unsuccesfuly' { BeforeAll { Mock -CommandName 'Get-Item' -MockWith { return $null } -Verifiable Mock -CommandName 'Get-ChildItem' -MockWith { return $null } -Verifiable } It 'Should throw' { { Set-CertificatePermission -Thumbprint '12345678' -ServiceAccount 'Everyone' } | Should -Throw Assert-VerifiableMock } } } Describe 'SqlServerSecureConnection\Get-CertificateAcl' -Tag 'Helper' { Context 'When calling a method that execute successfully' { BeforeAll { Mock -CommandName 'Get-ChildItem' -MockWith { return [MockedGetItem]::new() } -Verifiable Mock -CommandName 'Get-Item' -MockWith { return [MockedGetItem]::new() } -Verifiable } It 'Should not throw' { { Get-CertificateAcl -Thumbprint '12345678' } | Should -Not -Throw Assert-VerifiableMock } } } Describe 'SqlServerSecureConnection\Get-SqlEncryptionValue' -Tag 'Helper' { Context 'When calling a method that execute successfully' { BeforeAll { Mock -CommandName 'Get-ItemProperty' -MockWith { return [MockedGetItem]::new() } -Verifiable Mock -CommandName 'Get-Item' -MockWith { return [MockedGetItem]::new() } -Verifiable } It 'Should not throw' { { Get-SqlEncryptionValue -InstanceName $mockNamedInstanceName } | Should -Not -Throw Assert-VerifiableMock } } Context 'When calling a method that execute unsuccessfully' { BeforeAll { Mock -CommandName 'Get-ItemProperty' -MockWith { throw "Error" } -Verifiable Mock -CommandName 'Get-Item' -MockWith { return [MockedGetItem]::new() } -Verifiable } It 'Should throw with expected message' { { Get-SqlEncryptionValue -InstanceName $mockNamedInstanceName } | Should -Throw -ExpectedMessage "SQL instance '$mockNamedInstanceName' not found on SQL Server." Assert-VerifiableMock } } } } } finally { Invoke-TestCleanup }
PowerShell/xSQLServer
Tests/Unit/MSFT_SqlServerSecureConnection.Tests.ps1
PowerShell
mit
34,489
{ test.ok( thrown instanceof axios.Cancel, "Promise must be rejected with a Cancel obejct" ); test.equal(thrown.message, "Operation has been canceled."); test.done(); }
stas-vilchik/bdd-ml
data/914.js
JavaScript
mit
185
using System; namespace EasyNetQ { public class EasyNetQException : Exception { public EasyNetQException() {} public EasyNetQException(string message) : base(message) {} public EasyNetQException(string format, params string[] args) : base(string.Format(format, args)) {} public EasyNetQException(string message, Exception inner) : base(message, inner) {} } public class EasyNetQResponderException : EasyNetQException { public EasyNetQResponderException() { } public EasyNetQResponderException(string message) : base(message) { } public EasyNetQResponderException(string format, params string[] args) : base(format, args) { } public EasyNetQResponderException(string message, Exception inner) : base(message, inner) { } } }
ar7z1/EasyNetQ
Source/EasyNetQ/EasyNetQException.cs
C#
mit
815
# frozen_string_literal: true module ReviewBot class Notification def initialize(pull_request:, suggested_reviewers:) @pull_request = pull_request @suggested_reviewers = suggested_reviewers end attr_reader :pull_request, :suggested_reviewers def message [ %(• ##{pull_request.number} <#{pull_request.html_url}|#{pull_request.title}> needs a *#{needed_review_type}* from), suggested_reviewers.map(&:slack_emoji).join(' ') ].join(' ') end private def needed_review_type pull_request.needs_first_review? ? 'first review' : 'second review' end end end
danielma/reviewbot
lib/review_bot/notification.rb
Ruby
mit
636
function closeObject(id) { document.getElementById(id).style.display = 'none'; } function openObject(id) { document.getElementById(id).style.display = 'block'; } function openClose(id){ if (document.getElementById(id).style.display == 'block'){ console.log('intenta cerrar'); closeObject(id); }else{ console.log('intenta abrir'); openObject(id); } } $(document).ready(function () { $('#datetimepicker1').datetimepicker({ format: 'DD/MM/YYYY HH:mm' }); $(".botonRectificarEvento").on("click", function () { $.ajax({ type: 'POST', data: { id: $(this).attr("data-id") }, url: Routing.generate('eventos_rectificacion_nueva',null,true), context: document.body }) .done(function (datos) { if(datos.estado) { $('#tituloPopUp').html('Rectificar Evento'); $("#contenidoPopUp").html(datos.vista); $('.modal-dialog').removeClass('modal-lg'); $('#piePopUp').addClass('show'); $('#ventanaPopUp').modal('show'); } }); }); $("#botonGuardarPopUp").on("click", function () { var datosFormulario = $("#formularioRectificarEvento").serializeArray(); var urlFormulario = Routing.generate('eventos_rectificacion_crear',null,true); $.ajax( { url : urlFormulario, type: "POST", data : datosFormulario, success: function(datos) { if(datos.estado){ if(datos.rectificado){ $('#ventanaPopUp').modal('hide'); $( location ).attr("href", Routing.generate('eventos',null,true)); } else { $("#contenidoPopUp").html(datos.html); } } }, error: function() { alert('error'); } }); return false; }); // Visualizar detalles $('.botonMostrarDetallesEvento').on('click',function(){ $.ajax({ type: 'GET', url: Routing.generate('eventos_detalle',{ id: $(this).attr('data-id') },true), context: document.body }) .done(function (html) { $('#tituloPopUp').html('Detalle eventos'); $("#contenidoPopUp").html(html); $('.modal-dialog').addClass('modal-lg'); $('#piePopUp').addClass('hide'); $('#piePopUp').removeClass('show'); $('#ventanaPopUp').modal('show'); }); }); //Agregar nuevo detalle $('#ventanaPopUp').on("click",'#botonAgregarDetalle',function(){ var datosFormulario = $("#formularioAgregarDetalle").serializeArray(); var urlFormulario = Routing.generate('eventos_detalle_crear',null,true); $.ajax( { url : urlFormulario, type: "POST", data : datosFormulario, success: function(datos) { $("#contenidoPopUp").html(datos.html); } }); return false; }); $('#ventanaPopUp').on('mouseover','#dp-detalle',function(){ $('#dp-detalle').datetimepicker({ format: 'DD/MM/YYYY HH:mm' }); }); $('#ventanaPopUp').on('mouseover','#dp-rectificar',function(){ $('#dp-rectificar').datetimepicker({ format: 'DD/MM/YYYY HH:mm' }); }); $(".estado-switch").bootstrapSwitch(); $('#botonFormularioRegistro').on('click',function(){ if(! $('#botonFormularioRegistro').hasClass('active')) { $(':input','#formularioBusqueda') .not(':button, :submit, :reset, :hidden') .val('') .removeAttr('checked') .removeAttr('selected'); $('#formularioBusqueda').append('<input type="hidden" name="seccion" value="registro" />'); $('#formularioBusqueda').submit(); } // $('#botonFormularioBusqueda').removeClass('active'); // $(this).addClass('active'); // $('#divFormularioRegistro').removeClass('hide'); // $('#divFormularioRegistro').addClass('show'); // $('#divFormularioBusqueda').removeClass('show'); // $('#divFormularioBusqueda').addClass('hide'); }); $('#botonFormularioBusqueda').on('click',function(){ $('#botonFormularioRegistro').removeClass('active'); $(this).addClass('active'); $('#divFormularioBusqueda').removeClass('hide'); $('#divFormularioBusqueda').addClass('show'); $('#divFormularioRegistro').removeClass('show'); $('#divFormularioRegistro').addClass('hide'); }); $('#dtp-fecha-desde').datetimepicker({ format: 'DD/MM/YYYY HH:mm' }); $('#dtp-fecha-hasta').datetimepicker({ format: 'DD/MM/YYYY HH:mm' }); });
jogianotti/RegistroEventosIntendencia
src/RegistroEventos/CoreBundle/Resources/public/js/eventos.js
JavaScript
mit
5,274
<!DOCTYPE html> <html lang='en' dir='auto'><head> <meta charset='utf-8'> <meta name='viewport' content='width=device-width, initial-scale=1'> <meta name='description' content='The last weekend my colleagues and I had a nice time moving an existing application from a bare-metal infrastructure to AWS. I would like to share some of the focal points involved in such process, in case you’d go through it and would like to know: don’t expect everything to work as usual: you are changing the underlying hardware, moving to a virtualized environment. You can test every single part of the application but infrastructural side effects may occur in a second time relying on the provider: consider well which functionalities should be delegated to the cloud provider (AWS, in this case, offers a lot) or should be managed internally; for example S3 is not a distributed filesystem, and in some cases an RDS instance won’t have the same performance as database installed on an EC2 instance test application compliance, not hardware failure: instead of focusing on stress tests, you should focus first on functionality tests to ensure every part of te application is behaving as expected; hardware failure are easily handled in the cloud, that’s the primary purpose of IaaS.'> <meta name='theme-color' content='#ffcd00'> <meta property='og:title' content='A smooth migration to the cloud » INGE4PRES RATIONAL THOUGHTS'> <meta property='og:description' content='The last weekend my colleagues and I had a nice time moving an existing application from a bare-metal infrastructure to AWS. I would like to share some of the focal points involved in such process, in case you’d go through it and would like to know: don’t expect everything to work as usual: you are changing the underlying hardware, moving to a virtualized environment. You can test every single part of the application but infrastructural side effects may occur in a second time relying on the provider: consider well which functionalities should be delegated to the cloud provider (AWS, in this case, offers a lot) or should be managed internally; for example S3 is not a distributed filesystem, and in some cases an RDS instance won’t have the same performance as database installed on an EC2 instance test application compliance, not hardware failure: instead of focusing on stress tests, you should focus first on functionality tests to ensure every part of te application is behaving as expected; hardware failure are easily handled in the cloud, that’s the primary purpose of IaaS.'> <meta property='og:url' content='http://inge.4pr.es/2014/10/15/2014-10-15-a-smooth-migration-to-the-cloud/'> <meta property='og:site_name' content='INGE4PRES RATIONAL THOUGHTS'> <meta property='og:type' content='article'><meta property='article:publisher' content='358809487873346'><meta property='article:section' content='post'><meta property='article:published_time' content='2014-10-15T18:15:28Z'/><meta property='article:modified_time' content='2014-10-15T18:15:28Z'/><meta property='fb:app_id' content='1845367892442473'><meta property='fb:admins' content='francesco.inge'><meta name='twitter:card' content='summary'><meta name='twitter:site' content='@inge4pres'> <meta name="generator" content="Hugo 0.82.0" /> <title>A smooth migration to the cloud » INGE4PRES RATIONAL THOUGHTS</title> <link rel='canonical' href='http://inge.4pr.es/2014/10/15/2014-10-15-a-smooth-migration-to-the-cloud/'> <link rel='icon' href='/favicon.ico'> <link rel='stylesheet' href='/assets/css/main.ab98e12b.css'><style> :root{--color-accent:#ffcd00;} </style> <script type="application/javascript"> var doNotTrack = false; if (!doNotTrack) { window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date; ga('create', 'UA-55252403-1', 'auto'); ga('send', 'pageview'); } </script> <script async src='https://www.google-analytics.com/analytics.js'></script> </head> <body class='page type-post layout-post has-sidebar'> <div class='site'><div id='sidebar' class='sidebar'> <a class='screen-reader-text' href='#main-menu'>Skip to Main Menu</a> <div class='container'><section class='widget widget-about sep-after'> <header> <div class='logo'> <a href='/'> <img src='/avatar.png'> </a> </div> <h2 class='title site-title '> <a href='/'> Francesco Gualazzi </a> </h2> <div class='desc'> infrastructure-aware developer </div> </header> </section> </div> <div class='sidebar-overlay'></div> </div><div class='main'><nav id='main-menu' class='menu main-menu' aria-label='Main Menu'> <div class='container'> <a class='screen-reader-text' href='#content'>Skip to Content</a> <button id='sidebar-toggler' class='sidebar-toggler' aria-controls='sidebar'> <span class='screen-reader-text'>Toggle Sidebar</span> <span class='open'><svg class='icon' xmlns='http://www.w3.org/2000/svg' viewbox='0 0 24 24' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-hidden='true'> <line x1="3" y1="12" x2="21" y2="12" /> <line x1="3" y1="6" x2="21" y2="6" /> <line x1="3" y1="18" x2="21" y2="18" /> </svg> </span> <span class='close'><svg class='icon' xmlns='http://www.w3.org/2000/svg' viewbox='0 0 24 24' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-hidden='true'> <line x1="18" y1="6" x2="6" y2="18" /> <line x1="6" y1="6" x2="18" y2="18" /> </svg> </span> </button> <ul><li class='item'> <a href='/'>/</a> </li><li class='item'> <a href='/about'>/about</a> </li><li class='item'> <a href='/resume'>/resume</a> </li></ul> </div> </nav><div class='header-widgets'> <div class='container'></div> </div> <header id='header' class='header site-header'> <div class='container sep-after'> <div class='header-info'><p class='site-title title'>INGE4PRES RATIONAL THOUGHTS</p><p class='desc site-desc'>Growing knowledge one post at a time</p> </div> </div> </header> <main id='content'> <article lang='en' class='entry'> <header class='header entry-header'> <div class='container sep-after'> <div class='header-info'> <h1 class='title'>A smooth migration to the cloud</h1> </div> <div class='entry-meta'> <span class='posted-on'><svg class='icon' xmlns='http://www.w3.org/2000/svg' viewbox='0 0 24 24' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-hidden='true'> <rect x="3" y="4" width="18" height="18" rx="2" ry="2"/> <line x1="16" y1="2" x2="16" y2="6"/> <line x1="8" y1="2" x2="8" y2="6"/> <line x1="3" y1="10" x2="21" y2="10"/> </svg> <span class='screen-reader-text'>Posted on </span> <time class='entry-date' datetime='2014-10-15T18:15:28Z'>15 Oct 2014</time> </span> <span class='reading-time'><svg class='icon' xmlns='http://www.w3.org/2000/svg' viewbox='0 0 24 24' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-hidden='true'> <circle cx="12" cy="12" r="10"/> <polyline points="12 6 12 12 15 15"/> </svg> 2 mins read </span> </div> </div> </header> <div class='container entry-content'> <p>The last weekend my colleagues and I had a nice time moving an existing application from a bare-metal infrastructure to AWS. I would like to share some of the focal points involved in such process, in case you’d go through it and would like to know:</p> <ul> <li><strong>don’t expect everything to work as usual</strong>: you are changing the underlying hardware, moving to a virtualized environment. You can test every single part of the application but infrastructural side effects may occur in a second time</li> <li><strong>relying on the provider</strong>: consider well which functionalities should be delegated to the cloud provider (AWS, in this case, offers a lot) or should be managed internally; for example S3 is not a distributed filesystem, and in some cases an RDS instance won’t have the same performance as database installed on an EC2 instance</li> <li><strong>test application compliance, not hardware failure</strong>: instead of focusing on stress tests, you should focus first on functionality tests to ensure every part of te application is behaving as expected; hardware failure are easily handled in the cloud, that’s the primary purpose of IaaS. What is not handled by the cloud is that the application’s features will work on it!</li> <li><strong>use a checklist</strong>: this may seem obvious, but having a clear and well written to-do list with a time table and activities’ details will help you analyze if anything is missing or needs to be done in advance</li> </ul> <p>Aside of this technical considerations, having the support of your coworkers and managers it is what really makes the difference: it keeps you focused in every step and at the same time helps if any problem comes up. That’s why my boss decided to take several videos with his phone and produced a “movie”,  hope you like it 😀</p> </div> <footer class='entry-footer'> <div class='container sep-before'><div class='categories'><svg class='icon' xmlns='http://www.w3.org/2000/svg' viewbox='0 0 24 24' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-hidden='true'> <path d="M22,19a2,2,0,0,1-2,2H4a2,2,0,0,1-2-2V5A2,2,0,0,1,4,3H9l2,3h9a2,2,0,0,1,2,2Z"/> </svg> <span class='screen-reader-text'>Categories: </span><a class='category' href='/categories/tech/'>tech</a></div> </div> </footer> </article> <nav class='entry-nav'> <div class='container'><div class='prev-entry sep-before'> <a href='/2013/11/11/2013-11-11-backup-and-restore-crontabs/'> <span aria-hidden='true'><svg class='icon' xmlns='http://www.w3.org/2000/svg' viewbox='0 0 24 24' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-hidden='true'> <line x1="20" y1="12" x2="4" y2="12"/> <polyline points="10 18 4 12 10 6"/> </svg> Previous</span> <span class='screen-reader-text'>Previous post: </span>Backup and restore crontabs</a> </div><div class='next-entry sep-before'> <a href='/2014/12/11/2014-12-11-happy-birthday-server/'> <span class='screen-reader-text'>Next post: </span>Happy birthday server!<span aria-hidden='true'>Next <svg class='icon' xmlns='http://www.w3.org/2000/svg' viewbox='0 0 24 24' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-hidden='true'> <line x1="4" y1="12" x2="20" y2="12"/> <polyline points="14 6 20 12 14 18"/> </svg> </span> </a> </div></div> </nav> <section id='comments' class='comments'> <div class='container sep-before'> <div class='comments-area'><div id="disqus_thread"></div> <script type="application/javascript"> var disqus_config = function () { }; (function() { if (["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1) { document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.'; return; } var d = document, s = d.createElement('script'); s.async = true; s.src = '//' + "inge4pres" + '.disqus.com/embed.js'; s.setAttribute('data-timestamp', +new Date()); (d.head || d.body).appendChild(s); })(); </script> <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> <a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a> </div> </div> </section> </main> <footer id='footer' class='footer'> <div class='container sep-before'><section class='widget widget-social_menu sep-after'><header> <h4 class='title widget-title'>Stay Tuned</h4> </header><nav aria-label='Social Menu'> <ul><li> <a href='https://github.com/inge4pres' target='_blank' rel='noopener me'> <span class='screen-reader-text'>Open Github account in new tab</span><svg class='icon' xmlns='http://www.w3.org/2000/svg' viewbox='0 0 24 24' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-hidden='true'> <path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"/> </svg> </a> </li><li> <a href='https://gitlab.com/inge4pres' target='_blank' rel='noopener me'> <span class='screen-reader-text'>Open Gitlab account in new tab</span><svg class='icon' xmlns='http://www.w3.org/2000/svg' viewbox='0 0 24 24' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-hidden='true'> <title>GitLab icon</title> <path d="M22.65 14.39L12 22.13 1.35 14.39a.84.84 0 0 1-.3-.94l1.22-3.78 2.44-7.51A.42.42 0 0 1 4.82 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.49h8.1l2.44-7.51A.42.42 0 0 1 18.6 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.51L23 13.45a.84.84 0 0 1-.35.94z"/> </svg> </a> </li><li> <a href='https://twitter.com/inge4pres' target='_blank' rel='noopener me'> <span class='screen-reader-text'>Open Twitter account in new tab</span><svg class='icon' xmlns='http://www.w3.org/2000/svg' viewbox='0 0 24 24' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-hidden='true'> <title>Twitter icon</title> <path d="M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z"></path> </svg> </a> </li><li> <a href='mailto:[email protected]' target='_blank' rel='noopener me'> <span class='screen-reader-text'>Contact via Email</span><svg class='icon' xmlns='http://www.w3.org/2000/svg' viewbox='0 0 24 24' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-hidden='true'> <path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path><polyline points="22,6 12,13 2,6"></polyline> </svg> </a> </li><li> <a href='https://linkedin.com/in/francescogualazzi' target='_blank' rel='noopener me'> <span class='screen-reader-text'>Open Linkedin account in new tab</span><svg class='icon' xmlns='http://www.w3.org/2000/svg' viewbox='0 0 24 24' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-hidden='true'> <path d="M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z"></path><rect x="2" y="9" width="4" height="12"></rect><circle cx="4" cy="4" r="2"></circle> </svg> </a> </li><li> <a href='https://instagram.com/inge4pres' target='_blank' rel='noopener me'> <span class='screen-reader-text'>Open Instagram account in new tab</span><svg class='icon' xmlns='http://www.w3.org/2000/svg' viewbox='0 0 24 24' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' aria-hidden='true'> <rect x="2" y="2" width="20" height="20" rx="5" ry="5"></rect><path d="M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"></path><line x1="17.5" y1="6.5" x2="17.51" y2="6.5"></line> </svg> </a> </li></ul> </nav> </section><div class='copyright'> <p>inge4pres &copy; 2012-2021 Francesco Gualazzi </p> </div> </div> </footer> </div> </div><script>window.__assets_js_src="/assets/js/"</script> <script src='/assets/js/main.c3bcf2df.js'></script> </body> </html>
inge4pres/blog
inge.4pr.es/public/2014/10/15/2014-10-15-a-smooth-migration-to-the-cloud/index.html
HTML
mit
15,816
import {Component, OnInit, ElementRef,} from '@angular/core'; import {FileSelect} from './file.select'; import {NgIf} from '@angular/common'; import {NgForm} from '@angular/common'; import {CostImport, CostImportService} from '../../../services/cost-import-service'; import {FourcastService} from '../../../services/fourcast-service'; import {FileUploader} from './file-uploader'; import {FileItem} from './file-uploader'; const TEMPLATE: string = require('./simple.import.setup.html'); const URL = 'http://127.0.0.1:8081/rest/$upload'; @Component({ selector: 'simple-demo', template: TEMPLATE, directives: [FileSelect], styles: [` .active { background-color: red; } .disabled { color: gray; border: medium solid gray; } `], providers: [FileUploader, CostImportService, FourcastService] }) export class SimpleCostImportSetup implements OnInit { isOn = true; isDisabled = false; importId: string; private _file: File; public isUploaded: boolean = false; constructor( uploader: FileUploader, public importService: CostImportService){} public isFileSelected: boolean = false; typeNames = CostImport.typeNames; model: CostImport = new CostImport(); ngOnInit(){ this.model.division = '' } onFileSelected(event){ console.log('File selected', event); this._file = event['file']; this.isFileSelected = true this.model.importFileName = this._file.name; //console.log('File selected 2: ', this.model.importFileName) } updateCostImport(fileId:string){ console.log('FileId (update): ', fileId) this.importService.updateCostImportHdr(this.model, fileId) .subscribe((res) =>{ var temp = JSON.stringify(res); console.log("Update cost import header result: ",res); this.importId = res['id']; this.isUploaded = true; //console.log('File content: ', text); }); } processCostImport(importId:string){ } onImportFileClicked(){ console.log("Button clicked"); let uploader = new FileUploader(); uploader.uploadFile(this._file); uploader.emitter.subscribe((data) => { console.log("Upload event: ", data); let response = JSON.parse(data['response']); let fileId = response['ID']; console.log('FileId (clicked): ', fileId) this.updateCostImport(fileId); }); //this.uploadFile(this._file); } onImportTypeChange(event){ this.model.isSupplierInvoices = false; this.model.isPayrollWeekly = false; this.model.isPayrollMonthly = false; switch (true){ case event.target[0].selected: this.model.isSupplierInvoices = true; break; case event.target[1].selected: this.model.isPayrollWeekly = true; break; case event.target[2].selected: this.model.isPayrollMonthly = true; break; } } testUpdate(){ let url:string = "http://127.0.0.1:8081/processImport"; let xhr=new XMLHttpRequest(); let formdata=new FormData(); formdata.append('ID',this.importId); xhr.addEventListener("load", function (evt) { let responseStr = evt.currentTarget['response']; let res = JSON.parse(responseStr); let id = res['ID']; console.log("Response: ", res['ID']); nextStep(id); }) xhr.open('POST', url, true); xhr.send(formdata); function nextStep(id: string){ let url:string = "http://127.0.0.1:8081/processData"; let xhr=new XMLHttpRequest(); let formdata=new FormData(); formdata.append('ID',id); xhr.addEventListener("load", function (evt) { console.log(evt); }) xhr.open('POST', url, true); xhr.send(formdata); } } }
chriscurnow/angular2-webpack-starter
src/app/components/costImports/simple.cost.import.setup.ts
TypeScript
mit
3,556
#include <iostream> #include <string> #include<iomanip> using namespace std; int main() { string a; double h,m,x; while(cin>>a) { if(a=="0:00")break; if(a[1]==':') { h=a[0]-'0'; m=(a[2]-'0')*10+(a[3]-'0'); } else if(a[2]==':') { h=(a[0]-'0')*10+(a[1]-'0'); m=(a[3]-'0')*10+(a[4]-'0'); } x=30*h+m/2-6*m; if(x<0) { x=-x; } if(x>180) { x=360-x; } cout<<fixed<<setprecision(3)<<x<<endl; } }
w181496/OJ
Zerojudge/d095.cpp
C++
mit
718
<?php namespace HealthCareAbroad\LogBundle\Repository; use Doctrine\ORM\EntityRepository; /** * ErrorLogRepository * * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ class ErrorLogRepository extends EntityRepository { }
richtermarkbaay/MEDTrip
src/HealthCareAbroad/LogBundle/Repository/ErrorLogRepository.php
PHP
mit
277
# SilkSlider [![Build Status](https://secure.travis-ci.org/wwood/bioruby-SilkSlider.png)](http://travis-ci.org/wwood/bioruby-SilkSlider) A bioinformatic program for predicting whether proteins are 'silk-like' or not. This program was developed by Carmel McDougall and Ben Woodcroft at the [Degnan Laboratory](http://www.biology.uq.edu.au/staff/bernie-degnan) at the University of Queensland. ## Installation After installing Ruby (SilkSlider is tested on Ruby 2.1.2): ```sh gem install SilkSlider ``` Also required is the [SignalP](http://www.cbs.dtu.dk/services/SignalP/) and [TMHMM](http://www.cbs.dtu.dk/services/TMHMM/) programs, which need to be installed separately and available to silk_slider on the `$PATH`. SilkSlider is only tested on linux systems. ## Usage To run the program: ```sh silk_slider my.fasta ``` The program outputs a FASTA file of all silk-like proteins. To see the help: ```sh silk_slider -h ``` ## Project home page Information on the source tree, documentation, examples, issues and how to contribute, see http://github.com/wwood/SilkSlider ## Cite Currently unpublished - a journal article is in preparation. ## Biogems.info This Biogem is published at (http://biogems.info/index.html#SilkSlider) ## Copyright Copyright (c) 2014 Carmel McDougall, Ben Woodcroft, and Bernard Degnan. See LICENSE.txt for further details.
wwood/SilkSlider
README.md
Markdown
mit
1,370
<?php /* * This file is part of the MopaBootstrapBundle. * * (c) Philipp A. Mohrenweiser <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Mopa\Bundle\BootstrapBundle\Menu\Factory; use Knp\Menu\Factory\ExtensionInterface; use Knp\Menu\ItemInterface; /** * Extension for integrating Bootstrap Menus into KnpMenu. */ class MenuExtension implements ExtensionInterface { /** * Builds a menu item based. * * @param ItemInterface $item * @param array $options */ public function buildItem(ItemInterface $item, array $options) { if ($options['navbar']) { $item->setChildrenAttribute('class', 'nav navbar-nav'); } if ($options['pills']) { $item->setChildrenAttribute('class', 'nav nav-pills'); } if ($options['stacked']) { $class = $item->getChildrenAttribute('class'); $item->setChildrenAttribute('class', $class . ' nav-stacked'); } if ($options['dropdown-header']) { $item ->setAttribute('role', 'presentation') ->setAttribute('class', 'dropdown-header') ->setUri(null); } if ($options['list-group']) { $item->setChildrenAttribute('class', 'list-group'); $item->setAttribute('class', 'list-group-item'); } if ($options['list-group-item']) { $item->setAttribute('class', 'list-group-item'); } if ($options['dropdown']) { $item ->setUri('#') ->setAttribute('class', 'dropdown') ->setLinkAttribute('class', 'dropdown-toggle') ->setLinkAttribute('data-toggle', 'dropdown') ->setChildrenAttribute('class', 'dropdown-menu') ->setChildrenAttribute('role', 'menu'); if ($options['caret']) { $item->setExtra('caret', 'true'); } } if ($options['divider']) { $item ->setLabel('') ->setUri(null) ->setAttribute('role', 'presentation') ->setAttribute('class', 'divider'); } if ($options['pull-right']) { $className = $options['navbar'] ? 'navbar-right' : 'pull-right'; $class = $item->getChildrenAttribute('class', ''); $item->setChildrenAttribute('class', $class . ' ' . $className); } if ($options['icon']) { $item->setExtra('icon', $options['icon']); } } /** * Builds the options for extension. * * @param array $options * * @return array $options */ public function buildOptions(array $options) { return array_merge(array( 'navbar' => false, 'pills' => false, 'stacked' => false, 'dropdown-header' => false, 'dropdown' => false, 'list-group' => false, 'list-group-item' => false, 'caret' => false, 'pull-right' => false, 'icon' => false, 'divider' => false, ), $options); } }
naitsirch/mopa-bootstrap-bundle
Menu/Factory/MenuExtension.php
PHP
mit
3,307
<?php require_once "class_db.php"; class qly_pages extends db{ public function LayTieuDeKD($idPa){ $sql="SELECT TieuDeKD FROM mk_pages WHERE idPa = '$idPa'"; $kq = mysql_query($sql,$this->conn); $row_trang = mysql_fetch_assoc($kq); return $row_trang['TieuDeKD']; } public function LayTieuDe($idPa){ $sql="SELECT TieuDe FROM mk_pages WHERE idPa = '$idPa'"; $kq = mysql_query($sql,$this->conn); $row_trang = mysql_fetch_assoc($kq); return $row_trang['TieuDe']; } public function LayID($TieuDeKD){ $sql="SELECT idPa FROM mk_pages WHERE TieuDeKD = '$TieuDeKD' "; $kq = mysql_query($sql,$this->conn); $row_trang = mysql_fetch_assoc($kq); return $row_trang['idPa']; } public function LayIDGroup($idPa){ $sql="SELECT idGroup FROM mk_pages WHERE idPa = '$idPa' "; $kq = mysql_query($sql,$this->conn); $row_trang = mysql_fetch_assoc($kq); return $row_trang['idGroup']; } public function LayParent($idPa){ $sql="SELECT Parent FROM mk_pages WHERE idPa = '$idPa' "; $kq = mysql_query($sql,$this->conn); $row_trang = mysql_fetch_assoc($kq); return $row_trang['Parent']; } public function LayNoiDung($idPa){ $sql="SELECT NoiDung FROM mk_pages WHERE idPa = '$idPa' "; $kq = mysql_query($sql,$this->conn); $row_trang = mysql_fetch_assoc($kq); return $row_trang['NoiDung']; } public function Pages($idPa){ $sql="SELECT * FROM mk_pages WHERE idPa = $idPa"; $kq = mysql_query($sql,$this->conn); return $kq; } public function ListCauHoi(){ $sql="SELECT TomTat, NoiDung FROM mk_pages WHERE AnHien = 1 and idGroup = 2 ORDER BY idPa "; $kq = mysql_query($sql,$this->conn) or die(mysql_error()); return $kq; } public function DanhChoKhachHang($parent){ $sql="SELECT * FROM mk_pages WHERE Parent = $parent and AnHien = 1 Order By ThuTu ASC, idLoai DESC "; $kq = mysql_query($sql,$this->conn); return $sql; } public function ListPagesParent($idGroup, &$totalRows, $pageNum=1, $pageSize = 10, $Parent){ $startRow = ($pageNum-1)*$pageSize; $sql="SELECT TieuDe, TieuDeKD, TomTat, NoiDung, UrlHinh FROM mk_pages WHERE AnHien = 1 and idGroup = $idGroup and Parent = '$Parent' ORDER BY idPa desc LIMIT $startRow , $pageSize "; $kq = mysql_query($sql,$this->conn) or die(mysql_error()); $sql="SELECT count(*) FROM mk_pages WHERE AnHien = 1 and idGroup = $idGroup and Parent = '$Parent' "; $rs= mysql_query($sql) or die(mysql_error());; $row_rs = mysql_fetch_row($rs); $totalRows = $row_rs[0]; return $kq; } public function ListPages($idGroup, &$totalRows, $pageNum=1, $pageSize = 10, $lang = 'vi'){ $startRow = ($pageNum-1)*$pageSize; $sql="SELECT TieuDe, TomTat, TieuDeKD, UrlHinh, NgayDang, NoiDung FROM mk_pages WHERE AnHien = 1 and idGroup = $idGroup and Lang = '$lang' ORDER BY idPa desc LIMIT $startRow , $pageSize "; $kq = mysql_query($sql,$this->conn) or die(mysql_error()); $sql="SELECT count(*) FROM mk_pages WHERE AnHien = 1 and idGroup = $idGroup and Lang = '$lang' "; $rs= mysql_query($sql) or die(mysql_error());; $row_rs = mysql_fetch_row($rs); $totalRows = $row_rs[0]; return $kq; } public function ListTinTuc($sotin, $idGroup){ if($idGroup == -1){ $sql="SELECT TieuDe, TomTat, TieuDeKD, UrlHinh, NgayDang FROM mk_pages WHERE AnHien = 1 and idGroup in (1, 2) ORDER BY idPa desc LIMIT 0 , $sotin "; }else{ $sql="SELECT TieuDe, TomTat, TieuDeKD, UrlHinh, NgayDang FROM mk_pages WHERE AnHien = 1 and idGroup = $idGroup ORDER BY idPa desc LIMIT 0 , $sotin "; } $kq = mysql_query($sql,$this->conn) or die(mysql_error()); return $kq; } public function ListMenu($idGroup){ $sql="SELECT TieuDe, TieuDeKD, idPa FROM mk_pages WHERE AnHien = 1 and idGroup = $idGroup and idPa <> 2 and idPa <> 109 ORDER BY ThuTu ASC"; $kq = mysql_query($sql,$this->conn) or die(mysql_error()); return $kq; } public function LayTitle($idPa){ $sql="SELECT Title FROM mk_pages WHERE idPa = '$idPa' "; $kq = mysql_query($sql,$this->conn); $row_trang = mysql_fetch_assoc($kq); return $row_trang['Title']; } public function LayDes($idPa){ $sql="SELECT Des FROM mk_pages WHERE idPa = '$idPa' "; $kq = mysql_query($sql,$this->conn); $row_trang = mysql_fetch_assoc($kq); return $row_trang['Des']; } public function LayKeyword($idPa){ $sql="SELECT Keyword FROM mk_pages WHERE idPa = '$idPa'"; $kq = mysql_query($sql,$this->conn); $row_trang = mysql_fetch_assoc($kq); return $row_trang['Keyword']; } } ?>
pkapollo/phongkhamapollo.com
san-phu-khoa/m/lib/class_pages.php
PHP
mit
4,795
--- layout: page title: Rain Tech Award Ceremony date: 2016-05-24 author: Harold Yang tags: weekly links, java status: published summary: Quisque sit amet posuere eros. Ut malesuada pharetra. banner: images/banner/leisure-03.jpg booking: startDate: 09/17/2017 endDate: 09/18/2017 ctyhocn: MBGINHX groupCode: RTAC published: true --- Nulla pretium felis ultricies, laoreet tortor ut, porta nisi. Morbi in consectetur dui. Fusce non magna in nibh blandit fermentum sed at mauris. Aenean hendrerit facilisis eros, at molestie ligula luctus vel. Maecenas non condimentum quam. Aliquam dignissim metus sed urna cursus convallis. Cras vitae urna velit. Praesent scelerisque, orci vulputate varius congue, nisi elit commodo mauris, id dapibus nulla velit id nisl. Sed iaculis dui elementum feugiat imperdiet. In tincidunt sem a metus vulputate, et posuere elit porttitor. Donec sed risus id orci blandit pulvinar. Nunc euismod vehicula egestas. Quisque sit amet nulla purus. Nullam ac felis turpis. Nulla iaculis lacinia justo at placerat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed imperdiet id metus sed ornare. Vestibulum ultrices nec enim at pulvinar. Fusce dictum leo in ultricies bibendum. Duis pharetra turpis et placerat placerat. Ut porta pulvinar felis, in vestibulum eros eleifend in. Aliquam et ante elit. In interdum nulla placerat aliquam sodales. 1 Sed placerat nibh eget massa pellentesque ullamcorper ac a odio 1 Etiam quis sapien fermentum, sagittis ligula in, blandit nibh. Nam luctus laoreet hendrerit. Donec consequat pretium quam, et faucibus eros egestas a. Aenean tempus ultricies est sed mattis. Praesent blandit turpis sit amet dolor laoreet, at tincidunt ligula congue. Proin commodo lobortis purus nec laoreet. Donec nec suscipit urna, venenatis congue felis. Maecenas congue, justo sed accumsan viverra, mi neque fringilla nisi, a bibendum libero odio sit amet urna. Etiam vulputate nulla consectetur magna ornare, sit amet gravida quam semper. Phasellus laoreet mauris et sem dignissim vestibulum. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nulla luctus aliquet nibh, vel vehicula ligula consequat vel. Mauris interdum viverra elementum. Donec mattis, nisi a placerat egestas, nunc libero convallis ante, sed ullamcorper orci nulla condimentum turpis. Praesent egestas dolor vitae porta vehicula.
KlishGroup/prose-pogs
pogs/M/MBGINHX/RTAC/index.md
Markdown
mit
2,367
/* eslint-env node*/ var gutil = require('gulp-util') var paths = { layouts: { componentsDir: './app/components/**/*.jade', src: './app/views/**/*.jade', dest: './app/public/assets/html/' }, styles: { componentsDir: './app/lib/stylesheets/**/*.styl', src: './app/lib/stylesheets/styles.styl', dest: './app/public/assets/css/' }, scripts: { entry: './app/lib/scripts/entry.jsx', src: ['./app/lib/scripts/**/*.jsx', './app/lib/scripts/**/*.js'], dest: './app/public/assets/js/' } } var onError = function (error) { gutil.log(gutil.colors.red(error)) this.emit('end') } module.exports = { paths: paths, onError: onError }
datyayu/cemetery
[JS-ES6][React] Raji - first version/gulp/config.js
JavaScript
mit
716
//*************************************************************************** // Copyright (C) 2009 Realmac Software Ltd // // These coded instructions, statements, and computer programs contain // unpublished proprietary information of Realmac Software Ltd // and are protected by copyright law. They may not be disclosed // to third parties or copied or duplicated in any form, in whole or // in part, without the prior written consent of Realmac Software Ltd. // Created by Keith Duncan on 26/03/2009 //*************************************************************************** #import <Cocoa/Cocoa.h> // Model #import "RMUploadKit/AFPropertyListProtocol.h" #import "RMUploadKit/RMUploadPlugin.h" #import "RMUploadKit/RMUploadPreset.h" #import "RMUploadKit/RMUploadCredentials.h" // Controller #import "RMUploadKit/RMUploadPresetConfigurationViewController.h" #import "RMUploadKit/RMUploadMetadataConfigurationViewController.h" // Upload #import "RMUploadKit/RMUploadTask.h" #import "RMUploadKit/RMUploadURLConnection.h" #import "RMUploadKit/NSURLRequest+RMUploadAdditions.h" #import "RMUploadKit/RMUploadMultipartFormDocument.h" // Other #import "RMUploadKit/RMUploadConstants.h" #import "RMUploadKit/RMUploadErrors.h"
soffes/cloudapp.uploader
Frameworks/RMUploadKit.framework/Versions/A/Headers/RMUploadKit.h
C
mit
1,238
/* Copyright (c) 2012 Jess VanDerwalker <[email protected]> * All rights reserved. * * data.h * * 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. */ #ifndef _DATA_H_ #define _DATA_H_ #include <xcb/xcb.h> #include <xcb/damage.h> #define XTOQ_DAMAGE 0 #define XTOQ_EXPOSE 1 #define XTOQ_CREATE 2 #define XTOQ_DESTROY 3 typedef struct xtoq_context_t { xcb_connection_t *conn; xcb_drawable_t window; xcb_window_t parent; xcb_damage_damage_t damage; int x; int y; int width; int height; int damaged_x; int damaged_y; int damaged_width; int damaged_height; char *name; /* The name of the window */ int wm_delete_set; /* Flag for WM_DELETE_WINDOW, 1 if set */ void *local_data; // Area for data client cares about } xtoq_context_t; typedef struct xtoq_event_t { xtoq_context_t *context; int event_type; } xtoq_event_t; typedef struct image_data_t { uint8_t *data; int length; } image_data_t; typedef struct xtoq_image_t { xcb_image_t *image; int x; int y; int width; int height; } xtoq_image_t; typedef void (*xtoq_event_cb_t) (xtoq_event_t const *event); extern int _damage_event; #endif
TeamEuclid/euclid
src/libcompositewm/data.h
C
mit
2,223
# Lecture 1: Mathematical background This lecture aims at introducing the mathematical concepts we will be using throughout the course (linear algebra, calculus, statistics, numerical optimization). Note that this does not serve as a mathematics course in itself. The students interested in a more formal and academic approach can refer to the following links: - [Pr. Strang's course on linear algebra](https://www.youtube.com/playlist?list=PLE7DDD91010BC51F8) - [Pr. Strang's course on calculus](https://www.youtube.com/playlist?list=PLBE9407EA64E2C318) - [Pr. Boyd's course on convex optimization](https://www.youtube.com/playlist?list=PL3940DD956CDF0622) - [Leon Bottou's paper on SGD](https://www.microsoft.com/en-us/research/publication/stochastic-gradient-tricks/) This folder contains the material related to the first lecture. - [`build/slides.pdf`](build/slides.pdf) corresponds the slides The rest is the (latex) source code used to generate the slides.
azubiolo/itstep
it_step/ml_from_scratch/1_background/README.md
Markdown
mit
967
from django.contrib import admin from .models import Question # Register your models here. admin.site.register(Question)
BeardedPlatypus/capita-selecta-ctf
ctf/players/admin.py
Python
mit
126
<!doctype html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="es"> <!--<![endif]--> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="distribution" content="global"/> <title>Wallery — Murales gratuitos, contenidos valiosos</title> <meta name="description" content=""/> <meta name="keywords" content=""/> <meta name="author" content=""/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <link type="text/plain" rel="author" href="humans.txt" /> <!-- Open Graphs Tag's --> <meta property="og:title" content=""/> <meta property="og:site_name" content=""/> <meta property="og:image" content="" /> <meta property="og:image:secure_url" content="" /> <meta property="og:image:type" content="image/jpeg" /> <meta property="og:image:width" content="400" /> <meta property="og:image:height" content="300" /> <meta property="og:description" content=""/> <meta property="og:url" content=""/> <!--[if lte IE 8]><script src="css/ie/html5shiv.js"></script><![endif]--> <link rel="apple-touch-icon" href="apple-touch-icon.png"> <link rel="icon" type="image/x-icon" href="favicon.ico" /> <!-- Stylesheets --> <link rel="stylesheet" href="css/normalize.css"/> <link rel="stylesheet" href="css/bootstrap.css"/> <link href="https://fonts.googleapis.com/css?family=Titillium+Web:300,400,700&amp;subset=latin-ext" rel="stylesheet"> <link rel="stylesheet" href="css/croppic.css"> <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.1/css/bootstrap-select.min.css"> <link rel="stylesheet" type="text/less" href="css/main.less"/> <script src="js/vendor/less.min.js"></script> <!--[if lte IE 8]><link rel="stylesheet" href="css/ie/v8.css" /><![endif]--> <!--[if lte IE 9]><link rel="stylesheet" href="css/ie/v9.css" /><![endif]--> <!--[if lt IE 10]><script src="js/old/respond.min.js"></script><![endif]--> <script src="js/vendor/modernizr-2.8.3.min.js"></script> </head> <body> <!--[if lt IE 9]> <p class="browsehappy">La version de su navegador es demasiado antigua. <a href="http://browsehappy.com/">Actualicelo</a> y disfrute el sitio al maximo.</p> <![endif]--> <div class="container-fluid alpha"> <div class="container"> Alpha v0.1 - 18/04/2017 - <a href="https://github.com/agustinl/Wallery"><strong>GITHUB</strong></a> </div> </div> <header class="container-fluid"> <div class="container"> <div class="col-lg-2"> <img src="images/logo.png" alt="Wallery"> </div> <div class="col-lg-8 text-center"> <h1>Murales gratuitos, <strong>contenidos valiosos</strong></h1> </div> <div class="col-lg-2"> <a class="btn btn-default" href="#" role="button">Busqueda avanzada</a> </div> </div> </header> <section class="container"> <div id="uploadform" class="col-lg-8 col-lg-offset-2 row"> <div class="row"> <div class="col-lg-5 row"> <div id="cropContaineroutputUpload"></div> <input type="text" name="tmp_img" id="cropOutput"/> </div> <div class="col-lg-7 white-form"> <div class="align-middle"> <div class="form-group row"> <div class="col-lg-6"> <input type="text" class="form-control" name="" placeholder="DNI / LC / LE" data-toggle="tooltip" data-placement="bottom" title="Solo para comprobar que no se haya cargado una solicitud previa."> <span class="glyphicon glyphicon-question-sign form-control-feedback" aria-hidden="true"></span> </div> <div class="col-lg-6"> <select class="selectpicker" data-width="100%" title="Tipo de sangre"> <option>O negativo</option> <option>O positivo</option> <option data-divider="true"></option> <option>A negativo</option> <option>A positivo</option> <option data-divider="true"></option> <option>B negativo</option> <option>B positivo</option> <option data-divider="true"></option> <option>AB negativo</option> <option>AB positivo</option> </select> </div> </div> <div class="form-group row"> <div class="col-lg-8"> <input type="text" class="form-control" name="" placeholder="Nombre y apellido"> </div> <div class="col-lg-4"> <input type="text" class="form-control" name="" placeholder="Cantidad" data-toggle="tooltip" data-placement="bottom" title="Dejar en blanco si no hay un numero determinado."> <span class="glyphicon glyphicon-user form-control-feedback" aria-hidden="true"></span> </div> </div> <div class="form-group"> <p class="text-muted-info">¿Donde donar?</p> <hr> <input id="searchTextField" type="text" class="form-control input-mg" name="" placeholder="Centro medico"> <input id="searchTextFieldTwo" type="text" class="form-control input-mg" name="" placeholder="Direccion"> <input type="text" class="form-control input-mg" name="" placeholder="Dias y horarios"> </div> <div class="form-group"> <textarea class="form-control" placeholder="Informacion adicional..."></textarea> </div> <div class="form-group row"> <div class="col-lg-6"> <input type="text" class="form-control" name="" placeholder="Telefono #1"> </div> <div class="col-lg-6"> <input type="text" class="form-control" name="" placeholder="Referencia #1"> </div> </div> <div class="form-group row"> <div class="col-lg-6"> <input type="text" class="form-control" name="" placeholder="Telefono #2"> </div> <div class="col-lg-6"> <input type="text" class="form-control" name="" placeholder="Referencia #2"> </div> </div> </div> </div> </div> </div> <div class="col-lg-2 uploadform-buttons"> <div> <button class="btn btn-primary" type="submit">Listo</button> <button class="btn btn-link">Cancelar</button> </div> </div> </section> <footer class="container-fluid"> <div class="container"> <h6>2017 — Buenos Aires, Argentina — <a href="#">[email protected]</a></h6> </div> </footer> <script src="js/vendor/jquery-1.12.0.min.js"></script> <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.12.0.min.js"><\/script>')</script> <script src="js/vendor/bootstrap.min.js"></script> <script src="js/croppic.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.1/js/bootstrap-select.min.js"></script> <script src="https://maps.googleapis.com/maps/api/js?libraries=places&key=AIzaSyALeJWJhFIFahkYfCEsPBL5dNMbGfABXRA "></script> <script src="js/scripts.js"></script> <script> window.ga=function(){ga.q.push(arguments)};ga.q=[];ga.l=+new Date; ga('create','UA-XXXXX-Y','auto');ga('send','pageview') </script> <script src="https://www.google-analytics.com/analytics.js" async defer></script> <!--[if lt IE 10]><script src="js/old/rem.min.js"></script><![endif]--> </body> </html>
agustinl/wallery
index.html
HTML
mit
7,363
/** * * app.js * * This is the entry file for the application * */ import FilmLocationSearchComponent from '../MovieSearchApp/Containers/FilmSearchContainer/FilmSearchComponent'; import AppComponent from '../CommonComponent/app.js'; import React from 'react'; import { Router, Route, IndexRoute, browserHistory } from 'react-router'; console.log("current href",window.location.href); const getAppRouter = () => { return ( <Route component={AppComponent}> <Route component={FilmLocationSearchComponent} path='/searchmovies' /> </Route> ); } export { getAppRouter }
anil26/MovieSearchGoogleMaps
js/Routes/AppRouter.js
JavaScript
mit
597
/* Accordion directive */ app.directive('vmfAccordionContainer', ['$compile', function($compile) { return { restrict: 'EA', scope: { type: '@', headers: '=', accData: '=', selAcc: '=', customClass:'=' }, link: function(scope, elem, attrs) { var template; if(scope.type === '1') { template = '<table class="vmf-accordion-table1"><thead class="vmf-accordion-table-header"><tr><td class="col1"></td>'; var count = 1; angular.forEach(scope.headers, function(item) { // if(count === 1) { // template += '<td colspan="2">' + item + '</td>'; // } // else { template += '<td class="col' + (count + 1) +'">' + item + '</td>'; // } count += 1; }); template += '</tr></thead><tbody class="vmf-accordion-table-body">'; scope.accordionIndex = 0; angular.forEach(scope.accData, function(item) { template += '<tr class="vmf-accordion-header" ng-click="toggleAccordion(' + scope.accordionIndex + ')"><td ><span class="vmf-arrow"></span></td><td colspan="3">' + item.header + '</td></tr>'; angular.forEach(item.contents, function(content) { template += '<tr class="vmf-accordion-row" ng-show="activeIndex =='+ scope.accordionIndex + '"><td colspan="1"></td>'; angular.forEach(content, function(cellData) { template += '<td colspan="1">' + cellData + '</td>'; }); template += '</tr>'; }); scope.accordionIndex += 1; }); template += '</tbody></table>'; elem.append(template); // console.log(template); $compile(elem.contents())(scope); // for IE7 elem.find('.vmf-accordion-row').hide(); } else if(scope.type === '2') { template = '<table class="vmf-accordion-table2"><thead class="vmf-accordion-table2-header" style="background-color: lightgray;"><tr><td class="col1"></td>'; var headerCount = 0; angular.forEach(scope.headers, function(item) { if(headerCount !== scope.headers.length - 1) { template += '<td class="col' + (headerCount + 1 + 1)+ '">' + item + '</td>'; } else { template += '<td colspan="2" class="col' + (headerCount + 1 + 1)+ '">' + item + '</td>'; } headerCount += 1; }); template += '</tr></thead><tbody class="vmf-accordion-table2-body">'; scope.accordionIndex = 0; angular.forEach(scope.accData, function(item) { template += '<tr class="vmf-accordion-header2" ng-click="toggleAccordion(' + scope.accordionIndex + ')"><td><span class="vmf-arrow"></span></td>'; var accHeadersCount = 1; angular.forEach(item.headers, function(header) { if(accHeadersCount !== item.headers.length) { template += '<td>' + header + '</td>'; } else { template += '<td class="vmf-acc-header-last-child">' + header + '</td>'; } accHeadersCount += 1; }); template += '</tr><tr class="vmf-accordion-row2"><td></td><td class="vmf-acc-header-last-child" colspan="' + item.headers.length + '"><table class="vmf-accordion-sub-table" ng-show="activeIndex =='+ scope.accordionIndex + '">'; var count = 0; angular.forEach(item.contents, function(content) { if(count !== 0) { template += '<tr class="vmf-accordion-sub-table-row">'; angular.forEach(content, function(cellData) { template += '<td>' + cellData + '</td>'; }); template += '</tr>'; } else { template += '<thead class="vmf-accordion-sub-table-header"><tr>'; var subHeaderCount = 1; angular.forEach(content, function(cellData) { template += '<td class="col' + subHeaderCount + '">' + cellData + '</td>'; subHeaderCount += 1; }); template += '</tr></thead><tbody class="vmf-accordion-sub-table-body">'; } count += 1; }); template += '</tbody></table></td></tr>'; scope.accordionIndex += 1; }); template += '</tbody></table>'; elem.append(template); // console.log(template); if(scope.customClass){ angular.forEach(scope.customClass, function(item) { elem.find(item.selector).addClass(item.cusclass); }); } $compile(elem.contents())(scope); // for IE7 elem.find('.vmf-accordion-row2').hide(); // elem.find('.vmf-accordion-row2').hide(); } scope.toggleAccordion = function(index) { scope.activeIndex = scope.activeIndex === index ? -1 : index; var accordions, accordionRows; if(scope.type === '1') { elem.find('.vmf-accordion-row').hide(); accordions = elem.find('.vmf-accordion-header'); accordions.removeClass('vmf-active-row'); // for IE7 if(scope.activeIndex !== -1) { // accordions = elem.find('.vmf-accordion-header'); // console.log(accordions[index]); $(accordions[index]).addClass('vmf-active-row'); accordionRows = $(accordions[index]).nextUntil('.vmf-accordion-header'); $(accordionRows).show(); } } else if(scope.type === '2') { elem.find('.vmf-accordion-row2').hide(); accordions = elem.find('.vmf-accordion-header2'); accordions.removeClass('vmf-active-row'); // for IE7 if(scope.activeIndex !== -1) { $(accordions[index]).addClass('vmf-active-row'); accordionRows = $(accordions[index]).nextUntil('.vmf-accordion-header2'); $(accordionRows).show(); } } }; scope.buttonClick = function($event, index) { $event.stopPropagation(); scope.selAcc = index; }; } }; }]);
anandharshan/Web-components-DD
dev/modules/Accordion/accordionDirectives.js
JavaScript
mit
8,055
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package de.comci.bigbib; import com.mongodb.BasicDBObject; import com.mongodb.DBObject; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import org.bson.types.ObjectId; import org.codehaus.jackson.annotate.JsonProperty; import org.jbibtex.BibTeXEntry; import org.jbibtex.Key; import org.jbibtex.StringValue; import org.jbibtex.Value; /** * * @author Sebastian */ @XmlRootElement() @XmlAccessorType(XmlAccessType.NONE) public class PeristentBibTexEntry extends BibTeXEntry { private ObjectId id; public PeristentBibTexEntry(Key type, Key key) { super(type, key); } static Map<String, Key> keyMapping = new HashMap<String, Key>(); static { keyMapping.put("address", BibTeXEntry.KEY_ADDRESS); keyMapping.put("annote", BibTeXEntry.KEY_ANNOTE); keyMapping.put("author", BibTeXEntry.KEY_AUTHOR); keyMapping.put("booktitle", BibTeXEntry.KEY_BOOKTITLE); keyMapping.put("chapter", BibTeXEntry.KEY_CHAPTER); keyMapping.put("crossref", BibTeXEntry.KEY_CROSSREF); keyMapping.put("doi", BibTeXEntry.KEY_DOI); keyMapping.put("edition", BibTeXEntry.KEY_EDITION); keyMapping.put("editor", BibTeXEntry.KEY_EDITOR); keyMapping.put("eprint", BibTeXEntry.KEY_EPRINT); keyMapping.put("howpublished", BibTeXEntry.KEY_HOWPUBLISHED); keyMapping.put("institution", BibTeXEntry.KEY_INSTITUTION); keyMapping.put("journal", BibTeXEntry.KEY_JOURNAL); keyMapping.put("key", BibTeXEntry.KEY_KEY); keyMapping.put("month", BibTeXEntry.KEY_MONTH); keyMapping.put("note", BibTeXEntry.KEY_NOTE); keyMapping.put("number", BibTeXEntry.KEY_NUMBER); keyMapping.put("organization", BibTeXEntry.KEY_ORGANIZATION); keyMapping.put("pages", BibTeXEntry.KEY_PAGES); keyMapping.put("publisher", BibTeXEntry.KEY_PUBLISHER); keyMapping.put("school", BibTeXEntry.KEY_SCHOOL); keyMapping.put("series", BibTeXEntry.KEY_SERIES); keyMapping.put("title", BibTeXEntry.KEY_TITLE); keyMapping.put("type", BibTeXEntry.KEY_TYPE); keyMapping.put("url", BibTeXEntry.KEY_URL); keyMapping.put("volume", BibTeXEntry.KEY_VOLUME); keyMapping.put("year", BibTeXEntry.KEY_YEAR); } public PeristentBibTexEntry(DBObject persistentObject) { super( new Key((String) persistentObject.get("type")), new Key((String) persistentObject.get("key")) ); BasicDBObject fields = (BasicDBObject) persistentObject.get("fields"); id = (ObjectId) persistentObject.get("_id"); for (String key : fields.keySet()) { if (keyMapping.containsKey(key)) { this.addField(keyMapping.get(key), new StringValue(fields.getString(key), StringValue.Style.BRACED)); } else { this.addField(new Key(key), new StringValue(fields.getString(key), StringValue.Style.BRACED)); } } } @JsonProperty("id") @XmlElement(name="id") public String getStringId() { return id.toString(); } @JsonProperty("key") @XmlElement(name="key") public String getStringKey() { return super.getKey().getValue(); } @JsonProperty("type") @XmlElement(name="type") public String getStringType() { return super.getType().getValue(); } @JsonProperty("fields") @XmlElement(name="fields") public Map<String, String> getStringFields() { Map<String, String> fields = new HashMap<String, String>(); for (Entry<Key,Value> e : getFields().entrySet()) { if (e.getKey() != null && e.getValue() != null) { fields.put(e.getKey().getValue(), e.getValue().toUserString()); } } return fields; } @Override public String toString() { return String.format("[%s:%s] %s: %s (%s)", this.getType(), this.getKey(), this.getField(KEY_AUTHOR).toUserString(), this.getField(KEY_TITLE).toUserString(), this.getField(KEY_YEAR).toUserString()); } }
maiers/bigbib
src/main/java/de/comci/bigbib/PeristentBibTexEntry.java
Java
mit
4,524
module Admin::BaseHelper include ActionView::Helpers::DateHelper def subtabs_for(current_module) output = [] AccessControl.project_module(current_user.profile.label, current_module).submenus.each_with_index do |m,i| current = (m.url[:controller] == params[:controller] && m.url[:action] == params[:action]) ? "current" : "" output << subtab(_(m.name), current, m.url) end content_for(:tasks) { output.join("\n") } end def subtab(label, style, options = {}) content_tag :li, link_to(label, options, { "class"=> style }) end def show_page_heading content_tag(:h2, @page_heading, :class => 'mb20') unless @page_heading.blank? end def cancel(url = {:action => 'index'}) link_to _("Cancel"), url end def save(val = _("Store")) '<input type="submit" value="' + val + '" class="save" />' end def confirm_delete(val = _("Delete")) '<input type="submit" value="' + val + '" />' end def link_to_show(record, controller = @controller.controller_name) if record.published? link_to image_tag('admin/show.png', :alt => _("show"), :title => _("Show content")), {:controller => controller, :action => 'show', :id => record.id}, {:class => "lbOn"} end end def link_to_edit(label, record, controller = @controller.controller_name) link_to label, :controller => controller, :action => 'edit', :id => record.id end def link_to_edit_with_profiles(label, record, controller = @controller.controller_name) if current_user.admin? || current_user.id == record.user_id link_to label, :controller => controller, :action => 'edit', :id => record.id end end def link_to_destroy(record, controller = @controller.controller_name) link_to image_tag('admin/delete.png', :alt => _("delete"), :title => _("Delete content")), :controller => controller, :action => 'destroy', :id => record.id end def link_to_destroy_with_profiles(record, controller = @controller.controller_name) if current_user.admin? || current_user.id == record.user_id link_to(_("delete"), { :controller => controller, :action => 'destroy', :id => record.id }, :confirm => _("Are you sure?"), :method => :post, :title => _("Delete content")) end end def text_filter_options TextFilter.find(:all).collect do |filter| [ filter.description, filter ] end end def text_filter_options_with_id TextFilter.find(:all).collect do |filter| [ filter.description, filter.id ] end end def alternate_class @class = @class != '' ? '' : 'class="shade"' end def reset_alternation @class = nil end def task_quickpost(title) link_to_function(title, toggle_effect('quick-post', 'Effect.BlindUp', "duration:0.4", "Effect.BlindDown", "duration:0.4")) end def task_overview content_tag :li, link_to(_('Back to overview'), :action => 'index') end def task_add_resource_metadata(title,id) link_to_function(title, toggle_effect('add-resource-metadata-' + id.to_s, 'Effect.BlindUp', "duration:0.4", "Effect.BlindDown", "duration:0.4")) end def task_edit_resource_metadata(title,id) link_to_function(title, toggle_effect('edit-resource-metadata-' + id.to_s, 'Effect.BlindUp', "duration:0.4", "Effect.BlindDown", "duration:0.4")) end def task_edit_resource_mime(title,id) link_to_function(title, toggle_effect('edit-resource-mime-' + id.to_s, 'Effect.BlindUp', "duration:0.4", "Effect.BlindDown", "duration:0.4")) end def class_write if controller.controller_name == "content" or controller.controller_name == "pages" "current" if controller.action_name == "new" end end def class_content if controller.controller_name =~ /content|pages|categories|resources|feedback/ "current" if controller.action_name =~ /list|index|show/ end end def class_themes "current" if controller.controller_name =~ /themes|sidebar/ end def class_users controller.controller_name =~ /users/ ? "current right" : "right" end def class_dashboard controller.controller_name =~ /dashboard/ ? "current right" : "right" end def class_settings controller.controller_name =~ /settings|textfilter/ ? "current right" : "right" end def class_profile controller.controller_name =~ /profiles/ ? "current right" : "right" end def alternate_editor return 'visual' if current_user.editor == 'simple' return 'simple' end def collection_select_with_current(object, method, collection, value_method, text_method, current_value, prompt=false) result = "<select name='#{object}[#{method}]'>\n" if prompt == true result << "<option value=''>" << _("Please select") << "</option>" end for element in collection if current_value and current_value == element.send(value_method) result << "<option value='#{element.send(value_method)}' selected='selected'>#{element.send(text_method)}</option>\n" else result << "<option value='#{element.send(value_method)}'>#{element.send(text_method)}</option>\n" end end result << "</select>\n" return result end def render_void_table(size, cols) if size == 0 "<tr>\n<td colspan=#{cols}>" + _("There are no %s yet. Why don't you start and create one?", _(controller.controller_name)) + "</td>\n</tr>\n" end end def cancel_or_save result = '<p class="right">' result << cancel result << " " result << _("or") result << " " result << save( _("Save") + " &raquo") result << '</p>' return result end def link_to_published(item) item.published? ? link_to_permalink(item, _("published"), '', 'published') : "<span class='unpublished'>#{_("unpublished")}</span>" end def macro_help_popup(macro, text) unless current_user.editor == 'visual' "<a rel='lightbox' href=\"#{url_for :controller => 'textfilters', :action => 'macro_help', :id => macro.short_name}\" onclick=\"return popup(this, 'Typo Macro Help')\">#{text}</a>" end end def render_macros(macros) result = link_to_function _("Show help on Typo macros") + " (+/-)",update_page { |page| page.visual_effect(:toggle_blind, "macros", :duration => 0.2) } result << "<table id='macros' style='display: none;'>" result << "<tr>" result << "<th>#{_('Name')}</th>" result << "<th>#{_('Description')}</th>" result << "<th>#{_('Tag')}</th>" result << "</tr>" for macro in macros.sort_by { |f| f.short_name } result << "<tr #{alternate_class}>" result << "<td>#{macro_help_popup macro, macro.display_name}</td>" result << "<td>#{h macro.description}</td>" result << "<td><code>&lt;typo:#{h macro.short_name}&gt;</code></td>" result << "</tr>" end result << "</table>" end def build_editor_link(label, action, id, update, editor) link = link_to_remote(label, :url => { :action => action, 'editor' => editor}, :loading => "new Element.show('update_spinner_#{id}')", :success => "new Element.toggle('update_spinner_#{id}')", :update => "#{update}") link << image_tag("spinner-blue.gif", :id => "update_spinner_#{id}", :style => 'display:none;') end def display_pagination(collection, cols) if WillPaginate::ViewHelpers.total_pages_for_collection(collection) > 1 return "<tr><td colspan=#{cols} class='paginate'>#{will_paginate(collection)}</td></tr>" end end def show_thumbnail_for_editor(image) thumb = "#{RAILS_ROOT}/public/files/thumb_#{image.filename}" picture = "#{this_blog.base_url}/files/#{image.filename}" image.create_thumbnail unless File.exists? thumb # If something went wrong with thumbnail generation, we just display a place holder thumbnail = (File.exists? thumb) ? "#{this_blog.base_url}/files/thumb_#{image.filename}" : "#{this_blog.base_url}/images/thumb_blank.jpg" picture = "<img class='tumb' src='#{thumbnail}' " picture << "alt='#{this_blog.base_url}/files/#{image.filename}' " picture << " onclick=\"edInsertImageFromCarousel('article_body_and_extended', '#{this_blog.base_url}/files/#{image.filename}');\" />" return picture end end
jasondew/cola.rb
app/helpers/admin/base_helper.rb
Ruby
mit
8,319
<?php namespace Editionista\WebsiteBundle\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; use Symfony\Bundle\FrameworkBundle\Controller\Controller as Controller; use Editionista\WebsiteBundle\Entity\Tag; /** * Edition controller. * * @Route("/tags") */ class TagController extends Controller { /** * @Route("/", name="tags") * @Template() */ public function indexAction() { $em = $this->getDoctrine()->getManager(); $tags = $em->getRepository('EditionistaWebsiteBundle:Tag')->findAll(); return array('tags' => $tags); } /** * @Route("/{tag}", name="show_tag") * @Template() */ public function showAction($tag) { $em = $this->getDoctrine()->getManager(); $tag = $em->getRepository('EditionistaWebsiteBundle:Tag')->findOneByName($tag); $editions = $tag->getEditions(); return array('tag' => $tag, 'editions' => $editions); } /** * @Route("/push", name="push_tags") * @Method({"POST"}) */ public function pushAction(Request $request) { $pushedTag = $request->request->get('tag'); $em = $this->getDoctrine()->getManager(); $storedTag = $em->getRepository('EditionistaWebsiteBundle:Tag')->findOneByName($pushedTag); if($storedTag == null) { $tag = new Tag(); $tag->setName($pushedTag); $em = $this->getDoctrine()->getManager(); $em->persist($tag); $em->flush(); } $response = new Response(json_encode(array('tag' => $pushedTag))); $response->headers->set('Content-Type', 'application/json'); return $response; } /** * @Route("/pull", name="pull_tags") */ public function pullAction(Request $request) { $em = $this->getDoctrine()->getManager(); $entities = $em->getRepository('EditionistaWebsiteBundle:Tag')->findAll(); $tags = array(); foreach($entities as $entity) { $tags['tags'][] = array('tag' => $entity->getName()); } $response = new Response(json_encode($tags)); $response->headers->set('Content-Type', 'application/json'); return $response; } }
fabstei/editionista
src/Editionista/WebsiteBundle/Controller/TagController.php
PHP
mit
2,557
package io.questions.model.questionnaire import io.questions.model.questionnaire.Element.{ Parent, Primitive } trait ElementValues { implicit class ElementValuesSyntax(e: Element) { def parent: Element.Parent = e match { case p: Parent => p case x => throw new IllegalArgumentException(s"Expected a Parent. Got $x") } def primitive: Element.Primitive = e match { case p: Primitive => p case x => throw new IllegalArgumentException(s"Expected a Primitive. Got $x") } } }
channingwalton/qanda
questionnaire/src/test/scala/io/questions/model/questionnaire/ElementValues.scala
Scala
mit
536
using System; using System.Reflection; namespace Light.DataCore { abstract class DynamicFieldMapping : FieldMapping { public static DynamicFieldMapping CreateDynmaicFieldMapping (PropertyInfo property, DynamicCustomMapping mapping) { DynamicFieldMapping fieldMapping; Type type = property.PropertyType; TypeInfo typeInfo = type.GetTypeInfo(); string fieldName = property.Name; if (typeInfo.IsGenericType) { Type frameType = type.GetGenericTypeDefinition (); if (frameType.FullName == "System.Nullable`1") { Type [] arguments = type.GetGenericArguments (); type = arguments [0]; typeInfo = type.GetTypeInfo(); } } if (type.IsArray) { throw new LightDataException(string.Format(SR.DataMappingUnsupportFieldType, property.DeclaringType, property.Name, type)); } else if (type.IsGenericParameter || typeInfo.IsGenericTypeDefinition) { throw new LightDataException(string.Format(SR.DataMappingUnsupportFieldType, property.DeclaringType, property.Name, type)); } else if (typeInfo.IsEnum) { DynamicEnumFieldMapping enumFieldMapping = new DynamicEnumFieldMapping (type, fieldName, mapping); fieldMapping = enumFieldMapping; } else { TypeCode code = Type.GetTypeCode (type); switch (code) { case TypeCode.Empty: case TypeCode.Object: throw new LightDataException(string.Format(SR.DataMappingUnsupportFieldType, property.DeclaringType, property.Name, type)); default: DynamicPrimitiveFieldMapping primitiveFieldMapping = new DynamicPrimitiveFieldMapping (type, fieldName, mapping); fieldMapping = primitiveFieldMapping; break; } } return fieldMapping; } protected DynamicFieldMapping (Type type, string fieldName, DynamicCustomMapping mapping, bool isNullable) : base (type, fieldName, fieldName, mapping, isNullable, null) { } } }
aquilahkj/Light.DataCore
Light.DataCore/Mappings/DynamicFieldMapping.cs
C#
mit
1,881
class Solution { public: int findRadius(vector<int>& houses, vector<int>& heaters) { sort(houses.begin(), houses.end()); sort(heaters.begin(), heaters.end()); auto radius = 0; auto idx = 0; for (auto house : houses) { auto current = abs(house - heaters[idx]); if (current <= radius) continue; for (auto n = idx + 1; n < heaters.size(); ++n) { if (abs(house - heaters[n]) <= current) { current = abs(house - heaters[n]); idx = n; } else { break; } } radius = max(radius, current); } return radius; } };
wait4pumpkin/leetcode
475.cc
C++
mit
561
<div *ngIf="user"> <div class="page-header"> <h2>{{user.name}}</h2> </div> <ul class="list-group"> <li class="list-group-item">Username: {{user.username}}</li> <li class="list-group-item">Email: {{user.email}}</li> </ul> </div>
roeibh/meanauthapp
angular-src/src/app/components/profile/profile.component.html
HTML
mit
248
from django.conf.urls import patterns, include, url import views urlpatterns = patterns('', url(r'^logout', views.logout, name='logout'), url(r'^newUser', views.newUser, name='newUser'), url(r'^appHandler', views.appHandler, name='appHandler'), url(r'^passToLogin', views.loginByPassword, name='passToLogin'), url(r'^signToLogin', views.loginBySignature, name='signToLogin'), url(r'^authUserHandler', views.authUserHandler, name='authUserHandler'), )
odeke-em/restAssured
auth/urls.py
Python
mit
477
/* * This file was autogenerated by the GPUdb schema processor. * * DO NOT EDIT DIRECTLY. */ package com.gpudb.protocol; import java.util.LinkedHashMap; import java.util.Map; import org.apache.avro.Schema; import org.apache.avro.SchemaBuilder; import org.apache.avro.generic.GenericData; import org.apache.avro.generic.IndexedRecord; /** * A set of parameters for {@link * com.gpudb.GPUdb#filterByValue(FilterByValueRequest)}. * <p> * Calculates which objects from a table has a particular value for a * particular column. The input parameters provide a way to specify either a * String * or a Double valued column and a desired value for the column on which the * filter * is performed. The operation is synchronous, meaning that a response will not * be * returned until all the objects are fully available. The response payload * provides the count of the resulting set. A new result view which satisfies * the * input filter restriction specification is also created with a view name * passed * in as part of the input payload. Although this functionality can also be * accomplished with the standard filter function, it is more efficient. */ public class FilterByValueRequest implements IndexedRecord { private static final Schema schema$ = SchemaBuilder .record("FilterByValueRequest") .namespace("com.gpudb") .fields() .name("tableName").type().stringType().noDefault() .name("viewName").type().stringType().noDefault() .name("isString").type().booleanType().noDefault() .name("value").type().doubleType().noDefault() .name("valueStr").type().stringType().noDefault() .name("columnName").type().stringType().noDefault() .name("options").type().map().values().stringType().noDefault() .endRecord(); /** * This method supports the Avro framework and is not intended to be called * directly by the user. * * @return the schema for the class. * */ public static Schema getClassSchema() { return schema$; } /** * Optional parameters. * <ul> * <li> {@link * com.gpudb.protocol.FilterByValueRequest.Options#COLLECTION_NAME * COLLECTION_NAME}: [DEPRECATED--please specify the containing schema for * the view as part of {@code viewName} and use {@link * com.gpudb.GPUdb#createSchema(CreateSchemaRequest)} to create the schema * if non-existent] Name of a schema for the newly created view. If the * schema is non-existent, it will be automatically created. * </ul> * The default value is an empty {@link Map}. * A set of string constants for the parameter {@code options}. */ public static final class Options { /** * [DEPRECATED--please specify the containing schema for the view as * part of {@code viewName} and use {@link * com.gpudb.GPUdb#createSchema(CreateSchemaRequest)} to create the * schema if non-existent] Name of a schema for the newly created * view. If the schema is non-existent, it will be automatically * created. */ public static final String COLLECTION_NAME = "collection_name"; private Options() { } } private String tableName; private String viewName; private boolean isString; private double value; private String valueStr; private String columnName; private Map<String, String> options; /** * Constructs a FilterByValueRequest object with default parameters. */ public FilterByValueRequest() { tableName = ""; viewName = ""; valueStr = ""; columnName = ""; options = new LinkedHashMap<>(); } /** * Constructs a FilterByValueRequest object with the specified parameters. * * @param tableName Name of an existing table on which to perform the * calculation, in [schema_name.]table_name format, using * standard <a * href="../../../../../../concepts/tables/#table-name-resolution" * target="_top">name resolution rules</a>. * @param viewName If provided, then this will be the name of the view * containing the results, in [schema_name.]view_name * format, using standard <a * href="../../../../../../concepts/tables/#table-name-resolution" * target="_top">name resolution rules</a> and meeting <a * href="../../../../../../concepts/tables/#table-naming-criteria" * target="_top">table naming criteria</a>. Must not be * an already existing table or view. The default value * is ''. * @param isString Indicates whether the value being searched for is * string or numeric. * @param value The value to search for. The default value is 0. * @param valueStr The string value to search for. The default value is * ''. * @param columnName Name of a column on which the filter by value would * be applied. * @param options Optional parameters. * <ul> * <li> {@link * com.gpudb.protocol.FilterByValueRequest.Options#COLLECTION_NAME * COLLECTION_NAME}: [DEPRECATED--please specify the * containing schema for the view as part of {@code * viewName} and use {@link * com.gpudb.GPUdb#createSchema(CreateSchemaRequest)} to * create the schema if non-existent] Name of a schema for * the newly created view. If the schema is non-existent, * it will be automatically created. * </ul> * The default value is an empty {@link Map}. * */ public FilterByValueRequest(String tableName, String viewName, boolean isString, double value, String valueStr, String columnName, Map<String, String> options) { this.tableName = (tableName == null) ? "" : tableName; this.viewName = (viewName == null) ? "" : viewName; this.isString = isString; this.value = value; this.valueStr = (valueStr == null) ? "" : valueStr; this.columnName = (columnName == null) ? "" : columnName; this.options = (options == null) ? new LinkedHashMap<String, String>() : options; } /** * * @return Name of an existing table on which to perform the calculation, * in [schema_name.]table_name format, using standard <a * href="../../../../../../concepts/tables/#table-name-resolution" * target="_top">name resolution rules</a>. * */ public String getTableName() { return tableName; } /** * * @param tableName Name of an existing table on which to perform the * calculation, in [schema_name.]table_name format, using * standard <a * href="../../../../../../concepts/tables/#table-name-resolution" * target="_top">name resolution rules</a>. * * @return {@code this} to mimic the builder pattern. * */ public FilterByValueRequest setTableName(String tableName) { this.tableName = (tableName == null) ? "" : tableName; return this; } /** * * @return If provided, then this will be the name of the view containing * the results, in [schema_name.]view_name format, using standard * <a * href="../../../../../../concepts/tables/#table-name-resolution" * target="_top">name resolution rules</a> and meeting <a * href="../../../../../../concepts/tables/#table-naming-criteria" * target="_top">table naming criteria</a>. Must not be an already * existing table or view. The default value is ''. * */ public String getViewName() { return viewName; } /** * * @param viewName If provided, then this will be the name of the view * containing the results, in [schema_name.]view_name * format, using standard <a * href="../../../../../../concepts/tables/#table-name-resolution" * target="_top">name resolution rules</a> and meeting <a * href="../../../../../../concepts/tables/#table-naming-criteria" * target="_top">table naming criteria</a>. Must not be * an already existing table or view. The default value * is ''. * * @return {@code this} to mimic the builder pattern. * */ public FilterByValueRequest setViewName(String viewName) { this.viewName = (viewName == null) ? "" : viewName; return this; } /** * * @return Indicates whether the value being searched for is string or * numeric. * */ public boolean getIsString() { return isString; } /** * * @param isString Indicates whether the value being searched for is * string or numeric. * * @return {@code this} to mimic the builder pattern. * */ public FilterByValueRequest setIsString(boolean isString) { this.isString = isString; return this; } /** * * @return The value to search for. The default value is 0. * */ public double getValue() { return value; } /** * * @param value The value to search for. The default value is 0. * * @return {@code this} to mimic the builder pattern. * */ public FilterByValueRequest setValue(double value) { this.value = value; return this; } /** * * @return The string value to search for. The default value is ''. * */ public String getValueStr() { return valueStr; } /** * * @param valueStr The string value to search for. The default value is * ''. * * @return {@code this} to mimic the builder pattern. * */ public FilterByValueRequest setValueStr(String valueStr) { this.valueStr = (valueStr == null) ? "" : valueStr; return this; } /** * * @return Name of a column on which the filter by value would be applied. * */ public String getColumnName() { return columnName; } /** * * @param columnName Name of a column on which the filter by value would * be applied. * * @return {@code this} to mimic the builder pattern. * */ public FilterByValueRequest setColumnName(String columnName) { this.columnName = (columnName == null) ? "" : columnName; return this; } /** * * @return Optional parameters. * <ul> * <li> {@link * com.gpudb.protocol.FilterByValueRequest.Options#COLLECTION_NAME * COLLECTION_NAME}: [DEPRECATED--please specify the containing * schema for the view as part of {@code viewName} and use {@link * com.gpudb.GPUdb#createSchema(CreateSchemaRequest)} to create the * schema if non-existent] Name of a schema for the newly created * view. If the schema is non-existent, it will be automatically * created. * </ul> * The default value is an empty {@link Map}. * */ public Map<String, String> getOptions() { return options; } /** * * @param options Optional parameters. * <ul> * <li> {@link * com.gpudb.protocol.FilterByValueRequest.Options#COLLECTION_NAME * COLLECTION_NAME}: [DEPRECATED--please specify the * containing schema for the view as part of {@code * viewName} and use {@link * com.gpudb.GPUdb#createSchema(CreateSchemaRequest)} to * create the schema if non-existent] Name of a schema for * the newly created view. If the schema is non-existent, * it will be automatically created. * </ul> * The default value is an empty {@link Map}. * * @return {@code this} to mimic the builder pattern. * */ public FilterByValueRequest setOptions(Map<String, String> options) { this.options = (options == null) ? new LinkedHashMap<String, String>() : options; return this; } /** * This method supports the Avro framework and is not intended to be called * directly by the user. * * @return the schema object describing this class. * */ @Override public Schema getSchema() { return schema$; } /** * This method supports the Avro framework and is not intended to be called * directly by the user. * * @param index the position of the field to get * * @return value of the field with the given index. * * @throws IndexOutOfBoundsException * */ @Override public Object get(int index) { switch (index) { case 0: return this.tableName; case 1: return this.viewName; case 2: return this.isString; case 3: return this.value; case 4: return this.valueStr; case 5: return this.columnName; case 6: return this.options; default: throw new IndexOutOfBoundsException("Invalid index specified."); } } /** * This method supports the Avro framework and is not intended to be called * directly by the user. * * @param index the position of the field to set * @param value the value to set * * @throws IndexOutOfBoundsException * */ @Override @SuppressWarnings("unchecked") public void put(int index, Object value) { switch (index) { case 0: this.tableName = (String)value; break; case 1: this.viewName = (String)value; break; case 2: this.isString = (Boolean)value; break; case 3: this.value = (Double)value; break; case 4: this.valueStr = (String)value; break; case 5: this.columnName = (String)value; break; case 6: this.options = (Map<String, String>)value; break; default: throw new IndexOutOfBoundsException("Invalid index specified."); } } @Override public boolean equals(Object obj) { if( obj == this ) { return true; } if( (obj == null) || (obj.getClass() != this.getClass()) ) { return false; } FilterByValueRequest that = (FilterByValueRequest)obj; return ( this.tableName.equals( that.tableName ) && this.viewName.equals( that.viewName ) && ( this.isString == that.isString ) && ( (Double)this.value ).equals( (Double)that.value ) && this.valueStr.equals( that.valueStr ) && this.columnName.equals( that.columnName ) && this.options.equals( that.options ) ); } @Override public String toString() { GenericData gd = GenericData.get(); StringBuilder builder = new StringBuilder(); builder.append( "{" ); builder.append( gd.toString( "tableName" ) ); builder.append( ": " ); builder.append( gd.toString( this.tableName ) ); builder.append( ", " ); builder.append( gd.toString( "viewName" ) ); builder.append( ": " ); builder.append( gd.toString( this.viewName ) ); builder.append( ", " ); builder.append( gd.toString( "isString" ) ); builder.append( ": " ); builder.append( gd.toString( this.isString ) ); builder.append( ", " ); builder.append( gd.toString( "value" ) ); builder.append( ": " ); builder.append( gd.toString( this.value ) ); builder.append( ", " ); builder.append( gd.toString( "valueStr" ) ); builder.append( ": " ); builder.append( gd.toString( this.valueStr ) ); builder.append( ", " ); builder.append( gd.toString( "columnName" ) ); builder.append( ": " ); builder.append( gd.toString( this.columnName ) ); builder.append( ", " ); builder.append( gd.toString( "options" ) ); builder.append( ": " ); builder.append( gd.toString( this.options ) ); builder.append( "}" ); return builder.toString(); } @Override public int hashCode() { int hashCode = 1; hashCode = (31 * hashCode) + this.tableName.hashCode(); hashCode = (31 * hashCode) + this.viewName.hashCode(); hashCode = (31 * hashCode) + ((Boolean)this.isString).hashCode(); hashCode = (31 * hashCode) + ((Double)this.value).hashCode(); hashCode = (31 * hashCode) + this.valueStr.hashCode(); hashCode = (31 * hashCode) + this.columnName.hashCode(); hashCode = (31 * hashCode) + this.options.hashCode(); return hashCode; } }
GPUdb/gpudb-api-java
api/src/main/java/com/gpudb/protocol/FilterByValueRequest.java
Java
mit
18,189
module Dragoman module Mapper def localize locales = I18n.available_locales unscoped_locales = [I18n.default_locale] scoped_locales = locales - unscoped_locales scope ':locale', shallow_path: ':locale', defaults: {dragoman_options: {locales: scoped_locales}} do yield end defaults dragoman_options: {locales: unscoped_locales} do yield end @locales = nil end end end
pietervisser/dragoman
lib/dragoman/mapper.rb
Ruby
mit
442
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.34209 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace NugetCompare.UI.Properties { using System; /// <summary> /// A strongly-typed resource class, for looking up localized strings, etc. /// </summary> // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NugetCompare.UI.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } /// <summary> /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } } }
ryanande/NugetCompare
src/UI/Properties/Resources.Designer.cs
C#
mit
2,795
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>infotheo: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.13.0 / infotheo - 0.3.2</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> infotheo <small> 0.3.2 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-02-11 02:59:41 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-02-11 02:59:41 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils conf-gmp 4 Virtual package relying on a GMP lib system installation coq 8.13.0 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.13.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.13.1 Official release 4.13.1 ocaml-config 2 OCaml Switch Configuration ocaml-options-vanilla 1 Ensure that OCaml is compiled with no special options enabled ocamlfind 1.9.3 A library manager for OCaml zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Reynald Affeldt &lt;[email protected]&gt;&quot; homepage: &quot;https://github.com/affeldt-aist/infotheo&quot; dev-repo: &quot;git+https://github.com/affeldt-aist/infotheo.git&quot; bug-reports: &quot;https://github.com/affeldt-aist/infotheo/issues&quot; license: &quot;LGPL-2.1-or-later&quot; synopsis: &quot;Discrete probabilities and information theory for Coq&quot; description: &quot;&quot;&quot; Infotheo is a Coq library for reasoning about discrete probabilities, information theory, and linear error-correcting codes.&quot;&quot;&quot; build: [ [make &quot;-j%{jobs}%&quot; ] [make &quot;-C&quot; &quot;extraction&quot; &quot;tests&quot;] {with-test} ] install: [make &quot;install&quot;] depends: [ &quot;coq&quot; { (&gt;= &quot;8.13&quot; &amp; &lt; &quot;8.14~&quot;) | (= &quot;dev&quot;) } &quot;coq-mathcomp-ssreflect&quot; { (&gt;= &quot;1.12.0&quot; &amp; &lt; &quot;1.13~&quot;) } &quot;coq-mathcomp-fingroup&quot; { (&gt;= &quot;1.12.0&quot; &amp; &lt; &quot;1.13~&quot;) } &quot;coq-mathcomp-algebra&quot; { (&gt;= &quot;1.12.0&quot; &amp; &lt; &quot;1.13~&quot;) } &quot;coq-mathcomp-solvable&quot; { (&gt;= &quot;1.12.0&quot; &amp; &lt; &quot;1.13~&quot;) } &quot;coq-mathcomp-field&quot; { (&gt;= &quot;1.12.0&quot; &amp; &lt; &quot;1.13~&quot;) } &quot;coq-mathcomp-analysis&quot; { (&gt;= &quot;0.3.6&quot; &amp; &lt; &quot;0.3.8&quot;) } ] tags: [ &quot;keyword:information theory&quot; &quot;keyword:probability&quot; &quot;keyword:error-correcting codes&quot; &quot;keyword:convexity&quot; &quot;logpath:infotheo&quot; &quot;date:2021-03-23&quot; ] authors: [ &quot;Reynald Affeldt, AIST&quot; &quot;Manabu Hagiwara, Chiba U. (previously AIST)&quot; &quot;Jonas Senizergues, ENS Cachan (internship at AIST)&quot; &quot;Jacques Garrigue, Nagoya U.&quot; &quot;Kazuhiko Sakaguchi, Tsukuba U.&quot; &quot;Taku Asai, Nagoya U. (M2)&quot; &quot;Takafumi Saikawa, Nagoya U.&quot; &quot;Naruomi Obata, Titech (M2)&quot; ] url { http: &quot;https://github.com/affeldt-aist/infotheo/archive/0.3.2.tar.gz&quot; checksum: &quot;sha512=ab3a82c343eb3b1fc164e95cc963612310f06a400e3fb9781c28b4afb37356a57a99d236cd788d925ae5f2c8ce8f96850ad40d5a79306daca69db652c268d5f8&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-infotheo.0.3.2 coq.8.13.0</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.13.0). The following dependencies couldn&#39;t be met: - coq-infotheo -&gt; coq-mathcomp-analysis &lt; 0.3.8 -&gt; coq-mathcomp-finmap &lt; 1.4~ -&gt; coq &lt; 8.11.1 -&gt; ocaml &lt; 4.10 base of this switch (use `--unlock-base&#39; to force) - coq-infotheo -&gt; coq-mathcomp-analysis &lt; 0.3.8 -&gt; coq-mathcomp-finmap &lt; 1.4~ -&gt; coq-mathcomp-ssreflect &lt; 1.8~ -&gt; coq &lt; 8.10~ -&gt; ocaml &lt; 4.10 base of this switch (use `--unlock-base&#39; to force) - coq-infotheo -&gt; coq-mathcomp-analysis &lt; 0.3.8 -&gt; coq-hierarchy-builder (&lt; 1.1.0 | &gt;= dev) -&gt; coq &lt; 8.12.0~ -&gt; ocaml &lt; 4.12 base of this switch (use `--unlock-base&#39; to force) - coq-infotheo -&gt; coq-mathcomp-analysis &lt; 0.3.8 -&gt; coq-hierarchy-builder (&lt; 1.1.0 | &gt;= dev) -&gt; coq-elpi -&gt; ocaml &lt; 4.12~ base of this switch (use `--unlock-base&#39; to force) - coq-infotheo -&gt; coq-mathcomp-analysis &lt; 0.3.8 -&gt; coq-hierarchy-builder (&lt; 1.1.0 | &gt;= dev) -&gt; coq-elpi -&gt; elpi &lt; 1.14.0~ -&gt; camlp5 &lt; 8.00~alpha01 -&gt; ocaml &lt; 4.13.0 base of this switch (use `--unlock-base&#39; to force) - coq-infotheo -&gt; coq-mathcomp-analysis &lt; 0.3.8 -&gt; coq-hierarchy-builder (&lt; 1.1.0 | &gt;= dev) -&gt; coq-elpi -&gt; elpi &lt; 1.14.0~ -&gt; ocaml-migrate-parsetree &lt; 2.0.0 -&gt; ocaml &lt; 4.13 base of this switch (use `--unlock-base&#39; to force) - coq-infotheo -&gt; coq-mathcomp-analysis &lt; 0.3.8 -&gt; coq-hierarchy-builder (&lt; 1.1.0 | &gt;= dev) -&gt; coq-elpi -&gt; elpi &lt; 1.14.0~ -&gt; ppx_tools_versioned &lt; 5.2.1 -&gt; ocaml &lt; 4.08.0 base of this switch (use `--unlock-base&#39; to force) - coq-infotheo -&gt; coq-mathcomp-analysis &lt; 0.3.8 -&gt; coq-hierarchy-builder (&lt; 1.1.0 | &gt;= dev) -&gt; coq-elpi -&gt; coq &lt; 8.13~ -&gt; ocaml &lt; 4.12 base of this switch (use `--unlock-base&#39; to force) - coq-infotheo -&gt; coq-mathcomp-analysis &lt; 0.3.8 -&gt; coq &lt; 8.9~ -&gt; ocaml &lt; 4.12 base of this switch (use `--unlock-base&#39; to force) No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-infotheo.0.3.2</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
coq-bench/coq-bench.github.io
clean/Linux-x86_64-4.13.1-2.0.10/released/8.13.0/infotheo/0.3.2.html
HTML
mit
10,100
<?php if(!defined('BASEPATH')) die; class MY_Controller extends CI_Controller { public $session; public $user; function __construct(){ parent::__construct(); $this->output->set_header('X-Powered-By: ' . config_item('system_vendor')); $this->output->set_header('X-Deadpool: ' . config_item('header_message')); $this->load->library('SiteEnum', '', 'enum'); $this->load->library('SiteParams', '', 'setting'); $this->load->library('SiteTheme', '', 'theme'); $this->load->library('SiteMenu', '', 'menu'); $this->load->library('SiteForm', '', 'form'); $this->load->library('SiteMeta', '', 'meta'); $this->load->library('ObjectMeta', '', 'ometa'); $this->load->library('ActionEvent', '', 'event'); $cookie_name = config_item('sess_cookie_name'); $hash = $this->input->cookie($cookie_name); if($hash){ $this->load->model('Usersession_model', 'USession'); $session = $this->USession->getBy('hash', $hash); $this->session = $session; if($session){ $this->load->model('User_model', 'User'); $user = $this->User->get($session->user); // TODO // Increase session expiration if it's almost expired if($user && $user->status > 1){ $this->user = $user; $this->user->perms = []; if($user){ if($user->id == 1){ $this->load->model('Perms_model', 'Perms'); $user_perms = $this->Perms->getByCond([], true, false); $this->user->perms = prop_values($user_perms, 'name'); }else{ $this->load->model('Userperms_model', 'UPerms'); $user_perms = $this->UPerms->getBy('user', $user->id, true); if($user_perms) $this->user->perms = prop_values($user_perms, 'perms'); } $this->user->perms[] = 'logged_in'; } } } } if($this->theme->current() == 'admin/') $this->lang->load('admin', config_item('language')); } /** * Return to client as ajax respond. * @param mixed data The data to return. * @param mixed error The error data. * @param mixed append Additional data to append to result. */ public function ajax($data, $error=false, $append=null){ $result = array( 'data' => $data, 'error'=> $error ); if($append) $result = array_merge($result, $append); $cb = $this->input->get('cb'); if(!$cb) $cb = $this->input->get('callback'); $json = json_encode($result); $cset = config_item('charset'); if($cb){ $json = "$cb($json);"; $this->output ->set_status_header(200) ->set_content_type('application/javascript', $cset) ->set_output($json) ->_display(); exit; }else{ $this->output ->set_status_header(200) ->set_content_type('application/json', $cset) ->set_output($json) ->_display(); exit; } } /** * Check if current admin user can do something * @param string perms The perms to check. * @return boolean true on allowed, false otherwise. */ public function can_i($perms){ if(!$this->user) return false; return in_array($perms, $this->user->perms); } /** * Redirect to some URL. * @param string next Target URL. * @param integer status Redirect status. */ public function redirect($next='/', $status=NULL){ if(substr($next, 0, 4) != 'http') $next = base_url($next); redirect($next, 'auto', $status); } /** * Print page. * @param string view The view to load. * @param array params The parameters to send to view. */ public function respond($view, $params=array()){ $page_title = ''; if(array_key_exists('title', $params)) $page_title = $params['title'] . ' - '; $page_title.= $this->setting->item('site_name'); $params['page_title'] = $page_title; if(!$this->theme->exists($view) && !is_dev()) return $this->show_404(); $this->theme->load($view, $params); } /** * Print 404 page */ public function show_404(){ $this->load->model('Urlredirection_model', 'Redirection'); $next = $this->Redirection->getBy('source', uri_string()); if($next) return $this->redirect($next->target, 301); $this->output->set_status_header('404'); $params = array( 'title' => _l('Page not found') ); $this->respond('404', $params); } }
iqbalfn/admin
application/core/MY_Controller.php
PHP
mit
5,404
/* ================================================================ * startserver by xdf(xudafeng[at]126.com) * * first created at : Mon Jun 02 2014 20:15:51 GMT+0800 (CST) * * ================================================================ * Copyright 2013 xdf * * Licensed under the MIT License * You may not use this file except in compliance with the License. * * ================================================================ */ 'use strict'; var logx = require('logx'); function *logger() { var log = 'Method: '.gray + this.req.method.red; log += ' Url: '.gray + this.req.url.red; logx.info(log); yield this.next(); } module.exports = logger;
xudafeng/startserver
lib/middleware/logger/index.js
JavaScript
mit
675
/** * Default admin */ new User({ firstName: 'Admin', lastName: 'Admin', username: 'admin', type: 'admin', password: 'admin', email: '[email protected]', subscribed: false, }).save((u) => { }) /** * Test users */ new User({ firstName: 'Jonathan', lastName: 'Santos', username: 'santojon', type: 'user', password: 'test', email: '[email protected]', gender: 'Male', subscribed: true, image: 'https://avatars1.githubusercontent.com/u/4976482' }).save((u) => { UserController.updateUser(u) }) new User({ firstName: 'Raphael', lastName: 'Tulyo', username: 'crazybird', type: 'user', password: 'test', email: '[email protected]', gender: 'Male', subscribed: true }).save((u) => { UserController.updateUser(u) }) new User({ firstName: 'Vinícius', lastName: 'Emanuel', username: 'vems', type: 'user', password: 'test', email: '[email protected]', gender: 'Male', subscribed: true }).save((u) => { UserController.updateUser(u) }) /** * More test users */ for (i = 0; i < 5; i++) { new User({ firstName: 'Test' + i, lastName: '' + i, username: 'testuser' + i, type: 'user', password: 'test', email: 'test' + i + '@test.br', gender: (i % 2 === 0) ? 'Male' : 'Female', subscribed: true }).save((u) => { UserController.updateUser(u) }) } Subscription.findAll().forEach((s) => { s.status = true s.update(s) })
santojon/hardStone
bootstrap.js
JavaScript
mit
1,538
--- layout: page title: Mcclain Family Reunion date: 2016-05-24 author: Roger Moss tags: weekly links, java status: published summary: Nullam hendrerit elit lectus. Vestibulum in purus efficitur. banner: images/banner/leisure-04.jpg booking: startDate: 02/07/2019 endDate: 02/11/2019 ctyhocn: PRIWVHX groupCode: MFR published: true --- Donec interdum pulvinar ex id pharetra. Morbi accumsan, ligula non dignissim pellentesque, arcu est semper massa, in congue lectus metus vitae purus. Vestibulum sit amet elementum ante. Sed efficitur maximus pulvinar. Praesent laoreet justo in dui consequat, dictum elementum mauris maximus. Morbi ultrices tortor nec porta tincidunt. Donec et lectus tortor. Vestibulum porttitor venenatis odio id tincidunt. In pellentesque tortor a metus fringilla, eu tincidunt lorem feugiat. Praesent pulvinar metus ac quam mattis, nec maximus eros pretium. Nullam et nulla a mauris semper venenatis. Fusce lacus mauris, vehicula vel diam quis, auctor venenatis mi. Vivamus ac urna dui. Duis porttitor tincidunt metus quis lobortis. Donec ut velit felis. Vivamus justo ex, suscipit non turpis sed, lacinia commodo dui. Vivamus tristique finibus arcu ac condimentum. Sed vel risus quis urna fringilla hendrerit et id tellus. Nam suscipit massa a dignissim scelerisque. Nullam nisl felis, imperdiet eu dui non, iaculis rutrum orci. 1 Nullam vehicula orci sit amet felis euismod varius 1 Morbi feugiat ex vel lectus pharetra, sed gravida metus facilisis. Cras nec lobortis augue. Vestibulum enim massa, dapibus sagittis ornare vitae, feugiat nec arcu. Sed id augue leo. In hac habitasse platea dictumst. Donec ullamcorper sapien a egestas commodo. Praesent non elit mollis mi sodales egestas sit amet nec elit. Suspendisse eget efficitur enim. Quisque libero quam, volutpat sed commodo sed, gravida et purus. Nam bibendum ipsum quis justo convallis, vel porttitor purus ullamcorper. Mauris id gravida velit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sed gravida urna, sed mattis arcu. Aenean facilisis at ex at porta. Nullam semper eget est eget dapibus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Fusce efficitur arcu in erat vestibulum tempus. Cras aliquet, sapien feugiat scelerisque lobortis, tellus ex mollis ipsum, a convallis quam ipsum id ligula. Mauris porta tristique turpis, eget feugiat sapien sollicitudin sed. Nullam porttitor sagittis mi, vitae pharetra enim efficitur et. Etiam hendrerit ac metus sed viverra. Ut ipsum nisi, luctus eget ex ac, volutpat maximus justo. Fusce vulputate iaculis dignissim. Duis placerat facilisis purus ut tristique.
KlishGroup/prose-pogs
pogs/P/PRIWVHX/MFR/index.md
Markdown
mit
2,665
--- layout: page title: Purple Systems Seminar date: 2016-05-24 author: Martha Chandler tags: weekly links, java status: published summary: Fusce risus orci, porttitor id molestie sit amet, mollis. banner: images/banner/meeting-01.jpg booking: startDate: 10/13/2016 endDate: 10/14/2016 ctyhocn: FTWMFHX groupCode: PSS published: true --- Phasellus pretium nulla id risus congue maximus. Fusce elementum elementum facilisis. Suspendisse ut venenatis nunc. Nulla euismod, elit non semper aliquam, odio leo pellentesque turpis, vitae feugiat lorem purus in purus. Vestibulum accumsan bibendum felis, vitae volutpat nunc fringilla et. Quisque eros nunc, congue in pharetra ut, lacinia quis urna. Praesent a enim vitae turpis fringilla tristique. Mauris euismod elit id nunc mollis porttitor. In ultricies est libero, non porttitor ante eleifend pharetra. Quisque tincidunt sapien sollicitudin urna viverra rutrum. Quisque molestie leo libero, nec porttitor tortor vestibulum tempor. Nullam vel ullamcorper quam, at euismod nunc. Etiam faucibus nisl eros, id tempor enim pellentesque vel. * Pellentesque porttitor eros a diam faucibus commodo. In sit amet leo diam. Phasellus sollicitudin porta mi, in venenatis lectus ultricies sit amet. Aliquam eu porta nisl. Maecenas nec est eget enim elementum elementum vel ac justo. Ut aliquam tellus non commodo pulvinar. Curabitur pharetra ligula vel orci maximus viverra. Duis a blandit dolor. Vestibulum sit amet venenatis nulla. Mauris lectus eros, pellentesque vitae urna in, vulputate blandit augue. Suspendisse potenti. Fusce a euismod nisl, eu imperdiet sem. Aliquam nec finibus elit. Praesent odio velit, bibendum et leo et, rhoncus ornare odio.
KlishGroup/prose-pogs
pogs/F/FTWMFHX/PSS/index.md
Markdown
mit
1,701
--- title: "Suriname" published: true featured_image_path: featured_image_attribution: geocode: SUR iso_code: SR territory: state_party: true signed_but_not_ratified: false signed_date: ratified_or_acceded_date: 2008-07-15T00:00:00.000Z entry_into_force_date: 2008-10-01T00:00:00.000Z ratified_apic_date: genocide: crimes_against_humanity: aggression: war_crimes: note: slug: suriname ---
ABA-Center-for-Human-Rights/aba-icc
_countries/suriname.md
Markdown
mit
389
/** * Automatically generated file. Please do not edit. * @author Highcharts Config Generator by Karasiq * @see [[http://api.highcharts.com/highstock]] */ package com.highstock.config import scalajs.js, js.`|` import com.highcharts.CleanJsObject import com.highcharts.HighchartsUtils._ /** * @note JavaScript name: <code>plotOptions-solidgauge-dragDrop-guideBox-default</code> */ @js.annotation.ScalaJSDefined class PlotOptionsSolidgaugeDragDropGuideBoxDefault extends com.highcharts.HighchartsGenericObject { /** * <p>CSS class name of the guide box in this state. Defaults to * <code>highcharts-drag-box-default</code>.</p> * @since 6.2.0 */ val className: js.UndefOr[String] = js.undefined /** * <p>Width of the line around the guide box.</p> * @since 6.2.0 */ val lineWidth: js.UndefOr[Double] = js.undefined /** * <p>Color of the border around the guide box.</p> * @since 6.2.0 */ val lineColor: js.UndefOr[String | js.Object] = js.undefined /** * <p>Guide box fill color.</p> * @since 6.2.0 */ val color: js.UndefOr[String | js.Object] = js.undefined /** * <p>Guide box cursor.</p> * @since 6.2.0 */ val cursor: js.UndefOr[String] = js.undefined /** * <p>Guide box zIndex.</p> * @since 6.2.0 */ val zIndex: js.UndefOr[Double] = js.undefined } object PlotOptionsSolidgaugeDragDropGuideBoxDefault { /** * @param className <p>CSS class name of the guide box in this state. Defaults to. <code>highcharts-drag-box-default</code>.</p> * @param lineWidth <p>Width of the line around the guide box.</p> * @param lineColor <p>Color of the border around the guide box.</p> * @param color <p>Guide box fill color.</p> * @param cursor <p>Guide box cursor.</p> * @param zIndex <p>Guide box zIndex.</p> */ def apply(className: js.UndefOr[String] = js.undefined, lineWidth: js.UndefOr[Double] = js.undefined, lineColor: js.UndefOr[String | js.Object] = js.undefined, color: js.UndefOr[String | js.Object] = js.undefined, cursor: js.UndefOr[String] = js.undefined, zIndex: js.UndefOr[Double] = js.undefined): PlotOptionsSolidgaugeDragDropGuideBoxDefault = { val classNameOuter: js.UndefOr[String] = className val lineWidthOuter: js.UndefOr[Double] = lineWidth val lineColorOuter: js.UndefOr[String | js.Object] = lineColor val colorOuter: js.UndefOr[String | js.Object] = color val cursorOuter: js.UndefOr[String] = cursor val zIndexOuter: js.UndefOr[Double] = zIndex com.highcharts.HighchartsGenericObject.toCleanObject(new PlotOptionsSolidgaugeDragDropGuideBoxDefault { override val className: js.UndefOr[String] = classNameOuter override val lineWidth: js.UndefOr[Double] = lineWidthOuter override val lineColor: js.UndefOr[String | js.Object] = lineColorOuter override val color: js.UndefOr[String | js.Object] = colorOuter override val cursor: js.UndefOr[String] = cursorOuter override val zIndex: js.UndefOr[Double] = zIndexOuter }) } }
Karasiq/scalajs-highcharts
src/main/scala/com/highstock/config/PlotOptionsSolidgaugeDragDropGuideBoxDefault.scala
Scala
mit
3,056
--- layout: home title: Borislav Stanimirov stylesheet: homepage ---
iboB/ibob.github.com
index.md
Markdown
mit
69
using UnityEngine; using System.Collections; public class GravitySwitch : MonoBehaviour { public float GravityStrength; float momentum; float click; public bool GameState; bool GravityState; public GameObject Explosion; public GameObject[] Jets; public GameObject[] CharacterPieces; public Vector3 hitposition; public GameObject EndScreen; public UILabel BestScore; void Start() { GravityStrength = 0; BestScore.text = "Best:" + PlayerPrefs.GetFloat("BestScore").ToString(); GameState = true; } void Update () { Gravity(); Controls(); if (GameState == false) { transform.position = hitposition; EndScreen.SetActive(true); } } void Gravity() { //transform.Translate(new Vector3(3,0) * Time.deltaTime); switch (GravityState) { case true: Physics2D.gravity = new Vector2(momentum,GravityStrength); /*transform.localEulerAngles = new Vector2(-180, 0);*/ break; case false: Physics2D.gravity = new Vector2(momentum,-GravityStrength); /*transform.localEulerAngles = new Vector2(0, 0);*/ break; } if (GravityStrength == 0) { transform.position = new Vector3(0,-5.5f,0); } } void Controls() { if (Input.GetKeyDown(KeyCode.Space)) { GravityState = !GravityState; } if (Input.GetMouseButtonDown(0)) { GravityState = !GravityState; if (click == 0) { momentum = 2; GravityStrength = 27; foreach(GameObject jet in Jets) { jet.SetActive(true); } } click+=1; } } void OnCollisionEnter2D(Collision2D other) { //Application.LoadLevel(Application.loadedLevel); if (GameState == true) { foreach (ContactPoint2D contact in other.contacts) { GameObject Hit = Instantiate (Explosion, contact.point, Quaternion.identity) as GameObject; hitposition = Hit.transform.position; GameState = false; } foreach (GameObject self in CharacterPieces) { self.SetActive(false); } } } }
parodyband/Polarity
Assets/Code/GravitySwitch.cs
C#
mit
1,927
<h1>Most Viewed</h1> <table class="table table-hover"> <thead> <tr> <th>Tool ID</th> <th>Tool Name</th> <th>Tool Description</th> <th>Extent</th> <th>Rating</th> <th>Views</th> </tr> </thead> <tbody> <tr> <td>#1</td> <td>Test Pro</td> <td>This tool creates auto testing scripts</td> <td>Enterprise</td> <td>3/5</td> <td>4589</td> </tr> <tr> <td>#2</td> <td>Script Builder</td> <td>This tool auto builds the scripts</td> <td>Application</td> <td>4/5</td> <td>9768</td> </tr> <tr> <td>#3</td> <td>Bootstrap Builder</td> <td>Auto build responsive websites</td> <td>Technology</td> <td>5/5</td> <td>759</td> </tr> </tbody> </table>
dennisjohn13/SmartTracker
RefUI/pages/Viewed.html
HTML
mit
1,345
import sys import pytest from opentracing.ext import tags from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from opentracing_instrumentation.client_hooks import mysqldb as mysqldb_hooks from opentracing_instrumentation.request_context import span_in_context from .sql_common import metadata, User SKIP_REASON_PYTHON_3 = 'MySQLdb is not compatible with Python 3' SKIP_REASON_CONNECTION = 'MySQL is not running or cannot connect' MYSQL_CONNECTION_STRING = 'mysql://[email protected]/test' @pytest.fixture def session(): Session = sessionmaker() engine = create_engine(MYSQL_CONNECTION_STRING) Session.configure(bind=engine) metadata.create_all(engine) try: yield Session() except: pass @pytest.fixture(autouse=True, scope='module') def patch_sqlalchemy(): mysqldb_hooks.install_patches() try: yield finally: mysqldb_hooks.reset_patches() def is_mysql_running(): try: import MySQLdb with MySQLdb.connect(host='127.0.0.1', user='root'): pass return True except: return False def assert_span(span, operation, parent=None): assert span.operation_name == 'MySQLdb:' + operation assert span.tags.get(tags.SPAN_KIND) == tags.SPAN_KIND_RPC_CLIENT if parent: assert span.parent_id == parent.context.span_id assert span.context.trace_id == parent.context.trace_id else: assert span.parent_id is None @pytest.mark.skipif(not is_mysql_running(), reason=SKIP_REASON_CONNECTION) @pytest.mark.skipif(sys.version_info.major == 3, reason=SKIP_REASON_PYTHON_3) def test_db(tracer, session): root_span = tracer.start_span('root-span') # span recording works for regular operations within a context only with span_in_context(root_span): user = User(name='user', fullname='User', password='password') session.add(user) session.commit() spans = tracer.recorder.get_spans() assert len(spans) == 4 connect_span, insert_span, commit_span, rollback_span = spans assert_span(connect_span, 'Connect') assert_span(insert_span, 'INSERT', root_span) assert_span(commit_span, 'commit', root_span) assert_span(rollback_span, 'rollback', root_span)
uber-common/opentracing-python-instrumentation
tests/opentracing_instrumentation/test_mysqldb.py
Python
mit
2,279
// Write a boolean expression that returns if the bit at position p (counting from 0) // in a given integer number v has value of 1. Example: v=5; p=1 -> false. using System; class BitInIntegerCheck { static void Main() { // декларираме променливи за числото (v) и позицията (p), за която ще проверяваме int v = 8; int p = 3; // израза е прекалено лесен и не мисля, че си заслужава декларацията на 2 допълнителни променливи... // умножаваме "v" с 1 предварително отместено "p" пъти наляво, след което резултатът бива отместен "p" пъти надясно // със същият успех може и да се премести единицата от дясната страна на израза "p" пъти наляво, // като по този начин си спестяваме връщането "p" пъти надясно от другата страна на равенството и е по-лесно за разбиране/четене // => if( v & ( 1 << p ) == 1 << p ) if( ( v & ( 1 << p ) ) >> p == 1 ) { Console.WriteLine("The value {0} has a 1 at bit number {1}", v, p); } else { Console.WriteLine("The value {0} has a 0 at bit number {1}", v, p); } } }
Steffkn/TelerikAcademy
Programming/01. CSharp Part 1/03.OperatorsAndExpressions/10.BinInIntegerCheck/BitInIntegerCheck.cs
C#
mit
1,546
<header role="banner" id="top"> <div class="mdj-header"> <div style="flex-grow: 2;"> <div class="mdj-card"> <div class="mdj-card--photo"> <a href="{{ site.baseurl }}/"><img class="mdj-card--photo__rainbow" src="/assets/mdjablonski-white.jpg"></a> </div> <div class="mdj-card--desc"> <h2 class="mdj-header--title"><a href="{{ site.baseurl }}/">Marcin Dominik Jabłoński</a></h2> <p class="mdj-header--subtitle"><a href="{{ site.baseurl }}/">Product & UX designer</a></p> </div> </div> <div class="mdj-dialog"> <span class="mdj-dialog--arrow"></span> <span class="mdj-dialog--bubble">Hello!<span class="hello"></span>Welcome to my website.</span> </div> </div> <nav role="navigation"> <ul class="mdj-menu"> <li><a class="mdj-menu__about" href="{{ site.baseurl }}/"><span></span>About me</a></li> <li><a class="mdj-menu__portfolio" href="{{ site.baseurl }}/ux-portfolio/"><span></span>UX portfolio</a></li> <li><a class="mdj-menu__articles" href="{{ site.baseurl }}/articles/"><span></span>Articles</a></li> </ul> </nav> </div> </header>
mdjablonski/mdjablonski.github.io
_includes/header.html
HTML
mit
1,353
/* * Copyright 2017 Max Schafer, Ammar Mahdi, Riley Dixon, Steven Weikai Lu, Jiaxiong Yang * * 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. */ package com.example.lit.habit; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Parcel; import android.os.Parcelable; import android.util.Base64; import android.util.Log; import com.example.lit.exception.BitmapTooLargeException; import com.example.lit.exception.HabitFormatException; import com.example.lit.saving.Saveable; import com.example.lit.exception.HabitFormatException; import io.searchbox.annotations.JestId; import java.io.ByteArrayOutputStream; import java.io.Serializable; import java.text.ParsePosition; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.List; /** * This class is an abstract habit class * @author Steven Weikai Lu */ public abstract class Habit implements Habitable , Parcelable, Saveable { private String title; private SimpleDateFormat format; private Date date; public abstract String habitType(); private String user; private String reason; private int titleLength = 20; private int reasonLength = 30; private List<Calendar> calendars; private List<Date> dates; private String encodedImage; @JestId private String id; private Bitmap image; public String getID(){ return id ;} public void setID(String id){ this.id = id ;} public Habit(String title) throws HabitFormatException { this.setTitle(title); this.setDate(new Date()); } public Habit(String title, Date date) throws HabitFormatException{ this.setTitle(title); this.setDate(date); } public Habit(String title, Date date, String reason) throws HabitFormatException { this.setTitle(title); this.setDate(date); this.setReason(reason); } /** * This is the main constructor we are using in AddHabitActivity * * @see com.example.lit.activity.AddHabitActivity * @param title Habit name, should be at most 20 char long. * @param reason Habit Comment, should be at most 30 char long. * @param date Set by GPS when creating the habit * @param calendarList Set by user when creating the habit * @throws HabitFormatException thrown when title longer than 20 char or reason longer than 30 char * */ public Habit(String title, Date date, String reason, List<Calendar> calendarList) throws HabitFormatException { this.setTitle(title); this.setDate(date); this.setReason(reason); this.setCalendars(calendarList); } public Habit(String title, Date date, String reason, List<Calendar> calendars, Bitmap image)throws HabitFormatException, BitmapTooLargeException{ this.setTitle(title); this.setDate(date); this.setReason(reason); this.setCalendars(calendars); this.setImage(image); } // TODO: Constructor with JestID public String getTitle() { return title; } public void setTitle(String title) throws HabitFormatException { if (title.length() > this.titleLength){ throw new HabitFormatException(); } this.title = title; } public String getUser() { return user; } public void setUser(String user) { this.user = user; } public Date getDate() { return date; } /** * Function takes in a Date object and formats it to dd-MM-yyyy * @param date */ public void setDate(Date date) { // Format the current time. SimpleDateFormat format = new SimpleDateFormat ("dd-MM-yyyy"); String dateString = format.format(date); // Parse the previous string back into a Date. ParsePosition pos = new ParsePosition(0); this.date = format.parse(dateString, pos); } public String getReason() { return reason; } public void setReason(String reason) throws HabitFormatException { if (reason.length() < this.reasonLength) { this.reason = reason; } else { throw new HabitFormatException(); } } public List<Calendar> getCalendars() { return calendars; } public void setCalendars(List<Calendar> calendars) { this.calendars = calendars; } public Bitmap getImage() { if(encodedImage != null) { byte[] decodedString = Base64.decode(this.encodedImage, Base64.DEFAULT); this.image = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length); } return this.image; } /** * Function takes in a Bitmap object and decodes it to a 64Base string * @param image * @throws BitmapTooLargeException */ public void setImage(Bitmap image) throws BitmapTooLargeException { if (image == null){ this.image = null; } else if (image.getByteCount() > 65536){ throw new BitmapTooLargeException(); } else { this.image = image; ByteArrayOutputStream baos = new ByteArrayOutputStream(); image.compress(Bitmap.CompressFormat.JPEG, 100, baos); //bm is the bitmap object byte[] byteArray = baos.toByteArray(); this.encodedImage = Base64.encodeToString(byteArray, Base64.DEFAULT); //Log.i("encoded",this.encodedImage); } } @Override public String toString() { SimpleDateFormat format = new SimpleDateFormat("dd-MM-yyyy"); return "Habit Name: " + this.getTitle() + '\n' + "Started From: " + format.format(this.getDate()); } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeString(this.title); dest.writeSerializable(this.format); dest.writeLong(this.date != null ? this.date.getTime() : -1); dest.writeString(this.user); dest.writeString(this.reason); dest.writeInt(this.titleLength); dest.writeInt(this.reasonLength); dest.writeList(this.calendars); dest.writeList(this.dates); dest.writeString(this.encodedImage); dest.writeString(this.id); dest.writeParcelable(this.image, flags); } protected Habit(Parcel in) { this.title = in.readString(); this.format = (SimpleDateFormat) in.readSerializable(); long tmpDate = in.readLong(); this.date = tmpDate == -1 ? null : new Date(tmpDate); this.user = in.readString(); this.reason = in.readString(); this.titleLength = in.readInt(); this.reasonLength = in.readInt(); this.calendars = new ArrayList<Calendar>(); in.readList(this.calendars, Calendar.class.getClassLoader()); this.dates = new ArrayList<Date>(); in.readList(this.dates, Date.class.getClassLoader()); this.encodedImage = in.readString(); this.id = in.readString(); this.image = in.readParcelable(Bitmap.class.getClassLoader()); } }
CMPUT301F17T06/Lit
app/src/main/java/com/example/lit/habit/Habit.java
Java
mit
8,243
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>Privacy Policy</title> <style> body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; padding: 1em; } </style> </head> <body> <h2>Privacy Policy</h2> <p> Bobgoo SLU built the Bobzon for Amazon app as an Ad Supported app. This SERVICE is provided by Bobgoo SLU at no cost and is intended for use as is. </p> <p>This page is used to inform website visitors regarding our policies with the collection, use, and disclosure of Personal Information if anyone decided to use our Service. </p> <p>If you choose to use our Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that we collect is used for providing and improving the Service. We will not use or share your information with anyone except as described in this Privacy Policy. </p> <p>The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at Bobzon for Amazon unless otherwise defined in this Privacy Policy. </p> <p><strong>Information Collection and Use</strong></p> <p>For a better experience, while using our Service, we may require you to provide us with certain personally identifiable information. The information that we request is retained on your device and is not collected by us in any way. </p> <p>The app does use third party services that may collect information used to identify you.</p> <div> <p>Link to privacy policy of third party service providers used by the app </p> <ul> <!----> <li><a href="https://www.google.com/policies/privacy/" target="_blank">Google Play Services</a></li> <li><a href="https://support.google.com/admob/answer/6128543?hl=en" target="_blank">AdMob</a></li> <li><a href="https://firebase.google.com/policies/analytics" target="_blank">Firebase Analytics</a></li> <li><a href="https://fabric.io/privacy" target="_blank">Fabric</a></li> <li><a href="http://try.crashlytics.com/terms/privacy-policy.pdf" target="_blank">Crashlytics</a></li> <!----> </ul> </div> <p><strong>Log Data</strong></p> <p> We want to inform you that whenever you use our Service, in a case of an error in the app we collect data and information (through third party products) on your phone called Log Data. This Log Data may include information such as your device Internet Protocol (“IP”) address, device name, operating system version, the configuration of the app when utilizing our Service, the time and date of your use of the Service, and other statistics. </p> <p><strong>Cookies</strong></p> <p>Cookies are files with small amount of data that is commonly used an anonymous unique identifier. These are sent to your browser from the website that you visit and are stored on your device internal memory. </p> <p>This Service does not use these “cookies” explicitly. However, the app may use third party code and libraries that use “cookies” to collection information and to improve their services. You have the option to either accept or refuse these cookies and know when a cookie is being sent to your device. If you choose to refuse our cookies, you may not be able to use some portions of this Service. </p> <p><strong>Service Providers</strong></p> <p> We may employ third-party companies and individuals due to the following reasons:</p> <ul> <li>To facilitate our Service;</li> <li>To provide the Service on our behalf;</li> <li>To perform Service-related services; or</li> <li>To assist us in analyzing how our Service is used.</li> </ul> <p> We want to inform users of this Service that these third parties have access to your Personal Information. The reason is to perform the tasks assigned to them on our behalf. However, they are obligated not to disclose or use the information for any other purpose. </p> <p><strong>Security</strong></p> <p> We value your trust in providing us your Personal Information, thus we are striving to use commercially acceptable means of protecting it. But remember that no method of transmission over the internet, or method of electronic storage is 100% secure and reliable, and we cannot guarantee its absolute security. </p> <p><strong>Links to Other Sites</strong></p> <p>This Service may contain links to other sites. If you click on a third-party link, you will be directed to that site. Note that these external sites are not operated by us. Therefore, we strongly advise you to review the Privacy Policy of these websites. We have no control over and assume no responsibility for the content, privacy policies, or practices of any third-party sites or services. </p> <p><strong>Children’s Privacy</strong></p> <p>These Services do not address anyone under the age of 13. We do not knowingly collect personally identifiable information from children under 13. In the case we discover that a child under 13 has provided us with personal information, we immediately delete this from our servers. If you are a parent or guardian and you are aware that your child has provided us with personal information, please contact us so that we will be able to do necessary actions. </p> <p><strong>Changes to This Privacy Policy</strong></p> <p> We may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes. We will notify you of any changes by posting the new Privacy Policy on this page. These changes are effective immediately after they are posted on this page. </p> <p><strong>Contact Us</strong></p> <p>If you have any questions or suggestions about our Privacy Policy, do not hesitate to contact us. </p> <br> <p>Last Edited on 2019-02-19</p> </body> </html>
angelsubirana/bobzon
_site/privacy.html
HTML
mit
6,094
import * as React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <path d="M2 21.5c0 .28.22.5.49.5h13.02c.27 0 .49-.22.49-.5V20H2v1.5zM15.5 16H11v-2H7v2H2.5c-.28 0-.5.22-.5.5V18h14v-1.5c0-.28-.22-.5-.5-.5zm4.97-.55c.99-1.07 1.53-2.48 1.53-3.94V2h-6v9.47c0 1.48.58 2.92 1.6 4l.4.42V22h4v-2h-2v-4.03l.47-.52zM18 4h2v4h-2V4zm1.03 10.07c-.65-.71-1.03-1.65-1.03-2.6V10h2v1.51c0 .95-.34 1.85-.97 2.56z" /> , 'BrunchDiningOutlined');
callemall/material-ui
packages/material-ui-icons/src/BrunchDiningOutlined.js
JavaScript
mit
477
# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::DataMigration::Mgmt::V2018_07_15_preview module Models # # Results for query analysis comparison between the source and target # class QueryAnalysisValidationResult include MsRestAzure # @return [QueryExecutionResult] List of queries executed and it's # execution results in source and target attr_accessor :query_results # @return [ValidationError] Errors that are part of the execution attr_accessor :validation_errors # # Mapper for QueryAnalysisValidationResult class as Ruby Hash. # This will be used for serialization/deserialization. # def self.mapper() { client_side_validation: true, required: false, serialized_name: 'QueryAnalysisValidationResult', type: { name: 'Composite', class_name: 'QueryAnalysisValidationResult', model_properties: { query_results: { client_side_validation: true, required: false, serialized_name: 'queryResults', type: { name: 'Composite', class_name: 'QueryExecutionResult' } }, validation_errors: { client_side_validation: true, required: false, serialized_name: 'validationErrors', type: { name: 'Composite', class_name: 'ValidationError' } } } } } end end end end
Azure/azure-sdk-for-ruby
management/azure_mgmt_data_migration/lib/2018-07-15-preview/generated/azure_mgmt_data_migration/models/query_analysis_validation_result.rb
Ruby
mit
1,785
import {MdSnackBar} from '@angular/material'; export abstract class CommonCrudService { constructor(private snackBar: MdSnackBar) { } // todo refactor crud operations to here (use metadata?) onOperationPerformedNotify(opName: string): (res: boolean) => void { return (res) => { let text; if (res) { text = `Successful ${opName}!`; } else { text = `Failed to ${opName}!`; } this.snackBar.open(text, null, { duration: 1000 }); }; } }
Ivanbmstu/angular
src/app/modules/shared/editor/common-crud.service.ts
TypeScript
mit
514
--- layout: post author: Christoph Broschinski author_lnk: https://github.com/cbroschinski title: TU Clausthal reports its 2016 and 2017 APC expenditures date: 2018-02-05 08:00:00 summary: categories: [general, openAPC] comments: true --- The [TU Clausthal](http://www.tu-clausthal.de/Welcome.php.en) has updated its APC expenditures. The latest contribution provides data for the 2016 and 2017 periods. The [Library of Clausthal University of Technology](http://www.ub.tu-clausthal.de/en/) is in charge of the [University's Open Access Publishing Fund](http://www.ub.tu-clausthal.de/en/angebote-fuer-wissenschaftlerinnen/elektronisches-publizieren/publikationsfonds/), which is supported by the DFG under its [Open-Access Publishing Programme](http://www.dfg.de/en/research_funding/programmes/infrastructure/lis/funding_opportunities/open_access/). Contact person is [Silke Frank](mailto:[email protected]) ## Cost data The new dataset covers publication fees for 7 articles. Total expenditure amounts to 11 106€ and the average fee is 1 587€. The following table shows the payments the library of Clausthal University of Technology has made to publishers in 2016 and 2017. | | Articles| Fees paid in EURO| Mean Fee paid| |:------------------------------------|--------:|-----------------:|-------------:| |Scientific Research Publishing, Inc, | 2| 921| 461| |Carl Hanser Verlag | 1| 2099| 2099| |Elsevier BV | 1| 1964| 1964| |MDPI AG | 1| 1004| 1004| |Springer Nature | 1| 2618| 2618| |Wiley-Blackwell | 1| 2500| 2500| ## Overview With the recent contribution included, the overall APC data for TU Clausthal now looks as follows: ### Fees paid per publisher (in EURO) ![plot of chunk tree_clausthal_2018_02_05_full](/figure/tree_clausthal_2018_02_05_full-1.png) ### Average costs per year (in EURO) ![plot of chunk box_clausthal_2018_02_05_year_full](/figure/box_clausthal_2018_02_05_year_full-1.png)
OpenAPC/openapc.github.io
_posts/2018-02-05-clausthal.md
Markdown
mit
2,286
package org.vitrivr.cineast.core.util.audio.pitch.tracking; import java.util.LinkedList; import java.util.List; import org.apache.commons.math3.stat.descriptive.SummaryStatistics; import org.vitrivr.cineast.core.util.audio.pitch.Pitch; /** * This is a helper class for pitch tracking. It represents a pitch contour, that is, a candidate for a melody fragment. The contour has a fixed length and each slot in the sequence represents a specific timeframe (e.g. belonging to a FFT bin in the underlying STFT). * <p> * The intention behind this class is the simplification of comparison between different pitch contours, either on a frame-by-frame basis but also as an entity. In addition to the actual pitch information, the pitch contour class also provides access to pitch contour statistics related to salience and pitch frequency. * * @see PitchTracker */ public class PitchContour { /** * The minimum frequency in Hz on the (artifical) cent-scale. */ private static final float CENT_SCALE_MINIMUM = 55.0f; /** * Entity that keeps track of salience related contour statistics. */ private SummaryStatistics salienceStatistics = new SummaryStatistics(); /** * Entity that keeps track of frequency related contour statistics. */ private SummaryStatistics frequencyStatistics = new SummaryStatistics(); /** * Sequence of pitches that form the PitchContour. */ private final List<Pitch> contour = new LinkedList<>(); /** * Indicates that the PitchContour statistics require recalculation. */ private boolean dirty = true; /** * The start frame-index of the pitch-contour. Marks beginning in time. */ private int start; /** * The end frame-index of the pitch-contour. Marks ending in time. */ private int end; /** * Constructor for PitchContour. * * @param start Start-index of the contour. * @param pitch Pitch that belongs to the start-index. */ public PitchContour(int start, Pitch pitch) { this.start = start; this.end = start; this.contour.add(pitch); } /** * Sets the pitch at the given index if the index is within the bounds of the PitchContour. * * @param p Pitch to append. */ public void append(Pitch p) { this.contour.add(p); this.end += 1; this.dirty = true; } /** * Sets the pitch at the given index if the index is within the bounds of the PitchContour. * * @param p Pitch to append. */ public void prepend(Pitch p) { this.contour.add(0, p); this.start -= 1; this.dirty = true; } /** * Returns the pitch at the given index or null, if the index is out of bounds. Note that even if the index is within bounds, the Pitch can still be null. * * @param i Index for which to return a pitch. */ public Pitch getPitch(int i) { if (i >= this.start && i <= this.end) { return this.contour.get(i - this.start); } else { return null; } } /** * Getter for start. * * @return Start frame-index. */ public final int getStart() { return start; } /** * Getter for end. * * @return End frame-index. */ public final int getEnd() { return end; } /** * Size of the pitch-contour. This number also includes empty slots. * * @return Size of the contour. */ public final int size() { return this.contour.size(); } /** * Returns the mean of all pitches in the melody. * * @return Pitch mean */ public final double pitchMean() { if (this.dirty) { this.calculate(); } return this.frequencyStatistics.getMean(); } /** * Returns the standard-deviation of all pitches in the melody. * * @return Pitch standard deviation */ public final double pitchDeviation() { if (this.dirty) { this.calculate(); } return this.frequencyStatistics.getStandardDeviation(); } /** * Returns the mean-salience of all pitches in the contour. * * @return Salience mean */ public final double salienceMean() { if (this.dirty) { this.calculate(); } return this.salienceStatistics.getMean(); } /** * Returns the salience standard deviation of all pitches in the contour. * * @return Salience standard deviation. */ public final double salienceDeviation() { if (this.dirty) { this.calculate(); } return this.salienceStatistics.getStandardDeviation(); } /** * Returns the sum of all salience values in the pitch contour. */ public final double salienceSum() { if (this.dirty) { this.calculate(); } return this.salienceStatistics.getSum(); } /** * Calculates the overlap between the given pitch-contours. * * @return Size of the overlap between two pitch-contours. */ public final int overlap(PitchContour contour) { return Math.max(0, Math.min(this.end, contour.end) - Math.max(this.start, contour.start)); } /** * Determines if two PitchContours overlap and returns true of false. * * @return true, if two PitchContours overlap and falseotherwise. */ public final boolean overlaps(PitchContour contour) { return this.overlap(contour) > 0; } /** * Re-calculates the PitchContour statistics. */ private void calculate() { this.salienceStatistics.clear(); this.frequencyStatistics.clear(); for (Pitch pitch : this.contour) { if (pitch != null) { this.salienceStatistics.addValue(pitch.getSalience()); this.frequencyStatistics.addValue(pitch.distanceCents(CENT_SCALE_MINIMUM)); } } this.dirty = false; } }
vitrivr/cineast
cineast-core/src/main/java/org/vitrivr/cineast/core/util/audio/pitch/tracking/PitchContour.java
Java
mit
5,638
using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Windows; using System.Windows.Markup; // 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("RapidPliant.App.EarleyDebugger")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("RapidPliant.App.EarleyDebugger")] [assembly: AssemblyCopyright("Copyright © 2016")] [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)] //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly:ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, // or application resource dictionaries) ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] // 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")] [assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "RapidPliant.App.EarleyDebugger.Views")]
bilsaboob/RapidPliant
src/app/RapidPliant.App.EarleyDebugger/Properties/AssemblyInfo.cs
C#
mit
2,546
package com.company; import java.util.Scanner; public class EvenPowersOf2 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = Integer.parseInt(scanner.nextLine()); int num = 1; for (int i = 0; i <= n ; i+=2) { System.out.println(num); num *= 4; } } }
ivelin1936/Studing-SoftUni-
Programing Basic/Programming Basics - Exercises/Advanced Loops/src/com/company/EvenPowersOf2.java
Java
mit
368
# -*- 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): # Deleting model 'Participant' db.delete_table(u'pa_participant') # Removing M2M table for field user on 'Participant' db.delete_table('pa_participant_user') # Adding M2M table for field user on 'ReportingPeriod' db.create_table(u'pa_reportingperiod_user', ( ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), ('reportingperiod', models.ForeignKey(orm[u'pa.reportingperiod'], null=False)), ('user', models.ForeignKey(orm[u'pa.user'], null=False)) )) db.create_unique(u'pa_reportingperiod_user', ['reportingperiod_id', 'user_id']) def backwards(self, orm): # Adding model 'Participant' db.create_table(u'pa_participant', ( (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('reporting_period', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['pa.ReportingPeriod'])), )) db.send_create_signal(u'pa', ['Participant']) # Adding M2M table for field user on 'Participant' db.create_table(u'pa_participant_user', ( ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), ('participant', models.ForeignKey(orm[u'pa.participant'], null=False)), ('user', models.ForeignKey(orm[u'pa.user'], null=False)) )) db.create_unique(u'pa_participant_user', ['participant_id', 'user_id']) # Removing M2M table for field user on 'ReportingPeriod' db.delete_table('pa_reportingperiod_user') models = { u'auth.group': { 'Meta': {'object_name': 'Group'}, u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) }, u'auth.permission': { 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) }, 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'pa.activity': { 'Meta': {'object_name': 'Activity'}, 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['pa.Category']"}), 'description': ('django.db.models.fields.CharField', [], {'max_length': '200'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) }, u'pa.activityentry': { 'Meta': {'object_name': 'ActivityEntry'}, 'activity': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['pa.Activity']"}), 'day': ('django.db.models.fields.CharField', [], {'max_length': '10'}), 'hour': ('django.db.models.fields.IntegerField', [], {}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'slot': ('django.db.models.fields.IntegerField', [], {}), 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['pa.User']"}) }, u'pa.category': { 'Meta': {'object_name': 'Category'}, 'description': ('django.db.models.fields.CharField', [], {'max_length': '200'}), 'grouping': ('django.db.models.fields.CharField', [], {'default': "'d'", 'max_length': '15'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'reporting_period': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['pa.ReportingPeriod']"}) }, u'pa.profession': { 'Meta': {'object_name': 'Profession'}, u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '60'}) }, u'pa.reportingperiod': { 'Meta': {'object_name': 'ReportingPeriod'}, 'end_date': ('django.db.models.fields.DateTimeField', [], {}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '120'}), 'slots_per_hour': ('django.db.models.fields.IntegerField', [], {}), 'start_date': ('django.db.models.fields.DateTimeField', [], {}), 'user': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['pa.User']", 'symmetrical': 'False'}) }, u'pa.user': { 'Meta': {'object_name': 'User'}, 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), 'profession': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['pa.Profession']", 'null': 'True', 'blank': 'True'}), 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) } } complete_apps = ['pa']
Mathew/psychoanalysis
psychoanalysis/apps/pa/migrations/0002_auto__del_participant.py
Python
mit
7,476
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>美艺空间手工饰品 2017-03-18-2 - 美艺空间</title> <meta name="description" content="美艺空间手工饰品"> <link rel="shortcut icon" href="/assets/images/favicon.ico"> <link href="https://fonts.googleapis.com/css?family=Fascinate+Inline" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,700" rel="stylesheet"> <link rel="stylesheet" href="/assets/fonts/font-awesome/css/font-awesome.min.css"> <link rel="stylesheet" href="/assets/css/main.css"> </head> <body> <header class="site-header"> <button class="toggle_menu"> <span class="sandwich"> <span class="sw-topper"></span> <span class="sw-bottom"></span> <span class="sw-footer"></span> </span> </button> <nav class="top_menu"> <ul> <li class="main-items"><a href="/">首页</a></li> <li class="main-items"><a href="">建设中</a></li> </ul> </nav> <div class="header-content"> <div class="logo"> <a href="/" class="logo-link">美艺空间</a> </div> </div> </header> <div class="page-wrap"> <main role="main"> <div class="page-container"> <img class="page-img" src=http://imglf0.nosdn.127.net/img/R2s3QnZjM0lqWFRtYUZGNDU2VUlOOURkcGJxc0JzOVh4M1B4bHFoUE5kNUpHTEZKUmdBWmhRPT0.jpg?imageView&thumbnail=1800y1350&type=jpg&quality=96&stripmeta=0&type=jpg alt="美艺空间手工饰品 2017-03-18-2"> <div class="page-content"> <article> <h1 class="page-title">美艺空间手工饰品 2017-03-18-2</h1> <div class="date-byline"><span><i class="fa fa-calendar-o" aria-hidden="true"></i> 2017, Mar 18&nbsp;&nbsp;&nbsp;&nbsp;</span><span><i class="fa fa-pencil-square-o" aria-hidden="true"></i> Xiaomeng</span></div> </article> <!-- <div class="comment"> <button class="show-comments"><i class="fa fa-comments" aria-hidden="true"> Load/Add comments</i></button> <div id="disqus_thread"></div> </div> <script src=/assets/js/vendor/jquery-3.1.1.min.js></script> <script> $(document).ready(function() { $('.show-comments').on('click', function(){ var disqus_shortname = ''; $.ajax({ type: "GET", url: "http://" + disqus_shortname + "mr-brown.disqus.com/embed.js", dataType: "script", cache: true }); $(this).fadeOut(); }); }); </script> --> <div id="disqus_thread" class="article-comments"></div> <script> (function() { var d = document, s = d.createElement('script'); s.src = '//mr-brown.disqus.com/embed.js'; s.setAttribute('data-timestamp', +new Date()); (d.head || d.body).appendChild(s); })(); </script> <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> </div> </div> </main> </div> <footer class="footer"> <div class="footer-social"> <ul class="social-icons"> </ul> <ul class="copyright"> <li>2017 @ 美艺空间</li> </ul> </div> <div class="footer-newsletter"></div> </footer> <!-- Jquery --> <script src="/assets/js/vendor/jquery-3.1.1.min.js"></script> <!-- Main Js --> <script src="/assets/js/main.js"></script> </body> </html>
meiyizone/meiyizone.github.io
_site/2017/03/18/ornament-2.html
HTML
mit
3,610
/************************************************************************ The MIT License(MIT) Copyright(c) 2014 Lingjijian [B-y] [email protected] 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. ************************************************************************/ #ifndef __TUI_UTIL_H__ #define __TUI_UTIL_H__ #include "cocos2d.h" #include "TuiMacros.h" NS_TUI_BEGIN using namespace std; /** * @brief the tool * */ class TuiUtil{ public: /** * @brief use name to create the animation * * @param name * @param delay * @param iLoops Whether loop * @return Animation */ static Animation* createAnimWithName(const char* name,float delay,unsigned int iLoops); /** * @brief use name and Play frames to create the animation * * @param name * @param iNum frame number * @param delay * @param iLoops Whether loop * @return Animation */ static Animation* createAnimWithNameAndNum(const char* name,int iNum, float delay,unsigned int iLoops); /* * @brief replace all string in actual ,such as => replace_all(string("12212"),"12","21") => 22211 * * @param str text * @param old_value * @param new_value * @return string */ static string replace_all_actual(string str, const string& old_value, const string& new_value); /* * @brief replace all string ,such as => replace_all(string("12212"),"12","21") => 21221 * * @param str text * @param old_value * @param new_value * @return string */ static string replace_all(string str, const string& old_value, const string& new_value); /* * @brief split string ,such as => split(string("ff_a"),"_") => ["ff","a"] * * @param str text * @param delim * @return string */ static vector< string > split(const string& s,const string& delim); static vector< string > separateUtf8(const std::string& inStr); static bool isChinese(const std::string& s); protected: private: }; NS_TUI_END #endif
LingJiJian/Tui-x
HelloTuiLua/frameworks/runtime-src/Classes/tui/TuiUtil.h
C
mit
2,905
# Jrails-ui module ActionView module Helpers module JavaScriptHelper def hash_to_jquery(hash) '{'+hash.map { |k,v| [k, case v.class.name when 'String' "'#{v}'" when 'Hash' hash_to_jquery(v) else v.to_s end ].join(':') }.join(',')+'}' end def flash_messages content_tag(:div, :class => "ui-widget flash") do flash.map { |type,message| state = case type when :notice; 'highlight' when :error; 'error' end icon = case type when :notice; 'info' when :error; 'alert' end content_tag(:div, content_tag(:span, "", :class => "ui-icon ui-icon-#{icon}", :style => "float: left; margin-right: 0.3em;")+message, :class => "ui-state-#{state} ui-corner-all #{type}", :style => "margin-top: 5px; padding: 0.7em;") }.join end end def link_to_dialog(*args, &block) div_id = "dialog#{args[1].gsub(/\//,'_')}" dialog = { :modal => true, :draggable => false, :resizable => false, :width => 600 }.merge(args[2][:dialog] || {}) args[2].merge!( :onclick => "$('##{div_id}').dialog(#{hash_to_jquery(dialog)});return false;" ) args[2].delete(:dialog) if block_given? dialog_html = capture(&block) else render_options = args[2][:render] || {} dialog_html = render(render_options) end link_html = link_to(*args)+content_tag(:div, dialog_html, :style => 'display:none;', :id => div_id, :title => args.first) return block_given? ? concat(link_html) : link_html end end end end
jadencarver/jquery_ui
lib/jrails_ui.rb
Ruby
mit
1,890
/* * Copyright (c) 2020 by Stefan Schubert under the MIT License (MIT). * See project LICENSE file for the detailed terms and conditions. */ package de.bluewhale.sabi.webclient.rest.exceptions; import de.bluewhale.sabi.exception.ExceptionCode; import de.bluewhale.sabi.exception.MessageCode; import de.bluewhale.sabi.exception.TankExceptionCodes; /** * MessageCodes that may arise by using the Tank Restservice * * @author schubert */ public enum TankMessageCodes implements MessageCode { NO_SUCH_TANK(TankExceptionCodes.TANK_NOT_FOUND_OR_DOES_NOT_BELONG_TO_USER); // ------------------------------ FIELDS ------------------------------ private TankExceptionCodes exceptionCode; // --------------------------- CONSTRUCTORS --------------------------- TankMessageCodes() { exceptionCode = null; } TankMessageCodes(TankExceptionCodes pExceptionCode) { exceptionCode = pExceptionCode; } // --------------------- GETTER / SETTER METHODS --------------------- @Override public ExceptionCode getExceptionCode() { return exceptionCode; } }
StefanSchubert/sabi
sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/rest/exceptions/TankMessageCodes.java
Java
mit
1,112
package okeanos.data.services.entities; import javax.measure.quantity.Power; import org.jscience.physics.amount.Amount; public interface Price { double getCostAtConsumption(Amount<Power> consumption); }
wolfgang-lausenhammer/Okeanos
okeanos.data/src/main/java/okeanos/data/services/entities/Price.java
Java
mit
207
<?php namespace Shop\MainBundle\Data; use Doctrine\Common\Persistence\ObjectRepository; use Shop\MainBundle\Entity\Settings; /** * Class ShopSettingsResource * @package Shop\MainBundle\Data */ class ShopSettingsResource { /** * @var ObjectRepository */ protected $settingsRepository; /** * @var Settings|null */ protected $settings; function __construct(ObjectRepository $settingsRepository) { $this->settingsRepository = $settingsRepository; } /** * @return null|Settings */ public function getSettings() { if($this->settings === null){ $this->settings = $this->settingsRepository->findOneBy(array()); if (!$this->settings) { $this->settings = new Settings(); } } return $this->settings; } /** * @param $key * @return mixed */ public function get($key){ return $this->getSettings()->offsetGet($key); } }
ja1cap/shop
src/Shop/MainBundle/Data/ShopSettingsResource.php
PHP
mit
1,014
<!DOCTYPE html> <!--[if lt IE 9]><html class="no-js lt-ie9" lang="en" dir="ltr"><![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en" dir="ltr"> <!--<![endif]--> <!-- Usage: /eic/site/ccc-rec.nsf/tpl-eng/template-1col.html?Open&id=3 (optional: ?Open&page=filename.html&id=x) --> <!-- Created: ; Product Code: 536; Server: stratnotes2.ic.gc.ca --> <head> <!-- Title begins / Début du titre --> <title> Bayview Propeller - Complete profile - Canadian Company Capabilities - Industries and Business - Industry Canada </title> <!-- Title ends / Fin du titre --> <!-- Meta-data begins / Début des métadonnées --> <meta charset="utf-8" /> <meta name="dcterms.language" title="ISO639-2" content="eng" /> <meta name="dcterms.title" content="" /> <meta name="description" content="" /> <meta name="dcterms.description" content="" /> <meta name="dcterms.type" content="report, data set" /> <meta name="dcterms.subject" content="businesses, industry" /> <meta name="dcterms.subject" content="businesses, industry" /> <meta name="dcterms.issued" title="W3CDTF" content="" /> <meta name="dcterms.modified" title="W3CDTF" content="" /> <meta name="keywords" content="" /> <meta name="dcterms.creator" content="" /> <meta name="author" content="" /> <meta name="dcterms.created" title="W3CDTF" content="" /> <meta name="dcterms.publisher" content="" /> <meta name="dcterms.audience" title="icaudience" content="" /> <meta name="dcterms.spatial" title="ISO3166-1" content="" /> <meta name="dcterms.spatial" title="gcgeonames" content="" /> <meta name="dcterms.format" content="HTML" /> <meta name="dcterms.identifier" title="ICsiteProduct" content="536" /> <!-- EPI-11240 --> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- MCG-202 --> <meta content="width=device-width,initial-scale=1" name="viewport"> <!-- EPI-11567 --> <meta name = "format-detection" content = "telephone=no"> <!-- EPI-12603 --> <meta name="robots" content="noarchive"> <!-- EPI-11190 - Webtrends --> <script> var startTime = new Date(); startTime = startTime.getTime(); </script> <!--[if gte IE 9 | !IE ]><!--> <link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="icon" type="image/x-icon"> <link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/wet-boew.min.css"> <!--<![endif]--> <link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/theme.min.css"> <!--[if lt IE 9]> <link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="shortcut icon" /> <link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/ie8-wet-boew.min.css" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/ie8-wet-boew.min.js"></script> <![endif]--> <!--[if lte IE 9]> <![endif]--> <noscript><link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/noscript.min.css" /></noscript> <!-- Google Tag Manager DO NOT REMOVE OR MODIFY - NE PAS SUPPRIMER OU MODIFIER --> <script>dataLayer1 = [];</script> <!-- End Google Tag Manager --> <!-- EPI-11235 --> <link rel="stylesheet" href="/eic/home.nsf/css/add_WET_4-0_Canada_Apps.css"> <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> <link href="/app/ccc/srch/css/print.css" media="print" rel="stylesheet" type="text/css" /> </head> <body class="home" vocab="http://schema.org/" typeof="WebPage"> <!-- EPIC HEADER BEGIN --> <!-- Google Tag Manager DO NOT REMOVE OR MODIFY - NE PAS SUPPRIMER OU MODIFIER --> <noscript><iframe title="Google Tag Manager" src="//www.googletagmanager.com/ns.html?id=GTM-TLGQ9K" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer1'?'&l='+l:'';j.async=true;j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer1','GTM-TLGQ9K');</script> <!-- End Google Tag Manager --> <!-- EPI-12801 --> <span typeof="Organization"><meta property="legalName" content="Department_of_Industry"></span> <ul id="wb-tphp"> <li class="wb-slc"> <a class="wb-sl" href="#wb-cont">Skip to main content</a> </li> <li class="wb-slc visible-sm visible-md visible-lg"> <a class="wb-sl" href="#wb-info">Skip to "About this site"</a> </li> </ul> <header role="banner"> <div id="wb-bnr" class="container"> <section id="wb-lng" class="visible-md visible-lg text-right"> <h2 class="wb-inv">Language selection</h2> <div class="row"> <div class="col-md-12"> <ul class="list-inline mrgn-bttm-0"> <li><a href="nvgt.do?V_TOKEN=1492268651023&V_SEARCH.docsCount=3&V_DOCUMENT.docRank=5279&V_SEARCH.docsStart=5278&V_SEARCH.command=navigate&V_SEARCH.resultsJSP=/prfl.do&lang=fra&redirectUrl=/app/scr/imbs/ccc/rgstrtn/rgstr.sec?_flId?_flxKy=e1s1&amp;estblmntNo=234567041301&amp;profileId=61&amp;_evId=bck&amp;lang=eng&amp;V_SEARCH.showStricts=false&amp;prtl=1&amp;_flId?_flId?_flxKy=e1s1" title="Français" lang="fr">Français</a></li> </ul> </div> </div> </section> <div class="row"> <div class="brand col-xs-8 col-sm-9 col-md-6"> <a href="http://www.canada.ca/en/index.html"><object type="image/svg+xml" tabindex="-1" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/sig-blk-en.svg"></object><span class="wb-inv"> Government of Canada</span></a> </div> <section class="wb-mb-links col-xs-4 col-sm-3 visible-sm visible-xs" id="wb-glb-mn"> <h2>Search and menus</h2> <ul class="list-inline text-right chvrn"> <li><a href="#mb-pnl" title="Search and menus" aria-controls="mb-pnl" class="overlay-lnk" role="button"><span class="glyphicon glyphicon-search"><span class="glyphicon glyphicon-th-list"><span class="wb-inv">Search and menus</span></span></span></a></li> </ul> <div id="mb-pnl"></div> </section> <!-- Site Search Removed --> </div> </div> <nav role="navigation" id="wb-sm" class="wb-menu visible-md visible-lg" data-trgt="mb-pnl" data-ajax-fetch="//cdn.canada.ca/gcweb-cdn-dev/sitemenu/sitemenu-en.html" typeof="SiteNavigationElement"> <h2 class="wb-inv">Topics menu</h2> <div class="container nvbar"> <div class="row"> <ul class="list-inline menu"> <li><a href="https://www.canada.ca/en/services/jobs.html">Jobs</a></li> <li><a href="http://www.cic.gc.ca/english/index.asp">Immigration</a></li> <li><a href="https://travel.gc.ca/">Travel</a></li> <li><a href="https://www.canada.ca/en/services/business.html">Business</a></li> <li><a href="https://www.canada.ca/en/services/benefits.html">Benefits</a></li> <li><a href="http://healthycanadians.gc.ca/index-eng.php">Health</a></li> <li><a href="https://www.canada.ca/en/services/taxes.html">Taxes</a></li> <li><a href="https://www.canada.ca/en/services.html">More services</a></li> </ul> </div> </div> </nav> <!-- EPIC BODY BEGIN --> <nav role="navigation" id="wb-bc" class="" property="breadcrumb"> <h2 class="wb-inv">You are here:</h2> <div class="container"> <div class="row"> <ol class="breadcrumb"> <li><a href="/eic/site/icgc.nsf/eng/home" title="Home">Home</a></li> <li><a href="/eic/site/icgc.nsf/eng/h_07063.html" title="Industries and Business">Industries and Business</a></li> <li><a href="/eic/site/ccc-rec.nsf/tpl-eng/../eng/home" >Canadian Company Capabilities</a></li> </ol> </div> </div> </nav> </header> <main id="wb-cont" role="main" property="mainContentOfPage" class="container"> <!-- End Header --> <!-- Begin Body --> <!-- Begin Body Title --> <!-- End Body Title --> <!-- Begin Body Head --> <!-- End Body Head --> <!-- Begin Body Content --> <br> <!-- Complete Profile --> <!-- Company Information above tabbed area--> <input id="showMore" type="hidden" value='more'/> <input id="showLess" type="hidden" value='less'/> <h1 id="wb-cont"> Company profile - Canadian Company Capabilities </h1> <div class="profileInfo hidden-print"> <ul class="list-inline"> <li><a href="cccSrch.do?lang=eng&profileId=&prtl=1&key.hitsPerPage=25&searchPage=%252Fapp%252Fccc%252Fsrch%252FcccBscSrch.do%253Flang%253Deng%2526amp%253Bprtl%253D1%2526amp%253Btagid%253D&V_SEARCH.scopeCategory=CCC.Root&V_SEARCH.depth=1&V_SEARCH.showStricts=false&V_SEARCH.sortSpec=title+asc&amp;rstBtn.x=" class="btn btn-link">New Search</a>&nbsp;|</li> <li><form name="searchForm" method="post" action="/app/ccc/srch/bscSrch.do"> <input type="hidden" name="lang" value="eng" /> <input type="hidden" name="profileId" value="" /> <input type="hidden" name="prtl" value="1" /> <input type="hidden" name="searchPage" value="%2Fapp%2Fccc%2Fsrch%2FcccBscSrch.do%3Flang%3Deng%26amp%3Bprtl%3D1%26amp%3Btagid%3D" /> <input type="hidden" name="V_SEARCH.scopeCategory" value="CCC.Root" /> <input type="hidden" name="V_SEARCH.depth" value="1" /> <input type="hidden" name="V_SEARCH.showStricts" value="false" /> <input id="repeatSearchBtn" class="btn btn-link" type="submit" value="Return to search results" /> </form></li> <li>|&nbsp;<a href="nvgt.do?V_SEARCH.docsStart=5277&amp;V_DOCUMENT.docRank=5278&amp;V_SEARCH.docsCount=3&amp;lang=eng&amp;prtl=1&amp;sbPrtl=&amp;profile=cmpltPrfl&amp;V_TOKEN=1492268658485&amp;V_SEARCH.command=navigate&amp;V_SEARCH.resultsJSP=%2fprfl.do&amp;estblmntNo=234567162180&amp;profileId=&amp;key.newSearchLabel=">Previous Company</a></li> <li>|&nbsp;<a href="nvgt.do?V_SEARCH.docsStart=5279&amp;V_DOCUMENT.docRank=5280&amp;V_SEARCH.docsCount=3&amp;lang=eng&amp;prtl=1&amp;sbPrtl=&amp;profile=cmpltPrfl&amp;V_TOKEN=1492268658485&amp;V_SEARCH.command=navigate&amp;V_SEARCH.resultsJSP=%2fprfl.do&amp;estblmntNo=234567068940&amp;profileId=&amp;key.newSearchLabel=">Next Company</a></li> </ul> </div> <details> <summary>Third-Party Information Liability Disclaimer</summary> <p>Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.</p> </details> <h2> Bayview Propeller Div. of Artanus Inc. </h2> <div class="row"> <div class="col-md-5"> <h2 class="h5 mrgn-bttm-0">Legal Name:</h2> <p>Bayview Propeller Div. of Artanus Inc.</p> <h2 class="h5 mrgn-bttm-0">Operating Name:</h2> <p>Bayview Propeller</p> <h2 class="h5 mrgn-bttm-0">Alternate Name:</h2> <p class="mrgn-bttm-0">Bayview Marina</p> <p class="mrgn-bttm-0">Bayview Propeller</p> <p><a href="mailto:[email protected]" title="[email protected]">[email protected]</a></p> </div> <div class="col-md-4 mrgn-sm-sm"> <h2 class="h5 mrgn-bttm-0">Mailing Address:</h2> <address class="mrgn-bttm-md"> 832 Northey&#39;s Bay Rd<br/> WOODVIEW, Ontario<br/> K0L 3E0 <br/> </address> <h2 class="h5 mrgn-bttm-0">Location Address:</h2> <address class="mrgn-bttm-md"> 832 Northey&#39;s Bay Rd<br/> WOODVIEW, Ontario<br/> K0L 3E0 <br/> </address> <p class="mrgn-bttm-0"><abbr title="Telephone">Tel.</abbr>: (705) 654-4409 </p> <p class="mrgn-bttm-lg"><abbr title="Facsimile">Fax</abbr>: (705) 654-4611</p> </div> <div class="col-md-3 mrgn-tp-md"> </div> </div> <div class="row mrgn-tp-md mrgn-bttm-md"> <div class="col-md-12"> </div> </div> <!-- <div class="wb-tabs ignore-session update-hash wb-eqht-off print-active"> --> <div class="wb-tabs ignore-session"> <div class="tabpanels"> <details id="details-panel1"> <summary> Full profile </summary> <!-- Tab 1 --> <h2 class="wb-invisible"> Full profile </h2> <!-- Contact Information --> <h3 class="page-header"> Contact information </h3> <section class="container-fluid"> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Dennis Johnson </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> <!--if client gender is not null or empty we use gender based job title--> Manager </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Area of Responsibility: </strong> </div> <div class="col-md-7"> Manufacturing/Production/Operations. </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (705) 654-3545 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Facsimile: </strong> </div> <div class="col-md-7"> (705) 654-4611 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> [email protected] </div> </div> </section> <p class="mrgn-tp-lg text-right small hidden-print"> <a href="#wb-cont">top of page</a> </p> <!-- Company Description --> <h3 class="page-header"> Company description </h3> <section class="container-fluid"> <div class="row"> <div class="col-md-5"> <strong> Country of Ownership: </strong> </div> <div class="col-md-7"> Canada &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Year Established: </strong> </div> <div class="col-md-7"> 1964 </div> </div> <div class="row"> <div class="col-md-5"> <strong> Exporting: </strong> </div> <div class="col-md-7"> No &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Industry (NAICS): </strong> </div> <div class="col-md-7"> 336611 - Ship Building and Repairing </div> </div> <div class="row"> <div class="col-md-5"> <strong> Alternate Industries (NAICS): </strong> </div> <div class="col-md-7"> 332999 - All Other Miscellaneous Fabricated Metal Product Manufacturing<br> 417990 - All Other Machinery, Equipment and Supplies Wholesaler-Distributors<br> </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Business Activity: </strong> </div> <div class="col-md-7"> Services &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Number of Employees: </strong> </div> <div class="col-md-7"> 6&nbsp; </div> </div> </section> <!-- Products / Services / Licensing --> <h3 class="page-header"> Product / Service / Licensing </h3> <section class="container-fluid"> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> Propellers<br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-12"> MANUFACTURER OF MARINE PROPELLERS<br> <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> Yacht Service Company <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> Boat Parts and Accessories Distributor <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-12"> Lines Distributed: <br> Arco Electrical Products, Bayview Propeller repair services, <br> Bayview shafts and marine hardward, Buck Algonquin Marine <br> couplings, Federal Propellers, Martec Propellers, Michigan <br> Propellers Strong Seal by Tides Marine.<br> <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> Propeller Repair<br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-12"> Repairs to all types of marine propellers up to ten feet in diameter<br> <br> </div> </div> </section> <p class="mrgn-tp-lg text-right small hidden-print"> <a href="#wb-cont">top of page</a> </p> <!-- Technology Profile --> <!-- Market Profile --> <!-- Sector Information --> <details class="mrgn-tp-md mrgn-bttm-md"> <summary> Third-Party Information Liability Disclaimer </summary> <p> Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements. </p> </details> </details> <details id="details-panel2"> <summary> Contacts </summary> <h2 class="wb-invisible"> Contact information </h2> <!-- Contact Information --> <section class="container-fluid"> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Dennis Johnson </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> <!--if client gender is not null or empty we use gender based job title--> Manager </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Area of Responsibility: </strong> </div> <div class="col-md-7"> Manufacturing/Production/Operations. </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (705) 654-3545 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Facsimile: </strong> </div> <div class="col-md-7"> (705) 654-4611 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> [email protected] </div> </div> </section> </details> <details id="details-panel3"> <summary> Description </summary> <h2 class="wb-invisible"> Company description </h2> <section class="container-fluid"> <div class="row"> <div class="col-md-5"> <strong> Country of Ownership: </strong> </div> <div class="col-md-7"> Canada &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Year Established: </strong> </div> <div class="col-md-7"> 1964 </div> </div> <div class="row"> <div class="col-md-5"> <strong> Exporting: </strong> </div> <div class="col-md-7"> No &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Industry (NAICS): </strong> </div> <div class="col-md-7"> 336611 - Ship Building and Repairing </div> </div> <div class="row"> <div class="col-md-5"> <strong> Alternate Industries (NAICS): </strong> </div> <div class="col-md-7"> 332999 - All Other Miscellaneous Fabricated Metal Product Manufacturing<br> 417990 - All Other Machinery, Equipment and Supplies Wholesaler-Distributors<br> </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Business Activity: </strong> </div> <div class="col-md-7"> Services &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Number of Employees: </strong> </div> <div class="col-md-7"> 6&nbsp; </div> </div> </section> </details> <details id="details-panel4"> <summary> Products, services and licensing </summary> <h2 class="wb-invisible"> Product / Service / Licensing </h2> <section class="container-fluid"> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Product Name: </strong> </div> <div class="col-md-9"> Propellers<br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-12"> MANUFACTURER OF MARINE PROPELLERS<br> <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> Yacht Service Company <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> Boat Parts and Accessories Distributor <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-12"> Lines Distributed: <br> Arco Electrical Products, Bayview Propeller repair services, <br> Bayview shafts and marine hardward, Buck Algonquin Marine <br> couplings, Federal Propellers, Martec Propellers, Michigan <br> Propellers Strong Seal by Tides Marine.<br> <br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> Propeller Repair<br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-12"> Repairs to all types of marine propellers up to ten feet in diameter<br> <br> </div> </div> </section> </details> </div> </div> <div class="row"> <div class="col-md-12 text-right"> Last Update Date 2014-11-26 </div> </div> <!-- - Artifact ID: CBW - IMBS - CCC Search WAR - Group ID: ca.gc.ic.strategis.imbs.ccc.search - Version: 3.26 - Built-By: bamboo - Build Timestamp: 2017-03-02T21:29:28Z --> <!-- End Body Content --> <!-- Begin Body Foot --> <!-- End Body Foot --> <!-- END MAIN TABLE --> <!-- End body --> <!-- Begin footer --> <div class="row pagedetails"> <div class="col-sm-5 col-xs-12 datemod"> <dl id="wb-dtmd"> <dt class=" hidden-print">Date Modified:</dt> <dd class=" hidden-print"> <span><time>2017-03-02</time></span> </dd> </dl> </div> <div class="clear visible-xs"></div> <div class="col-sm-4 col-xs-6"> </div> <div class="col-sm-3 col-xs-6 text-right"> </div> <div class="clear visible-xs"></div> </div> </main> <footer role="contentinfo" id="wb-info"> <nav role="navigation" class="container wb-navcurr"> <h2 class="wb-inv">About government</h2> <!-- EPIC FOOTER BEGIN --> <!-- EPI-11638 Contact us --> <ul class="list-unstyled colcount-sm-2 colcount-md-3"> <li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07026.html#pageid=E048-H00000&amp;from=Industries">Contact us</a></li> <li><a href="https://www.canada.ca/en/government/dept.html">Departments and agencies</a></li> <li><a href="https://www.canada.ca/en/government/publicservice.html">Public service and military</a></li> <li><a href="https://www.canada.ca/en/news.html">News</a></li> <li><a href="https://www.canada.ca/en/government/system/laws.html">Treaties, laws and regulations</a></li> <li><a href="https://www.canada.ca/en/transparency/reporting.html">Government-wide reporting</a></li> <li><a href="http://pm.gc.ca/eng">Prime Minister</a></li> <li><a href="https://www.canada.ca/en/government/system.html">How government works</a></li> <li><a href="http://open.canada.ca/en/">Open government</a></li> </ul> </nav> <div class="brand"> <div class="container"> <div class="row"> <nav class="col-md-10 ftr-urlt-lnk"> <h2 class="wb-inv">About this site</h2> <ul> <li><a href="https://www.canada.ca/en/social.html">Social media</a></li> <li><a href="https://www.canada.ca/en/mobile.html">Mobile applications</a></li> <li><a href="http://www1.canada.ca/en/newsite.html">About Canada.ca</a></li> <li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07033.html">Terms and conditions</a></li> <li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07033.html#p1">Privacy</a></li> </ul> </nav> <div class="col-xs-6 visible-sm visible-xs tofpg"> <a href="#wb-cont">Top of Page <span class="glyphicon glyphicon-chevron-up"></span></a> </div> <div class="col-xs-6 col-md-2 text-right"> <object type="image/svg+xml" tabindex="-1" role="img" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/wmms-blk.svg" aria-label="Symbol of the Government of Canada"></object> </div> </div> </div> </div> </footer> <!--[if gte IE 9 | !IE ]><!--> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/wet-boew.min.js"></script> <!--<![endif]--> <!--[if lt IE 9]> <script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/ie8-wet-boew2.min.js"></script> <![endif]--> <script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/theme.min.js"></script> <!-- EPI-10519 --> <span class="wb-sessto" data-wb-sessto='{"inactivity": 1800000, "reactionTime": 180000, "sessionalive": 1800000, "logouturl": "/app/ccc/srch/cccSrch.do?lang=eng&prtl=1"}'></span> <script src="/eic/home.nsf/js/jQuery.externalOpensInNewWindow.js"></script> <!-- EPI-11190 - Webtrends --> <script src="/eic/home.nsf/js/webtrends.js"></script> <script>var endTime = new Date();</script> <noscript> <div><img alt="" id="DCSIMG" width="1" height="1" src="//wt-sdc.ic.gc.ca/dcs6v67hwe0ei7wsv8g9fv50d_3k6i/njs.gif?dcsuri=/nojavascript&amp;WT.js=No&amp;WT.tv=9.4.0&amp;dcssip=www.ic.gc.ca"/></div> </noscript> <!-- /Webtrends --> <!-- JS deps --> <script src="/eic/home.nsf/js/jquery.imagesloaded.js"></script> <!-- EPI-11262 - Util JS --> <script src="/eic/home.nsf/js/_WET_4-0_utils_canada.min.js"></script> <!-- EPI-11383 --> <script src="/eic/home.nsf/js/jQuery.icValidationErrors.js"></script> <span style="display:none;" id='app-info' data-project-groupid='' data-project-artifactid='' data-project-version='' data-project-build-timestamp='' data-issue-tracking='' data-scm-sha1='' data-scm-sha1-abbrev='' data-scm-branch='' data-scm-commit-date=''></span> </body></html> <!-- End Footer --> <!-- - Artifact ID: CBW - IMBS - CCC Search WAR - Group ID: ca.gc.ic.strategis.imbs.ccc.search - Version: 3.26 - Built-By: bamboo - Build Timestamp: 2017-03-02T21:29:28Z -->
GoC-Spending/data-corporations
html/234567005072.html
HTML
mit
46,888
var builder = require("botbuilder"); var botbuilder_azure = require("botbuilder-azure"); const notUtils = require('./notifications-utils.js'); module.exports = [ function (session) { session.beginDialog('notifications-common-symbol'); }, function (session, results) { var pair = results.response; session.dialogData.symbol = pair; builder.Prompts.number(session, 'How big should the interval be?'); }, function (session, results) { session.dialogData.interval = results.response; builder.Prompts.text(session, "What name would you like to give to this notification?"); }, function (session, results) { var sub = notUtils.getBaseNotification('interval', session.message.address); sub.symbol = session.dialogData.symbol; sub.interval = session.dialogData.interval; sub.previousprice = 0; sub.isfirstun = true; sub.name = results.response; notUtils.createNotification(sub).then((r) => { session.endDialog('Notification created!'); }).catch((e) => { session.endDialog('Couldn\'t create notification: ' + e); }); } ];
jantielens/CryptoBuddy
messages/dialogs/notifications-add-interval.js
JavaScript
mit
1,193
#ifndef _PSW_H_INCLUDED_ #define _PSW_H_INCLUDED_ /* * (補足) プロセッサステータスレジスタ(PSW): * -------+----------+---------------------------------------- * b16 | I | 割り込み許可ビット(0:禁止/1:許可) * b17 | U | スタックポインタ指定ビット(0:ISP/1:USP) * b20 | PM | プロセッサモード設定ビット(0:S/1:U) * b27-24 | IPL[3:0] | プロセッサ割り込み優先レベル(0(最低)-15(最高) * -------+----------+---------------------------------------- */ #define PSW_I_DISABLE 0x00000000 #define PSW_I_ENABLE 0x00010000 #define PSW_U_ISP 0x00000000 #define PSW_U_USP 0x00020000 #define PSW_PM_SUPER 0x00000000 #define PSW_PM_USER 0x00100000 #define PSW_IPL_MIN 0x00000000 #define PSW_IPL_MAX 0x0f000000 #endif /* _PSW_H_INCLUDED_ */
extsui/extkernel
include/hwlib/psw.h
C
mit
846
/* Copyright c1997-2014 Trygve Isaacson. All rights reserved. This file is part of the Code Vault version 4.1 http://www.bombaydigital.com/ License: MIT. See LICENSE.md in the Vault top level directory. */ #ifndef vinstant_h #define vinstant_h /** @file */ #include "vtypes.h" #include "vstring.h" class VCodePoint; class VInstant; class VDate; class VTimeOfDay; class VDateAndTime; class VInstantFormatter; /** A VDuration is a length of time. It is most useful in conjunction with VInstant as the proper type to use when adding or subtracting an amount of time to a VInstant, or when subtracting two VInstants to find out the length of time between them. Several constant values are defined, and by applying the multiplication operator, you can create your own values describing particular lengths of time. For example, to declare a constant for the duration of 1.5 hours, you could do any of the following: <code> VDuration d1 = 90 * VDuration::MINUTE(); VDuration d2 = VDuration::HOUR() + (30 * VDuration::MINUTE()); assert(d1 == d2); </code> To get a VInstant describing a point in time 15 minutes in the future, you could do the following: <code> VInstant x; // constructs to the current time x += (15 * VDuration::MINUTE()); </code> The only unusual behavior within VDuration is the existence of the UNSPECIFIED duration constant. This is provided for cases where, due to backward compatibility, you need to initialize a duration to a special value that a normal value will never equal. It's a much better practice to let durations initialize to ZERO by default. Some behavior is not meaningful if you perform operations on an UNSPECIFIED duration. You should only test them for equality. Negative durations are perfectly OK. They behave just as you'd expect; for example, if you subtract a later VInstant from an earlier VInstant, the resulting VDuration will be negative. The NEGATIVE_INFINITY and POSITIVE_INFINITY constants are provided primarily so that the VInstant math operations can provide reasonable results when the instant values are INFINITE_PAST or INFINITE_FUTURE. In addition, VDuration's own math operations provide logical results when using these infinity values. Strict Weak Ordering: Sorting functions require a strict weak ordering to be defined. This is implemented by the comparision operators. It is defined as follows: NEGATIVE_INFINITY < negative durations < ZERO < positive durations < POSITIVE_INFINITY < UNSPECIFIED */ class VDuration { public: static const VDuration& ZERO(); ///< Duration constant of zero milliseconds. static const VDuration& MILLISECOND(); ///< Duration constant of 1 millisecond. static const VDuration& SECOND(); ///< Duration constant of 1 second (1000 milliseconds). static const VDuration& MINUTE(); ///< Duration constant of 1 minute (60 seconds). static const VDuration& HOUR(); ///< Duration constant of 1 hour (60 minutes). static const VDuration& DAY(); ///< Duration constant of 1 day (24 hours). static const VDuration& UNSPECIFIED(); ///< Special duration constant that is unequal to any other duration value. static const VDuration& NEGATIVE_INFINITY(); ///< Special duration constant that is "less than" all specific durations. static const VDuration& POSITIVE_INFINITY(); ///< Special duration constant that is "greater than" all specific durations. /** Constructs a duration equal to ZERO, or zero milliseconds. */ VDuration() : mDurationMilliseconds(0) {} /** Copy constructor. @param d a duration to copy. */ VDuration(const VDuration& d) : mDurationMilliseconds(d.mDurationMilliseconds) {} /** Constructs a duration that is the difference from the specified instant to now. @param sinceWhen the start time to measure from */ VDuration(const VInstant& sinceWhen); /** Non-virtual destructor. This class is not intended to be subclassed. */ ~VDuration() {} /** Rather than have a constructor that takes a string, and risk unintended overloading, we define a static helper if you want to construct a VDuration from a duration string. It uses setDurationString internally to do the work. @see setDurationString @param s the string indicating the duration @return the VDuration */ static VDuration createFromDurationString(const VString& s); /** Assignment operator. @param d a duration to assign from */ VDuration& operator=(const VDuration& d) { if (this != &d) mDurationMilliseconds = d.getDurationMilliseconds(); return *this; } /** Increment operator. @param forwardOffset a duration to add */ VDuration& operator+=(const VDuration& forwardOffset); /** Decrement operator. @param backwardOffset a duration to subtract */ VDuration& operator-=(const VDuration& backwardOffset); /** In-place multiplication operator. @param multiplier a number to multiply the duration by */ VDuration& operator*=(Vs64 multiplier); /** In-place division operator. @param divisor a number to divide the duration by @throws does nothing if the divisor is zero */ VDuration& operator/=(int divisor); /** In-place modulo operator. @param divisor a duration to modulo the duration by @throws does nothing if the divisor is zero or not specific */ VDuration& operator%=(const VDuration& divisor); /** Unary negation operator. @return the negative of this duration */ VDuration operator-() const; /** Returns the duration in milliseconds. @return obvious */ Vs64 getDurationMilliseconds() const { return mDurationMilliseconds; } /** Returns the duration in whole seconds, using simple truncating division of milliseconds. @return obvious */ int getDurationSeconds() const { return static_cast<int>(mDurationMilliseconds / kMillisecondsPerSecond); } /** Returns the duration in whole minutes, using simple truncating division of milliseconds. @return obvious */ int getDurationMinutes() const { return static_cast<int>(mDurationMilliseconds / kMillisecondsPerMinute); } /** Returns the duration in whole hours, using simple truncating division of milliseconds. @return obvious */ int getDurationHours() const { return static_cast<int>(mDurationMilliseconds / kMillisecondsPerHour); } /** Returns the duration in whole days, using simple truncating division of milliseconds. @return obvious */ int getDurationDays() const { return static_cast<int>(mDurationMilliseconds / kMillisecondsPerDay); } /** Returns a string formatted as in the simplest integer+suffix possible as described in setDurationString() docs below. @return obvious */ VString getDurationString() const; /** Returns a string formatted as s.uuu, the number of seconds and milliseconds. @return obvious */ VString getDurationStringFractionalSeconds() const; /** Sets the duration in milliseconds. @param durationMilliseconds the duration to set, in milliseconds */ void setDurationMilliseconds(Vs64 durationMilliseconds) { mDurationMilliseconds = durationMilliseconds; } /** Sets the duration in seconds. @param durationSeconds the duration to set, in seconds */ void setDurationSeconds(int durationSeconds) { mDurationMilliseconds = kMillisecondsPerSecond * static_cast<Vs64>(durationSeconds); } /** Sets the duration in minutes. @param durationMinutes the duration to set, in minutes */ void setDurationMinutes(int durationMinutes) { mDurationMilliseconds = kMillisecondsPerMinute * static_cast<Vs64>(durationMinutes); } /** Sets the duration in hours. @param durationHours the duration to set, in hours */ void setDurationHours(int durationHours) { mDurationMilliseconds = kMillisecondsPerHour * static_cast<Vs64>(durationHours); } /** Sets the duration in 24-hour days (no DST calculations are done). @param durationDays the duration to set, in 24-hour days */ void setDurationDays(int durationDays) { mDurationMilliseconds = kMillisecondsPerDay * static_cast<Vs64>(durationDays); } /** Sets the duration via a simple human-readable format that indicates value and magnitude. Please note that because this requires string parsing, it is less efficient than using VDuration constants and multiplication. If present, the suffix of s must be one of: ms | s | m | h | d The prefix is an integer (leading minus sign allowed). If the suffix is omitted the string must be in the form s.mmm just like what getDurationString() returns. This is to allow get/set symmetry. Whitespace between the prefix and suffix is allowed but not preferred. Here are examples with each allowed suffix and the (obvious) meaning: 27ms 23472ms (meaning 23.472 seconds) 5s 107s (meaning 1 minute 47 seconds) 8m 152m (meaning 2 hours 32 minutes) 3h 7d 5.273 (meaning 5.273 seconds) The prefix value is simply multiplied out to get the raw number of milliseconds to store in the object. No calendar-like operations are done, which is why "weeks", "months", etc. are not supported. For symmetry of getDurationString/setDurationString, the following strings are used for the special durations. (They are case-insensitive on input, and written as upper case on output.) "INFINITY" <-> VDuration::POSITIVE_INFINITY() "-INFINITY" <-> VDuration::NEGATIVE_INFINITY() "UNSPECIFIED" <-> VDuration::UNSPECIFIED() @param s the string indicating the duration @throws VRangeException if the string is malformed */ void setDurationString(const VString& s); friend inline bool operator==(const VDuration& lhs, const VDuration& rhs); ///< Compares durations for equality in milliseconds using ==. friend inline bool operator!=(const VDuration& lhs, const VDuration& rhs); ///< Compares durations for equality in milliseconds using !=. friend inline bool operator< (const VDuration& lhs, const VDuration& rhs); ///< Compares durations for equality in milliseconds using <. friend inline bool operator<=(const VDuration& lhs, const VDuration& rhs); ///< Compares durations for equality in milliseconds using <=. friend inline bool operator>=(const VDuration& lhs, const VDuration& rhs); ///< Compares durations for equality in milliseconds using >=. friend inline bool operator> (const VDuration& lhs, const VDuration& rhs); ///< Compares durations for equality in milliseconds using >. friend inline VDuration operator+(const VDuration& d1, const VDuration& d2);///< Adds d1 + d2 and returns their total duration. friend inline VDuration operator-(const VDuration& d1, const VDuration& d2);///< Subtracts d2 from d1 and returns the difference in duration. friend inline VDuration operator*(Vs64 multiplier, const VDuration& d1); ///< Multiplies d1 by a number and returns the resulting duration; uses Vs64 for VInstant delta compatibility. friend inline VDuration operator*(const VDuration& d1, Vs64 multiplier); ///< Multiplies d1 by a number and returns the resulting duration; uses Vs64 for VInstant delta compatibility. friend VDuration operator/(const VDuration& d, int divisor); ///< Divides d1 by a number and returns the resulting duration. @throws VException if the divisor is zero friend VDuration operator%(const VDuration& d, const VDuration& divisor); ///< Returns d modulo the divisor. Does nothing if the divisor is zero or not specific. static inline VDuration min(const VDuration& d1, const VDuration& d2); ///< Returns a duration that is the lesser of d1 and d2. static inline VDuration max(const VDuration& d1, const VDuration& d2); ///< Returns a duration that is the greater of d1 and d2. static inline VDuration abs(const VDuration& d); ///< Returns a duration that is equal to d if d is > ZERO, and -d if d is < ZERO. /** Returns true if the duration can be legitimately compared using comparison operators such as <, <=, >, >=. This is the case for specific durations as well as the infinite durations. It is not the case for unspecified durations. */ bool isComparable() const { return (*this != VDuration::UNSPECIFIED()); } /** Returns true if the duration has a specific value (not infinite) and therefore its internal duration value can be tested and used in simple math calculations. */ bool isSpecific() const { return (*this != VDuration::UNSPECIFIED()) && (*this != VDuration::NEGATIVE_INFINITY()) && (*this != VDuration::POSITIVE_INFINITY()); } /** Returns true if d1 and d2 can be compared using simple value comparison. In other words, both d1 and d2 have specific values. It's false if either one is not specific. */ static bool areValuesSpecific(const VDuration& d1, const VDuration& d2) { return d1.isSpecific() && d2.isSpecific(); } private: // These are called by the friend inline comparison operators for comparing non-simple durations. static VDuration _complexAdd(const VDuration& d1, const VDuration& d2); static VDuration _complexSubtract(const VDuration& d1, const VDuration& d2); static VDuration _complexMultiply(const VDuration& d, Vs64 multiplier); static VDuration _complexMin(const VDuration& d1, const VDuration& d2); static VDuration _complexMax(const VDuration& d1, const VDuration& d2); static VDuration _complexAbs(const VDuration& d); // This is the private constructor used internally. explicit VDuration(Vs64 durationMilliseconds) : mDurationMilliseconds(durationMilliseconds) {} Vs64 mDurationMilliseconds; ///< The duration in milliseconds. The values for UNSPECIFIED, NEGATIVE_INFINITY, and POSITIVE_INFINITY are special. // These are used internally for conversion. static const Vs64 kMillisecondsPerSecond = CONST_S64(1000); static const Vs64 kMillisecondsPerMinute = CONST_S64(60000); static const Vs64 kMillisecondsPerHour = CONST_S64(3600000); static const Vs64 kMillisecondsPerDay = CONST_S64(86400000); }; // Inline implementations of some of the above VDuration operators. // For non-specific values, some operators need to call more complicated functions to provide // sensible values. inline bool operator==(const VDuration& lhs, const VDuration& rhs) { return lhs.mDurationMilliseconds == rhs.mDurationMilliseconds; } inline bool operator!=(const VDuration& lhs, const VDuration& rhs) { return !operator==(lhs, rhs); } inline bool operator< (const VDuration& lhs, const VDuration& rhs) { return lhs.mDurationMilliseconds < rhs.mDurationMilliseconds; } inline bool operator<=(const VDuration& lhs, const VDuration& rhs) { return !operator>(lhs, rhs); } inline bool operator>=(const VDuration& lhs, const VDuration& rhs) { return !operator<(lhs, rhs); } inline bool operator> (const VDuration& lhs, const VDuration& rhs) { return operator<(rhs, lhs); } inline VDuration operator+(const VDuration& d1, const VDuration& d2) { if (VDuration::areValuesSpecific(d1, d2)) return VDuration(d1.mDurationMilliseconds + d2.mDurationMilliseconds); else return VDuration::_complexAdd(d1, d2); } inline VDuration operator-(const VDuration& d1, const VDuration& d2) { if (VDuration::areValuesSpecific(d1, d2)) return VDuration(d1.mDurationMilliseconds - d2.mDurationMilliseconds); else return VDuration::_complexSubtract(d1, d2); } inline VDuration operator*(Vs64 multiplier, const VDuration& d) { if (d.isSpecific()) return VDuration(d.mDurationMilliseconds * multiplier); else return VDuration::_complexMultiply(d, multiplier); } inline VDuration operator*(const VDuration& d, Vs64 multiplier) { if (d.isSpecific()) return VDuration(d.mDurationMilliseconds * multiplier); else return VDuration::_complexMultiply(d, multiplier); } inline VDuration VDuration::min(const VDuration& d1, const VDuration& d2) { if (VDuration::areValuesSpecific(d1, d2)) return (d1 < d2) ? d1 : d2; else return VDuration::_complexMin(d1, d2); } inline VDuration VDuration::max(const VDuration& d1, const VDuration& d2) { if (VDuration::areValuesSpecific(d1, d2)) return (d1 > d2) ? d1 : d2; else return VDuration::_complexMax(d1, d2); } inline VDuration VDuration::abs(const VDuration& d) { if (d.isSpecific()) return (d.mDurationMilliseconds < CONST_S64(0)) ? -d : d; else return VDuration::_complexAbs(d); } /** VDurationVector is simply a vector of VDuration objects. Note that the vector elements are objects, not pointers to objects. */ typedef std::vector<VDuration> VDurationVector; /** This structure is passed to or returned by the core functions to describe a calendar structured instant in some implied time zone. */ class VInstantStruct { public: VInstantStruct() : mYear(0), mMonth(1), mDay(1), mHour(0), mMinute(0), mSecond(0), mMillisecond(0), mDayOfWeek(0) {} VInstantStruct(const VDate& date, const VTimeOfDay& timeOfDay); /** Returns the UTC Epoch Offset of this Time Struct, treating the Time Struct as an instant in the UTC time zone. The mDayOfWeek field is ignored. @return the UTC Epoch Offset of this UTC time struct */ Vs64 getOffsetFromUTCStruct() const; /** Returns the UTC Epoch Offset of this Time Struct, treating the Time Struct as an instant in the machine's local time zone. The mDayOfWeek field is ignored. @return the UTC Epoch Offset of this local time struct */ Vs64 getOffsetFromLocalStruct() const; /** Fills in a Time Struct to represent the specified UTC Epoch Offset in the UTC time zone. @param offset a UTC Epoch Offset */ void setUTCStructFromOffset(Vs64 offset); /** Fills in this Time Struct to represent the specified UTC Epoch Offset in the machine's local time zone. @param offset a UTC Epoch Offset */ void setLocalStructFromOffset(Vs64 offset); /** Copies this Time Struct into a "struct tm" POSIX structure. @param fields the tm struct to initialize */ void getTmStruct(struct tm& fields) const; /** Sets up this Time Struct from a "struct tm" POSIX structure. @param fields the tm struct to copy @param millisecond the ms value to use, since tm only has second resolution; normally zero except for some conversions */ void setFromTmStruct(const struct tm& fields, int millisecond); int mYear; ///< The year. int mMonth; ///< The month (1 to 12). int mDay; ///< The day of the month (1 to 31). int mHour; ///< The hour of day (0 to 23). int mMinute; ///< The minute of the hour (0 to 59). int mSecond; ///< The second of the minute (0 to 59). int mMillisecond; ///< The millisecond within the second (0 to 999). int mDayOfWeek; ///< See enum in VInstant: kSunday=0..kSaturday=6. private: // These are the 3 platform-defined helper functions for converting between // offsets and UTC or local broken-down time struct. There isn't one for // "from UTC struct" because it is not per-platform; if timegm is available // we call it, otherwise we implement it directly. /** Returns the UTC Epoch Offset of the specified Time Struct, treating the Time Struct as an instant in the machine's local time zone. The mDayOfWeek field is ignored. @return the UTC Epoch Offset of the specified local time struct */ static Vs64 _platform_offsetFromLocalStruct(const VInstantStruct& when); /** Fills in a Time Struct to represent the specified UTC Epoch Offset in the machine's local time zone. @param offset a UTC Epoch Offset @param when the Time Struct to fill in with the local time zone representation of the offset */ static void _platform_offsetToLocalStruct(Vs64 offset, VInstantStruct& when); /** Fills in a Time Struct to represent the specified UTC Epoch Offset in the UTC time zone. @param offset a UTC Epoch Offset @param when the Time Struct to fill in with the UTC time zone representation of the offset */ static void _platform_offsetToUTCStruct(Vs64 offset, VInstantStruct& when); /** Provides a robust interface to localtime without the thread safety pitfalls, using the re-entrant version if available. Throws an exception if the date specified is out of range for the platform's time implementation. (Specifically, Win32 does not support dates prior to 1970!) The result structure contains the broken-down time corresponding to the supplied offset, in local time. @param epochOffset number of seconds since 1/1/1970 UTC @param resultStorage pointer to tm struct to be filled out in local time */ static void _threadsafe_localtime(const time_t epochOffset, struct tm* resultStorage); /** Provides a robust interface to gmtime without the thread safety pitfalls, using the re-entrant version if available. Throws an exception if the date specified is out of range for the platform's time implementation. (Specifically, Win32 does not support dates prior to 1970!) The result structure contains the broken-down time corresponding to the supplied offset, in GMT time. @param epochOffset number of seconds since 1/1/1970 UTC @param resultStorage pointer to tm struct to be filled out in GMT time */ static void _threadsafe_gmtime(const time_t epochOffset, struct tm* resultStorage); }; /** You can provide a callback interface for VInstant to allow for converting to and from "remote time zones" (RTZ). Currently the built-in code of VInstant (using OS-provided functions) can only convert between UTC and the local time zone. To implement remote time zone conversion, implement this interface, and call VInstant::setRemoteTimeZoneConverter(). Then you can pass RTZ specifiers to the VInstant APIs that allow them, and VInstant will call back to the installed RTZ converter interface. */ class IVRemoteTimeZoneConverter { public: /** Converts an offset (ms from 1970 UTC, same as VInstant "value") to a broken-down calendar time in the specified time zone. This function should throw a VException if the time zone ID is invalid. @param offset a number milliseconds since UTC 1970 00:00:00.000 @param timeZoneID a time zone ID string (e.g., PST, EST, etc.) from the set of strings supported by the converter @param when a structure that will be filled to contain the y/m/d/h/m/s for the specified UTC offset as seen in the specified time zone */ virtual void offsetToRTZStruct(Vs64 offset, const VString& timeZoneID, VInstantStruct& when) = 0; /** Converts a broken-down calendar time, interpreted in the specified time zone, to an offset (ms from 1970 UTC, same as VInstant "value"). This function should throw a VException if the time zone ID is invalid. @param timeZoneID a time zone ID string (e.g., PST, EST, etc.) from the set of strings supported by the converter @param when a structure containing y/m/d/h/m/s values in the specified time zone @return the number milliseconds since UTC 1970 00:00:00.000 that the time represents as interpreted in the specified time zone */ virtual Vs64 offsetFromRTZStruct(const VString& timeZoneID, const VInstantStruct& when) = 0; protected: IVRemoteTimeZoneConverter() {} virtual ~IVRemoteTimeZoneConverter() {} }; /** A VInstant is an object that represents an instant in time regardless of the location (and time zone) of where code is running. A key purpose of VInstant is to abstract the OS time-related APIs while retaining the ability to easily compare two instants that originated in code running in different time zones--internally, the value is stored in UTC time. You can create a VInstant to represent the current instant in time, and you can convert to and from string representations in UTC or the current locale. A VInstant can also be created to represent instants infinitely far in the past or future, to indicate events that have not yet happened or should never happen. */ class VInstant { public: /** Constant VInstant representing the kInfinitePast value. */ static const VInstant& INFINITE_PAST(); /** Constant VInstant representing the kInfiniteFuture value. */ static const VInstant& INFINITE_FUTURE(); /** Constant VInstant representing the kNeverOccurred value. */ static const VInstant& NEVER_OCCURRED(); /** Constant for use with functions that take a timeZoneID parameter, indicating the time conversion is for UTC. */ static const VString& UTC_TIME_ZONE_ID(); /** Constant for use with functions that take a timeZoneID parameter, indicating the time conversion is for the local time zone. */ static const VString& LOCAL_TIME_ZONE_ID(); /** Returns an instant created from a raw 64-bit millisecond UTC epoch offset, of the same form as is returned by getValue() and can be passed to setValue(). @param value the time value in ms since UTC 1970 00:00:00.000 (negative values represent earlier instants in time) @return an instant representing the specified time */ static VInstant instantFromRawValue(Vs64 value) { return VInstant(value); } /** Returns an instant created from a POSIX time_t value, which is defined as the number of seconds since UTC 1970 00:00:00.000. @param value the POSIX time value (seconds since UTC 1970 00:00:00.000) (negative values represent earlier instants in time) @return an instant representing the specified time */ static VInstant instantFromPosixTime(time_t value) { return VInstant(CONST_S64(1000) * static_cast<Vs64>(value)); } /** Creates an instant to represent the current time. */ VInstant(); /** Creates an instant by copying an existing instant. */ VInstant(const VInstant& i) : mValue(i.mValue) {} /** Destructor. */ ~VInstant() {} /** Copy constructor. @param i the instant to copy */ VInstant& operator=(const VInstant& i); /** Increments (or decrements) the instant in time from its current value by the specified VDuration if the kind is kActualValue. If the kind is not kActualValue, this function has no effect. @param forwardOffsetDuration the duration offset in milliseconds to apply; positive values move the instant forward in time; negative values move it backward */ VInstant& operator+=(const VDuration& forwardOffsetDuration); /** Decrements (or increments) the instant in time from its current value by the specified VDuration if the kind is kActualValue. If the kind is not kActualValue, this function has no effect. @param backwardOffsetDuration the offset in milliseconds to apply; positive values move the instant backward in time; negative values move it forward */ VInstant& operator-=(const VDuration& backwardOffsetDuration); /** Sets the instant to the current time. The time is affected by any simulated or frozen time state that has been set. */ void setNow(); /** Sets the instant to the actual current time not offset by simulation or frozen time. */ void setTrueNow(); /** Returns an object holding the broken-down fields that this instant represents in UTC. This is primarily for use by VInstantFormatter when formatting a string. @return the UTC y/m/d/h/m/s etc. values for this instant */ VInstantStruct getUTCInstantFields() const; /** Returns an object holding the broken-down fields that this instant represents in the current time zone. This is primarily for use by VInstantFormatter when formatting a string. @return the current time zone y/m/d/h/m/s etc. values for this instant */ VInstantStruct getLocalInstantFields() const; /* There are two flavors of string conversion -- UTC and local -- and each one has a modern form and a legacy form. The modern form returns the string, and is supplied a VInstantFormatter to control the format; there are several preset formatters available in VInstantFormatter. If you omit the formatter you get the same format that the legacy API provided prior to Vault 4.0, for backward compatibility. The legacy form puts the string into a read-write parameter and has optional parameters to control whether milliseconds are included and whether punctuation is stripped out to make the string safe to use as a file system node name. */ // Modern APIs starting with Vault 4.0: /** Returns a string for this instant in UTC time in the format "y-MM-dd HH:mm:ss.SSS UTC", or one of the special time value strings "PAST", "FUTURE", or "NEVER". @return obvious */ VString getUTCString() const; /** Returns a string for this instant in UTC time in the specified format, or one of the special time value strings "PAST", "FUTURE", or "NEVER". @param formatter the formatter to use @return obvious */ VString getUTCString(const VInstantFormatter& formatter) const; /** Returns a string for this instant in local time in the format "y-MM-dd HH:mm:ss.SSS", or one of the special time value strings "PAST", "FUTURE", or "NEVER". @return obvious */ VString getLocalString() const; /** Returns a string for this instant in local time in the specified format, or one of the special time value strings "PAST", "FUTURE", or "NEVER". @param formatter the formatter to use @return obvious */ VString getLocalString(const VInstantFormatter& formatter) const; // Legacy APIs: /** Returns a string for this instant in UTC time, or one of the special time value strings "PAST", "FUTURE", or "NEVER". You can specify whether to use a format that is safe for use in a file system node name (no punctuation), and whether to include the milliseconds. @param s the string for format for return @param fileNameSafe if true, the format omits punctuation and the " UTC" suffix so it can be safely used in a file system node name @param wantMilliseconds if true, the milliseconds suffix is included; otherwise not */ void getUTCString(VString& s, bool fileNameSafe = false, bool wantMilliseconds = true) const; /** Returns a string for this instant in local time, or one of the special time value strings "PAST", "FUTURE", or "NEVER". You can specify whether to use a format that is safe for use in a file system node name (no punctuation), and whether to include the milliseconds. @param s the string for format for return @param fileNameSafe if true, the format omits punctuation so it can be safely used in a file system node name @param wantMilliseconds if true, the milliseconds suffix is included; otherwise not */ void getLocalString(VString& s, bool fileNameSafe = false, bool wantMilliseconds = true) const; /** Sets the instant from a UTC string representation. You must use the same string format as returned by getUTCString(), that is "y-MM-dd HH:mm:ss.SSS UTC", or one of the special time value strings "PAST", "FUTURE", or "NEVER", or the special string "NOW". @param s the UTC string representation of the instant @see VInstant::getUTCString() */ void setUTCString(const VString& s); /** Sets the instant from a local string representation. You must use the same string format as returned by getLocalString(), that is "y-MM-dd HH:mm:ss.SSS", or one of the special time value strings "PAST", "FUTURE", or "NEVER", or the special string "NOW". @param s the local string representation of the instant @see VInstant::getLocalString() */ void setLocalString(const VString& s); /** Returns true if the instance has a specific time value, indicating that it is not one of the special time constants NEVER_OCCURRED, INFINITE_PAST, or INFINITE_FUTURE. */ bool isSpecific() const { return (*this != VInstant::NEVER_OCCURRED()) && (*this != VInstant::INFINITE_PAST()) && (*this != VInstant::INFINITE_FUTURE()); } /** Returns true if the instance kind is comparable, indicating that it can be compared against another time along the timeline; in particular, instants with kind kNeverOccurred are not comparable. */ bool isComparable() const { return (*this != VInstant::NEVER_OCCURRED()); } /** Returns the raw time value of the instant, defined as milliseconds since UTC 1970 00:00:00.000. Actual resolution may only be seconds, depending on OS. You should generally avoid accessing this value since it is not abstract; you can use other functions and operators to shift forward and backward in time, to get streamable values, etc. You can use the value returned by this function to set into another VInstant using setValue(), but you must also synchronize the "kind" as well (see getKind(), setKind()) if you are using any kinds other than kActualValue. @return the time value in ms since UTC 1970 00:00:00.000 (negative values represent earlier instants in time) */ Vs64 getValue() const { return mValue; } /** Sets the raw time value of the instant, defined as milliseconds since UTC 1970 00:00:00.000. Actual resolution may only be seconds, depending on OS. You should generally avoid accessing this value since it is not abstract; you can use other functions and operators to shift forward and backward in time, to set from streamed values, etc. You can use the value returned by getValue() to supply to this function, but you must also synchronize the "kind" as well (see getKind(), setKind()) if you are using any kinds other than kActualValue. @param value the time value in ms since UTC 1970 00:00:00.000 (negative values represent earlier instants in time) */ void setValue(Vs64 value) { mValue = value; } /** Returns a VDate to represent the instant's date, just as would be returned in the date value returned by getValues() if you specified the local time zone. @return the date of the instant in the local time zone */ VDate getLocalDate() const; /** Returns a VDate to represent the instant's date, just as would be returned in the date value returned by getValues(). The difference is that this function only returns the date, as a convenience. If you need both date and time, it is more efficient to call getValues() than getDate() followed by getTimeOfDay(), because the underlying conversion must happen on each of those calls. Throws an exception if you specify RTZ conversion and there is no converter installed. @param timeZoneID specifies which time zone the result should be given in @return the date of the instant in the specified time zone */ VDate getDate(const VString& timeZoneID) const; /** Returns a VTimeOfDay to represent the instant's time, just as would be returned in the timeOfDay value returned by getValues() if you specified the local time zone. @return the time of day of the instant in the local time zone */ VTimeOfDay getLocalTimeOfDay() const; /** Returns a VTimeOfDay to represent the instant's time, just as would be returned in the timeOfDay value returned by getValues(). The difference is that this function only returns the time of day, as a convenience. If you need both date and time, it is more efficient to call getValues() than getDate() followed by getTimeOfDay(), because the underlying conversion must happen on each of those calls. Throws an exception if you specify RTZ conversion and there is no converter installed. @param timeZoneID specifies which time zone the result should be given in @return the time of day of the instant in the specified time zone */ VTimeOfDay getTimeOfDay(const VString& timeZoneID) const; /** Returns a VDateAndTime to represent the instant's time, just as would be returned in the values returned by getValues(), using the local time zone. @return the date and time of day of the instant in the local time zone */ VDateAndTime getLocalDateAndTime() const; /** Returns a VDateAndTime to represent the instant's time, just as would be returned in the values returned by getValues(). Throws an exception if you specify RTZ conversion and there is no converter installed. @param timeZoneID specifies which time zone the result should be given in @return the date and time of day of the instant in the specified time zone */ VDateAndTime getDateAndTime(const VString& timeZoneID) const; /** Sets the instant to represent the specified time, just as would be done by setValues(), using the local time zone. @param dt the date and time of day to use */ void setLocalDateAndTime(const VDateAndTime& dt); /** Sets the instant to represent the specified time, just as would be done by setValues(), using the specified time zone. Throws an exception if you specify RTZ conversion and there is no converter installed. @param dt the date and time of day to use @param timeZoneID specifies which time zone the date and time is given in */ void setDateAndTime(const VDateAndTime& dt, const VString& timeZoneID); /** Returns a VDate and VTimeOfDay to represent the instant, either in UTC or local time, or in a remote time zone (if an RTZ converter has been installed). Throws an exception if you specify RTZ conversion and there is no converter installed. @param date the VDate to set @param timeOfDay the VTimeOfDay to set @param timeZoneID specifies which time zone the result should be given in */ void getValues(VDate& date, VTimeOfDay& timeOfDay, const VString& timeZoneID) const; /** Sets the instant from a VDate and VTimeOfDay, either in UTC or local time, or in a remote time zone (if an RTZ converter has been installed). Throws an exception if you specify RTZ conversion and there is no converter installed. @param date the date to use @param timeOfDay the time of day to use @param timeZoneID specifies which time zone in which the supplied date and time are given in */ void setValues(const VDate& date, const VTimeOfDay& timeOfDay, const VString& timeZoneID); /** Returns the local offset in milliseconds, of the local time zone, at the instant in time represented by this VInstant. For locales west of GMT, this value is negative (e.g., -8 hours or -7 hours in California, depending on daylight time), and for locales east of GMT, this value is positive. */ Vs64 getLocalOffsetMilliseconds() const; friend inline bool operator==(const VInstant& lhs, const VInstant& rhs); ///< Compares two instants. friend inline bool operator!=(const VInstant& lhs, const VInstant& rhs); ///< Compares two instants. friend inline bool operator< (const VInstant& lhs, const VInstant& rhs); ///< Compares two instants. friend inline bool operator<=(const VInstant& lhs, const VInstant& rhs); ///< Compares two instants. friend inline bool operator>=(const VInstant& lhs, const VInstant& rhs); ///< Compares two instants. friend inline bool operator> (const VInstant& lhs, const VInstant& rhs); ///< Compares two instants. friend inline VDuration operator-(const VInstant& i1, const VInstant& i2); ///< Returns the time duration between i1 and i2. @param i1 an instant @param i2 an instant @return i1 - i2 as a VDuration friend inline VInstant operator+(const VInstant& i1, const VDuration& forwardDuration); ///< Returns an instant incremented by a delta. @param i1 an instant @param forwardDuration the duration to add @return the result of i1+forwardDuration friend inline VInstant operator-(const VInstant& i1, const VDuration& backwardDuration);///< Returns an instant decremented by a delta. @param i1 an instant @param backwardDuration the duration to subtract to add @return the result of i1-backwardDuration static inline VInstant min(const VInstant& i1, const VInstant& i2); ///< Returns the earlier of i1 and i2. @param i1 an instant @param i2 an instant @return i1 if i1 < i2 static inline VInstant max(const VInstant& i1, const VInstant& i2); ///< Returns the later of i1 and i2. @param i1 an instant @param i2 an instant @return i1 if i1 > i2 /** Returns a relatively high-resolution snapshot of the current time, for use with a subsequent call to VInstant::snapshotDelta(). You should not assume that the snapshot value remains valid across system starts; if you need to get the difference in times across reboots, use normal VInstant operator minus. @return the current system clock snapshot */ static Vs64 snapshot(); /** Returns the delta between the current time and the supplied origin snapshot value. As noted in the VInstant::snapshot() docs, the delta may not work across reboots. @param snapshotValue a snapshot value from VInstant::snapshot() @return the time delta from the snapshot to now */ static VDuration snapshotDelta(Vs64 snapshotValue); /** Installs a Remote Time Zone Converter, that VInstant will use for functions that take a timeZoneID, if that parameter is not UTC or the local time zone. The caller still owns the converter; VInstant will not delete it. You can pass NULL to disable use of RTZ conversion (by default, no converter is installed). */ static void setRemoteTimeZoneConverter(IVRemoteTimeZoneConverter* converter); /** Returns the currently installed Remote Time Zone Converter, which may be NULL. You might use this to delete the old converter if you are installing a new one. VInstant uses whatever converter is installed (if it's not NULL) at the time it needs it. */ static IVRemoteTimeZoneConverter* getRemoteTimeZoneConverter(); // Time simulation features. Note that if "frozen time" is in effect, the // "clock offset" information is not used. /** Adjusts the simulated clock offset. The simulated clock offset is applied by _platform_now() and _platform_snapshot() to the values they return. This can be used to simulate a faster passing of time, by adjusting the clock forward. It may be impractical to adjust the clock backwards, because some code constructs may behave badly if time flows backwards. However, you may be able to apply an initial backwards offset if you wish to start your program running in a simulated time in the past. @param delta the amount of offset to add/delete */ static void incrementSimulatedClockOffset(const VDuration& delta); /** Sets the simulated clock offset. The simulated clock offset is applied by setNow() and snapshot() to the values they return. This can be used to simulate a faster passing of time, by adjusting the clock forward. It may be impractical to adjust the clock backwards, because some code constructs may behave badly if time flows backwards. However, you may be able to apply an initial backwards offset if you wish to start your program running in a simulated time in the past. @param offset the simulated clock offset */ static void setSimulatedClockOffset(const VDuration& offset); /** Sets the simulated clock offset implied by the specified absolute time value. The simulated clock offset is applied by setNow() and snapshot() to the values they return. This can be used to simulate a faster passing of time, by adjusting the clock forward. It may be impractical to adjust the clock backwards, because some code constructs may behave badly if time flows backwards. However, you may be able to apply an initial backwards offset if you wish to start your program running in a simulated time in the past. @param simulatedCurrentTime the simulated time from which to calculate the offset */ static void setSimulatedClockValue(const VInstant& simulatedCurrentTime); /** Returns the simulated clock offset. The simulated clock offset is applied by _platform_now() and _platform_snapshot() to the values they return. This can be used to simulate a faster passing of time, by adjusting the clock forward. It may be impractical to adjust the clock backwards, because some code constructs may behave badly if time flows backwards. However, you may be able to apply an initial backwards offset if you wish to start your program running in a simulated time in the past. */ static VDuration getSimulatedClockOffset(); /** Freezes the flow of time by specifying an absolute time that will be returned by any call to setNow(), as well as any use of snapshot() to track time deltas. @param frozenTimeValue the time value that is frozen */ static void freezeTime(const VInstant& frozenTimeValue); /** Shifts the frozen time value by the specified amount. This can be used to freeze time and then cause it to flow slowly or quickly by manually rolling time forward at the desired rate. @param delta the duration by which to offset the frozen time; negative values may have strange effects */ static void shiftFrozenTime(const VDuration& delta); /** Unfreezes time and resumes real-time operation. If you previously used a future time for freezing, you should probably install a clock offset value before unfreezing, to ensure that time proceeds forward; otherwise you will unfreeze and end up in an earlier time (now). */ static void unfreezeTime(); /** Returns true if time is currently frozen. @return true if time is frozen */ static bool isTimeFrozen(); private: // This is the private constructor used internally. explicit VInstant(Vs64 utcOffsetMilliseconds) : mValue(utcOffsetMilliseconds) {} Vs64 mValue; ///< Milliseconds since: UTC 1970 00:00:00.000. Actual resolution may only be seconds, depending on OS. Using {64-bit,ms} means our definition does not have painful range limits like {32-bit,sec}. /** Returns true if i1 and i2 can be compared using simple value comparison. (It's false if either one has mKind != kActualValue.) */ static bool canCompareValues(const VInstant& i1, const VInstant& i2) { return i1.isSpecific() && i2.isSpecific(); } /** Returns true if i1 > i2, considering the complexity of mKind != kActualValue. */ static bool _complexGT(const VInstant& i1, const VInstant& i2); /** Returns true if i1 >= i2, considering the complexity of mKind != kActualValue. */ static bool _complexGTE(const VInstant& i1, const VInstant& i2); /** Returns true if i1 < i2, considering the complexity of mKind != kActualValue. */ static bool _complexLT(const VInstant& i1, const VInstant& i2); /** Returns true if i1 <= i2, considering the complexity of mKind != kActualValue. */ static bool _complexLTE(const VInstant& i1, const VInstant& i2); /* These are the core function interfaces that must be implemented on a per-platform basis. That is, they are platform-specific and are implemented in the vinstant_platform.* files. All other time conversion is performed via these calls. This allows us to isolate the platform and library quirks in those files rather than conditionally compile code in vinstant.cpp. There are only two types used here. - The 64-bit millisecond "offset" from UTC 1970. This is also what VInstant uses an offset. We'll just refer to this as a UTC Epoch Offset. - The y/m/d/h/m/s "struct" in some time zone. We'll just refer to this as a "Time Struct". It's all about converting between them. There is one additional function, _platform_snapshot(), which is not about time conversion, but just about measuring short time durations with millisecond resolution. */ /** Returns the current UTC Epoch Offset in milliseconds. Actual resolution may only be seconds, depending on OS. @return the current UTC Epoch Offset in milliseconds */ static Vs64 _platform_now(); /** Returns a current time value with millisecond resolution; the base value is unspecified, and this is only to be used to count time deltas between two snapshot values. @return a clock value representing "now" in milliseconds, base undefined */ static Vs64 _platform_snapshot(); static Vs64 gSimulatedClockOffset; ///< Value applied by _platform_now() and _platform_snapshot() to simulate non-real-time flow. static Vs64 gFrozenClockValue; ///< If non-zero, the "current time" returned is always this value; time is effectively frozen. static IVRemoteTimeZoneConverter* gRemoteTimeZoneConverter; ///< The converter for RTZ conversion, or NULL. // Let VDate call the getTimeValue() bottleneck for getting the day of // week, but don't make it a public API since it's exposing the tm // structure which is dependent on time.h functionality. friend class VDate; friend class VInstantUnit; // Let unit test validate our internal APIs. }; // Inline implementations of some of the above VInstant operators. inline bool operator==(const VInstant& lhs, const VInstant& rhs) { return lhs.mValue == rhs.mValue; } inline bool operator!=(const VInstant& lhs, const VInstant& rhs) { return !operator==(lhs, rhs); } inline bool operator< (const VInstant& lhs, const VInstant& rhs) { if (VInstant::canCompareValues(lhs, rhs)) return lhs.mValue < rhs.mValue; else return VInstant::_complexLT(lhs, rhs); } inline bool operator<=(const VInstant& lhs, const VInstant& rhs) { if (VInstant::canCompareValues(lhs, rhs)) return lhs.mValue <= rhs.mValue; else return VInstant::_complexLTE(lhs, rhs); } inline bool operator>=(const VInstant& lhs, const VInstant& rhs) { if (VInstant::canCompareValues(lhs, rhs)) return lhs.mValue >= rhs.mValue; else return VInstant::_complexGTE(lhs, rhs); } inline bool operator> (const VInstant& lhs, const VInstant& rhs) { if (VInstant::canCompareValues(lhs, rhs)) return lhs.mValue > rhs.mValue; else return VInstant::_complexGT(lhs, rhs); } inline VDuration operator-(const VInstant& i1, const VInstant& i2) { if (VInstant::canCompareValues(i1, i2)) return VDuration::MILLISECOND() * (i1.mValue - i2.mValue); else return VDuration(); } inline VInstant operator+(const VInstant& i1, const VDuration& forwardDuration) { VInstant result = i1; result += forwardDuration; return result; } inline VInstant operator-(const VInstant& i1, const VDuration& backwardDuration) { VInstant result = i1; result -= backwardDuration; return result; } inline VInstant VInstant::min(const VInstant& i1, const VInstant& i2) { return (i1 < i2) ? i1 : i2; } inline VInstant VInstant::max(const VInstant& i1, const VInstant& i2) { return (i1 > i2) ? i1 : i2; } /** VInstantVector is simply a vector of VInstant objects. Note that the vector elements are objects, not pointers to objects. */ typedef std::vector<VInstant> VInstantVector; /** VDate represents a calendar date: a year/month/day. Per (*) below, the "day" field is actually allowed to be in the range 1 to 32, for purposes of allowing the caller to increment the day and then convert to a VInstant. */ class VDate { public: static VDate createFromDateString(const VString& dateString, const VCodePoint& delimiter); /** Constructs a date with values set to 0000-01-01 (useless but legal state for a VDate object). Your first use of such a date object should be to assign it a useful value. */ VDate(); /** Constructs a date from the current instant. Throws an exception if you specify RTZ conversion and there is no converter installed. @param timeZoneID specifies which time zone the y/m/d should be given in */ VDate(const VString& timeZoneID); /** Constructs a date from specified values. @param year the year @param month the month (1 to 12) @param day the day of the month (1 to 31*) */ VDate(int year, int month, int day); /** Destructor. */ virtual ~VDate() {} /** Returns the year of the date. @return the year */ int getYear() const; /** Returns the month of the date. @return the month (1 to 12) */ int getMonth() const; /** Returns the day of the month of the date. @return the day of the month (1 to 31*) */ int getDay() const; /** Returns the day of the week of the date. @return the day of the week (0=kSunday to 6=kSaturday, as in time.h and defined in the enum below) */ int getDayOfWeek() const; /** Sets the date from specified values. @param year the year @param month the month of the year (1 to 12) @param day the day of the month (1 to 31*) */ void set(int year, int month, int day); /** Sets the year of the date. @param year the year */ void setYear(int year); /** Sets the month of the date. @param month the month of the year (1 to 12) */ void setMonth(int month); /** Sets the day of the month. @param day the day of the month (1 to 31*) */ void setDay(int day); /** Returns a string for this date in the format "y-MM-dd". @return obvious */ VString getDateString() const; /** Returns a string for this date in the specified format. @param formatter the formatter to use @return obvious */ VString getDateString(const VInstantFormatter& formatter) const; /** Returns an object holding the broken-down fields that this date represents. This is primarily for use by VInstantFormatter when formatting a string. @return the y/m/d values for this date, with other fields default constructed from VTimeOfDay() */ VInstantStruct getDateFields() const; // Values returned by getDayOfWeek(). enum { kSunday = 0, kMonday, kTuesday, kWednesday, kThursday, kFriday, kSaturday }; friend inline bool operator==(const VDate& lhs, const VDate& rhs); ///< Compares two dates. friend inline bool operator!=(const VDate& lhs, const VDate& rhs); ///< Compares two dates. friend inline bool operator< (const VDate& lhs, const VDate& rhs); ///< Compares two dates. friend inline bool operator<=(const VDate& lhs, const VDate& rhs); ///< Compares two dates. friend inline bool operator>=(const VDate& lhs, const VDate& rhs); ///< Compares two dates. friend inline bool operator> (const VDate& lhs, const VDate& rhs); ///< Compares two dates. private: /** Asserts if any invariant is broken. */ void _assertInvariant() const; int mYear; ///< The year. int mMonth; ///< The month (1 to 12). int mDay; ///< The day of the month (1 to 31*). }; inline bool operator==(const VDate& lhs, const VDate& rhs) { return (lhs.mYear == rhs.mYear) && (lhs.mMonth == rhs.mMonth) && (lhs.mDay == rhs.mDay); } inline bool operator!=(const VDate& lhs, const VDate& rhs) { return !operator==(lhs, rhs); } inline bool operator< (const VDate& lhs, const VDate& rhs) { if (lhs.mYear < rhs.mYear) return true; if (lhs.mYear > rhs.mYear) return false; if (lhs.mMonth < rhs.mMonth) return true; if (lhs.mMonth > rhs.mMonth) return false; return (lhs.mDay < rhs.mDay); } inline bool operator<=(const VDate& lhs, const VDate& rhs) { return !operator>(lhs, rhs); } inline bool operator>=(const VDate& lhs, const VDate& rhs) { return !operator<(lhs, rhs); } inline bool operator> (const VDate& lhs, const VDate& rhs) { return operator<(rhs, lhs); } /** VTimeOfDay represents a time of day without understanding about calendars or time zones; it is simply an hour/minute/second container. */ class VTimeOfDay { public: /** Constructs a time of day with all values set to zero, which is valid and means midnight (start of a day). */ VTimeOfDay(); /** Constructs a time of day from the current instant. Throws an exception if you specify RTZ conversion and there is no converter installed. @param timeZoneID specifies which time zone the h/m/s should be given in */ VTimeOfDay(const VString& timeZoneID); /** Constructs a time of day from specified values. @param hour the hour of day (0 to 23) @param minute the minute of the hour (0 to 59) @param second the second of the minute (0 to 59) @param millisecond the millisecond of the second (0 to 999) */ VTimeOfDay(int hour, int minute, int second, int millisecond); /** Destructor. */ virtual ~VTimeOfDay() {} /** Returns the hour of day. @return the hour (0 to 23) */ int getHour() const; /** Returns the minute of the hour. @return the minute (0 to 59) */ int getMinute() const; /** Returns the second of the minute. @return the second (0 to 59) */ int getSecond() const; /** Returns the millisecond of the second. @return the second (0 to 999) */ int getMillisecond() const; /** Sets the time of day from specified values. @param hour the hour of day (0 to 23) @param minute the minute of the hour (0 to 59) @param second the second of the minute (1 to 59) @param millisecond the millisecond of the second (0 to 999) */ void set(int hour, int minute, int second, int millisecond); /** Sets the hour of the day. @param hour the hour of day (0 to 23) */ void setHour(int hour); /** Sets the minute of the hour. @param minute the minute of the hour (0 to 59) */ void setMinute(int minute); /** Sets the second of the minute. @param second the second of the minute (1 to 59) */ void setSecond(int second); /** Sets the millisecond of the second. @param millisecond the millisecond of the second (0 to 999) */ void setMillisecond(int millisecond); /** Sets the hour, minute, second, and millisecond to zero. */ void setToStartOfDay(); /** Returns a string for this time of day in the format "HH:mm:ss.SSS". @return obvious */ VString getTimeOfDayString() const; /** Returns a string for this time of day in the specified format. @param formatter the formatter to use @return obvious */ VString getTimeOfDayString(const VInstantFormatter& formatter) const; /** Returns an object holding the broken-down fields that this time of day represents. This is primarily for use by VInstantFormatter when formatting a string. @return the h/m/s/ms values for this time of day, with other fields defaulted from VDate() */ VInstantStruct getTimeOfDayFields() const; friend inline bool operator==(const VTimeOfDay& t1, const VTimeOfDay& t2); private: /** Asserts if any invariant is broken. */ void _assertInvariant() const; int mHour; ///< The hour of day (0 to 23). int mMinute; ///< The minute of the hour (0 to 59). int mSecond; ///< The second of the minute (0 to 59). int mMillisecond; ///< The millisecond of the second (0 to 999). }; inline bool operator==(const VTimeOfDay& t1, const VTimeOfDay& t2) { return (t1.mHour == t2.mHour) && (t1.mMinute == t2.mMinute) && (t1.mSecond == t2.mSecond) && (t1.mMillisecond == t2.mMillisecond); } /** VDateAndTime simply aggregates a VDate and a VTimeOfDay into one convenient object. */ class VDateAndTime { public: VDateAndTime() : mDate(), mTimeOfDay() {} VDateAndTime(const VString& timeZoneID); VDateAndTime(int inYear, int inMonth, int inDay, int inHour, int inMinute, int inSecond, int inMillisecond) : mDate(inYear, inMonth, inDay), mTimeOfDay(inHour, inMinute, inSecond, inMillisecond) {} ~VDateAndTime() {} // Use these accessors to call the date and time of day sub-objects directly. const VDate& getDate() const { return mDate; } const VTimeOfDay& getTimeOfDay() const { return mTimeOfDay; } int getYear() const { return mDate.getYear(); } int getMonth() const { return mDate.getMonth(); } int getDay() const { return mDate.getDay(); } int getDayOfWeek() const { return mDate.getDayOfWeek(); } int getHour() const { return mTimeOfDay.getHour(); } int getMinute() const { return mTimeOfDay.getMinute(); } int getSecond() const { return mTimeOfDay.getSecond(); } int getMillisecond() const { return mTimeOfDay.getMillisecond(); } void set(int inYear, int inMonth, int inDay, int inHour, int inMinute, int inSecond, int inMillisecond) { mDate.set(inYear, inMonth, inDay); mTimeOfDay.set(inHour, inMinute, inSecond, inMillisecond); } void setYear(int year) { mDate.setYear(year); } void setMonth(int month) { mDate.setMonth(month); } void setDay(int day) { mDate.setDay(day); } void setHour(int hour) { mTimeOfDay.setHour(hour); } void setMinute(int minute) { mTimeOfDay.setMinute(minute); } void setSecond(int second) { mTimeOfDay.setSecond(second); } void setMillisecond(int millisecond) { mTimeOfDay.setMillisecond(millisecond); } void setToStartOfDay() { mTimeOfDay.setToStartOfDay(); } friend inline bool operator==(const VDateAndTime& dt1, const VDateAndTime& dt2); private: VDate mDate; VTimeOfDay mTimeOfDay; }; inline bool operator==(const VDateAndTime& dt1, const VDateAndTime& dt2) { return (dt1.mDate == dt2.mDate) && (dt1.mTimeOfDay == dt2.mTimeOfDay); } // VInstantFormatterLocaleInfo ----------------------------------------------- /** This class holds a set of locale-specific text and other information used when formatting VInstant time stamp strings. The purpose is to decouple the text and rules specific to a locale from the formatting directive logic of VInstantFormatter itself. You can supply one of these when constructing a VInstantFormatter to control the format. Currently I have the default constructor creating US English strings and that's all, but you can build one for another locale and use it when appropriate. */ class VInstantFormatterLocaleInfo { public: /** Returns a reference to a global locale info object for a specific locale. Currently I do not actually track and return objects for different locales, so this is a future-proofing API. It always returns the US English info. @param localeName the local name string (e.g. "en-us") @return the info for the specified locale, to use when formatting */ static const VInstantFormatterLocaleInfo& getLocaleInfo(const VString& localeName); /** Constructs an empty locale info that you can modify. (In reality, the default constructor currently fills in "en-us" locale info.) */ VInstantFormatterLocaleInfo(); ~VInstantFormatterLocaleInfo() {} // The instance variables are public since they are just data, which you can // build if you are setting up your own locale object. VString CE_MARKER; ///< The marker for the common era name, e.g. "CE" or "AD" VString AM_MARKER; ///< The marker for times before noon, e.g. "AM" VString PM_MARKER; ///< The marker for time after noon, e.g. "PM" VStringVector MONTH_NAMES_SHORT; ///< Short-form abbreviated month names, e.g. [0] = "Jan" ... [11] = "Dec" VStringVector MONTH_NAMES_LONG; ///< Long-form full month names, e.g. [0] = "January" ... [11] = "December" VStringVector DAY_NAMES_SHORT; ///< Short-form abbreviated day-of-week names, e.g. [0] = "Sun" ... [6] = "Sat" VStringVector DAY_NAMES_LONG; ///< Long-form full day-of-week names, e.g. [0] = "Sunday" ... [6] = "Saturday" }; // VInstantFormatter --------------------------------------------------------- /** This class describes how a VInstant should be formatted as a string. You construct it with a format specifier string, whose contents lay out the fields that you want in the string, and their form. The format specifier implements as closely as possible the same directives as the Java SimpleDateFormat documentation describes: <http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html> You can also supply a locale info object to indicate the language of non-numeric parts of the string. In the future this may also include some aspects of formatting that differ per locale rather than per format specifier. Because there is nothing mutable in this class, and because there is no transient internal state in the object, the format() method can be called freely by multiple threads at the same time. */ class VInstantFormatter { public: /** Constructs a formatter for the default locale with a default format specifier. */ VInstantFormatter(); /** Constructs a formatter for a specified locale with a default format specifier. @param localeInfo the locale to use */ VInstantFormatter(const VInstantFormatterLocaleInfo& localeInfo); /** Constructs a formatter for the default locale with a specified format specifier. @param formatSpecifier the format to apply */ VInstantFormatter(const VString& formatSpecifier); /** Constructs a formatter for a specified locale and format specifier. @param formatSpecifier the format to apply @param localeInfo the locale to use */ VInstantFormatter(const VString& formatSpecifier, const VInstantFormatterLocaleInfo& localeInfo); ~VInstantFormatter() {} /** Builds and returns a local time zone time stamp string for the specified instant, according to the locale and format specifier supplied to the constructor of this formatter. Assuming that the local time zone is non-UTC, if the format specifier includes time zone, it will be non-zero such as "-07:00" depending on the particular specifier. */ VString formatLocalString(const VInstant& when) const; /** Builds and returns a UTC time zone time stamp string for the specified instant, according to the locale and format specifier supplied to the constructor of this formatter. If the format specifier includes the time zone, it will indicate UTC in a form such as "Z" or "+0:00" depending on the particular specifier. */ VString formatUTCString(const VInstant& when) const; /** Builds and returns a date string for the specified date, according to the locale and format specifier supplied to the constructor of this formatter. It is important to use the correct formatter: don't simply re-use one that has field specifiers for time components within a day, because it would cause values to be included for those components. */ VString formatDateString(const VDate& date) const; /** Builds and returns a time string for the specified time of day, according to the locale and format specifier supplied to the constructor of this formatter. It is important to use the correct formatter: don't simply re-use one that has field specifiers for date components, because it would cause values to be included for those components. */ VString formatTimeOfDayString(const VTimeOfDay& timeOfDay) const; // Getter, for debugging use. VString getFormatSpecifier() const { return mFormatSpecifier; } private: /** This is what we call internally to format the instant after converting it to a broken-down set of information. If it's a UTC time, the offset is zero; otherwise it's the offset in milliseconds. */ VString _format(const VInstantStruct& when, int utcOffsetMilliseconds) const; void _flushPendingFieldSpecifier(const VInstantStruct& when, int utcOffsetMilliseconds, VString& fieldSpecifier/*will be set to empty on return*/, VString& resultToAppendTo) const; void _flushFixedLengthTextValue(const VString& value, VString& resultToAppendTo) const; void _flushVariableLengthTextValue(const VString& shortValue, const VString& longValue, int fieldLength, VString& resultToAppendTo) const; void _flushNumberValue(int value, int fieldLength, VString& resultToAppendTo) const; void _flushYearValue(int year, int fieldLength, VString& resultToAppendTo) const; void _flushMonthValue(int month, int fieldLength, VString& resultToAppendTo) const; void _flushDayNameValue(int dayOfWeek/*0=sun ... 6=sat*/, int fieldLength, VString& resultToAppendTo) const; void _flushDayNumberValue(int dayOfWeek/*0=sun ... 6=sat*/, int fieldLength, VString& resultToAppendTo) const; void _flushTimeZoneValue(int utcOffsetMilliseconds, const VString& fieldSpecifier, VString& resultToAppendTo) const; VString mFormatSpecifier; // Pseudo-constants: Potentially localized values, not static, because we allow setting per VInstantFormatter. const VInstantFormatterLocaleInfo& mLocaleInfo; }; #endif /* vinstant_h */
trygve-isaacson/code-vault
source/containers/vinstant.h
C
mit
74,529
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; namespace Terra.WebUI.Models.AccountViewModels { public class LoginViewModel { [Required] [EmailAddress] public string Email { get; set; } [Required] [DataType(DataType.Password)] public string Password { get; set; } [Display(Name = "Remember me?")] public bool RememberMe { get; set; } } }
Arukim/terra
Terra.WebUI/Models/AccountViewModels/LoginViewModel.cs
C#
mit
512
version https://git-lfs.github.com/spec/v1 oid sha256:a396601eca15b0c281513d01941cfd37300b927b32a1bb9bb6e708a9910f1b49 size 2712
yogeshsaroya/new-cdnjs
ajax/libs/ckeditor/4.2/plugins/a11yhelp/dialogs/lang/sr-latn.min.js
JavaScript
mit
129
package com.ruenzuo.weatherapp.adapters; import android.app.Activity; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.TextView; import com.ruenzuo.weatherapp.R; import com.ruenzuo.weatherapp.models.City; /** * Created by ruenzuo on 08/05/14. */ public class CitiesAdapter extends ArrayAdapter<City> { private int resourceId; public CitiesAdapter(Context context, int resource) { super(context, resource); resourceId = resource; } @Override public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { LayoutInflater inflater = ((Activity)getContext()).getLayoutInflater(); convertView = inflater.inflate(resourceId, null); } City country = getItem(position); TextView txtViewCityName = (TextView) convertView.findViewById(R.id.txtViewCityName); txtViewCityName.setText(country.getName()); return convertView; } }
Ruenzuo/android-facade-example
WeatherApp/src/main/java/com/ruenzuo/weatherapp/adapters/CitiesAdapter.java
Java
mit
1,106
module SelecaoAdmin class Engine < ::Rails::Engine isolate_namespace SelecaoAdmin end end
swayzepatryck/selecao_admin
lib/selecao_admin/engine.rb
Ruby
mit
98
<?php include __DIR__.'/../lib/SALT.php'; /** An example of using the SALT Secure Storage API to store then use a stored Credit Card */ use \SALT\Merchant; use \SALT\HttpsCreditCardService; use \SALT\CreditCard; use \SALT\PaymentProfile; // connection parameters to the gateway $url = 'https://test.salt.com/gateway/creditcard/processor.do'; //$merchant = new Merchant ('Your Merchant ID', 'Your API Token'); $merchant = new Merchant ( VALID_MERCHANT_ID, VALID_API_TOKEN ); $service = new HttpsCreditCardService( $merchant, $url ); // credit card info from customer - to be stored $creditCard = new CreditCard( '4242424242424242', '1010', null, '123 Street', 'A1B23C' ); // payment profile to be stored (just using the card component in this example) $paymentProfile = new PaymentProfile( $creditCard, null ); // store data under the token 'my-token-001' //$storageToken = 'my-token-'.date('Ymd'); $storageToken = uniqid(); $storageReceipt = $service->addToStorage( $storageToken, $paymentProfile ); if ( $storageReceipt->approved ) { echo "Credit card storage approved.\n"; $purchaseOrderId = uniqid(); echo "Creating Single purchase with Order ID $purchaseOrderId\n"; $singlePurchaseReceipt = $service->singlePurchase( $purchaseOrderId, $storageToken, '100', null ); // optional array dump of response params // print_r($receipt->params); if ( $singlePurchaseReceipt->approved ) { //Store the transaction id. echo "Single Purchase Receipt approved\n"; } else { echo "Single purchase receipt not approved\n"; } } else { echo "Credit card storage not approved.\n"; } //Update the credit card stored $updatedCreditCard = new CreditCard ( '4012888888881881', '1010', null, '1 Market St.', '94105' ); $paymentProfile->creditCard = $updatedCreditCard; $updatedStorageReceipt = $service->updateStorage($storageToken, $paymentProfile); if ( $updatedStorageReceipt->approved ) { echo "Updated credit card storage approved.\n"; } else { echo "Updated credit card storage not approved.\n"; } //Query the credit card stored $queryStorageReceipt = $service->queryStorage($storageToken); if ( $queryStorageReceipt->approved ) { echo "Secure storage query successful.\n"; echo "Response: \n"; print_r($queryStorageReceipt->params); } else { echo "Secure storage query failed.\n"; }
SaltTechnology/salt-payment-client-php
examples/CreditCardStorage.php
PHP
mit
2,376
package tehnut.resourceful.crops.compat; import mcp.mobius.waila.api.*; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.items.ItemHandlerHelper; import tehnut.resourceful.crops.block.tile.TileSeedContainer; import tehnut.resourceful.crops.core.RegistrarResourcefulCrops; import tehnut.resourceful.crops.core.data.Seed; import javax.annotation.Nonnull; import java.util.List; @WailaPlugin public class CompatibilityWaila implements IWailaPlugin { @Override public void register(IWailaRegistrar registrar) { final CropProvider cropProvider = new CropProvider(); registrar.registerStackProvider(cropProvider, TileSeedContainer.class); registrar.registerNBTProvider(cropProvider, TileSeedContainer.class); } public static class CropProvider implements IWailaDataProvider { @Nonnull @Override public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) { Seed seed = RegistrarResourcefulCrops.SEEDS.getValue(new ResourceLocation(accessor.getNBTData().getString("seed"))); if (seed == null) return accessor.getStack(); if (seed.isNull()) return accessor.getStack(); if (seed.getOutputs().length == 0) return accessor.getStack(); return ItemHandlerHelper.copyStackWithSize(seed.getOutputs()[0].getItem(), 1); } @Nonnull @Override public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) { return currenttip; } @Nonnull @Override public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) { return currenttip; } @Nonnull @Override public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) { return currenttip; } @Nonnull @Override public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, BlockPos pos) { tag.setString("seed", ((TileSeedContainer) te).getSeedKey().toString()); return tag; } } }
TehNut/ResourcefulCrops
src/main/java/tehnut/resourceful/crops/compat/CompatibilityWaila.java
Java
mit
2,650
<?php /* * This file is part of the WeatherUndergroundBundle. * * (c) Nikolay Ivlev <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace SunCat\WeatherUndergroundBundle\DependencyInjection; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\Config\FileLocator; use Symfony\Component\HttpKernel\DependencyInjection\Extension; use Symfony\Component\DependencyInjection\Loader; /** * DI extension * * @author suncat2000 <[email protected]> */ class WeatherUndergroundExtension extends Extension { /** * {@inheritDoc} */ public function load(array $configs, ContainerBuilder $container) { $configuration = new Configuration(); $config = $this->processConfiguration($configuration, $configs); $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('services.yml'); $container->setParameter('weather_underground.apikey', $config['apikey']); $container->setParameter('weather_underground.format', $config['format']); $container->setParameter('weather_underground.host_data_features', $config['host_data_features']); $container->setParameter('weather_underground.host_autocomlete', $config['host_autocomlete']); } }
suncat2000/WeatherUndergroundBundle
DependencyInjection/WeatherUndergroundExtension.php
PHP
mit
1,429
import _ from 'lodash'; /** * Represents a channel with which commands can be invoked. * * Channels are one-per-origin (protocol/domain/port). */ class Channel { constructor(config, $rootScope, $timeout, contentWindow) { this.config = config; this.$rootScope = $rootScope; this.$timeout = $timeout; this._contentWindow = contentWindow; this.messageCounter = 0; } ab2str(buffer) { let result = ""; let bytes = new Uint8Array(buffer); let len = bytes.byteLength; for (let i = 0; i < len; i++) { result += String.fromCharCode(bytes[i]); } return result; }; /** * Fire and forget pattern that sends the command to the target without waiting for a response. */ invokeDirect(command, data, targetOrigin, transferrablePropertyPath) { if (!data) { data = {}; } if (!targetOrigin) { targetOrigin = this.config.siteUrl; } if (!targetOrigin) { targetOrigin = "*"; } data.command = command; data.postMessageId = `SP.RequestExecutor_${this.messageCounter++}`; let transferrableProperty = undefined; if (transferrablePropertyPath) { transferrableProperty = _.get(data, transferrablePropertyPath); } if (transferrableProperty) this._contentWindow.postMessage(data, targetOrigin, [transferrableProperty]); else this._contentWindow.postMessage(data, targetOrigin); } /** * Invokes the specified command on the channel with the specified data, constrained to the specified domain awaiting for max ms specified in timeout */ async invoke(command, data, targetOrigin, timeout, transferrablePropertyPath) { if (!data) { data = {}; } if (!targetOrigin) { targetOrigin = this.config.siteUrl; } if (!targetOrigin) { targetOrigin = "*"; } if (!timeout) { timeout = 0; } data.command = command; data.postMessageId = `SP.RequestExecutor_${this.messageCounter++}`; let resolve, reject; let promise = new Promise((innerResolve, innerReject) => { resolve = innerResolve; reject = innerReject; }); let timeoutPromise; if (timeout > 0) { timeoutPromise = this.$timeout(() => { reject(new Error(`invoke() timed out while waiting for a response while executing ${data.command}`)); }, timeout); } let removeMonitor = this.$rootScope.$on(this.config.crossDomainMessageSink.incomingMessageName, (event, response) => { if (response.postMessageId !== data.postMessageId) return; if (response.result === "error") { reject(response); } else { if (response.data) { let contentType = response.headers["content-type"] || response.headers["Content-Type"]; if (contentType.startsWith("application/json")) { let str = this.ab2str(response.data); if (str.length > 0) { try { response.data = JSON.parse(str); } catch(ex) { } } } else if (contentType.startsWith("text")) { response.data = this.ab2str(response.data); } } resolve(response); } removeMonitor(); if (timeoutPromise) this.$timeout.cancel(timeoutPromise); }); let transferrableProperty = undefined; if (transferrablePropertyPath) { transferrableProperty = _.get(data, transferrablePropertyPath); } if (transferrableProperty) this._contentWindow.postMessage(data, targetOrigin, [transferrableProperty]); else this._contentWindow.postMessage(data, targetOrigin); return promise; } } module.exports = Channel;
beyond-sharepoint/sp-angular-webpack
src/ng-sharepoint/Channel.js
JavaScript
mit
4,352
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); include __DIR__.'/../../../application/config/config.php'; /* |-------------------------------------------------------------------------- | Base Site URL |-------------------------------------------------------------------------- | | URL to your CodeIgniter root. Typically this will be your base URL, | WITH a trailing slash: | | http://example.com/ | | If this is not set then CodeIgniter will guess the protocol, domain and | path to your installation. | */ $config['base_url'] = $config['gi_base_url'].'/api/'; /* |-------------------------------------------------------------------------- | Index File |-------------------------------------------------------------------------- | | Typically this will be your index.php file, unless you've renamed it to | something else. If you are using mod_rewrite to remove the page set this | variable so that it is blank. | */ $config['index_page'] = ''; /* |-------------------------------------------------------------------------- | URI PROTOCOL |-------------------------------------------------------------------------- | | This item determines which server global should be used to retrieve the | URI string. The default setting of 'AUTO' works for most servers. | If your links do not seem to work, try one of the other delicious flavors: | | 'AUTO' Default - auto detects | 'PATH_INFO' Uses the PATH_INFO | 'QUERY_STRING' Uses the QUERY_STRING | 'REQUEST_URI' Uses the REQUEST_URI | 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO | */ $config['uri_protocol'] = 'AUTO'; if( defined('__CLI_MODE') && __CLI_MODE === TRUE ) { $config['uri_protocol'] = 'AUTO'; } /* |-------------------------------------------------------------------------- | URL suffix |-------------------------------------------------------------------------- | | This option allows you to add a suffix to all URLs generated by CodeIgniter. | For more information please see the user guide: | | http://codeigniter.com/user_guide/general/urls.html */ $config['url_suffix'] = ''; /* |-------------------------------------------------------------------------- | Default Language |-------------------------------------------------------------------------- | | This determines which set of language files should be used. Make sure | there is an available translation if you intend to use something other | than english. | */ $config['language'] = 'english'; /* |-------------------------------------------------------------------------- | Default Character Set |-------------------------------------------------------------------------- | | This determines which character set is used by default in various methods | that require a character set to be provided. | */ $config['charset'] = 'UTF-8'; /* |-------------------------------------------------------------------------- | Enable/Disable System Hooks |-------------------------------------------------------------------------- | | If you would like to use the 'hooks' feature you must enable it by | setting this variable to TRUE (boolean). See the user guide for details. | */ $config['enable_hooks'] = FALSE; /* |-------------------------------------------------------------------------- | Class Extension Prefix |-------------------------------------------------------------------------- | | This item allows you to set the filename/classname prefix when extending | native libraries. For more information please see the user guide: | | http://codeigniter.com/user_guide/general/core_classes.html | http://codeigniter.com/user_guide/general/creating_libraries.html | */ $config['subclass_prefix'] = 'GI_'; /* |-------------------------------------------------------------------------- | Allowed URL Characters |-------------------------------------------------------------------------- | | This lets you specify with a regular expression which characters are permitted | within your URLs. When someone tries to submit a URL with disallowed | characters they will get a warning message. | | As a security measure you are STRONGLY encouraged to restrict URLs to | as few characters as possible. By default only these are allowed: a-z 0-9~%.:_- | | Leave blank to allow all characters -- but only if you are insane. | | DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!! | */ $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-'; /* |-------------------------------------------------------------------------- | Enable Query Strings |-------------------------------------------------------------------------- | | By default CodeIgniter uses search-engine friendly segment based URLs: | example.com/who/what/where/ | | By default CodeIgniter enables access to the $_GET array. If for some | reason you would like to disable it, set 'allow_get_array' to FALSE. | | You can optionally enable standard query string based URLs: | example.com?who=me&what=something&where=here | | Options are: TRUE or FALSE (boolean) | | The other items let you set the query string 'words' that will | invoke your controllers and its functions: | example.com/index.php?c=controller&m=function | | Please note that some of the helpers won't work as expected when | this feature is enabled, since CodeIgniter is designed primarily to | use segment based URLs. | */ $config['allow_get_array'] = TRUE; $config['enable_query_strings'] = FALSE; $config['controller_trigger'] = 'c'; $config['function_trigger'] = 'm'; $config['directory_trigger'] = 'd'; // experimental not currently in use /* |-------------------------------------------------------------------------- | Error Logging Threshold |-------------------------------------------------------------------------- | | If you have enabled error logging, you can set an error threshold to | determine what gets logged. Threshold options are: | You can enable error logging by setting a threshold over zero. The | threshold determines what gets logged. Threshold options are: | | 0 = Disables logging, Error logging TURNED OFF | 1 = Error Messages (including PHP errors) | 2 = Debug Messages | 3 = Informational Messages | 4 = All Messages | | For a live site you'll usually only enable Errors (1) to be logged otherwise | your log files will fill up very fast. | */ $config['log_threshold'] = 0; /* |-------------------------------------------------------------------------- | Error Logging Directory Path |-------------------------------------------------------------------------- | | Leave this BLANK unless you would like to set something other than the default | application/logs/ folder. Use a full server path with trailing slash. | */ $config['log_path'] = ''; /* |-------------------------------------------------------------------------- | Date Format for Logs |-------------------------------------------------------------------------- | | Each item that is logged has an associated date. You can use PHP date | codes to set your own date formatting | */ $config['log_date_format'] = 'Y-m-d H:i:s'; /* |-------------------------------------------------------------------------- | Cache Directory Path |-------------------------------------------------------------------------- | | Leave this BLANK unless you would like to set something other than the default | system/cache/ folder. Use a full server path with trailing slash. | */ $config['cache_path'] = ''; /* |-------------------------------------------------------------------------- | Encryption Key |-------------------------------------------------------------------------- | | If you use the Encryption class or the Session class you | MUST set an encryption key. See the user guide for info. | */ $config['encryption_key'] = 'dfsa09302qdflaskf0-2iq'; /* |-------------------------------------------------------------------------- | Session Variables |-------------------------------------------------------------------------- | | 'sess_cookie_name' = the name you want for the cookie | 'sess_expiration' = the number of SECONDS you want the session to last. | by default sessions last 7200 seconds (two hours). Set to zero for no expiration. | 'sess_expire_on_close' = Whether to cause the session to expire automatically | when the browser window is closed | 'sess_encrypt_cookie' = Whether to encrypt the cookie | 'sess_use_database' = Whether to save the session data to a database | 'sess_table_name' = The name of the session database table | 'sess_match_ip' = Whether to match the user's IP address when reading the session data | 'sess_match_useragent' = Whether to match the User Agent when reading the session data | 'sess_time_to_update' = how many seconds between CI refreshing Session Information | */ $config['sess_cookie_name'] = 'gi_session'; $config['sess_expiration'] = 7200; $config['sess_expire_on_close'] = FALSE; $config['sess_encrypt_cookie'] = FALSE; $config['sess_use_database'] = FALSE; $config['sess_table_name'] = 'ci_sessions'; $config['sess_match_ip'] = FALSE; $config['sess_match_useragent'] = TRUE; $config['sess_time_to_update'] = 300; /* |-------------------------------------------------------------------------- | Cookie Related Variables |-------------------------------------------------------------------------- | | 'cookie_prefix' = Set a prefix if you need to avoid collisions | 'cookie_domain' = Set to .your-domain.com for site-wide cookies | 'cookie_path' = Typically will be a forward slash | 'cookie_secure' = Cookies will only be set if a secure HTTPS connection exists. | */ $config['cookie_prefix'] = ""; $config['cookie_domain'] = ""; $config['cookie_path'] = "/"; $config['cookie_secure'] = FALSE; /* |-------------------------------------------------------------------------- | Global XSS Filtering |-------------------------------------------------------------------------- | | Determines whether the XSS filter is always active when GET, POST or | COOKIE data is encountered | */ $config['global_xss_filtering'] = FALSE; /* |-------------------------------------------------------------------------- | Cross Site Request Forgery |-------------------------------------------------------------------------- | Enables a CSRF cookie token to be set. When set to TRUE, token will be | checked on a submitted form. If you are accepting user data, it is strongly | recommended CSRF protection be enabled. | | 'csrf_token_name' = The token name | 'csrf_cookie_name' = The cookie name | 'csrf_expire' = The number in seconds the token should expire. */ $config['csrf_protection'] = FALSE; $config['csrf_token_name'] = 'csrf_test_name'; $config['csrf_cookie_name'] = 'csrf_cookie_name'; $config['csrf_expire'] = 7200; /* |-------------------------------------------------------------------------- | Output Compression |-------------------------------------------------------------------------- | | Enables Gzip output compression for faster page loads. When enabled, | the output class will test whether your server supports Gzip. | Even if it does, however, not all browsers support compression | so enable only if you are reasonably sure your visitors can handle it. | | VERY IMPORTANT: If you are getting a blank page when compression is enabled it | means you are prematurely outputting something to your browser. It could | even be a line of whitespace at the end of one of your scripts. For | compression to work, nothing can be sent before the output buffer is called | by the output class. Do not 'echo' any values with compression enabled. | */ $config['compress_output'] = FALSE; /* |-------------------------------------------------------------------------- | Master Time Reference |-------------------------------------------------------------------------- | | Options are 'local' or 'gmt'. This pref tells the system whether to use | your server's local time as the master 'now' reference, or convert it to | GMT. See the 'date helper' page of the user guide for information | regarding date handling. | */ $config['time_reference'] = 'local'; /* |-------------------------------------------------------------------------- | Rewrite PHP Short Tags |-------------------------------------------------------------------------- | | If your PHP installation does not have short tag support enabled CI | can rewrite the tags on-the-fly, enabling you to utilize that syntax | in your view files. Options are TRUE or FALSE (boolean) | */ $config['rewrite_short_tags'] = FALSE; /* |-------------------------------------------------------------------------- | Reverse Proxy IPs |-------------------------------------------------------------------------- | | If your server is behind a reverse proxy, you must whitelist the proxy IP | addresses from which CodeIgniter should trust the HTTP_X_FORWARDED_FOR | header in order to properly identify the visitor's IP address. | Comma-delimited, e.g. '10.0.1.200,10.0.1.201' | */ $config['proxy_ips'] = ''; /* End of file config.php */ /* Location: ./application/config/config.php */
Minds-On-Design-Lab/giving-impact
gi-api/application/config/config.php
PHP
mit
13,001
import { NO_ERRORS_SCHEMA } from '@angular/core'; import { inject, async, TestBed, ComponentFixture } from '@angular/core/testing'; // Load the implementations that should be tested import { AppComponent } from './app.component'; import { AppState } from './app.service'; describe(`App`, () => { });
Kseniya-Smirnova/study_app
src/app/app.component.spec.ts
TypeScript
mit
312
export function getName(value) { if (value == 0) { return "上班"; } if (value == 1) { return "下班"; } throw "invalid route direction"; } export function getValue(name) { if (name == "上班") { return 0; } if (name == "下班") { return 1; } throw "invalid route direction"; }
plantain-00/demo-set
js-demo/restful-api-demo/services/routeDirection.ts
TypeScript
mit
354
# reactjs-program A collection of ReactJS examples. ### Requirements 1) NodeJS & npm 2) python (optional, used for serving up HTTP) ### Getting Started You can view the examples through any HTTP server. The following assumes use of [Python's SimpleHTTPServer] (https://docs.python.org/2/library/simplehttpserver.html#module-SimpleHTTPServer) 1) Clone repo and cd into it. 2) Install dependencies: `npm install` 2) Start HTTP server: `python -m SimpleHTTPServer 8000`. You may need to install Python if not already installed. 3) Navigate to desired example, e.g., http://localhost:8000/todo/ ### Create An Example At the moment I'm enjoying using [browserify](http://browserify.org/) to organize and bundle dependencies within the browser. To get start, try the following: 1) `mkdir my_new_app && cd my_new_app` 2) `touch index.html && mkdir src && mkdir build` 2) `npm init` 3) `npm install --save react react-dom` 4) `npm install --save-dev babelify babel-preset-react` 5) `npm install -g browserify` 6) Bundle all dependencies: `browserify -t [ babelify --presets [ react ] ] src/main.js -o build/app.js` (assumes your final render takes place in `src/main.js`) 7) Include the following script tag in your index.html: `<script src="build/app.js"></script>` 8) Fire up your example on http://localhost:8000/my_new_app
DJO3/reactjs-demos
README.md
Markdown
mit
1,336
#ifndef VIEWER_H #define VIEWER_H #include "common.h" #include "drawable.h" #include "controller.h" class Viewer { public: bool glfw_is_up; GLFWwindow* window; GLuint VertexArrayID; int width; int height; Controller controls; std::vector<Drawable *> drawables; Viewer(); void add( Drawable *d) { drawables.push_back( d); } void fatal( std::string msg) { fprintf( stderr, "%s\n", msg.c_str()); getchar(); throw Exc(msg); } // Various inits void init(); int init_window(); int init_glew(); int init_vao(); void run(); virtual ~Viewer(); }; #endif
lrdennison/mcpe-view
src/viewer.h
C
mit
635
// config/database.js module.exports = { 'secret': 'puneetvashisht', 'url' : 'mongodb://localhost/userdb' // looks like mongodb://<user>:<pass>@mongo.onmodulus.net:27017/Mikha4ot };
arun2786/tk-mean
database.js
JavaScript
mit
191