text
stringlengths 3
181k
| src
stringlengths 5
1.02k
|
---|---|
// Accord FFMPEG Library
// The Accord.NET Framework
// http://accord-framework.net
//
// Copyright © AForge.NET, 2009-2011
// [email protected]
//
// Copyright © MelvinGr, 2016-2017
// https://github.com/MelvinGr
//
// Copyright © César Souza, 2009-2017
// cesarsouza at gmail.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., 675 Mass Ave, Cambridge, MA 02139, USA.
//
#pragma once
using namespace System;
extern int video_codecs[];
extern int pixel_formats[];
extern int CODECS_COUNT;
namespace Accord {
namespace Video {
namespace FFMPEG
{
/// <summary>
/// Enumeration of some video codecs from FFmpeg library, which are available for writing video files.
/// </summary>
///
public enum class VideoCodec
{
/// <summary>
/// Default video codec, which FFmpeg library selects for the specified file format.
/// </summary>
///
Default = -1,
/// <summary>
/// MPEG-4 part 2.
/// </summary>
///
MPEG4 = 0,
/// <summary>
/// Windows Media Video 7.
/// </summary>
///
WMV1,
/// <summary>
/// Windows Media Video 8.
/// </summary>
///
WMV2,
/// <summary>
/// MPEG-4 part 2 Microsoft variant version 2.
/// </summary>
///
MSMPEG4v2,
/// <summary>
/// MPEG-4 part 2 Microsoft variant version 3.
/// </summary>
///
MSMPEG4v3,
/// <summary>
/// H.263+ / H.263-1998 / H.263 version 2.
/// </summary>
///
H263P,
/// <summary>
/// Flash Video (FLV) / Sorenson Spark / Sorenson H.263.
/// </summary>
FLV1,
/// <summary>
/// MPEG-2 part 2.
/// </summary>
///
MPEG2,
/// <summary>
/// Raw (uncompressed) video.
/// </summary>
///
Raw,
/// <summary>
/// FF video codec 1 lossless codec.
/// </summary>
///
FFV1,
/// <summary>
/// FFmpeg's HuffYUV lossless codec.
/// </summary>
///
FFVHUFF,
/// <summary>
/// H.264/MPEG-4 Part 10.
/// </summary>
///
H264,
/// <summary>
/// H.265
/// </summary>
///
H265,
/// <summary>
/// H.264/MPEG-4 Part 10.
/// </summary>
///
Theora,
/// <summary>
/// VP-8.
/// </summary>
///
VP8,
/// <summary>
/// VP-9.
/// </summary>
///
VP9,
};
}
}
}
| anders9ustafsson/framework-Sources/Extras/Accord.Video.FFMPEG.GPL/VideoCodec.h |
# Multitask Learning for Scalable and Dense Multilayer Bayesian Map Inference
Lu Gan, Youngji Kim, Jessy W. Grizzle, Jeffrey M. Walls, Ayoung Kim, Ryan M. Eustice, and Maani Ghaffari
Toyota Research Institute provided funds to support this work. Funding for M. Ghaffari was in part provided by NSF Award No. 2118818. Funding for J. Grizzle was in part provided by NSF Award No. 2118818. Y. Kim was supported by the International Research & Development Program of the National Research Foundation for Korea (NRF) funded by the Ministry of Science and ICT (Grant number: 2019K13A1A12069741). _(Lu Gan and Youngji Kim contributed equally to this work.) (Corresponding author: Lu Gan)._L. Gan, J. Grizzle, R. Eustice, and M. Ghaffari are with the Robotics Institute, University of Michigan, Ann Arbor, MI 48109, USA. {ganlu, Grizzle, eustice, manningj}@umich.edu.Y. Kim is with the Department of Civil and Environmental Engineering, KAIST, Daejeon, S. Korea. [email protected]. Kim is with the Department of Mechanical Engineering, SNU, Seoul, S. Korea. [email protected]. Walls is with Woven Planet Holdings, Inc. [email protected].
###### Abstract
This article presents a novel and flexible multitask multilayer Bayesian mapping framework with readily extendable attribute layers. The proposed framework goes beyond modern metric-semantic maps to provide even richer environmental information for robots in a single mapping formalism while exploiting intralayer and interlayer correlations. It removes the need for a robot to access and process information from many separate maps when performing a complex task, advancing the way robots interact with their environments. To this end, we design a multitask deep neural network with attention mechanisms as our front-end to provide heterogeneous observations for multiple map layers simultaneously. Our back-end runs a scalable closed-form Bayesian inference with only logarithmic time complexity. We apply the framework to build a dense robotic map including metric-semantic occupancy and traversability layers. Traversability ground truth labels are automatically generated from exteroceptive sensory data in a self-supervised manner. We present extensive experimental results on publicly available datasets and data collected by a 3D bipedal robot platform and show reliable mapping performance in different environments. Finally, we also discuss how the current framework can be extended to incorporate more information such as friction, signal strength, temperature, and physical quantity concentration using Gaussian map layers. The software for reproducing the presented results or running on customized data is made publicly available.
Bayesian inference, continuous mapping, multi-task learning, robot sensing systems, semantic scene understanding, traversability estimation.
## I Introduction
Robotic mapping is the process of inferring a model of the environment from noisy measurements and is an essential task in the pursuit of robotic autonomy [1]. Over the recent decades of highly active research on robotic mapping, maps have used different representations, included different sensing modalities, and been applied to a variety of tasks such as localization [2], as a reference for navigation [3], and autonomous exploration [4]. Traditionally, maps built for robot localization contain geometric information of the environment. For example, occupancy grid maps employ voxel grids as the map representation and probabilistically assign a binary label to each grid cell to denote whether it is occupied [5, 6, 7]. The geometric structure of the scene is also encoded in dense maps where Truncated Signed Distance Fields (TSDFs) are used to represent a surface implicitly [8, 9]. For better visualization [10] and camera tracking [11], 3D maps are also textured with appearance (e.g., color) information.
Although classical robotic maps have reached a level of maturity for localization purposes, most practical robotic applications require more than just geometric information, e.g., high-level path planning and task planning. Semantic mapping timely extends the map representation to include semantic knowledge in addition to geometry and appearance, and becomes a highly active research area [12, 13, 14, 15, 16, 17, 18, 19]. In recent years, object instances, as another form of semantic knowledge, are also incorporated into robotic maps [20, 21, 22].
With the inclusion of scene understanding, semantic maps enable a much greater range of tasks for robots. For instance, domestic robots can fetch tableware from the kitchen, and a
Fig. 1: Overview of our proposed multitask multilayer Bayesian mapping framework. We first employ exteroceptive sensory data and sensor trajectory to generate training data for map attributes other than semantics (traversability specifically) in a self-supervised manner. We then train a unified segmentation deep neural network for monocular image via MTL using available data. Predictions of the MTL network are processed through our multilayer Bayesian inference sequentially and efficiently to build dense maps. Inter-layer correlations are also leveraged to improve the map posterior. Our framework is designed to be easily extended to include additional layers.
legged robot can walk on firm pavement instead of unstable vegetation. However, even with semantics, maps can still be limited for higher level planning. Planning systems may desire other environmental attributes for better decision making, such as the traversability of the ground surface, the affordance [23, Ch. 8] of surrounding objects, the outdoor temperature, or the concentration of some quantity in the air. These attributes form a high-level understanding of the environment, which is regarded as one of the key requirements of the _robust-perception age_ in robotics [24].
At present, each of these attributes is often estimated independently and represented in a separate map. To perform a complex task involving multiple attributes, a robot needs to access and process information across different maps [25]. This not only complicates planning, but ignores the correlation among different sources of information. In this paper, we argue that instead of using an independent map for a specific task, information can be stored in one shared map with several correlated layers where each layer contains one attribute. We propose a multitask multilayer Bayesian mapping framework which
1. provides rich information such as semantics and traversability and is extendable to include more layers;
2. runs online using an arbitrary number of sensors (e.g., cameras and LiDARs);
3. unifies and simplifies the access to different map attributes for communication efficiency;
4. leverages inter-layer correlations to improve the map posterior distribution.
This work focuses on applying the proposed mapping framework to build a second _traversability_ layer on top of the first _semantic_ layer developed in our previous work [19]. Traversability, by definition in robotics, means "the capability of a ground robot to reside over a terrain region under an admissible state wherein it is capable of entering given its current state" [26]. We choose traversability as the second layer for two reasons. First, a traversability map is essential for a robot to safely and efficiently navigate within its environment and plan local motion policies with improved stability. Secondly, traversability is highly correlated with the semantic properties of an environment. For example, sky is non-traversable to a ground robot; road is the opposite; mud can either be traversable or untraversable.
An overview of the proposed framework is shown in Fig. 1. We first employ exteroceptive sensor data and robot trajectory to generate ground truth labels for image traversability segmentation in a self-supervised manner. We then design and train a multitask deep neural network as our front-end to provide multiple observations simultaneously. Our back-end runs a closed-form Bayesian inference for dense multilayer mapping where semantic information is leveraged in traversability estimation. The multitask learning (MTL) front-end not only achieves systematic efficiency, but also improves prediction performance over the Single-Task Learning (STL) equivalent. The multilayer Bayesian inference back-end is scalable and provides map uncertainty.
This work has the following contributions:
1. We propose a novel and extendable multitask multilayer Bayesian mapping framework to provide rich environmental information in a single mapping formalism.
2. We develop a multitask deep neural network for scene semantic and traversability segmentation.
3. We present a self-supervised approach to automatically generating training data for traversability segmentation.
4. We formulate a scalable and dense multilayer mapping algorithm via closed-form Bayesian inference that leverages inter-layer correlations.
5. We provide an open-source implementation of the proposed method and present extensive experiments using real and simulated data. We also discuss the reproducibility and extendability of the developed mapping framework.
The remainder of this paper is organized as follows. A review of the related work on multilayer robotic mapping, self-supervised learning for traversability estimation and deep MTL is given in Section II. Section III describes the design of our multitask deep network, and how we generate labeled traversability data for training without requiring manual annotation. Section IV formulates our multilayer Bayesian map inference in the semantic-traversability case. Experiments and discussions are presented in Section V and Section VI, and finally, Section VII concludes the paper.
## II Related Work
In this section, we review the existing literature on multilayer robotic mapping, self-supervised traversability estimation, and deep MTL. | 2106.14986v2.mmd |
angular.module('stx.core.directives')
.directive('stBackButton', ['$window', function ($window) {
return {
restrict: 'A',
link: function (scope, element, attrs) {
element.bind('click', function () {
scope.back();
});
}
};
}])
; | sciencetrax/stx-portal-src/app/core/directives/backButton.js |
(function() {
/**
* Task's wizard tabs index
*/
Ext.define('CMDBuild.view.administration.tasks.connector.CMTaskTabs', {
constructor: function() {
this.step1 = Ext.create('CMDBuild.view.administration.tasks.connector.CMStep1');
this.step2 = Ext.create('CMDBuild.view.administration.tasks.common.CMStepCronConfiguration');
this.step3 = Ext.create('CMDBuild.view.administration.tasks.connector.CMStep3');
this.step4 = Ext.create('CMDBuild.view.administration.tasks.connector.CMStep4');
this.step5 = Ext.create('CMDBuild.view.administration.tasks.connector.CMStep5');
this.step6 = Ext.create('CMDBuild.view.administration.tasks.connector.CMStep6');
this.step7 = Ext.create('CMDBuild.view.administration.tasks.connector.CMStep7');
},
getTabs: function() {
return [this.step1, this.step2, this.step3, this.step4, this.step5, this.step6, this.step7];
}
});
})(); | jzinedine/CMDBuild-cmdbuild/src/main/webapp/javascripts/cmdbuild/view/administration/tasks/connector/CMTaskTabs.js |
var expect = require('expect.js');
var gulp = require('gulp');
var slushfile = require('../slushfile');
describe('slush-saci-android generator', function() {
it('should register default gulp task', function() {
expect(gulp.tasks.default.name).to.be('default');
});
});
| benjamine/slush-saci-android-test/test.js |
package jp.setsulla.bantorra.siron;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
} | TE-ToshiakiTanaka/bantorra.old-lib/adb/apk/Siron/app/src/androidTest/java/jp/setsulla/bantorra/siron/ApplicationTest.java |
Balka Karachayevskaya - Wikipedia
Tiganos: 44°05′50″N 42°17′24″E / 44.09724°N 42.29004°Ö / 44.09724; 42.29004
Balka Karachayevskaya
Balka Karachayevskaya (Балка Карачаевская)
44°05′50″N 42°17′24″E / 44.09724°N 42.29004°Ö / 44.09724; 42.29004
Dalog ang Balka Karachayevskaya (Rinuso: Балка Карачаевская) sa Rusya.[1] Nahimutang ni sa lalawigan sa Karachayevo-Cherkesiya, sa habagatan-kasadpang bahin sa nasod, 1,300 km sa habagatan sa Moscow ang ulohan sa nasod.
Ang klima klima sa kontinente.[2] Ang kasarangang giiniton 9 °C. Ang kinainitan nga bulan Agosto, sa 20 °C, ug ang kinabugnawan Enero, sa -6 °C.[3] Ang kasarangang pag-ulan 916 milimetro matag tuig. Ang kinabasaan nga bulan Hunyo, sa 133 milimetro nga ulan, ug ang kinaugahan Pebrero, sa 39 milimetro.[4]
Nahimutangan sa Balka Karachayevskaya sa Rusya.
↑ Balka Karachayevskaya sa Geonames.org (cc-by); post updated 2012-01-21; database download sa 2017-01-07
Gikuha gikan sa "https://ceb.wikipedia.org/w/index.php?title=Balka_Karachayevskaya&oldid=22447608"
Kining maong panid kataposang giusab niadtong 14 Mayo 2018 sa 02:46. | c4-ceb |
using System;
namespace InControl
{
// @cond nodoc
[AutoDiscover]
public class LogitechF310ModeDMacProfile : UnityInputDeviceProfile
{
public LogitechF310ModeDMacProfile()
{
Name = "Logitech F310 Controller";
Meta = "Logitech F310 Controller on Mac (Mode D)";
SupportedPlatforms = new[] {
"OS X"
};
JoystickNames = new[] {
"Logitech Logitech Dual Action"
};
ButtonMappings = new[] {
new InputControlMapping {
Handle = "A",
Target = InputControlType.Action1,
Source = Button1
},
new InputControlMapping {
Handle = "B",
Target = InputControlType.Action2,
Source = Button2
},
new InputControlMapping {
Handle = "X",
Target = InputControlType.Action3,
Source = Button0
},
new InputControlMapping {
Handle = "Y",
Target = InputControlType.Action4,
Source = Button3
},
new InputControlMapping {
Handle = "Left Bumper",
Target = InputControlType.LeftBumper,
Source = Button4
},
new InputControlMapping {
Handle = "Right Bumper",
Target = InputControlType.RightBumper,
Source = Button5
},
new InputControlMapping {
Handle = "Left Stick Button",
Target = InputControlType.LeftStickButton,
Source = Button10
},
new InputControlMapping {
Handle = "Right Stick Button",
Target = InputControlType.RightStickButton,
Source = Button11
},
new InputControlMapping {
Handle = "Back",
Target = InputControlType.Back,
Source = Button8
},
new InputControlMapping {
Handle = "Start",
Target = InputControlType.Start,
Source = Button9
},
new InputControlMapping {
Handle = "Left Trigger",
Target = InputControlType.LeftTrigger,
Source = Button6
},
new InputControlMapping {
Handle = "Right Trigger",
Target = InputControlType.RightTrigger,
Source = Button7
},
};
AnalogMappings = new[] {
LeftStickLeftMapping( Analog0 ),
LeftStickRightMapping( Analog0 ),
LeftStickUpMapping( Analog1 ),
LeftStickDownMapping( Analog1 ),
RightStickLeftMapping( Analog2 ),
RightStickRightMapping( Analog2 ),
RightStickUpMapping( Analog3 ),
RightStickDownMapping( Analog3 ),
DPadLeftMapping( Analog4 ),
DPadRightMapping( Analog4 ),
DPadUpMapping( Analog5 ),
DPadDownMapping( Analog5 ),
};
}
}
// @endcond
}
| Zammy/ProjectRevolver-Project Revolver/Assets/InControl/Source/Unity/DeviceProfiles/LogitechF310ModeDMacProfile.cs |
/* Copyright (c) 2013 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//
// GTLComputeAccessConfig.h
//
// ----------------------------------------------------------------------------
// NOTE: This file is generated from Google APIs Discovery Service.
// Service:
// Compute Engine API (compute/v1beta14)
// Description:
// API for the Google Compute Engine service.
// Documentation:
// https://developers.google.com/compute/docs/reference/v1beta14
// Classes:
// GTLComputeAccessConfig (0 custom class methods, 4 custom properties)
#if GTL_BUILT_AS_FRAMEWORK
#import "GTL/GTLObject.h"
#else
#import "GTLObject.h"
#endif
// ----------------------------------------------------------------------------
//
// GTLComputeAccessConfig
//
// An access configuration attached to an instance's network interface.
@interface GTLComputeAccessConfig : GTLObject
// Type of the resource.
@property (copy) NSString *kind;
// Name of this access configuration.
@property (copy) NSString *name;
// An external IP address associated with this instance. Specify an unused
// static IP address available to the project. If not specified, the external IP
// will be drawn from a shared ephemeral pool.
@property (copy) NSString *natIP;
// Type of configuration. Must be set to "ONE_TO_ONE_NAT". This configures
// port-for-port NAT to the internet.
@property (copy) NSString *type;
@end
| hash3r/ios-app-youtube-token-test-iosapp-token-test/Pods/Google-API-Client/Source/Services/Compute/Generated/GTLComputeAccessConfig.h |
namespace Peygir.Presentation.Forms
{
partial class TicketHistoryForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TicketHistoryForm));
this.groupBox = new System.Windows.Forms.GroupBox();
this.ticketHistoryDetailsUserControl = new Peygir.Presentation.UserControls.TicketHistoryDetailsUserControl();
this.ticketHistoryListUserControl = new Peygir.Presentation.UserControls.TicketHistoryListUserControl();
this.okButton = new System.Windows.Forms.Button();
this.groupBox.SuspendLayout();
this.SuspendLayout();
//
// groupBox
//
resources.ApplyResources(this.groupBox, "groupBox");
this.groupBox.Controls.Add(this.ticketHistoryDetailsUserControl);
this.groupBox.Name = "groupBox";
this.groupBox.TabStop = false;
//
// ticketHistoryDetailsUserControl
//
resources.ApplyResources(this.ticketHistoryDetailsUserControl, "ticketHistoryDetailsUserControl");
this.ticketHistoryDetailsUserControl.DateTimeFormatter = null;
this.ticketHistoryDetailsUserControl.Name = "ticketHistoryDetailsUserControl";
this.ticketHistoryDetailsUserControl.ReadOnly = false;
//
// ticketHistoryListUserControl
//
resources.ApplyResources(this.ticketHistoryListUserControl, "ticketHistoryListUserControl");
this.ticketHistoryListUserControl.DateTimeFormatter = null;
this.ticketHistoryListUserControl.Name = "ticketHistoryListUserControl";
//
// okButton
//
resources.ApplyResources(this.okButton, "okButton");
this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
this.okButton.Image = global::Peygir.Presentation.Forms.Properties.Resources.Image_OK;
this.okButton.Name = "okButton";
this.okButton.UseVisualStyleBackColor = true;
//
// TicketHistoryForm
//
this.AcceptButton = this.okButton;
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.okButton;
this.Controls.Add(this.okButton);
this.Controls.Add(this.ticketHistoryListUserControl);
this.Controls.Add(this.groupBox);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "TicketHistoryForm";
this.ShowInTaskbar = false;
this.groupBox.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox;
private UserControls.TicketHistoryListUserControl ticketHistoryListUserControl;
private UserControls.TicketHistoryDetailsUserControl ticketHistoryDetailsUserControl;
private System.Windows.Forms.Button okButton;
}
} | amir-saniyan/Peygir-Peygir.Presentation.Forms/TicketHistoryForm.Designer.cs |
import java.util.ArrayList;
public class Vertex {
private int value;
private ArrayList<Vertex> neighboursOfTheVertex;
public boolean wasVisited;
public Vertex(int value) {
this.value = value;
wasVisited = false;
neighboursOfTheVertex = new ArrayList<Vertex>();
}
public ArrayList<Vertex> getNeighboursOfTheVertex() {
return neighboursOfTheVertex;
}
public int getValue() {
return value;
}
public void addNeighbour(Vertex v) {
neighboursOfTheVertex.add(v);
}
}
| magiclud/Sieci--graf-src/Vertex.java |
export const today = 'Today';
export const oneWeek = '1 week';
export const oneMonth = '1 month';
export const threeMonth = '3 months';
export const sixMonth = '6 months';
export const oneYear = '1 year';
export const GetNameByPeriod = {
0: today,
1: oneWeek,
2: oneMonth,
3: threeMonth,
4: sixMonth,
5: oneYear,
};
export const GetPeriodByName = {
[today]: 0,
[oneWeek]: 1,
[oneMonth]: 2,
[threeMonth]: 3,
[sixMonth]: 4,
[oneYear]: 5,
};
// The count of ticks in x-axis
export const GetTicksByPeriod = {
0: 1,
1: 7,
2: 7,
3: 12,
4: 12,
5: 12,
};
const periodEnum = {
...GetPeriodByName,
...GetNameByPeriod,
};
export default periodEnum;
| oopDaniel/dow-30-visualization-src/consts/periodEnum.js |
var tag = function (elm, tag){ return elm.getElementsByTagName(tag); };
var tf = new TableFilter('demo', {
base_path: '../dist/tablefilter/',
extensions:[{
name: 'sort',
types:[
'String',
'Number',
'String',
'String',
'EU',
'US',
'String',
'dmydate',
'mdydate'
],
on_sort_loaded: start
}]
});
tf.init();
function start(tf, sort){
module('Sanity checks');
test('Sort extension', function() {
notEqual(sort, null, 'Sort instanciated');
deepEqual(sort.stt instanceof SortableTable, true, 'Sort type');
deepEqual(sort.sorted, false, 'Table not sorted');
deepEqual(sort.initialized, true, 'Sort initialized');
});
module('UI elements');
test('Sort UI elements', function() {
var th = tf.getHeaderElement(0),
indicator = tag(th, 'img'),
validRows = tf.getValidRows(true);
deepEqual(indicator.length, 1, 'Sort indicator in header element');
deepEqual(
(tf.tbl.rows[validRows[0]].cells[1]).innerHTML,
'AUY78',
'First custom key cell text before sorting');
});
test('Sort behaviour', function() {
validRows = tf.getValidRows();
sort.sortByColumnIndex(1);
deepEqual(sort.sorted, true, 'Table column sorted');
deepEqual(
(tf.tbl.rows[validRows[0]].cells[1]).innerHTML,
'QT1',
'First custom key cell text after sorting');
});
module('Destroy and re-init');
test('Remove sort', function() {
sort.destroy();
var th = tf.getHeaderElement(0),
indicator = tag(th, 'img');
deepEqual(sort.initialized, false, 'Sort is removed');
deepEqual(indicator.length, 0, 'Sort indicator is removed');
});
}
| marcdouguet/motif-postaco/js/TableFilter/test/test-sort-key.js |
package ess
//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//
//http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing, software
//distributed under the License is distributed on an "AS IS" BASIS,
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//See the License for the specific language governing permissions and
//limitations under the License.
//
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
)
// DescribeCapacityHistory invokes the ess.DescribeCapacityHistory API synchronously
// api document: https://help.aliyun.com/api/ess/describecapacityhistory.html
func (client *Client) DescribeCapacityHistory(request *DescribeCapacityHistoryRequest) (response *DescribeCapacityHistoryResponse, err error) {
response = CreateDescribeCapacityHistoryResponse()
err = client.DoAction(request, response)
return
}
// DescribeCapacityHistoryWithChan invokes the ess.DescribeCapacityHistory API asynchronously
// api document: https://help.aliyun.com/api/ess/describecapacityhistory.html
// asynchronous document: https://help.aliyun.com/document_detail/66220.html
func (client *Client) DescribeCapacityHistoryWithChan(request *DescribeCapacityHistoryRequest) (<-chan *DescribeCapacityHistoryResponse, <-chan error) {
responseChan := make(chan *DescribeCapacityHistoryResponse, 1)
errChan := make(chan error, 1)
err := client.AddAsyncTask(func() {
defer close(responseChan)
defer close(errChan)
response, err := client.DescribeCapacityHistory(request)
if err != nil {
errChan <- err
} else {
responseChan <- response
}
})
if err != nil {
errChan <- err
close(responseChan)
close(errChan)
}
return responseChan, errChan
}
// DescribeCapacityHistoryWithCallback invokes the ess.DescribeCapacityHistory API asynchronously
// api document: https://help.aliyun.com/api/ess/describecapacityhistory.html
// asynchronous document: https://help.aliyun.com/document_detail/66220.html
func (client *Client) DescribeCapacityHistoryWithCallback(request *DescribeCapacityHistoryRequest, callback func(response *DescribeCapacityHistoryResponse, err error)) <-chan int {
result := make(chan int, 1)
err := client.AddAsyncTask(func() {
var response *DescribeCapacityHistoryResponse
var err error
defer close(result)
response, err = client.DescribeCapacityHistory(request)
callback(response, err)
result <- 1
})
if err != nil {
defer close(result)
callback(nil, err)
result <- 0
}
return result
}
// DescribeCapacityHistoryRequest is the request struct for api DescribeCapacityHistory
type DescribeCapacityHistoryRequest struct {
*requests.RpcRequest
ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"`
ScalingGroupId string `position:"Query" name:"ScalingGroupId"`
PageSize requests.Integer `position:"Query" name:"PageSize"`
EndTime string `position:"Query" name:"EndTime"`
StartTime string `position:"Query" name:"StartTime"`
OwnerId requests.Integer `position:"Query" name:"OwnerId"`
PageNumber requests.Integer `position:"Query" name:"PageNumber"`
}
// DescribeCapacityHistoryResponse is the response struct for api DescribeCapacityHistory
type DescribeCapacityHistoryResponse struct {
*responses.BaseResponse
RequestId string `json:"RequestId" xml:"RequestId"`
TotalCount int `json:"TotalCount" xml:"TotalCount"`
PageNumber int `json:"PageNumber" xml:"PageNumber"`
PageSize int `json:"PageSize" xml:"PageSize"`
CapacityHistoryItems CapacityHistoryItems `json:"CapacityHistoryItems" xml:"CapacityHistoryItems"`
}
// CreateDescribeCapacityHistoryRequest creates a request to invoke DescribeCapacityHistory API
func CreateDescribeCapacityHistoryRequest() (request *DescribeCapacityHistoryRequest) {
request = &DescribeCapacityHistoryRequest{
RpcRequest: &requests.RpcRequest{},
}
request.InitWithApiInfo("Ess", "2014-08-28", "DescribeCapacityHistory", "ess", "openAPI")
return
}
// CreateDescribeCapacityHistoryResponse creates a response to parse from DescribeCapacityHistory response
func CreateDescribeCapacityHistoryResponse() (response *DescribeCapacityHistoryResponse) {
response = &DescribeCapacityHistoryResponse{
BaseResponse: &responses.BaseResponse{},
}
return
}
| xiaozhu36/terraform-provider-vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ess/describe_capacity_history.go |
'''
* TeleStax, Open Source Cloud Communications
* Copyright 2011-2016, Telestax Inc and individual contributors
* by the @authors tag.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
This code was generated by :
Name: Md Sharique
Email : [email protected]
'''
import sys
from http.server import HTTPServer
from http.server import SimpleHTTPRequestHandler
def main():
HandlerClass = SimpleHTTPRequestHandler
ServerClass = HTTPServer
Protocol = "HTTP/1.0"
if sys.argv[1:]:
port = int(sys.argv[1])
else:
port = 8000
server_address = ('192.168.1.76', port)
HandlerClass.protocol_version = Protocol
httpd = ServerClass(server_address, HandlerClass)
sa = httpd.socket.getsockname()
print ("Serving HTTP on", sa[0], "port", sa[1], "...")
httpd.serve_forever()
if __name__ == '__main__':
main()
| RestComm/restcomm-sdk-python-Restcomm_Python_SDk/Test/CreateLocalServer/createServer.py |
'use strict';
var http = require('http');
var https = require('https');
var url = require('url');
var getRawBody = require('raw-body');
var isUnset = require('./isUnset');
function extend(obj, source, skips) {
if (!source) {
return obj;
}
for (var prop in source) {
if (!skips || skips.indexOf(prop) === -1) {
obj[prop] = source[prop];
}
}
return obj;
}
function parseHost(Container) {
var host = Container.params.host;
var req = Container.user.req;
var options = Container.options;
host = (typeof host === 'function') ? host(req) : host.toString();
if (!host) {
return new Error('Empty host parameter');
}
if (!/http(s)?:\/\//.test(host)) {
host = 'http://' + host;
}
var parsed = url.parse(host);
if (!parsed.hostname) {
return new Error('Unable to parse hostname, possibly missing protocol://?');
}
var ishttps = options.https || parsed.protocol === 'https:';
return {
host: parsed.hostname,
port: parsed.port || (ishttps ? 443 : 80),
module: ishttps ? https : http,
};
}
function reqHeaders(req, options) {
var headers = options.headers || {};
var skipHdrs = [ 'connection', 'content-length' ];
if (!options.preserveHostHdr) {
skipHdrs.push('host');
}
var hds = extend(headers, req.headers, skipHdrs);
hds.connection = 'close';
return hds;
}
function createRequestOptions(req, res, options) {
// prepare proxyRequest
var reqOpt = {
headers: reqHeaders(req, options),
method: req.method,
path: req.path,
params: req.params,
};
if (options.preserveReqSession) {
reqOpt.session = req.session;
}
return Promise.resolve(reqOpt);
}
// extract to bodyContent object
function bodyContent(req, res, options) {
var parseReqBody = isUnset(options.parseReqBody) ? true : options.parseReqBody;
function maybeParseBody(req, limit) {
if (req.body) {
return Promise.resolve(req.body);
} else {
// Returns a promise if no callback specified and global Promise exists.
return getRawBody(req, {
length: req.headers['content-length'],
limit: limit,
});
}
}
if (parseReqBody) {
return maybeParseBody(req, options.limit);
}
}
module.exports = {
create: createRequestOptions,
bodyContent: bodyContent,
parseHost: parseHost
};
| villadora/express-http-proxy-lib/requestOptions.js |
Η Ε.Ε. ενέκρινε τη σήμανση προϊόντων των (παράνομων) ισραηλινών εποικισμών | Σύλλογος Ιντιφάντα
Η Κομισιόν, το εκτελεστικό όργανο της Ε.Ε., είπε ότι ο φορέας υιοθέτησε την ερμηνευτική οδηγία για την «ένδειξη προέλευσης των αγαθών από εδάφη που κατέχει το Ισραήλ από τον Ιούνιο του 1967».
Η οδηγία βασίζεται σε προϋπάρχουσα νομοθεσία και θα διασφαλίζει ότι όταν η ένδειξη προέλευσης στα προϊόντα θα είναι υποχρεωτική, τα προϊόντα των εποικισμών δεν θα μπορούν να χαρακτηρίζονται ως «Made in Israel».
«Εφόσον τα Υψίπεδα του Γκολάν και η Δυτική Όχθη, συμπεριλαμβανομένης της Ανατολικής Ιερουσαλήμ, δεν αποτελούν μέρος της ισραηλινής επικράτειας, σύμφωνα με το διεθνές δίκαιο, η ένδειξη «προϊόν από το Ισραήλ» θεωρείται ανακριβής και παραπλανητική κατά το πνεύμα της σχετικής νομοθεσίας», δήλωσε η Ε.Ε.
Τα προϊόντα που παράγονται στους ισραηλινούς εποικισμούς στη Δυτική Όχθη ή στα Υψίπεδα του Γκολάν, θα πρέπει να περιλαμβάνουν τον όρο «ισραηλινός εποικισμός», προσθέτει η οδηγία, και μπορούν είτε να φέρουν την ένδειξη «προϊόν των Υψιπέδων του Γκολάν (ισραηλινός εποικισμός)», είτε «προϊόν της Δυτικής Όχθης (ισραηλινός εποικισμός)».
Τα παλαιστινιακά προϊόντα θα μπορούν να φέρουν την ένδειξη «προϊόν της Δυτικής Όχθης (παλαιστινιακό προϊόν)», «προϊόν από τη Γάζα» ή «προϊόν από την Παλαιστίνη».
Η σήμανση θα είναι υποχρεωτική για τα φρέσκα φρούτα και λαχανικά, το κρασί, το μέλι, το ελαιόλαδο, τα αυγά, τα πουλερικά, οργανικά προϊόντα και καλλυντικά, ενώ εθελοντική θα είναι για βιομηχανικά προϊόντα και συσκευασμένα τρόφιμα.
Ωστόσο, η Ε.Ε. πρόσθεσε ότι οι κανονισμοί δεν αποσκοπούν στο μποϊκοτάζ των ισραηλινών εξαγωγών από τους εποικισμούς, το οποίο όπως είπε, δεν υποστηρίζει «με κανένα τρόπο».
Αντίθετα δήλωσε ότι «η ένδειξη προέλευσης θα δώσει στους καταναλωτές τη δυνατότητα για μια ενημερωμένη επιλογή».
Ο Γενικός Γραμματέας της PLO, Σάεμπ Ερεκάτ, καλωσόρισε την κίνηση, αποκαλώντας την «μια σημαντική κίνηση προς το καθολικό μποϊκοτάζ των ισραηλινών εποικισμών, που είναι χτισμένοι παράνομα σε κατεχόμενη παλαιστινιακή γη».
«Η Ε.Ε. για μια ακόμα φορά κινήθηκε από το επίπεδο των δηλώσεων στη λήψη συγκεκριμένων πολιτικών αποφάσεων. Πιστεύουμε ότι χρει | c4-el |
// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
//
// Reference.h: Rcpp R/C++ interface class library -- Reference class objects
//
// Copyright (C) 2010 - 2015 Dirk Eddelbuettel and Romain Francois
//
// This file is part of Rcpp.
//
// Rcpp 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.
//
// Rcpp 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 Rcpp. If not, see <http://www.gnu.org/licenses/>.
#ifndef Rcpp_Reference_h
#define Rcpp_Reference_h
namespace Rcpp{
/**
* S4 object (of a reference class)
*/
RCPP_API_CLASS(Reference_Impl),
public FieldProxyPolicy<Reference_Impl<StoragePolicy> >
{
public:
Reference_Impl() {}
RCPP_GENERATE_CTOR_ASSIGN(Reference_Impl)
/**
* checks that x is an S4 object of a reference class and wrap it.
*
* @param x must be an S4 object of some reference class
*/
Reference_Impl(SEXP x) {
Storage::set__(x) ;
}
Reference_Impl& operator=( SEXP other ) {
Storage::set__(other) ;
return *this ;
}
/**
* Creates an reference object of the requested class.
*
* @param klass name of the target reference class
* @throw reference_creation_error if klass does not map to a known S4 class
*/
Reference_Impl( const std::string& klass ) {
SEXP newSym = Rf_install("new");
Shield<SEXP> call( Rf_lang2( newSym, Rf_mkString( klass.c_str() ) ) );
Storage::set__( Rcpp_eval( call , Rcpp::internal::get_Rcpp_namespace()) );
}
void update( SEXP x){
if( ! ::Rf_isS4(x) ) throw not_reference();
}
} ;
typedef Reference_Impl<PreserveStorage> Reference;
} // namespace Rcpp
#endif
| mycpp/mycpp.github.io-packrat/lib/x86_64-w64-mingw32/3.3.2/Rcpp/include/Rcpp/Reference.h |
//>>built
define("dojox/editor/plugins/nls/zh/Save",{save:"\u4fdd\u5b58"}); | aconyteds/Esri-Ozone-Map-Widget-vendor/js/esri/arcgis_js_api/library/3.12/3.12compact/dojox/editor/plugins/nls/zh/Save.js |
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
var should = require('should');
var util = require('util');
var msRestAzure = require('ms-rest-azure');
var _ = require('underscore');
var testutil = require('../../util/util');
var SuiteBase = require('../../framework/suite-base');
var dump = util.inspect;
var AuthorizationClient = require('../../../lib/services/resourceManagement/lib/authorization/authorizationClient');
var ResourceManagementClient = require('../../../lib/services/resourceManagement/lib/resource/resourceManagementClient');
var testPrefix = 'authorizationClient-tests';
var groupPrefix = 'nodeTestGroup';
var createdGroups = [];
var requiredEnvironment = [
{ name: 'AZURE_TEST_LOCATION', defaultValue: 'West US' }
];
var suite;
var client;
var testLocation;
var groupName;
describe('Authorization Client', function () {
before(function (done) {
suite = new SuiteBase(this, testPrefix, requiredEnvironment);
suite.setupSuite(function () {
groupName = suite.generateId(groupPrefix, createdGroups, suite.isMocked);
client = new AuthorizationClient(suite.credentials, suite.subscriptionId);
testLocation = process.env['AZURE_TEST_LOCATION'];
if (suite.isPlayback) {
client.longRunningOperationRetryTimeoutInSeconds = 0;
}
suite.createResourcegroup(groupName, testLocation, function (err, result) {
should.not.exist(err);
done();
});
});
});
after(function (done) {
suite.teardownSuite(function () {
suite.deleteResourcegroup(groupName, function (err, result) {
should.not.exist(err);
done();
});
});
});
beforeEach(function (done) {
suite.setupTest(done);
});
afterEach(function (done) {
suite.baseTeardownTest(done);
});
describe('Management Lock Operations', function () {
var lockName = 'testlock1';
var lockLevel = 'CanNotDelete';
it('should work for all operations possible', function (done) {
var lockParameters = {
properties: {
level: lockLevel,
notes: 'Optional text.'
}
};
client.managementLocks.createOrUpdateAtResourceGroupLevel(groupName, lockName, lockParameters, function (err, result) {
should.not.exist(err);
should.exist(result.body);
client.managementLocks.get(lockName, function (error, result) {
//should.not.exist(err);
//should.exist(result.body);
client.managementLocks.listAtResourceGroupLevel(groupName, { properties: { level: lockLevel } }, function (err, result) {
should.not.exist(err);
should.exist(result.body);
result.response.statusCode.should.equal(200);
var locks = result.body.value;
locks.length.should.be.above(0);
locks.some(function (item) {
return item.name.should.equal(lockName);
}).should.be.true;
client.managementLocks.listAtSubscriptionLevel(null, function (err, result) {
should.not.exist(err);
should.exist(result.body);
result.response.statusCode.should.equal(200);
var locks = result.body.value;
locks.length.should.be.above(0);
locks.some(function (item) {
return item.name.should.equal(lockName);
}).should.be.true;
client.managementLocks.deleteAtResourceGroupLevel(groupName, lockName, function (err, result) {
should.not.exist(err);
result.response.statusCode.should.equal(200);
done();
});
});
});
});
});
});
});
}); | amarzavery/cool_sdk-test/services/resourceManagement/authorizationClient-tests.js |
namespace TraceSpy
{
partial class ColorizerEdit
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ColorizerEdit));
this.buttonCancel = new System.Windows.Forms.Button();
this.buttonOK = new System.Windows.Forms.Button();
this.checkBoxIgnoreCase = new System.Windows.Forms.CheckBox();
this.textBoxDefinition = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.checkBoxActive = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// buttonCancel
//
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.Location = new System.Drawing.Point(240, 143);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 23);
this.buttonCancel.TabIndex = 5;
this.buttonCancel.Text = "&Cancel";
this.buttonCancel.UseVisualStyleBackColor = true;
//
// buttonOK
//
this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.buttonOK.Enabled = false;
this.buttonOK.Location = new System.Drawing.Point(159, 143);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 23);
this.buttonOK.TabIndex = 4;
this.buttonOK.Text = "&OK";
this.buttonOK.UseVisualStyleBackColor = true;
//
// checkBoxIgnoreCase
//
this.checkBoxIgnoreCase.AutoSize = true;
this.checkBoxIgnoreCase.Checked = true;
this.checkBoxIgnoreCase.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxIgnoreCase.Location = new System.Drawing.Point(78, 120);
this.checkBoxIgnoreCase.Name = "checkBoxIgnoreCase";
this.checkBoxIgnoreCase.Size = new System.Drawing.Size(83, 17);
this.checkBoxIgnoreCase.TabIndex = 2;
this.checkBoxIgnoreCase.Text = "Ignore Case";
this.checkBoxIgnoreCase.UseVisualStyleBackColor = true;
//
// textBoxDefinition
//
this.textBoxDefinition.Location = new System.Drawing.Point(78, 12);
this.textBoxDefinition.Multiline = true;
this.textBoxDefinition.Name = "textBoxDefinition";
this.textBoxDefinition.Size = new System.Drawing.Size(385, 102);
this.textBoxDefinition.TabIndex = 1;
this.textBoxDefinition.TextChanged += new System.EventHandler(this.TextBoxDefinitionTextChanged);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(13, 15);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(54, 13);
this.label2.TabIndex = 0;
this.label2.Text = "Definition:";
//
// checkBoxActive
//
this.checkBoxActive.AutoSize = true;
this.checkBoxActive.Checked = true;
this.checkBoxActive.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxActive.Location = new System.Drawing.Point(167, 120);
this.checkBoxActive.Name = "checkBoxActive";
this.checkBoxActive.Size = new System.Drawing.Size(56, 17);
this.checkBoxActive.TabIndex = 3;
this.checkBoxActive.Text = "Active";
this.checkBoxActive.UseVisualStyleBackColor = true;
//
// ColorizerEdit
//
this.AcceptButton = this.buttonOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.buttonCancel;
this.ClientSize = new System.Drawing.Size(475, 178);
this.Controls.Add(this.checkBoxActive);
this.Controls.Add(this.checkBoxIgnoreCase);
this.Controls.Add(this.textBoxDefinition);
this.Controls.Add(this.label2);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ColorizerEdit";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Colorizer";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ColorizerEditFormClosing);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.CheckBox checkBoxIgnoreCase;
private System.Windows.Forms.TextBox textBoxDefinition;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.CheckBox checkBoxActive;
}
} | smourier/TraceSpy-TraceSpy/ColorizerEdit.Designer.cs |
'use strict';
angular.module('myApp.home', ['ngRoute'])
// Declared route
.config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/home', {
templateUrl: 'views/home/home.html',
controller: 'HomeCtrl'
});
}])
// Home controller
.controller('HomeCtrl', [function() {
}]); | nick-feifan/healthwise-test/views/home/home.js |
››Convert perch to fall [English]
perch fall
Did you mean to convert perch perch perch [Ireland] to fall [English] fall [Scots] fall [English] fall [Scotland]
How many perch in 1 fall? The answer is 1.8594185744641.
We assume you are converting between perch and fall [English].
You can view more details on each measurement unit:
perch or fall
The SI derived unit for area is the square meter.
1 square meter is equal to 0.039536861034746 perch, or 0.021263023601956 fall.
Note that rounding errors may occur, so always check the results.
Use this page to learn how to convert between perch and fall [English].
Type in your own numbers in the form to convert the units!
››Quick conversion chart of perch to fall
1 perch to fall = 0.5378 fall
5 perch to fall = 2.68901 fall
10 perch to fall = 5.37803 fall
20 perch to fall = 10.75605 fall
30 perch to fall = 16.13408 fall
40 perch to fall = 21.5121 fall
50 perch to fall = 26.89013 fall
75 perch to fall = 40.33519 fall
100 perch to fall = 53.78025 fall
››Want other units?
You can do the reverse unit conversion from fall to perch, or enter any two units below:
Enter two units to convert
From: To:
››Metric conversions and more
ConvertUnits.com provides an online conversion calculator for all types of measurement units. You can find metric conversion tables for SI units, as well as English units, currency, and other data. Type in unit symbols, abbreviations, or full names for units of length, area, mass, pressure, and other types. Examples include mm, inch, 100 kg, US fluid ounce, 6'3", 10 stone 4, cubic cm, metres squared, grams, moles, feet per second, and many more! | finemath-3plus |
//
// UIScrollView+XO.h
// Scooby
//
// Created by Scott Petit on 1/14/13.
// Copyright (c) 2013 Scott Petit. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIScrollView (XO)
@property (nonatomic, readonly) CGFloat xPercentageOffset;
@property (nonatomic, readonly) CGFloat yPercentageOffset;
- (void)xo_scrollToTop;
- (void)xo_scrollToTopAnimated:(BOOL)animated;
- (void)xo_scrollToVerticalPercentage:(CGFloat)percentage animated:(BOOL)animated;
- (void)xo_scrollToHorizontalPercentage:(CGFloat)percentage animated:(BOOL)animated;
@end
| ScottPetit/XOToolKit-XOToolKit/XOToolKit/Categories/UIScrollView+XO.h |
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* nm-l2tp-service - L2TP VPN integration with NetworkManager
*
* 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.
*
* (C) Copyright 2007 - 2008 Novell, Inc.
*/
#ifndef NM_PPP_STATUS_H
#define NM_PPP_STATUS_H
typedef enum {
NM_PPP_STATUS_UNKNOWN,
NM_PPP_STATUS_DEAD,
NM_PPP_STATUS_INITIALIZE,
NM_PPP_STATUS_SERIALCONN,
NM_PPP_STATUS_DORMANT,
NM_PPP_STATUS_ESTABLISH,
NM_PPP_STATUS_AUTHENTICATE,
NM_PPP_STATUS_CALLBACK,
NM_PPP_STATUS_NETWORK,
NM_PPP_STATUS_RUNNING,
NM_PPP_STATUS_TERMINATE,
NM_PPP_STATUS_DISCONNECT,
NM_PPP_STATUS_HOLDOFF,
NM_PPP_STATUS_MASTER
} NMPPPStatus;
#endif /* NM_PPP_STATUS_H */
| ndorf/NetworkManager-l2tp-src/nm-ppp-status.h |
Zpravodajský kamion s kapitány Gábinou a Romanem zakotvil tentokrát v Náchodě | Prima jede… za vámi
Prima jede... Náchod 2015 - Obrázek 11Foto: archiv Prima Roadshow Prima jede... za vámi má za sebou další zastávku. Zpravodajský kamion tentokrát kotvil v Náchodě. Zprávy FTV Prima moderovali Gabriela Kratochvílová a Roman Šebrle, v rámci doprovodného programu pak vystoupil i oblíbený herec z Cest domů Miroslav Etzler.
"I přes nepřízeň počasí byla na náměstí v Náchodě spousta lidí. Diváci nás vřele přijali. Vysílání Zpráv jsme si s Romanem užili, už teď se těším na pražské publikum příští sobotu," říká moderátorka Zpráv FTV Prima Gabriela Kratochvílová."V Náchodě mi to znovu připomnělo, že tahle práce má smysl. A i když občas zapršelo, lidi nás v tom nenechali, těším se na ně na naší další zastávce," dodal Roman Šebrle.Krimi zprávy z Náchoda moderovala Bára Kozáková, která si našla čas i na krátký výlet. "S přítelem jsme si stihli prohlédnout Státní zámek Náchod. Město mě opravdu okouzlilo, lidi jsou velmi milí. Ráda se do Náchoda vrátím, s místními lidmi a energií, kterou nám dávali, se vysílalo fakt perfektně," doplnila s úsměvem moderátorka Krimi zpráv Bára Kozáková.Zpravodajské hodině jako tradičně předcházel velký doprovodný program, který v 15 hodin odstartovala Lucie Šilhánová. Na Masarykově náměstí postupně vystoupili ABBA STARS či muzikálové hvězdy Petr Poláček a Petra Doležalová. Seriálové fandy zase přišel pozdravit Miroslav Etzler, kterého diváci Primy znají jako Jana Maška z Cest domů.Na nejmenší čekal skákací hrad, malování na obličej, nafukování balónků a různé soutěže. Navíc i v Náchodě probíhal projekt Koruna za kilo, v rámci něhož je možné se zbavit drobného nepotřebného elektra a přispět na dobrou věc s partnerem roadshow Prima jede... za vámi, společností ASEKOL. Jak se takový elektroodpad třídí, ukázali na místě i Gabriela Kratochvílová a Roman Šebrle."Chytrý telefon vyhrává ten, kdo odevzdá do červeného kontejneru umístěného na náměstí nejvíce drobného vysloužilého elektra. Navíc za každý odevzdaný kilogram elektrozařízení věnuje společnost ASEKOL rovných 10 Kč nadačnímu fondu Rovná šance, který pomáhá handicapovaným nalézt práci," upřesnila manažerka komunikace společnosti ASEKOL Martina Ďaďová.V dalších týdnech zavítá roadshow Prima jede... za vámi i do Prahy, Ústí nad Labem, Tábora, Teplic, České Lípy, Písku, Mělníka a Žatce.Podívejte se na reportáž o Náchodě Článek
Území Broumovského výběžku ležícího severně od Náchoda bylo vyhlášeno za CHKO Broumovsko. Důvodem je pestrost a zachovalost krajinného rázu podhorské oblasti, bohaté... | c4-cs |
// ----------------------------------------------------------------------------
// Copyright 2007-2015, GeoTelematic Solutions, Inc.
// All rights reserved
// ----------------------------------------------------------------------------
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ----------------------------------------------------------------------------
// Change History:
// 2008/05/20 Martin D. Flynn
// -Initial release
// 2009/05/01 Martin D. Flynn
// -Added support for specifying replacement variables in encoded URLs.
// 2009/09/23 Martin D. Flynn
// -Added 'getTarget'
// ----------------------------------------------------------------------------
package org.opengts.war.tools;
import java.util.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import org.opengts.util.*;
import org.opengts.dbtools.*;
import org.opengts.db.*;
import org.opengts.war.tools.*;
public class WebPageURL
extends WebPageAdaptor
implements StringTools.ValueFilter
{
// ------------------------------------------------------------------------
private static int LinkCount = 0;
// ------------------------------------------------------------------------
private String urlString = null;
private String urlTarget = "_blank";
public WebPageURL()
{
this.setBaseURI("");
this.setPageName("link_" + (++LinkCount));
this.setLoginRequired(true);
}
// ------------------------------------------------------------------------
public String getURL()
{
return (this.urlString != null)? this.urlString : "";
}
public void setURL(String url)
{
this.urlString = (url != null)? url : "";
}
// ------------------------------------------------------------------------
public String getTarget()
{
return !StringTools.isBlank(this.urlTarget)? this.urlTarget : "_blank";
}
public void setTarget(String targ)
{
this.urlTarget = !StringTools.isBlank(targ)? targ : "_blank";
}
// ------------------------------------------------------------------------
// StringTools.ValueFilter interface
public String getFilteredValue(String value)
{
return URIArg.encodeArg(new StringBuffer(), value).toString();
}
public String encodePageURL(RequestProperties reqState)
{
return StringTools.replaceKeys(this.getURL(), reqState, this/*StringTools.ValueFilter*/);
}
public String encodePageURL(RequestProperties reqState, String command)
{
return this.encodePageURL(reqState);
}
//public String encodePageURL(RequestProperties reqState, String command, String cmdArg)
//{
// return this.encodePageURL(reqState);
//}
// ------------------------------------------------------------------------
public String getMenuName(RequestProperties reqState)
{
return "url";
}
// ------------------------------------------------------------------------
public String getMenuDescription(RequestProperties reqState, String parentMenuName)
{
String urlDesc = super.getMenuDescription(reqState, parentMenuName);
if (!StringTools.isBlank(urlDesc)) {
return urlDesc;
} else {
return this.encodePageURL(reqState);
}
}
// ------------------------------------------------------------------------
public void writePage(
final RequestProperties reqState,
final String pageMsg)
throws IOException
{
// no-op
}
// ------------------------------------------------------------------------
}
| paragp/GTS-PreUAT-src/org/opengts/war/tools/WebPageURL.java |
/**
* Class Item.
*
* @author Vadim Mironov ([email protected]/[email protected])
* @version $Id$
* @since 0.1
*/
package ru.job4j.tracker;
import java.util.Random;
/**
* Class Item.
*/
public class Item {
/**
* Random number to generate item id.
*/
private static Random random = new Random();
/**
* Id.
*/
private String id;
/**
* Name.
*/
private String name;
/**
* Description.
*/
private String desc;
/**
* Creation time.
*/
private long created;
/**
* Constructor.
* @param name - name of object
* @param desc - description of object
*/
public Item(String name, String desc) {
this.id = generateId();
this.name = name;
this.desc = desc;
this.created = System.currentTimeMillis();
}
/**
* Id getter.
* @return String - item id
*/
public String getId() {
return id;
}
/**
* Id setter.
* @param id - item id
*/
public void setId(String id) {
this.id = id;
}
/**
* Name getter.
* @return String - name
*/
public String getName() {
return name;
}
/**
* Description getter.
* @return String - desc
*/
public String getDesc() {
return desc;
}
/**
* Getter of creation date.
* @return long - creation date
*/
public long getCreated() {
return created;
}
/**
* Generator item id.
* @return String - item id
*/
private String generateId() {
return Long.toString(System.currentTimeMillis() + random.nextInt(100));
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Item item = (Item) o;
if (id != null ? !id.equals(item.id) : item.id != null) {
return false;
}
if (name != null ? !name.equals(item.name) : item.name != null) {
return false;
}
return desc != null ? desc.equals(item.desc) : item.desc == null;
}
@Override
public int hashCode() {
int result = id != null ? id.hashCode() : 0;
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (desc != null ? desc.hashCode() : 0);
return result;
}
} | MironovVadim/vmironov-chapter_002/src/main/java/ru/job4j/tracker/Item.java |
sap.ui.define([
"test/unit/model/models",
"test/unit/model/formatter",
"test/unit/model/FlaggedType",
"test/unit/model/DateFormatter"
], function() { "use strict"; });
| openui5/packaged-sap.m-test-resources/sap/m/demokit/tutorial/testing/16/webapp/test/unit/allTests.js |
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.sdk.wip;
import java.net.InetSocketAddress;
public class WipBrowserFactoryImpl implements WipBrowserFactory {
@Override
public WipBrowser createBrowser(InetSocketAddress socketAddress,
LoggerFactory connectionLoggerFactory) {
return new WipBrowserImpl(socketAddress, connectionLoggerFactory);
}
}
| develar/chromedevtools-wip/backend/src/org/chromium/sdk/wip/WipBrowserFactoryImpl.java |
/*
CETextFinder.h
CotEditor
http://coteditor.com
Created by 1024jp on 2015-01-03.
------------------------------------------------------------------------------
© 2015 1024jp
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#import <OgreKit/OgreTextFinder.h>
// notifications
/// Posted when text finder performed "Replace All." Object is target text view.
extern NSString *_Nonnull const CETextFinderDidReplaceAllNotification;
@interface CETextFinder : OgreTextFinder
@end
| yangchenghu/CotEditor-CotEditor/Sources/CETextFinder.h |
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode* invertTree(TreeNode* root) {
if (root == nullptr) {
return nullptr;
}
TreeNode* left = invertTree(root->left);
TreeNode* right = invertTree(root->right);
root->left = right;
root->right = left;
return root;
}
};
| jiadaizhao/LeetCode-0201-0300/0226-Invert Binary Tree/0226-Invert Binary Tree.cpp |
// Created file "tmp\src\dxguid\dxguid"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(TID_D3DRMMesh, 0x3d82ab44, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33);
| Frankie-PellesC/fSDK-Lib/src/dxguid8/dxguid0000017F.c |
#
# Copyright 2014 Red Hat, Inc.
#
# 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
#
# Refer to the README and COPYING files for full details of the license
#
"""
This module provides exceptions for the profiling package.
"""
class UsageError(Exception):
""" Raised when profiler is used incorrectly """
| txomon/vdsm-lib/vdsm/profiling/errors.py |
class searcherState {
public:
uint64 posnMax;
uint64 posnLen;
uint64 *posn;
#ifdef __APPLE__
uint32 pad;
#endif
double encodeTime;
double maskTime;
double searchTime;
double filterTime;
searcherState() {
posnMax = 16384;
posnLen = 0;
posn = new uint64 [ posnMax ];
encodeTime = 0.0;
maskTime = 0.0;
searchTime = 0.0;
filterTime = 0.0;
};
~searcherState() {
delete [] posn;
};
};
| macmanes-lab/wgs-assembler-kmer/seagen/searcherState.H |
# Neural Methods for Logical Reasoning over Knowledge Graphs
Alfonso Amayuelas\({}^{*\dagger}\), Shuai Zhang\({}^{\dagger}\), Susie Xi Rao\({}^{\dagger}\) & Ce Zhang\({}^{\dagger}\)
\({}^{*}\)EPFL
\({}^{\dagger}\)ETH Zurich
[email protected]
{shuazhang, raox, ce.zhang}@inf.ethz.ch
###### Abstract
Reasoning is a fundamental problem for computers and deeply studied in Artificial Intelligence. In this paper, we specifically focus on answering multi-hop logical queries on Knowledge Graphs (KGs). This is a complicated task because, in real-world scenarios, the graphs tend to be large and incomplete. Most previous works have been unable to create models that accept full First-Order Logical (FOL) queries, which include negative queries, and have only been able to process a limited set of query structures. Additionally, most methods present logic operators that can only perform the logical operation they are made for. We introduce a set of models that use Neural Networks to create one-point vector embeddings to answer the queries. The versatility of neural networks allows the framework to handle FOL queries with Conjunction (\(\wedge\)), Disjunction (\(\vee\)) and Negation (\(\neg\)) operators. We demonstrate experimentally the performance of our model through extensive experimentation on well-known benchmarking datasets. Besides having more versatile operators, the models achieve a 10% relative increase over the best performing state of the art and more than 30% over the original method based on single-point vector embeddings.
+
Footnote †: Source code available on: [https://github.com/amayuelas/NNKGReasoning](https://github.com/amayuelas/NNKGReasoning)
## 1 Introduction
Knowledge graphs (KGs) are a type of data structure that can capture many kinds of relationships between entities (e.g.: _Moscow_\(\xrightarrow{\text{cityIn}}\)_Russia_) and have been popularized since the creation of the semantic web or its introduction into Google's search engine. They can contain many kinds of different information, and they can be widely used in question-answering systems, search engines, and recommender systems (Palumbo et al., 2017; Xiong et al., 2017).
Reasoning is a fundamental skill of human brains. For example, we can infer new knowledge based on known facts and logic rules, and discern patterns/relationships to make sense of seemingly unrelated information. It is a multidisciplinary topic and is being studied in psychology, neuroscience, and artificial intelligence (Fagin et al., 2003). The ability to reason about the relations between objects is central to generally intelligent behavior. We can define reasoning as the process of inferring new knowledge based on known facts and logic rules. Knowledge graphs are a structure used for storing many kinds of information, therefore the ability to answer complex queries and extract answers that are not directly encoded in the graph are of high interest to the AI community.
To answer complex queries, the model receives a query divided in logical statements. A full First-Order Logic (FOL) is necessary to process a wider range of queries, which includes negative queries. FOL includes the following logical operators: Existential (\(\exists\)), Conjunction (\(\wedge\)), Disjunction (\(\vee\)), and Negation (\(\neg\)). The power of representation of our logical framework is the key to process complex queries. However, most frameworks have only been able to process Existential Positive First-Order Logic (EPFO), which means that negative queries cannot be processed.
For example, One could ask a knowledge graph containing drugs and side effects the following question: _"What drug can be used to treat pneumonia and does not cause drowsiness?"_. The first step to answer such a query is to translate it into logical statements: \(q=V_{?}\cdot\exists V:\textit{Treat}(\textit{Pneumonia, V}_{?})\)\(\lambda\)\(\neg\)_Cause(Drowsiness,V\({}_{\gamma}\))_. Once the query is divided into logical statements, we obtain the computation graph, a directed acyclic graph (DAG) which defines the order of operations. Afterwards, we can start traversing the graph. However, many real-world graphs are incomplete and therefore traversing them becomes very hard and even computationally impossible. There are many possible answer entities, and it requires modeling sets of entities. As such, embedding methods become a good solution to answer these queries. Previous works (Hamilton et al., 2018; Ren et al., 2020; Ren and Leskovec, 2020) have created methods for embedding the query and the graph into a vector space. The idea of graph embeddings reduces the problem to simply using nearest-neighbor search to find the answers, without paying attention to the intermediate results.
The embedding approach solves many of the problems of query-answering in knowledge graphs. In theory, we could answer the queries just by traversing the graph. In practice, graphs are large and incomplete, and answering arbitrary logical queries becomes a complicated task. The graph incompleteness means that traversing its edges would not provide the correct answers.
This work aims to create some models that allow complex queries and extract the correct answers from large incomplete knowledge graphs. To this end, we present a set of models based on Neural Networks that embed the query and the entities into a one-point vector space. Then, it computes the distance between the query and the entities to rank the answers according to the likelihood to answer the query. We use the versatility of Neural Networks to create the operators needed to process FOL queries.
We conduct experiments using well-known datasets for KG Reasoning: FB15k, FB15-237, and NELL. The experiments show that our models can effectively answer FOL and provide a noticeable improvement when compared with the state-of-the-art baselines. Our models provide a relative improvement of 5% to 10% to the latest state-of-art method and about 30% to 40% when compared with the method that uses the same idea of one-point vector space embeddings (Hamilton et al., 2018).
The main contributions of this work are summarized as: (1). **New embedding-based methods for logical reasoning over knowledge graphs**: two new models, plus variants, for KG Reasoning. These methods embed the query and the entities in the same vector space with single-point vectors. Implementing the logical operators with neural networks provides versatility to create any operator with virtually the same architecture. (2). **Improved performance over the current state of the art**. Experimental results show that the models presented in this paper outperform the selected baselines: Graph Query Embeddings (GOE) (Hamilton et al., 2018), Query2Box (Q2B) (Ren et al., 2020), and Beta2 (Ren and Leskovec, 2020). (3). **Handling of negative queries**. Modelling queries with negation has been an open question in KG Reasoning until recently. Betale (Ren and Leskovec, 2020) introduced the first method able to do so. This work takes advantages of the good relationship inference capabilities of Neural Networks and uses them to create the negation operator.
Figure 1: **MLP Framework for KG Reasoning.** Representation of a sample query: “_List the teams where Brazilian football players who were awarded a Ballon d’Or played_”. **(A)** Query represented by its logical statements and dependency graph. **(B)** 2D Representation of the answer entities in a one-point vector space used by the reasoning framework.
## 2 Related Work
Traditional tasks on graphs include _Link Prediction_(Liben-Nowell and Kleinberg, 2007), _Knowledge Base Completion_(Wang et al., 2015), or basic Query-Answering (one-hop). They are all different versions of the same problem: _Is link (h,r,t) in the KG?_ or _Is 1 an answer to query (h,r,)?_, where only a variable is missing. However, we face a more complicated problem, known as Knowledge Graph Reasoning, that may involve several unobserved edges or nodes over massive and incomplete KGs. In this case, queries can be path queries, conjunctive queries, disjunctive queries or or a combination of them. A formal definition of KG Reasoning can be found in Chen et al. (2020), as stated in Definition 2.1.
**Definition 2.1** (Reasoning over knowledge graphs).: Defining a knowledge graph as: \(\mathcal{G}=\langle\mathcal{E},\mathcal{R},\mathcal{T}\rangle\), where \(\mathcal{E},\mathcal{T}\) represent the set of entities, \(\mathcal{R}\) the set of relations, and the edges in \(\mathcal{R}\) link two nodes to form a triple as \((h,r,t)\in\mathcal{T}\). Then, reasoning over a \(KG\) is defined as creating a triplet that does not exist in the original \(KG\), \(\mathcal{G}^{\prime}=\{(h,r,t)|h\in\mathcal{E},r\in\mathcal{R},t\in\mathcal{T}, (h,r,t)\not\in\mathcal{G}\}\)
Most related to our work are embedding approaches for multi-hop queries over KGs: (Hamilton et al., 2018), (Ren et al., 2020), (Ren and Leskovec, 2020) and (Das et al., 2016), as well as models for question answering (Yasunaga et al., 2021), (Feng et al., 2020). The main differences with these methods rely on the ability to handle full First-Order Logical Queries and using Neural Networks to define all logical operators, including the projection. We also deliver a more extensive range of network implementations.
On a broader outlook, we identify a series of works that aim to solve Knowledge Graph Reasoning with several different techniques, such as _Attention Mechanisms_(Wang et al., 2018), _Reinforcement Learning_ like DeepPath (Xiong et al., 2017) or DIVA (Chen et al., 2018), or _Neural Logic Networks_(Shi et al., 2020), (Qu and Tang, 2019).
## 3 Models
Both models presented here follow the idea behind Graph Query Embedding - GQE (Hamilton et al., 2018): Learning to embed the queries into a low dimensional space. Our models differ from it in the point that logical query operations are represented by geometric operators. In our case, we do not follow the direct geometric sense and these operators are all represented by Neural Networks, instead of just the Intersection operator in GQE. Similarly, however, the operators are jointly optimized with the node embeddings to find the optimal representation.
In order to answer a query, the system receives a query \(q\), represented as a DAG, where the nodes are the entities and the edges the relationships. Starting with the embeddings \(\mathbf{e}_{v_{1}},...,\mathbf{e}_{v_{n}}\) of its anchor nodes and apply the logical operations represented by the edges to finally obtain an embedding \(\mathbf{q}\) of the query (Guu et al., 2015). | 2209.14464v1.mmd |
import EmblrStore from "ember-emblr/services/application"
export function initialize() {
const app = arguments[1] || arguments[0];
const emblrStore = EmblrStore.create({});
app.register('emblrStore:main', emblrStore, {instantiate: false});
app.inject('route', 'emblrStore', 'emblrStore:main');
app.inject('controller', 'emblrStore', 'emblrStore:main');
}
export default {
name: 'emblr-store',
initialize: initialize
};
| iwilliams/ember-emblr-addon/initializers/emblr-store.js |
#!/usr/bin/env python3
from subprocess import call
# call(["ifconfig", "eth0", "192.168.10.1"])
call("sysctl -w net.core.rmem_max=50000000", shell = True)
call("sysctl -w net.core.rmem_max=50000000", shell = True)
call("sysctl -w net.core.wmem_max=1048576", shell = True)
| splotz90/urh-misc/USRP_init.py |
//
// BNDConcreteViewModel.h
// BIND
//
// Created by Marko Hlebar on 22/04/2015.
// Copyright (c) 2015 Marko Hlebar. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "BNDViewModel.h"
@interface BNDViewModel : NSObject <BNDViewModel> {
NSArray *_bindings;
}
@property (nonatomic, strong, readonly) id model;
@property (nonatomic, strong) NSArray *bindings;
- (id)initWithModel:(id)model;
- (void)addChild:(BNDViewModel *)child;
- (void)removeChild:(BNDViewModel *)child;
- (void)removeAllChildren;
@end
| markohlebar/Fontana-Pods/BIND/BIND/Abstractions/BNDConcreteViewModel.h |
package org.isoe.fwk.bsh;
public class Dummy {
}
| francoispfister/diagraph-org.isoe.fwk.bsh/src/org/isoe/fwk/bsh/Dummy.java |
# Written by @Netuoso
class TpbSlack
def initialize
@options = {page: '0', ordering: Constants::ORDERING.default, type: Constants::CATEGORIES.default}
@base_url = Constants::BASE_URL
end
def process(action, query: "", opts: [])
case action
when 'recent'
recent
when 'top'
top(opts)
when 'search'
search(query, opts)
when 'info'
info
when 'help'
help
end
end
def recent
results = {}
url = URI.encode(@base_url + '/recent')
page = Nokogiri::HTML(RestClient.get(url))
torrent_rows = page.css('tr')[1...-1]
torrent_rows.each_with_index do |result, index|
results.merge!({"torrent_#{index+1}" => {info: result.text.lstrip.gsub("\t", "").gsub("\n", " "), magnet: ""}})
end if torrent_rows
links = page.css("a[title='Download this torrent using magnet']").select { |link| link['title'] = 'Download this torrent using magnet' }
links[0...torrent_rows.count].each_with_index do |link, index|
results["torrent_#{index+1}"][:magnet] = link['href']
end if torrent_rows
results
end
def top(opts=[])
results = {}
opts.each do |opt|
@options[:page] = opt[1..-1].delete("\s") if opt[0] == 'p'
@options[:ordering] = opt[1..-1].delete("\s") if opt[0] == 'o'
@options[:type] = opt[1..-1].delete("\s") if opt[0] == 't'
end if !opts.empty?
url = URI.encode(@base_url + "/top/#{@options[:type]}")
page = Nokogiri::HTML(RestClient.get(url))
torrent_rows = page.css('tr')[1...-1]
torrent_rows.each_with_index do |result, index|
results.merge!({"torrent_#{index+1}" => {info: result.text.lstrip.gsub("\t", "").gsub("\n", " "), magnet: ""}})
end if torrent_rows
links = page.css("a[title='Download this torrent using magnet']").select { |link| link['title'] = 'Download this torrent using magnet' }
links[0...torrent_rows.count].each_with_index do |link, index|
results["torrent_#{index+1}"][:magnet] = link['href']
end if torrent_rows
results
end
def search(query, opts=[])
results = {}
opts.each do |opt|
@options[:page] = opt[1..-1].delete("\s") if opt[0] == 'p'
@options[:ordering] = opt[1..-1].delete("\s") if opt[0] == 'o'
@options[:type] = opt[1..-1].delete("\s") if opt[0] == 't'
end if !opts.empty?
url = URI.encode(@base_url + "/search/#{query}/#{@options[:page]}/#{@options[:ordering]}/#{@options[:type]}")
page = Nokogiri::HTML(RestClient.get(url))
torrent_rows = page.css('tr')[1...-1]
torrent_rows.each_with_index do |result, index|
results.merge!({"torrent_#{index+1}" => {info: result.text.lstrip.gsub("\t", "").gsub("\n", " "), magnet: ""}})
end if torrent_rows
links = page.css("a[title='Download this torrent using magnet']").select { |link| link['title'] = 'Download this torrent using magnet' }
links[0...torrent_rows.count].each_with_index do |link, index|
results["torrent_#{index+1}"][:magnet] = link['href']
end if torrent_rows
results
end
def info
"Ruby-based Slack Bot for interacting with <https://thepiratebay.la>, written by @Netuoso"
end
def help
{categories: Constants::CATEGORIES, ordering: Constants::ORDERING}
end
end | netuoso/tpb_slack_ruby-includes/tpb_slack.rb |
var express = require('express');
var app = module.exports = express();
var path = require('path');
var moment = require('moment');
// pie chart settings
var pie = require('./pie');
app.set('views', path.join(__dirname, 'views'));
app.get(/\/stats(?:\/(\w+))?/, function (req, res, next) {
// reuse the admin's database connection
var db = res.locals._admin.db;
// get the month from the url
var month = req.params[0] || 'january';
queryDatabase(db, month, function (err, rows, total) {
if (err) return next(err);
// pie chart's settings
res.locals.chart = JSON.stringify(pie.chart(month, rows, total));
// month's select control data
res.locals.months = getMonths(month);
next();
});
});
app.post(/\/stats(?:\/(\w+))?/, function (req, res, next) {
// reuse the admin's database connection
var db = res.locals._admin.db;
// get the month from the POST params
var month = req.body.month;
queryDatabase(db, month, function (err, rows, total) {
if (err) return next(err);
// pie chart's settings
res.locals.chart = JSON.stringify(pie.chart(month, rows, total));
// month's select control data
res.locals.months = getMonths(month);
next();
});
});
// common data for each request to this view
app.all(/\/stats(?:\/(\w+))?/, function (req, res, next) {
var relative = path.relative(res.locals._admin.views, app.get('views'));
res.locals.breadcrumbs = {
links: [
{url: '/', text: res.locals.string.home},
{active: true, text: 'Statistics'}
]
};
res.locals.partials = {
content: path.join(relative, 'form'),
readme: path.join(relative, 'readme')
};
next();
});
function getMonths (month) {
var months = [
{value: 'january', text: 'January'},
{value: 'february', text: 'February'},
{value: 'mart', text: 'Mart'},
{value: 'april', text: 'April'},
{value: 'may', text: 'May'},
{value: 'june', text: 'June'}
];
// set the selected month
for (var i=0; i < months.length; i++) {
if (months[i].value === month) {
months[i].selected = true;
break;
}
}
return months;
}
function queryDatabase (db, month, cb) {
// find the first and last date of the selected month (all test dates are in 2012)
var date = moment('2012-'+month, 'YYYY-MMMM'),
first = date.startOf('month').format('YYYY-MM-DD'),
last = date.endOf('month').format('YYYY-MM-DD');
// group by item and sum its cache for the selected month
var sql = "select `name`, SUM(`cache`) as 'total'\
from `purchase` join `item`\
on `purchase`.`item_id` = `item`.`id`\
where DATE(`date`) between '"+first+"' and '"+last+"'\
group by `item_id`;";
db.client.query(sql, function (err, items) {
if (err) return cb(err);
// total spend cache for this month
var sql = "select SUM(`cache`) as 'total'\
from `purchase`\
where DATE(`date`) between '"+first+"' and '"+last+"';";
db.client.query(sql, function (err, sum) {
if (err) return cb(err);
// queries results
var rows = items,
total = sum[0].total;
cb(null, rows, total);
});
});
}
| simov/express-admin-examples-config/custom/highcharts/app.js |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
class MetricDefinition(Model):
"""The definition of a metric.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar metric_availabilities: The list of metric availabilities for the
account.
:vartype metric_availabilities:
list[~azure.mgmt.cosmosdb.models.MetricAvailability]
:ivar primary_aggregation_type: The primary aggregation type of the
metric. Possible values include: 'None', 'Average', 'Total', 'Minimimum',
'Maximum', 'Last'
:vartype primary_aggregation_type: str or
~azure.mgmt.cosmosdb.models.PrimaryAggregationType
:param unit: The unit of the metric. Possible values include: 'Count',
'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond',
'Milliseconds'
:type unit: str or ~azure.mgmt.cosmosdb.models.UnitType
:ivar resource_uri: The resource uri of the database.
:vartype resource_uri: str
:ivar name: The name information for the metric.
:vartype name: ~azure.mgmt.cosmosdb.models.MetricName
"""
_validation = {
'metric_availabilities': {'readonly': True},
'primary_aggregation_type': {'readonly': True},
'resource_uri': {'readonly': True},
'name': {'readonly': True},
}
_attribute_map = {
'metric_availabilities': {'key': 'metricAvailabilities', 'type': '[MetricAvailability]'},
'primary_aggregation_type': {'key': 'primaryAggregationType', 'type': 'str'},
'unit': {'key': 'unit', 'type': 'str'},
'resource_uri': {'key': 'resourceUri', 'type': 'str'},
'name': {'key': 'name', 'type': 'MetricName'},
}
def __init__(self, unit=None):
super(MetricDefinition, self).__init__()
self.metric_availabilities = None
self.primary_aggregation_type = None
self.unit = unit
self.resource_uri = None
self.name = None
| lmazuel/azure-sdk-for-python-azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/metric_definition.py |
Chinggaemi-jae - Wikipedia
Tiganos: 37°08′12″N 127°58′08″E / 37.1368°N 127.969°Ö / 37.1368; 127.969
Chinggaemi-jae
Chinggaemi-jae (징개미재)
37°08′12″N 127°58′08″E / 37.1368°N 127.969°Ö / 37.1368; 127.969
Gintang ang Chinggaemi-jae (Korean: 징개미재) sa Habagatang Koreya.[1] Nahimutang ni sa lalawigan sa Chungcheongbuk-do, sa sentro nga bahin sa nasod, 100 km sa habagatan-sidlakan sa Seoul ang ulohan sa nasod. 448 metros ibabaw sa dagat kahaboga ang nahimutangan sa Chinggaemi-jae.[1]
Ang yuta palibot sa Chinggaemi-jae kay kabungtoran.[saysay 1] Dunay mga 192 ka tawo kada kilometro kwadrado sa palibot sa Chinggaemi-jae medyo hilabihan populasyon.[3] Ang kinadul-ang mas dakong lungsod mao ang Chungju, 18.1 km sa habagatan sa Chinggaemi-jae. Hapit nalukop sa lasang nga sagolsagol ang palibot sa Chinggaemi-jae.[4] Sa rehiyon palibot sa Chinggaemi-jae, mga walog talagsaon komon.[saysay 2]
Nahimutangan sa Chinggaemi-jae sa Habagatang Koreya.
↑ 1.0 1.1 1.2 Chinggaemi-jae sa Geonames.org (cc-by); post updated 2012-01-20; database download sa 2015-06-27
Gikuha gikan sa "https://ceb.wikipedia.org/w/index.php?title=Chinggaemi-jae&oldid=25009323" | c4-ceb |
ድር “ቢያብር አንበሳ ያስር” ያሉትን ከስራ ላይ እናውል አክሎግ ቢራራ (ዶር) | Ethiopian Media Forum (EMF)
ድር “ቢያብር አንበሳ ያስር” ያሉትን ከስራ ላይ እናውል አክሎግ ቢራራ (ዶር)
የታሪክ ተጠያቂወች አንሁን፤
Posted by ethioforum on August 9, 2012. Filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0. Both comments and pings are currently closed. | c4-am |
--[[
author:{pbb}
time:2021-09-08 09:39:53
Desc:
use lib:
local ActTeacher = NPL.load("(gl)script/apps/Aries/Creator/Game/Tasks/ActTeacher/ActTeacher.lua")
ActTeacher.ShowView()
]]
local KeepWorkItemManager = NPL.load("(gl)script/apps/Aries/Creator/HttpAPI/KeepWorkItemManager.lua");
local HttpWrapper = NPL.load("(gl)script/apps/Aries/Creator/HttpAPI/HttpWrapper.lua");
local ActTeacher = NPL.export()
local gsId = 20029
local exid = 40034
local page = nil
function ActTeacher.OnInit()
page = document:GetPageCtrl();
end
--30048
function ActTeacher.ShowView()
local bOwn, guid, bag, copies, item = KeepWorkItemManager.HasGSItem(gsId)
if bOwn and copies > 0 then
ActTeacher.ShowPage()
else
local username = GameLogic.GetFilters():apply_filters('store_get', 'user/username');
local activity_id = ActTeacher.GetActivityId()
keepwork.quiz.registrate({
name = username,
activityId = activity_id
},function (err, msg, data)
if err == 200 then
ActTeacher.ShowPage()
KeepWorkItemManager.LoadItems(nil)
else
_guihelper.MessageBox(L"报名教师节活动失败,请联系客服解决");
end
end)
end
end
function ActTeacher.ShowPage()
local params = {
url = "script/apps/Aries/Creator/Game/Tasks/ActTeacher/ActTeacher.html",
name = "ActTeacher.ShowView",
isShowTitleBar = false,
DestroyOnClose = true,
style = CommonCtrl.WindowFrame.ContainerStyle,
allowDrag = false,
enable_esc_key = false,
zorder = 0,
-- app_key = MyCompany.Aries.Creator.Game.Desktop.App.app_key,
directPosition = true,
align = "_fi",
x = 0,
y = 0,
width = 0,
height = 0,
};
System.App.Commands.Call("File.MCMLWindowFrame", params);
end
function ActTeacher.GetSubmitWorldId()
local httpwrapper_version = HttpWrapper.GetDevVersion();
if httpwrapper_version == "ONLINE" then
return 81489
end
return 20732
end
function ActTeacher.GetActivityId()
local httpwrapper_version = HttpWrapper.GetDevVersion();
if httpwrapper_version == "ONLINE" then
return 36
end
return 27
end | NPLPackages/paracraft-script/apps/Aries/Creator/Game/Tasks/ActTeacher/ActTeacher.lua |
require "helper"
class Novelist < ActiveRecord::Base
extend FriendlyId
friendly_id :name, :use => :slugged
end
class Novel < ActiveRecord::Base
extend FriendlyId
belongs_to :novelist
belongs_to :publisher
friendly_id :name, :use => :scoped, :scope => [:publisher, :novelist]
end
class Publisher < ActiveRecord::Base
has_many :novels
end
class ScopedTest < MiniTest::Unit::TestCase
include FriendlyId::Test
include FriendlyId::Test::Shared::Core
def model_class
Novel
end
test "should detect scope column from belongs_to relation" do
assert_equal ["publisher_id", "novelist_id"], Novel.friendly_id_config.scope_columns
end
test "should detect scope column from explicit column name" do
model_class = Class.new(ActiveRecord::Base) do
self.abstract_class = true
extend FriendlyId
friendly_id :empty, :use => :scoped, :scope => :dummy
end
assert_equal ["dummy"], model_class.friendly_id_config.scope_columns
end
test "should allow duplicate slugs outside scope" do
transaction do
novel1 = Novel.create! :name => "a", :novelist => Novelist.create!(:name => "a")
novel2 = Novel.create! :name => "a", :novelist => Novelist.create!(:name => "b")
assert_equal novel1.friendly_id, novel2.friendly_id
end
end
test "should not allow duplicate slugs inside scope" do
with_instance_of Novelist do |novelist|
novel1 = Novel.create! :name => "a", :novelist => novelist
novel2 = Novel.create! :name => "a", :novelist => novelist
assert novel1.friendly_id != novel2.friendly_id
end
end
test "should apply scope with multiple columns" do
transaction do
novelist = Novelist.create! :name => "a"
publisher = Publisher.create! :name => "b"
novel1 = Novel.create! :name => "c", :novelist => novelist, :publisher => publisher
novel2 = Novel.create! :name => "c", :novelist => novelist, :publisher => Publisher.create(:name => "d")
novel3 = Novel.create! :name => "c", :novelist => Novelist.create(:name => "e"), :publisher => publisher
novel4 = Novel.create! :name => "c", :novelist => novelist, :publisher => publisher
assert_equal novel1.friendly_id, novel2.friendly_id
assert_equal novel2.friendly_id, novel3.friendly_id
assert novel3.friendly_id != novel4.friendly_id
end
end
end
| Rifu/caa-rails-vendor/gems/ruby/2.0.0/gems/friendly_id-5.0.0.rc2/test/scoped_test.rb |
/*******************************************************************************
* DataList_test.cpp
* Copyright (C) 2017 Mel McCalla <[email protected]>
*
* This file is part of html2LaTeX.
*
* html2LaTeX 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.
*
* html2LaTeX 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 html2LaTeX. If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/
| mel00010/html2LaTeX-test/HTML/Elements/Normal/DataList_test.cpp |
/*!
\ingroup PkgCircularKernel2GeometricConcepts
\cgalConcept
A function object concept to compare a point `p` and an arc `a` on the vertical line passing through `p`.
*/
class CircularKernel::CompareYatX_2 {
public:
/// \name Operations
/// A model of this concept must provide:
/// @{
/*!
For a circular arc.
\pre The arc `a` must be monotone and `p` must be in the vertical range of `a`.
*/
Comparison_result operator()
(const CircularKernel::Circular_arc_point_2 &p,
const CircularKernel::Circular_arc_2 &a);
/*!
Same for a segment.
*/
Comparison_result operator()
(const CircularKernel::Circular_arc_point_2 &p,
const CircularKernel::Line_arc_2 &a);
/// @}
}; /* end CircularKernel::CompareYatX_2 */
| hlzz/dotfiles-graphics/cgal/Circular_kernel_2/doc/Circular_kernel_2/Concepts/CircularKernel--CompareYatX_2.h |
# -*- encoding: utf-8 -*-
################################################################################
# #
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU Affero 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 Affero General Public License for more details. #
# #
# You should have received a copy of the GNU Affero General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
################################################################################
from openerp import models, fields, api
class Category(models.Model):
_name = 'cl_todo.task.category'
name = fields.Char('Category', required=True, size=128, translate=True)
parent_id = fields.Many2one('cl_todo.task.category', 'Parent Category', select=True, ondelete='restrict')
code = fields.Char('Code', size=128, required=False)
description = fields.Char(string='Description', size=256)
notes = fields.Text(string='Notes')
complete_name = fields.Char(string='Full Category', compute='_name_get_fnc', store=False, readonly=True)
child_ids = fields.One2many('cl_todo.task.category', 'parent_id', 'Child Categories')
active = fields.Boolean('Active',
help="If unchecked, it will allow you to hide the category without removing it.",
default=1)
parent_left = fields.Integer('Left parent', select=True)
parent_right = fields.Integer('Right parent', select=True)
todo_ids = fields.Many2many(
'cl_todo.task',
'cl_todo_task_category_rel',
'category_id',
'todo_task_id',
'Todo Tasks'
)
_sql_constraints = [
('uniq_code', 'unique(code)', "Error! The Code must be unique!"),
]
_constraints = [(
models.Model._check_recursion,
'Error! You can not create recursive categories.',
['parent_id']
)]
_parent_store = True
_parent_order = 'name'
_order = 'parent_left'
@api.multi
def name_get(self):
"""Return the category's display name, including their direct parent by default.
:param dict context: the ``category_display`` key can be
used to select the short version of the
category (without the direct parent),
when set to ``'short'``. The default is
the long version."""
if self._context is None:
self._context = {}
if self._context.get('category_display') == 'short':
return super(Category, self).name_get()
if isinstance(self._ids, (int, long)):
self._ids = [self._ids]
reads = self.read(['name', 'parent_id'])
res = []
for record in reads:
name = record['name']
if record['parent_id']:
name = record['parent_id'][1] + ' / ' + name
res.append((record['id'], name))
return res
@api.model
def name_search(self, name, args=None, operator='ilike', limit=100):
args = args or []
if name:
name = name.split(' / ')[-1]
args = [('name', operator, name)] + args
categories = self.search(args, limit=limit)
return categories.name_get()
@api.one
def _name_get_fnc(self):
self.refresh_complete_name = 0
complete_name = self.name_get()
if complete_name:
self.complete_name = complete_name[0][1]
else:
self.complete_name = self.name
class TodoTask(models.Model):
_inherit = 'cl_todo.task'
category_ids = fields.Many2many(
'cl_todo.task.category',
'cl_todo_task_category_rel',
'todo_task_id',
'category_id',
'Categories'
)
| CLVsol/odoo_cl_addons-cl_todo/category/cl_todo_category.py |
module Cms::PublicFilter::Node
extend ActiveSupport::Concern
include Cms::PublicFilter::Layout
private
def init_context
self.params = ActionController::Parameters.new
self.request = ActionDispatch::Request.new("rack.input" => "", "REQUEST_METHOD" => "GET")
self.response = ActionDispatch::Response.new
end
def find_node(path)
node = Cms::Node.site(@cur_site).in_path(path).sort(depth: -1).to_a.first
return unless node
@preview || node.public? ? node.becomes_with_route : nil
end
def render_node(node)
rest = @cur_main_path.sub(/^\/#{node.filename}/, "").sub(/\/index\.html$/, "")
path = "/.s#{@cur_site.id}/nodes/#{node.route}#{rest}"
spec = recognize_agent path
return unless spec
@cur_node = node
controller = node.route.sub(/\/.*/, "/agents/#{spec[:cell]}")
agent = new_agent controller
agent.controller.params.merge! spec
agent.render spec[:action]
end
public
def generate_node(node, opts = {})
path = opts[:url] || "#{node.filename}/index.html"
return if Cms::Page.site(node.site).and_public.filename(path).first
@cur_site = node.site
@cur_path = opts[:url] || node.url
@cur_main_path = @cur_path.sub(@cur_site.url, "/")
@csrf_token = false
params.merge! opts[:params] if opts[:params]
begin
@exists = true
response.body = render_node node
response.content_type ||= "text/html"
rescue StandardError => e
@exists = false
return if e.to_s == "404"
return if e.is_a? Mongoid::Errors::DocumentNotFound
raise e unless Rails.env.producton?
end
if response.content_type == "text/html" && node.layout
html = render_to_string inline: render_layout(node.layout), layout: "cms/page"
else
html = response.body
end
file = opts[:file] || "#{node.path}/index.html"
write_file node, html, file: file
end
def generate_node_with_pagination(node, opts = {})
if generate_node node
@task.log "#{node.url}index.html" if @task
end
max = opts[:max] || 9999
num = max
2.upto(max) do |i|
file = "#{node.path}/index.p#{i}.html"
if generate_node node, file: file, params: { page: i }
@task.log "#{node.url}index.p#{i}.html" if @task
end
if !@exists
num = i
break
end
end
num.upto(max) do |i|
file = "#{node.path}/index.p#{i}.html"
break unless Fs.exists?(file)
Fs.rm_rf file
end
end
end
| hotmix/shirasagi-app/controllers/concerns/cms/public_filter/node.rb |
# Python library imports.
import json
# Django imports.
from django.http import HttpResponse
class JsonResponse(HttpResponse):
def __init__(self, content={}, status=None, content_type=None):
if not content_type:
content_type = 'application/json'
super(JsonResponse, self).__init__(json.dumps(content), status=status, content_type=content_type)
| ze-phyr-us/django-libretto-django_libretto/http.py |
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
/******************************************************************************
*
* file: ArgTraits.h
*
* Copyright (c) 2007, Daniel Aarno, Michael E. Smoot .
* All rights reverved.
*
* See the file COPYING in this directory for
* more information.
*
* 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.
*
*****************************************************************************/
// This is an internal tclap file, you should probably not have to
// include this directly
#ifndef TCLAP_ARGTRAITS_H
#define TCLAP_ARGTRAITS_H
namespace TCLAP {
// We use two empty structs to get compile type specialization
// function to work
/**
* A value like argument value type is a value that can be set using
* operator>>. This is the default value type.
*/
struct ValueLike {
typedef ValueLike ValueCategory;
virtual ~ValueLike() {}
};
/**
* A string like argument value type is a value that can be set using
* operator=(string). Usefull if the value type contains spaces which
* will be broken up into individual tokens by operator>>.
*/
struct StringLike {
virtual ~StringLike() {}
};
/**
* A class can inherit from this object to make it have string like
* traits. This is a compile time thing and does not add any overhead
* to the inherenting class.
*/
struct StringLikeTrait {
typedef StringLike ValueCategory;
virtual ~StringLikeTrait() {}
};
/**
* A class can inherit from this object to make it have value like
* traits. This is a compile time thing and does not add any overhead
* to the inherenting class.
*/
struct ValueLikeTrait {
typedef ValueLike ValueCategory;
virtual ~ValueLikeTrait() {}
};
/**
* Arg traits are used to get compile type specialization when parsing
* argument values. Using an ArgTraits you can specify the way that
* values gets assigned to any particular type during parsing. The two
* supported types are StringLike and ValueLike.
*/
template<typename T>
struct ArgTraits {
typedef typename T::ValueCategory ValueCategory;
virtual ~ArgTraits() {}
//typedef ValueLike ValueCategory;
};
#endif
} // namespace
| bbc/vc2hqdecode-testprogs/tclap/ArgTraits.h |
import java.util.*;
class Test {
void foo() {
Map.Entry<String, String> entry = Map.entry("foo", "bar");
Map<String, String> model = new HashMap<>();
model.put(entry.getKey(), entry.getValue());
model.put("goo", "baz");/*2*//*3*/
process(/*1*/model/*4*/);
}
void process(Map<String, String> model) {
}
} | siosio/intellij-community-plugins/IntentionPowerPak/test/com/siyeh/ipp/collections/to_mutable_collection/MapOfEntries_after.java |
#region Copyright (C) 2011-2017 Ivan Masmitjà
// Copyright (C) 2011-2017 Ivan Masmitjà
//
// SamsChannelEditor 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.
//
// SamsChannelEditor 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 SamsChannelEditor. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.Text;
namespace SamsChannelEditor.Utils
{
public class DataMapping
{
private Encoding DefaultEncoding { get; set; }
private byte[] data;
public byte[] Data
{
get { return data; }
set { data = value; }
}
public int BaseOffset { get; set; }
public DataMapping()
{
DefaultEncoding = Encoding.BigEndianUnicode;
BaseOffset = 0;
}
#region Byte
public byte GetByte(int offset)
{
return data[BaseOffset + offset];
}
public void SetByte(int offset, byte value)
{
data[BaseOffset + offset] = value;
}
#endregion
#region Word
public ushort GetWord(int offset)
{
return BitConverter.ToUInt16(this.data, BaseOffset + offset);
}
public void SetWord(int offset, ushort value)
{
byte[] b = BitConverter.GetBytes(value);
this.data[BaseOffset + offset + 0] = b[0];
this.data[BaseOffset + offset + 1] = b[1];
}
#endregion
#region String()
public string GetString(int offset, int length)
{
var encoding = this.DefaultEncoding;
return encoding.GetString(this.data, BaseOffset + offset, length).TrimEnd('\0');
}
public int SetString(int offset, int length, string text)
{
var bytes = this.DefaultEncoding.GetBytes(text);
int len = Math.Min(bytes.Length, length);
Array.Clear(Data, offset, len);
Array.Copy(bytes, 0, this.data, BaseOffset + offset, len);
return len;
}
#endregion
}
}
| imasm/samschanneledit-Source/SamsungChanelEditor/Utils/DataMapping.cs |
import getMissingResources from '../getMissingResources';
let mockMissing;
jest.mock('../getMissingResourceShas', () => () => mockMissing);
it('filters to resources marked as missing in the response', () => {
const resources = [
{
sha: '1',
},
{
sha: '2',
},
{
sha: '3',
},
];
mockMissing = ['1', '3'];
const missingResources = getMissingResources({ missing: mockMissing }, resources);
expect(missingResources).toEqual([
{
sha: '1',
},
{
sha: '3',
},
]);
});
| percy/react-percy-packages/react-percy-api-client/src/resources/__tests__/getMissingResources-tests.js |
//
// Utils.h
// BSSimpleHTTPNetworkingDemo
//
// Created by juxingzhutou on 15/11/6.
// Copyright © 2015年 bluntsword. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSData (Utils)
- (NSString *)detectImageSuffix;
@end
| juxingzhutou/BSSimpleHTTPNetworking-BSSimpleHTTPNetworkingDemo/Global_Objects/NSData+Utils.h |
require 'test_helper'
class CoverImageTest < ActiveSupport::TestCase
test "Can't cache a cover image without a solr id" do
cover = CoverImage.new thumbnail_url: 'https://covers.openlibrary.org/b/oclc/428817148-M.jpg'
assert_not cover.valid?
end
test "Can't cache a cover image with an invalid URL" do
cover = CoverImage.new solr_id: 12345, thumbnail_url: 'abcdefg'
assert_not cover.valid?
end
test "Can't cache a cover image with a URL that returns a 404" do
cover = CoverImage.new solr_id: 12345, thumbnail_url: 'http://httpstat.us/404'
assert_not cover.valid?
end
test "Can't cache a cover image with a URL that returns a 500" do
cover = CoverImage.new solr_id: 12345, thumbnail_url: 'http://httpstat.us/500'
assert_not cover.valid?
end
test "Can't cache a cover image with a URL that returns a 200 not found message" do
cover = CoverImage.new solr_id: 12345, thumbnail_url: 'https://covers.openlibrary.org/b/isbn/0071381333-S.jpg?default=false'
assert_not cover.valid?
end
test "Can cache a cover image with a proper solr_id and thumbnail_url" do
cover = CoverImage.new solr_id: 12345, thumbnail_url: 'https://ia800808.us.archive.org/zipview.php?zip=/28/items/olcovers68/olcovers68-S.zip&file=686643-S.jpg'
assert cover.valid?
end
end
| JMuscutt/cwe-library-notifications-test/models/cover_image_test.rb |
Orase si statiuni in Guineea Ecuatoriala - Direct Booking
Home Destinatii turistice internationaleAltele Regiuni si statiuni in Guineea Ecuatoriala
Regiuni si statiuni in Guineea Ecuatoriala
Regiunile si statiunile din Guineea Ecuatoriala unde puteti gasi pachete turistice in portalul Direct Booking.
Obiective turistice in Guineea Ecuatoriala Oferte Guineea Ecuatoriala | c4-co |
/*
N-Rage`s Dinput8 Plugin
(C) 2002, 2006 Norbert Wladyka
Author`s Email: [email protected]
Website: http://go.to/nrage
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _SETTINGS_H_
#define _SETTINGS_H_
#define DIRECTINPUT_VERSION 0x0800
// Hacks for GNU C compilers? No, thank you...
#ifdef __GNUC__
#ifndef WINVER
#define WINVER 0x0500
#endif // #ifndef WINVER
#ifndef _WIN32_IE
#define _WIN32_IE 0x0300
#endif // #ifndef _WIN32_IE
//#ifndef _const unsigned char *_DEFINED
//#define _const unsigned char *_DEFINED
//typedef const unsigned char *const unsigned char *;
//#endif
#endif // #ifdef __GNUC__
// Our default buffer size for TCHAR arrays (resources get loaded through here)
// Make sure localized resources do not exceed this limit, or they will be cut off
#define DEFAULT_BUFFER 256
// Use default settings for 'release' and 'debug' builds
#define STDCONFIG
#ifndef STDCONFIG
// Custom (nonstandard) settings here
// Workaround for a Adaptoid driver bug
// Basically if the Adaptoid USB driver doesn't respond that there's a pak, say there is one anyway
#define ADAPTOIDPAK_RUMBLEFIX
// Remove unimplemented elements of the GUI
// #define HIDEUNIMPLEMENTED
// Check controller commands for valid CRC
// #define MAKEADRESSCRCCHECK
// Display button for writing shortcuts binary
// #define RAWPROFILEWRITE
// Enable selection of transfer pak
// #define V_TRANSFERPAK
// Enable selection of voice pak
// #define V_VOICEPAK
#else
// Standard settings
#ifdef _DEBUG
// Standard debug settings
// Workaround for a Adaptoid driver bug
#define ADAPTOIDPAK_RUMBLEFIX
// Remove unimplemented Elements of the GUI
// #define HIDEUNIMPLEMENTED
// Check controller commands for valid CRC
#define MAKEADRESSCRCCHECK
// Display button for writing shortcuts binary
#define RAWPROFILEWRITE
// Enable selection of transfer pak
#define V_TRANSFERPAK
// Enable selection of voice pak
#define V_VOICEPAK
// Spits out loads of extra info for ControllerCommand and ReadController
// #define ENABLE_RAWPAK_DEBUG
#else
// Standard release settings
// Workaround for a Adaptoid driver bug
#define ADAPTOIDPAK_RUMBLEFIX
// Remove unimplemented elements of the GUI
#define HIDEUNIMPLEMENTED
// Check controller commands for valid CRC
// #define MAKEADRESSCRCCHECK
// Display button for writing shortcuts binary
// #define RAWPROFILEWRITE
// Enable selection of transfer pak
#define V_TRANSFERPAK
// Enable selection of voice pak
// #define V_VOICEPAK
#endif // #ifdef _DEBUG
#endif // #ifndef STDCONFIG
#undef STDCONFIG
#ifdef _DEBUG
#define VERSIONINFO _T(VERSIONNUMBER) _T("-Debugbuild")
#else
#define VERSIONINFO _T(VERSIONNUMBER)
#endif // #ifdef _DEBUG
#endif // #ifndef _SETTINGS_H_
| shygoo/project64-Source/nragev20/settings.h |
## Saturday, December 25, 2010
### "The Naughty/Nice Ledger"
Jeff Ely:
The Naughty/Nice Ledger, by Jeff Ely: It sounds so simple: you’re nice you make the list, you’re naughty you get a stocking full of coal. But just how much of the year do you have to be nice?
It would indeed be simple if Santa could observe perfectly your naughty/nice intentions. Then he could use the grim ledger: you make the list if and only if you are nice all 365 days of the year. But it’s an imperfect world. Even the best intentions go awry. Try as you may to be nice there’s always the chance that you come off looking naughty due to misunderstandings or circumstances beyond your control. Just ask Rod Blagojevich.
And with 365 chances for misunderstanding, the grim ledger makes for a mighty slim list come Christmas Eve. No, in a world of imperfect monitoring, Santa needs a more forgiving test than that. But while it should be forgiving enough to grant entry to the nice, it can’t be so forgiving that it also allows the naughty to pass. And then there’s that dreaded third category of youngster: the game theorist who will try to find just the right mix of naughty and nice to wreak havoc but still make the list. Fortunately for St. Nick, the theory of dynamic moral hazard has it all worked out.
There exists a number T between 0 and 365 (the latter being a “sufficiently large number of periods”) with three key properties
1. The probability that a truly nice boy or girl comes out looking nice on at least T days is close to 100%,
2. The probability that the unwaveringly naughty gets lucky and comes out looking nice for T days is close to 0%,
3. If you are being strategic and you are going to be naughty at least once, then you should go all the way and be unwaveringly naughty.
The formal statement of #3 (which is clearly the crucial property) is the following. You may consider being naughty for Z days and nice for the remaining 365-Z days and if you do your payoff has two parts. First, you get to be naughty for Z days. Second, you have a certain probability of making the list. Property #3 says that the total expected payoff is convex in Z. And with a convex payoff you want to go to extremes, either nice all year long or naughty all year long.
And given #1 and #2, you are better off being nice than naughty. One very important caveat though. It is essential that Santa never let you know how you are doing as the year progresses. Because once you know you’ve achieved your T you are in the clear and you can safely be naughty for the remainder. No wonder he’s so secretive with that list.
(The classic reference is Radner. More recently these ideas are being used in repeated games.)
Posted by on Saturday, December 25, 2010 at 01:11 AM in Economics | Permalink Comments (4) | finemath-3plus |
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "NSView.h"
@interface NSView (IBViewAdditions)
+ (id)ib_viewWithSize:(struct CGSize)arg1;
- (void)ib_removeFromSuperviewMakingAncestorFirstResponderIfNeeded;
- (void)ib_setSubviewsMakingAncestorFirstResponderIfNeeded:(id)arg1;
- (id)ib_layoutDescription;
- (void)ib_centerWithIntegralOriginInRect:(struct CGRect)arg1;
- (id)ib_constraintsForMakingFlushWithSuperview;
- (BOOL)isMouse:(struct CGPoint)arg1 inRect:(struct CGRect)arg2;
- (id)firstAncestorPassingTest:(CDUnknownBlockType)arg1;
- (void)scrollRectToVisible:(struct CGRect)arg1 animatingSynchronously:(BOOL)arg2 duration:(double)arg3;
- (void)scrollRectToVisible:(struct CGRect)arg1 animatingSynchronously:(BOOL)arg2;
- (struct CGRect)rectToScrollRectToVisible:(struct CGRect)arg1 keepingRectVisible:(struct CGRect)arg2;
- (CDStruct_f6143a38)convertLine:(CDStruct_f6143a38)arg1 fromView:(id)arg2;
- (CDStruct_f6143a38)convertLine:(CDStruct_f6143a38)arg1 toView:(id)arg2;
- (long long)convertKnobPosition:(long long)arg1 fromView:(id)arg2;
- (long long)convertKnobPosition:(long long)arg1 toView:(id)arg2;
- (unsigned long long)convertRectEdge:(unsigned long long)arg1 fromView:(id)arg2;
- (unsigned long long)convertRectEdge:(unsigned long long)arg1 toView:(id)arg2;
- (id)transformForConvertingPointsFromView:(id)arg1;
- (id)transformForConvertingPointsToView:(id)arg1;
- (id)transformForConvertingToAncestor:(id)arg1;
- (struct CGRect)visibleBoundsIgnoringHiddenAncestors;
- (struct CGPoint)convertPointFromScreen:(struct CGPoint)arg1;
- (struct CGPoint)convertPointToScreen:(struct CGPoint)arg1;
- (struct CGSize)convertSizeToScreen:(struct CGSize)arg1;
- (struct CGSize)convertSizeFromScreen:(struct CGSize)arg1;
- (struct CGRect)convertRectFromScreen:(struct CGRect)arg1;
- (struct CGRect)convertRectToScreen:(struct CGRect)arg1;
- (struct CGSize)convertOffsetFromWindow:(struct CGSize)arg1;
- (struct CGSize)convertOffsetToWindow:(struct CGSize)arg1;
- (struct CGSize)convertSizeFromWindow:(struct CGSize)arg1;
- (struct CGSize)convertSizeToWindow:(struct CGSize)arg1;
- (struct CGPoint)convertPointFromWindow:(struct CGPoint)arg1;
- (struct CGPoint)convertPointToWindow:(struct CGPoint)arg1;
- (struct CGRect)convertRectFromWindow:(struct CGRect)arg1;
- (struct CGRect)convertRectToWindow:(struct CGRect)arg1;
- (CDStruct_c519178c)convertInsetFromWindow:(CDStruct_c519178c)arg1;
- (CDStruct_c519178c)convertInsetToWindow:(CDStruct_c519178c)arg1;
- (CDStruct_c519178c)convertInset:(CDStruct_c519178c)arg1 fromView:(id)arg2;
- (CDStruct_c519178c)convertInset:(CDStruct_c519178c)arg1 toView:(id)arg2;
- (struct CGRect)boundsClippedToAncestor:(id)arg1 convertedToView:(id)arg2;
- (struct CGRect)boundsClippedToAncestorsConvertedToView:(id)arg1;
- (struct CGRect)boundsClippedToAncestorsConvertedToWindow;
- (void)makeRectVisible:(struct CGRect)arg1 ofView:(id)arg2;
- (void)makeRectVisible:(struct CGRect)arg1;
- (void)insertSubview:(id)arg1 atIndex:(long long)arg2;
- (void)foreachRectBeingDrawn:(CDUnknownBlockType)arg1;
- (BOOL)isVisible;
- (void)invokeWithTemporarySuperview:(id)arg1 block:(CDUnknownBlockType)arg2;
- (BOOL)ib_isLayerBackedOrHasLayerBackedDescendant;
@end
| wczekalski/Distraction-Free-Xcode-plugin-Archived/v1/WCDistractionFreeXcodePlugin/Headers/PlugIns/IDEInterfaceBuilderKit/NSView-IBViewAdditions.h |
export const SEARCH_ARTICLES_INITIATION = 'SEARCH_ARTICLES_INITIATION';
export const SEARCH_ARTICLES_SUCCESS = 'SEARCH_ARTICLES_SUCCESS';
export const SEARCH_ARTICLES_FAILURE = 'SEARCH_ARTICLES_FAILURE';
export const CLEAR_SEARCH_ERROR = 'CLEAR_SEARCH_ERROR';
| udacityalumni/alumni-client-app/src/containers/SearchContainer/constants.js |
var AbstractClientStore = module.exports = function () {
};
AbstractClientStore.prototype.increment = function (key, lifetime, callback) {
var self = this;
this.get(key, function (err, value) {
if (err) {
callback(err);
} else {
var count = value ? value.count+1 : 1;
self.set(key, {count: count, lastRequest: new Date(), firstRequest: new Date()}, lifetime, function (err) {
var prevValue = {
count: value ? value.count : 0,
lastRequest: value ? value.lastRequest : null,
firstRequest: value ? value.firstRequest : null
};
typeof callback == 'function' && callback(err, prevValue);
});
}
});
}; | EdwardStudy/myghostblog-versions/1.25.7/node_modules/express-brute/lib/AbstractClientStore.js |
'use strict'
import { warning } from './log'
/**
* This will log a single deprecation notice per function and forward the call
* on to the new API.
*
* @param {string} message The deprecation message.
* @param {*} ctx The context this forwarded call should run in
* @param {function} fn The function to forward on to
* @return {function} The function that will warn once and then call fn
*/
export default function deprecated(message, fn) {
var warned = false
if (process.env.NODE_ENV !== 'production') {
var newFn = function() {
if (process.env.NODE_ENV !== 'production') {
if (!warned) {
warning(message)
warned = true
}
return fn.apply(this, arguments)
}
}
Object.assign(newFn, fn)
return newFn
}
return fn
}
| netceteragroup/girders-elements-packages/core/src/log/deprecated.js |
//
// OpenHours.h
// YelpAnalyzer
//
// Created by Водолазкий В.В. on 04.08.14.
// Copyright (c) 2014 Geomatix Labs S.R.O. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
@class Business;
@interface OpenHours : NSManagedObject
@property (nonatomic, retain) NSDate * close;
@property (nonatomic, retain) NSNumber * day;
@property (nonatomic, retain) NSDate * open;
@property (nonatomic, retain) Business *busines;
+ (void) setUpHours:(NSDictionary *)hours forBusiness:(Business *)bus inMoc:(NSManagedObjectContext *)moc;
@end
| Voldemarus/YelpAnalyzer-YelpAnalyzer/OpenHours.h |
// Copyright (c) 2015, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation 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.
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("WebsitePanel.Providers.DNS.SimpleDNS50")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("WebsitePanel.Providers.DNS.SimpleDNS50")]
[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("ae7abd9f-e4ec-4f01-84f3-3941fc739a49")]
| simonegli8/Websitepanel-WebsitePanel/Sources/WebsitePanel.Providers.DNS.SimpleDNS50/Properties/AssemblyInfo.cs |
Joruri::Application.routes.draw do
mod = "cms"
match "/_preview/:site/(*path)" => "cms/admin/preview#index",
:as => :cms_preview, :defaults => { :concept => nil }, :format => false
## -------------------------------------------------------
## admin
scope "#{Joruri.admin_uri}/#{mod}", :module => mod, :as => mod do
match "tool_rebuild" => "admin/tool/rebuild#index"
match "tool_search" => "admin/tool/search#index"
match "tool_export" => "admin/tool/export#index"
match "tool_import" => "admin/tool/import#index"
match "tests_kana" => "admin/tests/kana#index",
:as => :tests_kana
match "embedded_file/:id/:name.:format" => "admin/embedded_files#index",
:as => :embedded_file
match "embedded_file/:id/thumb/:name.:format" => "admin/embedded_files#index",
:as => :embedded_thumbnail, :thumbnail => true
resources :tool_link_checks,
:controller => "admin/tool/link_checks"
resources :navi_sites,
:controller => "admin/navi/sites"
resources :navi_concepts,
:controller => "admin/navi/concepts"
resources :concepts,
:controller => "admin/concepts",
:path => ":parent/concepts" do
collection do
get :layouts
post :layouts
end
end
resources :sites,
:controller => "admin/sites"
resources :kana_dictionaries,
:controller => "admin/kana_dictionaries" do
collection do
get :make
post :make
get :test
end
end
resources :navi_concepts,
:controller => "admin/navi/concepts"
resources :emergencies,
:controller => "admin/emergencies" do
member do
get :change
end
end
end
scope "#{Joruri.admin_uri}/#{mod}/c:concept", :module => mod, :as => mod do
match "stylesheets/" => "admin/stylesheets#index",
:as => :stylesheets, :format => false
match "stylesheets/(*path)" => "admin/stylesheets#index",
:as => :stylesheets, :format => false
resources :contents,
:controller => "admin/contents"
resource :contents_rewrite,
:controller => "admin/content/rewrite"
resources :nodes,
:controller => "admin/nodes",
:path => ":parent/nodes" do
collection do
get :search
get :content_options
get :model_options
end
end
resources :layouts,
:controller => "admin/layouts"
resources :pieces,
:controller => "admin/pieces" do
collection do
get :content_options
get :model_options
end
end
resources :data_texts,
:controller => "admin/data/texts"
resources :data_files,
:controller => "admin/data/files",
:path => ":parent/data_files" do
member do
get :download
get :thumbnail
end
end
resources :data_file_nodes,
:controller => "admin/data/file_nodes",
:path => ":parent/data_file_nodes"
resources :inline_data_files,
:controller => "admin/inline/data_files",
:path => ":parent/inline_data_files" do
member do
get :download
get :thumbnail
end
end
resources :inline_data_file_nodes,
:controller => "admin/inline/data_file_nodes",
:path => ":parent/inline_data_file_nodes"
## -----------------------------------------------------
## node
resources :node_directories,
:controller => "admin/node/directories",
:path => ":parent/node_directories"
resources :node_pages,
:controller => "admin/node/pages",
:path => ":parent/node_pages"
resources :node_sitemaps,
:controller => "admin/node/sitemaps",
:path => ":parent/node_sitemaps"
## -----------------------------------------------------
## piece
resources :piece_frees,
:controller => "admin/piece/frees"
resources :piece_page_titles,
:controller => "admin/piece/page_titles"
resources :piece_bread_crumbs,
:controller => "admin/piece/bread_crumbs"
resources :piece_links,
:controller => "admin/piece/links"
resources :piece_link_items,
:controller => "admin/piece/link_items",
:path => ":piece/piece_link_items"
resources :piece_sns_sharings,
:controller => "admin/piece/sns_sharings"
end
## -------------------------------------------------------
## public
scope "_public/#{mod}", :module => mod, :as => "" do
match "node_preview/" => "public/node/preview#index"
match "node_pages/" => "public/node/pages#index"
match "node_sitemaps/" => "public/node/sitemaps#index"
end
end | kaosf/joruri-cms-2.0.2-config/modules/cms/routes.rb |
/**
* @param {string} s
* @return {number}
*/
var getVal = function(s) {
if (s === 'I') {
return 1;
} else if (s === 'V') {
return 5;
} else if (s === 'X') {
return 10;
} else if (s === 'L') {
return 50;
} else if (s === 'C') {
return 100;
} else if (s === 'D') {
return 500;
} else if (s === 'M') {
return 1000;
}
};
var romanToInt = function(s) {
var cur = 0;
var last = 10000;
var res = 0;
for (var i = 0; i < s.length; i++) {
cur = getVal(s[i]);
if (last < cur) {
res -= 2 * last;
}
res += cur;
last = cur;
}
return res;
}; | oneRice/LeetCode-javascript-solution/013/solution.js |
module Typhoeus
# The Typhoeus configuration used to set global
# options.
# @example Set the configuration options within a block.
# Typhoeus.configure do |config|
# config.verbose = true
# end
#
# @example Set the configuration directly.
# Typhoeus::Config.verbose = true
module Config
extend self
# Defines whether the connection is blocked.
# Defaults to false. When set to true, only
# stubbed requests are allowed. A
# {Typhoeus::Errors::NoStub} error is raised,
# when trying to do a real request. It's possible
# to work around inside
# {Typhoeus.with_connection}.
#
# @return [ Boolean ]
#
# @see Typhoeus::Request::BlockConnection
# @see Typhoeus::Hydra::BlockConnection
# @see Typhoeus#with_connection
# @see Typhoeus::Errors::NoStub
attr_accessor :block_connection
# Defines whether GET requests are memoized when using the {Typhoeus::Hydra}.
#
# @return [ Boolean ]
#
# @see Typhoeus::Hydra
# @see Typhoeus::Hydra::Memoizable
attr_accessor :memoize
# Defines whether curls debug output is shown.
# Unfortunately it prints to stderr.
#
# @return [ Boolean ]
#
# @see http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTVERBOSE
attr_accessor :verbose
# Defines whether requests are cached.
#
# @return [ Object ]
#
# @see Typhoeus::Hydra::Cacheable
# @see Typhoeus::Request::Cacheable
attr_accessor :cache
# Defines whether to use a default user agent.
#
# @return [ String ]
#
# @see Typhoeus::Request#set_defaults
attr_accessor :user_agent
# Defines wether to use a proxy server for every request.
#
# @return [ String ]
#
# @see Typhoeus::Request#set_defaults
attr_accessor :proxy
end
end
| joisadler/joisadler.github.io-vendor/bundle/ruby/3.0.0/gems/typhoeus-1.4.0/lib/typhoeus/config.rb |
/*
* Copyright 2015 Ben Manes. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.github.benmanes.caffeine.cache.simulator.admission;
/**
* A multiset for estimating the popularity of an element.
*
* @author [email protected] (Ben Manes)
*/
public interface Frequency {
/** Returns the estimated number of times the element was seen. */
int frequency(long e);
/** Increments the popularity of the element. */
void increment(long e);
/** Feedback to allow for adaptability. */
default void reportMiss() {}
}
| ben-manes/caffeine-simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/admission/Frequency.java |
angular.module("ngJqxsettings", []).directive('ngJqxsettings', function ($interval, dateFilter) {
function link(scope, element, attrs) {
var widget = attrs.ngJqwidgets;
var propertyToScopeArray = propertyToScope(attrs.ngJqxsettings);
for (var p = 0; p < propertyToScopeArray.length; p++) {
var property = propertyToScopeArray[p].scopeVar;
eval("var " + property + " = scope." + property + ";");
// watches for changes in the $scope variables and updates the widget accordingly
scope.$watch(property, function (newValue, oldValue) {
if (newValue != oldValue) {
var setting = this.exp;
eval(setting + " = scope." + setting);
var updatedProperty;
for (var i = 0; i < propertyToScopeArray.length; i++) {
if (setting == propertyToScopeArray[i].scopeVar) {
updatedProperty = eval("({ " + propertyToScopeArray[i].jqwidgetsProperty + ": " + setting + " })");
break;
};
};
if (updatedProperty != undefined) {
$(element[0])[widget](updatedProperty);
};
};
});
};
// initializes the widget
var settings = eval("(" + attrs.ngJqxsettings + ")");
$(document).ready(function () {
$(element[0])[widget](settings);
});
};
return {
link: link
};
});
// extracts the key-value pairs from the settings string
var propertyToScope = function (settingsString) {
var newString = settingsString.slice(1, settingsString.length - 1);
newString = newString.trim();
var keyValueArray = newString.split(",");
var keyValueObjects = new Array();
for (var i = 0; i < keyValueArray.length; i++) {
var tempString = keyValueArray[i].trim();
var tempArray = tempString.split(":");
var scopeVar = tempArray[1].trim();
if (isNaN(scopeVar) == true && scopeVar != "true" && scopeVar != "false" && scopeVar[0] != "\"" && scopeVar[0] != "\'") {
keyValueObjects.push({ jqwidgetsProperty: tempArray[0].trim(), scopeVar: tempArray[1].trim() });
};
};
return keyValueObjects;
}; | LuisAlejandroDuarte/ESC-app/module/angular/ngjqxsettings.js |
package net.eusashead.validation.model;
public class Applicant {
private Integer id;
private String name;
private int age;
private boolean valid;
public Applicant(Integer id, String name, int age) {
super();
this.setId(id);
this.name = name;
this.age = age;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public boolean isValid() {
return valid;
}
public void setValid(boolean valid) {
this.valid = valid;
}
} | patrickvankann/drools-jsr303-src/test/java/net/eusashead/validation/model/Applicant.java |
ኬኒያ በ5ኛው ፕሬዚዳንታዊው ፕርጫ ዋዜማ ላይ በፍርሃት ርዳለች [ዮናስ ሐጎስ-ናይሮቢ ኬኒያ] – The Ethio Sun
ኬኒያ በ5ኛው ፕሬዚዳንታዊው ፕርጫ ዋዜማ ላይ በፍርሃት ርዳለች [ዮናስ ሐጎስ-ናይሮቢ ኬኒያ]
ከአስር ዓመታት በፊት በ2007 በተደረገ ምርጫ በወቅቱ ለሁለተኛ ጊዜ ይወዳደሩ የነበሩት የቀድሞው ፕሬዚዳንት ምዋይ ኪባኪ Mwai Kibaki ድምፅ አጭበርብረዋል በሚል መነሻ የተነሳ ሐገራዊ ረብሻ ከአንድ ሺህ ያላነሱ ኬንያውያን ሕይወታቸውን ከገበሩበትና ከመቶ ሺህ በላይ የሚሆኑት ከቤት ንብረታቸው ከተፈናቀሉበት በኋላ የተባበሩት መንግስታት ድርጅት ጣልቃ በመግባት በወቅቱ መሪ በነበሩት ኮፊ አናን አደራዳሪነት ተቃዋሚውና በስልጣን ላይ የነበረው ፓርቲ ስልጣን በመጋራት አምስቱን ዓመት ሐገሪቷን እንዲያስተዳድሩ በማስማማት ደም መፋሰሱን አስቁሟል።
ያለዉ የእርዳታ ሃብት ክምችት የኢትዮጵያዉያንን ሕጻናት ለመርዳት የማያስችል መሆኑን እርዳታ ሰጪ ድርጅቶች ገለጹ። | c4-am |
/*************************************************************************/
/* export.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* 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. */
/*************************************************************************/
void register_windows_exporter();
| jejung/godot-platform/windows/export/export.h |
/*
* ReMatrix.hpp
*
* (Un)License: Public Domain
* You can use and modify this file without any restriction.
* Do what you want.
* No warranties and disclaimer of any damages.
* More info: http://unlicense.org
* The latest sources: https://github.com/republib
*/
#ifndef RplMatrix_HPP_
#define RplMatrix_HPP_
class RplMatrix;
/**
* Implements a RplMatrix specific exception.
*/
class RplMatrixException: public ReException {
public:
RplMatrixException(const RplMatrix& RplMatrix, const char* format, ...);
};
/**
* The type of a RplMatrix element.
*/
typedef qreal MatVal;
class Tuple2 {
public:
Tuple2(MatVal value1, MatVal value2) :
m_value1(value1),
m_value2(value2) {
}
public:
MatVal m_value1;
MatVal m_value2;
};
/**
* Implements a RplMatrix with 2 dimensions.
*/
class RplMatrix {
public:
RplMatrix(const char* name = NULL);
RplMatrix(int rows, int cols, const char* name = NULL);
virtual ~RplMatrix();
RplMatrix(const RplMatrix& source);
RplMatrix& operator =(const RplMatrix& source);
public:
RplMatrix& operator +=(const RplMatrix& operand);
RplMatrix& operator -=(const RplMatrix& operand);
RplMatrix operator +(const RplMatrix& operand);
RplMatrix operator -(const RplMatrix& operand);
RplMatrix& operator +=(MatVal scalar);
RplMatrix& operator -=(MatVal scalar);
RplMatrix operator +(MatVal scalar);
RplMatrix operator -(MatVal scalar);
bool operator ==(const RplMatrix& operand) const;
bool operator ==(MatVal scalar) const;
inline bool operator !=(const RplMatrix& operand) const {
return !(*this == operand);
}
inline bool operator !=(MatVal operand) {
return !(*this == operand);
}
public:
inline const QByteArray& getName() const {
return m_name;
}
inline MatVal get(int row, int col) const {
check(row, col);
return m_values[row * m_cols + col];
}
inline RplMatrix& set(int row, int col, MatVal value) {
check(row, col);
m_values[row * m_cols + col] = value;
return *this;
}
inline int getRows() const {
return m_rows;
}
inline int getCols() const {
return m_cols;
}
public:
void checkDefinition(int rows, int cols) const;
void check(int row, int col) const;
void checkSameDimension(const RplMatrix& operand) const;
RplMatrix& resize(int rows, int cols, const MatVal values[] = NULL,
MatVal defaultValue = 0.0);
Tuple2 minMax() const;
RplMatrix transpose() const;
QByteArray toString(const char* prefix = NULL, const char* format = "%f",
const char* rowSeparator = "\n", const char* colSeparator = ",") const;
void readFromCvs(const char* filename, int maxLineLength = 1024 * 1024);
void readFromXml(const char* filename, const char* tagCol,
const char* tagRow, const char* tagTable,
int maxLineLength = 1024 * 1024);
protected:
int m_rows;
int m_cols;
MatVal* m_values;
QByteArray m_name;
};
#endif /* RplMatrix_HPP_ */
| republib/reqt-math/ReMatrix.hpp |
/*****************************************************************************
* Copyright 2006 - 2008 Broadcom Corporation. All rights reserved.
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2, available at
* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
*
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a
* license other than the GPL, without Broadcom's express prior written
* consent.
*****************************************************************************/
#ifndef VC_FILESERVICE_DEFS_H
#define VC_FILESERVICE_DEFS_H
/* Definitions (not used by API) */
#define FS_MAX_DATA 4096
/* Protocol (not used by API) version 1.2 */
enum {
/* Over-the-wire file open flags */
VC_O_RDONLY = 0x01,
VC_O_WRONLY = 0x02,
VC_O_RDWR = 0x04,
VC_O_APPEND = 0x08,
VC_O_CREAT = 0x10,
VC_O_TRUNC = 0x20,
VC_O_EXCL = 0x40,
/* Request Commands (VC->Host->VC) */
/* These commands don't require a pathname */
VC_FILESYS_RESET = 64,
VC_FILESYS_CLOSE = 65,
VC_FILESYS_CLOSEDIR = 66,
VC_FILESYS_LSEEK = 67,
VC_FILESYS_READ = 68,
VC_FILESYS_READDIR = 69,
VC_FILESYS_SETEND = 70,
VC_FILESYS_WRITE = 71,
/* These commands require a pathname */
VC_FILESYS_FORMAT = 72,
VC_FILESYS_FREESPACE = 73,
VC_FILESYS_GET_ATTR = 74,
VC_FILESYS_MKDIR = 75,
VC_FILESYS_OPEN = 76,
VC_FILESYS_OPENDIR = 77,
VC_FILESYS_REMOVE = 78,
VC_FILESYS_RENAME = 79,
VC_FILESYS_SET_ATTR = 80,
VC_FILESYS_SCANDISK = 81,
VC_FILESYS_TOTALSPACE = 82,
VC_FILESYS_DISKWRITABLE=83,
VC_FILESYS_OPEN_DISK_RAW = 84,
VC_FILESYS_CLOSE_DISK_RAW = 85,
VC_FILESYS_NUMSECTORS = 86,
VC_FILESYS_READ_SECTORS = 87,
VC_FILESYS_WRITE_SECTORS = 88,
VC_FILESYS_MOUNT = 89,
VC_FILESYS_UMOUNT = 90,
VC_FILESYS_FSTYPE = 91,
VC_FILESYS_READ_DIRECT = 92,
VC_FILESYS_LSEEK64 = 93,
VC_FILESYS_FREESPACE64 = 94,
VC_FILESYS_TOTALSPACE64= 95
};
/* Parameters for lseek */
#define VC_FILESYS_SEEK_SET 0 /* Set file pointer to "offset" */
#define VC_FILESYS_SEEK_CUR 1 /* Set file pointer to current plus "offset" */
#define VC_FILESYS_SEEK_END 2 /* Set file pointer to EOF plus "offset" */
/* Return values of vc_filesys_type */
#define VC_FILESYS_FS_UNKNOWN 0
#define VC_FILESYS_FS_FAT12 1
#define VC_FILESYS_FS_FAT16 2
#define VC_FILESYS_FS_FAT32 3
#endif
| kzlin129/tt-gpl-go12/linux-2.6.28.10/drivers/char/broadcom/vc/vc_fileservice_defs.h |
Evaluate the sum of a function
anemone
MHB POTW Director
Staff member
Evaluate $h\left( \dfrac{1}{401} \right)+h\left( \dfrac{2}{401} \right)+\cdots+h\left( \dfrac{400}{401} \right)$ if $h(x)=\dfrac{9^x}{9^x+3}$.
Pranav
Well-known member
Evaluate $h\left( \dfrac{1}{401} \right)+h\left( \dfrac{2}{401} \right)+\cdots+h\left( \dfrac{400}{401} \right)$ if $h(x)=\dfrac{9^x}{9^x+3}$.
Notice that h(x)+h(1-x)=1.
Hence,
$$h\left(\frac{1}{401}\right)+h\left(\frac{400}{401}\right)=1$$
$$h\left(\frac{2}{401}\right)+h\left(\frac{399}{401}\right)=1$$
$$.$$
$$.$$
$$.$$
$$h\left(\frac{200}{401}\right)+h\left(\frac{201}{401}\right)=1$$
So the sum is 200.
anemone
MHB POTW Director
Staff member
Notice that h(x)+h(1-x)=1.
Hence,
$$h\left(\frac{1}{401}\right)+h\left(\frac{400}{401}\right)=1$$
$$h\left(\frac{2}{401}\right)+h\left(\frac{399}{401}\right)=1$$
$$.$$
$$.$$
$$.$$
$$h\left(\frac{200}{401}\right)+h\left(\frac{201}{401}\right)=1$$
So the sum is 200.
Well done and thanks for participating, Pranav! I think this problem is doable only if one recognizes that in this case, $h(x)+h(1-x)=1$! | finemath-3plus |
export default {
uiv: {
datePicker: {
clear: 'Tyhjennä',
today: 'Tänään',
month: 'Kuukausi',
month1: 'Tammikuu',
month2: 'Helmikuu',
month3: 'Maaliskuu',
month4: 'Huhtikuu',
month5: 'Toukokuu',
month6: 'Kesäkuu',
month7: 'Heinäkuu',
month8: 'Elokuu',
month9: 'Syyskuu',
month10: 'Lokakuu',
month11: 'Marraskuu',
month12: 'Joulukuu',
year: 'Vuosi',
week1: 'Ma',
week2: 'Ti',
week3: 'Ke',
week4: 'To',
week5: 'Pe',
week6: 'La',
week7: 'Su'
},
timePicker: {
am: 'AM',
pm: 'PM'
},
modal: {
cancel: 'Peruuta',
ok: 'OK'
}
}
}
| wxsms/uiv-src/locale/lang/fi-FI.js |
# Analytic Geometry (6th Edition) View more editions Solutions for Chapter 3.1 Problem 16PProblem 16P: In Problem, find an equation of the line indicated and sketc...
• 1824 step-by-step solutions
• Solved by professors & experts
• iOS, Android, & web
Chapter: Problem:
In Problem, find an equation of the line indicated and sketch the graph.
Through (5, 1) and (5, 3)
Step-by-Step Solution:
Chapter: Problem:
• Step 1 of 4
If the x-coordinates of a pair of points are equal, then the line passing through the points must be vertical. The equation of the vertical line is given by
where a is the value of the common x-coordinate.
Therefore, the equation of the line that passes through the point and is
In general form, the equation of the line is .
• Chapter , Problem is solved.
Corresponding Textbook
Analytic Geometry | 6th Edition
9780534948542ISBN-13: 0534948545ISBN: Douglas F RiddleAuthors: | finemath-3plus |
/*
* Copyright IBM Corporation, 2013. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
package org.opendaylight.controller.networkconfig.neutron;
/**
* This interface defines the methods a service that wishes to be aware of Neutron Subnets needs to implement
*
*/
public interface INeutronSubnetAware {
/**
* Services provide this interface method to indicate if the specified subnet can be created
*
* @param subnet
* instance of proposed new Neutron Subnet object
* @return integer
* the return value is understood to be a HTTP status code. A return value outside of 200 through 299
* results in the create operation being interrupted and the returned status value reflected in the
* HTTP response.
*/
public int canCreateSubnet(NeutronSubnet subnet);
/**
* Services provide this interface method for taking action after a subnet has been created
*
* @param subnet
* instance of new Neutron Subnet object
* @return void
*/
public void neutronSubnetCreated(NeutronSubnet subnet);
/**
* Services provide this interface method to indicate if the specified subnet can be changed using the specified
* delta
*
* @param delta
* updates to the subnet object using patch semantics
* @param subnet
* instance of the Neutron Subnet object to be updated
* @return integer
* the return value is understood to be a HTTP status code. A return value outside of 200 through 299
* results in the update operation being interrupted and the returned status value reflected in the
* HTTP response.
*/
public int canUpdateSubnet(NeutronSubnet delta, NeutronSubnet original);
/**
* Services provide this interface method for taking action after a subnet has been updated
*
* @param subnet
* instance of modified Neutron Subnet object
* @return void
*/
public void neutronSubnetUpdated(NeutronSubnet subnet);
/**
* Services provide this interface method to indicate if the specified subnet can be deleted
*
* @param subnet
* instance of the Subnet Router object to be deleted
* @return integer
* the return value is understood to be a HTTP status code. A return value outside of 200 through 299
* results in the delete operation being interrupted and the returned status value reflected in the
* HTTP response.
*/
public int canDeleteSubnet(NeutronSubnet subnet);
/**
* Services provide this interface method for taking action after a subnet has been deleted
*
* @param subnet
* instance of deleted Router Subnet object
* @return void
*/
public void neutronSubnetDeleted(NeutronSubnet subnet);
}
| aryantaheri/controller-opendaylight/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/INeutronSubnetAware.java |
# Solution for american perpetual put
I have been attempting an exercise in which I have to determine the value of an american perpetual put, $P$ in terms of the asset value $S$. The solution to the exercise says:
When $S>S_f$ (the optimal exercise boundary) P will satisfy
$\frac{1}{2}{\sigma}^2 S^2 \frac{\partial^2 P}{\partial S^2}-rP+rS\frac{\partial P}{\partial S}=0$ (standard BS pde)
where $r$ is risk free interest rate and $\sigma$ is the volatility of $S$
I understand that part but then it says to assume a solution of the form $P=S^{\lambda}$ where $\lambda$ is a real number.
Can anyone explain the idea behind this assumption?
• That's how PDEs and ODEs are often solved: someone guesses the form of the solution and then tries to verify that the equation is satisfied. A great deal of trial and error is often involved... You try S, then you try $S^n$ then $\ln S$ and so on. It's not an elegant business. – Alex C Apr 18 '16 at 0:53
To elaborate on the explanation provided by @Alex, the reasoning is because when we look at the PDE we notice that the $S$ terms appear in pairs with the $\dfrac{\partial}{\partial S}$, i.e. $S\dfrac{\partial}{\partial S}$ and $S^2\dfrac{\partial^2}{\partial S^2}$. What this says it that if we were to try a polynomial function of $S$ then after applying these operators then the exponent of $S$ would not change, i.e. $S\dfrac{\partial S^n}{\partial S} \to nS^n$ and similarly $S^2\dfrac{\partial^2 S^n}{\partial S^2} \to n(n-1)S^n$. This means that after trying this ansatz in the PDE it would cancel leaving only a polynomial equation for $n$, which if we can show has solutions, justifies the initial ansatz.
The overall reasoning behind this is that trying to solve PDEs in general is tedious, so always look for shortcuts specific to the problem. A good mentality to solving a PDE problem is that solving the actual PDE in general is relatively easy, the relatively hard bit is applying the boundary conditions! Hence whenever solving a PDE we should keep in mind how are our boundary conditions expressed? If they are a polynomial function of $S$ then we should try a polynomial function as our ansatz. If we have a wave boundary condition then try a wave ansatz, etc.
e.g.
The following $$\dfrac{\sigma^2}{2} \frac{\partial^2 P}{\partial S^2}-rP+r\frac{\partial P}{\partial S}=0$$ would typically motivate a solution $P = \exp(\mu S)$ and then we would solve for $\mu$.
A more general justification can be found in most courses in Linear Algebra and I would recommend seeing examples of the Sturm-Liouville problem. The general reasoning though is to change the basis into one that is easy to solve, e.g. we could solve your original PDE in terms of $\sin(S)$ and $\cos(S)$, or Legendre polynomials, Bessel functions, etc., but the solutions would not be anywhere as tidy. But you only learn which to try by drawing on experience, and even after years of experience and clever justifications it can frequently resort to trial and error.
I hope this helps.
With respect I think that this issue was associated Martingale properties AND dominated convergence theorem.(May be Wrong)
Let $L\in(0,K)$ a fixed price, we can consider the following choices for the exercise of a put option with strike price $K$:
• If $S_t\le K$, then we exercise contract at time $t$, and were delighted.
• O.W. we should wait until the first hitting time(of course we can play PS4 until the first hitting time!!) $$\tau_L=\inf \{u\ge t:S_u\le L \}$$ In case $S_T\le L$, the payoff will be $(K-S_t)^{+}$ since $K>L\ge S_t$. In case $S_t > L$, the price of the option will $$P_L(t,S_t)=E^{\mathbb{Q}}\left[e^{-r(\tau_L-t)}(K-S_{\tau_{L}})^+|S_t\right]$$ You know that the underlying asset price is written as $$S_t=S_0e^{rt+W^{\mathbb{Q}}_t-\frac{1}{2}\sigma^2\,t}\,\,(1)$$ We claim P_L(t,S_t=x)=\left\{ \begin{align} & K-x\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,,\,\,\,\,\,0<x\le L \\ & (K-L){{\left( \frac{x}{L} \right)}^{-\frac{r}{2{{\sigma }^{2}}}}}\,,\,\,\operatorname{O}.W. \\ \end{align} \right. As you see the starting date $t$ does not matter when pricing perpetual options hence $P_L(t, x)$ is actually independent of $t\in\mathbb{R}^+$, and the pricing of the perpetual put option can be performed by taking $t = 0$ and in the sequel we will work under $P_L(t,S_t)=P_L(S_t).$
Proof
Without loss of generality we take $t=0$
1. The result is obvious for $S_0=x\le L<K$ since in this case we have $\tau_L=t$ and $S_{\tau_L}=S_0=x$ and we have $$P_L(x)=E^{\mathbb{Q}}\left[e^{-r(t-t)}(K-x)^+|x\right]=K-x$$
2. (Fasten seat belt) Noe we should consider difficult case, i.e. $S_0=x>L$ .We know $$P_L(x)=E^{\mathbb{Q}}\left[e^{-r(\tau_L-0)}(K-S_{\tau_L})^+|S_0=x\right]=E^{\mathbb{Q}}\left[e^{-r\tau_L}(K-L)|S_0=x\right]$$ thus we just calculate $E^{\mathbb{Q}}\left[e^{-r\tau_L}|S_0=x\right]$. For this, we note that from $(1)$ for all $\lambda\in\mathbb{R}$ the process $\{Y_{\lambda}(t)\}_{t\ge 0}$ as defined $$Y_{\lambda}(t):={\left(\frac{S_t}{S_0}\right)}^{\lambda} e^{-t(r\lambda-\lambda(1-\lambda)\sigma^2/2)}=e^{\lambda\sigma W^{\mathbb{Q}}_t-\frac{1}{2}\lambda^2\sigma^2\,t}$$ is a martingale under the risk-neutral probability. Choosing $\lambda$ such that $$r=r\lambda-\frac{1}{2}\lambda(1-\lambda)\sigma^2$$ then $\lambda=1$ or $\lambda=-\frac{-2r}{\sigma^2}$. Choosing the negative solution, we have $\mathbb Q(\tau_L<\infty)=1$ and the bound
$$0\le Y_{\lambda}(t)={\left(\frac{S_t}{S_0}\right)}^{\lambda} e^{-t(r\lambda-\lambda(1-\lambda)\sigma^2/2)}={\left(\frac{S_t}{S_0}\right)}^{-\frac{2r}{\sigma^2}} e^{-tr}\le {\left(\frac{L}{S_0}\right)}^{-\frac{2r}{\sigma^2}}$$ since $r>0$ and $\lambda=-\frac{-2r}{\sigma^2}$. This yields $${\left(\frac{L}{S_0}\right)}^{{-\frac{2r}{\sigma^2}}}E^{\mathbb{Q}}\left[e^{-r \tau_L}\right]=E^{\mathbb{Q}}\left[\left(\frac{S_{\tau_L}}{S_0}\right)^{-\frac{2r}{\sigma^2}}e^{-r\tau_L}\mathbb{1}_{\{\tau_L<\infty \}}\right]=E^{\mathbb{Q}}[Y_{\lambda}(t)\mathbb{1}_{\{\tau_L<\infty \}}]$$ as a result $${\left(\frac{L}{S_0}\right)}^{{-\frac{2r}{\sigma^2}}}E^{\mathbb{Q}}\left[e^{-r \tau_L}\right]=E^{\mathbb{Q}}\left[\underset{t\to \infty }{\mathop{\lim }} Y_{\lambda}(\tau_L\wedge t)\right]=\underset{t\to \infty }{\mathop{\lim }}E^{\mathbb{Q}}\left[Y_{\lambda}(\tau_L\wedge t)\right]=E^{\mathbb{Q}}\left[Y_{\lambda}(0)\right]$$ Indeed we used the dominated convergence theorem,we have $${\left(\frac{L}{S_0}\right)}^{{-\frac{2r}{\sigma^2}}}E^{\mathbb{Q}}\left[e^{-r \tau_L}\right]=E^{\mathbb{Q}}\left[Y_{\lambda}(0)\right]=1$$ In the oher words $$E^{\mathbb{Q}}\left[e^{-r\tau_L}|S_0=x\right]={\left(\frac{x}{L}\right)}^{-\frac{r}{2\sigma^2}}\,\,\,\,\,,\,\,\,\,x>L$$ | finemath-3plus |
import _ from 'lodash';
import Module from './Module';
import ContentModule from './ContentModule';
import ContentFolder from './ContentFolder';
import { getModulePathParts } from './utils';
export default class ConcatenatedModule extends Module {
constructor(name, data, parent) {
super(name, data, parent);
this.name += ' (concatenated)';
this.children = Object.create(null);
this.fillContentModules();
}
fillContentModules() {
_.each(this.data.modules, moduleData => this.addContentModule(moduleData));
}
addContentModule(moduleData) {
const pathParts = getModulePathParts(moduleData);
if (!pathParts) {
return;
}
const [folders, fileName] = [pathParts.slice(0, -1), _.last(pathParts)];
let currentFolder = this;
_.each(folders, folderName => {
let childFolder = currentFolder.getChild(folderName);
if (!childFolder) {
childFolder = currentFolder.addChildFolder(new ContentFolder(folderName, this));
}
currentFolder = childFolder;
});
const module = new ContentModule(fileName, moduleData, this);
currentFolder.addChildModule(module);
}
getChild(name) {
return this.children[name];
}
addChildModule(module) {
module.parent = this;
this.children[module.name] = module;
}
addChildFolder(folder) {
folder.parent = this;
this.children[folder.name] = folder;
return folder;
}
toChartData() {
return {
...super.toChartData(),
concatenated: true,
groups: _.invokeMap(this.children, 'toChartData')
};
}
};
| esteladiaz/esteladiaz.github.io-node_modules/webpack-bundle-analyzer/src/tree/ConcatenatedModule.js |
/*
* Copyright (C) 2019 Advanced Micro Devices, Inc.
*
* 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 COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _clk_11_0_0_SH_MASK_HEADER
#define _clk_11_0_0_SH_MASK_HEADER
// addressBlock: clk_clk3_0_SmuClkDec
//CLK3_0_CLK3_CLK_PLL_REQ
#define CLK3_0_CLK3_CLK_PLL_REQ__FbMult_int__SHIFT 0x0
#define CLK3_0_CLK3_CLK_PLL_REQ__PllSpineDiv__SHIFT 0xc
#define CLK3_0_CLK3_CLK_PLL_REQ__FbMult_frac__SHIFT 0x10
#define CLK3_0_CLK3_CLK_PLL_REQ__FbMult_int_MASK 0x000001FFL
#define CLK3_0_CLK3_CLK_PLL_REQ__PllSpineDiv_MASK 0x0000F000L
#define CLK3_0_CLK3_CLK_PLL_REQ__FbMult_frac_MASK 0xFFFF0000L
//CLK3_0_CLK3_CLK2_DFS_CNTL
#define CLK3_0_CLK3_CLK2_DFS_CNTL__CLK2_DIVIDER__SHIFT 0x0
#define CLK3_0_CLK3_CLK2_DFS_CNTL__CLK2_DIVIDER_MASK 0x0000007FL
#endif
| CSE3320/kernel-code-linux-5.8/drivers/gpu/drm/amd/include/asic_reg/clk/clk_11_0_0_sh_mask.h |
/*!
* @header BAKit.h
* BABaseProject
*
* @brief BAKit
*
* @author 博爱
* @copyright Copyright © 2016年 博爱. All rights reserved.
* @version V1.0
*/
// _ooOoo_
// o8888888o
// 88" . "88
// (| -_- |)
// O\ = /O
// ____/`---'\____
// . ' \\| |// `.
// / \\||| : |||// \
// / _||||| -:- |||||- \
// | | \\\ - /// | |
// | \_| ''\---/'' | |
// \ .-\__ `-` ___/-. /
// ___`. .' /--.--\ `. . __
// ."" '< `.___\_<|>_/___.' >'"".
// | | : `- \`.;`\ _ /`;.`/ - ` : | |
// \ \ `-. \_ __\ /__ _/ .-` / /
// ======`-.____`-.___\_____/___.-`____.-'======
// `=---='
//
// .............................................
// 佛祖镇楼 BUG辟易
// 佛曰:
// 写字楼里写字间,写字间里程序员;
// 程序人员写程序,又拿程序换酒钱。
// 酒醒只在网上坐,酒醉还来网下眠;
// 酒醉酒醒日复日,网上网下年复年。
// 但愿老死电脑间,不愿鞠躬老板前;
// 奔驰宝马贵者趣,公交自行程序员。
// 别人笑我忒疯癫,我笑自己命太贱;
// 不见满街漂亮妹,哪个归得程序员?
/*
*********************************************************************************
*
* 在使用BAKit的过程中如果出现bug请及时以以下任意一种方式联系我,我会及时修复bug
*
* QQ : 可以添加ios开发技术群 479663605 在这里找到我(博爱1616【137361770】)
* 微博 : 博爱1616
* Email : [email protected]
* GitHub : https://github.com/boai
* 博客 : http://boaihome.com
*********************************************************************************
*/ // 博爱动画封装
#ifndef BAKit_BAAnimation_h
#define BAKit_BAAnimation_h
#pragma mark - 加载动画
#import "BAKit_LoadingView.h"
#import "BAKit_LoadingWaveView.h"
#endif /* BAKit_BAAnimation_h */
| boai/BAWeChat-WeChat/BAQMUIDemo/BAKit/BAKit_Custom/BAKit_Animation/BAKit_Animation.h |
#ifndef __MINC_CONFIG_H__
#define __MINC_CONFIG_H__
enum MINC_CONFIG {
MICFG_FORCE_V2=0,
MICFG_COMPRESS,
MICFG_CHUNKING,
MICFG_LOGFILE,
MICFG_LOGLEVEL,
MICFG_MAXBUF,
MICFG_MAXMEM,
MICFG_MINC_FILE_CACHE,
MICFG_MINC_CHECKSUM,
MICFG_COUNT
};
extern int miget_cfg_present(int);
extern int miget_cfg_bool(int);
extern int miget_cfg_int(int);
extern const char * miget_cfg_str(int);
extern double miget_cfg_double(int);
#endif /* __MINC_CONFIG_H__ */
| CIBC-Internal/itk-Modules/ThirdParty/MINC/src/libminc/libsrc/minc_config.h |
class CBA_580x42_TYPE95 { // QBZ-95 Stick Mags
BI_mags[] = {
"30Rnd_580x42_Mag_F",
"30Rnd_580x42_Mag_Tracer_F"
};
};
class CBA_580x42_TYPE95_XL { // QBB-95 LSW Drums
BI_drums[] = {
"100Rnd_580x42_Mag_F",
"100Rnd_580x42_Mag_Tracer_F"
};
};
| CBATeam/CBA_A3-addons/jam/magwells_580x42.hpp |
# include "empset.h"
static bool initDone = FALSE;
static /*@only@*/ ereftab known;
static eref empset_get (employee e, erc s) /*@*/
{
erc_elements(s, er)
{
employee e1 = eref_get(er);
if (employee_equal(&e1, &e))
{
return er;
}
} end_erc_elements ;
return eref_undefined;
}
bool empset_member (employee e, erc s)
{
return (eref_isDefined (empset_get (e, s)));
}
void empset_clear (empset s)
{
erc_clear (s);
}
bool /*@alt void@*/ empset_insert (empset s, employee e)
/*@globals internalState@*/
/*@modifies internalState@*/
{
if (eref_isDefined (empset_get (e, s)))
{
return FALSE;
}
empset_insertUnique (s, e);
return TRUE;
}
void empset_insertUnique (empset s, employee e)
/*@globals known@*/
/*@modifies known@*/
{
eref er;
er = ereftab_lookup (e, known);
if (!eref_isDefined (er))
{
er = eref_alloc ( );
eref_assign (er,e);
ereftab_insert (known, e, er);
}
erc_insert (s, er);
}
bool /*@alt void@*/ empset_delete (empset s, employee e)
{
eref er;
er = empset_get (e, s);
if (!eref_isDefined (er))
{
return FALSE;
}
return erc_delete (s, er);
}
empset empset_disjointUnion (empset s1, empset s2)
/*@globals known@*/
/*@modifies known@*/
{
erc result;
empset tmp;
result = erc_create ( );
if (erc_size (s1) > erc_size (s2))
{
tmp = s1;
s1 = s2;
s2 = tmp;
}
erc_join (result, s1);
empset_elements(s2, emp)
{
empset_insertUnique(result, emp);
} end_empset_elements ;
return result;
}
empset empset_union (empset s1, empset s2)
{
erc result;
empset tmp;
result = erc_create ();
if (erc_size (s1) > erc_size (s2))
{
tmp = s1;
s1 = s2;
s2 = tmp;
}
erc_join (result, s2);
empset_elements (s1, emp)
{
if (!empset_member(emp, s2))
{
empset_insert(result, emp);
}
} end_empset_elements ;
return result;
}
void empset_intersect (empset s1, empset s2)
{
erc toDelete = erc_create();
empset_elements (s2, emp)
{
if (!empset_member(emp, s2))
{
empset_insert(toDelete, emp);
}
} end_empset_elements ;
empset_elements (toDelete, emp)
{
empset_delete(s1, emp);
} end_empset_elements;
erc_final (toDelete);
}
bool empset_subset (empset s1, empset s2)
{
empset_elements(s1, emp)
{
if (!empset_member(emp, s2))
{
return FALSE;
}
} end_empset_elements ;
return TRUE;
}
void empset_initMod (void)
/*@globals initDone, undef known@*/
/*@modifies initDone, known@*/
{
if (initDone)
{
/*@-globstate@*/ return; /*@=globstate@*/
}
bool_initMod ();
employee_initMod ();
eref_initMod ();
erc_initMod ();
ereftab_initMod ();
known = ereftab_create ();
initDone = TRUE;
}
| ravenexp/splint-test/db3/empset.c |
#!/usr/bin/env python
# EX 01: create a new list with 3 random strings as elements
import random
import string
def randomstring(times, chars):
s = ''
for _ in xrange(times):
s += random.choice(chars)
return s
def main():
lista = []
for _ in xrange(3):
stringa = randomstring(random.randint(5, 15),
string.ascii_letters + string.digits )
lista.append(stringa)
print(lista)
if __name__ == '__main__':
main()
| zusantunfimmeri/python-exercises-ch3/ex01.py |
/*******************************************************************************
* Copyright (c) 2014 Joakim von Kistowski
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
package tools.descartes.dlim.tests;
import java.io.File;
/**
* Utilities for testing.
*
* @author Joakim von Kistowski
*/
public final class DlimTestUtils {
/**
* Delta for floating point equality comparisons.
*/
public static final double FP_DELTA = 0.0001;
/**
* Path for test outputs. Clean with cleanTestOutputDirectory before use.
*/
public static final String TEST_OUTPUT_DIR = "testoutput/";
/**
* Path for all input files for testing.
*/
public static final String TEST_INPUT_DIR = "testinput/";
/**
* DLIM model instance for testing.
*/
public static final String TEST_MODEL = DlimTestUtils.TEST_INPUT_DIR
+ "testmodel.dlim";
/**
* It's all static anyways.
*/
private DlimTestUtils() {
}
/**
* Cleans the test output directory of all files.
*/
public static void cleanTestOutputDirectories() {
cleanDirectory(new File(TEST_OUTPUT_DIR));
cleanDirectory(new File("./arrivalRates"));
cleanDirectory(new File("./timeStamps"));
cleanDirectory(new File("./diffs"));
}
private static void cleanDirectory(File dir) {
File[] files = dir.listFiles();
if (files != null) {
for (File f : files) {
if (f.isDirectory()) {
cleanDirectory(f);
}
if (!f.getName().equals(".gitignore")) {
f.delete();
}
}
}
}
/**
* Returns the Path of the current working directory. This should also be
* the path of the Eclipse Test project.
*
* @return Path of this test project.
*/
public static String getProjectPath() {
return new File("").getAbsolutePath();
}
}
| groenda/LIMBO-tools.descartes.dlim.generator.tests/src/tools/descartes/dlim/tests/DlimTestUtils.java |
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array-exotic-objects-defineownproperty-p-desc
info: |
For every integer k that is less than the value of
the length property of A but not less than ToUint32(length),
if A itself has a property (not an inherited property) named ToString(k),
then delete that property
es5id: 15.4.5.1_A1.2_T3
description: Checking an inherited property
---*/
//CHECK#1
Array.prototype[2] = 2;
var x = [0, 1];
x.length = 3;
if (x.hasOwnProperty('2') !== false) {
$ERROR('#1: Array.prototype[2] = 2; x = [0,1]; x.length = 3; x.hasOwnProperty(\'2\') === false. Actual: ' + (x.hasOwnProperty('2')));
}
//CHECK#2
x.length = 2;
if (x[2] !== 2) {
$ERROR('#2: Array.prototype[2] = 2; x = [0,1]; x.length = 3; x.length = 2; x[2] === 2. Actual: ' + (x[2]));
}
| sebastienros/jint-Jint.Tests.Test262/test/built-ins/Array/length/S15.4.5.1_A1.2_T3.js |
Service - Politiken PLUS
Service Kay Bojesen
Kay Bojesen i børnehøjde
Kay Bojesen er kendt for sit karakteristiske designmantra om, at der skal være ”cirkus i tingene”, og at linjerne på godt design bør smile. Den humørfyldte tilgang til kunsthåndværket overskyggede dog aldrig Kay Bojesens fokus på æstetik og funktionalitet. Heller ikke når han skabte design til børn, for Kay Bojesen var stærkt optaget af didaktik og moderne pædagogiske principper. Som en hyldest til indlæring gennem leg lancerer Kay Bojesen Denmark dette forår Kay Bojesens uimodståelige børneservice i melamin, der sætter alfabetet og klokken på menuen og gør måltidet til et kreativt indslag i familiens hverdag.
Kay Bojesens berømte træfigurer omtales ofte som ”legetøj”. I virkeligheden er garderen, aben og de andre dyr først og fremmest designobjekter, der appellerer til barnet i os alle, men Kay Bojesen skabte i høj grad også design til de mindste. Den visionære formgiver var tilhænger af tidens moderne indlæringsprincipper, der op gennem 1940’erne og 50’erne blev bannerfører for tanken om indlæring gennem leg og kreativitet. I 2014 relancerede Kay Bojesen Denmark med stor succes Alfabetklodserne, som Kay Bojesen designede som et staveredskab til den danske folkeskole, og foråret 2016 følger virksomheden op med Kay Bojesens intelligente design til middagsbordet: Et børneservice. Kay Bojesens børneservice består af tre melamindele, tallerken, dyb tallerken og kop, der kommunikerer alfabetet og klokken i moderne design og som tåler uendelige ture på gulvet, når der er bogstavleg på menuen.
ABC og tal-lerkenleg
Gennem sin lange karriere som formgiver arbejdede Kay Bojesen med mange materialer. Han var oprindelig uddannet sølvsmed, men tog i 1930’erne en afstikker til porcelænsvirksomheden Bing & Grøndahl, hvor han som kunstnerisk leder prøvede kræfter med porcelænsdesign. Her så børneservicet første gang dagens lys og vakte opsigt med sit fokus på funktion, æstetik og oplevelse i spisesituationen, men de pædagogiske principper holdt dog kun, så længe børnene ikke kastede porcelænet på gulvet. Siden blev servicet produceret i melamin, og når Kay Bojesen Denmark i dag tager fornyet livtag med det lærerige service, er det fortsat i slagfast melamin om end i en raffineret udgave, der med en særlig forarbejdning minder om porcelæn på overfladen.
Indlæringsmetoden er stadig den originale. Kanten af den flade tallerken har tal som en urskive, mens kanten på den dybe tallerken er dekoreret med alfabetets bogstaver. Når tallerkenerne er i brug, bruger barnet sit bestik som redskab til at lære klokken og til at lære at stave. Til de mere læseøvede er den dekorative melaminkop pyntet med bogstaver, der er placeret tæt på hinanden og nemt danner kendte ord som ”mor” og ”far”.I tråd med Kay Bojesens designDNA er servicets bogstav- og talillustrationer holdt i et enkelt, arkitektonisk udtryk, der gør det grafisk smukt og nemt for barnet at afkode, lege med og lære af.
Kay Bojesen børneservice er en selvskreven gaveidé til alle videbegærlige børn og deres designelskende forældre og sælges i en smuk gaveæske. Se hele beskrivelsen
| c4-da |
//
// BookInfoModel.h
// Book_Reader
//
// Created by hhuua on 2018/6/25.
// Copyright © 2018年 hhuua. All rights reserved.
//
#import "BookAPIBaseModel.h"
@interface BookInfoModel : BookAPIBaseModel
/* 书本名称*/
@property (nonatomic,copy) NSString* book_name;
/* 作者*/
@property (nonatomic,copy) NSString* author;
/* 书本的关联id号码*/
@property (nonatomic,copy) NSString* related_id;
/* 书本更新时间(不太准)*/
@property (nonatomic,copy) NSString* update_time;
/* 书本简介*/
@property (nonatomic,copy) NSString* book_desc;
/* 书本图片url*/
@property (nonatomic,copy) NSString* book_image;
/* 当前所选书源的url*/
@property (nonatomic,copy) NSString* book_url;
/* 书本的书源名称*/
@property (nonatomic,copy) NSString* source_name;
/* 书本状态*/
@property (nonatomic,copy) NSString* book_state;
/* 书本分类*/
@property (nonatomic,copy) NSString* book_sort;
/* 书本最后章节*/
@property (nonatomic,copy) NSString* book_last_chapter;
/* 字数*/
@property (nonatomic,assign) NSInteger book_word_count;
/* 收藏人数*/
@property (nonatomic,assign) NSInteger collection_num;
@end
| LQJJ/demo-122-Book_Reader-dev/Book_Reader/Main/Model/BookAPIModel/BookInfoModel.h |
Santa Catarina (estado) - Wikipedia
Tiganos: 27°00′S 50°00′W / 27.0°S 50.0°V / -27.0; -50.0
Alang sa ubang mga dapit sa mao gihapon nga ngalan, tan-awa ang Santa Catarina.
Opisyal nga ngaran: Estado de Santa Catarina
27°00′S 50°00′W / 27.0°S 50.0°V / -27.0; -50.0
95,346.18 km2 (36,813 sq mi)
6,249,682 (2014-08-01) [1]
3450387
Estado ang Santa Catarina (Kinatsila: Estado de Santa Catarina) sa Brasil.[1] Nahimutang ni sa habagatang bahin sa nasod, 1,300 km sa habagatan sa Brasília ang ulohan sa nasod. Adunay 6,249,682 ka molupyo.[1] Naglangkob kin og 95,346 ka kilometro kwadrado. Santa Catarina mopakigbahin sa usa ka utlanan sa Rio Grande do Sul, Paraná, ug Provincia de Misiones.
Ang yuta sa Santa Catarina kay kabungtoran sa kasadpan, apan sa sidlakan nga kini mao ang kabukiran.[saysay 1]
Santa Catarina may sa mosunod nga mga subdibisyon:
Sa mosunod nga mga natural nga mga bahin makita sa Santa Catarina:
Serra da Farofa (ibabaw'mg patag)
Canal das Três Barras (agianan nga kadagatan)
Canal de Santa Catarina (agianan nga kadagatan)
Canal do Linguado (agianan nga kadagatan)
Canal Ipiranga (agianan nga kadagatan)
Baía de Itapocoróia (luuk)
Baía do Norte (luuk)
Baía do Sul (luuk)
Baía Tijucas (luuk)
Enseada da Pinheira (luuk)
Enseada das Bombas (luuk)
Enseada de Camboriú (luuk)
Enseada de Porto Belo (luuk)
Enseada do Brito (luuk)
Enseada do Mariscal (luuk)
Enseada do Pãntano do Sul (luuk)
Enseada dos Zimbros (luuk)
Saco dos Limões (luuk)
Arroio Abelha (suba)
Arroio Abelha II (suba)
Arroio Água Clara (suba)
Arroio Água do Tatu (suba)
Arroio Anta Gorda (suba)
Arroio Apa (suba)
Arroio Atafona (suba)
Arroio Baixo Laje (suba)
Arroio Banhado (suba)
Arroio Barra do Burro (suba)
Arroio Barracas (suba)
Arroio Barrinha (suba)
Arroio Basílio (suba)
Arroio Boa Vista (suba)
Arroio Bracatinga (suba)
Arroio Braço da Cobra de Fora (suba)
Arroio Braço do Laurentino (suba)
Arroio Braço Esquerdo da Laje (suba)
Arroio Braço Itoupava (suba)
Arroio Braço Matador (suba)
Arroio Butiá de Cima (suba)
Arroio Caçador (suba)
Arroio Caminho da Padaria (suba)
Arroio Caminho do Meio (suba)
Arroio Caminho Leão (suba)
Arroio Canela (suba)
Arroio Canhasana (suba)
Arroio Catangara (suba)
Arroio Catete (suba)
Arroio Cedro (suba)
Arroio Condoga (suba)
Arroio Corindeiro (suba)
Arroio Corrente (suba)
Arroio Curucurana (suba)
Arroio da Abelha (suba)
Arroio da Cruz (suba)
Arroio da Gabirobinha (suba)
Arroio da Geada (suba)
Arroio da Gruta (suba)
Arroio da Paz (suba)
Arroio da Piava (suba)
Arroio das Canoas (suba)
Arroio do Alípio (suba)
Arroio do Cedro (suba)
Arroio do Cemitério (suba)
Arroio do Emídio (suba)
Arroio do Imbuial (suba)
Arroio do Macuco (suba)
Arroio do Pavão (suba)
Arroio do Posto (suba)
Arroio do Púlpito (suba)
Arroio do Quadrado (suba)
Arroio do | c4-ceb |
الفيفا يكشف حقيقة منع محمد صلاح من المشاركة في الأولمبياد | الصباح
باسل عبد الغني / 2020-02-15 14:25:23 / رياضة
أكد الاتحاد الدولي لكرة القدم "الفيفا" أن طرفًا واحدًا يمتلك حق السماح أو منع اللاعب محمد صلاح من المشاركة في أولمبياد طوكيو 2020.
ووفقًا لقناة سكاي نيوز يشارك في مسابقة كرة القدم في الأولمبياد المنتخب الأولمبي لمن هم دون 23 عاما، مع استثناء 3 لاعبين فوق هذا السن، ويأمل مسؤولو المنتخب المصري أن يكون محمد صلاح (27 عاما) أحدهم، حيث أكد الاتحاد الدولي أن باستطاعة ليفربول الإنجليزي، منع نجمه محمد صلاح، من المشاركة مع منتخب مصر في الألعاب الأولمبية المقبلة.
. ولم يتخذ مدرب ليفربول يورغن كلوب قرارا بعد، بشأن السماح لصلاح بالمشاركة في الألعاب الأولمبية، حيث أشار، الجمعة، إلى أنه يحتاج إلى "معلومات إضافية" لاتخاذ قرار بشأن السماح لنجم فريقه للمشاركة مع المنتخب المصري في أولمبياد طوكيو 2020.
محمد صلاح , | c4-ar |
import subject from '../../../src/imitate/initialize-names'
module.exports = {
'passed a non-null names': () => {
assert.equal(subject(null, 'foo'), 'foo')
},
'an anon function': () => {
assert.deepEqual(subject(function () {}), [])
},
'a named function': () => {
assert.deepEqual(subject(function blah () {}), ['blah'])
},
'a plain object': () => {
assert.deepEqual(subject({}), [])
},
'a string names param gets wrapped in []': () => {
assert.deepEqual(subject(function () {}, 'o_O'), ['o_O'])
}
}
| testdouble/testdouble.js-test/unit/imitate/initialize-names.test.js |
# This module requires that a global FIREBASE object is initialized, from the gem
# `firebase` (https://rubygems.org/gems/firebase). If you don't want to do that, it's
# pretty easy to tweak this code to take the FIREBASE object as a param, or even
# to hit the REST endpoints yourself using whatever HTTP client you prefer.
#
# To load the final text value of a pad created through the official JavaScript
# Firepad client, call `Firepad.load "PADNAME"`. This will check for a snapshot,
# then mutate a string in place to produce the final output. We also account for
# JavaScript's shitty string representation (JS expresses the poop emoji as two chars).
module Firepad
def self.load pad_path
if checkpoint = FIREBASE.get("#{pad_path}/checkpoint").body
doc = checkpoint['o'].first
doc = '' unless doc.is_a? String
history = FIREBASE.get("#{pad_path}/history", orderBy: '"$key"', startAt: "\"#{checkpoint['id']}\"").body.sort
history.shift
else
doc = ''
history = FIREBASE.get("#{pad_path}/history").body
return nil unless history
history = history.sort
end
doc.pad_surrogate_pairs!
history.each do |_, ops|
idx = 0
ops['o'].each do |op|
if op.is_a? Fixnum
if op > 0
# retain
idx += op
else
# delete
doc.slice! idx, -op
end
else
# insert
op.pad_surrogate_pairs!
doc.insert idx, op
idx += op.length
end
end
raise "The operation didn't operate on the whole string." if idx != doc.length
end
doc.delete! "\0".freeze
doc
end
end
class String
def pad_surrogate_pairs!
offset = 0
self.each_codepoint.with_index do |codepoint, idx|
if codepoint >= 0x10000 && codepoint <= 0x10FFFF
self.insert idx + offset, "\0".freeze
offset += 1
end
end
self
end
end
| firepad/firepad.github.io-firepad.rb |
/*
* 3DS OUTSCALE API
*
* Welcome to the 3DS OUTSCALE's API documentation.<br /><br /> The 3DS OUTSCALE API enables you to manage your resources in the 3DS OUTSCALE Cloud. This documentation describes the different actions available along with code examples.<br /><br /> Note that the 3DS OUTSCALE Cloud is compatible with Amazon Web Services (AWS) APIs, but some resources have different names in AWS than in the 3DS OUTSCALE API. You can find a list of the differences [here](https://wiki.outscale.net/display/EN/3DS+OUTSCALE+APIs+Reference).<br /><br /> You can also manage your resources using the [Cockpit](https://wiki.outscale.net/display/EN/About+Cockpit) web interface.
*
* API version: 1.2
* Contact: [email protected]
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package osc
// VpnConnection Information about a VPN connection.
type VpnConnection struct {
// The configuration to apply to the client gateway to establish the VPN connection, in XML format.
ClientGatewayConfiguration string `json:"ClientGatewayConfiguration,omitempty"`
// The ID of the client gateway used on the client end of the connection.
ClientGatewayId string `json:"ClientGatewayId,omitempty"`
// The type of VPN connection (always `ipsec.1`).
ConnectionType string `json:"ConnectionType,omitempty"`
// Information about one or more static routes associated with the VPN connection, if any.
Routes []RouteLight `json:"Routes,omitempty"`
// The state of the VPN connection (`pending` \\| `available` \\| `deleting` \\| `deleted`).
State string `json:"State,omitempty"`
// If `false`, the VPN connection uses dynamic routing with Border Gateway Protocol (BGP). If `true`, routing is controlled using static routes. For more information about how to create and delete static routes, see [CreateVpnConnectionRoute](#createvpnconnectionroute) and [DeleteVpnConnectionRoute](#deletevpnconnectionroute).
StaticRoutesOnly bool `json:"StaticRoutesOnly,omitempty"`
// One or more tags associated with the VPN connection.
Tags []ResourceTag `json:"Tags,omitempty"`
// The ID of the virtual gateway used on the 3DS OUTSCALE end of the connection.
VirtualGatewayId string `json:"VirtualGatewayId,omitempty"`
// The ID of the VPN connection.
VpnConnectionId string `json:"VpnConnectionId,omitempty"`
}
| ricardclau/packer-vendor/github.com/outscale/osc-sdk-go/osc/model_vpn_connection.go |
package headfirst.designpatterns.combining.composite;
public class GooseAdapter implements Quackable {
Goose goose;
public GooseAdapter(Goose goose) {
this.goose = goose;
}
public void quack() {
goose.honk();
}
public String toString() {
return "Goose pretending to be a Duck";
}
}
| yuweijun/learning-programming-design-patterns/src/main/java/headfirst/designpatterns/combining/composite/GooseAdapter.java |
#region Apache License Version 2.0
/*----------------------------------------------------------------
Copyright 2019 Jeffrey Su & Suzhou Senparc Network Technology Co.,Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific language governing permissions
and limitations under the License.
Detail: https://github.com/JeffreySu/WeiXinMPSDK/blob/master/license.md
----------------------------------------------------------------*/
#endregion Apache License Version 2.0
using System.Net;
using System.Text;
namespace Senparc.Weixin.TenPay.V2
{
/// <summary>
/// 生成Native支付方式使用的二维码
/// </summary>
public class QRCode
{
/// <summary>
/// url编码,添加空格转成%20
/// </summary>
/// <param name="con">需要生成二维码的Url</param>
/// <returns></returns>
public static string UrlEncode1(string con)
{
string UrlEncode = "";
#if NET45
UrlEncode = System.Web.HttpUtility.UrlEncode(con, Encoding.UTF8);
#else
UrlEncode = WebUtility.UrlEncode(con);
#endif
UrlEncode = UrlEncode.Replace("+", "%20");
return UrlEncode;
}
//' * google api 二维码生成【QRcode可以存储最多4296个字母数字类型的任意文本,具体可以查看二维码数据格式】
//' * @param string $chl 二维码包含的信息,可以是数字、字符、二进制信息、汉字。不能混合数据类型,数据必须经过UTF-8 URL-encoded.如果需要传递的信息超过2K个字节请使用POST方式
//' * @param int $widhtHeight 生成二维码的尺寸设置
//' * @param string $EC_level 可选纠错级别,QR码支持四个等级纠错,用来恢复丢失的、读错的、模糊的、数据。
//' * L-默认:可以识别已损失的7%的数据
//' * M-可以识别已损失15%的数据
//' * Q-可以识别已损失25%的数据
//' * H-可以识别已损失30%的数据
//' * @param int $margin 生成的二维码离图片边框的距离
public static string QRfromGoogle(string chl)
{
int widhtHeight = 300;
string EC_level = "L";
int margin = 0;
string QRfromGoogle;
chl = UrlEncode1(chl);
QRfromGoogle = "http://chart.apis.google.com/chart?chs=" + widhtHeight + "x" + widhtHeight + "&cht=qr&chld=" + EC_level + "|" + margin + "&chl=" + chl;
return QRfromGoogle;
}
}
}
| jiehanlin/WeiXinMPSDK-src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/V2/QRCode.cs |
Subsets and Splits