code
stringlengths
3
1.01M
repo_name
stringlengths
5
116
path
stringlengths
3
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
3
1.01M
.list-of-brand img { /*max width and height make img fit into div*/ max-width: 100%; max-height: 100%; display: block; margin: auto auto; } .list-of-brand div { height: 100%; }
Saebyuckbaan/DeeCaf
public/assets/css/add-new-coffee.css
CSS
mit
203
class VideoRepliesController < ApplicationController before_filter :require_user, :only => [:create, :delete] def create @reply = VideoReply.new(params[:video_reply]) @reply.user = @current_user if @reply.save flash[:notice] = 'Reply Submitted Successfully' redirect_to @reply.video else render @reply.video end end def delete @reply = VideoReply.find(params[:id]) @video = @reply.video @reply.destroy redirect_to @video end end
AlexChien/shadowgraph
app/controllers/video_replies_controller.rb
Ruby
mit
492
// Copyright (c) Microsoft Corporation // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.Runtime.InteropServices; namespace Microsoft.Xbox.Services.Leaderboard { public partial class LeaderboardQuery { public string StatName { get; internal set; } public string SocialGroup { get; internal set; } public bool HasNext { get; internal set; } public uint SkipResultToRank { get { return pImpl.GetSkipResultToRank(); } set { pImpl.SetSkipResultToRank(value); } } public bool SkipResultToMe { get { return pImpl.GetSkipResultToMe(); } set { pImpl.SetSkipResultToMe(value); } } public SortOrder Order { get { return pImpl.GetOrder(); } set { pImpl.SetOrder(value); } } public uint MaxItems { get { return pImpl.GetMaxItems(); } set { pImpl.SetMaxItems(value); } } ILeaderboardQueryImpl pImpl; internal IntPtr GetPtr() { return pImpl.GetPtr(); } internal LeaderboardQuery(IntPtr ptr) { pImpl = new LeaderboardQueryImpl(ptr, this); } // todo remove after removing leaderboard service internal LeaderboardQuery(LeaderboardQuery query, string continuation) { } } }
MSFT-Heba/xbox-live-unity-plugin
CSharpSource/Source/api/Leaderboard/LeaderboardQuery.cs
C#
mit
1,787
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("SmallestElementInArray")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("SmallestElementInArray")] [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("96634337-40b8-4f26-ab7b-dea8a2771ef1")] // 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")]
Shtereva/Fundamentals-with-CSharp
Lists-ProcessingVariable-LengthSequences/SmallestElementInArray/Properties/AssemblyInfo.cs
C#
mit
1,420
/** * Returns an Express Router with bindings for the Admin UI static resources, * i.e files, less and browserified scripts. * * Should be included before other middleware (e.g. session management, * logging, etc) for reduced overhead. */ var browserify = require('../middleware/browserify'); var express = require('express'); var less = require('less-middleware'); var path = require('path'); module.exports = function createStaticRouter (keystone) { var router = express.Router(); /* Prepare browserify bundles */ var bundles = { fields: browserify('utils/fields.js', 'FieldTypes'), signin: browserify('Signin/index.js'), index: browserify('index.js'), }; // prebuild static resources on the next tick // improves first-request performance process.nextTick(function () { bundles.fields.build(); bundles.signin.build(); bundles.index.build(); }); /* Prepare LESS options */ var elementalPath = path.join(path.dirname(require.resolve('elemental')), '..'); var reactSelectPath = path.join(path.dirname(require.resolve('react-select')), '..'); var customStylesPath = keystone.getPath('adminui custom styles') || ''; var lessOptions = { render: { modifyVars: { elementalPath: JSON.stringify(elementalPath), reactSelectPath: JSON.stringify(reactSelectPath), customStylesPath: JSON.stringify(customStylesPath), adminPath: JSON.stringify(keystone.get('admin path')), }, }, }; /* Configure router */ router.use('/styles', less(path.resolve(__dirname + '/../../public/styles'), lessOptions)); router.use('/styles/fonts', express.static(path.resolve(__dirname + '/../../public/js/lib/tinymce/skins/keystone/fonts'))); router.get('/js/fields.js', bundles.fields.serve); router.get('/js/signin.js', bundles.signin.serve); router.get('/js/index.js', bundles.index.serve); router.use(express.static(path.resolve(__dirname + '/../../public'))); return router; };
joerter/keystone
admin/server/app/createStaticRouter.js
JavaScript
mit
1,923
<div ng-include src="'templates/partials/sidebar.tpl.html'" id="sidebar" class="hidden-xs"></div> <div id="main" class="secure fixed" ui-view="content" ng-hide="advSearchIsOpen"></div> <ng-include src="'templates/partials/composer.tpl.html'" id="composerFrame"></ng-include> <ng-include src="'templates/partials/form.bug.tpl.html'"></ng-include> <ng-include src="'templates/partials/safari.attachment.warning.tpl.html'"></ng-include> <ng-include ng-if="isLoggedIn" src="'templates/partials/form.search.tpl.html'"></ng-include> <div id="backdrop" ng-show="networkActivity.loading()"></div>
GovanifY/WebClient
src/app/templates/layout/secured.tpl.html
HTML
mit
591
/* * User: aleksey.nakoryakov * Date: 03.08.12 * Time: 12:32 */ using System; using System.Reflection; using Autodesk.AutoCAD.ApplicationServices; namespace LayoutsFromModel { /// <summary> /// Класс для работы с настройками AutoCAD /// </summary> public static class AcadPreferencesHelper { /// <summary> /// Метод задаёт значение для настройки LayoutCreateViewport /// </summary> /// <param name="newValue">Новое значение настройки</param> /// <returns>Старое значение настройки</returns> public static bool SetLayoutCreateViewportProperty(bool newValue) { object acadObject = Application.AcadApplication; object preferences = acadObject.GetType().InvokeMember("Preferences", BindingFlags.GetProperty, null, acadObject, null); object display = preferences.GetType().InvokeMember("Display", BindingFlags.GetProperty, null, preferences, null); object layoutProperty = display .GetType().InvokeMember("LayoutCreateViewport", BindingFlags.GetProperty, null, display, null); bool layoutCreateViewportProperty = Convert.ToBoolean(layoutProperty); object[] dataArray = new object[]{newValue}; display.GetType() .InvokeMember("LayoutCreateViewport", BindingFlags.SetProperty, null, display, dataArray); return layoutCreateViewportProperty; } } }
bargool/LayoutsFromModel
LayoutsFromModel/Helpers/AcadPreferencesHelper.cs
C#
mit
1,694
/* ** my_putchar.c for my_putchar in /home/soto_a/my_funcs ** ** Made by adam kaso ** Login <soto_a@epitech.net> ** ** Started on Wed Oct 1 10:04:23 2014 adam kaso ** Last update Fri Jan 16 14:28:51 2015 Kaso Soto */ #include "my.h" void my_putchar(char c) { if (write(1, &c, 1) == -1) exit(EXIT_FAILURE); }
KASOGIT/bsq
lib/src/my_putchar.c
C
mit
322
package org.nextrtc.signalingserver.api; import lombok.extern.log4j.Log4j; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Service; import com.google.common.eventbus.EventBus; @Log4j @Service("nextRTCEventBus") @Scope("singleton") public class NextRTCEventBus { private EventBus eventBus; public NextRTCEventBus() { this.eventBus = new EventBus(); } public void post(NextRTCEvent event) { log.info("POSTED EVENT: " + event); eventBus.post(event); } @Deprecated public void post(Object o) { eventBus.post(o); } public void register(Object listeners) { log.info("REGISTERED LISTENER: " + listeners); eventBus.register(listeners); } }
kevintanhongann/nextrtc-signaling-server
src/main/java/org/nextrtc/signalingserver/api/NextRTCEventBus.java
Java
mit
719
--- layout: page title: Bradley - Anthony Wedding date: 2016-05-24 author: Martha Shaw tags: weekly links, java status: published summary: In id rutrum sem. Fusce ac feugiat ligula, id sagittis. banner: images/banner/leisure-03.jpg booking: startDate: 06/29/2016 endDate: 07/04/2016 ctyhocn: LGUUTHX groupCode: BAW published: true --- Morbi mattis, nulla non feugiat ultrices, dui lacus egestas est, et pulvinar tortor justo et libero. Pellentesque euismod leo fringilla leo vehicula, eu efficitur quam venenatis. Fusce ultricies eros at est tempus pulvinar elementum id tortor. Ut eleifend a quam porta fermentum. Pellentesque pharetra blandit diam mollis venenatis. Proin nec eleifend est, a fringilla enim. Morbi commodo elit sit amet aliquam convallis. Donec sollicitudin urna et nibh facilisis, eget volutpat arcu volutpat. Nam ut magna et leo feugiat euismod. Suspendisse in commodo nisi. Nunc ac tellus ut turpis pretium ultricies eu a orci. * Mauris quis purus non metus consectetur imperdiet * Donec id nisi sit amet turpis cursus molestie ac id diam * Mauris ut sapien a nulla tempus dictum * Mauris accumsan justo quis justo blandit congue. Sed eu tempor nunc. Cras scelerisque quam ut placerat pulvinar. Quisque feugiat molestie ante, eu cursus ex tristique a. Morbi tristique commodo ultrices. Sed pharetra risus quis risus ornare molestie. Vestibulum porta lacus quis purus eleifend cursus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cras imperdiet, dui a viverra vehicula, nisl arcu auctor enim, et ullamcorper massa sem quis purus. Aliquam nulla eros, tempor vitae tellus vitae, rutrum imperdiet velit. Donec ultricies dolor enim, quis ullamcorper leo egestas non. Nullam bibendum lectus non venenatis imperdiet. Sed faucibus lectus ac sapien blandit imperdiet. In et velit at nisl gravida tristique ut quis sem. Nunc ut magna hendrerit, pulvinar massa et, suscipit nisi. Etiam sed eros eget urna facilisis lobortis non eu nibh. Pellentesque lacinia sagittis interdum.
KlishGroup/prose-pogs
pogs/L/LGUUTHX/BAW/index.md
Markdown
mit
2,038
'use strict' const isPlainObject = require('lodash.isplainobject') const getPath = require('lodash.get') const StaticComponent = require('./StaticComponent') const DynamicComponent = require('./DynamicComponent') const LinkedComponent = require('./LinkedComponent') const ContainerComponent = require('./ContainerComponent') const MissingComponent = require('./MissingComponent') module.exports = { coerce, value: makeStaticComponent, factory: makeDynamicComponent, link: makeLinkedComponent, container: makeContainerComponent, missing: makeMissingComponent } function makeStaticComponent(value) { return new StaticComponent(value) } makeDynamicComponent.predefinedFrom = PredefinedComponentBuilder function makeDynamicComponent(factory, context) { return new DynamicComponent(factory, context) } function PredefinedComponentBuilder(implementations) { return function PredefinedComponent(implementationName, context) { let implementation = getPath(implementations, implementationName) return makeDynamicComponent(implementation, context) } } makeLinkedComponent.boundTo = BoundLinkBuilder function makeLinkedComponent(context, targetKey) { return new LinkedComponent(context, targetKey) } function BoundLinkBuilder(container) { return function BoundLink(targetKey) { return makeLinkedComponent(container, targetKey) } } function makeContainerComponent(container) { return new ContainerComponent(container) } function makeMissingComponent(key) { return new MissingComponent(key) } function coerce(component) { switch (true) { case _isComponent(component): return component case isPlainObject(component): return makeContainerComponent(component) default: return makeStaticComponent(component) } } function _isComponent(component) { return component && component.instantiate && component.unwrap && true }
zaboco/deependr
src/components/index.js
JavaScript
mit
1,892
# Include hook code here require 'active_record' require 'qds' ActiveRecord::Base.extend MindAsLab::Searchable
mindaslab/qds
init.rb
Ruby
mit
112
require File.expand_path(File.dirname(__FILE__) + '/spec_helper') describe "Cards" do it "fails" do fail "hey buddy, you should probably rename this file and start specing for real" end end
rhyhann/cards
spec/cards_spec.rb
Ruby
mit
199
//----------------------------------------------------------------------- // <copyright file="PropertiesFileGenerator.cs" company="SonarSource SA and Microsoft Corporation"> // Copyright (c) SonarSource SA and Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // </copyright> //----------------------------------------------------------------------- using SonarQube.Common; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; namespace SonarRunner.Shim { public static class PropertiesFileGenerator { private const string ProjectPropertiesFileName = "sonar-project.properties"; public const string VSBootstrapperPropertyKey = "sonar.visualstudio.enable"; public const string BuildWrapperOutputDirectoryKey = "sonar.cfamily.build-wrapper-output"; #region Public methods /// <summary> /// Locates the ProjectInfo.xml files and uses the information in them to generate /// a sonar-runner properties file /// </summary> /// <returns>Information about each of the project info files that was processed, together with /// the full path to generated file. /// Note: the path to the generated file will be null if the file could not be generated.</returns> public static ProjectInfoAnalysisResult GenerateFile(AnalysisConfig config, ILogger logger) { return GenerateFile(config, logger, new RoslynV1SarifFixer()); } public /* for test */ static ProjectInfoAnalysisResult GenerateFile(AnalysisConfig config, ILogger logger, IRoslynV1SarifFixer fixer) { if (config == null) { throw new ArgumentNullException("config"); } if (logger == null) { throw new ArgumentNullException("logger"); } string fileName = Path.Combine(config.SonarOutputDir, ProjectPropertiesFileName); logger.LogDebug(Resources.MSG_GeneratingProjectProperties, fileName); IEnumerable<ProjectInfo> projects = ProjectLoader.LoadFrom(config.SonarOutputDir); if (projects == null || !projects.Any()) { logger.LogError(Resources.ERR_NoProjectInfoFilesFound); return new ProjectInfoAnalysisResult(); } FixSarifReport(logger, projects, fixer); PropertiesWriter writer = new PropertiesWriter(config); ProjectInfoAnalysisResult result = ProcessProjectInfoFiles(projects, writer, logger); IEnumerable<ProjectInfo> validProjects = result.GetProjectsByStatus(ProjectInfoValidity.Valid); if (validProjects.Any()) { // Handle global settings AnalysisProperties properties = GetAnalysisPropertiesToWrite(config, logger); writer.WriteGlobalSettings(properties); string contents = writer.Flush(); result.FullPropertiesFilePath = fileName; File.WriteAllText(result.FullPropertiesFilePath, contents, Encoding.ASCII); } else { // if the user tries to build multiple configurations at once there will be duplicate projects if (result.GetProjectsByStatus(ProjectInfoValidity.DuplicateGuid).Any()) { logger.LogError(Resources.ERR_NoValidButDuplicateProjects); } else { logger.LogError(Resources.ERR_NoValidProjectInfoFiles); } } return result; } /// <summary> /// Loads SARIF reports from the given projects and attempts to fix /// improper escaping from Roslyn V1 (VS 2015 RTM) where appropriate. /// </summary> private static void FixSarifReport(ILogger logger, IEnumerable<ProjectInfo> projects, IRoslynV1SarifFixer fixer /* for test */) { // attempt to fix invalid project-level SARIF emitted by Roslyn 1.0 (VS 2015 RTM) foreach (ProjectInfo project in projects) { Property reportPathProperty; bool tryResult = project.TryGetAnalysisSetting(RoslynV1SarifFixer.ReportFilePropertyKey, out reportPathProperty); if (tryResult) { string reportPath = reportPathProperty.Value; string fixedPath = fixer.LoadAndFixFile(reportPath, logger); if (!reportPath.Equals(fixedPath)) // only need to alter the property if there was no change { // remove the property ahead of changing it // if the new path is null, the file was unfixable and we should leave the property out project.AnalysisSettings.Remove(reportPathProperty); if (fixedPath != null) { // otherwise, set the property value (results in no change if the file was already valid) Property newReportPathProperty = new Property(); newReportPathProperty.Id = RoslynV1SarifFixer.ReportFilePropertyKey; newReportPathProperty.Value = fixedPath; project.AnalysisSettings.Add(newReportPathProperty); } } } } } #endregion #region Private methods private static ProjectInfoAnalysisResult ProcessProjectInfoFiles(IEnumerable<ProjectInfo> projects, PropertiesWriter writer, ILogger logger) { ProjectInfoAnalysisResult result = new ProjectInfoAnalysisResult(); foreach (ProjectInfo projectInfo in projects) { ProjectInfoValidity status = ClassifyProject(projectInfo, projects, logger); if (status == ProjectInfoValidity.Valid) { IEnumerable<string> files = GetFilesToAnalyze(projectInfo, logger); if (files == null || !files.Any()) { status = ProjectInfoValidity.NoFilesToAnalyze; } else { string fxCopReport = TryGetFxCopReport(projectInfo, logger); string vsCoverageReport = TryGetCodeCoverageReport(projectInfo, logger); writer.WriteSettingsForProject(projectInfo, files, fxCopReport, vsCoverageReport); } } result.Projects.Add(projectInfo, status); } return result; } private static ProjectInfoValidity ClassifyProject(ProjectInfo projectInfo, IEnumerable<ProjectInfo> projects, ILogger logger) { if (projectInfo.IsExcluded) { logger.LogInfo(Resources.MSG_ProjectIsExcluded, projectInfo.FullPath); return ProjectInfoValidity.ExcludeFlagSet; } if (!IsProjectGuidValue(projectInfo)) { logger.LogWarning(Resources.WARN_InvalidProjectGuid, projectInfo.ProjectGuid, projectInfo.FullPath); return ProjectInfoValidity.InvalidGuid; } if (HasDuplicateGuid(projectInfo, projects)) { logger.LogWarning(Resources.WARN_DuplicateProjectGuid, projectInfo.ProjectGuid, projectInfo.FullPath); return ProjectInfoValidity.DuplicateGuid; } return ProjectInfoValidity.Valid; } private static bool IsProjectGuidValue(ProjectInfo project) { return project.ProjectGuid != Guid.Empty; } private static bool HasDuplicateGuid(ProjectInfo projectInfo, IEnumerable<ProjectInfo> projects) { return projects.Count(p => !p.IsExcluded && p.ProjectGuid == projectInfo.ProjectGuid) > 1; } /// <summary> /// Returns all of the valid files that can be analyzed. Logs warnings/info about /// files that cannot be analyzed. /// </summary> private static IEnumerable<string> GetFilesToAnalyze(ProjectInfo projectInfo, ILogger logger) { // We're only interested in files that exist and that are under the project root var result = new List<string>(); var baseDir = projectInfo.GetProjectDirectory(); foreach (string file in projectInfo.GetAllAnalysisFiles()) { if (File.Exists(file)) { if (IsInFolder(file, baseDir)) { result.Add(file); } else { logger.LogWarning(Resources.WARN_FileIsOutsideProjectDirectory, file, projectInfo.FullPath); } } else { logger.LogWarning(Resources.WARN_FileDoesNotExist, file); } } return result; } private static bool IsInFolder(string filePath, string folder) { string normalizedPath = Path.GetDirectoryName(Path.GetFullPath(filePath)); return normalizedPath.StartsWith(folder, StringComparison.OrdinalIgnoreCase); } private static string TryGetFxCopReport(ProjectInfo project, ILogger logger) { string fxCopReport = project.TryGetAnalysisFileLocation(AnalysisType.FxCop); if (fxCopReport != null) { if (!File.Exists(fxCopReport)) { fxCopReport = null; logger.LogWarning(Resources.WARN_FxCopReportNotFound, fxCopReport); } } return fxCopReport; } private static string TryGetCodeCoverageReport(ProjectInfo project, ILogger logger) { string vsCoverageReport = project.TryGetAnalysisFileLocation(AnalysisType.VisualStudioCodeCoverage); if (vsCoverageReport != null) { if (!File.Exists(vsCoverageReport)) { vsCoverageReport = null; logger.LogWarning(Resources.WARN_CodeCoverageReportNotFound, vsCoverageReport); } } return vsCoverageReport; } /// <summary> /// Returns all of the analysis properties that should /// be written to the sonar-project properties file /// </summary> private static AnalysisProperties GetAnalysisPropertiesToWrite(AnalysisConfig config, ILogger logger) { AnalysisProperties properties = new AnalysisProperties(); properties.AddRange(config.GetAnalysisSettings(false).GetAllProperties() // Strip out any sensitive properties .Where(p => !p.ContainsSensitiveData())); // There are some properties we want to override regardless of what the user sets AddOrSetProperty(VSBootstrapperPropertyKey, "false", properties, logger); // Special case processing for known properties RemoveBuildWrapperSettingIfDirectoryEmpty(properties, logger); return properties; } private static void AddOrSetProperty(string key, string value, AnalysisProperties properties, ILogger logger) { Property property; Property.TryGetProperty(key, properties, out property); if (property == null) { logger.LogDebug(Resources.MSG_SettingAnalysisProperty, key, value); property = new Property() { Id = key, Value = value }; properties.Add(property); } else { if (string.Equals(property.Value, value, StringComparison.InvariantCulture)) { logger.LogDebug(Resources.MSG_MandatorySettingIsCorrectlySpecified, key, value); } else { logger.LogWarning(Resources.WARN_OverridingAnalysisProperty, key, value); property.Value = value; } } } /// <summary> /// Passing in an invalid value for the build wrapper output directory will cause the C++ plugin to /// fail (invalid = missing or empty directory) so we'll remove invalid settings /// </summary> private static void RemoveBuildWrapperSettingIfDirectoryEmpty(AnalysisProperties properties, ILogger logger) { // The property is set early in the analysis process before any projects are analysed. We can't // tell at this point if the directory missing/empty is error or not - it could just be that all // of the Cpp projects have been excluded from analysis. // We're assuming that if the build wrapper output was not written due to an error elsewhere then // that error will have been logged or reported at the point it occurred. Consequently, we;ll // just write debug output to record what we're doing. Property directoryProperty; if (Property.TryGetProperty(BuildWrapperOutputDirectoryKey, properties, out directoryProperty)) { string path = directoryProperty.Value; if (!Directory.Exists(path) || IsDirectoryEmpty(path)) { logger.LogDebug(Resources.MSG_RemovingBuildWrapperAnalysisProperty, BuildWrapperOutputDirectoryKey, path); properties.Remove(directoryProperty); } else { logger.LogDebug(Resources.MSG_BuildWrapperPropertyIsValid, BuildWrapperOutputDirectoryKey, path); } } } private static bool IsDirectoryEmpty(string path) { return Directory.GetFiles(path, "*.*", SearchOption.AllDirectories).Length == 0; } #endregion } }
HSAR/sonar-msbuild-runner
SonarRunner.Shim/PropertiesFileGenerator.cs
C#
mit
14,482
'use strict'; var program = require('commander'); var Q = require('q'); var fs = require('fs'); var resolve = require('path').resolve; var stat = Q.denodeify(fs.stat); var readFile = Q.denodeify(fs.readFile); var writeFile = Q.denodeify(fs.writeFile); var assign = require('./util/assign'); program .option('--get', 'Gets configuration property') .option('--set', 'Sets a configuration value: Ex: "hello=world". If no value is set, then the property is unset from the config file'); program.parse(process.argv); var args = program.args; var opts = program.opts(); // Remove options that are not set in the same order as described above var selectedOpt = Object.keys(opts).reduce(function (arr, next) { if (opts[next]) { arr.push(next); } return arr; }, [])[0]; if (!args.length) { process.exit(1); } args = []; args.push(program.args[0].replace(/=.*$/, '')); args.push(program.args[0].replace(new RegExp(args[0] + '=?'), '')); if (args[1] === '') { args[1] = undefined; } stat(resolve('./fxc.json')) .then(function (stat) { if (stat.isFile()) { return readFile(resolve('./fxc.json')); } }) .catch(function () { return Q.when(null); }) .then(function (fileContent) { fileContent = assign({}, fileContent && JSON.parse(fileContent.toString('utf8'))); if (selectedOpt === 'get') { return fileContent[args[0]]; } if (typeof args[1] !== 'undefined') { fileContent[args[0]] = args[1]; } else { delete fileContent[args[0]]; } return writeFile(resolve('./fxc.json'), JSON.stringify(fileContent)); }) .then(function (output) { if (output) { console.log(output); } else { console.log('Property "' + args[0] + '" ' + (args[1] ? ('set to "' + args[1] + '"') : 'removed')); } process.exit(); });
zorrodg/fox-cove
lib/config.js
JavaScript
mit
1,822
require "pubdraft/version" require "pubdraft/engine" require "pubdraft/state" require "pubdraft/model" module Pubdraft def pubdraft(**options) include Model::InstanceMethods extend Model::ClassMethods cattr_accessor :pubdraft_states cattr_accessor :pubdraft_options before_create :set_pubdraft_default, unless: -> { pubdraft_options[:default] == false } states = options.delete(:states) || Pubdraft.default_states self.pubdraft_states = State.new_set(states) self.pubdraft_options = Pubdraft.default_options.merge(options) build_pubdraft_methods! end def self.default_states { drafted: :draft, published: :publish } end def self.default_options { field: 'state', default: 'published' } end end
neotericdesign/pubdraft
lib/pubdraft.rb
Ruby
mit
772
package pt.lsts.imc; import java.io.IOException; import java.net.URI; import java.util.concurrent.Future; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.annotations.OnWebSocketConnect; import org.eclipse.jetty.websocket.api.annotations.OnWebSocketMessage; import org.eclipse.jetty.websocket.api.annotations.WebSocket; import org.eclipse.jetty.websocket.client.ClientUpgradeRequest; import org.eclipse.jetty.websocket.client.WebSocketClient; @WebSocket public class ImcClientSocket { protected Session remote; protected WebSocketClient client = new WebSocketClient(); @OnWebSocketConnect public void onConnect(Session remote) { this.remote = remote; } @OnWebSocketMessage public void onBinary(Session session, byte buff[], int offset, int length) { try { IMCMessage msg = ImcProxyServer.deserialize(buff, offset, length); onMessage(msg); } catch (Exception e) { e.printStackTrace(); } } public void onMessage(IMCMessage msg) { msg.dump(System.out); } public void sendMessage(IMCMessage msg) throws IOException { if (remote == null || !remote.isOpen()) throw new IOException("Error sending message: not connected"); remote.getRemote().sendBytes(ImcProxyServer.wrap(msg)); } public Future<Session> connect(URI server) throws Exception { client.start(); return client.connect(this, server, new ClientUpgradeRequest()); } public void close() throws Exception { client.stop(); } public static void main(String[] args) throws Exception { ImcClientSocket socket = new ImcClientSocket(); Future<Session> future = socket.connect(new URI("ws://localhost:9090")); System.out.printf("Connecting..."); future.get(); socket.sendMessage(new Temperature(10.67f)); socket.close(); } }
LSTS/imcproxy
src/pt/lsts/imc/ImcClientSocket.java
Java
mit
1,796
# Dropbox This application is for demonstration purposes only. ## Frameworks/Tools - coming soon ## Design - Product design was created in Adobe Photoshop CC: [Raw PSD files](https://github.com/nicholas-davis/dropbox-angular-bootstrap/tree/master/design/mockups/app) / [PNG files](https://github.com/nicholas-davis/dropbox-angular-bootstrap/tree/master/design/mockups/app/screenshots) ## Demo - coming soon
nicholas-davis/dropbox-angular-bootstrap
README.md
Markdown
mit
411
<?php namespace Core; use Silex\ControllerCollection; abstract class AbstractController { /** * * @var Application */ protected $app; public function __construct( Application $app ) { $this->app = $app; } /** * * @param \Silex\ControllerCollection $controllers * @return \Silex\ControllerCollection */ public function __invoke( ControllerCollection $controllers = null ) { return $this->connect( $controllers ?: $this->app['controllers_factory'] ); } /** * @param \Silex\ControllerCollection $controllers * @return \Silex\ControllerCollection */ abstract protected function connect( ControllerCollection $controllers ); }
kor3k/silex
src/Core/AbstractController.php
PHP
mit
714
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_18) on Mon Feb 08 23:29:05 EST 2010 --> <TITLE> ProductComponent </TITLE> <META NAME="date" CONTENT="2010-02-08"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="ProductComponent"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ProductComponent.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../../../splar/plugins/configuration/bdd/javabdd/catalog/ProductCatalog.html" title="class in splar.plugins.configuration.bdd.javabdd.catalog"><B>PREV CLASS</B></A>&nbsp; &nbsp;NEXT CLASS</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?splar/plugins/configuration/bdd/javabdd/catalog/ProductComponent.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="ProductComponent.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> splar.plugins.configuration.bdd.javabdd.catalog</FONT> <BR> Class ProductComponent</H2> <PRE> java.lang.Object <IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by "><B>splar.plugins.configuration.bdd.javabdd.catalog.ProductComponent</B> </PRE> <HR> <DL> <DT><PRE>public class <B>ProductComponent</B><DT>extends java.lang.Object</DL> </PRE> <P> <HR> <P> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../../splar/plugins/configuration/bdd/javabdd/catalog/ProductComponent.html#ProductComponent(java.lang.String, java.lang.String)">ProductComponent</A></B>(java.lang.String&nbsp;id, java.lang.String&nbsp;name)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../splar/plugins/configuration/bdd/javabdd/catalog/ProductComponent.html#addComponentType(java.lang.String)">addComponentType</A></B>(java.lang.String&nbsp;typeID)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../splar/plugins/configuration/bdd/javabdd/catalog/ProductComponent.html#getID()">getID</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../splar/plugins/configuration/bdd/javabdd/catalog/ProductComponent.html#getName()">getName</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.util.Set&lt;java.lang.String&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../splar/plugins/configuration/bdd/javabdd/catalog/ProductComponent.html#getTypes()">getTypes</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../splar/plugins/configuration/bdd/javabdd/catalog/ProductComponent.html#toString()">toString</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD> </TR> </TABLE> &nbsp; <P> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="ProductComponent(java.lang.String, java.lang.String)"><!-- --></A><H3> ProductComponent</H3> <PRE> public <B>ProductComponent</B>(java.lang.String&nbsp;id, java.lang.String&nbsp;name)</PRE> <DL> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="getID()"><!-- --></A><H3> getID</H3> <PRE> public java.lang.String <B>getID</B>()</PRE> <DL> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getName()"><!-- --></A><H3> getName</H3> <PRE> public java.lang.String <B>getName</B>()</PRE> <DL> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getTypes()"><!-- --></A><H3> getTypes</H3> <PRE> public java.util.Set&lt;java.lang.String&gt; <B>getTypes</B>()</PRE> <DL> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="addComponentType(java.lang.String)"><!-- --></A><H3> addComponentType</H3> <PRE> public void <B>addComponentType</B>(java.lang.String&nbsp;typeID)</PRE> <DL> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="toString()"><!-- --></A><H3> toString</H3> <PRE> public java.lang.String <B>toString</B>()</PRE> <DL> <DD><DL> <DT><B>Overrides:</B><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE></DL> </DD> <DD><DL> </DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ProductComponent.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../../../splar/plugins/configuration/bdd/javabdd/catalog/ProductCatalog.html" title="class in splar.plugins.configuration.bdd.javabdd.catalog"><B>PREV CLASS</B></A>&nbsp; &nbsp;NEXT CLASS</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?splar/plugins/configuration/bdd/javabdd/catalog/ProductComponent.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="ProductComponent.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>
axel-halin/Thesis-JHipster
Dependencies/SPLAR/doc/splar/plugins/configuration/bdd/javabdd/catalog/ProductComponent.html
HTML
mit
12,496
# Activerecord::Slave [![Build Status](https://travis-ci.org/hirocaster/activerecord-slave.svg?branch=master)](https://travis-ci.org/hirocaster/activerecord-slave) [![Coverage Status](https://coveralls.io/repos/hirocaster/activerecord-slave/badge.svg?branch=master&service=github)](https://coveralls.io/github/hirocaster/activerecord-slave?branch=master) [![Code Climate](https://codeclimate.com/github/hirocaster/activerecord-slave/badges/gpa.svg)](https://codeclimate.com/github/hirocaster/activerecord-slave) ActiveRecord for MySQL Replication databases(master/slave). ## Installation Add this line to your application's Gemfile: gem 'activerecord-slave' And then execute: $ bundle Or install it yourself as: $ gem install activerecord-slave ## Usage Add database connections to your application's config/database.yml: ```yaml default: &default adapter: mysql2 encoding: utf8 pool: 5 database: user username: root password: host: localhost user_master: <<: *default host: master.db.example.com user_slave_001: <<: *default host: slave_001.db.example.com user_slave_002: <<: *default host: slave_002.db.example.com ``` Add this example, your application's config/initializers/active_record_slave.rb: ```ruby ActiveRecord::Slave.configure do |config| config.define_replication(:user) do |replication| # replication name replication.register_master(:user_master) # master connection replication.register_slave(:user_slave_001, 70) # slave connection, weight replication.register_slave(:user_slave_002, 30) end end ``` ### Model app/model/user.rb ```ruby class User < ActiveRecord::Base include ActiveRecord::Slave::Model use_slave :user # replicaition name end ``` Query for master database. ```ruby User.all User.find(1) User.where(name: "foobar") ``` Query for slave databases. distrebute(load-balance) connection by configured weight settings. ```ruby User.slave_for.all User.slave_for.find(1) User.slave_for.where(name: "foobar") ``` ## Contributing 1. Fork it ( http://github.com/hirocaster/activerecord-slave/fork ) 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request
w1mvy/activerecord-slave
README.md
Markdown
mit
2,324
# -*- coding: utf-8 -*- import json from axe.http_exceptions import BadJSON def get_request(request): return request def get_query(request): return request.args def get_form(request): return request.form def get_body(request): return request.data def get_headers(request): return request.headers def get_cookies(request): return request.cookies def get_method(request): return request.method def get_json(headers, body): content_type = headers.get('Content-Type') if content_type != 'application/json': return data = body.decode('utf8') try: return json.loads(data) except ValueError: raise BadJSON
soasme/axe
axe/default_exts.py
Python
mit
680
# This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). # # Examples: # # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) # Mayor.create(:name => 'Emanuel', :city => cities.first)
warolv/wikydoc
db/seeds.rb
Ruby
mit
362
'use strict'; import cheerio = require('cheerio'); import fs = require('fs'); import mkdirp = require('mkdirp'); import my_request = require('./my_request'); import path = require('path'); import subtitle from './subtitle/index'; import vlos from './vlos'; import video from './video/index'; import xml2js = require('xml2js'); import log = require('./log'); /** * Streams the episode to disk. */ export default function(config: IConfig, address: string, done: (err: Error, ign: boolean) => void) { scrapePage(config, address, (err, page) => { if (err) { return done(err, false); } if (page.media != null) { /* No player to scrape */ download(config, page, null, done); } else { /* The old way */ scrapePlayer(config, address, page.id, (errS, player) => { if (errS) { return done(errS, false); } download(config, page, player, done); }); } }); } /** * Completes a download and writes the message with an elapsed time. */ function complete(epName: string, message: string, begin: number, done: (err: Error, ign: boolean) => void) { const timeInMs = Date.now() - begin; const seconds = prefix(Math.floor(timeInMs / 1000) % 60, 2); const minutes = prefix(Math.floor(timeInMs / 1000 / 60) % 60, 2); const hours = prefix(Math.floor(timeInMs / 1000 / 60 / 60), 2); log.dispEpisode(epName, message + ' (' + hours + ':' + minutes + ':' + seconds + ')', true); done(null, false); } /** * Check if a file exist.. */ function fileExist(path: string) { try { fs.statSync(path); return true; } catch (e) { return false; } } function sanitiseFileName(str: string) { const sanitized = str.replace(/[\/':\?\*"<>\\\.\|]/g, '_'); return sanitized.replace(/{DIR_SEPARATOR}/g, '/'); } /** * Downloads the subtitle and video. */ function download(config: IConfig, page: IEpisodePage, player: IEpisodePlayer, done: (err: Error | string, ign: boolean) => void) { const serieFolder = sanitiseFileName(config.series || page.series); let fileName = sanitiseFileName(generateName(config, page)); let filePath = path.join(config.output || process.cwd(), serieFolder, fileName); if (fileExist(filePath + '.mkv')) { let count = 0; if (config.rebuildcrp) { log.warn('Adding \'' + fileName + '\' to the DB...'); return done(null, false); } log.warn('File \'' + fileName + '\' already exist...'); do { count = count + 1; fileName = sanitiseFileName(generateName(config, page, '-' + count)); filePath = path.join(config.output || process.cwd(), serieFolder, fileName); } while (fileExist(filePath + '.mkv')); log.warn('Renaming to \'' + fileName + '\'...'); page.filename = fileName; } if (config.rebuildcrp) { log.warn('Ignoring \'' + fileName + '\' as it does not exist...'); return done(null, true); } const ret = mkdirp(path.dirname(filePath)); if (ret) { log.dispEpisode(fileName, 'Fetching...', false); downloadSubtitle(config, page, player, filePath, (errDS) => { if (errDS) { log.dispEpisode(fileName, 'Error...', true); return done(errDS, false); } const now = Date.now(); if ( ((page.media === null) && (player.video.file !== undefined)) || ((page.media !== null) /* Do they still create page in advance for unreleased episodes? */) ) { log.dispEpisode(fileName, 'Fetching video...', false); downloadVideo(config, page, player, filePath, (errDV) => { if (errDV) { log.dispEpisode(fileName, 'Error...', true); return done(errDV, false); } if (config.merge) { return complete(fileName, 'Finished!', now, done); } let isSubtitled = true; if (page.media === null) { isSubtitled = Boolean(player.subtitle); } else { if (page.media.subtitles.length === 0) { isSubtitled = false; } } let videoExt = '.mp4'; if ( (page.media === null) && (player.video.mode === 'RTMP')) { videoExt = path.extname(player.video.file); } log.dispEpisode(fileName, 'Merging...', false); video.merge(config, isSubtitled, videoExt, filePath, config.verbose, (errVM) => { if (errVM) { log.dispEpisode(fileName, 'Error...', true); return done(errVM, false); } complete(fileName, 'Finished!', now, done); }); }); } else { log.dispEpisode(fileName, 'Ignoring: not released yet', true); done(null, true); } }); } else { log.dispEpisode(fileName, 'Error creating folder \'' + filePath + '\'...', true); return done('Cannot create folder', false); } } /** * Saves the subtitles to disk. */ function downloadSubtitle(config: IConfig, page: IEpisodePage, player: IEpisodePlayer, filePath: string, done: (err?: Error | string) => void) { if (page.media !== null) { const subs = page.media.subtitles; if (subs.length === 0) { /* No downloadable subtitles */ console.warn('Can\'t find subtitle ?!'); return done(); } let i; let j; /* Find a proper subtitles */ for (j = 0; j < config.sublang.length; j++) { const reqSubLang = config.sublang[j]; for (i = 0; i < subs.length; i++) { const curSub = subs[i]; if (curSub.format === 'ass' && curSub.language === reqSubLang) { my_request.get(config, curSub.url, (err, result) => { if (err) { log.error('An error occured while fetching subtitles...'); return done(err); } fs.writeFile(filePath + '.ass', '\ufeff' + result, done); }); /* Break from the first loop */ j = config.sublang.length; break; } } } if (i >= subs.length) { done('Cannot find subtitles with requested language(s)'); } } else { const enc = player.subtitle; if (!enc) { return done(); } subtitle.decode(enc.id, enc.iv, enc.data, (errSD, data) => { if (errSD) { log.error('An error occured while getting subtitles...'); return done(errSD); } if (config.debug) { log.dumpToDebug('SubtitlesXML', data); } const formats = subtitle.formats; const format = formats[config.format] ? config.format : 'ass'; formats[format](config, data, (errF: Error, decodedSubtitle: string) => { if (errF) { return done(errF); } fs.writeFile(filePath + '.' + format, '\ufeff' + decodedSubtitle, done); }); }); } } /** * Streams the video to disk. */ function downloadVideo(config: IConfig, page: IEpisodePage, player: IEpisodePlayer, filePath: string, done: (err: any) => void) { if (player == null) { /* new way */ const streams = page.media.streams; let i; /* Find a proper subtitles */ for (i = 0; i < streams.length; i++) { if (streams[i].format === 'vo_adaptive_hls' && streams[i].audio_lang === 'jaJP' && streams[i].hardsub_lang === null) { video.stream('', streams[i].url, '', filePath, 'mp4', 'HLS', config.verbose, done); break; } } if (i >= streams.length) { done('Cannot find a valid stream'); } } else { /* Old way */ video.stream(player.video.host, player.video.file, page.swf, filePath, path.extname(player.video.file), player.video.mode, config.verbose, done); } } /** * Names the file based on the config, page, series and tag. */ function generateName(config: IConfig, page: IEpisodePage, extra = '') { const episodeNum = parseInt(page.episode, 10); const volumeNum = parseInt(page.volume, 10); const episode = (episodeNum < 10 ? '0' : '') + page.episode; const volume = (volumeNum < 10 ? '0' : '') + page.volume; const tag = config.tag || 'CrunchyRoll'; const series = config.series || page.series; return config.nametmpl .replace(/{EPISODE_ID}/g, page.id.toString()) .replace(/{EPISODE_NUMBER}/g, episode) .replace(/{SEASON_NUMBER}/g, volume) .replace(/{VOLUME_NUMBER}/g, volume) .replace(/{SEASON_TITLE}/g, page.season) .replace(/{VOLUME_TITLE}/g, page.season) .replace(/{SERIES_TITLE}/g, series) .replace(/{EPISODE_TITLE}/g, page.title) .replace(/{TAG}/g, tag) + extra; } /** * Prefixes a value. */ function prefix(value: number|string, length: number) { let valueString = (typeof value !== 'string') ? String(value) : value; while (valueString.length < length) { valueString = '0' + valueString; } return valueString; } /** * Requests the page data and scrapes the id, episode, series and swf. */ function scrapePage(config: IConfig, address: string, done: (err: Error, page?: IEpisodePage) => void) { const epId = parseInt((address.match(/[0-9]+$/) || ['0'])[0], 10); if (!epId) { return done(new Error('Invalid address.')); } my_request.get(config, address, (err, result) => { if (err) { return done(err); } const $ = cheerio.load(result); /* First check if we have the new player */ const vlosScript = $('#vilos-iframe-container'); if (vlosScript) { const pageMetadata = JSON.parse($('script[type="application/ld+json"]')[0].children[0].data); const divScript = $('div[id="showmedia_video_box_wide"]'); const scripts = divScript.find('script').toArray(); const script = scripts[2].children[0].data; let seasonNumber = '1'; let seasonTitle = ''; if (pageMetadata.partOfSeason) { seasonNumber = pageMetadata.partOfSeason.seasonNumber; if (seasonNumber === '0') { seasonNumber = '1'; } seasonTitle = pageMetadata.partOfSeason.name; } done(null, vlos.getMedia(script, seasonTitle, seasonNumber)); } else { /* Use the old way */ const swf = /^([^?]+)/.exec($('link[rel=video_src]').attr('href')); const regexp = /\s*([^\n\r\t\f]+)\n?\s*[^0-9]*([0-9][\-0-9.]*)?,?\n?\s\s*[^0-9]*((PV )?[S0-9][P0-9.]*[a-fA-F]?)/; const seasonTitle = $('span[itemprop="title"]').text(); const look = $('#showmedia_about_media').text(); const episodeTitle = $('#showmedia_about_name').text().replace(/[“”]/g, ''); const data = regexp.exec(look); if (config.debug) { log.dumpToDebug('episode page', $.html()); } if (!swf || !data) { log.warn('Somethig unexpected in the page at ' + address + ' (data are: ' + look + ')'); log.warn('Setting Season to ’0’ and episode to ’0’...'); if (config.debug) { log.dumpToDebug('episode unexpected', look); } done(null, { episode: '0', id: epId, series: seasonTitle, season: seasonTitle, title: episodeTitle, swf: swf[1], volume: '0', filename: '', media: null, }); } else { done(null, { episode: data[3], id: epId, series: data[1], season: seasonTitle, title: episodeTitle, swf: swf[1], volume: data[2] || '1', filename: '', media: null, }); } } }); } /** * Requests the player data and scrapes the subtitle and video data. */ function scrapePlayer(config: IConfig, address: string, id: number, done: (err: Error, player?: IEpisodePlayer) => void) { const url = address.match(/^(https?:\/\/[^\/]+)/); if (!url) { return done(new Error('Invalid address.')); } const postForm = { current_page: address, video_format: config.video_format, video_quality: config.video_quality, media_id: id }; my_request.post(config, url[1] + '/xml/?req=RpcApiVideoPlayer_GetStandardConfig&media_id=' + id, postForm, (err, result) => { if (err) { return done(err); } xml2js.parseString(result, { explicitArray: false, explicitRoot: false, }, (errPS: Error, player: IEpisodePlayerConfig) => { if (errPS) { return done(errPS); } try { const isSubtitled = Boolean(player['default:preload'].subtitle); let streamMode = 'RTMP'; if (player['default:preload'].stream_info.host === '') { streamMode = 'HLS'; } done(null, { subtitle: isSubtitled ? { data: player['default:preload'].subtitle.data, id: parseInt(player['default:preload'].subtitle.$.id, 10), iv: player['default:preload'].subtitle.iv, } : null, video: { file: player['default:preload'].stream_info.file, host: player['default:preload'].stream_info.host, mode: streamMode, }, }); } catch (parseError) { if (config.debug) { log.dumpToDebug('player scrape', parseError); } done(parseError); } }); }); }
Godzil/Crunchy
src/episode.ts
TypeScript
mit
13,585
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_55) on Wed Jun 11 14:26:13 PDT 2014 --> <title>FVector (Javadocs: FLib)</title> <meta name="date" content="2014-06-11"> <link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="FVector (Javadocs: FLib)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../deprecated-list.html">Deprecated</a></li> <li><a href="../../index-all.html">Index</a></li> <li><a href="../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../flib/core/FShape.html" title="class in flib.core"><span class="strong">Prev Class</span></a></li> <li>Next Class</li> </ul> <ul class="navList"> <li><a href="../../index.html?flib/core/FVector.html" target="_top">Frames</a></li> <li><a href="FVector.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">flib.core</div> <h2 title="Class FVector" class="title">Class FVector</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>processing.core.PVector</li> <li> <ul class="inheritance"> <li>flib.core.FVector</li> </ul> </li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd>java.io.Serializable</dd> </dl> <hr> <br> <pre>public class <span class="strong">FVector</span> extends processing.core.PVector</pre> <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../serialized-form.html#flib.core.FVector">Serialized Form</a></dd></dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- =========== FIELD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="field_summary"> <!-- --> </a> <h3>Field Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> <caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><strong><a href="../../flib/core/FVector.html#SNAP_GRID">SNAP_GRID</a></strong></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><strong><a href="../../flib/core/FVector.html#SNAP_ISOMETRIC">SNAP_ISOMETRIC</a></strong></code>&nbsp;</td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="fields_inherited_from_class_processing.core.PVector"> <!-- --> </a> <h3>Fields inherited from class&nbsp;processing.core.PVector</h3> <code>x, y, z</code></li> </ul> </li> </ul> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../flib/core/FVector.html#FVector()">FVector</a></strong>()</code>&nbsp;</td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method_summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>static float</code></td> <td class="colLast"><code><strong><a href="../../flib/core/FVector.html#area(processing.core.PVector, processing.core.PVector, processing.core.PVector)">area</a></strong>(processing.core.PVector&nbsp;a, processing.core.PVector&nbsp;b, processing.core.PVector&nbsp;c)</code> <div class="block">Get the area of a triangle spanned by the three given points.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static boolean</code></td> <td class="colLast"><code><strong><a href="../../flib/core/FVector.html#collinear(processing.core.PVector, processing.core.PVector, processing.core.PVector)">collinear</a></strong>(processing.core.PVector&nbsp;a, processing.core.PVector&nbsp;b, processing.core.PVector&nbsp;c)</code> <div class="block">Check if three points are collinear https://github.com/schteppe/poly-decomp.js/blob/master/src/Point.js</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static boolean</code></td> <td class="colLast"><code><strong><a href="../../flib/core/FVector.html#collinear(processing.core.PVector, processing.core.PVector, processing.core.PVector, float)">collinear</a></strong>(processing.core.PVector&nbsp;a, processing.core.PVector&nbsp;b, processing.core.PVector&nbsp;c, float&nbsp;thresholdAngle)</code> <div class="block">Check if three points are collinear https://github.com/schteppe/poly-decomp.js/blob/master/src/Point.js</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>float</code></td> <td class="colLast"><code><strong><a href="../../flib/core/FVector.html#distSq(processing.core.PVector)">distSq</a></strong>(processing.core.PVector&nbsp;v1)</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static float</code></td> <td class="colLast"><code><strong><a href="../../flib/core/FVector.html#distSq(processing.core.PVector, processing.core.PVector)">distSq</a></strong>(processing.core.PVector&nbsp;v1, processing.core.PVector&nbsp;v2)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static processing.core.PVector</code></td> <td class="colLast"><code><strong><a href="../../flib/core/FVector.html#findNormal(processing.core.PVector, processing.core.PVector, processing.core.PVector, float)">findNormal</a></strong>(processing.core.PVector&nbsp;p0, processing.core.PVector&nbsp;p1, processing.core.PVector&nbsp;p2, float&nbsp;distance)</code> <div class="block">Finds the normal at p0 - the intersection of two vectors p1 and p2.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static java.util.List&lt;processing.core.PVector&gt;</code></td> <td class="colLast"><code><strong><a href="../../flib/core/FVector.html#getDecimatedVertices(java.util.List, float, boolean)">getDecimatedVertices</a></strong>(java.util.List&lt;processing.core.PVector&gt;&nbsp;vertices, float&nbsp;step, boolean&nbsp;doAddFinalVertex)</code> <div class="block">breaks a line (defined as a space between points) into a specified number of line segments code was taken directly from toxilibs https://bitbucket.org/postspectacular/toxiclibs/src/9d124c80e8af/src.core/toxi/geom/LineStrip2D.java modified for use with Processing's native PVector</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static float</code></td> <td class="colLast"><code><strong><a href="../../flib/core/FVector.html#getEstimatedArcLength(java.util.List)">getEstimatedArcLength</a></strong>(java.util.List&lt;processing.core.PVector&gt;&nbsp;vertices)</code> <div class="block">Get estimated arc length</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static processing.core.PVector[]</code></td> <td class="colLast"><code><strong><a href="../../flib/core/FVector.html#getParallelLine(processing.core.PVector[], float)">getParallelLine</a></strong>(processing.core.PVector[]&nbsp;points, float&nbsp;distance)</code> <div class="block">Calculates the vertex positions of a line parallel to the original line at an approximate fixed distance.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static java.util.ArrayList&lt;processing.core.PVector&gt;</code></td> <td class="colLast"><code><strong><a href="../../flib/core/FVector.html#grid(int, int, processing.core.PVector)">grid</a></strong>(int&nbsp;width, int&nbsp;height, processing.core.PVector&nbsp;spacing)</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static java.util.ArrayList&lt;processing.core.PVector&gt;</code></td> <td class="colLast"><code><strong><a href="../../flib/core/FVector.html#grid(int, int, processing.core.PVector, boolean)">grid</a></strong>(int&nbsp;width, int&nbsp;height, processing.core.PVector&nbsp;spacing, boolean&nbsp;bRandom)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../flib/core/FVector.html#interpolateTo(processing.core.PVector, float)">interpolateTo</a></strong>(processing.core.PVector&nbsp;v2, float&nbsp;amt)</code> <div class="block">interpolate from one PVector to another</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static processing.core.PVector</code></td> <td class="colLast"><code><strong><a href="../../flib/core/FVector.html#interpolateTo(processing.core.PVector, processing.core.PVector, float)">interpolateTo</a></strong>(processing.core.PVector&nbsp;v1, processing.core.PVector&nbsp;v2, float&nbsp;amt)</code> <div class="block">interpolate from one PVector to another</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static processing.core.PVector</code></td> <td class="colLast"><code><strong><a href="../../flib/core/FVector.html#limit(processing.core.PVector, float)">limit</a></strong>(processing.core.PVector&nbsp;v1, float&nbsp;lim)</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static processing.core.PVector</code></td> <td class="colLast"><code><strong><a href="../../flib/core/FVector.html#max(processing.core.PVector[])">max</a></strong>(processing.core.PVector[]&nbsp;points)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static processing.core.PVector</code></td> <td class="colLast"><code><strong><a href="../../flib/core/FVector.html#min(processing.core.PVector[])">min</a></strong>(processing.core.PVector[]&nbsp;points)</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>processing.core.PVector</code></td> <td class="colLast"><code><strong><a href="../../flib/core/FVector.html#snap(float, int)">snap</a></strong>(float&nbsp;scale, int&nbsp;type)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>processing.core.PVector</code></td> <td class="colLast"><code><strong><a href="../../flib/core/FVector.html#snap(processing.core.PVector, int)">snap</a></strong>(processing.core.PVector&nbsp;spacing, int&nbsp;type)</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static java.util.List&lt;processing.core.PVector&gt;</code></td> <td class="colLast"><code><strong><a href="../../flib/core/FVector.html#splitIntoSegments(processing.core.PVector, processing.core.PVector, java.util.List, float, boolean)">splitIntoSegments</a></strong>(processing.core.PVector&nbsp;a, processing.core.PVector&nbsp;b, java.util.List&lt;processing.core.PVector&gt;&nbsp;segments, float&nbsp;stepLength, boolean&nbsp;addFirst)</code> <div class="block">Split into segments</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_processing.core.PVector"> <!-- --> </a> <h3>Methods inherited from class&nbsp;processing.core.PVector</h3> <code>add, add, add, add, angleBetween, array, cross, cross, cross, dist, dist, div, div, div, dot, dot, dot, equals, fromAngle, fromAngle, get, get, hashCode, heading, heading2D, lerp, lerp, lerp, limit, mag, magSq, mult, mult, mult, normalize, normalize, random2D, random2D, random2D, random2D, random3D, random3D, random3D, random3D, rotate, set, set, set, set, setMag, setMag, sub, sub, sub, sub, toString</code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>getClass, notify, notifyAll, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ FIELD DETAIL =========== --> <ul class="blockList"> <li class="blockList"><a name="field_detail"> <!-- --> </a> <h3>Field Detail</h3> <a name="SNAP_GRID"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>SNAP_GRID</h4> <pre>public static&nbsp;int SNAP_GRID</pre> </li> </ul> <a name="SNAP_ISOMETRIC"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>SNAP_ISOMETRIC</h4> <pre>public static&nbsp;int SNAP_ISOMETRIC</pre> </li> </ul> </li> </ul> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="FVector()"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>FVector</h4> <pre>public&nbsp;FVector()</pre> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method_detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="interpolateTo(processing.core.PVector, processing.core.PVector, float)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>interpolateTo</h4> <pre>public static&nbsp;processing.core.PVector&nbsp;interpolateTo(processing.core.PVector&nbsp;v1, processing.core.PVector&nbsp;v2, float&nbsp;amt)</pre> <div class="block">interpolate from one PVector to another</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>v1</code> - </dd><dd><code>v2</code> - </dd><dd><code>amt</code> - between 0.0 and 1.0</dd> <dt><span class="strong">Returns:</span></dt><dd>interpolated point</dd></dl> </li> </ul> <a name="interpolateTo(processing.core.PVector, float)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>interpolateTo</h4> <pre>public&nbsp;void&nbsp;interpolateTo(processing.core.PVector&nbsp;v2, float&nbsp;amt)</pre> <div class="block">interpolate from one PVector to another</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>v2</code> - </dd><dd><code>amt</code> - between 0.0 and 1.0</dd></dl> </li> </ul> <a name="limit(processing.core.PVector, float)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>limit</h4> <pre>public static&nbsp;processing.core.PVector&nbsp;limit(processing.core.PVector&nbsp;v1, float&nbsp;lim)</pre> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>v1</code> - </dd><dd><code>lim</code> - </dd> <dt><span class="strong">Returns:</span></dt><dd>new limited PVector</dd></dl> </li> </ul> <a name="distSq(processing.core.PVector)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>distSq</h4> <pre>public&nbsp;float&nbsp;distSq(processing.core.PVector&nbsp;v1)</pre> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>v1</code> - </dd> <dt><span class="strong">Returns:</span></dt><dd>squared value</dd></dl> </li> </ul> <a name="distSq(processing.core.PVector, processing.core.PVector)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>distSq</h4> <pre>public static&nbsp;float&nbsp;distSq(processing.core.PVector&nbsp;v1, processing.core.PVector&nbsp;v2)</pre> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>v1</code> - </dd> <dt><span class="strong">Returns:</span></dt><dd>squared value</dd></dl> </li> </ul> <a name="grid(int, int, processing.core.PVector)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>grid</h4> <pre>public static&nbsp;java.util.ArrayList&lt;processing.core.PVector&gt;&nbsp;grid(int&nbsp;width, int&nbsp;height, processing.core.PVector&nbsp;spacing)</pre> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>width</code> - width of the entire grid</dd><dd><code>height</code> - height of the entire grid</dd><dd><code>spacing</code> - a PVector representing the spacing (or size of cells)</dd> <dt><span class="strong">Returns:</span></dt><dd>Grid with specified spacing between cells</dd></dl> </li> </ul> <a name="grid(int, int, processing.core.PVector, boolean)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>grid</h4> <pre>public static&nbsp;java.util.ArrayList&lt;processing.core.PVector&gt;&nbsp;grid(int&nbsp;width, int&nbsp;height, processing.core.PVector&nbsp;spacing, boolean&nbsp;bRandom)</pre> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>width</code> - width of the entire grid</dd><dd><code>height</code> - height of the entire grid</dd><dd><code>spacing</code> - a PVector representing the spacing (or size of cells)</dd><dd><code>bRandom</code> - return a random grid of points</dd> <dt><span class="strong">Returns:</span></dt><dd>arraylist of PVector in a grid with specified spacing between cells</dd></dl> </li> </ul> <a name="snap(processing.core.PVector, int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>snap</h4> <pre>public&nbsp;processing.core.PVector&nbsp;snap(processing.core.PVector&nbsp;spacing, int&nbsp;type)</pre> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>spacing</code> - </dd><dd><code>type</code> - snap type: SNAP_GRID, SNAP_ISOMETRIC</dd> <dt><span class="strong">Returns:</span></dt><dd>a PVector that snaps to a specific grid (starting at 0,0)</dd></dl> </li> </ul> <a name="snap(float, int)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>snap</h4> <pre>public&nbsp;processing.core.PVector&nbsp;snap(float&nbsp;scale, int&nbsp;type)</pre> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>scale</code> - </dd><dd><code>type</code> - snap type: SNAP_GRID, SNAP_ISOMETRIC</dd> <dt><span class="strong">Returns:</span></dt><dd>a PVector that snaps to a specific grid (starting at 0,0)</dd></dl> </li> </ul> <a name="max(processing.core.PVector[])"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>max</h4> <pre>public static&nbsp;processing.core.PVector&nbsp;max(processing.core.PVector[]&nbsp;points)</pre> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>points</code> - list of PVector points</dd> <dt><span class="strong">Returns:</span></dt><dd>point furthest from origin</dd></dl> </li> </ul> <a name="min(processing.core.PVector[])"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>min</h4> <pre>public static&nbsp;processing.core.PVector&nbsp;min(processing.core.PVector[]&nbsp;points)</pre> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>points</code> - list of PVector points</dd> <dt><span class="strong">Returns:</span></dt><dd>point closest to origin</dd></dl> </li> </ul> <a name="getParallelLine(processing.core.PVector[], float)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getParallelLine</h4> <pre>public static&nbsp;processing.core.PVector[]&nbsp;getParallelLine(processing.core.PVector[]&nbsp;points, float&nbsp;distance)</pre> <div class="block">Calculates the vertex positions of a line parallel to the original line at an approximate fixed distance. https://forum.processing.org/topic/points-with-equal-distance-repulsion-from-a-line</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>points</code> - a collection of points</dd><dd><code>distance</code> - the distance to maitain in result</dd> <dt><span class="strong">Returns:</span></dt><dd>a collection of points parallel to input points at specified distance</dd></dl> </li> </ul> <a name="findNormal(processing.core.PVector, processing.core.PVector, processing.core.PVector, float)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>findNormal</h4> <pre>public static&nbsp;processing.core.PVector&nbsp;findNormal(processing.core.PVector&nbsp;p0, processing.core.PVector&nbsp;p1, processing.core.PVector&nbsp;p2, float&nbsp;distance)</pre> <div class="block">Finds the normal at p0 - the intersection of two vectors p1 and p2. Joining adjacent normals maintains parallelism with points p1-p0-p2. https://forum.processing.org/topic/points-with-equal-distance-repulsion-from-a-line</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>p0</code> - first point</dd><dd><code>p1</code> - second point</dd><dd><code>p2</code> - third point</dd><dd><code>distance</code> - distance to maintain</dd> <dt><span class="strong">Returns:</span></dt><dd>{PVector}</dd></dl> </li> </ul> <a name="getDecimatedVertices(java.util.List, float, boolean)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getDecimatedVertices</h4> <pre>public static&nbsp;java.util.List&lt;processing.core.PVector&gt;&nbsp;getDecimatedVertices(java.util.List&lt;processing.core.PVector&gt;&nbsp;vertices, float&nbsp;step, boolean&nbsp;doAddFinalVertex)</pre> <div class="block">breaks a line (defined as a space between points) into a specified number of line segments code was taken directly from toxilibs https://bitbucket.org/postspectacular/toxiclibs/src/9d124c80e8af/src.core/toxi/geom/LineStrip2D.java modified for use with Processing's native PVector</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>vertices</code> - a List<PVector> of vertices to break</dd><dd><code>step</code> - the number of steps between the start point and end point</dd><dd><code>doAddFinalVertex</code> - include final vertex in results</dd> <dt><span class="strong">Returns:</span></dt><dd>List<PVector> the stepped number of points</dd></dl> </li> </ul> <a name="getEstimatedArcLength(java.util.List)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getEstimatedArcLength</h4> <pre>public static&nbsp;float&nbsp;getEstimatedArcLength(java.util.List&lt;processing.core.PVector&gt;&nbsp;vertices)</pre> <div class="block">Get estimated arc length</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>vertices</code> - </dd> <dt><span class="strong">Returns:</span></dt><dd>the length of the arc</dd></dl> </li> </ul> <a name="splitIntoSegments(processing.core.PVector, processing.core.PVector, java.util.List, float, boolean)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>splitIntoSegments</h4> <pre>public static&nbsp;java.util.List&lt;processing.core.PVector&gt;&nbsp;splitIntoSegments(processing.core.PVector&nbsp;a, processing.core.PVector&nbsp;b, java.util.List&lt;processing.core.PVector&gt;&nbsp;segments, float&nbsp;stepLength, boolean&nbsp;addFirst)</pre> <div class="block">Split into segments</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>a</code> - </dd><dd><code>b</code> - </dd><dd><code>segments</code> - </dd><dd><code>stepLength</code> - </dd><dd><code>addFirst</code> - </dd> <dt><span class="strong">Returns:</span></dt><dd>List<PVector></dd></dl> </li> </ul> <a name="area(processing.core.PVector, processing.core.PVector, processing.core.PVector)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>area</h4> <pre>public static&nbsp;float&nbsp;area(processing.core.PVector&nbsp;a, processing.core.PVector&nbsp;b, processing.core.PVector&nbsp;c)</pre> <div class="block">Get the area of a triangle spanned by the three given points. Note that the area will be negative if the points are not given in counter-clockwise order.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>a</code> - </dd><dd><code>b</code> - </dd><dd><code>c</code> - </dd> <dt><span class="strong">Returns:</span></dt><dd>float</dd></dl> </li> </ul> <a name="collinear(processing.core.PVector, processing.core.PVector, processing.core.PVector)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>collinear</h4> <pre>public static&nbsp;boolean&nbsp;collinear(processing.core.PVector&nbsp;a, processing.core.PVector&nbsp;b, processing.core.PVector&nbsp;c)</pre> <div class="block">Check if three points are collinear https://github.com/schteppe/poly-decomp.js/blob/master/src/Point.js</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>a</code> - </dd><dd><code>b</code> - </dd><dd><code>c</code> - </dd> <dt><span class="strong">Returns:</span></dt><dd>boolean</dd></dl> </li> </ul> <a name="collinear(processing.core.PVector, processing.core.PVector, processing.core.PVector, float)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>collinear</h4> <pre>public static&nbsp;boolean&nbsp;collinear(processing.core.PVector&nbsp;a, processing.core.PVector&nbsp;b, processing.core.PVector&nbsp;c, float&nbsp;thresholdAngle)</pre> <div class="block">Check if three points are collinear https://github.com/schteppe/poly-decomp.js/blob/master/src/Point.js</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>a</code> - </dd><dd><code>b</code> - </dd><dd><code>c</code> - </dd><dd><code>thresholdAngle</code> - Threshold angle to use when comparing the vectors. The function will return true if the angle between the resulting vectors is less than this value. Use zero for max precision.</dd> <dt><span class="strong">Returns:</span></dt><dd>boolean</dd></dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../deprecated-list.html">Deprecated</a></li> <li><a href="../../index-all.html">Index</a></li> <li><a href="../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../flib/core/FShape.html" title="class in flib.core"><span class="strong">Prev Class</span></a></li> <li>Next Class</li> </ul> <ul class="navList"> <li><a href="../../index.html?flib/core/FVector.html" target="_top">Frames</a></li> <li><a href="FVector.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>processing library FLib by Ken Frederick. (c) 2014</small></p> </body> </html>
frederickk/flibs
java/distribution/FLib-010/reference/flib/core/FVector.html
HTML
mit
30,643
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.ComponentModel; using System.Reflection; using System.Net.Http; using Newtonsoft.Json; namespace Codenesium.DataConversionExtensions { public static class ObjectExtensions { /// <summary> /// Converts a HttpContent response to a string /// </summary> /// <param name="httpContent"></param> /// <returns></returns> public static string ContentToString(this HttpContent httpContent) { var readAsStringAsync = httpContent.ReadAsStringAsync(); return readAsStringAsync.Result; } /// <summary> /// Returns the int converted value of the field decorated with [Key] in a class. /// Refer to how System.ComponentModel.DataAnnotations.KeyAttribute works for an example /// Throws an argument exception if the passed object does not have a decorated field /// </summary> /// <param name="obj"></param> /// <returns></returns> public static Nullable<int> GetNullableKey(this object obj) { if (obj == null) { return null; } Type type = obj.GetType(); foreach (PropertyInfo property in type.GetProperties()) { object[] attribute = property.GetCustomAttributes(typeof(System.ComponentModel.DataAnnotations.KeyAttribute), true); if (attribute.Length > 0) { object value = property.GetValue(obj, null); return value.ToString().ToInt(); } } throw new ArgumentException("The passed object does not have a property decorated with the [Key] attribute"); } public static int GetKey(this object obj) { var returnValue = obj.GetNullableKey(); return returnValue.HasValue ? returnValue.Value : 0; } /// <summary> /// Serializes the parameter and returns it as a json string /// </summary> /// <param name="obj"></param> /// <returns></returns> public static string ToJSONString(this object obj) { return JsonConvert.SerializeObject(obj, Formatting.Indented); } public static bool IsEmptyOrZeroOrNull(this object obj) { if (obj == null) { return true; } else { string parsed = obj.ToString(); if (parsed == String.Empty || parsed == "0" || parsed == "0.0") { return true; } else { return false; } } } } }
codenesium/DataConversionExtensions
DataConversionExtensions/ObjectExtensions.cs
C#
mit
2,903
//================================================================================================= /*! // \file blaze/math/adaptors/uniuppermatrix/Sparse.h // \brief UniUpperMatrix specialization for sparse matrices // // 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_ADAPTORS_UNIUPPERMATRIX_SPARSE_H_ #define _BLAZE_MATH_ADAPTORS_UNIUPPERMATRIX_SPARSE_H_ //************************************************************************************************* // Includes //************************************************************************************************* #include <iterator> #include <utility> #include <vector> #include <blaze/math/adaptors/Forward.h> #include <blaze/math/adaptors/uniuppermatrix/BaseTemplate.h> #include <blaze/math/adaptors/uniuppermatrix/UniUpperElement.h> #include <blaze/math/adaptors/uniuppermatrix/UniUpperProxy.h> #include <blaze/math/adaptors/uniuppermatrix/UniUpperValue.h> #include <blaze/math/Aliases.h> #include <blaze/math/constraints/Computation.h> #include <blaze/math/constraints/Hermitian.h> #include <blaze/math/constraints/Lower.h> #include <blaze/math/constraints/Resizable.h> #include <blaze/math/constraints/SparseMatrix.h> #include <blaze/math/constraints/Static.h> #include <blaze/math/constraints/StorageOrder.h> #include <blaze/math/constraints/Symmetric.h> #include <blaze/math/constraints/Transformation.h> #include <blaze/math/constraints/Uniform.h> #include <blaze/math/constraints/Upper.h> #include <blaze/math/constraints/View.h> #include <blaze/math/dense/InitializerMatrix.h> #include <blaze/math/Exception.h> #include <blaze/math/expressions/SparseMatrix.h> #include <blaze/math/InitializerList.h> #include <blaze/math/shims/Clear.h> #include <blaze/math/shims/IsDefault.h> #include <blaze/math/shims/IsOne.h> #include <blaze/math/sparse/SparseMatrix.h> #include <blaze/math/typetraits/IsComputation.h> #include <blaze/math/typetraits/IsLower.h> #include <blaze/math/typetraits/IsResizable.h> #include <blaze/math/typetraits/IsSquare.h> #include <blaze/math/typetraits/IsStrictlyTriangular.h> #include <blaze/math/typetraits/IsStrictlyUpper.h> #include <blaze/math/typetraits/IsUniTriangular.h> #include <blaze/math/typetraits/IsUniUpper.h> #include <blaze/math/typetraits/Size.h> #include <blaze/util/algorithms/Max.h> #include <blaze/util/Assert.h> #include <blaze/util/constraints/Const.h> #include <blaze/util/constraints/Numeric.h> #include <blaze/util/constraints/Pointer.h> #include <blaze/util/constraints/Reference.h> #include <blaze/util/constraints/Volatile.h> #include <blaze/util/EnableIf.h> #include <blaze/util/StaticAssert.h> #include <blaze/util/Types.h> namespace blaze { //================================================================================================= // // CLASS TEMPLATE SPECIALIZATION FOR SPARSE MATRICES // //================================================================================================= //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Specialization of UniUpperMatrix for sparse matrices. // \ingroup uniupper_matrix // // This specialization of UniUpperMatrix adapts the class template to the requirements of sparse // matrices. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix class UniUpperMatrix<MT,SO,false> : public SparseMatrix< UniUpperMatrix<MT,SO,false>, SO > { private: //**Type definitions**************************************************************************** using OT = OppositeType_t<MT>; //!< Opposite type of the sparse matrix. using TT = TransposeType_t<MT>; //!< Transpose type of the sparse matrix. using ET = ElementType_t<MT>; //!< Element type of the sparse matrix. //********************************************************************************************** public: //**Type definitions**************************************************************************** using This = UniUpperMatrix<MT,SO,false>; //!< Type of this UniUpperMatrix instance. using BaseType = SparseMatrix<This,SO>; //!< Base type of this UniUpperMatrix instance. using ResultType = This; //!< Result type for expression template evaluations. using OppositeType = UniUpperMatrix<OT,!SO,false>; //!< Result type with opposite storage order for expression template evaluations. using TransposeType = UniLowerMatrix<TT,!SO,false>; //!< Transpose type for expression template evaluations. using ElementType = ET; //!< Type of the matrix elements. using TagType = TagType_t<MT>; //!< Tag type of this UniUpperMatrix instance. using ReturnType = ReturnType_t<MT>; //!< Return type for expression template evaluations. using CompositeType = const This&; //!< Data type for composite expression templates. using Reference = UniUpperProxy<MT>; //!< Reference to a non-constant matrix value. using ConstReference = ConstReference_t<MT>; //!< Reference to a constant matrix value. using ConstIterator = ConstIterator_t<MT>; //!< Iterator over constant elements. //********************************************************************************************** //**Rebind struct definition******************************************************************** /*!\brief Rebind mechanism to obtain an UniUpperMatrix with different data/element type. */ template< typename NewType > // Data type of the other matrix struct Rebind { //! The type of the other UniUpperMatrix. using Other = UniUpperMatrix< typename MT::template Rebind<NewType>::Other >; }; //********************************************************************************************** //**Resize struct definition******************************************************************** /*!\brief Resize mechanism to obtain a UniUpperMatrix with different fixed dimensions. */ template< size_t NewM // Number of rows of the other matrix , size_t NewN > // Number of columns of the other matrix struct Resize { //! The type of the other UniUpperMatrix. using Other = UniUpperMatrix< typename MT::template Resize<NewM,NewN>::Other >; }; //********************************************************************************************** //**Iterator class definition******************************************************************* /*!\brief Iterator over the elements of the upper unitriangular matrix. */ class Iterator { public: //**Type definitions************************************************************************* using IteratorType = Iterator_t<MT>; //!< Type of the underlying sparse matrix iterators. using IteratorCategory = std::forward_iterator_tag; //!< The iterator category. using ValueType = UniUpperElement<MT>; //!< Type of the underlying elements. using PointerType = ValueType; //!< Pointer return type. using ReferenceType = ValueType; //!< Reference return type. using DifferenceType = ptrdiff_t; //!< Difference between two iterators. // STL iterator requirements using iterator_category = IteratorCategory; //!< The iterator category. using value_type = ValueType; //!< Type of the underlying elements. using pointer = PointerType; //!< Pointer return type. using reference = ReferenceType; //!< Reference return type. using difference_type = DifferenceType; //!< Difference between two iterators. //******************************************************************************************* //**Default constructor********************************************************************** /*!\brief Default constructor for the Iterator class. */ inline Iterator() : pos_ ( ) // Iterator to the current upper unitriangular matrix element , index_ ( 0UL ) // The row/column index of the iterator {} //******************************************************************************************* //**Constructor****************************************************************************** /*!\brief Constructor for the Iterator class. // // \param pos The initial position of the iterator. // \param index The row/column index of the iterator. */ inline Iterator( IteratorType pos, size_t index ) : pos_ ( pos ) // Iterator to the current upper unitriangular matrix element , index_( index ) // The row/column index of the iterator {} //******************************************************************************************* //**Prefix increment operator**************************************************************** /*!\brief Pre-increment operator. // // \return Reference to the incremented iterator. */ inline Iterator& operator++() { ++pos_; return *this; } //******************************************************************************************* //**Postfix increment operator*************************************************************** /*!\brief Post-increment operator. // // \return The previous position of the iterator. */ inline const Iterator operator++( int ) { const Iterator tmp( *this ); ++(*this); return tmp; } //******************************************************************************************* //**Element access operator****************************************************************** /*!\brief Direct access to the current sparse matrix element. // // \return Reference to the current sparse matrix element. */ inline ReferenceType operator*() const { return ReferenceType( pos_, pos_->index() == index_ ); } //******************************************************************************************* //**Element access operator****************************************************************** /*!\brief Direct access to the current sparse matrix element. // // \return Pointer to the current sparse matrix element. */ inline PointerType operator->() const { return PointerType( pos_, pos_->index() == index_ ); } //******************************************************************************************* //**Conversion operator********************************************************************** /*!\brief Conversion to an iterator over constant elements. // // \return An iterator over constant elements. */ inline operator ConstIterator() const { return pos_; } //******************************************************************************************* //**Equality operator************************************************************************ /*!\brief Equality comparison between two Iterator objects. // // \param rhs The right-hand side matrix iterator. // \return \a true if the iterators refer to the same element, \a false if not. */ inline bool operator==( const Iterator& rhs ) const { return pos_ == rhs.pos_; } //******************************************************************************************* //**Inequality operator********************************************************************** /*!\brief Inequality comparison between two Iterator objects. // // \param rhs The right-hand side matrix iterator. // \return \a true if the iterators don't refer to the same element, \a false if they do. */ inline bool operator!=( const Iterator& rhs ) const { return !( *this == rhs ); } //******************************************************************************************* //**Subtraction operator********************************************************************* /*!\brief Calculating the number of elements between two matrix iterators. // // \param rhs The right-hand side matrix iterator. // \return The number of elements between the two matrix iterators. */ inline DifferenceType operator-( const Iterator& rhs ) const { return pos_ - rhs.pos_; } //******************************************************************************************* //**Base function**************************************************************************** /*!\brief Access to the current position of the matrix iterator. // // \return The current position of the matrix iterator. */ inline IteratorType base() const { return pos_; } //******************************************************************************************* private: //**Member variables************************************************************************* IteratorType pos_; //!< Iterator to the current upper unitriangular matrix element. size_t index_; //!< The row/column index of the iterator. //******************************************************************************************* }; //********************************************************************************************** //**Compilation flags*************************************************************************** //! Compilation switch for the expression template assignment strategy. static constexpr bool smpAssignable = false; //********************************************************************************************** //**Constructors******************************************************************************** /*!\name Constructors */ //@{ inline UniUpperMatrix(); explicit inline UniUpperMatrix( size_t n ); inline UniUpperMatrix( size_t n, size_t nonzeros ); inline UniUpperMatrix( size_t n, const std::vector<size_t>& nonzeros ); inline UniUpperMatrix( initializer_list< initializer_list<ElementType> > list ); inline UniUpperMatrix( const UniUpperMatrix& m ); inline UniUpperMatrix( UniUpperMatrix&& m ) noexcept; template< typename MT2, bool SO2 > inline UniUpperMatrix( const Matrix<MT2,SO2>& m ); //@} //********************************************************************************************** //**Destructor********************************************************************************** /*!\name Destructor */ //@{ ~UniUpperMatrix() = default; //@} //********************************************************************************************** //**Data access functions*********************************************************************** /*!\name Data access functions */ //@{ inline Reference operator()( size_t i, size_t j ); inline ConstReference operator()( size_t i, size_t j ) const; inline Reference at( size_t i, size_t j ); inline ConstReference at( size_t i, size_t j ) const; inline Iterator begin ( size_t i ); inline ConstIterator begin ( size_t i ) const; inline ConstIterator cbegin( size_t i ) const; inline Iterator end ( size_t i ); inline ConstIterator end ( size_t i ) const; inline ConstIterator cend ( size_t i ) const; //@} //********************************************************************************************** //**Assignment operators************************************************************************ /*!\name Assignment operators */ //@{ inline UniUpperMatrix& operator=( initializer_list< initializer_list<ElementType> > list ); inline UniUpperMatrix& operator=( const UniUpperMatrix& rhs ); inline UniUpperMatrix& operator=( UniUpperMatrix&& rhs ) noexcept; template< typename MT2, bool SO2 > inline auto operator=( const Matrix<MT2,SO2>& rhs ) -> DisableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >; template< typename MT2, bool SO2 > inline auto operator=( const Matrix<MT2,SO2>& rhs ) -> EnableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >; template< typename MT2, bool SO2 > inline auto operator+=( const Matrix<MT2,SO2>& rhs ) -> DisableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >; template< typename MT2, bool SO2 > inline auto operator+=( const Matrix<MT2,SO2>& rhs ) -> EnableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >; template< typename MT2, bool SO2 > inline auto operator-=( const Matrix<MT2,SO2>& rhs ) -> DisableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >; template< typename MT2, bool SO2 > inline auto operator-=( const Matrix<MT2,SO2>& rhs ) -> EnableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >; template< typename MT2, bool SO2 > inline auto operator%=( const Matrix<MT2,SO2>& rhs ) -> UniUpperMatrix&; //@} //********************************************************************************************** //**Utility functions*************************************************************************** /*!\name Utility functions */ //@{ inline size_t rows() const noexcept; inline size_t columns() const noexcept; inline size_t capacity() const noexcept; inline size_t capacity( size_t i ) const noexcept; inline size_t nonZeros() const; inline size_t nonZeros( size_t i ) const; inline void reset(); inline void reset( size_t i ); inline void clear(); inline void resize ( size_t n, bool preserve=true ); inline void reserve( size_t nonzeros ); inline void reserve( size_t i, size_t nonzeros ); inline void trim(); inline void trim( size_t i ); inline void shrinkToFit(); inline void swap( UniUpperMatrix& m ) noexcept; static constexpr size_t maxNonZeros() noexcept; static constexpr size_t maxNonZeros( size_t n ) noexcept; //@} //********************************************************************************************** //**Insertion functions************************************************************************* /*!\name Insertion functions */ //@{ inline Iterator set ( size_t i, size_t j, const ElementType& value ); inline Iterator insert ( size_t i, size_t j, const ElementType& value ); inline void append ( size_t i, size_t j, const ElementType& value, bool check=false ); inline void finalize( size_t i ); //@} //********************************************************************************************** //**Erase functions***************************************************************************** /*!\name Erase functions */ //@{ inline void erase( size_t i, size_t j ); inline Iterator erase( size_t i, Iterator pos ); inline Iterator erase( size_t i, Iterator first, Iterator last ); template< typename Pred > inline void erase( Pred predicate ); template< typename Pred > inline void erase( size_t i, Iterator first, Iterator last, Pred predicate ); //@} //********************************************************************************************** //**Lookup functions**************************************************************************** /*!\name Lookup functions */ //@{ inline Iterator find ( size_t i, size_t j ); inline ConstIterator find ( size_t i, size_t j ) const; inline Iterator lowerBound( size_t i, size_t j ); inline ConstIterator lowerBound( size_t i, size_t j ) const; inline Iterator upperBound( size_t i, size_t j ); inline ConstIterator upperBound( size_t i, size_t j ) const; //@} //********************************************************************************************** //**Debugging functions************************************************************************* /*!\name Debugging functions */ //@{ inline bool isIntact() const noexcept; //@} //********************************************************************************************** //**Expression template evaluation functions**************************************************** /*!\name Expression template evaluation functions */ //@{ template< typename Other > inline bool canAlias ( const Other* alias ) const noexcept; template< typename Other > inline bool isAliased( const Other* alias ) const noexcept; inline bool canSMPAssign() const noexcept; //@} //********************************************************************************************** private: //**Utility functions*************************************************************************** /*!\name Utility functions */ //@{ inline void resetLower(); //@} //********************************************************************************************** //**Member variables**************************************************************************** /*!\name Member variables */ //@{ MT matrix_; //!< The adapted sparse matrix. //@} //********************************************************************************************** //**Friend declarations************************************************************************* template< typename MT2, bool SO2, bool DF2 > friend MT2& derestrict( UniUpperMatrix<MT2,SO2,DF2>& m ); //********************************************************************************************** //**Compile time checks************************************************************************* BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE ( MT ); BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE ( MT ); BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE ( MT ); BLAZE_CONSTRAINT_MUST_NOT_BE_CONST ( MT ); BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE ( MT ); BLAZE_CONSTRAINT_MUST_NOT_BE_VIEW_TYPE ( MT ); BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE ( MT ); BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSFORMATION_TYPE ( MT ); BLAZE_CONSTRAINT_MUST_NOT_BE_UNIFORM_TYPE ( MT ); BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE( MT ); BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE( MT ); BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE ( MT ); BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE ( MT ); BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER( OT, !SO ); BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER( TT, !SO ); BLAZE_CONSTRAINT_MUST_BE_NUMERIC_TYPE( ElementType ); BLAZE_STATIC_ASSERT( ( Size_v<MT,0UL> == Size_v<MT,1UL> ) ); //********************************************************************************************** }; /*! \endcond */ //************************************************************************************************* //================================================================================================= // // CONSTRUCTORS // //================================================================================================= //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief The default constructor for UniUpperMatrix. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline UniUpperMatrix<MT,SO,false>::UniUpperMatrix() : matrix_() // The adapted sparse matrix { BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Constructor for a matrix of size \f$ n \times n \f$. // // \param n The number of rows and columns of the matrix. // // The matrix is initialized as identity matrix and has no additional free capacity. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline UniUpperMatrix<MT,SO,false>::UniUpperMatrix( size_t n ) : matrix_( n, n, n ) // The adapted sparse matrix { BLAZE_CONSTRAINT_MUST_BE_RESIZABLE_TYPE( MT ); for( size_t i=0UL; i<n; ++i ) { matrix_.append( i, i, ElementType(1) ); matrix_.finalize( i ); } BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Constructor for a matrix of size \f$ n \times n \f$. // // \param n The number of rows and columns of the matrix. // \param nonzeros The number of expected non-zero elements. // // The matrix is initialized as identity matrix and will have at least the capacity for // \a nonzeros non-zero elements. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline UniUpperMatrix<MT,SO,false>::UniUpperMatrix( size_t n, size_t nonzeros ) : matrix_( n, n, max( nonzeros, n ) ) // The adapted sparse matrix { BLAZE_CONSTRAINT_MUST_BE_RESIZABLE_TYPE( MT ); for( size_t i=0UL; i<n; ++i ) { matrix_.append( i, i, ElementType(1) ); matrix_.finalize( i ); } BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Constructor for a matrix of size \f$ n \times n \f$. // // \param n The number of rows and columns of the matrix. // \param nonzeros The expected number of non-zero elements in each row/column. // \exception std::invalid_argument Invalid capacity specification. // // The matrix is initialized as identity matrix and will have the specified capacity in each // row/column. Note that since the matrix is initialized as \f$ n \times n \f$ identity matrix // the given vector must have at least \a n elements, all of which must not be 0. If the number // of non-zero elements of any row/column is specified as 0, a \a std::invalid_argument exception // is thrown. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline UniUpperMatrix<MT,SO,false>::UniUpperMatrix( size_t n, const std::vector<size_t>& nonzeros ) : matrix_( n, n, nonzeros ) // The adapted sparse matrix { BLAZE_CONSTRAINT_MUST_BE_RESIZABLE_TYPE( MT ); for( size_t i=0UL; i<n; ++i ) { if( nonzeros[i] == 0UL ) { BLAZE_THROW_INVALID_ARGUMENT( "Invalid capacity specification" ); } matrix_.append( i, i, ElementType(1) ); matrix_.finalize( i ); } BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief List initialization of all matrix elements. // // \param list The initializer list. // \exception std::invalid_argument Invalid setup of uniupper matrix. // // This constructor provides the option to explicitly initialize the elements of the uniupper // matrix by means of an initializer list: \code using blaze::rowMajor; blaze::UniUpperMatrix< blaze::CompressedMatrix<int,rowMajor> > A{ { 1, 2, 3 }, { 0, 1 }, { 0, 0, 1 } }; \endcode // The matrix is sized according to the size of the initializer list and all matrix elements are // initialized with the values from the given list. Missing values are initialized with default // values. In case the matrix cannot be resized and the dimensions of the initializer list don't // match or if the given list does not represent an uniupper matrix, a \a std::invalid_argument // exception is thrown. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline UniUpperMatrix<MT,SO,false>::UniUpperMatrix( initializer_list< initializer_list<ElementType> > list ) : matrix_( list ) // The adapted sparse matrix { if( !isUniUpper( matrix_ ) ) { BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" ); } BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief The copy constructor for UniUpperMatrix. // // \param m The uniupper matrix to be copied. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline UniUpperMatrix<MT,SO,false>::UniUpperMatrix( const UniUpperMatrix& m ) : matrix_( m.matrix_ ) // The adapted sparse matrix { BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" ); BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief The move constructor for UniUpperMatrix. // // \param m The uniupper matrix to be moved into this instance. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline UniUpperMatrix<MT,SO,false>::UniUpperMatrix( UniUpperMatrix&& m ) noexcept : matrix_( std::move( m.matrix_ ) ) // The adapted sparse matrix { BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" ); BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Conversion constructor from different matrices. // // \param m Matrix to be copied. // \exception std::invalid_argument Invalid setup of uniupper matrix. // // This constructor initializes the uniupper matrix as a copy of the given matrix. In case the // given matrix is not an uniupper matrix, a \a std::invalid_argument exception is thrown. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix template< typename MT2 // Type of the foreign matrix , bool SO2 > // Storage order of the foreign matrix inline UniUpperMatrix<MT,SO,false>::UniUpperMatrix( const Matrix<MT2,SO2>& m ) : matrix_( ~m ) // The adapted sparse matrix { if( !IsUniUpper_v<MT2> && !isUniUpper( matrix_ ) ) { BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" ); } if( !IsUniUpper_v<MT2> ) resetLower(); BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" ); BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" ); } /*! \endcond */ //************************************************************************************************* //================================================================================================= // // DATA ACCESS FUNCTIONS // //================================================================================================= //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief 2D-access to the matrix elements. // // \param i Access index for the row. The index has to be in the range \f$[0..N-1]\f$. // \param j Access index for the column. The index has to be in the range \f$[0..N-1]\f$. // \return Reference to the accessed value. // \exception std::invalid_argument Invalid assignment to diagonal or lower matrix element. // // The function call operator provides access to the elements at position (i,j). The attempt to // assign to an element in the lower part of the matrix (i.e. below the diagonal) will result in // a \a std::invalid_argument exception. // // Note that this function only performs an index check in case BLAZE_USER_ASSERT() is active. In // contrast, the at() function is guaranteed to perform a check of the given access indices. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline typename UniUpperMatrix<MT,SO,false>::Reference UniUpperMatrix<MT,SO,false>::operator()( size_t i, size_t j ) { BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" ); BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" ); return Reference( matrix_, i, j ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief 2D-access to the matrix elements. // // \param i Access index for the row. The index has to be in the range \f$[0..N-1]\f$. // \param j Access index for the column. The index has to be in the range \f$[0..N-1]\f$. // \return Reference to the accessed value. // \exception std::invalid_argument Invalid assignment to diagonal or lower matrix element. // // The function call operator provides access to the elements at position (i,j). The attempt to // assign to an element in the lower part of the matrix (i.e. below the diagonal) will result in // a \a std::invalid_argument exception. // // Note that this function only performs an index check in case BLAZE_USER_ASSERT() is active. In // contrast, the at() function is guaranteed to perform a check of the given access indices. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline typename UniUpperMatrix<MT,SO,false>::ConstReference UniUpperMatrix<MT,SO,false>::operator()( size_t i, size_t j ) const { BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" ); BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" ); return matrix_(i,j); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Checked access to the matrix elements. // // \param i Access index for the row. The index has to be in the range \f$[0..N-1]\f$. // \param j Access index for the column. The index has to be in the range \f$[0..N-1]\f$. // \return Reference to the accessed value. // \exception std::out_of_range Invalid matrix access index. // \exception std::invalid_argument Invalid assignment to diagonal or lower matrix element. // // The function call operator provides access to the elements at position (i,j). The attempt // to assign to an element on the diagonal or in the lower part of the matrix (i.e. below the // diagonal) will result in a \a std::invalid_argument exception. // // Note that in contrast to the subscript operator this function always performs a check of the // given access indices. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline typename UniUpperMatrix<MT,SO,false>::Reference UniUpperMatrix<MT,SO,false>::at( size_t i, size_t j ) { if( i >= rows() ) { BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" ); } if( j >= columns() ) { BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" ); } return (*this)(i,j); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Checked access to the matrix elements. // // \param i Access index for the row. The index has to be in the range \f$[0..N-1]\f$. // \param j Access index for the column. The index has to be in the range \f$[0..N-1]\f$. // \return Reference to the accessed value. // \exception std::out_of_range Invalid matrix access index. // \exception std::invalid_argument Invalid assignment to diagonal or lower matrix element. // // The function call operator provides access to the elements at position (i,j). The attempt // to assign to an element on the diagonal or in the lower part of the matrix (i.e. below the // diagonal) will result in a \a std::invalid_argument exception. // // Note that in contrast to the subscript operator this function always performs a check of the // given access indices. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline typename UniUpperMatrix<MT,SO,false>::ConstReference UniUpperMatrix<MT,SO,false>::at( size_t i, size_t j ) const { if( i >= rows() ) { BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" ); } if( j >= columns() ) { BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" ); } return (*this)(i,j); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Returns an iterator to the first element of row/column \a i. // // \param i The row/column index. // \return Iterator to the first element of row/column \a i. // // This function returns a row/column iterator to the first element of row/column \a i. In case // the uniupper matrix adapts a \a rowMajor sparse matrix the function returns an iterator to // the first element of row \a i, in case it adapts a \a columnMajor sparse matrix the function // returns an iterator to the first element of column \a i. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline typename UniUpperMatrix<MT,SO,false>::Iterator UniUpperMatrix<MT,SO,false>::begin( size_t i ) { return Iterator( matrix_.begin(i), i ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Returns an iterator to the first element of row/column \a i. // // \param i The row/column index. // \return Iterator to the first element of row/column \a i. // // This function returns a row/column iterator to the first element of row/column \a i. In case // the uniupper matrix adapts a \a rowMajor sparse matrix the function returns an iterator to // the first element of row \a i, in case it adapts a \a columnMajor sparse matrix the function // returns an iterator to the first element of column \a i. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline typename UniUpperMatrix<MT,SO,false>::ConstIterator UniUpperMatrix<MT,SO,false>::begin( size_t i ) const { return matrix_.begin(i); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Returns an iterator to the first element of row/column \a i. // // \param i The row/column index. // \return Iterator to the first element of row/column \a i. // // This function returns a row/column iterator to the first element of row/column \a i. In case // the uniupper matrix adapts a \a rowMajor sparse matrix the function returns an iterator to // the first element of row \a i, in case it adapts a \a columnMajor sparse matrix the function // returns an iterator to the first element of column \a i. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline typename UniUpperMatrix<MT,SO,false>::ConstIterator UniUpperMatrix<MT,SO,false>::cbegin( size_t i ) const { return matrix_.cbegin(i); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Returns an iterator just past the last element of row/column \a i. // // \param i The row/column index. // \return Iterator just past the last element of row/column \a i. // // This function returns an row/column iterator just past the last element of row/column \a i. // In case the uniupper matrix adapts a \a rowMajor sparse matrix the function returns an iterator // just past the last element of row \a i, in case it adapts a \a columnMajor sparse matrix the // function returns an iterator just past the last element of column \a i. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline typename UniUpperMatrix<MT,SO,false>::Iterator UniUpperMatrix<MT,SO,false>::end( size_t i ) { return Iterator( matrix_.end(i), i ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Returns an iterator just past the last element of row/column \a i. // // \param i The row/column index. // \return Iterator just past the last element of row/column \a i. // // This function returns an row/column iterator just past the last element of row/column \a i. // In case the uniupper matrix adapts a \a rowMajor sparse matrix the function returns an iterator // just past the last element of row \a i, in case it adapts a \a columnMajor sparse matrix the // function returns an iterator just past the last element of column \a i. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline typename UniUpperMatrix<MT,SO,false>::ConstIterator UniUpperMatrix<MT,SO,false>::end( size_t i ) const { return matrix_.end(i); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Returns an iterator just past the last element of row/column \a i. // // \param i The row/column index. // \return Iterator just past the last element of row/column \a i. // // This function returns an row/column iterator just past the last element of row/column \a i. // In case the uniupper matrix adapts a \a rowMajor sparse matrix the function returns an iterator // just past the last element of row \a i, in case it adapts a \a columnMajor sparse matrix the // function returns an iterator just past the last element of column \a i. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline typename UniUpperMatrix<MT,SO,false>::ConstIterator UniUpperMatrix<MT,SO,false>::cend( size_t i ) const { return matrix_.cend(i); } /*! \endcond */ //************************************************************************************************* //================================================================================================= // // ASSIGNMENT OPERATORS // //================================================================================================= //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief List assignment to all matrix elements. // // \param list The initializer list. // \exception std::invalid_argument Invalid assignment to uniupper matrix. // // This assignment operator offers the option to directly assign to all elements of the uniupper // matrix by means of an initializer list: \code using blaze::rowMajor; blaze::UniUpperMatrix< blaze::CompressedMatrix<int,rowMajor> > A; A = { { 1, 2, 3 }, { 0, 1 }, { 0, 0, 1 } }; \endcode // The matrix is resized according to the size of the initializer list and all matrix elements // are assigned the values from the given list. Missing values are assigned default values. In // case the matrix cannot be resized and the dimensions of the initializer list don't match or // if the given list does not represent an uniupper matrix, a \a std::invalid_argument exception // is thrown. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline UniUpperMatrix<MT,SO,false>& UniUpperMatrix<MT,SO,false>::operator=( initializer_list< initializer_list<ElementType> > list ) { const InitializerMatrix<ElementType> tmp( list, list.size() ); if( !isUniUpper( tmp ) ) { BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" ); } matrix_ = list; BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" ); BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" ); return *this; } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Copy assignment operator for UniUpperMatrix. // // \param rhs Matrix to be copied. // \return Reference to the assigned matrix. // // If possible and necessary, the matrix is resized according to the given \f$ N \times N \f$ // matrix and initialized as a copy of this matrix. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline UniUpperMatrix<MT,SO,false>& UniUpperMatrix<MT,SO,false>::operator=( const UniUpperMatrix& rhs ) { matrix_ = rhs.matrix_; BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" ); BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" ); return *this; } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Move assignment operator for UniUpperMatrix. // // \param rhs The matrix to be moved into this instance. // \return Reference to the assigned matrix. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline UniUpperMatrix<MT,SO,false>& UniUpperMatrix<MT,SO,false>::operator=( UniUpperMatrix&& rhs ) noexcept { matrix_ = std::move( rhs.matrix_ ); BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" ); BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" ); return *this; } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Assignment operator for general matrices. // // \param rhs The general matrix to be copied. // \return Reference to the assigned matrix. // \exception std::invalid_argument Invalid assignment to uniupper matrix. // // If possible and necessary, the matrix is resized according to the given \f$ N \times N \f$ // matrix and initialized as a copy of this matrix. If the matrix cannot be resized accordingly, // a \a std::invalid_argument exception is thrown. Also note that the given matrix must be an // uniupper matrix. Otherwise, a \a std::invalid_argument exception is thrown. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix template< typename MT2 // Type of the right-hand side matrix , bool SO2 > // Storage order of the right-hand side matrix inline auto UniUpperMatrix<MT,SO,false>::operator=( const Matrix<MT2,SO2>& rhs ) -> DisableIf_t< IsComputation_v<MT2>, UniUpperMatrix& > { if( IsStrictlyTriangular_v<MT2> || ( !IsUniUpper_v<MT2> && !isUniUpper( ~rhs ) ) ) { BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" ); } matrix_ = declupp( ~rhs ); if( !IsUniUpper_v<MT2> ) resetLower(); BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" ); BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" ); return *this; } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Assignment operator for matrix computations. // // \param rhs The matrix computation to be copied. // \return Reference to the assigned matrix. // \exception std::invalid_argument Invalid assignment to uniupper matrix. // // If possible and necessary, the matrix is resized according to the given \f$ N \times N \f$ // matrix and initialized as a copy of this matrix. If the matrix cannot be resized accordingly, // a \a std::invalid_argument exception is thrown. Also note that the given matrix must be an // uniupper matrix. Otherwise, a \a std::invalid_argument exception is thrown. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix template< typename MT2 // Type of the right-hand side matrix , bool SO2 > // Storage order of the right-hand side matrix inline auto UniUpperMatrix<MT,SO,false>::operator=( const Matrix<MT2,SO2>& rhs ) -> EnableIf_t< IsComputation_v<MT2>, UniUpperMatrix& > { if( IsStrictlyTriangular_v<MT2> || ( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) ) { BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" ); } if( IsUniUpper_v<MT2> ) { matrix_ = ~rhs; } else { MT tmp( ~rhs ); if( !isUniUpper( tmp ) ) { BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" ); } matrix_ = std::move( tmp ); } if( !IsUniUpper_v<MT2> ) resetLower(); BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" ); BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" ); return *this; } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Addition assignment operator for the addition of a general matrix (\f$ A+=B \f$). // // \param rhs The right-hand side general matrix to be added. // \return Reference to the matrix. // \exception std::invalid_argument Invalid assignment to uniupper matrix. // // In case the current sizes of the two matrices don't match, a \a std::invalid_argument // exception is thrown. Also note that the result of the addition operation must be an uniupper // matrix, i.e. the given matrix must be a strictly upper matrix. In case the result is not an // uniupper matrix, a \a std::invalid_argument exception is thrown. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix template< typename MT2 // Type of the right-hand side matrix , bool SO2 > // Storage order of the right-hand side matrix inline auto UniUpperMatrix<MT,SO,false>::operator+=( const Matrix<MT2,SO2>& rhs ) -> DisableIf_t< IsComputation_v<MT2>, UniUpperMatrix& > { if( IsLower_v<MT2> || IsUniTriangular_v<MT2> || ( !IsStrictlyUpper_v<MT2> && !isStrictlyUpper( ~rhs ) ) ) { BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" ); } matrix_ += declupp( ~rhs ); if( !IsStrictlyUpper_v<MT2> ) resetLower(); BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" ); BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" ); return *this; } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Addition assignment operator for the addition of a matrix computation (\f$ A+=B \f$). // // \param rhs The right-hand side matrix computation to be added. // \return Reference to the matrix. // \exception std::invalid_argument Invalid assignment to uniupper matrix. // // In case the current sizes of the two matrices don't match, a \a std::invalid_argument // exception is thrown. Also note that the result of the addition operation must be an uniupper // matrix, i.e. the given matrix must be a strictly upper matrix. In case the result is not an // uniupper matrix, a \a std::invalid_argument exception is thrown. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix template< typename MT2 // Type of the right-hand side matrix , bool SO2 > // Storage order of the right-hand side matrix inline auto UniUpperMatrix<MT,SO,false>::operator+=( const Matrix<MT2,SO2>& rhs ) -> EnableIf_t< IsComputation_v<MT2>, UniUpperMatrix& > { if( IsLower_v<MT2> || IsUniTriangular_v<MT2> || ( IsSquare_v<MT2> && !isSquare( ~rhs ) ) ) { BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" ); } if( IsStrictlyUpper_v<MT2> ) { matrix_ += ~rhs; } else { const ResultType_t<MT2> tmp( ~rhs ); if( !isStrictlyUpper( tmp ) ) { BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" ); } matrix_ += declupp( tmp ); } if( !IsStrictlyUpper_v<MT2> ) resetLower(); BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" ); BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" ); return *this; } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Subtraction assignment operator for the subtraction of a general matrix (\f$ A-=B \f$). // // \param rhs The right-hand side general matrix to be subtracted. // \return Reference to the matrix. // \exception std::invalid_argument Invalid assignment to uniupper matrix. // // In case the current sizes of the two matrices don't match, a \a std::invalid_argument // exception is thrown. Also note that the result of the subtraction operation must be an // uniupper matrix, i.e. the given matrix must be a strictly upper matrix. In case the // result is not an uniupper matrix, a \a std::invalid_argument exception is thrown. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix template< typename MT2 // Type of the right-hand side matrix , bool SO2 > // Storage order of the right-hand side matrix inline auto UniUpperMatrix<MT,SO,false>::operator-=( const Matrix<MT2,SO2>& rhs ) -> DisableIf_t< IsComputation_v<MT2>, UniUpperMatrix& > { if( IsLower_v<MT2> || IsUniTriangular_v<MT2> || ( !IsStrictlyUpper_v<MT2> && !isStrictlyUpper( ~rhs ) ) ) { BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" ); } matrix_ -= declupp( ~rhs ); if( !IsStrictlyUpper_v<MT2> ) resetLower(); BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" ); BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" ); return *this; } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Subtraction assignment operator for the subtraction of a matrix computation (\f$ A-=B \f$). // // \param rhs The right-hand side matrix computation to be subtracted. // \return Reference to the matrix. // \exception std::invalid_argument Invalid assignment to uniupper matrix. // // In case the current sizes of the two matrices don't match, a \a std::invalid_argument // exception is thrown. Also note that the result of the subtraction operation must be an // uniupper matrix, i.e. the given matrix must be a strictly upper matrix. In case the // result is not an uniupper matrix, a \a std::invalid_argument exception is thrown. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix template< typename MT2 // Type of the right-hand side matrix , bool SO2 > // Storage order of the right-hand side matrix inline auto UniUpperMatrix<MT,SO,false>::operator-=( const Matrix<MT2,SO2>& rhs ) -> EnableIf_t< IsComputation_v<MT2>, UniUpperMatrix& > { if( IsLower_v<MT2> || IsUniTriangular_v<MT2> || ( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) ) { BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" ); } if( IsStrictlyUpper_v<MT2> ) { matrix_ -= ~rhs; } else { const ResultType_t<MT2> tmp( ~rhs ); if( !isStrictlyUpper( tmp ) ) { BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" ); } matrix_ -= declupp( tmp ); } if( !IsStrictlyUpper_v<MT2> ) resetLower(); BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" ); BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" ); return *this; } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Schur product assignment operator for the multiplication of a matrix (\f$ A\circ=B \f$). // // \param rhs The right-hand side general matrix for the Schur product. // \return Reference to the matrix. // \exception std::invalid_argument Invalid assignment to uniupper matrix. // // In case the current sizes of the two matrices don't match, a \a std::invalid_argument // exception is thrown. Also note that the result of the Schur product operation must be an // uniupper matrix, i.e. the given matrix must be a strictly upper matrix. In case the result // is not an uniupper matrix, a \a std::invalid_argument exception is thrown. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix template< typename MT2 // Type of the right-hand side matrix , bool SO2 > // Storage order of the right-hand side matrix inline auto UniUpperMatrix<MT,SO,false>::operator%=( const Matrix<MT2,SO2>& rhs ) -> UniUpperMatrix& { if( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) { BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" ); } If_t< IsComputation_v<MT2>, ResultType_t<MT2>, const MT2& > tmp( ~rhs ); for( size_t i=0UL; i<(~rhs).rows(); ++i ) { if( !isOne( tmp(i,i) ) ) { BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" ); } } matrix_ %= tmp; if( !IsUniUpper_v<MT2> ) resetLower(); BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" ); BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" ); return *this; } /*! \endcond */ //************************************************************************************************* //================================================================================================= // // UTILITY FUNCTIONS // //================================================================================================= //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Returns the current number of rows of the matrix. // // \return The number of rows of the matrix. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline size_t UniUpperMatrix<MT,SO,false>::rows() const noexcept { return matrix_.rows(); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Returns the current number of columns of the matrix. // // \return The number of columns of the matrix. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline size_t UniUpperMatrix<MT,SO,false>::columns() const noexcept { return matrix_.columns(); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Returns the maximum capacity of the matrix. // // \return The capacity of the matrix. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline size_t UniUpperMatrix<MT,SO,false>::capacity() const noexcept { return matrix_.capacity(); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Returns the current capacity of the specified row/column. // // \param i The index of the row/column. // \return The current capacity of row/column \a i. // // This function returns the current capacity of the specified row/column. In case the uniupper // matrix adapts a \a rowMajor sparse matrix the function returns the capacity of row \a i, in // case it adapts a \a columnMajor sparse matrix the function returns the capacity of column // \a i. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline size_t UniUpperMatrix<MT,SO,false>::capacity( size_t i ) const noexcept { return matrix_.capacity(i); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Returns the total number of non-zero elements in the matrix // // \return The number of non-zero elements in the uniupper matrix. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline size_t UniUpperMatrix<MT,SO,false>::nonZeros() const { return matrix_.nonZeros(); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Returns the number of non-zero elements in the specified row/column. // // \param i The index of the row/column. // \return The number of non-zero elements of row/column \a i. // // This function returns the current number of non-zero elements in the specified row/column. // In case the uniupper matrix adapts a \a rowMajor sparse matrix the function returns the // number of non-zero elements in row \a i, in case it adapts a to \a columnMajor sparse // matrix the function returns the number of non-zero elements in column \a i. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline size_t UniUpperMatrix<MT,SO,false>::nonZeros( size_t i ) const { return matrix_.nonZeros(i); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Reset to the default initial values. // // \return void */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline void UniUpperMatrix<MT,SO,false>::reset() { if( SO ) { for( size_t j=1UL; j<columns(); ++j ) { matrix_.erase( j, matrix_.begin(j), matrix_.lowerBound(j,j) ); } } else { for( size_t i=0UL; i<rows(); ++i ) { matrix_.erase( i, matrix_.lowerBound(i,i+1UL), matrix_.end(i) ); } } } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Reset the specified row/column to the default initial values. // // \param i The index of the row/column. // \return void // \exception std::invalid_argument Invalid row/column access index. // // This function resets the values in the specified row/column to their default value. In case // the storage order is set to \a rowMajor the function resets the values in row \a i, in case // the storage order is set to \a columnMajor the function resets the values in column \a i. // Note that the reset() function has no impact on the capacity of the matrix or row/column. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline void UniUpperMatrix<MT,SO,false>::reset( size_t i ) { if( SO ) { matrix_.erase( i, matrix_.begin(i), matrix_.lowerBound(i,i) ); } else { matrix_.erase( i, matrix_.lowerBound(i,i+1UL), matrix_.end(i) ); } } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Clearing the uniupper matrix. // // \return void // // This function clears the uniupper matrix and returns it to its default state. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline void UniUpperMatrix<MT,SO,false>::clear() { using blaze::clear; if( IsResizable_v<MT> ) { clear( matrix_ ); } else { reset(); } } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Changing the size of the uniupper matrix. // // \param n The new number of rows and columns of the matrix. // \param preserve \a true if the old values of the matrix should be preserved, \a false if not. // \return void // // This function resizes the matrix using the given size to \f$ m \times n \f$. During this // operation, new dynamic memory may be allocated in case the capacity of the matrix is too // small. Note that this function may invalidate all existing views (submatrices, rows, columns, // ...) on the matrix if it is used to shrink the matrix. Additionally, the resize operation // potentially changes all matrix elements. In order to preserve the old matrix values, the // \a preserve flag can be set to \a true. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix void UniUpperMatrix<MT,SO,false>::resize( size_t n, bool preserve ) { BLAZE_CONSTRAINT_MUST_BE_RESIZABLE_TYPE( MT ); BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" ); const size_t oldsize( matrix_.rows() ); matrix_.resize( n, n, preserve ); if( n > oldsize ) { for( size_t i=oldsize; i<n; ++i ) matrix_.insert( i, i, ElementType(1) ); } } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Setting the minimum capacity of the uniupper matrix. // // \param nonzeros The new minimum capacity of the uniupper matrix. // \return void // // This function increases the capacity of the uniupper matrix to at least \a nonzeros elements. // The current values of the matrix elements and the individual capacities of the matrix rows // are preserved. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline void UniUpperMatrix<MT,SO,false>::reserve( size_t nonzeros ) { matrix_.reserve( nonzeros ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Setting the minimum capacity of a specific row/column of the uniupper matrix. // // \param i The row/column index \f$[0..N-1]\f$. // \param nonzeros The new minimum capacity of the specified row/column. // \return void // // This function increases the capacity of row/column \a i of the uniupper matrix to at least // \a nonzeros elements. The current values of the uniupper matrix and all other individual // row/column capacities are preserved. In case the uniupper matrix adapts a \a rowMajor sparse // matrix the function reserves capacity for row \a i. In case it adapts a \a columnMajor the // function reserves capacity for column \a i. The index has to be in the range \f$[0..N-1]\f$. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline void UniUpperMatrix<MT,SO,false>::reserve( size_t i, size_t nonzeros ) { matrix_.reserve( i, nonzeros ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Removing all excessive capacity from all rows/columns. // // \return void // // The trim() function can be used to reverse the effect of all row/column-specific reserve() // calls. The function removes all excessive capacity from all rows (in case of a rowMajor // matrix) or columns (in case of a columnMajor matrix). Note that this function does not // remove the overall capacity but only reduces the capacity per row/column. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline void UniUpperMatrix<MT,SO,false>::trim() { matrix_.trim(); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Removing all excessive capacity of a specific row/column of the uniupper matrix. // // \param i The index of the row/column to be trimmed \f$[0..N-1]\f$. // \return void // // This function can be used to reverse the effect of a row/column-specific reserve() call. // It removes all excessive capacity from the specified row (in case of a rowMajor matrix) // or column (in case of a columnMajor matrix). The excessive capacity is assigned to the // subsequent row/column. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline void UniUpperMatrix<MT,SO,false>::trim( size_t i ) { matrix_.trim( i ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Requesting the removal of unused capacity. // // \return void // // This function minimizes the capacity of the matrix by removing unused capacity. Please note // that in case a reallocation occurs, all iterators (including end() iterators), all pointers // and references to elements of this matrix are invalidated. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline void UniUpperMatrix<MT,SO,false>::shrinkToFit() { matrix_.shrinkToFit(); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Swapping the contents of two matrices. // // \param m The matrix to be swapped. // \return void */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline void UniUpperMatrix<MT,SO,false>::swap( UniUpperMatrix& m ) noexcept { using std::swap; swap( matrix_, m.matrix_ ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Returns the maximum number of non-zero values for an upper unitriangular matrix. // // \return The maximum number of non-zero values. // // This function returns the maximum possible number of non-zero values for an upper unitriangular // matrix with fixed-size adapted matrix of type \a MT. Note that this function can only be // called in case the adapted dense matrix is a fixed-size matrix. The attempt to call this // function in case the adapted matrix is resizable matrix will result in a compile time error. */ template< typename MT // Type of the adapted dense matrix , bool SO > // Storage order of the adapted dense matrix constexpr size_t UniUpperMatrix<MT,SO,false>::maxNonZeros() noexcept { BLAZE_CONSTRAINT_MUST_BE_STATIC_TYPE( MT ); return maxNonZeros( Size_v<MT,0UL> ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Returns the maximum number of non-zero values for an upper unitriangular matrix. // // \param n The number of rows and columns of the matrix. // \return The maximum number of non-zero values. // // This function returns the maximum possible number of non-zero values for an upper unitriangular // matrix of the given number of rows and columns. */ template< typename MT // Type of the adapted dense matrix , bool SO > // Storage order of the adapted dense matrix constexpr size_t UniUpperMatrix<MT,SO,false>::maxNonZeros( size_t n ) noexcept { return ( ( n + 1UL ) * n ) / 2UL; } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Reset the complete lower part of the matrix to the default initial values. // // \return void */ template< typename MT // Type of the adapted dense matrix , bool SO > // Storage order of the adapted dense matrix inline void UniUpperMatrix<MT,SO,false>::resetLower() { if( SO ) { for( size_t j=0UL; j<columns(); ++j ) matrix_.erase( j, matrix_.upperBound( j, j ), matrix_.end( j ) ); } else { for( size_t i=1UL; i<rows(); ++i ) matrix_.erase( i, matrix_.begin( i ), matrix_.lowerBound( i, i ) ); } } /*! \endcond */ //************************************************************************************************* //================================================================================================= // // INSERTION FUNCTIONS // //================================================================================================= //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Setting elements of the uniupper matrix. // // \param i The row index of the new element. The index has to be in the range \f$[0..N-1]\f$. // \param j The column index of the new element. The index has to be in the range \f$[0..N-1]\f$. // \param value The value of the element to be set. // \return Iterator to the set element. // \exception std::invalid_argument Invalid access to diagonal or lower matrix element. // // This function sets the value of an element of the uniupper matrix. In case the uniupper matrix // already contains an element with row index \a i and column index \a j its value is modified, // else a new element with the given \a value is inserted. The attempt to set an element on the // diagonal or in the lower part of the matrix (i.e. below the diagonal) will result in a // \a std::invalid_argument exception. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline typename UniUpperMatrix<MT,SO,false>::Iterator UniUpperMatrix<MT,SO,false>::set( size_t i, size_t j, const ElementType& value ) { if( i >= j ) { BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to diagonal or lower matrix element" ); } return Iterator( matrix_.set( i, j, value ), ( SO ? j : i ) ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Inserting elements into the uniupper matrix. // // \param i The row index of the new element. The index has to be in the range \f$[0..N-1]\f$. // \param j The column index of the new element. The index has to be in the range \f$[0..N-1]\f$. // \param value The value of the element to be inserted. // \return Iterator to the newly inserted element. // \exception std::invalid_argument Invalid sparse matrix access index. // \exception std::invalid_argument Invalid access to diagonal or lower matrix element. // // This function inserts a new element into the uniupper matrix. However, duplicate elements are // not allowed. In case the uniupper matrix already contains an element with row index \a i and // column index \a j, a \a std::invalid_argument exception is thrown. Also, the attempt to insert // an element on the diagonal or in the lower part of the matrix (i.e. below the diagonal) will // result in a \a std::invalid_argument exception. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline typename UniUpperMatrix<MT,SO,false>::Iterator UniUpperMatrix<MT,SO,false>::insert( size_t i, size_t j, const ElementType& value ) { if( i >= j ) { BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to diagonal or lower matrix element" ); } return Iterator( matrix_.insert( i, j, value ), ( SO ? j : i ) ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Appending elements to the specified row/column of the uniupper matrix. // // \param i The row index of the new element. The index has to be in the range \f$[0..N-1]\f$. // \param j The column index of the new element. The index has to be in the range \f$[0..N-1]\f$. // \param value The value of the element to be appended. // \param check \a true if the new value should be checked for default values, \a false if not. // \return void // \exception std::invalid_argument Invalid access to diagonal or lower matrix element. // // This function provides a very efficient way to fill an uniupper sparse matrix with elements. // It appends a new element to the end of the specified row/column without any additional memory // allocation. Therefore it is strictly necessary to keep the following preconditions in mind: // // - the index of the new element must be strictly larger than the largest index of non-zero // elements in the specified row/column of the sparse matrix // - the current number of non-zero elements in the matrix must be smaller than the capacity // of the matrix // // Ignoring these preconditions might result in undefined behavior! The optional \a check // parameter specifies whether the new value should be tested for a default value. If the new // value is a default value (for instance 0 in case of an integral element type) the value is // not appended. Per default the values are not tested. // // In combination with the reserve() and the finalize() function, append() provides the most // efficient way to add new elements to a (newly created) sparse matrix: \code using blaze::CompressedMatrix; using blaze::UniUpperMatrix; using blaze::rowMajor; UniUpperMatrix< CompressedMatrix<double,rowMajor> > A( 4 ); A.reserve( 3 ); // Reserving enough capacity for 3 non-zero elements A.append( 0, 1, 1.0 ); // Appending the value 1 in row 0 with column index 1 A.finalize( 0 ); // Finalizing row 0 A.append( 1, 2, 2.0 ); // Appending the value 2 in row 1 with column index 2 A.finalize( 1 ); // Finalizing row 1 A.append( 2, 3, 3.0 ); // Appending the value 3 in row 2 with column index 3 A.finalize( 2 ); // Finalizing row 2 A.finalize( 3 ); // Finalizing the final row 3 \endcode // Note that although append() does not allocate new memory it still invalidates all iterators // returned by the end() functions! Also note that the attempt to append an element within the // lower part of the matrix (i.e. below the diagonal) will result in a \a std::invalid_argument // exception. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline void UniUpperMatrix<MT,SO,false>::append( size_t i, size_t j, const ElementType& value, bool check ) { if( i >= j ) { BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to diagonal or lower matrix element" ); } if( !check || !isDefault<strict>( value ) ) matrix_.insert( i, j, value ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Finalizing the element insertion of a row/column. // // \param i The index of the row/column to be finalized \f$[0..N-1]\f$. // \return void // // This function is part of the low-level interface to efficiently fill a matrix with elements. // After completion of row/column \a i via the append() function, this function can be called to // finalize row/column \a i and prepare the next row/column for insertion process via append(). // // \note Although finalize() does not allocate new memory, it still invalidates all iterators // returned by the end() functions! */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline void UniUpperMatrix<MT,SO,false>::finalize( size_t i ) { matrix_.trim( i ); } /*! \endcond */ //************************************************************************************************* //================================================================================================= // // ERASE FUNCTIONS // //================================================================================================= //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Erasing elements from the uniupper matrix. // // \param i The row index of the element to be erased. The index has to be in the range \f$[0..N-1]\f$. // \param j The column index of the element to be erased. The index has to be in the range \f$[0..N-1]\f$. // \return void // \exception std::invalid_argument Invalid access to diagonal matrix element. // // This function erases a non-diagonal element from the uniupper matrix. The attempt to erase a // diagonal element will result in a \a std::invalid_argument exception. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline void UniUpperMatrix<MT,SO,false>::erase( size_t i, size_t j ) { if( i == j ) { BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to diagonal matrix element" ); } matrix_.erase( i, j ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Erasing elements from the uniupper matrix. // // \param i The row/column index of the element to be erased. The index has to be in the range \f$[0..N-1]\f$. // \param pos Iterator to the element to be erased. // \return Iterator to the element after the erased element. // \exception std::invalid_argument Invalid access to diagonal matrix element. // // This function erases a non-diagonal element from the uniupper matrix. In case the uniupper // matrix adapts a \a rowMajor sparse matrix the function erases an element from row \a i, in // case it adapts a \a columnMajor sparse matrix the function erases an element from column \a i. // The attempt to erase a diagonal element will result in a \a std::invalid_argument exception. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline typename UniUpperMatrix<MT,SO,false>::Iterator UniUpperMatrix<MT,SO,false>::erase( size_t i, Iterator pos ) { if( pos != matrix_.end(i) && pos->index() == i ) { BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to diagonal matrix element" ); } return Iterator( matrix_.erase( i, pos.base() ), i ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Erasing a range of elements from the uniupper matrix. // // \param i The row/column index of the element to be erased. The index has to be in the range \f$[0..N-1]\f$. // \param first Iterator to first element to be erased. // \param last Iterator just past the last element to be erased. // \return Iterator to the element after the erased element. // \exception std::invalid_argument Invalid access to diagonal matrix element. // // This function erases a range of elements from the uniupper matrix. In case the uniupper matrix // adapts a \a rowMajor sparse matrix the function erases a range of elements from row \a i, in // case it adapts a \a columnMajor matrix the function erases a range of elements from column \a i. // The attempt to erase a diagonal element will result in a \a std::invalid_argument exception. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline typename UniUpperMatrix<MT,SO,false>::Iterator UniUpperMatrix<MT,SO,false>::erase( size_t i, Iterator first, Iterator last ) { if( first == last ) return last; if( ( !SO && first.base() == matrix_.begin(i) ) || ( SO && last.base() == matrix_.end(i) ) ) { BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to diagonal matrix element" ); } return Iterator( matrix_.erase( i, first.base(), last.base() ), i ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Erasing specific elements from the uniupper matrix. // // \param predicate The unary predicate for the element selection. // \return void. // // This function erases specific elements from the uniupper matrix. The elements are selected by // the given unary predicate \a predicate, which is expected to accept a single argument of the // type of the elements and to be pure. The following example demonstrates how to remove all // elements that are smaller than a certain threshold value: \code blaze::UniUpperMatrix< CompressedMatrix<double,blaze::rowMajor> > A; // ... Resizing and initialization A.erase( []( double value ){ return value < 1E-8; } ); \endcode // \note The predicate is required to be pure, i.e. to produce deterministic results for elements // with the same value. The attempt to use an impure predicate leads to undefined behavior! */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix template< typename Pred > // Type of the unary predicate inline void UniUpperMatrix<MT,SO,false>::erase( Pred predicate ) { if( SO ) { for( size_t j=1UL; j<columns(); ++j ) { matrix_.erase( j, matrix_.begin(j), matrix_.find(j,j), predicate ); } } else { for( size_t i=0UL; (i+1UL) < rows(); ++i ) { matrix_.erase( i, matrix_.lowerBound(i,i+1UL), matrix_.end(i), predicate ); } } BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Erasing specific elements from a range of the uniupper matrix. // // \param i The row/column index of the elements to be erased. The index has to be in the range \f$[0..M-1]\f$. // \param first Iterator to first element of the range. // \param last Iterator just past the last element of the range. // \param predicate The unary predicate for the element selection. // \return void // // This function erases specific elements from a range of elements of the uniupper matrix. The // elements are selected by the given unary predicate \a predicate, which is expected to accept // a single argument of the type of the elements and to be pure. In case the storage order is // set to \a rowMajor the function erases a range of elements from row \a i, in case the storage // flag is set to \a columnMajor the function erases a range of elements from column \a i. The // following example demonstrates how to remove all elements that are smaller than a certain // threshold value: \code blaze::UniUpperMatrix< CompressedMatrix<double,blaze::rowMajor> > A; // ... Resizing and initialization A.erase( 2UL, A.begin(2UL), A.end(2UL), []( double value ){ return value < 1E-8; } ); \endcode // \note The predicate is required to be pure, i.e. to produce deterministic results for elements // with the same value. The attempt to use an impure predicate leads to undefined behavior! */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix template< typename Pred > // Type of the unary predicate inline void UniUpperMatrix<MT,SO,false>::erase( size_t i, Iterator first, Iterator last, Pred predicate ) { if( first == last ) return; if( ( !SO && first.base() == matrix_.begin(i) && predicate( ElementType(1) ) ) || ( SO && last.base() == matrix_.end(i) && predicate( ElementType(1) ) ) ) { BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to diagonal matrix element" ); } matrix_.erase( i, first.base(), last.base(), predicate ); BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" ); } /*! \endcond */ //************************************************************************************************* //================================================================================================= // // LOOKUP FUNCTIONS // //================================================================================================= //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Searches for a specific matrix element. // // \param i The row index of the search element. The index has to be in the range \f$[0..N-1]\f$. // \param j The column index of the search element. The index has to be in the range \f$[0..N-1]\f$. // \return Iterator to the element in case the index is found, end() iterator otherwise. // // This function can be used to check whether a specific element is contained in the uniupper // matrix. It specifically searches for the element with row index \a i and column index \a j. // In case the element is found, the function returns an row/column iterator to the element. // Otherwise an iterator just past the last non-zero element of row \a i or column \a j (the // end() iterator) is returned. Note that the returned uniupper matrix iterator is subject to // invalidation due to inserting operations via the function call operator, the set() function // or the insert() function! */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline typename UniUpperMatrix<MT,SO,false>::Iterator UniUpperMatrix<MT,SO,false>::find( size_t i, size_t j ) { return Iterator( matrix_.find( i, j ), ( SO ? j : i ) ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Searches for a specific matrix element. // // \param i The row index of the search element. The index has to be in the range \f$[0..N-1]\f$. // \param j The column index of the search element. The index has to be in the range \f$[0..N-1]\f$. // \return Iterator to the element in case the index is found, end() iterator otherwise. // // This function can be used to check whether a specific element is contained in the uniupper // matrix. It specifically searches for the element with row index \a i and column index \a j. // In case the element is found, the function returns an row/column iterator to the element. // Otherwise an iterator just past the last non-zero element of row \a i or column \a j (the // end() iterator) is returned. Note that the returned uniupper matrix iterator is subject to // invalidation due to inserting operations via the function call operator, the set() function // or the insert() function! */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline typename UniUpperMatrix<MT,SO,false>::ConstIterator UniUpperMatrix<MT,SO,false>::find( size_t i, size_t j ) const { return matrix_.find( i, j ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Returns an iterator to the first index not less then the given index. // // \param i The row index of the search element. The index has to be in the range \f$[0..N-1]\f$. // \param j The column index of the search element. The index has to be in the range \f$[0..N-1]\f$. // \return Iterator to the first index not less then the given index, end() iterator otherwise. // // In case of a row-major matrix, this function returns a row iterator to the first element with // an index not less then the given column index. In case of a column-major matrix, the function // returns a column iterator to the first element with an index not less then the given row // index. In combination with the upperBound() function this function can be used to create // a pair of iterators specifying a range of indices. Note that the returned uniupper matrix // iterator is subject to invalidation due to inserting operations via the function call // operator, the set() function or the insert() function! */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline typename UniUpperMatrix<MT,SO,false>::Iterator UniUpperMatrix<MT,SO,false>::lowerBound( size_t i, size_t j ) { return Iterator( matrix_.lowerBound( i, j ), ( SO ? j : i ) ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Returns an iterator to the first index not less then the given index. // // \param i The row index of the search element. The index has to be in the range \f$[0..N-1]\f$. // \param j The column index of the search element. The index has to be in the range \f$[0..N-1]\f$. // \return Iterator to the first index not less then the given index, end() iterator otherwise. // // In case of a row-major matrix, this function returns a row iterator to the first element with // an index not less then the given column index. In case of a column-major matrix, the function // returns a column iterator to the first element with an index not less then the given row // index. In combination with the upperBound() function this function can be used to create // a pair of iterators specifying a range of indices. Note that the returned uniupper matrix // iterator is subject to invalidation due to inserting operations via the function call // operator, the set() function or the insert() function! */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline typename UniUpperMatrix<MT,SO,false>::ConstIterator UniUpperMatrix<MT,SO,false>::lowerBound( size_t i, size_t j ) const { return matrix_.lowerBound( i, j ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Returns an iterator to the first index greater then the given index. // // \param i The row index of the search element. The index has to be in the range \f$[0..N-1]\f$. // \param j The column index of the search element. The index has to be in the range \f$[0..N-1]\f$. // \return Iterator to the first index greater then the given index, end() iterator otherwise. // // In case of a row-major matrix, this function returns a row iterator to the first element with // an index greater then the given column index. In case of a column-major matrix, the function // returns a column iterator to the first element with an index greater then the given row // index. In combination with the lowerBound() function this function can be used to create // a pair of iterators specifying a range of indices. Note that the returned uniupper matrix // iterator is subject to invalidation due to inserting operations via the function call // operator, the set() function or the insert() function! */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline typename UniUpperMatrix<MT,SO,false>::Iterator UniUpperMatrix<MT,SO,false>::upperBound( size_t i, size_t j ) { return Iterator( matrix_.upperBound( i, j ), ( SO ? j : i ) ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Returns an iterator to the first index greater then the given index. // // \param i The row index of the search element. The index has to be in the range \f$[0..N-1]\f$. // \param j The column index of the search element. The index has to be in the range \f$[0..N-1]\f$. // \return Iterator to the first index greater then the given index, end() iterator otherwise. // // In case of a row-major matrix, this function returns a row iterator to the first element with // an index greater then the given column index. In case of a column-major matrix, the function // returns a column iterator to the first element with an index greater then the given row // index. In combination with the lowerBound() function this function can be used to create // a pair of iterators specifying a range of indices. Note that the returned uniupper matrix // iterator is subject to invalidation due to inserting operations via the function call // operator, the set() function or the insert() function! */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline typename UniUpperMatrix<MT,SO,false>::ConstIterator UniUpperMatrix<MT,SO,false>::upperBound( size_t i, size_t j ) const { return matrix_.upperBound( i, j ); } /*! \endcond */ //************************************************************************************************* //================================================================================================= // // DEBUGGING FUNCTIONS // //================================================================================================= //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Returns whether the invariants of the uniupper matrix are intact. // // \return \a true in case the uniupper matrix's invariants are intact, \a false otherwise. // // This function checks whether the invariants of the uniupper matrix are intact, i.e. if its // state is valid. In case the invariants are intact, the function returns \a true, else it // will return \a false. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline bool UniUpperMatrix<MT,SO,false>::isIntact() const noexcept { using blaze::isIntact; return ( isIntact( matrix_ ) && isUniUpper( matrix_ ) ); } /*! \endcond */ //************************************************************************************************* //================================================================================================= // // EXPRESSION TEMPLATE EVALUATION FUNCTIONS // //================================================================================================= //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Returns whether the matrix can alias with the given address \a alias. // // \param alias The alias to be checked. // \return \a true in case the alias corresponds to this matrix, \a false if not. // // This function returns whether the given address can alias with the matrix. In contrast // to the isAliased() function this function is allowed to use compile time expressions // to optimize the evaluation. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix template< typename Other > // Data type of the foreign expression inline bool UniUpperMatrix<MT,SO,false>::canAlias( const Other* alias ) const noexcept { return matrix_.canAlias( alias ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Returns whether the matrix is aliased with the given address \a alias. // // \param alias The alias to be checked. // \return \a true in case the alias corresponds to this matrix, \a false if not. // // This function returns whether the given address is aliased with the matrix. In contrast // to the canAlias() function this function is not allowed to use compile time expressions // to optimize the evaluation. */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix template< typename Other > // Data type of the foreign expression inline bool UniUpperMatrix<MT,SO,false>::isAliased( const Other* alias ) const noexcept { return matrix_.isAliased( alias ); } /*! \endcond */ //************************************************************************************************* //************************************************************************************************* /*! \cond BLAZE_INTERNAL */ /*!\brief Returns whether the matrix can be used in SMP assignments. // // \return \a true in case the matrix can be used in SMP assignments, \a false if not. // // This function returns whether the matrix can be used in SMP assignments. In contrast to the // \a smpAssignable member enumeration, which is based solely on compile time information, this // function additionally provides runtime information (as for instance the current number of // rows and/or columns of the matrix). */ template< typename MT // Type of the adapted sparse matrix , bool SO > // Storage order of the adapted sparse matrix inline bool UniUpperMatrix<MT,SO,false>::canSMPAssign() const noexcept { return matrix_.canSMPAssign(); } /*! \endcond */ //************************************************************************************************* } // namespace blaze #endif
camillescott/boink
include/goetia/sketches/sketch/vec/blaze/blaze/math/adaptors/uniuppermatrix/Sparse.h
C
mit
110,583
import qambi, { getMIDIInputs } from 'qambi' document.addEventListener('DOMContentLoaded', function(){ console.time('loading and parsing assets took') qambi.init({ song: { type: 'Song', url: '../data/minute_waltz.mid' }, piano: { type: 'Instrument', url: '../../instruments/heartbeat/city-piano-light-concat.json' } }) .then(main) }) function main(data){ console.timeEnd('loading and parsing assets took') let {song, piano} = data song.getTracks().forEach(track => { track.setInstrument(piano) track.monitor = true track.connectMIDIInputs(...getMIDIInputs()) }) let btnPlay = document.getElementById('play') let btnPause = document.getElementById('pause') let btnStop = document.getElementById('stop') let divLoading = document.getElementById('loading') divLoading.innerHTML = '' btnPlay.disabled = false btnPause.disabled = false btnStop.disabled = false btnPlay.addEventListener('click', function(){ song.play() }) btnPause.addEventListener('click', function(){ song.pause() }) btnStop.addEventListener('click', function(){ song.stop() }) }
abudaan/qambi
examples/concat/main.js
JavaScript
mit
1,165
# Proyecto Yomi!!! Red social para el descubrimiento, búsqueda y recomendación de menús y recetas de cocina con todas las instrucciones y términos para que puedas prepararlas de forma fácil y sin confusión.
yomi-network/app
README.md
Markdown
mit
214
<?php /* * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many individuals * and is licensed under the MIT license. For more information, see * <http://www.doctrine-project.org>. */ namespace Doctrine\ORM\Query\AST; /** * DeleteClause ::= "DELETE" ["FROM"] AbstractSchemaName [["AS"] AliasIdentificationVariable] * * @link www.doctrine-project.org */ class DeleteClause extends Node { /** @var string */ public $abstractSchemaName; /** @var string */ public $aliasIdentificationVariable; /** * @param string $abstractSchemaName */ public function __construct($abstractSchemaName) { $this->abstractSchemaName = $abstractSchemaName; } /** * {@inheritdoc} */ public function dispatch($sqlWalker) { return $sqlWalker->walkDeleteClause($this); } }
bigfoot90/doctrine2
lib/Doctrine/ORM/Query/AST/DeleteClause.php
PHP
mit
1,646
## VERSION 1.1.5 #### GENERAL: - Created changelog #### CSS: - Added emoji-picker CSS - Fixed highlight CSS ## VERSION 1.1.6 #### CSS: - Added scrollbar CSS for public server list ## VERSION 1.1.7 #### GENERAL: - Added link to changelog - Added link to a preview image #### CSS: - Added notification badge CSS for friends list - Fixed friends list avatars on user profiles ## VERSION 1.1.8 #### CSS: - Reworked checkbox CSS - Changed slider CSS - Changed radio button CSS - Added twitch streaming CSS ## VERSION 1.1.9 #### GENERAL: - Updated theme description - Updated commented info in code - Added link to DRB RemoveShadows theme - Reworked changelog #### CSS: - Reworked settings tab bar CSS - Adjusted alt checkbox CSS - Fixed text CSS next to checkboxes - Fixed searchbar CSS ## VERSION 1.2.0 (Release: 21/06/2016) #### GENERAL: - Moved to GitHub - Updated links #### CSS: - Added button onclick animations - Added shadow to checkbox switch - Adjusted user profile background image brightness - Fixed activity text on user profiles - Fixed alt checkbox CSS ## VERSION 1.2.1 (Release: 22/06/2016) #### CSS: - Reworked account buttons - Reworked voice connection buttons - Reworked icons - Reworked add server button - Added emote picker onklick animations - Adjusted user settings background CSS ## VERSION 1.2.2 (Release: 24/06/2016) #### GENERAL: - Replaced screenshots - Added new screenshots - Added info to use dark theme & dark mode #### CSS: - Added symbols to settings tab bars - Added pinned messages CSS - Added background to active header buttons - Added BetterDiscord loading bar CSS - Adjusted Download Apps window CSS - Adjusted theme picker CSS - Fixed channel icon button position issues - Fixed voice connection buttons opacity - Fixed account buttons opacity - Fixed public serverlist backgrounds - Fixed mutual server icons on friends list issues - Fixed emote sorting issues - Fixed background colors in public server list ## VERSION 1.2.3 (Release: 27/06/2016) #### CSS: - Added jump to present bar CSS - Added guild placeholder CSS - Added symbols to settings tab bars for browser and mac - Added voice connection sparkline CSS - Adjusted BetterDiscord loading bar CSS - Adjusted changelog window CSS - Adjusted Download Apps window CSS - Adjusted guilds add window CSS - Fixed wrong symbols showing up for browser and mac - Fixed highlight CSS issues - Fixed icon/button sizing issues ## VERSION 1.2.4 (Release: 29/06/2016) #### GENERAL: - Added new red "Ruby" theme - Renamed "Ruby" theme to "Amber" - Updated backgrounds to higher resolutions - Beautified CSS - Shortened URLs #### CSS: - Added clock plugin CSS - Fixed slider handle positions ## VERSION 1.2.5 (Release: 02/07/2016) #### GENERAL: - Changed versioning system - Added release dates to changelog - Added former version numbers to changelog #### CSS: - Added icons for titlebar buttons - Added icons for header toolbar buttons - Added hover animations for account buttons - Added hover & popout animations for voice connection buttons - Adjusted & blurred user profile & user popout backgrounds - Adjusted hamburger button color - Changed titlebar button hover colors - Removed channel name capitalizing ## VERSION 1.2.6 (Release: 04/07/2016) #### GENERAL: - Updated screenshots #### CSS: - Added mute button hover animation - Added user name hover CSS - Added user popout roles hover CSS - Added jump to pinned message animation - Added emoji fav button CSS - Added emoji remove popout CSS - Changed user popout icons - Changed search bar icon CSS - Adjusted & blurred detached custom css container background - Adjusted user settings borders - Adjusted user profile borders - Adjusted bot & aka tag background - Adjusted several colors - Fixed wrong button icons showing in private chat - Fixed account & voice connection position issues - Fixed confirm button onclick animation - Fixed settings tab bar scroll issues - Fixed avatars not sizing correctly - Removed several unnecessary, no longer working lines ## VERSION 1.2.7 (Release: 07/07/2016) #### GENERAL: - Added support for more browsers (webkit) #### CSS: - Added new icons in channels - Added image download button CSS - Added mention highlight CSS - Added link hover CSS - Added toolbar badge CSS - Changed friends guild & friend channel icons - Adjusted & blurred public server list background - Adjusted avatar uploader CSS - Adjusted highlight hover CSS - Adjusted server settings connection link CSS - Adjusted user settings keybinds CSS - Adjusted cancel button CSS - Adjusted tab bar button sizing & positions - Adjusted & fixed disabled checkbox CSS - Fixed emoji picker onclick issues - Fixed link hover CSS - Minor changes & fixes ## VERSION 1.2.8 (Release: 10/07/2016) #### GENERAL: - Better support for light theme - Removed unnecessary CSS - Shortened & optimized CSS #### CSS: - Changed pin icon - Changed new messages CSS - Added & adjusted user settings connections CSS - Adjusted titlebar & header toolbar icons sizes - Adjusted background image gradients - Adjusted custom css container - Adjusted code cursor color - Minor changes & fixes ## VERSION 1.3.0 (Release: 16/07/2016) #### GENERAL: - Renamed themes to "Discord ReBorn" - Optimized colors - Updated screenshots - Changed release dates #### CSS: - Added load animation - Added recent mentions popout CSS - Updated pinned messages popout CSS - Added new recent mentions button icon - Added several new icons - Added user settings changelog link CSS - Added & adjusted user settings CSS - Added animations to user settings - Changed & fixed search bar icon CSS - Adjusted & fixed changelog CSS - Adjusted highlight CSS - Adjusted search bar CSS - Adjusted discriminator CSS - Fixed button icons ## VERSION 1.3.1 (Release: 21/07/2016) #### GENERAL: - New background image for Sapphire - Toned Sapphire colors to fit new background - Updated Sapphire screenshots - Updated theme descriptions - Added credit to Hammock (Omniscient used parts of his theme) - Updated RemoveShadows theme link #### CSS: - Reworked background image CSS - Removed old load animation - Added new load animation - Added fade in animation - Added Dev mark CSS - Added copy button CSS - Added message delete code CSS - Added new delete channel icon - Added new color picker icon - Added new notification settings modal icons - Added scroller feathers - Added channel sorting CSS - Added unblock button CSS - Added nickname change warning CSS - Added transitions to chat buttons - Changed guild header drop down CSS - Changed BetterDiscord plugin/theme list CSS - Fixed user settings changelog link - Fixed animations causing text rendering issues - Fixed custom css editor CSS - Minor adjustements & fixes ## VERSION 1.3.1b (Release: 23/07/2016) #### CSS: - Fixed backgrounds not showing for browsers and custom CSS ## VERSION 1.3.2 (Release: 09/08/2016) #### GENERAL: - Created Discord ReBorn Discord server - Moved icons to github - Updated screenshots #### CSS: - Added Call CSS - Added EBR CSS - Added new create group modal CSS - Added new create group icon - Added new start call icon - Added new add to group icon - Adjusted quicksave button CSS - Fixed wrong icons showing - Fixed button sizing issues - Fixed voice debug issues - Minor adjustements & fixes ## VERSION 2.0.0 (Release: 11/08(2016) #### GENERAL: - Renamed theme series to "ClearVision" - Added CSS variables for colors and background - Better support for non-BD Dark - Moved images to github - Moved screenshots to github - Updated screenshots #### CSS: - Added upload modal CSS - Added drag & drop modal CSS - Removed "channel members loading" image - Adjusted copy button CSS - Fixed BetterDiscord buttons - Fixed user popout discriminator height - Fixed server settings member list ClearVision Dev mark - Minor adjustements & fixes ## VERSION 2.0.1 (Release: 17/08/2016) #### GENERAL: - Beautified changelog - Removed former version numbers from changelog - Updated changelog link #### CSS: - Renamed "basic-color" variable to "main-color" - Added channel textarea focus CSS - Added web invite modal icons - Added download apps button CSS - Added authenticate modal CSS - Added invite accept CSS - Fixed user profile scrollbar CSS - Fixed bot tag - Minor adjustements & fixes ## VERSION 2.1.0 (Release: 20/08/2016) #### GENERAL: - Added light version of the theme for light appearance - Better support for light theme - Moved themes into own folder - Updated screenshots - Updated links - Removed "Fixes & adjustements by Zerthox" note #### CSS: - Added info to appereance tab in settings - Added CSS from dark theme to light theme - Fixed text channel hover CSS - Minor adjustemens & fixes ## VERSION 2.1.1 (Release: 20/08/2016) #### CSS: - Fixed group channel toolbar icons ## VERSION 2.2.0 (Release: 30/08/2016) #### GENERAL: - Added info for customization to the readme - Darkened light version of the theme for better readability - Nearly full support for light theme - Added light version screenshots #### CSS: - Made pinned messages clickable - Added flashing unread guild marker animation - Added flashing badge animation - Added selected call guild CSS - Added selected call guild animation - Added invite modal CSS - Added CSS syntax highlighting - Added notice close icon - Added system message pin icon - Added system message link CSS - Added icon friends transition - Adjusted EBR CSS - Adjusted header toolbar button transitions - Fixed user popout username CSS - Fixed user popout bot tag CSS - Fixed EBR CSS issues - Minor adjustements & fixes ## VERSION 2.3.0 (Release: 02/09/2016) #### GENERAL: - Sorted little parts of CSS - Fixed issues with new Discord version #### CSS: - Added user popout CSS to light version - Added detected accounts modal CSS - Added friend add page CSS - Added friend synchronization button CSS - Added friend synchronization button icons - Lightened user popout for better readability - Adjusted connection page CSS - Fixed text rendering issues - Fixed user profile modal - Fixed user popout - Fixed chat dividers - Fixed user popout quick message - Fixed friends guild issues - Several little fixes - Minor adjustements ## VERSION 2.3.1 (Release: 05/09/2016) #### CSS: - Reworked Dev mark - Added user profile modal icons - Added pseudo element syntax highlighting - Adjusted inline code block CSS - Adjusted multi-line code block CSS - Adjusted BetterDiscord theme/plugin list CSS - Fixed emote picker custom emotes ## VERSION 3.0.0 (Release: 07/09/2016) #### GENERAL: - Theme now automatically loads the newest version from github - Updated theme description - Added links to theme description #### CSS: - Added friend list button icons - Added friend list discriminator transition - Changed BetterDiscord settings tab icon - Adjusted friend list name column width - Fixed discriminator position - Fixed bot tag position - Minor adjustements & fixes ## VERSION 3.0.1 (Release: 07/09/2016) #### CSS: - Added user popout Dev mark hover CSS - Adjusted member roles overflow - Adjusted emoji picker category CSS - Fixed settings input CSS - Fixed voice debug modal CSS - Fixed bot tag & discriminator issues - Minor adjustements & fixes ## VERSION 3.0.2 (Release: 11/09/2016) #### CSS: - Added keyboard shorcut modal CSS - Added broken image CSS - Added role add button icon - Added update checking icon - Adjusted friend list border colors - Fixed emoji picker diversity selector CSS - Fixed emoji picker dimmer CSS - Fixed custom css editor selection - Fixed issues with BetterDiscord Minimal Mode - Fixed issues with friend page buttons - Minor adjustements & fixes ## VERSION 3.0.3 (Release: 16/09/16) #### CSS: - Added context menu animation - Added user popout animation - Added file upload button icon - Added file icons (chat & modal) - Added progress bar CSS - Adjusted titlebar topic link CSS - Adjusted titlebar topic highlight CSS - Fixed voice debug selected list CSS - Fixed broken image CSS - Fixed pin & mention popout issues - Minor adjustements & fixes ## VERSION 3.0.4 (Release: 24/09/16) ### CSS: - Added context menu item sub menu animation - Added account avatar hover animation - Adjusted Dev mark CSS - Adjusted seperator colors - Adjusted popout backgrounds for better readability - Fixes for light version - Fixes for message popouts - Fixed voice debug modal CSS - Fixed search bar clear button CSS - Fixed chat bot tag color - Minor adjustements & fixes ## VERSION 3.1.0 (Release: 17/09/16) ### GENERAL: - Better support for webkit browsers - Removed unnecessary CSS ### CSS: - Added guild settings tab bar icons - Added popout menu CSS - Added status picker menu CSS - Added channel notice CSS - Added instant invite modal CSS - Added new messages indicator CSS - Updated CSS syntax highlighting - Made channel textarea & message edit boxes scrollable - Adjusted more seperator colors - Adjusted status dot shadows - Fixed account avatar hover animation - Fixed issues with account avatar hover animation & account discriminator hover animation - Fixed an issue with user names in chat - Minor adjustements & fixes ## VERSION 3.1.1 (Release: 03/10/16) ### CSS: - Added popout menu icons - Added leave button hover & active animation - Added custom css editor syntax highlighting - Adjusted invite button CSS - Adjusted context menu item CSS - Adjusted role settings tab bar item CSS - Fixed CSS syntax highlighting - Minor adjustements & fixes ## VERSION 3.2.0 (Release: 15/10/16) ### CSS: - Added webhook settings page CSS - Added color picker CSS - Added BetterDiscord Dev mark - Changed status dot CSS - Changed Connections icon - Changed Locale icon - Adjusted ClearVision Dev mark - Adjusted user popout & user profile CSS to allow easier rendering - Adjusted & fixed image file icon - Fixed issues with new Discord update - Fixed loading image modal button positions - Fixed issues with context menu - Fixed light version context menu - Minor adjustements & fixes ## VERSION 4.0.0 (Release: 25/10/16) ### GENERAL: - Now loads CSS via GitCDN - Added info for mods - Darkened light version *(Old version available as mod)* - Fixed issues with links - Fixed issues with background image - Fixed mistakes in CSS - Removed unnecessary CSS ### CSS: - Added channel textarea guard countdown CSS - Added plugin settings popout CSS - Added Linenumber plugin CSS - Added info notice CSS - Reworked dropdown CSS - Reworked select input CSS - Reworked shorcut recorder CSS - Adjusted minimal mode CSS - Adjusted add friend input CSS - Fixed several issues with minimal mode - Fixed custom CSS syntax highlighting - Fixed issues with account - Fixed issues with cancel button - Fixed webhook message CSS - Fixes for light version - Minor adjustements & fixes ## VERSION 4.1.0 (Release: 06/11/16) ### CSS: - Added reactions buttons CSS - Added pinned messages & recent mentions animation - Added emote menu animation - Added embed video actions icons - Added Spectrum Colorpicker CSS - Adjusted menu & popout animations - Adjusted link hover CSS - Adjusted Dev mark CSS - Fixed issues with invite button - Fixed issues with compact appearance - Fixed issues with codeblocks in popouts - Fixed issues with Owner Tags plugin - Minor adjustements & fixes ## VERSION 4.1.1 (Release: 18/11/2016) ### CSS: - Updated & adjsuted user profile modal CSS - Updated embed links CSS - Added verified icon - Added update button icon - Increased user profile max name length - Fixed issues with new Discord update - Fixed issues with emotes - Minor adjustements & fixes ## VERSION 4.2.0 (Release: 02/12/2016) ### GENERAL: - Added min CSS - Themes now load min CSS ### CSS: - Reworked role CSS - Reworked add role button CSS - Added quoter plugin CSS - Adjusted broken emote & emoji CSS - Adjusted link & highlight hover CSS - Adjusted embed CSS - Fixed issues with popout menus - Fixed missing system message icon - Fixed issues with Group DM - Minor adjustements & fixes ## VERSION 4.2.1 (Release: 25/12/16) ### CSS: - Adjusted guild error CSS - Adjusted tooltip error CSS - Adjusted cancel button CSS - Adjusted & fixed linenumbers CSS - Adjusted codeblock width - Adjusted embed CSS - Fixed issues with new Discord update - Fixed issues with guild transitions - Fixed issues with private channels - Fixed verified icon - Removed unread animation - Removed unnecessary CSS - Minor adjustements & fixes ## VERSION 5.0.0 (Release: 15/01/2017) ### GENERAL: - Added background image brightness CSS variable - Added background image blur CSS variable - Adjusted comment info in code ### CSS: - Added Discord search CSS - Added reactions modal CSS - Added Discord Nitro mark - Added custom GIF badge - Adjusted background image position - Fixed input CSS - Fixed channel scroller flickering issues ## VERSION 5.0.1 (Release: 16/01/2017) ### CSS: - Fixed backdrop position - Fixed GIF border radius ## VERSION 5.0.2 (Release: 25/01/2017) ### CSS: - Adjusted search CSS - Fixed issues with new Discord update - Fixed user settings icons - Minor adjustements & fixes ## VERSION 5.0.3 (Release: 06/02/2017) ### CSS: - Added search highlight CSS - Added plugin settings textarea CSS - Adjusted & fixed search CSS - Fixed issues with background - Fixed issues with textarea colors - Minor adjustements & fixes ## VERSION 5.1.0 (Release: 17/03/2017) ### CSS: - Added security settings CSS - Added Nitro settings CSS - Added SendEmbeds CSS - Added Quoter CSS - Added status dot transitions - Improved support for light theme - Adjusted & fixed search CSS - Adjusted button CSS - Adjusted invite button CSS - Adjusted system message icons - Fixed textarea focus CSS - Fixed pulse animations - Fixed keyboard shorcut modal CSS - Fixed issues with light theme - Minor adjustements & fixes ## VERSION 5.1.1 (Release: 09/04/2017) ### CSS: - Adjusted highlight CSS - Fixed backdrop filter performance issues - Fixed server settings tab bar icons - Fixed private call region select modal - Fixed private call icons - Fixed pulsate animations - Fixed selected guild marker issues - Minor adjustements & fixes ## VERSION 5.1.2 (Release: 26/04/2017) ### CSS: - Added private group icon - Fixed issues with latest Discord update - Fixed toolbar buttons - Fixed quickswitcher CSS - Fixed issues with light theme ## VERSION 5.2.0 (Release: 09/05/2017) ### CSS: - Added new settings CSS - Added new notification modal CSS - Added new webhook modal CSS - Added NSFW warning CSS - Fixed custom CSS editor CSS - Fixed issues with Discord update - Fixed issues with BetterDiscord update - Fixed issues with quoter CSS ## VERSION 5.2.1 (Release: 09/05/2017) ### CSS: - Made light version lighter - Fixed search CSS - Fixed button colors ## VERSION 5.2.2 (Release: 13/05/2017) ### CSS: - Add social links CSS - Fix user settings image filters - Fix button colors - Fix issues with latest Discord Canary update ## Version 5.2.3 (Release: Upcoming) ### CSS: - Add emoji premium promo CSS - Fixed quickswitcher CSS - Fixed connection popout CSS - Fixed connection debug modal CSS - Fixed custom CSS editor scroller color - Fixed settings scroller colors
just4you51/Emerald-J4Y
Changelog.md
Markdown
mit
19,122
module Doorkeeper class TokensController < Doorkeeper::ApplicationMetalController def create response = authorize_response headers.merge! response.headers self.response_body = response.body.to_json self.status = response.status rescue Errors::DoorkeeperError => e handle_token_exception e end # OAuth 2.0 Token Revocation - http://tools.ietf.org/html/rfc7009 def revoke # The authorization server, if applicable, first authenticates the client # and checks its ownership of the provided token. # # Doorkeeper does not use the token_type_hint logic described in the # RFC 7009 due to the refresh token implementation that is a field in # the access token model. if authorized? revoke_token end # The authorization server responds with HTTP status code 200 if the token # has been revoked successfully or if the client submitted an invalid # token render json: {}, status: 200 end private # OAuth 2.0 Section 2.1 defines two client types, "public" & "confidential". # Public clients (as per RFC 7009) do not require authentication whereas # confidential clients must be authenticated for their token revocation. # # Once a confidential client is authenticated, it must be authorized to # revoke the provided access or refresh token. This ensures one client # cannot revoke another's tokens. # # Doorkeeper determines the client type implicitly via the presence of the # OAuth client associated with a given access or refresh token. Since public # clients authenticate the resource owner via "password" or "implicit" grant # types, they set the application_id as null (since the claim cannot be # verified). # # https://tools.ietf.org/html/rfc6749#section-2.1 # https://tools.ietf.org/html/rfc7009 def authorized? if token.present? # Client is confidential, therefore client authentication & authorization # is required if token.application_uid # We authorize client by checking token's application server.client && server.client.application.uid == token.application_uid else # Client is public, authentication unnecessary true end end end def revoke_token if token.accessible? token.revoke end end def token @token ||= AccessToken.by_token(request.POST['token']) || AccessToken.by_refresh_token(request.POST['token']) end def strategy @strategy ||= server.token_request params[:grant_type] end def authorize_response @authorize_response ||= strategy.authorize end end end
EasterAndJay/doorkeeper
app/controllers/doorkeeper/tokens_controller.rb
Ruby
mit
2,774
export default function widget(widget=null, action) { switch (action.type) { case 'widget.edit': return action.widget; case 'widget.edit.close': return null; default: return widget; } }
KevinAst/astx-redux-util
src/reducer/spec/samples/hash/widgetOld.js
JavaScript
mit
223
--- layout: page title: Latest Posts excerpt: "A simple and clean responsive Jekyll theme for words and photos." search_omit: true --- <ul class="post-list"> {% for post in site.posts limit:10 %} <li><article><a href="{{ site.url }}{{ post.url }}"><b>{{ post.title }}</b> <span class="entry-date"><time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: "%B %d, %Y" }}</time></span>{% if post.excerpt %} <span class="excerpt">{{ post.excerpt | remove: '\[ ... \]' | remove: '\( ... \)' | markdownify | strip_html | strip_newlines | escape_once }}</span>{% endif %}</a></article></li> {% endfor %} </ul>
xiaoxubeii/xiaoxubeii.github.com
index.html
HTML
mit
623
def tryprint(): return ('it will be oke')
cherylyli/stress-aid
env/lib/python3.5/site-packages/helowrld/__init__.py
Python
mit
45
/* * JBox2D - A Java Port of Erin Catto's Box2D * * JBox2D homepage: http://jbox2d.sourceforge.net/ * Box2D homepage: http://www.gphysics.com * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would be * appreciated but is not required. * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. */ package org.jbox2d.testbed; public class TestSettings { public int hz; public int iterationCount; public boolean enableWarmStarting; public boolean enablePositionCorrection; public boolean enableTOI; public boolean pause; public boolean singleStep; public boolean drawShapes; public boolean drawJoints; public boolean drawCoreShapes; public boolean drawOBBs; public boolean drawCOMs; public boolean drawStats; public boolean drawImpulses; public boolean drawAABBs; public boolean drawPairs; public boolean drawContactPoints; public boolean drawContactNormals; public boolean drawContactForces; public boolean drawFrictionForces; public TestSettings() { hz = 60; iterationCount = 10; drawStats = true; drawAABBs = false; drawPairs = false; drawShapes = true; drawJoints = true; drawCoreShapes = false; drawContactPoints = false; drawContactNormals = false; drawContactForces = false; drawFrictionForces = false; drawOBBs = false; drawCOMs = false; enableWarmStarting = true; enablePositionCorrection = true; enableTOI = true; pause = false; singleStep = false; } }
cr0ybot/MIRROR
libraries/JBox2D/src/org/jbox2d/testbed/TestSettings.java
Java
mit
2,286
/** * @file pifacedigital.h * @brief A simple static library for controlling PiFace Digital. * See mcp23s17.h for more register definitions. * * Copyright (C) 2013 Thomas Preston <thomas.preston@openlx.org.uk> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _PIFACEDIGITAL_H #define _PIFACEDIGITAL_H #include <stdint.h> #ifdef __cplusplus extern "C" { #endif #define OUTPUT 0x12 // GPIOA #define INPUT 0x13 // GPIOB /** * Opens and initialises a PiFace Digital with the specified hardware * address. Returns a file descriptor for making raw SPI transactions to * the MCP23S17 (for advanced users only). * * Example: * * pifacedigital_open(0); * int pifacedigital_fd = pifacedigital_open(0); // advanced * * @param hw_addr The hardware address (configure with jumpers: JP1 and JP2). */ int pifacedigital_open(uint8_t hw_addr); /** * Opens a PiFace Digital with the specified hardware address without * initialising it. Returns a file descriptor for making raw SPI transactions * to the MCP23S17 (for advanced users only). * * Example: * * pifacedigital_open_noinit(0); * int pifacedigital_fd = pifacedigital_open_noinit(0); // advanced * * @param hw_addr The hardware address (configure with jumpers: JP1 and JP2). */ int pifacedigital_open_noinit(uint8_t hw_addr); /** * Closes a PiFace Digital with the specified hardware address (turns * off interrupts, closes file descriptor if it is no longer needed). * * Example: * * pifacedigital_close(0); * * @param hw_addr The hardware address (configure with jumpers: JP1 and JP2). */ void pifacedigital_close(uint8_t hw_addr); /** * Reads a register from PiFace Digital. * * Example (read INPUT from PiFace Digital 0): * * uint8_t value = pifacedigital_read_reg(INPUT, 0); * * @param reg The register to read from (example: INPUT, OUTPUT). * @param hw_addr The hardware address (configure with jumpers: JP1 and JP2). */ uint8_t pifacedigital_read_reg(uint8_t reg, uint8_t hw_addr); /** * Writes to a register on PiFace Digital. * * Example (write 0xaa to OUTPUT on PiFace Digital 0): * * pifacedigital_write_reg(0xaa, OUTPUT, 0); * * @param data The byte to write. * @param reg The register to write to (example: INPUT, OUTPUT, GPPUB). * @param hw_addr The hardware address (configure with jumpers: JP1 and JP2). */ void pifacedigital_write_reg(uint8_t data, uint8_t reg, uint8_t hw_addr); /** * Read a bit from a register on PiFace Digital. * * Example (read bit 3 of INPUT on PiFace Digital 0): * * uint8_t bit_value = pifacedigital_read_bit(3, INPUT, 0); * * @param bit_num The bit number to read from. * @param reg The register to write to (example: INPUT, OUTPUT, GPPUB). * @param hw_addr The hardware address (configure with jumpers: JP1 and JP2). */ uint8_t pifacedigital_read_bit(uint8_t bit_num, uint8_t reg, uint8_t hw_addr); /** * Writes to a bit on a register on PiFace Digital. * * Example (write 1 to bit 3 of OUTPUT on PiFace Digital 0): * * pifacedigital_write_bit(1, 3, OUTPUT, 0); * * @param data The value to write. * @param bit_num The bit number to read from. * @param reg The register to write to (example: INPUT, OUTPUT, GPPUB). * @param hw_addr The hardware address (configure with jumpers: JP1 and JP2). */ void pifacedigital_write_bit(uint8_t data, uint8_t bit_num, uint8_t reg, uint8_t hw_addr); /** * Read from the input port on PiFace Digital 0. If you want to read from * other ports or PiFace Digital's with other hardware addresses then use * the more powerful function <pifacedigital_read_bit>"()". * * Example (read from bit 6 of INPUT on PiFace Digital 0): * * pifacedigital_digital_read(6); * * @param pin_num The pin number to read from. */ uint8_t pifacedigital_digital_read(uint8_t pin_num); /** * Write to the output port on PiFace Digital 0. If you want to write to * other ports or PiFace Digital's with other hardware addresses then use * the more powerful function <pifacedigital_write_bit>"()". * * Example (write 1 to bit 3 of OUTPUT on PiFace Digital 0): * * pifacedigital_digital_write(3, 1); * * @param pin_num The pin number to write to. * @param value The value to write. */ void pifacedigital_digital_write(uint8_t pin_num, uint8_t value); #ifdef __cplusplus } #endif #endif
ChristopherGittner/RaspPlc
include/external/pifacedigital.h
C
mit
5,033
<?php /* * This file is part of the AntiMattr Content MongoDB Bundle, a Symfony Bundle by Matthew Fitzgerald. * * (c) 2014 Matthew Fitzgerald * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace AntiMattr\Bundle\ContentMongoDBBundle\Form\Document; use Symfony\Component\Form\AbstractType; use Symfony\Component\OptionsResolver\OptionsResolverInterface; use Symfony\Component\Form\FormBuilderInterface; class PageSectionFormType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('position', 'integer', [ 'attr' => [ 'input_group' => [ 'prepend' => 'Order', 'size' => 'small', ], ], 'label' => false, ]) ->add('slug', 'text', [ 'attr' => [ 'input_group' => [ 'prepend' => 'Slug', 'size' => 'small', ], ], 'label' => false, ]) ->add('title', 'text', [ 'attr' => [ 'input_group' => [ 'prepend' => 'Subtitle', 'size' => 'small', ], ], 'label' => false, ]) ->add('description', 'textarea', [ 'label' => false, ]) ; } public function setDefaultOptions(OptionsResolverInterface $resolver) { $resolver->setDefaults([ 'data_class' => 'AntiMattr\Bundle\ContentMongoDBBundle\Document\Page\Section', ]); } public function getName() { return 'content_page_section'; } }
antimattr/symfony-demo-app-01
src/vendor/content-mongodb-bundle/src/AntiMattr/Bundle/ContentMongoDBBundle/Form/Document/PageSectionFormType.php
PHP
mit
1,927
/*! * Start Bootstrap - Agency v3.3.7+1 (http://startbootstrap.com/template-overviews/agency) * Copyright 2013-2017 Start Bootstrap * Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap/blob/gh-pages/LICENSE) */ body { overflow-x: hidden; font-family: "Roboto Slab", "Helvetica Neue", Helvetica, Arial, sans-serif; } .text-muted { color: #777777; } .text-primary { color: #78be20; } p { font-size: 14px; line-height: 1.75; } p.large { font-size: 16px; } a, a:hover, a:focus, a:active, a.active { outline: none; } a { color: #78be20; } a:hover, a:focus, a:active, a.active { color: #5c9219; } h1, h2, h3, h4, h5, h6 { font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif; text-transform: uppercase; font-weight: 700; } .img-centered { margin: 0 auto; } .bg-light-gray { background-color: #eeeeee; } .bg-darkest-gray { background-color: #222222; } .btn-primary { color: white; background-color: #78be20; border-color: #78be20; font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif; text-transform: uppercase; font-weight: 700; } .btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .open .dropdown-toggle.btn-primary { color: white; background-color: #5c9219; border-color: #578a17; } .btn-primary:active, .btn-primary.active, .open .dropdown-toggle.btn-primary { background-image: none; } .btn-primary.disabled, .btn-primary[disabled], fieldset[disabled] .btn-primary, .btn-primary.disabled:hover, .btn-primary[disabled]:hover, fieldset[disabled] .btn-primary:hover, .btn-primary.disabled:focus, .btn-primary[disabled]:focus, fieldset[disabled] .btn-primary:focus, .btn-primary.disabled:active, .btn-primary[disabled]:active, fieldset[disabled] .btn-primary:active, .btn-primary.disabled.active, .btn-primary[disabled].active, fieldset[disabled] .btn-primary.active { background-color: #78be20; border-color: #78be20; } .btn-primary .badge { color: #78be20; background-color: white; } .btn-xl { color: white; background-color: #78be20; border-color: #78be20; font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif; text-transform: uppercase; font-weight: 700; border-radius: 3px; font-size: 18px; padding: 20px 40px; } .btn-xl:hover, .btn-xl:focus, .btn-xl:active, .btn-xl.active, .open .dropdown-toggle.btn-xl { color: white; background-color: #5c9219; border-color: #578a17; } .btn-xl:active, .btn-xl.active, .open .dropdown-toggle.btn-xl { background-image: none; } .btn-xl.disabled, .btn-xl[disabled], fieldset[disabled] .btn-xl, .btn-xl.disabled:hover, .btn-xl[disabled]:hover, fieldset[disabled] .btn-xl:hover, .btn-xl.disabled:focus, .btn-xl[disabled]:focus, fieldset[disabled] .btn-xl:focus, .btn-xl.disabled:active, .btn-xl[disabled]:active, fieldset[disabled] .btn-xl:active, .btn-xl.disabled.active, .btn-xl[disabled].active, fieldset[disabled] .btn-xl.active { background-color: #78be20; border-color: #78be20; } .btn-xl .badge { color: #78be20; background-color: white; } .navbar-custom { background-color: #222222; border-color: transparent; } .navbar-custom .navbar-brand { color: #78be20; font-family: "Kaushan Script", "Helvetica Neue", Helvetica, Arial, cursive; } .navbar-custom .navbar-brand:hover, .navbar-custom .navbar-brand:focus, .navbar-custom .navbar-brand:active, .navbar-custom .navbar-brand.active { color: #5c9219; } .navbar-custom .navbar-collapse { border-color: rgba(255, 255, 255, 0.02); } .navbar-custom .navbar-toggle { background-color: #78be20; border-color: #78be20; font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif; text-transform: uppercase; color: white; font-size: 12px; } .navbar-custom .navbar-toggle:hover, .navbar-custom .navbar-toggle:focus { background-color: #78be20; } .navbar-custom .nav li a { font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif; text-transform: uppercase; font-weight: 400; letter-spacing: 1px; color: white; } .navbar-custom .nav li a:hover, .navbar-custom .nav li a:focus { color: #78be20; outline: none; } .navbar-custom .navbar-nav > .active > a { border-radius: 0; color: white; background-color: #78be20; } .navbar-custom .navbar-nav > .active > a:hover, .navbar-custom .navbar-nav > .active > a:focus { color: white; background-color: #5c9219; } @media (min-width: 768px) { .navbar-custom { background-color: transparent; padding: 25px 0; -webkit-transition: padding 0.3s; -moz-transition: padding 0.3s; transition: padding 0.3s; border: none; } .navbar-custom .navbar-brand { font-size: 2em; -webkit-transition: all 0.3s; -moz-transition: all 0.3s; transition: all 0.3s; } .navbar-custom .navbar-nav > .active > a { border-radius: 3px; } } @media (min-width: 768px) { .navbar-custom.affix { background-color: #222222; padding: 10px 0; } .navbar-custom.affix .navbar-brand { font-size: 1.5em; } } header { background-image: url('../img/header-bg.jpg'); background-repeat: no-repeat; background-attachment: scroll; background-position: center center; -webkit-background-size: cover; -moz-background-size: cover; background-size: cover; -o-background-size: cover; text-align: center; color: white; } header .intro-text { padding-top: 100px; padding-bottom: 50px; } header .intro-text .intro-lead-in { font-family: "Droid Serif", "Helvetica Neue", Helvetica, Arial, sans-serif; font-style: italic; font-size: 22px; line-height: 22px; margin-bottom: 25px; } header .intro-text .intro-heading { font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif; text-transform: uppercase; font-weight: 700; font-size: 50px; line-height: 50px; margin-bottom: 25px; } @media (min-width: 768px) { header .intro-text { padding-top: 300px; padding-bottom: 200px; } header .intro-text .intro-lead-in { font-family: "Droid Serif", "Helvetica Neue", Helvetica, Arial, sans-serif; font-style: italic; font-size: 40px; line-height: 40px; margin-bottom: 25px; } header .intro-text .intro-heading { font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif; text-transform: uppercase; font-weight: 700; font-size: 75px; line-height: 75px; margin-bottom: 50px; } } section { padding: 100px 0; } section h2.section-heading { font-size: 40px; margin-top: 0; margin-bottom: 15px; } section h3.section-subheading { font-size: 16px; font-family: "Droid Serif", "Helvetica Neue", Helvetica, Arial, sans-serif; text-transform: none; font-style: italic; font-weight: 400; margin-bottom: 75px; } @media (min-width: 768px) { section { padding: 150px 0; } } .service-heading { margin: 15px 0; text-transform: none; } #portfolio .portfolio-item { margin: 0 0 15px; right: 0; } #portfolio .portfolio-item .portfolio-link { display: block; position: relative; max-width: 400px; margin: 0 auto; } #portfolio .portfolio-item .portfolio-link .portfolio-hover { background: rgba(120, 190, 32, 0.9); position: absolute; width: 100%; height: 100%; opacity: 0; transition: all ease 0.5s; -webkit-transition: all ease 0.5s; -moz-transition: all ease 0.5s; } #portfolio .portfolio-item .portfolio-link .portfolio-hover:hover { opacity: 1; } #portfolio .portfolio-item .portfolio-link .portfolio-hover .portfolio-hover-content { position: absolute; width: 100%; height: 20px; font-size: 20px; text-align: center; top: 50%; margin-top: -12px; color: white; } #portfolio .portfolio-item .portfolio-link .portfolio-hover .portfolio-hover-content i { margin-top: -12px; } #portfolio .portfolio-item .portfolio-link .portfolio-hover .portfolio-hover-content h3, #portfolio .portfolio-item .portfolio-link .portfolio-hover .portfolio-hover-content h4 { margin: 0; } #portfolio .portfolio-item .portfolio-caption { max-width: 400px; margin: 0 auto; background-color: white; text-align: center; padding: 25px; } #portfolio .portfolio-item .portfolio-caption h4 { text-transform: none; margin: 0; } #portfolio .portfolio-item .portfolio-caption p { font-family: "Droid Serif", "Helvetica Neue", Helvetica, Arial, sans-serif; font-style: italic; font-size: 16px; margin: 0; } #portfolio * { z-index: 2; } @media (min-width: 767px) { #portfolio .portfolio-item { margin: 0 0 30px; } } .timeline { list-style: none; padding: 0; position: relative; } .timeline:before { top: 0; bottom: 0; position: absolute; content: ""; width: 2px; background-color: #f1f1f1; left: 40px; margin-left: -1.5px; } .timeline > li { margin-bottom: 50px; position: relative; min-height: 50px; } .timeline > li:before, .timeline > li:after { content: " "; display: table; } .timeline > li:after { clear: both; } .timeline > li .timeline-panel { width: 100%; float: right; padding: 0 20px 0 100px; position: relative; text-align: left; } .timeline > li .timeline-panel:before { border-left-width: 0; border-right-width: 15px; left: -15px; right: auto; } .timeline > li .timeline-panel:after { border-left-width: 0; border-right-width: 14px; left: -14px; right: auto; } .timeline > li .timeline-image { left: 0; margin-left: 0; width: 80px; height: 80px; position: absolute; z-index: 100; background-color: #78be20; color: white; border-radius: 100%; border: 7px solid #f1f1f1; text-align: center; } .timeline > li .timeline-image h4 { font-size: 10px; margin-top: 12px; line-height: 14px; } .timeline > li.timeline-inverted > .timeline-panel { float: right; text-align: left; padding: 0 20px 0 100px; } .timeline > li.timeline-inverted > .timeline-panel:before { border-left-width: 0; border-right-width: 15px; left: -15px; right: auto; } .timeline > li.timeline-inverted > .timeline-panel:after { border-left-width: 0; border-right-width: 14px; left: -14px; right: auto; } .timeline > li:last-child { margin-bottom: 0; } .timeline .timeline-heading h4 { margin-top: 0; color: inherit; } .timeline .timeline-heading h4.subheading { text-transform: none; } .timeline .timeline-body > p, .timeline .timeline-body > ul { margin-bottom: 0; } @media (min-width: 768px) { .timeline:before { left: 50%; } .timeline > li { margin-bottom: 100px; min-height: 100px; } .timeline > li .timeline-panel { width: 41%; float: left; padding: 0 20px 20px 30px; text-align: right; } .timeline > li .timeline-image { width: 100px; height: 100px; left: 50%; margin-left: -50px; } .timeline > li .timeline-image h4 { font-size: 13px; margin-top: 16px; line-height: 18px; } .timeline > li.timeline-inverted > .timeline-panel { float: right; text-align: left; padding: 0 30px 20px 20px; } } @media (min-width: 992px) { .timeline > li { min-height: 150px; } .timeline > li .timeline-panel { padding: 0 20px 20px; } .timeline > li .timeline-image { width: 150px; height: 150px; margin-left: -75px; } .timeline > li .timeline-image h4 { font-size: 18px; margin-top: 30px; line-height: 26px; } .timeline > li.timeline-inverted > .timeline-panel { padding: 0 20px 20px; } } @media (min-width: 1200px) { .timeline > li { min-height: 170px; } .timeline > li .timeline-panel { padding: 0 20px 20px 100px; } .timeline > li .timeline-image { width: 170px; height: 170px; margin-left: -85px; } .timeline > li .timeline-image h4 { margin-top: 40px; } .timeline > li.timeline-inverted > .timeline-panel { padding: 0 100px 20px 20px; } } .team-member { text-align: center; margin-bottom: 50px; } .team-member img { margin: 0 auto; border: 7px solid white; } .team-member h4 { margin-top: 25px; margin-bottom: 0; text-transform: none; } .team-member p { margin-top: 0; } aside.clients img { margin: 50px auto; } section#contact { background-color: #222222; background-image: url('../img/map-image.png'); background-position: center; background-repeat: no-repeat; } section#contact .section-heading { color: white; } section#contact .form-group { margin-bottom: 25px; } section#contact .form-group input, section#contact .form-group textarea { padding: 20px; } section#contact .form-group input.form-control { height: auto; } section#contact .form-group textarea.form-control { height: 236px; } section#contact .form-control:focus { border-color: #78be20; box-shadow: none; } section#contact ::-webkit-input-placeholder { font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif; text-transform: uppercase; font-weight: 700; color: #eeeeee; } section#contact :-moz-placeholder { /* Firefox 18- */ font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif; text-transform: uppercase; font-weight: 700; color: #eeeeee; } section#contact ::-moz-placeholder { /* Firefox 19+ */ font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif; text-transform: uppercase; font-weight: 700; color: #eeeeee; } section#contact :-ms-input-placeholder { font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif; text-transform: uppercase; font-weight: 700; color: #eeeeee; } section#contact .text-danger { color: #e74c3c; } footer { padding: 25px 0; text-align: center; } footer span.copyright { line-height: 40px; font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif; text-transform: uppercase; text-transform: none; } footer ul.quicklinks { margin-bottom: 0; line-height: 40px; font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif; text-transform: uppercase; text-transform: none; } ul.social-buttons { margin-bottom: 0; } ul.social-buttons li a { display: block; background-color: #222222; height: 40px; width: 40px; border-radius: 100%; font-size: 20px; line-height: 40px; color: white; outline: none; -webkit-transition: all 0.3s; -moz-transition: all 0.3s; transition: all 0.3s; } ul.social-buttons li a:hover, ul.social-buttons li a:focus, ul.social-buttons li a:active { background-color: #78be20; } .btn:focus, .btn:active, .btn.active, .btn:active:focus { outline: none; } .portfolio-modal .modal-dialog { margin: 0; height: 100%; width: auto; } .portfolio-modal .modal-content { border-radius: 0; background-clip: border-box; -webkit-box-shadow: none; box-shadow: none; border: none; min-height: 100%; padding: 100px 0; text-align: center; } .portfolio-modal .modal-content h2 { margin-bottom: 15px; font-size: 3em; } .portfolio-modal .modal-content p { margin-bottom: 30px; } .portfolio-modal .modal-content p.item-intro { margin: 20px 0 30px; font-family: "Droid Serif", "Helvetica Neue", Helvetica, Arial, sans-serif; font-style: italic; font-size: 16px; } .portfolio-modal .modal-content ul.list-inline { margin-bottom: 30px; margin-top: 0; } .portfolio-modal .modal-content img { margin-bottom: 30px; } .portfolio-modal .close-modal { position: absolute; width: 75px; height: 75px; background-color: transparent; top: 25px; right: 25px; cursor: pointer; } .portfolio-modal .close-modal:hover { opacity: 0.3; } .portfolio-modal .close-modal .lr { height: 75px; width: 1px; margin-left: 35px; background-color: #222222; transform: rotate(45deg); -ms-transform: rotate(45deg); /* IE 9 */ -webkit-transform: rotate(45deg); /* Safari and Chrome */ z-index: 1051; } .portfolio-modal .close-modal .lr .rl { height: 75px; width: 1px; background-color: #222222; transform: rotate(90deg); -ms-transform: rotate(90deg); /* IE 9 */ -webkit-transform: rotate(90deg); /* Safari and Chrome */ z-index: 1052; } .portfolio-modal .modal-backdrop { opacity: 0; display: none; } ::-moz-selection { text-shadow: none; background: #78be20; } ::selection { text-shadow: none; background: #78be20; } img::selection { background: transparent; } img::-moz-selection { background: transparent; } body { webkit-tap-highlight-color: #78be20; }
alexgt9/the-pirate-trip
css/agency.css
CSS
mit
16,369
module MollieNLIDeal class Engine < Rails::Engine config.mollie_ideal = MollieNLIDeal::Config end end
rsneekes/mollienl-ideal
lib/mollienl-ideal/engine.rb
Ruby
mit
111
require "rails_helper" RSpec.describe GoogleUrlValidator do include GoogleSheetHelper it "validates an incorrect host name" do record = build_stubbed(:tagging_spreadsheet, url: "https://invalid.com") GoogleUrlValidator.new.validate(record) expect(record.errors[:url]).to include(/is not a google docs url/i) end it "validates an incorrect path" do record = build_stubbed(:tagging_spreadsheet, url: "https://docs.google.com/something/else") GoogleUrlValidator.new.validate(record) expect(record.errors[:url]).to include(/does not have the expected public path/i) end it "validates missing param gid" do record = build_stubbed(:tagging_spreadsheet, url: "https://docs.google.com/path?p=1&p=2") GoogleUrlValidator.new.validate(record) expect(record.errors[:url]).to include(/is missing a google spreadsheet id/i) end it "validates missing param output" do record = build_stubbed(:tagging_spreadsheet, url: "https://docs.google.com/path") GoogleUrlValidator.new.validate(record) expect(record.errors[:url]).to include(/is missing the parameter output as csv/i) end it "validates incorrect param output" do record = build_stubbed(:tagging_spreadsheet, url: "https://docs.google.com/path?output=pdf") GoogleUrlValidator.new.validate(record) expect(record.errors[:url]).to include(/is missing the parameter output as csv/i) end it "does not add validation errors for a correct URL" do valid_url = google_sheet_url(key: "mykey", gid: "mygid") record = build_stubbed(:tagging_spreadsheet, url: valid_url) GoogleUrlValidator.new.validate(record) expect(record.errors[:url]).to be_empty end end
alphagov/content-tagger
spec/validators/google_url_validator_spec.rb
Ruby
mit
1,701
package org.github.mervyn.io; import static org.junit.Assert.*; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * @ClassName: FileInputStreamTest * @Description: 测试FileInputStream * @author: mervyn * @date 2015年12月26日 上午11:28:07 * */ public class FileInputStreamTest { protected Logger logger = LoggerFactory.getLogger(this.getClass()); /** * testFileInputStream1(测试FileInputStream(File file)构造函数,构造节点输入流) * TODO(这里描述这个方法适用条件 – 可选) * TODO(这里描述这个方法的执行流程 – 可选) * TODO(这里描述这个方法的使用方法 – 可选) * TODO(这里描述这个方法的注意事项 – 可选) * * @Title: testFileInputStream * @Description: 测试FileInputStream(File file)构造函数,构造节点输入流 * @param @throws IOException * @return void 返回类型 * @throws */ @Test public void testFileInputStream1() throws IOException{ String pathname = "src" + File.separator + "test" + File.separator + "resources" + File.separator + "test.txt"; File f = new File(pathname); //构造一个FileInputStream InputStream in = new FileInputStream(f); byte[] b = new byte[(int) f.length()]; //从输入流中读取数据,一次性读入所有字节 int len = in.read(b); //关闭输入流 in.close(); logger.debug("读入了" + len + "个字节的数据"); logger.debug("读入的数据是:" + new String(b)); } }
csmervyn/java-learn
java-learn-io/src/test/java/org/github/mervyn/io/FileInputStreamTest.java
Java
mit
1,707
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <title>Desktop</title> <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" /> <link rel="stylesheet" href="../styles/styles.css"> </head> <body> <div id="map"></div> <script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script src="/bower_components/moment/min/moment.min.js"></script> <!-- Mock Data = data.js --> <script src="/app/data.js"></script> <script src="/app/heatmap.js"></script> <script src="/app/leaflet-heatmap.js"></script> <script src="/app/app.js"></script> </body> </html>
hitraffic/desktop
views/index.html
HTML
mit
837
<div class="post"> <h1><a href="{{ Cupboard::route('posts.show', $post->slug) }}">{{ $post->title }}</a></h1> <div class="date">{{ date("M/d/Y", strtotime($post->publish_date)) }}</div> <div class="content"> {{ $post->parsed_intro }} </div> </div>
CupboardCMS/core
public/themes/default/inc/post.blade.php
PHP
mit
254
@charset "utf-8"; /* CSS Document */ html, body { color: black; background-color: #333; } h1{ color: #e0dfdc; text-shadow: 0 -1px 0 #ffffff, 0 1px 0 #2e2e2e, 0 2px 0 #2c2c2c, 0 3px 0 #2a2a2a, 0 4px 0 #282828, 0 5px 0 #262626, 0 6px 0 #242424, 0 7px 0 #222222, 0 8px 0 #202020, 0 9px 0 #1e1e1e, 0 10px 0 #1c1c1c, 0 11px 0 #1a1a1a, 0 12px 0 #181818, 0 13px 0 #161616, 0 14px 0 #141414, 0 15px 0 #121212, 0 22px 30px rgba(0, 0, 0, 0.9); } input[type="text"], input[type="email"], input[type="number"], input[type="password"], input[type="search"], input[type="url"], input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="text"], input[type="month"], input[type="time"], input[type="week"], input[type="tel"], input[list], textarea, select, a.file{ color: #666; background: #efefef; border:none; } a.radio, a.checkbox{ color: #333; background: #efefef; border:none; } input[type="text"]:active,input[type="text"]:focus, input[type="email"]:active,input[type="email"]:focus, input[type="number"]:active,input[type="number"]:focus, input[type="password"]:active,input[type="password"]:focus, input[type="search"]:active,input[type="search"]:focus, input[type="url"]:active,input[type="url"]:focus, input[type="date"]:active,input[type="date"]:focus, input[type="datetime"]:active,input[type="datetime"]:focus, input[type="datetime-local"]:active,input[type="datetime-local"]:focus, input[type="text"]:active,input[type="text"]:focus, input[type="month"]:active,input[type="month"]:focus, input[type="time"]:active,input[type="time"]:focus, input[type="week"]:active,input[type="week"]:focus, input[type="tel"]:active,input[type="tel"]:focus, input[list]:active,input[list]:focus, textarea:active,textarea:focus, select:active,select:focus{ color: #333; background:#fff; outline: none; } input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill { background-color: #0F9; background-image: none; color: rgb(0, 0, 0); } input[type]::-webkit-input-placeholder, select::-webkit-input-placeholder, textarea::-webkit-input-placeholder{ color:#efefef; } input[type="time"]::-webkit-input-placeholder{ display:none; } input[type="text"] + label, input[type="email"] + label, input[type="number"] + label, input[type="password"] + label, input[type="search"] + label, input[type="url"] + label, input[type="date"] + label, input[type="datetime"] + label, input[type="datetime-local"] + label, input[type="text"] + label, input[type="month"] + label, input[type="time"] + label, input[type="week"] + label, input[type="tel"] + label, input[type="color"] + label, input[type="range"] + label, input[list] ~ label, select + label, textarea + label, a.radio label:last-child, a.checkbox label:last-child, a.file label:last-child{ text-shadow:none; background: #eee000; color:#000; cursor: pointer; } input[type] + labellast-child:before, input[type] + labellast-child:after, input[list] + label:before, input[list] + label:after, select + label:before, select + label:after, textarea + label:before, textarea + label:after, a.radio label:last-child:after, a.radio label:last-child:before, a.checkbox label:last-child:after, a.checkbox label:last-child:before{ background: #eee000; } input[type] + label:before, input[list] + label:before, select + label:before, textarea + label:before, a.radio label:last-child:before, a.checkbox label:last-child:before{ background: rgba(3, 36, 41, 0.2); } input[type]:focus::-webkit-input-placeholder, input[type]:active::-webkit-input-placeholder, select:focus::-webkit-input-placeholder, select:active::-webkit-input-placeholder, textarea:focus::-webkit-input-placeholder, textarea:active::-webkit-input-placeholder { color: #aaa; } a.radio label:after{ } a.radio label:before{ } a.color{ color: #000; background: #efefef; } a.color input[type="color"]{ background:#efefef; box-shadow:none; } a.file label.lblfile{ color:#333; text-shadow:none; } input[type="range"]{ background:#efefef; } input[type="range"]:focus, input[type="range"]:active{ background:#fff; } input[type=range]::-webkit-slider-runnable-track { background: #ddd; border: none; } input[type=range]::-webkit-slider-thumb { background: #eee000; } input[type=range]:hover::-webkit-slider-thumb { box-shadow:0px 0px 5px #777; } input[type=range]:focus::-webkit-slider-thumb { outline: none; } input[type=range]:focus::-webkit-slider-runnable-track { background: #ccc; } button,input[type="button"], input[type="reset"]{ background:#efefef; color:#666; } button:hover, input[type="button"]:hover, input[type="reset"]:hover{ background:#ccc; color:#000; } input[type="submit"]{ background:#eee000; color:#000; border:1px solid #eee000; } input[type="submit"]:hover{ background:none; color:#eee000; border:1px solid #eee000; }
acmeinfotec/html5formgenerator
css/color/html5-form-generator-color-Yellow.css
CSS
mit
5,017
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("Series of Letters")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Series of Letters")] [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("28bb92e2-4a4c-41a0-8929-113edb6462a8")] // 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")]
BlueDress/School
C# Advanced/Regular Expressions Exercises/Series of Letters/Properties/AssemblyInfo.cs
C#
mit
1,410
package be.swsb.productivity.chapter5.beans; public abstract class CoffeeBeans { public abstract String scent(); }
Sch3lp/ProductivityWithShortcuts
src/main/java/be/swsb/productivity/chapter5/beans/CoffeeBeans.java
Java
mit
120
'use strict'; var MemoryStats = require('../../src/models/memory_stats') , SQliteAdapter = require('../../src/models/sqlite_adapter') , chai = require('chai') , expect = chai.expect , chaiAsPromised = require('chai-as-promised'); chai.use(chaiAsPromised); describe('MemoryStats', function() { describe('.constructor', function() { it('returns an instantiated memory stats and its schema attributes', function() { expect(MemoryStats().schemaAttrs).to.include.members(['container_name', 'timestamp_day']); }); it('returns an instantiated memory stats and its table name', function() { expect(MemoryStats().tableName).to.eql('memory_stats'); }); }); after(function() { return SQliteAdapter.deleteDB() .then(null) .catch(function(err) { console.log(err.stack); }); }); });
davidcunha/wharf
test/models/memory_stats_test.js
JavaScript
mit
848
package com.zs.leetcode.array; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; public class MergeIntervals { public static void main(String[] args) { } public List<Interval> merge(List<Interval> intervals) { List<Interval> list = new ArrayList<Interval>(); if (intervals.size() == 0) { return list; } Collections.sort(intervals, new MyComparator()); int start = intervals.get(0).start; int end = intervals.get(0).end; for (int i = 1; i < intervals.size(); i++) { Interval inter = intervals.get(i); if (inter.start > end) { list.add(new Interval(start, end)); start = inter.start; end = inter.end; }else{ end = Math.max(end, inter.end); } } list.add(new Interval(start, end)); return list; } class MyComparator implements Comparator<Interval> { @Override public int compare(Interval o1, Interval o2) { return o1.start - o2.start; } } }
zsgithub3895/common.code
src/com/zs/leetcode/array/MergeIntervals.java
Java
mit
1,011
# What is this? A script and data for a bot that automatically generates and posts the daily/weekly threads to /r/gamedev, as well as stickies and flairs them as appropriate. # How does it work? It automatically schedules posts, one post type per `/threads` folder. It determines which thread to post by first looking at `/threads/[thread]/once.yaml` and seeing if a thread is scheduled. If no specific thread is scheduled, it grabs the top thread from the `threads/[thread]/posts.yaml` queue (and moves it to the bottom), combines that threads `variables` with the default `variables` from `/threads/[thread]/config.yaml` and passes them into `/threads/[thread]/format.md` and the title, and then posts it to reddit. `format.md` and title variables are gathered from `internal.yaml`, `posts.yaml > [selected] > variables`, and `conf.yaml`. With the priority in that order. The variables are used replace the `%{name}` counterparts in `format.yaml` and `conf.yaml`'s title. # Contributing (post titles, bonus question, formatting, etc) Modify the appropriate file (probably `posts.yaml`) and submit a pull request, or [message /r/gamedev](https://www.reddit.com/message/compose?to=%2Fr%2Fgamedev), or [fill out this form](https://docs.google.com/forms/d/1ce7sbdm-D_PJy3WC5FAbpZ6KprBKW4OcSL0hLxUvoQE/viewform). (Optional) Run `validate.rb` before submitting to confirm all your changes are good to go. ## Base Text (`format.md`) Edit `format.md` as though it were a reddit post, with the exception that %{variable} will be replaced with their counterpart from the merger of `internal.yaml`, `[selected post] > variables`, and `conf.yaml` (with priority in that order). ```yaml # Standard Variables: %{today} - the current date YYYY-MM-DD %{counter} - the current post number %{tagline} - the (sub)title of the post %{question} - question to appear at the end of the post %{extra} - bonus text to be included at the end of the post ``` ## Regular posts (`posts.yaml`) When no specific post is scheduled through `once.yaml`, the top post is selected from `posts.yaml` and moved to the bottom of `posts.yaml`. ```yaml # Example posts.yaml entry - variables: tagline: "Text to be included in the title" question: "Question to be included at the end" # optional bonus: "Text to be included after the end" # optional ``` ## Scheduled posts (`once.yaml`) Specially scheduled posts. All entries should include one of `on_counter`, `after_date`, or `before_date`. Optionally they may include `keep: true` and `again: true` to move the entry to `posts.yaml` and keep the scheduling in `once.yaml`, respectively. ```yaml # Posted when the %{counter} reaches 50 and discarded (moved to once-used.yaml) - on_counter: 50 variables: tagline: "Text to be included in the title" question: "Question to be included at the end" # optional bonus: "Text to be included after the end" # optional # Posted in the week after '04/01' and then kept (moved to the end of posts.yaml) - after_date: '04/01' keep: true # this keeps the post (moves it to posts.yaml when we're done) variables: tagline: nothing nothing question: nothing nothing nothing bonus: |+ # Include multiple lines of text in this fashion line1 line2 line4 # Posted in the week before '04/01' and is used again (is kept in once.yaml and not moved) - before_date: '04/01' again: true variables: tagline: April Fools question: Something something pranks. bonus: |+ # Include multiple lines of text in this fashion just literally paragraphs of text not even kidding ``` # TODO * Testing * All. * The. * Things. * *(except posts.yaml)*
r-gamedev/weekly-posts
README.md
Markdown
mit
3,708
module.exports = { resolve: { alias: { 'vue': 'vue/dist/vue.js' } } }
ye-will/vue-factory
webpack.config.js
JavaScript
mit
88
/** * Created by kalle on 12.5.2014. */ /// <reference path="jquery.d.ts" /> var TheBall; (function (TheBall) { (function (Interface) { (function (UI) { var ResourceLocatedObject = (function () { function ResourceLocatedObject(isJSONUrl, urlKey, onUpdate, boundToElements, boundToObjects, dataSourceObjects) { this.isJSONUrl = isJSONUrl; this.urlKey = urlKey; this.onUpdate = onUpdate; this.boundToElements = boundToElements; this.boundToObjects = boundToObjects; this.dataSourceObjects = dataSourceObjects; // Initialize to empty arrays if not given this.onUpdate = onUpdate || []; this.boundToElements = boundToElements || []; this.boundToObjects = boundToObjects || []; this.dataSourceObjects = dataSourceObjects || []; } return ResourceLocatedObject; })(); UI.ResourceLocatedObject = ResourceLocatedObject; var UpdatingDataGetter = (function () { function UpdatingDataGetter() { this.TrackedURLDictionary = {}; } UpdatingDataGetter.prototype.registerSourceUrls = function (sourceUrls) { var _this = this; sourceUrls.forEach(function (sourceUrl) { if (!_this.TrackedURLDictionary[sourceUrl]) { var sourceIsJson = _this.isJSONUrl(sourceUrl); if (!sourceIsJson) throw "Local source URL needs to be defined before using as source"; var source = new ResourceLocatedObject(sourceIsJson, sourceUrl); _this.TrackedURLDictionary[sourceUrl] = source; } }); }; UpdatingDataGetter.prototype.isJSONUrl = function (url) { return url.indexOf("/") != -1; }; UpdatingDataGetter.prototype.getOrRegisterUrl = function (url) { var rlObj = this.TrackedURLDictionary[url]; if (!rlObj) { var sourceIsJson = this.isJSONUrl(url); rlObj = new ResourceLocatedObject(sourceIsJson, url); this.TrackedURLDictionary[url] = rlObj; } return rlObj; }; UpdatingDataGetter.prototype.RegisterAndBindDataToElements = function (boundToElements, url, onUpdate, sourceUrls) { var _this = this; if (sourceUrls) this.registerSourceUrls(sourceUrls); var rlObj = this.getOrRegisterUrl(url); if (sourceUrls) { rlObj.dataSourceObjects = sourceUrls.map(function (sourceUrl) { return _this.TrackedURLDictionary[sourceUrl]; }); } }; UpdatingDataGetter.prototype.RegisterDataURL = function (url, onUpdate, sourceUrls) { if (sourceUrls) this.registerSourceUrls(sourceUrls); var rlObj = this.getOrRegisterUrl(url); }; UpdatingDataGetter.prototype.UnregisterDataUrl = function (url) { if (this.TrackedURLDictionary[url]) delete this.TrackedURLDictionary[url]; }; UpdatingDataGetter.prototype.GetData = function (url, callback) { var rlObj = this.TrackedURLDictionary[url]; if (!rlObj) throw "Data URL needs to be registered before GetData: " + url; if (rlObj.isJSONUrl) { $.getJSON(url, function (content) { callback(content); }); } }; return UpdatingDataGetter; })(); UI.UpdatingDataGetter = UpdatingDataGetter; })(Interface.UI || (Interface.UI = {})); var UI = Interface.UI; })(TheBall.Interface || (TheBall.Interface = {})); var Interface = TheBall.Interface; })(TheBall || (TheBall = {})); //# sourceMappingURL=UpdatingDataGetter.js.map
abstractiondev/TheBallDeveloperExamples
WebTemplates/AdminTemplates/categoriesandcontent/assets/oiplib1.0/TheBall.Interface.UI/UpdatingDataGetter.js
JavaScript
mit
4,578
package bixie.checker.transition_relation; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import bixie.boogie.controlflow.AbstractControlFlowFactory; import bixie.boogie.controlflow.BasicBlock; import bixie.boogie.controlflow.CfgProcedure; import bixie.boogie.controlflow.expression.CfgExpression; import bixie.boogie.controlflow.statement.CfgStatement; import bixie.boogie.controlflow.util.HasseDiagram; import bixie.boogie.controlflow.util.PartialBlockOrderNode; import bixie.prover.Prover; import bixie.prover.ProverExpr; /** * @author schaef TODO: if we plan to do interprocedural analysis, we have to * change the way globals are handled here. */ public class FaultLocalizationTransitionRelation extends AbstractTransitionRelation { public LinkedList<ProverExpr> obligations = new LinkedList<ProverExpr>(); public HashMap<CfgStatement, BasicBlock> stmtOriginMap = new HashMap<CfgStatement, BasicBlock>(); HasseDiagram hd; public FaultLocalizationTransitionRelation(CfgProcedure cfg, AbstractControlFlowFactory cff, Prover p) { super(cfg, cff, p); makePrelude(); // create the ProverExpr for the precondition ProverExpr[] prec = new ProverExpr[cfg.getRequires().size()]; int i = 0; for (CfgExpression expr : cfg.getRequires()) { prec[i] = this.expression2proverExpression(expr); i++; } this.requires = this.prover.mkAnd(prec); // create the ProverExpr for the precondition ProverExpr[] post = new ProverExpr[cfg.getEnsures().size()]; i = 0; for (CfgExpression expr : cfg.getEnsures()) { post[i] = this.expression2proverExpression(expr); i++; } this.ensures = this.prover.mkAnd(post); this.hd = new HasseDiagram(cfg); computeSliceVC(cfg); this.hd = null; finalizeAxioms(); } private void computeSliceVC(CfgProcedure cfg) { PartialBlockOrderNode pon = hd.findNode(cfg.getRootNode()); LinkedList<BasicBlock> todo = new LinkedList<BasicBlock>(); todo.add(cfg.getRootNode()); HashSet<BasicBlock> mustreach = pon.getElements(); // System.err.println("-------"); // for (BasicBlock b : mustreach) System.err.println(b.getLabel()); // System.err.println("traverse "); while (!todo.isEmpty()) { BasicBlock current = todo.pop(); obligations.addAll(statements2proverExpression(current.getStatements())); for (CfgStatement stmt : current.getStatements()) { this.stmtOriginMap.put(stmt, current); } BasicBlock next = foo(current, mustreach); if (next!=null) { if (mustreach.contains(next)) { todo.add(next); } else { System.err.println("FIXME: don't know what to do with "+next.getLabel()); } } } // System.err.println("traverse done"); } private BasicBlock foo(BasicBlock b, HashSet<BasicBlock> mustpass) { HashSet<BasicBlock> done = new HashSet<BasicBlock>(); LinkedList<BasicBlock> todo = new LinkedList<BasicBlock>(); HashMap<BasicBlock, LinkedList<ProverExpr>> map = new HashMap<BasicBlock, LinkedList<ProverExpr>>(); todo.addAll(b.getSuccessors()); done.add(b); map.put(b, new LinkedList<ProverExpr>()); map.get(b).add(this.prover.mkLiteral(true)); while (!todo.isEmpty()) { BasicBlock current = todo.pop(); boolean allDone = true; LinkedList<LinkedList<ProverExpr>> prefix = new LinkedList<LinkedList<ProverExpr>>(); for (BasicBlock pre : current.getPredecessors()) { if (!done.contains(pre)) { allDone = false; break; } prefix.add(map.get(pre)); } if (!allDone) { todo.add(current); continue; } done.add(current); LinkedList<ProverExpr> conj = new LinkedList<ProverExpr>(); if (prefix.size()>1) { //TODO LinkedList<ProverExpr> shared = prefix.getFirst(); for (LinkedList<ProverExpr> list : prefix) { shared = sharedPrefix(shared, list); } conj.add(this.prover.mkAnd(shared.toArray(new ProverExpr[shared.size()]))); LinkedList<ProverExpr> disj = new LinkedList<ProverExpr>(); for (LinkedList<ProverExpr> list : prefix) { LinkedList<ProverExpr> cutlist = new LinkedList<ProverExpr>(); cutlist.addAll(list); cutlist.removeAll(shared); disj.add(this.prover.mkAnd(cutlist.toArray(new ProverExpr[cutlist.size()]))); } conj.add(this.prover.mkOr(disj.toArray(new ProverExpr[disj.size()]))); } else if (prefix.size()==1) { conj.addAll(prefix.getFirst()); } else { throw new RuntimeException("unexpected"); } if (mustpass.contains(current)) { if (conj.size()==1 && conj.getFirst().equals(this.prover.mkLiteral(true))) { // in that case, the predecessor was already in mustpass so nothing needs to be done. } else { ProverExpr formula = this.prover.mkAnd(conj.toArray(new ProverExpr[conj.size()])); this.obligations.add(formula); } return current; } else { for (CfgStatement stmt : current.getStatements()) { this.stmtOriginMap.put(stmt, current); } conj.addAll(statements2proverExpression(current.getStatements())); map.put(current, conj); for (BasicBlock suc : current.getSuccessors()) { if (!todo.contains(suc) && !done.contains(suc)) { todo.add(suc); } } } } return null; } private LinkedList<ProverExpr> sharedPrefix(LinkedList<ProverExpr> shared, LinkedList<ProverExpr> list) { Iterator<ProverExpr> iterA = shared.iterator(); Iterator<ProverExpr> iterB = list.iterator(); LinkedList<ProverExpr> ret = new LinkedList<ProverExpr>(); while(iterA.hasNext() && iterB.hasNext()) { ProverExpr next = iterA.next(); if (next == iterB.next()) { ret.add(next); } } return ret; } }
SRI-CSL/bixie
src/main/java/bixie/checker/transition_relation/FaultLocalizationTransitionRelation.java
Java
mit
5,883
--- title: COPLESTONE is_name: true --- COPLESTONE RADCLIFFE see RADCLIFFE
stokeclimsland/stokeclimsland
_cards/COPLESTONE.md
Markdown
mit
80
<table width="90%" border="0"><tr><td><script>function openfile(url) {fullwin = window.open(url, "fulltext", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");}</script><div class="layoutclass_pic"><div class="layoutclass_first_pic"><table class="ztable"><tr><th class="ztd1"><b>成語&nbsp;</b></th><td class="ztd2">目空四海</td></tr> <tr><th class="ztd1"><b>注音&nbsp;</b></th><td class="ztd2">ㄇㄨ<sup class="subfont">ˋ</sup> ㄎㄨㄥ ㄙ<sup class="subfont">ˋ</sup> ㄏㄞ<sup class="subfont">ˇ</sup></td></tr> <tr><th class="ztd1"><b>漢語拼音&nbsp;</b></th><td class="ztd2"><font class="english_word">mù kōng sì hǎi</font></td></tr> <tr><th class="ztd1"><b>釋義&nbsp;</b></th><td class="ztd2"> 義參「<a href="/cgi-bin/cydic/gsweb.cgi?o=dcydic&schfmt=text&gourl=%3De0%26sec%3Dsec1%26op%3Dsid%3D%22CW0000000613%22.%26v%3D-1" class="clink" target=_blank>目空一切</a>」。見「<a href="/cgi-bin/cydic/gsweb.cgi?o=dcydic&schfmt=text&gourl=%3De0%26sec%3Dsec1%26op%3Dsid%3D%22CW0000000613%22.%26v%3D-1" class="clink" target=_blank>目空一切</a>」條。</font></td></tr> <tr><th class="ztd1"><b><style>.tableoutfmt2 .std1{width:3%;}</style></b></th><td class="ztd2"><table class="fmt16_table"><tr><td width=150 style="text-align:left;" class="fmt16_td1" ><b>參考詞語︰</b></td><td width=150 style="text-align:left;" class="fmt16_td2" ><a href="/cgi-bin/cydic/gsweb.cgi?o=dcydic&schfmt=text&gourl=%3De0%26sec%3Dsec1%26op%3Dsid%3D%22CW0000000613%22.%26v%3D-1" class="clink" target=_blank>目空一切</a></td></tr><tr><td width=150 style="text-align:left;" class="fmt16_td1" ><b>注音︰</b></td><td width=150 style="text-align:left;" class="fmt16_td2" >ㄇㄨ<sup class="subfont">ˋ</sup> ㄎㄨㄥ | ㄑ|ㄝ<sup class="subfont">ˋ</sup></td></tr><tr><td width=150 style="text-align:left;" class="fmt16_td1" ><b>漢語拼音︰</b></td><td width=150 style="text-align:left;" class="fmt16_td2" ><font class="english_word">mù kōng yī qiè</font></td></tr></table><br><br></td></tr> </td></tr></table></div> <!-- layoutclass_first_pic --><div class="layoutclass_second_pic"></div> <!-- layoutclass_second_pic --></div> <!-- layoutclass_pic --></td></tr></table>
BuzzAcademy/idioms-moe-unformatted-data
all-data/2000-2999/2358-34.html
HTML
mit
2,256
module.exports = { prefix: 'far', iconName: 'road', icon: [576, 512, [], "f018", "M246.7 435.2l7.2-104c.4-6.3 5.7-11.2 12-11.2h44.9c6.3 0 11.5 4.9 12 11.2l7.2 104c.5 6.9-5 12.8-12 12.8h-59.3c-6.9 0-12.4-5.9-12-12.8zM267.6 288h41.5c5.8 0 10.4-4.9 10-10.7l-5.2-76c-.4-5.2-4.7-9.3-10-9.3h-31c-5.3 0-9.6 4.1-10 9.3l-5.2 76c-.5 5.8 4.1 10.7 9.9 10.7zm6.2-120H303c4.6 0 8.3-3.9 8-8.6l-2.8-40c-.3-4.2-3.8-7.4-8-7.4h-23.7c-4.2 0-7.7 3.3-8 7.4l-2.8 40c-.2 4.7 3.4 8.6 8.1 8.6zm2.8-72h23.5c3.5 0 6.2-2.9 6-6.4l-1.4-20c-.2-3.1-2.8-5.6-6-5.6H278c-3.2 0-5.8 2.4-6 5.6l-1.4 20c-.2 3.5 2.5 6.4 6 6.4zM12 448h65c5.4 0 10.2-3.6 11.6-8.9l99.5-367.6c1-3.8-1.8-7.6-5.8-7.6h-28.1c-2.4 0-4.6 1.5-5.6 3.7L.9 431.5C-2.3 439.4 3.5 448 12 448zm487.7 0h65c8.5 0 14.3-8.6 11.1-16.5L428 67.7c-.9-2.3-3.1-3.7-5.6-3.7h-28.1c-4 0-6.8 3.8-5.8 7.6L488 439.2c1.5 5.2 6.3 8.8 11.7 8.8z"] };
dolare/myCMS
static/fontawesome5/fontawesome-pro-5.0.2/fontawesome-pro-5.0.2/advanced-options/use-with-node-js/fontawesome-pro-regular/faRoad.js
JavaScript
mit
854
<?php function getHost() { // Determine the "host" (domain) part of the requested resource URL. if(isset($_SERVER['HTTP_X_FORWARDED_HOST']) && $host = $_SERVER['HTTP_X_FORWARDED_HOST']) { $elements = explode(',', $host); $host = trim(end($elements)); } else { if(!isset($_SERVER['HTTP_HOST']) || !$host = $_SERVER['HTTP_HOST']) { if(!isset($_SERVER['SERVER_NAME']) || !$host = $_SERVER['SERVER_NAME']) { $host = isset($_SERVER['SERVER_ADDR']) && !empty($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : ''; } } } // Remove port number and username from host. return trim(preg_replace('/(^.+@|:\d+$)/', '', $host)); } // Define the Perl-compatible Regular Expression for valid labels in PHP, as application environments must adhere to // this rule. defined('VALIDLABEL') || define('VALIDLABEL', '/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/'); // Specify that we are in production mode, we can turn it off in the front controller if you want. defined('PRODUCTION') || define('PRODUCTION', true); // If the application environment has already been defined, return it straight away. // First check that the ENVIRONMENT constant has not already been set in the front-controller (useful for overriding // configuration values in development or testing stages). If so, return it straight away. if(defined('ENVIRONMENT')) { return ENVIRONMENT; } /* ================ *\ | VIA: HOST/DOMAIN | \* ================ */ // Calculate the application environment from the current domain if it has been determined from server variables. if(!empty($host = getHost())) { // Load up the configuration for mapping hosts to application environments. $hosts = file_exists($hostsConfig = dirname(__FILE__) . '/hosts.php') ? require_once $hostsConfig : null; // Check to see if the current domain is in the "hosts" configuration. if(is_array($hosts) && !empty($hosts)) { foreach($hosts as $domain => $appenv) { if($domain === $host) { if(is_string($appenv) && preg_match(VALIDLABEL, $appenv)) { define('ENVIRONMENT', strtolower($appenv)); return ENVIRONMENT; } } } } } /* ==================== *\ | VIA: SERVER VARIABLE | \* ==================== */ // Check if the application environment has been set in the server variables. This can be done through Apache's // htaccess files, or through the Nginx server configuration. if(isset($_SERVER['ENVIRONMENT']) && preg_match(VALIDLABEL, $appenv = trim($_SERVER['ENVIRONMENT']))) { define('ENVIRONMENT', strtolower($appenv)); return ENVIRONMENT; } /* ================ *\ | VIA: CONFIG FILE | \* ================ */ $envfile = dirname(__FILE__) . '/.environment'; if(file_exists($envfile) && preg_match(VALIDLABEL, $appenv = trim(file_get_contents($envfile)))) { define('ENVIRONMENT', strtolower($appenv)); return ENVIRONMENT; } // If we got this far then a suitable application environment could not be found. Throw an exception. throw new \Exception('Could not determine a valid application environment. Please check the application and/or server configuration, and try again.');
Scowen/osrs-market
application/config/appenv.php
PHP
mit
3,628
package ru.ifmo.springaop.namepc; import org.springframework.aop.Advisor; import org.springframework.aop.framework.ProxyFactory; import org.springframework.aop.support.DefaultPointcutAdvisor; import org.springframework.aop.support.NameMatchMethodPointcut; import ru.ifmo.springaop.staticpc.SimpleAdvice; /** * Пример среза, где сревнение имени метода осуществляется просто по его имени. */ public class NamePointcutExample { public static void main(String[] args) { NameBean target = new NameBean(); // create advisor NameMatchMethodPointcut pc = new NameMatchMethodPointcut(); pc.addMethodName("foo"); pc.addMethodName("bar"); Advisor advisor = new DefaultPointcutAdvisor(pc, new SimpleAdvice()); // create the proxy ProxyFactory pf = new ProxyFactory(); pf.setTarget(target); pf.addAdvisor(advisor); NameBean proxy = (NameBean)pf.getProxy(); proxy.foo(); proxy.foo(999); proxy.bar(); proxy.yup(); } }
meefik/java-examples
SpringAOP/src/main/java/ru/ifmo/springaop/namepc/NamePointcutExample.java
Java
mit
1,153
package fastlanestat import ( "net/http" "html/template" // "fmt" // Import appengine urlfetch package, that is needed to make http call to the api "appengine" "appengine/datastore" ) type ViewContext struct { PricePoints []PricePoint } func viewStatsHandler(w http.ResponseWriter, r *http.Request) { c := appengine.NewContext(r) // The Query type and its methods are used to construct a query. q := datastore.NewQuery("PricePoint"). Order("-PointInTime"). Limit(5000) // To retrieve the results, // you must execute the Query using its GetAll or Run methods. var pricePoints []PricePoint //_, err := q.GetAll(c, &pricePoints) // handle error // ... viewContext := ViewContext{ PricePoints: pricePoints } t, _ := template.ParseFiles("templates/simple.htmltemplate") t.Execute(w, viewContext) }
ido-ran/fastlanestats
view.go
GO
mit
881
// The MIT License (MIT) // Copyright © 2015 AppsLandia. All rights reserved. // 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.appslandia.common.base; import java.io.IOException; import java.io.Writer; /** * @see java.io.BufferedWriter * * @author <a href="mailto:haducloc13@gmail.com">Loc Ha</a> * */ public class BufferedWriter extends Writer { private Writer out; private char cb[]; private int nChars, nextChar; private static int defaultCharBufferSize = 8192; public BufferedWriter(Writer out) { this(out, defaultCharBufferSize); } public BufferedWriter(Writer out, int sz) { super(out); if (sz <= 0) throw new IllegalArgumentException("sz"); this.out = out; cb = new char[sz]; nChars = sz; nextChar = 0; } private void ensureOpen() throws IOException { if (out == null) throw new IOException("Stream closed"); } void flushBuffer() throws IOException { ensureOpen(); if (nextChar == 0) return; out.write(cb, 0, nextChar); nextChar = 0; } public void write(int c) throws IOException { ensureOpen(); if (nextChar >= nChars) flushBuffer(); cb[nextChar++] = (char) c; } private int min(int a, int b) { if (a < b) return a; return b; } public void write(char cbuf[], int off, int len) throws IOException { ensureOpen(); if ((off < 0) || (off > cbuf.length) || (len < 0) || ((off + len) > cbuf.length) || ((off + len) < 0)) { throw new IndexOutOfBoundsException(); } else if (len == 0) { return; } if (len >= nChars) { /* * If the request length exceeds the size of the output buffer, flush the buffer and then write the data directly. In this way buffered streams will cascade harmlessly. */ flushBuffer(); out.write(cbuf, off, len); return; } int b = off, t = off + len; while (b < t) { int d = min(nChars - nextChar, t - b); System.arraycopy(cbuf, b, cb, nextChar, d); b += d; nextChar += d; if (nextChar >= nChars) flushBuffer(); } } public void write(String s, int off, int len) throws IOException { ensureOpen(); int b = off, t = off + len; while (b < t) { int d = min(nChars - nextChar, t - b); s.getChars(b, b + d, cb, nextChar); b += d; nextChar += d; if (nextChar >= nChars) flushBuffer(); } } public void newLine() throws IOException { write(System.lineSeparator(), 0, System.lineSeparator().length()); } public void flush() throws IOException { flushBuffer(); out.flush(); } public void close() throws IOException { if (out == null) { return; } try (Writer w = out) { flushBuffer(); } finally { out = null; cb = null; } } }
haducloc/appslandia-common
src/main/java/com/appslandia/common/base/BufferedWriter.java
Java
mit
3,684
/** * Copyright (c) 2010 Daniel Murphy * * 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. */ /** * Created at Aug 20, 2010, 2:58:08 AM */ package com.dmurph.mvc.gui.combo; import java.awt.event.KeyEvent; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.ArrayList; import java.util.Collection; import java.util.Comparator; import java.util.Iterator; import java.util.LinkedList; import javax.swing.JComboBox; import com.dmurph.mvc.model.MVCArrayList; /** * This class is for having a combo box that will always reflect the data of * an MVCArrayList. There is a lot of flexibility provided with filtering * and sorting the elements. * * @author Daniel Murphy */ public class MVCJComboBox<E> extends JComboBox { private static final long serialVersionUID = 1L; private MVCJComboBoxModel<E> model; private MVCArrayList<E> data; private IMVCJComboBoxFilter<E> filter; private final Object lock = new Object(); private MVCJComboBoxStyle style; private Comparator<E> comparator = null; private final PropertyChangeListener plistener = new PropertyChangeListener() { @SuppressWarnings("unchecked") public void propertyChange(PropertyChangeEvent argEvt) { String prop = argEvt.getPropertyName(); if (prop.equals(MVCArrayList.ADDED)) { add((E)argEvt.getNewValue()); } else if(prop.equals(MVCArrayList.ADDED_ALL)){ addAll((Collection<E>) argEvt.getNewValue()); } else if (prop.equals(MVCArrayList.CHANGED)) { change((E)argEvt.getOldValue(),(E) argEvt.getNewValue()); } else if (prop.equals(MVCArrayList.REMOVED)) { remove((E)argEvt.getOldValue()); } else if(prop.equals(MVCArrayList.REMOVED_ALL)){ synchronized(lock){ model.removeAllElements(); } } } }; /** * Constructs with no data, no filter, no * {@link Comparator}, and style set to * {@link MVCJComboBoxStyle#ADD_NEW_TO_BEGINNING}. */ public MVCJComboBox() { this(null, new IMVCJComboBoxFilter<E>() { public boolean showItem(E argComponent) { return true; }; }, MVCJComboBoxStyle.SORT, null); } /** * Constructs a combo box with the given style. If you want * the {@link MVCJComboBoxStyle#SORT} style, then you'll want to specify * a comparator as well. * @param argData * @param argStyle */ public MVCJComboBox(MVCJComboBoxStyle argStyle) { this(null, new IMVCJComboBoxFilter<E>() { public boolean showItem(E argComponent) { return true; }; }, argStyle, null); } /** * Constracts a dynamic combo box with the given data and * default style of {@link MVCJComboBoxStyle#SORT}. * @param argData */ public MVCJComboBox(MVCArrayList<E> argData, Comparator<E> argComparator) { this(argData, new IMVCJComboBoxFilter<E>() { public boolean showItem(E argComponent) { return true; }; }, MVCJComboBoxStyle.SORT, argComparator); } /** * Constructs a combo box with the given data and style. If you want * the {@link MVCJComboBoxStyle#SORT} style, then you'll want to specify * a comparator as well. * @param argData * @param argStyle */ public MVCJComboBox(MVCArrayList<E> argData, MVCJComboBoxStyle argStyle) { this(argData, new IMVCJComboBoxFilter<E>() { public boolean showItem(E argComponent) { return true; }; }, argStyle, null); } /** * Constructs a dynamic combo box with the given data, filter, and comparator. * The style will be {@link MVCJComboBoxStyle#SORT} by default. * @param argData * @param argFilter * @param argComparator */ public MVCJComboBox(MVCArrayList<E> argData, IMVCJComboBoxFilter<E> argFilter, Comparator<E> argComparator) { this(argData, argFilter, MVCJComboBoxStyle.SORT, null); } /** * * @param argData * @param argFilter * @param argStyle * @param argComparator */ public MVCJComboBox(MVCArrayList<E> argData, IMVCJComboBoxFilter<E> argFilter, MVCJComboBoxStyle argStyle, Comparator<E> argComparator) { data = argData; style = argStyle; filter = argFilter; comparator = argComparator; model = new MVCJComboBoxModel<E>(); super.setModel(model); if(data != null){ argData.addPropertyChangeListener(plistener); // add the data for (E o : data) { if(filter.showItem(o)){ model.addElement(o); } } // start with allowing the comparator to be null, in case they intend to set it later. and call refreshData() if(style == MVCJComboBoxStyle.SORT && comparator != null){ model.sort(comparator); } } } /** * Gets the rendering style of this combo box. Default style is * {@link MVCJComboBoxStyle#SORT}. * @return */ public MVCJComboBoxStyle getStyle(){ return style; } /** * Gets the data list. This is used to access * data with {@link #refreshData()}, so override * if you want to customize what the data is (sending * null to the contructor for the data * is a good idea in that case) * @return */ public ArrayList<E> getData(){ return data; } /** * Sets the data of this combo box. This causes the box * to refresh it's model * @param argData can be null */ public void setData(MVCArrayList<E> argData){ synchronized (lock) { if(data != null){ data.removePropertyChangeListener(plistener); } data = argData; if(data != null){ data.addPropertyChangeListener(plistener); } } refreshData(); } /** * Sets the comparator used for the {@link MVCJComboBoxStyle#SORT} style. * @param argComparator */ public void setComparator(Comparator<E> argComparator) { this.comparator = argComparator; } /** * Gets the comparator that's used for sorting. * @return */ public Comparator<E> getComparator() { return comparator; } /** * @return the filter */ public IMVCJComboBoxFilter<E> getFilter() { return filter; } /** * @param argFilter the filter to set */ public void setFilter(IMVCJComboBoxFilter<E> argFilter) { filter = argFilter; } /** * @see javax.swing.JComboBox#processKeyEvent(java.awt.event.KeyEvent) */ @Override public void processKeyEvent(KeyEvent argE) { if(argE.getKeyChar() == KeyEvent.VK_BACK_SPACE || argE.getKeyChar() == KeyEvent.VK_DELETE){ setSelectedItem(null); super.hidePopup(); }else{ super.processKeyEvent(argE); } } /** * Sets the style of this combo box * @param argStyle */ public void setStyle(MVCJComboBoxStyle argStyle){ style = argStyle; if(style == MVCJComboBoxStyle.SORT){ if(comparator == null){ throw new NullPointerException("DynamicJComboBox style is set to Alpha Sort, but the comparator is null."); } model.sort(comparator); } } public void refreshData(){ synchronized (lock) { // remove all elements model.removeAllElements(); if(getData() == null){ return; } for(E e: getData()){ if(filter.showItem(e)){ model.addElement(e); } } if(style == MVCJComboBoxStyle.SORT){ if(comparator == null){ throw new NullPointerException("DynamicJComboBox style is set to Alpha Sort, but the comparator is null."); } model.sort(comparator); } } } private void add(E argNewObj) { boolean b = filter.showItem(argNewObj); if (b == false) { return; } synchronized (lock) { switch(style){ case SORT:{ if(comparator == null){ throw new NullPointerException("DynamicJComboBox style is set to Alpha Sort, but the comparator is null."); } boolean inserted = false; for(int i=0; i<model.getSize(); i++){ E e = model.getElementAt(i); if(comparator.compare(e, argNewObj) > 0){ model.insertElementAt(argNewObj, i); inserted = true; break; } } if(!inserted){ model.addElement(argNewObj); } break; } case ADD_NEW_TO_BEGINNING:{ model.insertElementAt(argNewObj, 0); break; } case ADD_NEW_TO_END:{ model.addElement(argNewObj); } } } } private void addAll(Collection<E> argNewObjects) { LinkedList<E> filtered = new LinkedList<E>(); Iterator<E> it = argNewObjects.iterator(); while(it.hasNext()){ E e = it.next(); if(filter.showItem(e)){ filtered.add(e); } } if(filtered.size() == 0){ return; } synchronized (lock) { switch(style){ case SORT:{ if(comparator == null){ throw new NullPointerException("DynamicJComboBox style is set to Alpha Sort, but the comparator is null."); } model.addElements(filtered); model.sort(comparator); break; } case ADD_NEW_TO_BEGINNING:{ model.addElements(0, filtered); break; } case ADD_NEW_TO_END:{ model.addElements(filtered); } } } } private void change(E argOld, E argNew) { boolean so = filter.showItem(argOld); boolean sn = filter.showItem(argNew); if(!sn){ remove(argOld); return; } if(!so){ if(sn){ add(argNew); return; }else{ return; } } synchronized (lock) { int size = model.getSize(); for (int i = 0; i < size; i++) { E e = model.getElementAt(i); if (e == argOld) { model.setElementAt(argNew, i); return; } } if(style == MVCJComboBoxStyle.SORT){ if(comparator == null){ throw new NullPointerException("DynamicJComboBox style is set to Alpha Sort, but the comparator is null."); } model.sort(comparator); } } } private void remove(E argVal) { boolean is = filter.showItem(argVal); if (!is) { return; } synchronized (lock) { for(int i=0; i<model.getSize();i ++){ E e = model.getElementAt(i); if(e == argVal){ model.removeElementAt(i); return; } } } } }
pearlqueen/java-simple-mvc
src/main/java/com/dmurph/mvc/gui/combo/MVCJComboBox.java
Java
mit
10,703
'use strict'; module.exports = function(config) { config.set({ autoWatch : true, frameworks: ['jasmine'], browsers : ['PhantomJS'], plugins : [ 'karma-phantomjs-launcher', 'karma-jasmine', 'karma-coverage' ], preprocessors: { 'src/**/*.js': ['coverage'] }, reporters: ['progress', 'coverage'], coverageReporter: { type: 'lcov', dir: 'reports', subdir: 'coverage' }, colors: true }); };
threeq/angular-weui
karma.conf.js
JavaScript
mit
518
<?php /* Unsafe sample input : use exec to execute the script /tmp/tainted.php and store the output in $tainted sanitize : regular expression accepts everything construction : concatenation with simple quote */ /*Copyright 2015 Bertrand STIVALET Permission is hereby granted, without written agreement or royalty fee, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following three paragraphs appear in all copies of this software. IN NO EVENT SHALL AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. AUTHORS SPECIFICALLY DISCLAIM ANY WARRANTIES INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND AUTHORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.*/ $script = "/tmp/tainted.php"; exec($script, $result, $return); $tainted = $result[0]; $re = "/^.*$/"; if(preg_match($re, $tainted) == 1){ $tainted = $tainted; } else{ $tainted = ""; } $query = "(&(objectCategory=person)(objectClass=user)(cn='". $tainted . "'))"; //flaw $ds=ldap_connect("localhost"); $r=ldap_bind($ds); $sr=ldap_search($ds,"o=My Company, c=US", $query); ldap_close($ds); ?>
stivalet/PHP-Vulnerability-test-suite
Injection/CWE_90/unsafe/CWE_90__exec__func_preg_match-no_filtering__userByCN-concatenation_simple_quote.php
PHP
mit
1,525
using System; using System.Data.Entity; using System.Data.Entity.Infrastructure; using System.Threading; using System.Web.Mvc; using WebMatrix.WebData; using PersonaMVC4Example.Models; namespace PersonaMVC4Example.Filters { [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)] public sealed class InitializeSimpleMembershipAttribute : ActionFilterAttribute { private static SimpleMembershipInitializer _initializer; private static object _initializerLock = new object(); private static bool _isInitialized; public override void OnActionExecuting(ActionExecutingContext filterContext) { // Ensure ASP.NET Simple Membership is initialized only once per app start LazyInitializer.EnsureInitialized(ref _initializer, ref _isInitialized, ref _initializerLock); } private class SimpleMembershipInitializer { public SimpleMembershipInitializer() { Database.SetInitializer<UsersContext>(null); try { using (var context = new UsersContext()) { if (!context.Database.Exists()) { // Create the SimpleMembership database without Entity Framework migration schema ((IObjectContextAdapter)context).ObjectContext.CreateDatabase(); } } WebSecurity.InitializeDatabaseConnection("DefaultConnection", "UserProfile", "UserId", "UserName", autoCreateTables: true); } catch (Exception ex) { throw new InvalidOperationException("The ASP.NET Simple Membership database could not be initialized. For more information, please see http://go.microsoft.com/fwlink/?LinkId=256588", ex); } } } } }
shanselman/AspNetPersonaId
MVC4/PersonaMVC4Example/Filters/InitializeSimpleMembershipAttribute.cs
C#
mit
2,018
--- title: JavaScript创建并触发事件 --- 只测试了Chrome和UC手机浏览器 ## 创建自定义事件 使用[Event][1]构造函数可以直接创建时间,并在制定元素上触发: ``` var event = new Event('build.qiu'); elem.addEventListener('build.qiu', function (e) {}, false); elem.dispatchEvent(event); ``` [在线demo][1] ## 创建自定义事件并携带数据 使用`CustomEvent`构造函数, 在配置参数的`detail`字段添加需要的参数.然后在`event.detail`中获取: ``` var event = new CustomEvent('build.qiu', {detail: 'hello'}); function eventHandle(e) { console.log(e.detail); } ``` [在线demo][2] ## 触发build-in事件 ``` <div id="d3"> <style> #d3 .info, #d3 .trigger { min-height: 30px; background: #ddd; } </style> <p class="info"></p> <p class="trigger">click here to trigger event: build.qiu with detail data</p> <script> (function () { var info = document.querySelector('#d3 .info'); var trigger = document.querySelector('#d3 .trigger'); trigger.addEventListener('click', function (e) { var event = new CustomEvent('touchstart') info.dispatchEvent(event); }, false); info.addEventListener('touchstart', function (e) { info.textContent = 'received event: ' + e.type; }, false); }()); </script> </div> ``` [2]: http://qiudeqing.com/demo/html5/create-trigger-event.html#d2 [1]: http://qiudeqing.com/demo/html5/create-trigger-event.html#d1
qiu-deqing/qiu-deqing.github.io
html5/_posts/2015-08-18-create-and-trigger-event.md
Markdown
mit
1,479
/* * Copyright (c) 2013 Triforce - in association with the University of Pretoria and Epi-Use <Advance/> * * 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 afk.ge.tokyo.ems.systems; import afk.bot.london.Sonar; import afk.ge.BBox; import afk.ge.ems.Engine; import afk.ge.ems.ISystem; import afk.ge.ems.Utils; import afk.ge.tokyo.ems.components.Camera; import afk.ge.tokyo.ems.components.Display; import afk.ge.tokyo.ems.components.Mouse; import afk.ge.tokyo.ems.components.Selection; import afk.ge.tokyo.ems.nodes.CollisionNode; import afk.ge.tokyo.ems.nodes.SonarNode; import afk.gfx.GfxEntity; import static afk.gfx.GfxEntity.*; import static afk.gfx.GfxUtils.X_AXIS; import static afk.gfx.GfxUtils.Y_AXIS; import static afk.gfx.GfxUtils.Z_AXIS; import afk.gfx.GraphicsEngine; import com.hackoeur.jglm.Mat4; import com.hackoeur.jglm.Matrices; import com.hackoeur.jglm.Vec3; import com.hackoeur.jglm.Vec4; import java.util.List; /** * * @author daniel */ public class DebugRenderSystem implements ISystem { Engine engine; GraphicsEngine gfxEngine; public DebugRenderSystem(GraphicsEngine gfxEngine) { this.gfxEngine = gfxEngine; } @Override public boolean init(Engine engine) { this.engine = engine; return true; } @Override public void update(float t, float dt) { Camera camera = engine.getGlobal(Camera.class); Mouse mouse = engine.getGlobal(Mouse.class); Display display = engine.getGlobal(Display.class); Selection selection = engine.getGlobal(Selection.class); List<CollisionNode> nodes = engine.getNodeList(CollisionNode.class); for (CollisionNode node : nodes) { BBox bbox = new BBox(node.state, node.bbox); GfxEntity gfx = gfxEngine.getDebugEntity(bbox); gfx.position = bbox.getCenterPoint(); gfx.rotation = node.state.rot; gfx.scale = new Vec3(1); gfx.colour = selection.getEntity() == node.entity ? GREEN : MAGENTA; } List<SonarNode> snodes = engine.getNodeList(SonarNode.class); for (SonarNode node : snodes) { final Vec3[] POS_AXIS = { X_AXIS, Y_AXIS, Z_AXIS }; final Vec3[] NEG_AXIS = { X_AXIS.getNegated(), Y_AXIS.getNegated(), Z_AXIS.getNegated() }; Sonar sonar = node.controller.events.sonar; Mat4 m = Utils.getMatrix(node.state); Vec3 pos = node.state.pos.add(m.multiply(node.bbox.offset.toDirection()).getXYZ()); float[] sonarmins = { sonar.distance[3], sonar.distance[4], sonar.distance[5] }; float[] sonarmaxes = { sonar.distance[0], sonar.distance[1], sonar.distance[2] }; for (int i = 0; i < 3; i++) { if (!Float.isNaN(node.sonar.min.get(i))) { drawSonar(node, NEG_AXIS[i], sonarmins[i], node.sonar.min.get(i), pos.subtract(m.multiply(NEG_AXIS[i].scale(node.bbox.extent.get(i)).toDirection()).getXYZ())); } if (!Float.isNaN(node.sonar.max.get(i))) { drawSonar(node, POS_AXIS[i], sonarmaxes[i], node.sonar.max.get(i), pos.add(m.multiply(POS_AXIS[i].scale(node.bbox.extent.get(i)).toDirection()).getXYZ())); } } gfxEngine.getDebugEntity(new Vec3[] { new Vec3(-1000, 0, 0), new Vec3(1000, 0, 0) }).colour = new Vec3(0.7f, 0, 0); gfxEngine.getDebugEntity(new Vec3[] { new Vec3(0, -1000, 0), new Vec3(0, 1000, 0) }).colour = new Vec3(0, 0.7f, 0); gfxEngine.getDebugEntity(new Vec3[] { new Vec3(0, 0, -1000), new Vec3(0, 0, 1000) }).colour = new Vec3(0, 0, 0.7f); final float fov = 60.0f, near = 0.1f, far = 200.0f; Mat4 proj = Matrices.perspective(fov, display.screenWidth/display.screenHeight, near, far); Mat4 view = Matrices.lookAt(camera.eye, camera.at, camera.up); Mat4 cam = proj.multiply(view); Mat4 camInv = cam.getInverse(); Vec4 mouseNear4 = camInv.multiply(new Vec4(mouse.nx,mouse.ny,-1,1)); Vec4 mouseFar4 = camInv.multiply(new Vec4(mouse.nx,mouse.ny,1,1)); Vec3 mouseNear = mouseNear4.getXYZ().scale(1.0f/mouseNear4.getW()); Vec3 mouseFar = mouseFar4.getXYZ().scale(1.0f/mouseFar4.getW()); gfxEngine.getDebugEntity(new Vec3[] { mouseNear, mouseFar }).colour = new Vec3(1,0,0); } } private void drawSonar(SonarNode node, Vec3 axis, float sonar, float value, Vec3 pos) { GfxEntity gfx = gfxEngine.getDebugEntity(new Vec3[] { Vec3.VEC3_ZERO, axis.scale((Float.isInfinite(sonar) ? value : sonar)) }); gfx.position = pos; gfx.rotation = node.state.rot; gfx.scale = new Vec3(1); gfx.colour = MAGENTA; } @Override public void destroy() { } }
jwfwessels/AFK
src/afk/ge/tokyo/ems/systems/DebugRenderSystem.java
Java
mit
6,629
<img src="Z/posix-file-types-file_name.png" alt="Filename type."/>
io7m/coreland-posix-ada-doc
src/Z/posix-file-types-file_name.html
HTML
mit
67
<?php require_once('vendor/autoload.php');
thepsion5/menuizer
tests/bootstrap.php
PHP
mit
45
package models import java.sql.Timestamp case class NodeEntity(id: String, instancesCount: Int) case class InstanceEntity(id: String, nodeId: String, state: String) case class AttributeEntity(instanceId: String, key: String, value: String) case class OperationEntity(instanceId: String, interfaceName: String, operationName: String) case class TaskEntity(executionId: String, taskId: String, status: String, startTime: Option[Timestamp], endTime: Option[Timestamp], error: Option[String]) case class NodeTaskEntity(executionId: String, instanceId: String, interfaceName: String, operationName: String, status: String, startTime: Option[Timestamp], endTime: Option[Timestamp], error: Option[String]) case class RelationshipTaskEntity(executionId: String, sourceInstanceId: String, targetInstanceId: String, relationshipType: String, interfaceName: String, operationName: String, status: String, startTime: Option[Timestamp], endTime: Option[Timestamp], error: Option[String]) case class OperationOutputEntity(instanceId: String, interfaceName: String, operationName: String, key: String, value: String) case class ExecutionEntity(id: String, workflowId: String, startTime: Timestamp, endTime: Option[Timestamp], error: Option[String], status: String) case class ExecutionInputEntity(executionId: String, key: String, value: String) case class RelationshipEntity(sourceId: String, targetId: String, relationshipType: String) case class RelationshipInstanceEntity(sourceInstanceId: String, targetInstanceId: String, sourceNodeId: String, targetNodeId: String, relationshipType: String, state: String) case class RelationshipAttributeEntity(sourceInstanceId: String, targetInstanceId: String, relationshipType: String, key: String, value: String) case class RelationshipOperationEntity(sourceInstanceId: String, targetInstanceId: String, relationshipType: String, interfaceName: String, operationName: String) case class RelationshipOperationOutputEntity(sourceInstanceId: String, targetInstanceId: String, relationshipType: String, interfaceName: String, operationName: String, key: String, value: String)
vuminhkh/tosca-runtime
deployer/app/models/Models.scala
Scala
mit
2,119
# -*- encoding: utf-8 -*- module XenAPI module Network def network_name_label(name_label) self.network.get_by_name_label(name_label) end end end
locaweb/xenapi-ruby
lib/xenapi/network.rb
Ruby
mit
163
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <a href="" onmouseover="facebook()">Facebook</a> <br> <a href="" onmouseover="google()">goggle</a> <br> <a href="" onmouseover="twitter()">twitter</a> <!--<div id="imgs"></div>--> <br> <img id="imgs" src="f.png"> <script type="text/javascript"> var imagen=document.getElementById("imgs"); function facebook(){ imagen.src="f.png"; } function google(){ imagen.src="g.jpg" } function twitter(){ imagen.src="t.jpg" } /* function facebook(){ imagen.innerHTML="<img src='f.png'>"; } function google(){ imagen.innerHTML="<img src='g.jpg'>" } function twitter(){ imagen.innerHTML="<img src='t.jpg'>" } */ </script> </body> </html>
david995/phpprojects
Ejercicios/javascript/img/onmousehover.html
HTML
mit
823
package view.menuBar.workspace; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import javax.swing.JOptionPane; import view.Constants; import view.ViewController; /** * Class that reads in workspace preference files * * @author Lalita Maraj * @author Susan Zhang * */ public class WorkSpacePreferenceReader { private ViewController myController; public WorkSpacePreferenceReader (ViewController controller) { myController = controller; } public void loadPreferences (File prefFile) throws IOException { BufferedReader br = new BufferedReader(new FileReader(prefFile)); String sCurrentLine = br.readLine(); if (!sCurrentLine.equals("preferences")) { JOptionPane.showMessageDialog(null, Constants.WRONG_PREF_FILE_MESSAGE); } while ((sCurrentLine = br.readLine()) != null) { String[] s = sCurrentLine.split(" "); if (s[0].equals(Constants.BACKGROUND_KEYWORD) && s.length == Constants.COLOR_LINE_LENGTH) { myController.setBGColor(Integer.parseInt(s[1])); setPalette(s[1], s[2], s[3], s[4]); } if (s[0].equals(Constants.PEN_KEYWORD) && s.length == Constants.COLOR_LINE_LENGTH) { myController.setPenColor(Integer.parseInt(s[1])); setPalette(s[1], s[2], s[3], s[4]); } if (s[0].equals(Constants.IMAGE_KEYWORD) && s[1] != null) { myController.changeImage(Integer.parseInt(s[1])); } } br.close(); } private void setPalette(String index, String r, String g, String b){ myController.setPalette(Integer.parseInt(index), Integer.parseInt(r), Integer.parseInt(g), Integer.parseInt(b)); } }
chinnychin19/CS308_Proj3
src/view/menuBar/workspace/WorkSpacePreferenceReader.java
Java
mit
1,836
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package erp.cfd; import java.io.Serializable; /** * * @author Juan Barajas */ public final class SCfdiSignature implements Serializable { private String msUuid; private String msFechaTimbrado; private String msSelloCFD; private String msNoCertificadoSAT; private String msSelloSAT; private String msRfcEmisor; private String msRfcReceptor; private double mdTotalCy; public SCfdiSignature() { msUuid = ""; msFechaTimbrado = ""; msSelloCFD = ""; msNoCertificadoSAT = ""; msSelloSAT = ""; msRfcEmisor = ""; msRfcReceptor = ""; mdTotalCy = 0; } public void setUuid(String s) { msUuid = s; } public void setFechaTimbrado(String s) { msFechaTimbrado = s; } public void setSelloCFD(String s) { msSelloCFD = s; } public void setNoCertificadoSAT(String s) { msNoCertificadoSAT = s; } public void setSelloSAT(String s) { msSelloSAT = s; } public void setRfcEmisor(String s) { msRfcEmisor = s; } public void setRfcReceptor(String s) { msRfcReceptor = s; } public void setTotalCy(double d) { mdTotalCy = d; } public String getUuid() { return msUuid; } public String getFechaTimbrado() { return msFechaTimbrado; } public String getSelloCFD() { return msSelloCFD; } public String getNoCertificadoSAT() { return msNoCertificadoSAT; } public String getSelloSAT() { return msSelloSAT; } public String getRfcEmisor() { return msRfcEmisor; } public String getRfcReceptor() { return msRfcReceptor; } public double getTotalCy() { return mdTotalCy; } }
swaplicado/siie32
src/erp/cfd/SCfdiSignature.java
Java
mit
1,709
--- layout: post lang: fr title: "Châle White Bird" date: 2018-02-25 17:00:00 categories: ['crochet', 'création'] comments: true meta_description: "Un châle tout blanc au crochet avec explications gratuites" asset_path: 'white-bird' tags: - 'crochet' - 'chale' - 'shawl' - 'creation' - 'NorskFine' - 'blanc' - 'Whitebird' support: - jquery - gallery --- Bonjour à tous et toutes! Je vous présente aujourd'hui la dernière création du Crochet d'Argent: le châle **White Bird**! Un très beau châle tout blanc, réalisé en *Norsk Fine*, un fil en alpaga et laine très doux et bien chaud, à porter par ce grand froid! Bien grand avec ses dimensions généreuses, il saura vous envelopper de chaleur pour un thé au coin du feu ou une balade hivernale! Voici donc les explications: Vous aurez besoin de : * 3 pelotes de *Norsk Fine*, coloris blanc-cassé que vous pouvez trouver [chez Les Petites Pelotes de Rosalie](https://lespetitespelotesderosalie.boutiquedelaine.com/fnt2-51587) * Crochet 3,5mm Taille finale: * 183x88cm {% include gallery-layout.html gallery=site.data.galleries.white-bird id_number=1 %} ## Abréviations * ma = maille en l'air * ms = maille serrée * dbr = demi-bride * br = bride * Dbr = Double-bride * Trbr = Triple bride * Double bride croisée: passer trois mailles, faire une triple bride dans la quatrième maille, deux mailles en l'air, faire une triple bride dans la première maille en passant derrière la première triple bride. ## Explications **Rg1**: dans un rond magique, faire 3ma, 2br, 3ma, 3 brides. Tourner **Rg2**: 3ma/2br dans la première m, 1 br dans chaque br, 2br/2ma/2br dans les 2ma centrales, 1br sur chaque br du rg précédent, 3 br dans la dernière m. **Rg3**: 3ma/2br dans la première m, 1 br dans chaque br, 1ma/1br/2ma/1br/1ma dans les 2ma centrales, 1br dans chaque br du rg préc., 3br dans la dernière br **Rg4**: 3ma/2br dans la première m, 1 br dans chaque br, 2br/2ma/2br dans les 2ma centrales, 1br sur chaque br du rg précédent, 3 br dans la dernière m. **Rangs 5 à 22**: Répéter les rangs 3 et 4 encore 10 fois. ## Motif principal Il est composé de 6 rangs ainsi: **Rg 23**: 3ma, 2 br dans la même m, \*passer 2m, 1br/1ma/1br dans la m. suivante\*, 3ma au-dessus de la pointe, \*1br/1ma/1br dans la m. suivante, passer 2 m\*, 3 br dans la dernière ma du rg précédent **Rg24**: 3ma/2br dans la 1ère maille, \*2ma, 2 br écoulées ensemble sur les 2 br du rg précédent\*, 2ma/1br/2ma/1br/2ma dans les 3 ma de la pointe du rg précédent, \*2 br écoulées ensemble sur les 2 br du rg précédent, 2ma\*, 3 br dans la dernière ma du rg précédent **Rg25**: 3ma/2br dans la 1ère bride, 1br/1ma/1br dans la 3ème br du rg précédent, \*passer 2m, 1br/1ma/1br dans la m. suivante\*, 1br/1ma/1br sur la dernière bride avant la pointe, 3ma au-dessus de la pointe, 1br/1ma/1br sur la première bride après la pointe, \*passer 2m, 1br/1ma/1br dans la m. suivante\*, 3 br dans la dernière ma du rg précédent **Rg26**: 3ma/2br dans la 1ère maille, \*2ma, 2 br écoulées ensemble sur les 2 br du rg précédent\*, 2ma/1br/2ma/1br/2ma dans les 3 ma de la pointe du rg précédent, \*2 br écoulées ensemble sur les 2 br du rg précédent, 2ma\*, 3 br dans la dernière ma du rg précédent **Rg27**: 3ma/2 br dans la 1ère bride, 1br/1ma/1br dans la 3ème br du rg précédent, \*passer 2m, 1br/1ma/1br dans la m. suivante\*, 1br/1ma/1br sur la dernière bride avant la pointe, 3ma au-dessus de la pointe, 1br/1ma/1br sur la première bride après la pointe, \*passer 2m, 1br/1ma/1br dans la m. suivante\*, 3 br dans la dernière ma du rg précédent **Rg28**: 3ma/2br dans la 1ère maille, \*2ma, 2 br écoulées ensemble sur les 2 br du rg précédent\*, 2ma/1br/2ma/1br/2ma dans les 3 ma de la pointe du rg précédent, \*2 br écoulées ensemble sur les 2 br du rg précédent, 2ma\*, 3 br dans la dernière ma du rg précédent. - **Rg29**: 3ma/2br sur la première m, 1br sur chaque br, 2br/2ma/2br dans l'arceau central, 1 br sur chaque br du rg préc., 3br sur la dernière br **Rangs 30 à 35**: répéter le motif principal **Rg36**: répéter le rang 29 **Rangs 37 à 42**: répéter le motif principal **Rangs 43 et 44**: répéter les rangs 2 et 3 **Rg46**: 3ma, 2 br dans la même m, \*passer 2m, 1br/1ma/1br dans la m. suivante\*, 3ma au-dessus de la pointe, \*1br/1ma/1br dans la m. suivante, passer 2 m\*, 3 br dans la dernière ma du rg précédent **Rangs 47 et 48**: répéter les rangs 2 et 3 **Rangs 49 à 69**: répéter les rangs 23 à 43 ## Bordure **Rg1**: 4ma/2Dbrides dans la 1ère m, \*passer 3m, 1trbr dans la 4ème maille suivante, 3ma, 1trbr croisée dans la 3ème m précédentei\* (=1 croix), une "croix" de part et d'autre de la po inte, \*passer 3m, 1trbr dans la 4ème maille, 2ma, 1trbr croisée dans la 3ème m précédente\*, 3Dbr dans 3ème ma du rg préc. **Rg2**: 1ma, 1ms dans chaque Dbr, \*1ms dans la 1ère trbr, 3ms autour des 3ma du rg préc, 1ms dans la trbr suivante, 1ms entre les 2 tr br\*, répéter jusqu'à la fin du rang, 1ms dans chaque Dbr pour terminer. Piquer maintenant toujours les tr br dans les ms se trouvant entre les 2 trbr du pénultième rang. **Rg3**: 4ma/2Dbr dans la 1ère m, passer 3m, 1trbr dans la ms qui se trouve entre les 2trbr du rg 1 suivante, 3ma, 1trbr croisée dans la 1ère m (celle où sont les 3 premières Dbr), \*passer 3m, 1trbr dans la 4ème ms suivante, 3ma, 1trbr croisée dans la 3ème ms précédente\*, (pointe: 1Dbr/2ma/1Dbr dans la ms du milieu du rg précédent), \*passer 3m, 1trbr dans la 4ème ms suivante, 3ma, 1trbr croisée dans la 3ème ms précédente\*, terminer par 3 Dbr sur la dernière m. **Rg4**: 1ma, 1ms dans chaque Dbr, \*1ms dans la 1ère trbr, 3ms autour des 3ma du rg préc, 1ms dans la trbr suivante, 1ms entre les 2 tr br\*, répéter jusqu'à la fin du rang, (faire 3ms dans l'arceau de 2 sur la pointe), 1ms dans chaque Dbr pour terminer. **Rg5**: 4ma/2Dbr dans la 1ère m, passer 3m, 1trbr dans la ms qui se trouve entre les 2trbr du rg 3 suivante, 3ma, 1trbr croisée dans la 1ère m (celle où sont les 3 premières Dbr), \*passer 3m, 1trbr dans la 4ème ms suivante, 3ma, 1trbr croisée dans la 3ème ms précédente\*, (pointe: 1Dbr/4ma/1Dbr dans la ms du milieu du rg précédent), \*passer 3m, 1trbr dans la 4ème ms suivante, 3ma, 1trbr croisée dans la 3ème ms précédente\*, terminer par 3 Dbr sur la dernière m. **Rg6**: 1ma, 1ms dans chaque Dbr, \*1ms dans la 1ère trbr, 3ms autour des 3ma du rg préc, 1ms dans la trbr suivante, 1ms entre les 2 tr br\*, répéter jusqu'à la fin du rang, (faire 5ms dans l'arceau de 4 sur la pointe), 1ms dans chaque Dbr pour terminer. **Rg7**: 4ma/2Dbr dans la 1ère m, passer 3m, 1trbr dans la ms qui se trouve entre les 2trbr du rg 3 suivante, 3ma, 1trbr croisée dans la 1ère m (celle où sont les 3 premières Dbr), \*passer 3m, 1trbr dans la 4ème ms suivante, 3ma, 1trbr croisée dans la 3ème ms précédente\*, (pointe: 2 trbr croisées, la première sur la 3ème ms de la pointe et la ms inter-trbr du rg précédent, la seconde sur la 3ème ms de la pointe et la ms inter-trbr du rg précédent), \*passer 3m, 1trbr dans la 4ème ms suivante, 3ma, 1trbr croisée dans la 3ème ms précédente\*, terminer par 3 Dbr sur la dernière m. **Rang de finition**: 3ma/2br dans la 1ère m, 1br sur chaque Dbr du rg précédent, \*1ms entre les 2 trbr du rg précédent, 1dbr/1br/1ma/1br/1dbr dans l'espace de 3ms\*, répéter jusqu'à la pointe (pointe: 1dbr/2br/2Dbr dans le dernier arceau avant la pointe, 1trbr entre les trbr croisées du rg précédent, 2Dbr/2br/1dbr dans l'arceau suivant), \*1ms entre les 2 trbr du rg précédent, 1dbr/1br/1ma/1br/1dbr dans l'espace de 3ms\*, 1 br dans chaque Dbr du rg précédent, 3br dans la dernière maille. Rentrer les fils, bloquer le châle! Vous avez terminé, vous êtes prêt(e) à vous envoler! ## Diagrammes {% include gallery-layout.html gallery=site.data.galleries.white-bird-pattern-fr id_number=2 %} [Diagrammes au format pattern]({{ site.url }}/assets/patterns/white-bird/white-bird.zip) Une très bonne journée/soirée et un bon crochet! Hélène
david-barbion/lcda
_posts/2018-02-25-white-bird.markdown
Markdown
mit
8,271
import traverse from "../lib"; import assert from "assert"; import { parse } from "babylon"; import * as t from "babel-types"; function getPath(code) { const ast = parse(code, { plugins: ["flow", "asyncGenerators"] }); let path; traverse(ast, { Program: function (_path) { path = _path; _path.stop(); }, }); return path; } describe("inference", function () { describe("baseTypeStrictlyMatches", function () { it("it should work with null", function () { const path = getPath("var x = null; x === null").get("body")[1].get("expression"); const left = path.get("left"); const right = path.get("right"); const strictMatch = left.baseTypeStrictlyMatches(right); assert.ok(strictMatch, "null should be equal to null"); }); it("it should work with numbers", function () { const path = getPath("var x = 1; x === 2").get("body")[1].get("expression"); const left = path.get("left"); const right = path.get("right"); const strictMatch = left.baseTypeStrictlyMatches(right); assert.ok(strictMatch, "number should be equal to number"); }); it("it should bail when type changes", function () { const path = getPath("var x = 1; if (foo) x = null;else x = 3; x === 2") .get("body")[2].get("expression"); const left = path.get("left"); const right = path.get("right"); const strictMatch = left.baseTypeStrictlyMatches(right); assert.ok(!strictMatch, "type might change in if statement"); }); it("it should differentiate between null and undefined", function () { const path = getPath("var x; x === null").get("body")[1].get("expression"); const left = path.get("left"); const right = path.get("right"); const strictMatch = left.baseTypeStrictlyMatches(right); assert.ok(!strictMatch, "null should not match undefined"); }); }); describe("getTypeAnnotation", function () { it("should infer from type cast", function () { const path = getPath("(x: number)").get("body")[0].get("expression"); assert.ok(t.isNumberTypeAnnotation(path.getTypeAnnotation()), "should be number"); }); it("should infer string from template literal", function () { const path = getPath("`hey`").get("body")[0].get("expression"); assert.ok(t.isStringTypeAnnotation(path.getTypeAnnotation()), "should be string"); }); it("should infer number from +x", function () { const path = getPath("+x").get("body")[0].get("expression"); assert.ok(t.isNumberTypeAnnotation(path.getTypeAnnotation()), "should be number"); }); it("should infer T from new T", function () { const path = getPath("new T").get("body")[0].get("expression"); const type = path.getTypeAnnotation(); assert.ok(t.isGenericTypeAnnotation(type) && type.id.name === "T", "should be T"); }); it("should infer number from ++x", function () { const path = getPath("++x").get("body")[0].get("expression"); assert.ok(t.isNumberTypeAnnotation(path.getTypeAnnotation()), "should be number"); }); it("should infer number from --x", function () { const path = getPath("--x").get("body")[0].get("expression"); assert.ok(t.isNumberTypeAnnotation(path.getTypeAnnotation()), "should be number"); }); it("should infer void from void x", function () { const path = getPath("void x").get("body")[0].get("expression"); assert.ok(t.isVoidTypeAnnotation(path.getTypeAnnotation()), "should be void"); }); it("should infer string from typeof x", function () { const path = getPath("typeof x").get("body")[0].get("expression"); assert.ok(t.isStringTypeAnnotation(path.getTypeAnnotation()), "should be string"); }); it("should infer boolean from !x", function () { const path = getPath("!x").get("body")[0].get("expression"); assert.ok(t.isBooleanTypeAnnotation(path.getTypeAnnotation()), "should be boolean"); }); it("should infer type of sequence expression", function () { const path = getPath("a,1").get("body")[0].get("expression"); assert.ok(t.isNumberTypeAnnotation(path.getTypeAnnotation()), "should be number"); }); it("should infer type of logical expression", function () { const path = getPath("'a' && 1").get("body")[0].get("expression"); const type = path.getTypeAnnotation(); assert.ok(t.isUnionTypeAnnotation(type), "should be a union"); assert.ok(t.isStringTypeAnnotation(type.types[0]), "first type in union should be string"); assert.ok(t.isNumberTypeAnnotation(type.types[1]), "second type in union should be number"); }); it("should infer type of conditional expression", function () { const path = getPath("q ? true : 0").get("body")[0].get("expression"); const type = path.getTypeAnnotation(); assert.ok(t.isUnionTypeAnnotation(type), "should be a union"); assert.ok(t.isBooleanTypeAnnotation(type.types[0]), "first type in union should be boolean"); assert.ok(t.isNumberTypeAnnotation(type.types[1]), "second type in union should be number"); }); it("should infer RegExp from RegExp literal", function () { const path = getPath("/.+/").get("body")[0].get("expression"); const type = path.getTypeAnnotation(); assert.ok(t.isGenericTypeAnnotation(type) && type.id.name === "RegExp", "should be RegExp"); }); it("should infer Object from object expression", function () { const path = getPath("({ a: 5 })").get("body")[0].get("expression"); const type = path.getTypeAnnotation(); assert.ok(t.isGenericTypeAnnotation(type) && type.id.name === "Object", "should be Object"); }); it("should infer Array from array expression", function () { const path = getPath("[ 5 ]").get("body")[0].get("expression"); const type = path.getTypeAnnotation(); assert.ok(t.isGenericTypeAnnotation(type) && type.id.name === "Array", "should be Array"); }); it("should infer Function from function", function () { const path = getPath("(function (): string {})").get("body")[0].get("expression"); const type = path.getTypeAnnotation(); assert.ok(t.isGenericTypeAnnotation(type) && type.id.name === "Function", "should be Function"); }); it("should infer call return type using function", function () { const path = getPath("(function (): string {})()").get("body")[0].get("expression"); const type = path.getTypeAnnotation(); assert.ok(t.isStringTypeAnnotation(type), "should be string"); }); it("should infer call return type using async function", function () { const path = getPath("(async function (): string {})()").get("body")[0].get("expression"); const type = path.getTypeAnnotation(); assert.ok(t.isGenericTypeAnnotation(type) && type.id.name === "Promise", "should be Promise"); }); it("should infer call return type using async generator function", function () { const path = getPath("(async function * (): string {})()").get("body")[0].get("expression"); const type = path.getTypeAnnotation(); assert.ok(t.isGenericTypeAnnotation(type) && type.id.name === "AsyncIterator", "should be AsyncIterator"); }); it("should infer number from x/y", function () { const path = getPath("x/y").get("body")[0].get("expression"); const type = path.getTypeAnnotation(); assert.ok(t.isNumberTypeAnnotation(type), "should be number"); }); it("should infer boolean from x instanceof y", function () { const path = getPath("x instanceof y").get("body")[0].get("expression"); const type = path.getTypeAnnotation(); assert.ok(t.isBooleanTypeAnnotation(type), "should be boolean"); }); it("should infer number from 1 + 2", function () { const path = getPath("1 + 2").get("body")[0].get("expression"); const type = path.getTypeAnnotation(); assert.ok(t.isNumberTypeAnnotation(type), "should be number"); }); it("should infer string|number from x + y", function () { const path = getPath("x + y").get("body")[0].get("expression"); const type = path.getTypeAnnotation(); assert.ok(t.isUnionTypeAnnotation(type), "should be a union"); assert.ok(t.isStringTypeAnnotation(type.types[0]), "first type in union should be string"); assert.ok(t.isNumberTypeAnnotation(type.types[1]), "second type in union should be number"); }); it("should infer type of tagged template literal", function () { const path = getPath("(function (): RegExp {}) `hey`").get("body")[0].get("expression"); const type = path.getTypeAnnotation(); assert.ok(t.isGenericTypeAnnotation(type) && type.id.name === "RegExp", "should be RegExp"); }); }); });
STRML/babel
packages/babel-traverse/test/inference.js
JavaScript
mit
8,822
# Open Translators to Things Sample App - Android Sample apps built to Android for Lamp, Shades and Temperature sensors. This README will help get you started running the sample apps. ## Install Tools Get your dev environment set up: * install your Android/Java IDE ## Get the Source Next, clone this repo to your local machine to get started. Navigate to the directory with the app you want to explore and launch the visual studio solution file ##Get started Check our [website] (http://www.opentranslatorstothings.org) for a more complete guide how to start running Open Translator to Things. ###Lamp This sample connects to the org.OpenT2T.Sample.SuperPopular.Lamp schema. This sample interfaces with Lamp devices. User can use switch button to turn the lamp On/off and the slider to set Brightness. ###Shades This sample connects to the org.OpenT2T.Sample.SuperPopular.Shade This sample interacts with shades which can be opened or closed through UI ###Temperature This sample connects to the org.OpenT2T.Sample.SuperPopular.TemperatureSensor User can get the temperature with clicking Refresh in UI ## Create a Pull Request Made any changes we should consider? Send us a pull request! Check out [this article](https://help.github.com/articles/creating-a-pull-request/) on how to get started.
openT2T/sampleapps
android/README.md
Markdown
mit
1,322
var Chartist = require('chartist'); module.exports = makePluginInstance; makePluginInstance.calculateScaleFactor = calculateScaleFactor; makePluginInstance.scaleValue = scaleValue; function makePluginInstance(userOptions) { var defaultOptions = { dot: { min: 8, max: 10, unit: 'px' }, line: { min: 2, max: 4, unit: 'px' }, svgWidth: { min: 360, max: 1000 } }; var options = Chartist.extend({}, defaultOptions, userOptions); return function scaleLinesAndDotsInstance(chart) { var actualSvgWidth; chart.on('draw', function(data) { if (data.type === 'point') { setStrokeWidth(data, options.dot, options.svgWidth); } else if (data.type === 'line') { setStrokeWidth(data, options.line, options.svgWidth); } }); /** * Set stroke-width of the element of a 'data' object, based on chart width. * * @param {Object} data - Object passed to 'draw' event listener * @param {Object} widthRange - Specifies min/max stroke-width and unit. * @param {Object} thresholds - Specifies chart width to base scaling on. */ function setStrokeWidth(data, widthRange, thresholds) { var scaleFactor = calculateScaleFactor(thresholds.min, thresholds.max, getActualSvgWidth(data)); var strokeWidth = scaleValue(widthRange.min, widthRange.max, scaleFactor); data.element.attr({ style: 'stroke-width: ' + strokeWidth + widthRange.unit }); } /** * @param {Object} data - Object passed to 'draw' event listener */ function getActualSvgWidth(data) { return data.element.root().width(); } }; } function calculateScaleFactor(min, max, value) { if (max <= min) { throw new Error('max must be > min'); } var delta = max - min; var scaleFactor = (value - min) / delta; scaleFactor = Math.min(scaleFactor, 1); scaleFactor = Math.max(scaleFactor, 0); return scaleFactor; } function scaleValue(min, max, scaleFactor) { if (scaleFactor > 1) throw new Error('scaleFactor cannot be > 1'); if (scaleFactor < 0) throw new Error('scaleFactor cannot be < 0'); if (max < min) throw new Error('max cannot be < min'); var delta = max - min; return (delta * scaleFactor) + min; }
psalaets/chartist-plugin-scale-lines-and-dots
index.js
JavaScript
mit
2,292
/* * This file is part of Sponge, licensed under the MIT License (MIT). * * Copyright (c) SpongePowered <https://www.spongepowered.org> * Copyright (c) contributors * * 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 org.spongepowered.common.entity.ai.goal; import org.spongepowered.api.entity.ai.goal.Goal; import org.spongepowered.api.entity.ai.goal.GoalType; import org.spongepowered.api.entity.living.Agent; public final class SpongeGoalType implements GoalType { private final Class<? extends Goal<? extends Agent>> goalClass; public SpongeGoalType(final Class<? extends Goal<? extends Agent>> goalClass) { this.goalClass = goalClass; } @Override public Class<? extends Goal<?>> goalClass() { return this.goalClass; } }
SpongePowered/Sponge
src/main/java/org/spongepowered/common/entity/ai/goal/SpongeGoalType.java
Java
mit
1,809
#pragma once #include <type_traits> namespace funcpp::typeclass::eq { template <typename T> struct eq_class<T, std::enable_if_t<std::is_scalar<T>::value>> : std::true_type { static bool equal(T const& a, T const& b) { return a == b; } }; }
julian-becker/funcpp
modules/typeclass/include/typeclass/eq/scalar.h
C
mit
260
<!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> Fleetwood Waste Systems Ltd - 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=1492286193386&V_SEARCH.docsCount=3&V_DOCUMENT.docRank=17817&V_SEARCH.docsStart=17816&V_SEARCH.command=navigate&V_SEARCH.resultsJSP=/prfl.do&lang=fra&redirectUrl=/app/scr/imbs/ccc/rgstrtn/wp-admin/admin-ajax.php?_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=17815&amp;V_DOCUMENT.docRank=17816&amp;V_SEARCH.docsCount=3&amp;lang=eng&amp;prtl=1&amp;sbPrtl=&amp;profile=cmpltPrfl&amp;V_TOKEN=1492286219118&amp;V_SEARCH.command=navigate&amp;V_SEARCH.resultsJSP=%2fprfl.do&amp;estblmntNo=234567164956&amp;profileId=&amp;key.newSearchLabel=">Previous Company</a></li> <li>|&nbsp;<a href="nvgt.do?V_SEARCH.docsStart=17817&amp;V_DOCUMENT.docRank=17818&amp;V_SEARCH.docsCount=3&amp;lang=eng&amp;prtl=1&amp;sbPrtl=&amp;profile=cmpltPrfl&amp;V_TOKEN=1492286219118&amp;V_SEARCH.command=navigate&amp;V_SEARCH.resultsJSP=%2fprfl.do&amp;estblmntNo=234567040703&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> Fleetwood Waste Systems Ltd </h2> <div class="row"> <div class="col-md-5"> <h2 class="h5 mrgn-bttm-0">Legal/Operating Name:</h2> <p>Fleetwood Waste Systems Ltd</p> <div class="mrgn-tp-md"></div> <p class="mrgn-bttm-0" ><a href="http://www.fleetwoodwaste.com" target="_blank" title="Website URL">http://www.fleetwoodwaste.com</a></p> <p><a href="mailto:info@fleetwoodwaste.com" title="info@fleetwoodwaste.com">info@fleetwoodwaste.com</a></p> </div> <div class="col-md-4 mrgn-sm-sm"> <h2 class="h5 mrgn-bttm-0">Mailing Address:</h2> <address class="mrgn-bttm-md"> 659, 53rd Ave E<br/> VANCOUVER, British Columbia<br/> V5X 1J4 <br/> </address> <h2 class="h5 mrgn-bttm-0">Location Address:</h2> <address class="mrgn-bttm-md"> 127-11568 Eburne Way<br/> RICHMOND, British Columbia<br/> V6V 0A7 <br/> </address> <p class="mrgn-bttm-0"><abbr title="Telephone">Tel.</abbr>: (604) 294-1393 </p> <p class="mrgn-bttm-lg"><abbr title="Facsimile">Fax</abbr>: (604) 294-1115</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"> <h2 class="wb-inv">Company Profile</h2> <br> SAME DAY SERVICE <br>Providing friendly and reliable garbage disposal and bin rental service at competitive rate since 1971 <br> <br>8 to 40 yard containers for <br>• Commercial <br>• Residential <br>• Industrial <br>We are proud to serve the following service areas listed below: <br>• Vancouver <br>• Burnaby <br>• Richmond <br>• Surrey <br>• Delta <br>• New Westminster <br>• Port Moody <br>• North Vancouver <br>• Maple Ridge <br>• West Vancouver <br>• Coquitlam <br>• Port Coquitlam <br><br> </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> Lukhvir Sandhu </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--> Vice President </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Area of Responsibility: </strong> </div> <div class="col-md-7"> Management Executive. </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (604) 294-1393 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> info@fleetwoodwaste.com </div> </div> </section> <p class="mrgn-tp-lg text-right small hidden-print"> <a href="#wb-cont">top of page</a> </p> <!-- Company Description --> <h3 class="page-header"> Company description </h3> <section class="container-fluid"> <div class="row"> <div class="col-md-5"> <strong> 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"> 562110 - Waste Collection </div> </div> <div class="row"> <div class="col-md-5"> <strong> Alternate Industries (NAICS): </strong> </div> <div class="col-md-7"> 532410 - Construction, Transportation, Mining, and Forestry Machinery and Equipment Rental and Leasing<br> 562210 - Waste Treatment and Disposal<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> </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> Service Name: </strong> </div> <div class="col-md-9"> Garbage disposal and bin rental<br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-12"> Providing friendly and reliable garbage disposal and bin rental service at competitive rate since 1971 <br> <br> 8 to 40 yard containers for <br> • Commercial <br> • Residential <br> • Industrial <br> We are proud to serve the following service areas listed below: <br> • Vancouver <br> • Burnaby <br> • Richmond <br> • Surrey <br> • Delta <br> • New Westminster <br> • Port Moody <br> • North Vancouver <br> • Maple Ridge <br> • West Vancouver <br> • Coquitlam <br> • Port Coquitlam <br> <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> Lukhvir Sandhu </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--> Vice President </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Area of Responsibility: </strong> </div> <div class="col-md-7"> Management Executive. </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (604) 294-1393 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> info@fleetwoodwaste.com </div> </div> </section> </details> <details id="details-panel3"> <summary> Description </summary> <h2 class="wb-invisible"> Company description </h2> <section class="container-fluid"> <div class="row"> <div class="col-md-5"> <strong> 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"> 562110 - Waste Collection </div> </div> <div class="row"> <div class="col-md-5"> <strong> Alternate Industries (NAICS): </strong> </div> <div class="col-md-7"> 532410 - Construction, Transportation, Mining, and Forestry Machinery and Equipment Rental and Leasing<br> 562210 - Waste Treatment and Disposal<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> </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> Service Name: </strong> </div> <div class="col-md-9"> Garbage disposal and bin rental<br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-12"> Providing friendly and reliable garbage disposal and bin rental service at competitive rate since 1971 <br> <br> 8 to 40 yard containers for <br> • Commercial <br> • Residential <br> • Industrial <br> We are proud to serve the following service areas listed below: <br> • Vancouver <br> • Burnaby <br> • Richmond <br> • Surrey <br> • Delta <br> • New Westminster <br> • Port Moody <br> • North Vancouver <br> • Maple Ridge <br> • West Vancouver <br> • Coquitlam <br> • Port Coquitlam <br> <br> <br> </div> </div> </section> </details> </div> </div> <div class="row"> <div class="col-md-12 text-right"> Last Update Date 2015-07-20 </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/234567133020.html
HTML
mit
35,741
exports.BattleStatuses = { brn: { effectType: 'Status', onStart: function (target, source, sourceEffect) { if (sourceEffect && sourceEffect.id === 'flameorb') { this.add('-status', target, 'brn', '[from] item: Flame Orb'); return; } this.add('-status', target, 'brn'); }, onBasePower: function (basePower, attacker, defender, move) { if (move && move.category === 'Physical' && attacker && attacker.ability !== 'guts' && move.id !== 'facade') { return this.chainModify(0.5); // This should really take place directly in the damage function but it's here for now } }, onResidualOrder: 9, onResidual: function (pokemon) { this.damage(pokemon.maxhp / 8); } }, par: { effectType: 'Status', onStart: function (target) { this.add('-status', target, 'par'); }, onModifySpe: function (speMod, pokemon) { if (pokemon.ability !== 'quickfeet') { return this.chain(speMod, 0.25); } }, onBeforeMovePriority: 2, onBeforeMove: function (pokemon) { if (this.random(4) === 0) { this.add('cant', pokemon, 'par'); return false; } } }, slp: { effectType: 'Status', onStart: function (target) { this.add('-status', target, 'slp'); // 1-3 turns this.effectData.startTime = this.random(2, 5); this.effectData.time = this.effectData.startTime; }, onBeforeMovePriority: 2, onBeforeMove: function (pokemon, target, move) { if (pokemon.getAbility().isHalfSleep) { pokemon.statusData.time--; } pokemon.statusData.time--; if (pokemon.statusData.time <= 0) { pokemon.cureStatus(); return; } this.add('cant', pokemon, 'slp'); if (move.sleepUsable) { return; } return false; } }, frz: { effectType: 'Status', onStart: function (target) { this.add('-status', target, 'frz'); if (target.species === 'Shaymin-Sky' && target.baseTemplate.species === target.species) { var template = this.getTemplate('Shaymin'); target.formeChange(template); target.baseTemplate = template; target.setAbility(template.abilities['0']); target.baseAbility = target.ability; target.details = template.species + (target.level === 100 ? '' : ', L' + target.level) + (target.gender === '' ? '' : ', ' + target.gender) + (target.set.shiny ? ', shiny' : ''); this.add('detailschange', target, target.details); this.add('message', target.species + " has reverted to Land Forme! (placeholder)"); } }, onBeforeMovePriority: 2, onBeforeMove: function (pokemon, target, move) { if (move.thawsUser || this.random(5) === 0) { pokemon.cureStatus(); return; } this.add('cant', pokemon, 'frz'); return false; }, onHit: function (target, source, move) { if (move.type === 'Fire' && move.category !== 'Status') { target.cureStatus(); } } }, psn: { effectType: 'Status', onStart: function (target) { this.add('-status', target, 'psn'); }, onResidualOrder: 9, onResidual: function (pokemon) { this.damage(pokemon.maxhp / 8); } }, tox: { effectType: 'Status', onStart: function (target, source, sourceEffect) { this.effectData.stage = 0; if (sourceEffect && sourceEffect.id === 'toxicorb') { this.add('-status', target, 'tox', '[from] item: Toxic Orb'); return; } this.add('-status', target, 'tox'); }, onSwitchIn: function () { this.effectData.stage = 0; }, onResidualOrder: 9, onResidual: function (pokemon) { if (this.effectData.stage < 15) { this.effectData.stage++; } this.damage(this.clampIntRange(pokemon.maxhp / 16, 1) * this.effectData.stage); } }, confusion: { // this is a volatile status onStart: function (target, source, sourceEffect) { var result = this.runEvent('TryConfusion', target, source, sourceEffect); if (!result) return result; this.add('-start', target, 'confusion'); this.effectData.time = this.random(2, 6); }, onEnd: function (target) { this.add('-end', target, 'confusion'); }, onBeforeMove: function (pokemon) { pokemon.volatiles.confusion.time--; if (!pokemon.volatiles.confusion.time) { pokemon.removeVolatile('confusion'); return; } this.add('-activate', pokemon, 'confusion'); if (this.random(2) === 0) { return; } this.directDamage(this.getDamage(pokemon, pokemon, 40)); return false; } }, flinch: { duration: 1, onBeforeMovePriority: 1, onBeforeMove: function (pokemon) { if (!this.runEvent('Flinch', pokemon)) { return; } this.add('cant', pokemon, 'flinch'); return false; } }, trapped: { noCopy: true, onModifyPokemon: function (pokemon) { if (!this.effectData.source || !this.effectData.source.isActive) { delete pokemon.volatiles['trapped']; return; } pokemon.tryTrap(); }, onStart: function (target) { this.add('-activate', target, 'trapped'); } }, partiallytrapped: { duration: 5, durationCallback: function (target, source) { if (source.item === 'gripclaw') return 8; return this.random(5, 7); }, onStart: function (pokemon, source) { this.add('-activate', pokemon, 'move: ' +this.effectData.sourceEffect, '[of] ' + source); }, onResidualOrder: 11, onResidual: function (pokemon) { if (this.effectData.source && (!this.effectData.source.isActive || this.effectData.source.hp <= 0)) { pokemon.removeVolatile('partiallytrapped'); return; } if (this.effectData.source.item === 'bindingband') { this.damage(pokemon.maxhp / 6); } else { this.damage(pokemon.maxhp / 8); } }, onEnd: function (pokemon) { this.add('-end', pokemon, this.effectData.sourceEffect, '[partiallytrapped]'); }, onModifyPokemon: function (pokemon) { pokemon.tryTrap(); } }, lockedmove: { // Outrage, Thrash, Petal Dance... duration: 2, onResidual: function (target) { if (target.status === 'slp') { // don't lock, and bypass confusion for calming delete target.volatiles['lockedmove']; } this.effectData.trueDuration--; }, onStart: function (target, source, effect) { this.effectData.trueDuration = this.random(2, 4); this.effectData.move = effect.id; }, onRestart: function () { if (this.effectData.trueDuration >= 2) { this.effectData.duration = 2; } }, onEnd: function (target) { if (this.effectData.trueDuration > 1) return; this.add('-end', target, 'rampage'); target.addVolatile('confusion'); }, onLockMove: function (pokemon) { return this.effectData.move; } }, twoturnmove: { // Skull Bash, SolarBeam, Sky Drop... duration: 2, onStart: function (target, source, effect) { this.effectData.move = effect.id; // source and target are reversed since the event target is the // pokemon using the two-turn move this.effectData.targetLoc = this.getTargetLoc(source, target); target.addVolatile(effect.id, source); }, onEnd: function (target) { target.removeVolatile(this.effectData.move); }, onLockMove: function () { return this.effectData.move; }, onLockMoveTarget: function () { return this.effectData.targetLoc; } }, choicelock: { onStart: function (pokemon) { this.effectData.move = this.activeMove.id; if (!this.effectData.move) return false; }, onModifyPokemon: function (pokemon) { if (!pokemon.getItem().isChoice || !pokemon.hasMove(this.effectData.move)) { pokemon.removeVolatile('choicelock'); return; } if (pokemon.ignore['Item']) { return; } var moves = pokemon.moveset; for (var i = 0; i < moves.length; i++) { if (moves[i].id !== this.effectData.move) { moves[i].disabled = true; } } } }, mustrecharge: { duration: 2, onBeforeMove: function (pokemon) { this.add('cant', pokemon, 'recharge'); pokemon.removeVolatile('mustrecharge'); return false; }, onLockMove: 'recharge' }, futuremove: { // this is a side condition onStart: function (side) { this.effectData.positions = []; for (var i = 0; i < side.active.length; i++) { this.effectData.positions[i] = null; } }, onResidualOrder: 3, onResidual: function (side) { var finished = true; for (var i = 0; i < side.active.length; i++) { var posData = this.effectData.positions[i]; if (!posData) continue; posData.duration--; if (posData.duration > 0) { finished = false; continue; } // time's up; time to hit! :D var target = side.foe.active[posData.targetPosition]; var move = this.getMove(posData.move); if (target.fainted) { this.add('-hint', '' + move.name + ' did not hit because the target is fainted.'); this.effectData.positions[i] = null; continue; } this.add('-message', '' + move.name + ' hit! (placeholder)'); target.removeVolatile('Protect'); target.removeVolatile('Endure'); if (typeof posData.moveData.affectedByImmunities === 'undefined') { posData.moveData.affectedByImmunities = true; } this.moveHit(target, posData.source, move, posData.moveData); this.effectData.positions[i] = null; } if (finished) { side.removeSideCondition('futuremove'); } } }, stall: { // Protect, Detect, Endure counter duration: 2, counterMax: 256, onStart: function () { this.effectData.counter = 3; }, onStallMove: function () { // this.effectData.counter should never be undefined here. // However, just in case, use 1 if it is undefined. var counter = this.effectData.counter || 1; this.debug("Success chance: " + Math.round(100 / counter) + "%"); return (this.random(counter) === 0); }, onRestart: function () { if (this.effectData.counter < this.effect.counterMax) { this.effectData.counter *= 3; } this.effectData.duration = 2; } }, gem: { duration: 1, affectsFainted: true, onBasePower: function (basePower, user, target, move) { this.debug('Gem Boost'); return this.chainModify([0x14CD, 0x1000]); } }, // weather // weather is implemented here since it's so important to the game raindance: { effectType: 'Weather', duration: 5, durationCallback: function (source, effect) { if (source && source.item === 'damprock') { return 8; } return 5; }, onBasePower: function (basePower, attacker, defender, move) { if (move.type === 'Water') { this.debug('rain water boost'); return this.chainModify(1.5); } if (move.type === 'Fire') { this.debug('rain fire suppress'); return this.chainModify(0.5); } }, onStart: function (battle, source, effect) { if (effect && effect.effectType === 'Ability' && this.gen <= 5) { this.effectData.duration = 0; this.add('-weather', 'RainDance', '[from] ability: ' + effect, '[of] ' + source); } else { this.add('-weather', 'RainDance'); } }, onResidualOrder: 1, onResidual: function () { this.add('-weather', 'RainDance', '[upkeep]'); this.eachEvent('Weather'); }, onEnd: function () { this.add('-weather', 'none'); } }, sunnyday: { effectType: 'Weather', duration: 5, durationCallback: function (source, effect) { if (source && source.item === 'heatrock') { return 8; } return 5; }, onBasePower: function (basePower, attacker, defender, move) { if (move.type === 'Fire') { this.debug('Sunny Day fire boost'); return this.chainModify(1.5); } if (move.type === 'Water') { this.debug('Sunny Day water suppress'); return this.chainModify(0.5); } }, onStart: function (battle, source, effect) { if (effect && effect.effectType === 'Ability' && this.gen <= 5) { this.effectData.duration = 0; this.add('-weather', 'SunnyDay', '[from] ability: ' + effect, '[of] ' + source); } else { this.add('-weather', 'SunnyDay'); } }, onImmunity: function (type) { if (type === 'frz') return false; }, onResidualOrder: 1, onResidual: function () { this.add('-weather', 'SunnyDay', '[upkeep]'); this.eachEvent('Weather'); }, onEnd: function () { this.add('-weather', 'none'); } }, sandstorm: { effectType: 'Weather', duration: 5, durationCallback: function (source, effect) { if (source && source.item === 'smoothrock') { return 8; } return 5; }, // This should be applied directly to the stat before any of the other modifiers are chained // So we give it increased priority. onModifySpDPriority: 10, onModifySpD: function (spd, pokemon) { if (pokemon.hasType('Rock') && this.isWeather('sandstorm')) { return this.modify(spd, 1.5); } }, onStart: function (battle, source, effect) { if (effect && effect.effectType === 'Ability' && this.gen <= 5) { this.effectData.duration = 0; this.add('-weather', 'Sandstorm', '[from] ability: ' + effect, '[of] ' + source); } else { this.add('-weather', 'Sandstorm'); } }, onResidualOrder: 1, onResidual: function () { this.add('-weather', 'Sandstorm', '[upkeep]'); if (this.isWeather('sandstorm')) this.eachEvent('Weather'); }, onWeather: function (target) { this.damage(target.maxhp / 16); }, onEnd: function () { this.add('-weather', 'none'); } }, hail: { effectType: 'Weather', duration: 5, durationCallback: function (source, effect) { if (source && source.item === 'icyrock') { return 8; } return 5; }, onStart: function (battle, source, effect) { if (effect && effect.effectType === 'Ability' && this.gen <= 5) { this.effectData.duration = 0; this.add('-weather', 'Hail', '[from] ability: ' + effect, '[of] ' + source); } else { this.add('-weather', 'Hail'); } }, onResidualOrder: 1, onResidual: function () { this.add('-weather', 'Hail', '[upkeep]'); if (this.isWeather('hail')) this.eachEvent('Weather'); }, onWeather: function (target) { this.damage(target.maxhp / 16); }, onEnd: function () { this.add('-weather', 'none'); } }, arceus: { // Arceus's actual typing is implemented here // Arceus's true typing for all its formes is Normal, and it's only // Multitype that changes its type, but its formes are specified to // be their corresponding type in the Pokedex, so that needs to be // overridden. This is mainly relevant for Hackmons and Balanced // Hackmons. onSwitchInPriority: 101, onSwitchIn: function (pokemon) { var type = 'Normal'; if (pokemon.ability === 'multitype') { type = this.runEvent('Plate', pokemon); if (!type || type === true) { type = 'Normal'; } } pokemon.setType(type, true); } } };
nehoray181/pokemon
data/statuses.js
JavaScript
mit
14,531
package com.example.profbola.bakingtime.provider; import android.database.sqlite.SQLiteDatabase; import com.example.profbola.bakingtime.provider.RecipeContract.IngredientEntry; import static com.example.profbola.bakingtime.utils.RecipeConstants.IngredientDbHelperConstants.INGREDIENT_RECIPE_ID_IDX; /** * Created by prof.BOLA on 6/23/2017. */ public class IngredientDbHelper { // private static final String DATABASE_NAME = "bakingtime.db"; // private static final int DATABASE_VERSION = 1; // public IngredientDbHelper(Context context) { // super(context, DATABASE_NAME, null, DATABASE_VERSION); // } public static void onCreate(SQLiteDatabase db) { final String SQL_CREATE_INGREDIENTS_TABLE = "CREATE TABLE " + IngredientEntry.TABLE_NAME + " ( " + IngredientEntry._ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + IngredientEntry.COLUMN_INGREDIENT + " STRING NOT NULL, " + IngredientEntry.COLUMN_MEASURE + " STRING NOT NULL, " + IngredientEntry.COLUMN_QUANTITY + " REAL NOT NULL, " + IngredientEntry.COLUMN_RECIPE_ID + " INTEGER, " + " FOREIGN KEY ( " + IngredientEntry.COLUMN_RECIPE_ID + " ) REFERENCES " + RecipeContract.RecipeEntry.TABLE_NAME + " ( " + RecipeContract.RecipeEntry.COLUMN_ID + " ) " + " UNIQUE ( " + IngredientEntry.COLUMN_INGREDIENT + " , " + IngredientEntry.COLUMN_RECIPE_ID + " ) ON CONFLICT REPLACE " + ");"; final String SQL_CREATE_INDEX = "CREATE INDEX " + INGREDIENT_RECIPE_ID_IDX + " ON " + IngredientEntry.TABLE_NAME + " ( " + IngredientEntry.COLUMN_RECIPE_ID + " );"; db.execSQL(SQL_CREATE_INGREDIENTS_TABLE); db.execSQL(SQL_CREATE_INDEX); } public static void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { db.execSQL("DROP TABLE IF EXISTS " + IngredientEntry.TABLE_NAME); onCreate(db); } }
Ehbraheem/Baking-Time
app/src/main/java/com/example/profbola/bakingtime/provider/IngredientDbHelper.java
Java
mit
2,247
version https://git-lfs.github.com/spec/v1 oid sha256:5a4f668a21f7ea9a0b8ab69c0e5fec6461ab0f73f7836acd640fe43ea9919fcf size 89408
yogeshsaroya/new-cdnjs
ajax/libs/bacon.js/0.7.46/Bacon.js
JavaScript
mit
130
# jAlgorithms Algorithms and data structures practice
ilyagubarev/jAlgorithms
README.md
Markdown
mit
54
// All material copyright ESRI, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.16/esri/copyright.txt for details. //>>built define({widgetLabel:"\u56fe\u5c42\u5217\u8868",noItemsToDisplay:"\u5f53\u524d\u6ca1\u6709\u8981\u663e\u793a\u7684\u9879\u76ee\u3002",layerInvisibleAtScale:"\u5728\u5f53\u524d\u6bd4\u4f8b\u4e0b\u4e0d\u53ef\u89c1",layerError:"\u52a0\u8f7d\u6b64\u56fe\u5c42\u65f6\u51fa\u9519",untitledLayer:"\u65e0\u6807\u9898\u56fe\u5c42"});
ycabon/presentations
2020-devsummit/arcgis-js-api-road-ahead/js-api/esri/widgets/LayerList/nls/zh-cn/LayerList.js
JavaScript
mit
480
<?php namespace Sydes\L10n\Locales; use Sydes\L10n\Locale; use Sydes\L10n\Plural\Rule1; class EuLocale extends Locale { use Rule1; protected $isoCode = 'eu'; protected $englishName = 'Basque'; protected $nativeName = 'euskara'; protected $isRtl = false; }
sydes/framework
src/L10n/Locales/EuLocale.php
PHP
mit
280
( function( factory ) { if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery" ], factory ); } else { // Browser globals factory( jQuery ); } } ( function( $ ) { $.ui = $.ui || {}; return $.ui.version = "1.12.1"; } ) ); /*! * jQuery UI Widget 1.12.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Widget //>>group: Core //>>description: Provides a factory for creating stateful widgets with a common API. //>>docs: http://api.jqueryui.com/jQuery.widget/ //>>demos: http://jqueryui.com/widget/ ( function( factory ) { if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./version" ], factory ); } else { // Browser globals factory( jQuery ); } }( function( $ ) { var widgetUuid = 0; var widgetSlice = Array.prototype.slice; $.cleanData = ( function( orig ) { return function( elems ) { var events, elem, i; for ( i = 0; ( elem = elems[ i ] ) != null; i++ ) { try { // Only trigger remove when necessary to save time events = $._data( elem, "events" ); if ( events && events.remove ) { $( elem ).triggerHandler( "remove" ); } // Http://bugs.jquery.com/ticket/8235 } catch ( e ) {} } orig( elems ); }; } )( $.cleanData ); $.widget = function( name, base, prototype ) { var existingConstructor, constructor, basePrototype; // ProxiedPrototype allows the provided prototype to remain unmodified // so that it can be used as a mixin for multiple widgets (#8876) var proxiedPrototype = {}; var namespace = name.split( "." )[ 0 ]; name = name.split( "." )[ 1 ]; var fullName = namespace + "-" + name; if ( !prototype ) { prototype = base; base = $.Widget; } if ( $.isArray( prototype ) ) { prototype = $.extend.apply( null, [ {} ].concat( prototype ) ); } // Create selector for plugin $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) { return !!$.data( elem, fullName ); }; $[ namespace ] = $[ namespace ] || {}; existingConstructor = $[ namespace ][ name ]; constructor = $[ namespace ][ name ] = function( options, element ) { // Allow instantiation without "new" keyword if ( !this._createWidget ) { return new constructor( options, element ); } // Allow instantiation without initializing for simple inheritance // must use "new" keyword (the code above always passes args) if ( arguments.length ) { this._createWidget( options, element ); } }; // Extend with the existing constructor to carry over any static properties $.extend( constructor, existingConstructor, { version: prototype.version, // Copy the object used to create the prototype in case we need to // redefine the widget later _proto: $.extend( {}, prototype ), // Track widgets that inherit from this widget in case this widget is // redefined after a widget inherits from it _childConstructors: [] } ); basePrototype = new base(); // We need to make the options hash a property directly on the new instance // otherwise we'll modify the options hash on the prototype that we're // inheriting from basePrototype.options = $.widget.extend( {}, basePrototype.options ); $.each( prototype, function( prop, value ) { if ( !$.isFunction( value ) ) { proxiedPrototype[ prop ] = value; return; } proxiedPrototype[ prop ] = ( function() { function _super() { return base.prototype[ prop ].apply( this, arguments ); } function _superApply( args ) { return base.prototype[ prop ].apply( this, args ); } return function() { var __super = this._super; var __superApply = this._superApply; var returnValue; this._super = _super; this._superApply = _superApply; returnValue = value.apply( this, arguments ); this._super = __super; this._superApply = __superApply; return returnValue; }; } )(); } ); constructor.prototype = $.widget.extend( basePrototype, { // TODO: remove support for widgetEventPrefix // always use the name + a colon as the prefix, e.g., draggable:start // don't prefix for widgets that aren't DOM-based widgetEventPrefix: existingConstructor ? ( basePrototype.widgetEventPrefix || name ) : name }, proxiedPrototype, { constructor: constructor, namespace: namespace, widgetName: name, widgetFullName: fullName } ); // If this widget is being redefined then we need to find all widgets that // are inheriting from it and redefine all of them so that they inherit from // the new version of this widget. We're essentially trying to replace one // level in the prototype chain. if ( existingConstructor ) { $.each( existingConstructor._childConstructors, function( i, child ) { var childPrototype = child.prototype; // Redefine the child widget using the same prototype that was // originally used, but inherit from the new version of the base $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto ); } ); // Remove the list of existing child constructors from the old constructor // so the old child constructors can be garbage collected delete existingConstructor._childConstructors; } else { base._childConstructors.push( constructor ); } $.widget.bridge( name, constructor ); return constructor; }; $.widget.extend = function( target ) { var input = widgetSlice.call( arguments, 1 ); var inputIndex = 0; var inputLength = input.length; var key; var value; for ( ; inputIndex < inputLength; inputIndex++ ) { for ( key in input[ inputIndex ] ) { value = input[ inputIndex ][ key ]; if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) { // Clone objects if ( $.isPlainObject( value ) ) { target[ key ] = $.isPlainObject( target[ key ] ) ? $.widget.extend( {}, target[ key ], value ) : // Don't extend strings, arrays, etc. with objects $.widget.extend( {}, value ); // Copy everything else by reference } else { target[ key ] = value; } } } } return target; }; $.widget.bridge = function( name, object ) { var fullName = object.prototype.widgetFullName || name; $.fn[ name ] = function( options ) { var isMethodCall = typeof options === "string"; var args = widgetSlice.call( arguments, 1 ); var returnValue = this; if ( isMethodCall ) { // If this is an empty collection, we need to have the instance method // return undefined instead of the jQuery instance if ( !this.length && options === "instance" ) { returnValue = undefined; } else { this.each( function() { var methodValue; var instance = $.data( this, fullName ); if ( options === "instance" ) { returnValue = instance; return false; } if ( !instance ) { return $.error( "cannot call methods on " + name + " prior to initialization; " + "attempted to call method '" + options + "'" ); } if ( !$.isFunction( instance[ options ] ) || options.charAt( 0 ) === "_" ) { return $.error( "no such method '" + options + "' for " + name + " widget instance" ); } methodValue = instance[ options ].apply( instance, args ); if ( methodValue !== instance && methodValue !== undefined ) { returnValue = methodValue && methodValue.jquery ? returnValue.pushStack( methodValue.get() ) : methodValue; return false; } } ); } } else { // Allow multiple hashes to be passed on init if ( args.length ) { options = $.widget.extend.apply( null, [ options ].concat( args ) ); } this.each( function() { var instance = $.data( this, fullName ); if ( instance ) { instance.option( options || {} ); if ( instance._init ) { instance._init(); } } else { $.data( this, fullName, new object( options, this ) ); } } ); } return returnValue; }; }; $.Widget = function( /* options, element */ ) {}; $.Widget._childConstructors = []; $.Widget.prototype = { widgetName: "widget", widgetEventPrefix: "", defaultElement: "<div>", options: { classes: {}, disabled: false, // Callbacks create: null }, _createWidget: function( options, element ) { element = $( element || this.defaultElement || this )[ 0 ]; this.element = $( element ); this.uuid = widgetUuid++; this.eventNamespace = "." + this.widgetName + this.uuid; this.bindings = $(); this.hoverable = $(); this.focusable = $(); this.classesElementLookup = {}; if ( element !== this ) { $.data( element, this.widgetFullName, this ); this._on( true, this.element, { remove: function( event ) { if ( event.target === element ) { this.destroy(); } } } ); this.document = $( element.style ? // Element within the document element.ownerDocument : // Element is window or document element.document || element ); this.window = $( this.document[ 0 ].defaultView || this.document[ 0 ].parentWindow ); } this.options = $.widget.extend( {}, this.options, this._getCreateOptions(), options ); this._create(); if ( this.options.disabled ) { this._setOptionDisabled( this.options.disabled ); } this._trigger( "create", null, this._getCreateEventData() ); this._init(); }, _getCreateOptions: function() { return {}; }, _getCreateEventData: $.noop, _create: $.noop, _init: $.noop, destroy: function() { var that = this; this._destroy(); $.each( this.classesElementLookup, function( key, value ) { that._removeClass( value, key ); } ); // We can probably remove the unbind calls in 2.0 // all event bindings should go through this._on() this.element .off( this.eventNamespace ) .removeData( this.widgetFullName ); this.widget() .off( this.eventNamespace ) .removeAttr( "aria-disabled" ); // Clean up events and states this.bindings.off( this.eventNamespace ); }, _destroy: $.noop, widget: function() { return this.element; }, option: function( key, value ) { var options = key; var parts; var curOption; var i; if ( arguments.length === 0 ) { // Don't return a reference to the internal hash return $.widget.extend( {}, this.options ); } if ( typeof key === "string" ) { // Handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } options = {}; parts = key.split( "." ); key = parts.shift(); if ( parts.length ) { curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] ); for ( i = 0; i < parts.length - 1; i++ ) { curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {}; curOption = curOption[ parts[ i ] ]; } key = parts.pop(); if ( arguments.length === 1 ) { return curOption[ key ] === undefined ? null : curOption[ key ]; } curOption[ key ] = value; } else { if ( arguments.length === 1 ) { return this.options[ key ] === undefined ? null : this.options[ key ]; } options[ key ] = value; } } this._setOptions( options ); return this; }, _setOptions: function( options ) { var key; for ( key in options ) { this._setOption( key, options[ key ] ); } return this; }, _setOption: function( key, value ) { if ( key === "classes" ) { this._setOptionClasses( value ); } this.options[ key ] = value; if ( key === "disabled" ) { this._setOptionDisabled( value ); } return this; }, _setOptionClasses: function( value ) { var classKey, elements, currentElements; for ( classKey in value ) { currentElements = this.classesElementLookup[ classKey ]; if ( value[ classKey ] === this.options.classes[ classKey ] || !currentElements || !currentElements.length ) { continue; } // We are doing this to create a new jQuery object because the _removeClass() call // on the next line is going to destroy the reference to the current elements being // tracked. We need to save a copy of this collection so that we can add the new classes // below. elements = $( currentElements.get() ); this._removeClass( currentElements, classKey ); // We don't use _addClass() here, because that uses this.options.classes // for generating the string of classes. We want to use the value passed in from // _setOption(), this is the new value of the classes option which was passed to // _setOption(). We pass this value directly to _classes(). elements.addClass( this._classes( { element: elements, keys: classKey, classes: value, add: true } ) ); } }, _setOptionDisabled: function( value ) { this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null, !!value ); // If the widget is becoming disabled, then nothing is interactive if ( value ) { this._removeClass( this.hoverable, null, "ui-state-hover" ); this._removeClass( this.focusable, null, "ui-state-focus" ); } }, enable: function() { return this._setOptions( { disabled: false } ); }, disable: function() { return this._setOptions( { disabled: true } ); }, _classes: function( options ) { var full = []; var that = this; options = $.extend( { element: this.element, classes: this.options.classes || {} }, options ); function processClassString( classes, checkOption ) { var current, i; for ( i = 0; i < classes.length; i++ ) { current = that.classesElementLookup[ classes[ i ] ] || $(); if ( options.add ) { current = $( $.unique( current.get().concat( options.element.get() ) ) ); } else { current = $( current.not( options.element ).get() ); } that.classesElementLookup[ classes[ i ] ] = current; full.push( classes[ i ] ); if ( checkOption && options.classes[ classes[ i ] ] ) { full.push( options.classes[ classes[ i ] ] ); } } } this._on( options.element, { "remove": "_untrackClassesElement" } ); if ( options.keys ) { processClassString( options.keys.match( /\S+/g ) || [], true ); } if ( options.extra ) { processClassString( options.extra.match( /\S+/g ) || [] ); } return full.join( " " ); }, _untrackClassesElement: function( event ) { var that = this; $.each( that.classesElementLookup, function( key, value ) { if ( $.inArray( event.target, value ) !== -1 ) { that.classesElementLookup[ key ] = $( value.not( event.target ).get() ); } } ); }, _removeClass: function( element, keys, extra ) { return this._toggleClass( element, keys, extra, false ); }, _addClass: function( element, keys, extra ) { return this._toggleClass( element, keys, extra, true ); }, _toggleClass: function( element, keys, extra, add ) { add = ( typeof add === "boolean" ) ? add : extra; var shift = ( typeof element === "string" || element === null ), options = { extra: shift ? keys : extra, keys: shift ? element : keys, element: shift ? this.element : element, add: add }; options.element.toggleClass( this._classes( options ), add ); return this; }, _on: function( suppressDisabledCheck, element, handlers ) { var delegateElement; var instance = this; // No suppressDisabledCheck flag, shuffle arguments if ( typeof suppressDisabledCheck !== "boolean" ) { handlers = element; element = suppressDisabledCheck; suppressDisabledCheck = false; } // No element argument, shuffle and use this.element if ( !handlers ) { handlers = element; element = this.element; delegateElement = this.widget(); } else { element = delegateElement = $( element ); this.bindings = this.bindings.add( element ); } $.each( handlers, function( event, handler ) { function handlerProxy() { // Allow widgets to customize the disabled handling // - disabled as an array instead of boolean // - disabled class as method for disabling individual parts if ( !suppressDisabledCheck && ( instance.options.disabled === true || $( this ).hasClass( "ui-state-disabled" ) ) ) { return; } return ( typeof handler === "string" ? instance[ handler ] : handler ) .apply( instance, arguments ); } // Copy the guid so direct unbinding works if ( typeof handler !== "string" ) { handlerProxy.guid = handler.guid = handler.guid || handlerProxy.guid || $.guid++; } var match = event.match( /^([\w:-]*)\s*(.*)$/ ); var eventName = match[ 1 ] + instance.eventNamespace; var selector = match[ 2 ]; if ( selector ) { delegateElement.on( eventName, selector, handlerProxy ); } else { element.on( eventName, handlerProxy ); } } ); }, _off: function( element, eventName ) { eventName = ( eventName || "" ).split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace; element.off( eventName ).off( eventName ); // Clear the stack to avoid memory leaks (#10056) this.bindings = $( this.bindings.not( element ).get() ); this.focusable = $( this.focusable.not( element ).get() ); this.hoverable = $( this.hoverable.not( element ).get() ); }, _delay: function( handler, delay ) { function handlerProxy() { return ( typeof handler === "string" ? instance[ handler ] : handler ) .apply( instance, arguments ); } var instance = this; return setTimeout( handlerProxy, delay || 0 ); }, _hoverable: function( element ) { this.hoverable = this.hoverable.add( element ); this._on( element, { mouseenter: function( event ) { this._addClass( $( event.currentTarget ), null, "ui-state-hover" ); }, mouseleave: function( event ) { this._removeClass( $( event.currentTarget ), null, "ui-state-hover" ); } } ); }, _focusable: function( element ) { this.focusable = this.focusable.add( element ); this._on( element, { focusin: function( event ) { this._addClass( $( event.currentTarget ), null, "ui-state-focus" ); }, focusout: function( event ) { this._removeClass( $( event.currentTarget ), null, "ui-state-focus" ); } } ); }, _trigger: function( type, event, data ) { var prop, orig; var callback = this.options[ type ]; data = data || {}; event = $.Event( event ); event.type = ( type === this.widgetEventPrefix ? type : this.widgetEventPrefix + type ).toLowerCase(); // The original event may come from any element // so we need to reset the target on the new event event.target = this.element[ 0 ]; // Copy original event properties over to the new event orig = event.originalEvent; if ( orig ) { for ( prop in orig ) { if ( !( prop in event ) ) { event[ prop ] = orig[ prop ]; } } } this.element.trigger( event, data ); return !( $.isFunction( callback ) && callback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false || event.isDefaultPrevented() ); } }; $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { $.Widget.prototype[ "_" + method ] = function( element, options, callback ) { if ( typeof options === "string" ) { options = { effect: options }; } var hasOptions; var effectName = !options ? method : options === true || typeof options === "number" ? defaultEffect : options.effect || defaultEffect; options = options || {}; if ( typeof options === "number" ) { options = { duration: options }; } hasOptions = !$.isEmptyObject( options ); options.complete = callback; if ( options.delay ) { element.delay( options.delay ); } if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) { element[ method ]( options ); } else if ( effectName !== method && element[ effectName ] ) { element[ effectName ]( options.duration, options.easing, callback ); } else { element.queue( function( next ) { $( this )[ method ](); if ( callback ) { callback.call( element[ 0 ] ); } next(); } ); } }; } ); return $.widget; } ) ); /*! * jQuery UI Controlgroup 1.12.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Controlgroup //>>group: Widgets //>>description: Visually groups form control widgets //>>docs: http://api.jqueryui.com/controlgroup/ //>>demos: http://jqueryui.com/controlgroup/ //>>css.structure: ../../themes/base/core.css //>>css.structure: ../../themes/base/controlgroup.css //>>css.theme: ../../themes/base/theme.css ( function( factory ) { if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "../widget" ], factory ); } else { // Browser globals factory( jQuery ); } }( function( $ ) { var controlgroupCornerRegex = /ui-corner-([a-z]){2,6}/g; return $.widget( "ui.controlgroup", { version: "1.12.1", defaultElement: "<div>", options: { direction: "horizontal", disabled: null, onlyVisible: true, items: { "button": "input[type=button], input[type=submit], input[type=reset], button, a", "controlgroupLabel": ".ui-controlgroup-label", "checkboxradio": "input[type='checkbox'], input[type='radio']", "selectmenu": "select", "spinner": ".ui-spinner-input" } }, _create: function() { this._enhance(); }, // To support the enhanced option in jQuery Mobile, we isolate DOM manipulation _enhance: function() { this.element.attr( "role", "toolbar" ); this.refresh(); }, _destroy: function() { this._callChildMethod( "destroy" ); this.childWidgets.removeData( "ui-controlgroup-data" ); this.element.removeAttr( "role" ); if ( this.options.items.controlgroupLabel ) { this.element .find( this.options.items.controlgroupLabel ) .find( ".ui-controlgroup-label-contents" ) .contents().unwrap(); } }, _initWidgets: function() { var that = this, childWidgets = []; // First we iterate over each of the items options $.each( this.options.items, function( widget, selector ) { var labels; var options = {}; // Make sure the widget has a selector set if ( !selector ) { return; } if ( widget === "controlgroupLabel" ) { labels = that.element.find( selector ); labels.each( function() { var element = $( this ); if ( element.children( ".ui-controlgroup-label-contents" ).length ) { return; } element.contents() .wrapAll( "<span class='ui-controlgroup-label-contents'></span>" ); } ); that._addClass( labels, null, "ui-widget ui-widget-content ui-state-default" ); childWidgets = childWidgets.concat( labels.get() ); return; } // Make sure the widget actually exists if ( !$.fn[ widget ] ) { return; } // We assume everything is in the middle to start because we can't determine // first / last elements until all enhancments are done. if ( that[ "_" + widget + "Options" ] ) { options = that[ "_" + widget + "Options" ]( "middle" ); } else { options = { classes: {} }; } // Find instances of this widget inside controlgroup and init them that.element .find( selector ) .each( function() { var element = $( this ); var instance = element[ widget ]( "instance" ); // We need to clone the default options for this type of widget to avoid // polluting the variable options which has a wider scope than a single widget. var instanceOptions = $.widget.extend( {}, options ); // If the button is the child of a spinner ignore it // TODO: Find a more generic solution if ( widget === "button" && element.parent( ".ui-spinner" ).length ) { return; } // Create the widget if it doesn't exist if ( !instance ) { instance = element[ widget ]()[ widget ]( "instance" ); } if ( instance ) { instanceOptions.classes = that._resolveClassesValues( instanceOptions.classes, instance ); } element[ widget ]( instanceOptions ); // Store an instance of the controlgroup to be able to reference // from the outermost element for changing options and refresh var widgetElement = element[ widget ]( "widget" ); $.data( widgetElement[ 0 ], "ui-controlgroup-data", instance ? instance : element[ widget ]( "instance" ) ); childWidgets.push( widgetElement[ 0 ] ); } ); } ); this.childWidgets = $( $.unique( childWidgets ) ); this._addClass( this.childWidgets, "ui-controlgroup-item" ); }, _callChildMethod: function( method ) { this.childWidgets.each( function() { var element = $( this ), data = element.data( "ui-controlgroup-data" ); if ( data && data[ method ] ) { data[ method ](); } } ); }, _updateCornerClass: function( element, position ) { var remove = "ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"; var add = this._buildSimpleOptions( position, "label" ).classes.label; this._removeClass( element, null, remove ); this._addClass( element, null, add ); }, _buildSimpleOptions: function( position, key ) { var direction = this.options.direction === "vertical"; var result = { classes: {} }; result.classes[ key ] = { "middle": "", "first": "ui-corner-" + ( direction ? "top" : "left" ), "last": "ui-corner-" + ( direction ? "bottom" : "right" ), "only": "ui-corner-all" }[ position ]; return result; }, _spinnerOptions: function( position ) { var options = this._buildSimpleOptions( position, "ui-spinner" ); options.classes[ "ui-spinner-up" ] = ""; options.classes[ "ui-spinner-down" ] = ""; return options; }, _buttonOptions: function( position ) { return this._buildSimpleOptions( position, "ui-button" ); }, _checkboxradioOptions: function( position ) { return this._buildSimpleOptions( position, "ui-checkboxradio-label" ); }, _selectmenuOptions: function( position ) { var direction = this.options.direction === "vertical"; return { width: direction ? "auto" : false, classes: { middle: { "ui-selectmenu-button-open": "", "ui-selectmenu-button-closed": "" }, first: { "ui-selectmenu-button-open": "ui-corner-" + ( direction ? "top" : "tl" ), "ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "top" : "left" ) }, last: { "ui-selectmenu-button-open": direction ? "" : "ui-corner-tr", "ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "bottom" : "right" ) }, only: { "ui-selectmenu-button-open": "ui-corner-top", "ui-selectmenu-button-closed": "ui-corner-all" } }[ position ] }; }, _resolveClassesValues: function( classes, instance ) { var result = {}; $.each( classes, function( key ) { var current = instance.options.classes[ key ] || ""; current = $.trim( current.replace( controlgroupCornerRegex, "" ) ); result[ key ] = ( current + " " + classes[ key ] ).replace( /\s+/g, " " ); } ); return result; }, _setOption: function( key, value ) { if ( key === "direction" ) { this._removeClass( "ui-controlgroup-" + this.options.direction ); } this._super( key, value ); if ( key === "disabled" ) { this._callChildMethod( value ? "disable" : "enable" ); return; } this.refresh(); }, refresh: function() { var children, that = this; this._addClass( "ui-controlgroup ui-controlgroup-" + this.options.direction ); if ( this.options.direction === "horizontal" ) { this._addClass( null, "ui-helper-clearfix" ); } this._initWidgets(); children = this.childWidgets; // We filter here because we need to track all childWidgets not just the visible ones if ( this.options.onlyVisible ) { children = children.filter( ":visible" ); } if ( children.length ) { // We do this last because we need to make sure all enhancment is done // before determining first and last $.each( [ "first", "last" ], function( index, value ) { var instance = children[ value ]().data( "ui-controlgroup-data" ); if ( instance && that[ "_" + instance.widgetName + "Options" ] ) { var options = that[ "_" + instance.widgetName + "Options" ]( children.length === 1 ? "only" : value ); options.classes = that._resolveClassesValues( options.classes, instance ); instance.element[ instance.widgetName ]( options ); } else { that._updateCornerClass( children[ value ](), value ); } } ); // Finally call the refresh method on each of the child widgets. this._callChildMethod( "refresh" ); } } } ); } ) );
malahinisolutions/verify
public/assets/jquery-ui/widgets/controlgroup-f525e8d53867db2d7a4e30c79b5d800b.js
JavaScript
mit
28,612
<?php /** * TOP API: taobao.xhotel.rate.add request * * @author auto create * @since 1.0, 2013-12-10 16:57:25 */ class XhotelRateAddRequest { /** * 额外服务-是否可以加床,1:不可以,2:可以 **/ private $addBed; /** * 额外服务-加床价格 **/ private $addBedPrice; /** * 币种(仅支持CNY) **/ private $currencyCode; /** * gid酒店商品id **/ private $gid; /** * 价格和库存信息。 A:use_room_inventory:是否使用room级别共享库存,可选值 true false 1、true时:使用room级别共享库存(即使用gid对应的XRoom中的inventory),rate_quota_map 的json 数据中不需要录入库存信息,录入的库存信息会忽略 2、false时:使用rate级别私有库存,此时要求价格和库存必填。 B:date 日期必须为 T---T+90 日内的日期(T为当天),且不能重复 C:price 价格 int类型 取值范围1-99999999 单位为分 D:quota 库存 int 类型 取值范围 0-999(数量库存) 60000(状态库存关) 61000(状态库存开) **/ private $inventoryPrice; /** * 名称 **/ private $name; /** * 酒店RPID **/ private $rpid; /** * 实价有房标签(RP支付类型为全额支付) **/ private $shijiaTag; private $apiParas = array(); public function setAddBed($addBed) { $this->addBed = $addBed; $this->apiParas["add_bed"] = $addBed; } public function getAddBed() { return $this->addBed; } public function setAddBedPrice($addBedPrice) { $this->addBedPrice = $addBedPrice; $this->apiParas["add_bed_price"] = $addBedPrice; } public function getAddBedPrice() { return $this->addBedPrice; } public function setCurrencyCode($currencyCode) { $this->currencyCode = $currencyCode; $this->apiParas["currency_code"] = $currencyCode; } public function getCurrencyCode() { return $this->currencyCode; } public function setGid($gid) { $this->gid = $gid; $this->apiParas["gid"] = $gid; } public function getGid() { return $this->gid; } public function setInventoryPrice($inventoryPrice) { $this->inventoryPrice = $inventoryPrice; $this->apiParas["inventory_price"] = $inventoryPrice; } public function getInventoryPrice() { return $this->inventoryPrice; } public function setName($name) { $this->name = $name; $this->apiParas["name"] = $name; } public function getName() { return $this->name; } public function setRpid($rpid) { $this->rpid = $rpid; $this->apiParas["rpid"] = $rpid; } public function getRpid() { return $this->rpid; } public function setShijiaTag($shijiaTag) { $this->shijiaTag = $shijiaTag; $this->apiParas["shijia_tag"] = $shijiaTag; } public function getShijiaTag() { return $this->shijiaTag; } public function getApiMethodName() { return "taobao.xhotel.rate.add"; } public function getApiParas() { return $this->apiParas; } public function check() { RequestCheckUtil::checkMaxValue($this->addBed,2,"addBed"); RequestCheckUtil::checkMinValue($this->addBed,1,"addBed"); RequestCheckUtil::checkNotNull($this->gid,"gid"); RequestCheckUtil::checkNotNull($this->inventoryPrice,"inventoryPrice"); RequestCheckUtil::checkMaxLength($this->name,60,"name"); RequestCheckUtil::checkNotNull($this->rpid,"rpid"); } public function putOtherTextParam($key, $value) { $this->apiParas[$key] = $value; $this->$key = $value; } }
allengaller/mazi-cms
web/doc/Resources/open/taobao/taobao-sdk-PHP-online_standard-20131210/top/request/XhotelRateAddRequest.php
PHP
mit
3,443
import java.util.Iterator; import java.util.NoSuchElementException; @SuppressWarnings("unchecked") public class RandomizedQueue<Item> implements Iterable<Item> { private Item[] _arr; private int _length = 0; private void resize(int newLength) { if (newLength > _arr.length) newLength = 2 * _arr.length; else if (newLength < _arr.length / 4) newLength = _arr.length / 2; else return; Item[] newArr = (Item[])(new Object[newLength]); for (int i = 0; i < _length; ++i) { newArr[i] = _arr[i]; } _arr = newArr; } public RandomizedQueue() { _arr = (Item[])(new Object[1]); } public boolean isEmpty() { return _length == 0; } public int size() { return _length; } public void enqueue(Item item) { if (item == null) throw new NullPointerException(); resize(_length + 1); _arr[_length] = item; ++_length; } public Item dequeue() { if (_length == 0) throw new NoSuchElementException(); int idx = StdRandom.uniform(_length); Item ret = _arr[idx]; _arr[idx] = _arr[_length - 1]; _arr[_length - 1] = null; --_length; resize(_length); return ret; } public Item sample() { if (_length == 0) throw new NoSuchElementException(); return _arr[StdRandom.uniform(_length)]; } private class RandomizedQueueIterator implements Iterator<Item> { Item[] _state; int _current = 0; public RandomizedQueueIterator() { _state = (Item[])(new Object[_length]); for (int i = 0; i < _length; ++i) { _state[i] = _arr[i]; } StdRandom.shuffle(_state); } public boolean hasNext() { return _current != _state.length; } public Item next() { if (!hasNext()) throw new NoSuchElementException(); return _state[_current++]; } public void remove() { throw new UnsupportedOperationException(); } } public Iterator<Item> iterator() { return new RandomizedQueueIterator(); } public static void main(String[] args) { RandomizedQueue<Integer> queue = new RandomizedQueue<Integer>(); for (int i = 0; i < 10; ++i) { queue.enqueue(i); } for (int e: queue) { StdOut.println(e); } } }
hghwng/mooc-algs1
2/RandomizedQueue.java
Java
mit
2,505
// //#include "Mesure.h" // //Mesure *m; // //void setup() //{ // //} // //void loop() //{ // m = new Mesure(13,20,4,4); // m->addNote(Note_E,4,NOIR); // m->addNote(Note_E,4,NOIR); // m->addNote(Note_E,4,NOIR); // m->addNote(Note_C,4,NOIR); // m->play(); // // m = new Mesure(13,20,4,4); // m->addNote(Note_E,4,NOIR); // m->addNote(Note_G,4,NOIR); // m->addNote(Note_G,3,NOIR); // m->addNote(Note_C,4,NOIR); // m->play(); // // m = new Mesure(13,20,4,4); // m->addNote(Note_G,3,NOIR); // m->addNote(Note_E,3,NOIR); // m->addNote(Note_G,3,NOIR); // m->addNote(Note_A,3,NOIR); // m->play(); // // m = new Mesure(13,20,4,4); // m->addNote(Note_Gd,3,NOIR); // m->addNote(Note_Gd,3,NOIR); // m->addNote(Note_E,4,NOIR); // m->addNote(Note_G,4,NOIR); // m->play(); // // m = new Mesure(13,20,4,4); // m->addNote(Note_A,4,NOIR); // m->addNote(Note_F,4,NOIR); // m->addNote(Note_G,4,NOIR); // m->addNote(Note_E,4,NOIR); // m->play(); // // m = new Mesure(13,20,4,4); // m->addNote(Note_C,4,NOIR); // m->addNote(Note_D,4,NOIR); // m->addNote(Note_B,3,NOIR); // m->addNote(Note_C,4,NOIR); // m->play(); // // m = new Mesure(13,20,4,4); // m->addNote(Note_G,3,NOIR); // m->addNote(Note_E,3,NOIR); // m->addNote(Note_G,3,NOIR); // m->addNote(Note_A,3,NOIR); // m->play(); // // m = new Mesure(13,20,4,4); // m->addNote(Note_Gd,3,NOIR); // m->addNote(Note_Gd,3,NOIR); // m->addNote(Note_E,4,NOIR); // m->addNote(Note_G,4,NOIR); // m->play(); // // delay(5000); //}
alexgus/libAudio
Mesure_test.cpp
C++
mit
1,521
'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.42000 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) #Region "My.Settings Auto-Save Functionality" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean Private Shared addedHandlerLockObject As New Object <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) If My.Application.SaveMySettingsOnExit Then My.Settings.Save() End If End Sub #End If #End Region Public Shared ReadOnly Property [Default]() As MySettings Get #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject If Not addedHandler Then AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings addedHandler = True End If End SyncLock End If #End If Return defaultInstance End Get End Property End Class End Namespace Namespace My <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ Friend Module MySettingsProperty <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ Friend ReadOnly Property Settings() As Global.Rodriguez_GuessingGame.My.MySettings Get Return Global.Rodriguez_GuessingGame.My.MySettings.Default End Get End Property End Module End Namespace
miguel2192/CSC-162
Rodriguez_GuessingGame/Rodriguez_GuessingGame/My Project/Settings.Designer.vb
Visual Basic
mit
2,950
<?php namespace Robo\Task\FileSystem; use Robo\Result; /** * Mirrors a directory to another * * ``` php * <?php * $this->taskMirrorDir(['dist/config/' => 'config/'])->run(); * // or use shortcut * $this->_mirrorDir('dist/config/', 'config/'); * * ?> * ``` */ class MirrorDir extends BaseDir { public function run() { foreach ($this->dirs as $src => $dst) { $this->fs->mirror( $src, $dst, null, [ 'override' => true, 'copy_on_windows' => true, 'delete' => true ] ); $this->printTaskInfo("Mirrored from {source} to {destination}", ['source' => $src, 'destination' => $dst]); } return Result::success($this); } }
boedah/Robo
src/Task/FileSystem/MirrorDir.php
PHP
mit
835
# Makefile.in generated by automake 1.10.1 from Makefile.am. # Makefile. Generated from Makefile.in by configure. # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # Makefile.am - builds jscoverage # Copyright (C) 2007, 2008 siliconforks.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # 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 General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. pkgdatadir = $(datadir)/jscoverage pkglibdir = $(libdir)/jscoverage pkgincludedir = $(includedir)/jscoverage am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = x86_64-unknown-linux-gnu host_triplet = x86_64-unknown-linux-gnu bin_PROGRAMS = jscoverage$(EXEEXT) jscoverage-server$(EXEEXT) noinst_PROGRAMS = generate-resources$(EXEEXT) subdir = . DIST_COMMON = README $(am__configure_deps) $(dist_man_MANS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/config.h.in $(srcdir)/make-bin-dist.sh.in \ $(srcdir)/make-dist.sh.in $(top_srcdir)/configure COPYING \ config.guess config.rpath config.sub depcomp install-sh \ missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = make-dist.sh make-bin-dist.sh am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am_generate_resources_OBJECTS = generate-resources.$(OBJEXT) generate_resources_OBJECTS = $(am_generate_resources_OBJECTS) generate_resources_LDADD = $(LDADD) am__objects_1 = am_jscoverage_OBJECTS = encoding.$(OBJEXT) highlight.$(OBJEXT) \ instrument.$(OBJEXT) instrument-js.$(OBJEXT) \ jscoverage.$(OBJEXT) resource-manager.$(OBJEXT) \ stream.$(OBJEXT) util.$(OBJEXT) $(am__objects_1) jscoverage_OBJECTS = $(am_jscoverage_OBJECTS) jscoverage_DEPENDENCIES = js/obj/libjs.a am_jscoverage_server_OBJECTS = http-connection.$(OBJEXT) \ http-exchange.$(OBJEXT) http-host.$(OBJEXT) \ http-message.$(OBJEXT) http-server.$(OBJEXT) \ http-url.$(OBJEXT) encoding.$(OBJEXT) highlight.$(OBJEXT) \ instrument-js.$(OBJEXT) jscoverage-server.$(OBJEXT) \ resource-manager.$(OBJEXT) stream.$(OBJEXT) util.$(OBJEXT) \ $(am__objects_1) jscoverage_server_OBJECTS = $(am_jscoverage_server_OBJECTS) jscoverage_server_DEPENDENCIES = js/obj/libjs.a DEFAULT_INCLUDES = -I. depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ SOURCES = $(generate_resources_SOURCES) $(jscoverage_SOURCES) \ $(jscoverage_server_SOURCES) DIST_SOURCES = $(generate_resources_SOURCES) $(jscoverage_SOURCES) \ $(jscoverage_server_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive man1dir = $(mandir)/man1 NROFF = nroff MANS = $(dist_man_MANS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = ${SHELL} /home/joel/Dropbox/Spring2016/CSCI3308/SemesterProject/flow/node_modules/expresso/deps/jscoverage/missing --run aclocal-1.10 AMTAR = ${SHELL} /home/joel/Dropbox/Spring2016/CSCI3308/SemesterProject/flow/node_modules/expresso/deps/jscoverage/missing --run tar AUTOCONF = ${SHELL} /home/joel/Dropbox/Spring2016/CSCI3308/SemesterProject/flow/node_modules/expresso/deps/jscoverage/missing --run autoconf AUTOHEADER = ${SHELL} /home/joel/Dropbox/Spring2016/CSCI3308/SemesterProject/flow/node_modules/expresso/deps/jscoverage/missing --run autoheader AUTOMAKE = ${SHELL} /home/joel/Dropbox/Spring2016/CSCI3308/SemesterProject/flow/node_modules/expresso/deps/jscoverage/missing --run automake-1.10 AWK = mawk CC = /usr/bin/clang-3.6 CCDEPMODE = depmode=gcc3 CFLAGS = -g -O2 CPP = /usr/bin/clang-3.6 -E CPPFLAGS = CXX = /usr/bin/clang++-3.6 CXXDEPMODE = depmode=gcc3 CXXFLAGS = --std=c++11 CYGPATH_W = echo DEFS = -DHAVE_CONFIG_H DEPDIR = .deps ECHO_C = ECHO_N = -n ECHO_T = EGREP = /bin/grep -E EXEEXT = EXTRA_SOCKET_LIBS = EXTRA_THREAD_LIBS = -lpthread EXTRA_TIMER_LIBS = GREP = /bin/grep INSTALL = /usr/bin/install -c INSTALL_DATA = ${INSTALL} -m 644 INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = $(install_sh) -c -s LDFLAGS = LIBICONV = LIBOBJS = LIBS = LTLIBICONV = LTLIBOBJS = MAKEINFO = ${SHELL} /home/joel/Dropbox/Spring2016/CSCI3308/SemesterProject/flow/node_modules/expresso/deps/jscoverage/missing --run makeinfo MKDIR_P = /bin/mkdir -p OBJEXT = o PACKAGE = jscoverage PACKAGE_BUGREPORT = PACKAGE_NAME = jscoverage PACKAGE_STRING = jscoverage 0.4 PACKAGE_TARNAME = jscoverage PACKAGE_VERSION = 0.4 PATH_SEPARATOR = : SET_MAKE = SHELL = /bin/bash STRIP = VERSION = 0.4 XP_DEF = -DXP_UNIX abs_builddir = /home/joel/Dropbox/Spring2016/CSCI3308/SemesterProject/flow/node_modules/expresso/deps/jscoverage abs_srcdir = /home/joel/Dropbox/Spring2016/CSCI3308/SemesterProject/flow/node_modules/expresso/deps/jscoverage abs_top_builddir = /home/joel/Dropbox/Spring2016/CSCI3308/SemesterProject/flow/node_modules/expresso/deps/jscoverage abs_top_srcdir = /home/joel/Dropbox/Spring2016/CSCI3308/SemesterProject/flow/node_modules/expresso/deps/jscoverage ac_ct_CC = /usr/bin/clang-3.6 ac_ct_CXX = am__include = include am__leading_dot = . am__quote = am__tar = ${AMTAR} chof - "$$tardir" am__untar = ${AMTAR} xf - bindir = ${exec_prefix}/bin build = x86_64-unknown-linux-gnu build_alias = build_cpu = x86_64 build_os = linux-gnu build_vendor = unknown builddir = . datadir = ${datarootdir} datarootdir = ${prefix}/share docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} dvidir = ${docdir} exec_prefix = ${prefix} host = x86_64-unknown-linux-gnu host_alias = host_cpu = x86_64 host_os = linux-gnu host_vendor = unknown htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info install_sh = $(SHELL) /home/joel/Dropbox/Spring2016/CSCI3308/SemesterProject/flow/node_modules/expresso/deps/jscoverage/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale localstatedir = ${prefix}/var mandir = ${datarootdir}/man mkdir_p = /bin/mkdir -p oldincludedir = /usr/include pdfdir = ${docdir} prefix = /usr/local program_transform_name = s,x,x, psdir = ${docdir} sbindir = ${exec_prefix}/sbin sharedstatedir = ${prefix}/com srcdir = . sysconfdir = ${prefix}/etc target_alias = top_builddir = . top_srcdir = . ACLOCAL_AMFLAGS = -I m4 SUBDIRS = js AM_CFLAGS = -Ijs -Ijs/obj -DXP_UNIX AM_CXXFLAGS = -Ijs -Ijs/obj -DXP_UNIX resources = jscoverage-help.txt jscoverage-server-help.txt \ jscoverage.jsm jscoverage.manifest jscoverage.xul jscoverage-overlay.js \ jscoverage.html \ jscoverage.css jscoverage-ie.css jscoverage-highlight.css \ jscoverage.js report.js \ jscoverage-throbber.gif jscoverage_SOURCES = encoding.c encoding.h \ highlight.c highlight.h \ instrument.c instrument.h \ instrument-js.cpp instrument-js.h \ jscoverage.c global.h \ resource-manager.c resource-manager.h \ stream.c stream.h \ util.c util.h \ $(resources) jscoverage_LDADD = js/obj/libjs.a -lm jscoverage_server_SOURCES = http-connection.c \ http-exchange.c \ http-host.c \ http-message.c \ http-server.c http-server.h \ http-url.c \ encoding.c encoding.h \ highlight.c highlight.h \ instrument-js.cpp instrument-js.h \ jscoverage-server.c global.h \ resource-manager.c resource-manager.h \ stream.c stream.h \ util.c util.h \ $(resources) jscoverage_server_LDADD = js/obj/libjs.a -lm -lpthread generate_resources_SOURCES = generate-resources.c BUILT_SOURCES = resources.c dist_man_MANS = jscoverage.1 jscoverage-server.1 CLEANFILES = *.gcno *.exe resources.c *~ all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .cpp .o .obj am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ cd $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 make-dist.sh: $(top_builddir)/config.status $(srcdir)/make-dist.sh.in cd $(top_builddir) && $(SHELL) ./config.status $@ make-bin-dist.sh: $(top_builddir)/config.status $(srcdir)/make-bin-dist.sh.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) generate-resources$(EXEEXT): $(generate_resources_OBJECTS) $(generate_resources_DEPENDENCIES) @rm -f generate-resources$(EXEEXT) $(LINK) $(generate_resources_OBJECTS) $(generate_resources_LDADD) $(LIBS) jscoverage$(EXEEXT): $(jscoverage_OBJECTS) $(jscoverage_DEPENDENCIES) @rm -f jscoverage$(EXEEXT) $(CXXLINK) $(jscoverage_OBJECTS) $(jscoverage_LDADD) $(LIBS) jscoverage-server$(EXEEXT): $(jscoverage_server_OBJECTS) $(jscoverage_server_DEPENDENCIES) @rm -f jscoverage-server$(EXEEXT) $(CXXLINK) $(jscoverage_server_OBJECTS) $(jscoverage_server_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c include ./$(DEPDIR)/encoding.Po include ./$(DEPDIR)/generate-resources.Po include ./$(DEPDIR)/highlight.Po include ./$(DEPDIR)/http-connection.Po include ./$(DEPDIR)/http-exchange.Po include ./$(DEPDIR)/http-host.Po include ./$(DEPDIR)/http-message.Po include ./$(DEPDIR)/http-server.Po include ./$(DEPDIR)/http-url.Po include ./$(DEPDIR)/instrument-js.Po include ./$(DEPDIR)/instrument.Po include ./$(DEPDIR)/jscoverage-server.Po include ./$(DEPDIR)/jscoverage.Po include ./$(DEPDIR)/resource-manager.Po include ./$(DEPDIR)/stream.Po include ./$(DEPDIR)/util.Po .c.o: $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po # source='$<' object='$@' libtool=no \ # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ # $(COMPILE) -c $< .c.obj: $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po # source='$<' object='$@' libtool=no \ # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ # $(COMPILE) -c `$(CYGPATH_W) '$<'` .cpp.o: $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po # source='$<' object='$@' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXXCOMPILE) -c -o $@ $< .cpp.obj: $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po # source='$<' object='$@' libtool=no \ # DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \ # $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d $(distdir) || mkdir $(distdir) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(PROGRAMS) $(MANS) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-man install-dvi: install-dvi-recursive install-exec-am: install-binPROGRAMS install-html: install-html-recursive install-info: install-info-recursive install-man: install-man1 install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-binPROGRAMS \ clean-generic clean-noinstPROGRAMS ctags ctags-recursive dist \ dist-all dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ \ dist-zip distcheck distclean distclean-compile \ distclean-generic distclean-hdr distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-man1 install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 resources.c: generate-resources $(resources) $(srcdir)/generate-resources $(resources) > $@ example: jscoverage $(srcdir)/jscoverage --exclude=.svn doc/example doc/instrumented example-inverted: jscoverage $(srcdir)/jscoverage --exclude=.svn doc/example-inverted doc/instrumented-inverted example-jsunit: jscoverage $(srcdir)/jscoverage --exclude=.svn --no-instrument=jsunit doc/example-jsunit doc/instrumented-jsunit # override default install target so as not to recursively install subpackages install: install-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT:
SirUsername/flow
node_modules/expresso/deps/jscoverage/Makefile
Makefile
mit
31,200
using System; using System.Collections.Generic; using System.Linq; using System.Security.Claims; using System.Threading.Tasks; using Microsoft.AspNet.Identity; using Microsoft.AspNet.Identity.EntityFramework; using Microsoft.AspNet.Identity.Owin; using Microsoft.Owin.Security; using Microsoft.Owin.Security.Cookies; using Microsoft.Owin.Security.OAuth; using SearchCrawlerHelper.Sample.Models; namespace SearchCrawlerHelper.Sample.Providers { public class ApplicationOAuthProvider : OAuthAuthorizationServerProvider { private readonly string _publicClientId; public ApplicationOAuthProvider(string publicClientId) { if (publicClientId == null) { throw new ArgumentNullException("publicClientId"); } _publicClientId = publicClientId; } public override async Task GrantResourceOwnerCredentials(OAuthGrantResourceOwnerCredentialsContext context) { var userManager = context.OwinContext.GetUserManager<ApplicationUserManager>(); ApplicationUser user = await userManager.FindAsync(context.UserName, context.Password); //TODO: move this func into userManager if (user == null) { user = await userManager.FindByEmailAsync(context.UserName); if(user != null) { user = await userManager.FindAsync(user.UserName, context.Password); } } if (user == null) { context.SetError("invalid_grant", "The user name or password is incorrect."); return; } ClaimsIdentity oAuthIdentity = await user.GenerateUserIdentityAsync(userManager, OAuthDefaults.AuthenticationType); ClaimsIdentity cookiesIdentity = await user.GenerateUserIdentityAsync(userManager, CookieAuthenticationDefaults.AuthenticationType); AuthenticationProperties properties = CreateProperties(oAuthIdentity); AuthenticationTicket ticket = new AuthenticationTicket(oAuthIdentity, properties); context.Validated(ticket); context.Request.Context.Authentication.SignIn(cookiesIdentity); } public override Task TokenEndpoint(OAuthTokenEndpointContext context) { foreach (KeyValuePair<string, string> property in context.Properties.Dictionary) { context.AdditionalResponseParameters.Add(property.Key, property.Value); } return Task.FromResult<object>(null); } public override Task ValidateClientAuthentication(OAuthValidateClientAuthenticationContext context) { // Resource owner password credentials does not provide a client ID. if (context.ClientId == null) { context.Validated(); } return Task.FromResult<object>(null); } public override Task ValidateClientRedirectUri(OAuthValidateClientRedirectUriContext context) { if (context.ClientId == _publicClientId) { Uri expectedRootUri = new Uri(context.Request.Uri, "/"); Uri redirectUri = new Uri(context.RedirectUri); if (expectedRootUri.Authority == redirectUri.Authority) { context.Validated(); } } return Task.FromResult<object>(null); } public static AuthenticationProperties CreateProperties(ClaimsIdentity identity) { var roleClaimValues = ((ClaimsIdentity)identity).FindAll(ClaimTypes.Role).Select(c => c.Value); var roles = string.Join(",", roleClaimValues); IDictionary<string, string> data = new Dictionary<string, string> { { "userName", ((ClaimsIdentity) identity).FindFirstValue(ClaimTypes.Name) }, { "userRoles", roles } }; return new AuthenticationProperties(data); } } }
Useful-Software-Solutions-Ltd/PhantomRunnerAndSearchCrawlerHelper
SearchCrawlerHelper.Sample/Providers/ApplicationOAuthProvider.cs
C#
mit
4,146
import * as types from '@/store/mutation-types'; export default { namespaced: true, state: { type: 0, catId: 0 }, getters: { [types.STATE_INFO]: state => { return state.type + 3; } } }
Tiny-Fendy/web-express
public/store/modules/m2/m3/index.js
JavaScript
mit
204
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Microsoft.Dx.Wopi.Models { public class WopiHostCapabilities : IWopiHostCapabilities { public bool SupportsCobalt { get; set; } public bool SupportsContainers { get; set; } public bool SupportsDeleteFile { get; set; } public bool SupportsEcosystem { get; set; } public bool SupportsExtendedLockLength { get; set; } public bool SupportsFolders { get; set; } public bool SupportsGetLock { get; set; } public bool SupportsLocks { get; set; } public bool SupportsRename { get; set; } public bool SupportsUpdate { get; set; } public bool SupportsUserInfo { get; set; } internal WopiHostCapabilities() { } internal WopiHostCapabilities Clone() { return (WopiHostCapabilities)this.MemberwiseClone(); } } }
apulliam/WOPIFramework
Microsoft.Dx.Wopi/Models/WopiHostCapabilities.cs
C#
mit
991
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>bdds: 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 / bdds - 8.9.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> bdds <small> 8.9.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2021-12-22 08:53:51 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-12-22 08:53:51 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils conf-gmp 3 Virtual package relying on a GMP lib system installation coq 8.13.0 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.07.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.07.1 Official release 4.07.1 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.1 A library manager for OCaml zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Hugo.Herbelin@inria.fr&quot; homepage: &quot;https://github.com/coq-contribs/bdds&quot; license: &quot;LGPL 2.1&quot; build: [make &quot;-j1&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/BDDs&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.9&quot; &amp; &lt; &quot;8.10~&quot;} &quot;coq-int-map&quot; {&gt;= &quot;8.9&quot; &amp; &lt; &quot;8.10~&quot;} ] tags: [ &quot;keyword: BDD&quot; &quot;keyword: binary decision diagrams&quot; &quot;keyword: classical logic&quot; &quot;keyword: propositional logic&quot; &quot;keyword: validity&quot; &quot;keyword: satisfiability&quot; &quot;keyword: model checking&quot; &quot;keyword: reflection&quot; &quot;category: Computer Science/Decision Procedures and Certified Algorithms/Decision procedures&quot; &quot;category: Miscellaneous/Extracted Programs/Decision procedures&quot; &quot;date: May-July 1999&quot; ] authors: [ &quot;Kumar Neeraj Verma&quot; ] bug-reports: &quot;https://github.com/coq-contribs/bdds/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/bdds.git&quot; synopsis: &quot;BDD algorithms and proofs in Coq, by reflection&quot; description: &quot;&quot;&quot; Provides BDD algorithms running under Coq. (BDD are Binary Decision Diagrams.) Allows one to do classical validity checking by reflection in Coq using BDDs, can also be used to get certified BDD algorithms by extraction. First step towards actual symbolic model-checkers in Coq. See file README for operation.&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/bdds/archive/v8.9.0.tar.gz&quot; checksum: &quot;md5=8096278f05e33fe07dac659da37affd6&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-bdds.8.9.0 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-bdds -&gt; coq &lt; 8.10~ -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-bdds.8.9.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://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.07.1-2.0.6/released/8.13.0/bdds/8.9.0.html
HTML
mit
7,632
package com.company; import java.util.Scanner; public class TrainingHallEquipment { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); double budget = Double.parseDouble(scanner.nextLine()); int numberOfItems = Integer.parseInt(scanner.nextLine()); double subTotal = 0; for (int i = 1; i <= numberOfItems ; i++) { String itemName = scanner.nextLine(); double itemPrice = Double.parseDouble(scanner.nextLine()); int itemCount = Integer.parseInt(scanner.nextLine()); if (itemCount == 1) { System.out.printf("Adding %d %s to cart.%n", itemCount, itemName); } else { System.out.printf("Adding %d %ss to cart.%n", itemCount, itemName); } subTotal += itemCount * itemPrice; } System.out.printf("Subtotal: $%.2f %n", subTotal); if (subTotal <= budget) { System.out.printf("Money left: $%.2f", (budget - subTotal)); } else { System.out.printf("Not enough. We need $%.2f more.", (subTotal - budget)); } } }
ivelin1936/Studing-SoftUni-
Programming Fundamentals/Basics-MoreExercises/src/com/company/TrainingHallEquipment.java
Java
mit
1,209
document.observe('click', function(e, el) { if (el = e.findElement('form a.add_nested_fields')) { // Setup var assoc = el.readAttribute('data-association'); // Name of child var target = el.readAttribute('data-target'); var blueprint = $(el.readAttribute('data-blueprint-id')); var content = blueprint.readAttribute('data-blueprint'); // Fields template // Make the context correct by replacing <parents> with the generated ID // of each of the parent objects var context = (el.getOffsetParent('.fields').firstDescendant().readAttribute('name') || '').replace(/\[[a-z_]+\]$/, ''); // If the parent has no inputs we need to strip off the last pair var current = content.match(new RegExp('\\[([a-z_]+)\\]\\[new_' + assoc + '\\]')); if (current) { context = context.replace(new RegExp('\\[' + current[1] + '\\]\\[(new_)?\\d+\\]$'), ''); } // context will be something like this for a brand new form: // project[tasks_attributes][1255929127459][assignments_attributes][1255929128105] // or for an edit form: // project[tasks_attributes][0][assignments_attributes][1] if(context) { var parent_names = context.match(/[a-z_]+_attributes(?=\]\[(new_)?\d+\])/g) || []; var parent_ids = context.match(/[0-9]+/g) || []; for(i = 0; i < parent_names.length; i++) { if(parent_ids[i]) { content = content.replace( new RegExp('(_' + parent_names[i] + ')_.+?_', 'g'), '$1_' + parent_ids[i] + '_'); content = content.replace( new RegExp('(\\[' + parent_names[i] + '\\])\\[.+?\\]', 'g'), '$1[' + parent_ids[i] + ']'); } } } // Make a unique ID for the new child var regexp = new RegExp('new_' + assoc, 'g'); var new_id = new Date().getTime(); content = content.replace(regexp, new_id); var field; if (target) { field = $$(target)[0].insert(content); } else { field = el.insert({ before: content }); } field.fire('nested:fieldAdded', {field: field, association: assoc}); field.fire('nested:fieldAdded:' + assoc, {field: field, association: assoc}); return false; } }); document.observe('click', function(e, el) { if (el = e.findElement('form a.remove_nested_fields')) { var hidden_field = el.previous(0), assoc = el.readAttribute('data-association'); // Name of child to be removed if(hidden_field) { hidden_field.value = '1'; } var field = el.up('.fields').hide(); field.fire('nested:fieldRemoved', {field: field, association: assoc}); field.fire('nested:fieldRemoved:' + assoc, {field: field, association: assoc}); return false; } });
Stellenticket/nested_form
vendor/assets/javascripts/prototype_nested_form.js
JavaScript
mit
2,739
<hr /> <div class="post-nav"> {{if .Prev}}<a class="prev-post" href="/posts/{{.Prev.File}}">&lt;- {{.Prev.Title}}</a>{{end}} {{if .Next}}<a class="next-post" href="/posts/{{.Next.File}}">{{.Next.Title}} -&gt;</a>{{end}} </div>
Inaimathi/langnostic
resources/public/templates/post-links.html
HTML
mit
231