text stringlengths 2 1.04M | meta dict |
|---|---|
from django.contrib import admin
from .models import Coach, Participant, Sport, Team, Discipline, Performance
from import_export import resources
from import_export.admin import ImportExportModelAdmin
class ParticipantResource(resources.ModelResource):
"""
Class used for the export of a list of registered participants.
"""
class Meta:
model = Participant
# The fields that are used for the export.
fields = ('first_name', 'prefix', 'last_name', 'date_of_birth', 'gender', 'food_preferences',
'club__name', 'disciplines', 'disciplines__performance',)
class CoachResource(resources.ModelResource):
"""
Class used for the export of a list of registered coaches.
"""
class Meta:
model = Coach
# The fields that are used for the export.
fields = ('club__name', 'first_name', 'prefix', 'last_name', 'gender',
'phone_number', 'email', 'food_preferences', )
class TeamResource(resources.ModelResource):
"""
Class used for the export of teams.
"""
class Meta:
model = Team
# The fields that are used for the export.
fields = ('club__name', 'team_name', 'team_members')
@admin.register(Participant)
class ParticipantAdmin(ImportExportModelAdmin):
list_display = ('first_name', 'prefix', 'last_name', 'club',)
list_filter = ('disciplines', 'club', 'wheelchair_bound',)
resource_class = ParticipantResource
@admin.register(Coach)
class MyCoachAdmin(ImportExportModelAdmin):
list_display = ('first_name', 'last_name', 'email', 'club')
@admin.register(Sport)
class SportAdmin(admin.ModelAdmin):
list_display = ('name',)
@admin.register(Team)
class TeamAdmin(ImportExportModelAdmin):
list_display = ('team_name', 'club',)
@admin.register(Discipline)
class DisciplineAdmin(admin.ModelAdmin):
list_display = ('name_of_discipline', 'eventcode', 'sport',)
@admin.register(Performance)
class PerformanceAdmin(admin.ModelAdmin):
list_display = ('discipline', 'participant', 'qualification',)
| {
"content_hash": "c61e303d4c1f7c68460228ba12831d18",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 101,
"avg_line_length": 30.26086956521739,
"alnum_prop": 0.6719348659003831,
"repo_name": "wearespindle/subscriptionform",
"id": "a3c56da466a851272b732f70e5c7c04f362a22af",
"size": "2088",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "sports/admin.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "4601"
},
{
"name": "HTML",
"bytes": "21346"
},
{
"name": "Python",
"bytes": "41865"
}
],
"symlink_target": ""
} |
package org.fcrepo.server.types.mtom.gen;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="pid" type="{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="dsID" type="{http://www.w3.org/2001/XMLSchema}string"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"pid",
"dsID"
})
@XmlRootElement(name = "getDatastreamHistory")
public class GetDatastreamHistory {
@XmlElement(required = true)
protected String pid;
@XmlElement(required = true)
protected String dsID;
/**
* Gets the value of the pid property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPid() {
return pid;
}
/**
* Sets the value of the pid property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPid(String value) {
this.pid = value;
}
/**
* Gets the value of the dsID property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDsID() {
return dsID;
}
/**
* Sets the value of the dsID property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDsID(String value) {
this.dsID = value;
}
}
| {
"content_hash": "8f1f2f9222ae72a960b517eb4b80dbf7",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 95,
"avg_line_length": 22.25,
"alnum_prop": 0.5798729848558867,
"repo_name": "hbarnard/fcrepo-phaidra",
"id": "0596ea8bd4b452ecf4accd6dc8df16d4a9ab646c",
"size": "2047",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "fcrepo-common/target/generated-sources/cxf/org/fcrepo/server/types/mtom/gen/GetDatastreamHistory.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ActionScript",
"bytes": "4502"
},
{
"name": "CSS",
"bytes": "43333"
},
{
"name": "Eagle",
"bytes": "10702"
},
{
"name": "HTML",
"bytes": "338541"
},
{
"name": "Java",
"bytes": "8724397"
},
{
"name": "JavaScript",
"bytes": "63544"
},
{
"name": "Perl",
"bytes": "5659"
},
{
"name": "Shell",
"bytes": "30339"
},
{
"name": "XSLT",
"bytes": "1794449"
}
],
"symlink_target": ""
} |
package com.qianxuefeng.mountain.domain.model;
/**
* @desc 文章图片
* @author ljt
* @time 2015-8-28 下午4:28:43
*/
public class ArticleImage {
private Integer id;
private String imageUrl;
private Integer articleId;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getImageUrl() {
return imageUrl;
}
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
}
public Integer getArticleId() {
return articleId;
}
public void setArticleId(Integer articleId) {
this.articleId = articleId;
}
}
| {
"content_hash": "e02e32580982b3c71d77cb4a63b92228",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 46,
"avg_line_length": 15.102564102564102,
"alnum_prop": 0.6926994906621392,
"repo_name": "QianXF/mountain-blog",
"id": "b7df7c82611493a06219fc4875e77bcce3330d36",
"size": "601",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/qianxuefeng/mountain/domain/model/ArticleImage.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "50261"
},
{
"name": "HTML",
"bytes": "77281"
},
{
"name": "Java",
"bytes": "338854"
},
{
"name": "JavaScript",
"bytes": "323316"
},
{
"name": "TSQL",
"bytes": "4148"
}
],
"symlink_target": ""
} |
.imported-by-pure {
overflow: hidden auto;
}
| {
"content_hash": "7b53d8a1e90a8251ab74fa57d3906f73",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 24,
"avg_line_length": 15.666666666666666,
"alnum_prop": 0.6808510638297872,
"repo_name": "webpack-contrib/css-loader",
"id": "2f7c8d882eea99ad9c456f271b2cc99bd4d509a6",
"size": "47",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/fixtures/integration/imported-by-pure.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "270001"
},
{
"name": "Shell",
"bytes": "151"
}
],
"symlink_target": ""
} |
package cmd
import (
"fmt"
"os"
"github.com/golang/glog"
homedir "github.com/mitchellh/go-homedir"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
var (
cfgFile string
vmregistryGrpcURL string
vmregistryGrpcCA string
credStoreAddress string
credStoreCA string
)
// RootCmd represents the base command when called without any subcommands
var RootCmd = &cobra.Command{
Use: "vmregistry-cli",
Short: "A brief description of your application",
Long: `A longer description that spans multiple lines and likely contains
examples and usage of using your application. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
// Uncomment the following line if your bare application
// has an action associated with it:
// Run: func(cmd *cobra.Command, args []string) { },
}
// Execute adds all child commands to the root command sets flags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() {
if err := RootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}
func init() {
cobra.OnInitialize(initConfig)
// Here you will define your flags and configuration settings.
// Cobra supports persistent flags, which, if defined here,
// will be global for your application.
RootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.vmregistry-cli.yaml)")
RootCmd.PersistentFlags().StringVar(&vmregistryGrpcURL, "vmregistry-url", "", "remote grpc endpoint for vmregistry")
RootCmd.PersistentFlags().StringVar(&vmregistryGrpcCA, "vmregistry-ca", "", "remote grpc ca for vmregistry verification")
RootCmd.PersistentFlags().StringVar(&credStoreAddress, "credstore-url", "", "remote grpc endpoint for credstore")
RootCmd.PersistentFlags().StringVar(&credStoreCA, "credstore-ca", "", "remote grpc ca for credstore verification")
// Cobra also supports local flags, which will only run
// when this action is called directly.
RootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}
// initConfig reads in config file and ENV variables if set.
func initConfig() {
if cfgFile != "" {
// Use config file from the flag.
viper.SetConfigFile(cfgFile)
} else {
// Find home directory.
home, err := homedir.Dir()
if err != nil {
fmt.Println(err)
os.Exit(1)
}
// Search config in home directory with name ".vmregistry-cli" (without extension).
viper.AddConfigPath(home)
viper.SetConfigName(".vmregistry-cli")
}
viper.AutomaticEnv() // read in environment variables that match
// If a config file is found, read it in.
if err := viper.ReadInConfig(); err == nil {
fmt.Println("Using config file:", viper.ConfigFileUsed())
}
if vmregistryGrpcURL == "" {
glog.Errorf("grpc endpoint for vmregistry isn't specified")
os.Exit(2)
}
if credStoreAddress == "" {
glog.Errorf("grpc endpoint for credstore isn't specified")
os.Exit(2)
}
}
| {
"content_hash": "d55d81fcce9ad0147a663800eeade62f",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 122,
"avg_line_length": 30.35,
"alnum_prop": 0.7252059308072487,
"repo_name": "google/vmregistry",
"id": "b49c6ea6f51d3d56658e83968c2ad1e3d6895890",
"size": "3594",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "cmd/vmregistry-cli/cmd/root.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "53331"
},
{
"name": "Makefile",
"bytes": "1163"
},
{
"name": "Protocol Buffer",
"bytes": "751"
}
],
"symlink_target": ""
} |
/*
* ExOutputRoutineTE.cpp
*
* Created on: 03 февр. 2016 г.
* Author: aleksandr
*/
#include "ExOutputRoutineTE.h"
#include <fstream>
#include <cmath>
void ExOutputRoutineTE::print() {
std::ofstream file;
std::string currentFileName = fileName+"_"+std::to_string(currentTime) + ".txt";
file.open(currentFileName, std::ofstream::trunc);
if (!file.is_open()) {
return;
}
grid->Ex.GPUtoCPU();
float* Ex = grid->Ex.getHostPtr();
int sizeEx = grid->Ex.getSize();
#define Ex(M, N) Ex[(M) * (grid->sizeY) + (N)]
for(int i = 0; i < (sizeX-1)*sizeY; i++) {
int xCoord = firstX+resolutionX*(i/sizeY);
int yCoord = firstY+resolutionY*(i%sizeY);
file << xCoord << " " << yCoord << " " << Ex(xCoord, yCoord) << std::endl;
}
file.close();
}
void ExOutputRoutineTE::compute(int time) {
if (time > startTime && time < endTime) {
if ((time-startTime)%period == 0) {
print();
}
}
currentTime++;
}
| {
"content_hash": "66d4f5621084392a3a8381a236bb4922",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 81,
"avg_line_length": 23.1,
"alnum_prop": 0.6201298701298701,
"repo_name": "AlexHatesUnicorns/FDTD_Solver",
"id": "6a30b3d28eab963aae025d57e55fb995a26cfa0e",
"size": "929",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/Routines/ExOutputRoutineTE.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "2502"
},
{
"name": "C++",
"bytes": "99790"
},
{
"name": "CMake",
"bytes": "694"
},
{
"name": "Cuda",
"bytes": "33387"
},
{
"name": "Smarty",
"bytes": "640"
}
],
"symlink_target": ""
} |
<?php
namespace AppBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class UserType extends AbstractType
{
/**
* @param OptionsResolver $resolver
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'AppBundle\Entity\User'
));
}
}
| {
"content_hash": "d322de48345b85290a01117d32ce5421",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 63,
"avg_line_length": 21.666666666666668,
"alnum_prop": 0.6967032967032967,
"repo_name": "MilesGithub/tor_ibin",
"id": "cf839178a5e9b25909a8b34fd7cc60d5eb19bef3",
"size": "455",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/AppBundle/Form/UserType.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "13841"
},
{
"name": "CSS",
"bytes": "39670"
},
{
"name": "HTML",
"bytes": "259079"
},
{
"name": "JavaScript",
"bytes": "122272"
},
{
"name": "PHP",
"bytes": "300734"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "8412d19ba463aeeb46ddac76e5f79afb",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.307692307692308,
"alnum_prop": 0.6940298507462687,
"repo_name": "mdoering/backbone",
"id": "4f0950cec73f00500e73c2987940fdbf9c3d47a2",
"size": "190",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Bryophyta/Bryopsida/Leucodontales/Neckeraceae/Hydrocryphaea/Hydrocryphaea wardii/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
% y = bwdpr1(Lden, b)
% BWDPR1 Solves "PROD_k L(pk,betak)' * y = b", where
% L(p,beta) = eye(n) + tril(p*beta',-1).
%
% ********** INTERNAL FUNCTION OF SEDUMI **********
%
% See also sedumi, dpr1fact, fwdpr1
function y = bwdpr1(Lden, b)
%
% This file is part of SeDuMi 1.1 by Imre Polik and Oleksandr Romanko
% Copyright (C) 2005 McMaster University, Hamilton, CANADA (since 1.1)
%
% Copyright (C) 2001 Jos F. Sturm (up to 1.05R5)
% Dept. Econometrics & O.R., Tilburg University, the Netherlands.
% Supported by the Netherlands Organization for Scientific Research (NWO).
%
% Affiliation SeDuMi 1.03 and 1.04Beta (2000):
% Dept. Quantitative Economics, Maastricht University, the Netherlands.
%
% Affiliations up to SeDuMi 1.02 (AUG1998):
% CRL, McMaster University, Canada.
% Supported by the Netherlands Organization for Scientific Research (NWO).
%
% 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
%
disp('The SeDuMi binaries are not installed.')
disp('In Matlab, launch "install_sedumi" in the folder you put the SeDuMi files.')
disp('For more information see the file Install.txt.')
error(' ') | {
"content_hash": "cb69691e8826f9a16bde0d47405b98f7",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 82,
"avg_line_length": 42.65909090909091,
"alnum_prop": 0.6846030900372936,
"repo_name": "wgchoi/indoorunderstanding_3dgp",
"id": "4c55508edd0f3a6a99c0525234261ea281a7e2e0",
"size": "1877",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "3rdParty/mpt/solvers/SeDuMi_1_3/bwdpr1.m",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "1182011"
},
{
"name": "C++",
"bytes": "247196"
},
{
"name": "Erlang",
"bytes": "3992"
},
{
"name": "Java",
"bytes": "97728"
},
{
"name": "JavaScript",
"bytes": "10998"
},
{
"name": "M",
"bytes": "565298"
},
{
"name": "Matlab",
"bytes": "9153843"
},
{
"name": "Objective-C",
"bytes": "202515"
},
{
"name": "Perl",
"bytes": "52578"
},
{
"name": "Python",
"bytes": "36752"
},
{
"name": "Shell",
"bytes": "2466"
}
],
"symlink_target": ""
} |
package runtime
var Fadd64 = fadd64
var Fsub64 = fsub64
var Fmul64 = fmul64
var Fdiv64 = fdiv64
var F64to32 = f64to32
var F32to64 = f32to64
var Fcmp64 = fcmp64
var Fintto64 = fintto64
var F64toint = f64toint
func entersyscall()
func exitsyscall()
var Entersyscall = entersyscall
var Exitsyscall = exitsyscall
| {
"content_hash": "0af335822dc43fbedb909f953132ca4a",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 31,
"avg_line_length": 18.352941176470587,
"alnum_prop": 0.782051282051282,
"repo_name": "eternalNight/ucore_app_go",
"id": "53c5fcba4734320e5b971e732e42fae335c7a10f",
"size": "502",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/pkg/runtime/export_test.go",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "208288"
},
{
"name": "C",
"bytes": "3721363"
},
{
"name": "C++",
"bytes": "30701"
},
{
"name": "Emacs Lisp",
"bytes": "21395"
},
{
"name": "Go",
"bytes": "11941120"
},
{
"name": "JavaScript",
"bytes": "84730"
},
{
"name": "Objective-C",
"bytes": "24013"
},
{
"name": "OpenEdge ABL",
"bytes": "9784"
},
{
"name": "Perl",
"bytes": "176639"
},
{
"name": "Python",
"bytes": "154470"
},
{
"name": "Scala",
"bytes": "215"
},
{
"name": "Shell",
"bytes": "55271"
},
{
"name": "VimL",
"bytes": "21069"
}
],
"symlink_target": ""
} |
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.fields import GenericForeignKey
class DirtyInstance(models.Model):
"""
Holds a reference to a model instance that may contain inconsistent data
that needs to be recalculated.
DirtyInstance instances are created by the insert/update/delete triggers
when related objects change.
"""
class Meta:
app_label="denorm"
content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
object_id = models.TextField(blank=True, null=True)
content_object = GenericForeignKey()
def __str__(self):
return u'DirtyInstance: %s,%s' % (self.content_type, self.object_id)
def __unicode__(self):
return u'DirtyInstance: %s, %s' % (self.content_type, self.object_id)
| {
"content_hash": "7c82c0c93480192188b64429746a4396",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 77,
"avg_line_length": 35.5,
"alnum_prop": 0.715962441314554,
"repo_name": "initcrash/django-denorm",
"id": "a2f50dd8c41e7d712f4f2e83cee21b90cf0767ce",
"size": "876",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "denorm/models.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Python",
"bytes": "160270"
}
],
"symlink_target": ""
} |
<!--
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See License.txt in the project root for
license information.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-parent</artifactId>
<version>1.3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>azure-mgmt-servicebus</artifactId>
<packaging>jar</packaging>
<name>Microsoft Azure SDK for Service Bus Management</name>
<description>This package contains Microsoft Azure Service Bus Management SDK.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>
<licenses>
<license>
<name>The MIT License (MIT)</name>
<url>http://opensource.org/licenses/MIT</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>scm:git:https://github.com/Azure/azure-sdk-for-java</url>
<connection>scm:git:git@github.com:Azure/azure-sdk-for-java.git</connection>
<tag>HEAD</tag>
</scm>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<legal><![CDATA[[INFO] Any downloads listed may be third party software. Microsoft grants you no rights for third party software.]]></legal>
</properties>
<developers>
<developer>
<id>microsoft</id>
<name>Microsoft</name>
</developer>
</developers>
<dependencies>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-client-runtime</artifactId>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-mgmt-resources</artifactId>
<version>1.3.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-client-authentication</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-mgmt-resources</artifactId>
<version>1.3.1-SNAPSHOT</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<annotationProcessors>
<annotationProcessor>
com.microsoft.azure.management.apigeneration.LangDefinitionProcessor</annotationProcessor>
</annotationProcessors>
<debug>true</debug>
<optimize>true</optimize>
<compilerArguments>
<AaddGeneratedAnnotation>true</AaddGeneratedAnnotation>
<Adebug>true</Adebug>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8</version>
<configuration>
<excludePackageNames>*.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search</excludePackageNames>
<bottom><![CDATA[<code></code>]]></bottom>
</configuration>
</plugin>
</plugins>
</build>
</project>
| {
"content_hash": "bcd2c374699f7ada5487cf276269d5b5",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 204,
"avg_line_length": 33.160583941605836,
"alnum_prop": 0.648910411622276,
"repo_name": "martinsawicki/azure-sdk-for-java",
"id": "5ac09d714a70e53d9d5cc1858d20e86bdaca0a34",
"size": "4730",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "azure-mgmt-servicebus/pom.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "31090060"
},
{
"name": "JavaScript",
"bytes": "7170"
},
{
"name": "PowerShell",
"bytes": "160"
},
{
"name": "Shell",
"bytes": "609"
}
],
"symlink_target": ""
} |
module AlleApi
class AuctionEvent
class Update < AuctionEvent
def alter_auction_state
auction.touch
end
end
end
end
| {
"content_hash": "61f9cfb890e2c04b3171c902f41fb8d2",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 31,
"avg_line_length": 16.444444444444443,
"alnum_prop": 0.6554054054054054,
"repo_name": "jumski/alle_api",
"id": "70e56e68185072430e993f88fb78ea074994eb4f",
"size": "149",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/models/alle_api/auction_event/update.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1092"
},
{
"name": "HTML",
"bytes": "110032"
},
{
"name": "JavaScript",
"bytes": "1282"
},
{
"name": "Ruby",
"bytes": "311104"
},
{
"name": "Shell",
"bytes": "205"
}
],
"symlink_target": ""
} |
Pattern: Malformed qouted symbol
Issue: -
## Description
Checks if the quotes used for quoted symbols match the configured defaults. By default uses the same configuration as `Style/StringLiterals`.
String interpolation is always kept in double quotes.
## Examples
EnforcedStyle: same_as_string_literals (default) / single_quotes
```ruby
# bad
:"abc-def"
# good
:'abc-def'
:"#{str}"
:"a\'b"
```
EnforcedStyle: double_quotes
```ruby
# bad
:'abc-def'
# good
:"abc-def"
:"#{str}"
:"a\'b"
```
## Further Reading
* [RuboCop - Style/QuotedSymbols](https://docs.rubocop.org/rubocop/cops_style.html#stylequotedsymbols) | {
"content_hash": "ec9e92c816e2051c87b23b16a77e6727",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 141,
"avg_line_length": 16.94871794871795,
"alnum_prop": 0.670196671709531,
"repo_name": "Adroiti/docs-for-code-review-tools",
"id": "c4407e672875aa88fc4547e6a5b20054e6a6d63f",
"size": "661",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "RuboCop/Style-QuotedSymbols.md",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
<#
.Synopsis
Gets all collected items in a user's collection.
.DESCRIPTION
Gets all collected items in a user's collection.
.EXAMPLE
PS C:\> Get-TraktCollection -Type movies
Description
-----------
This example shows how to get all collected movies from your Trakt.TV collection.
.EXAMPLE
PS C:\> Get-TraktCollection -Type shows
Description
-----------
This example shows how to get all collected shows from your Trakt.TV collection.
.INPUTS
None
.OUTPUTS
PSCustomObject
.NOTES
None
.COMPONENT
None
.ROLE
None
.FUNCTIONALITY
The functionality that best describes this cmdlet
#>
function Remove-TraktRating
{
[CmdletBinding(DefaultParameterSetName='ASinglePerson')]
[OutputType([PSCustomObject])]
Param
(
# InputObject help description
[Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)]
[Object]
$InputObject
)
begin {
$uri = 'sync/ratings/remove'
$postData = @{
movies = @()
shows = @()
episodes = @()
}
}
process
{
# LINK: http://docs.trakt.apiary.io/#reference/sync/add-to-collection/add-items-to-collection
if ($InputObject.PSObject.TypeNames -contains 'Trakt.Movie') {
$newInputObject = $InputObject | ConvertFrom-TraktMovie
$postData.movies += $newInputObject
} elseif ($InputObject.PSObject.TypeNames -contains 'Trakt.Show') {
$newInputObject = $InputObject | ConvertFrom-TraktShow
$newInputObject.Remove('seasons')
$postData.shows += $newInputObject
} elseif ($InputObject.PSObject.TypeNames -contains 'Trakt.Episode') {
$newInputObject = $InputObject | ConvertFrom-TraktEpisode
$postData.episodes += $newInputObject
} elseif ($InputObject.PSObject.TypeNames -contains 'Trakt.Ratings') {
switch ($InputObject.Type) {
movie {
$newInputObject = $InputObject.Movie | ConvertFrom-TraktMovie
$postData.movies += $newInputObject
}
show {
$newInputObject = $InputObject.Show | ConvertFrom-TraktShow
$newInputObject.Remove('seasons')
$postData.shows += $newInputObject
}
episode {
$newInputObject = $InputObject.Episode | ConvertFrom-TraktEpisode
$postData.episodes += $newInputObject
}
}
} else {
throw 'Unknown object type passed to the cmdlet.'
}
}
end {
Invoke-Trakt -Uri $uri -Method ([Microsoft.PowerShell.Commands.WebRequestMethod]::Post) -PostData $postData |
ForEach-Object {
$_
}
}
} | {
"content_hash": "a71e116e582968d15c5bfb28605fc333",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 117,
"avg_line_length": 30.25,
"alnum_prop": 0.5878099173553719,
"repo_name": "juniinacio/Trakt-PowerShell",
"id": "92e4059e09552bc023fa6e169d11a776ad30da53",
"size": "2904",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Trakt-PowerShell/Public/Remove-TraktRating.ps1",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PowerShell",
"bytes": "360997"
}
],
"symlink_target": ""
} |
@import redeclarations_left;
@import weird_objc;
int test(id x) {
return x->wibble;
}
// RUN: rm -rf %t
// RUN: %clang_cc1 -fmodules -x objective-c -fmodules-cache-path=%t -emit-module -fmodule-name=redeclarations_left %S/Inputs/module.map
// RUN: %clang_cc1 -fmodules -x objective-c -fmodules-cache-path=%t -emit-module -fmodule-name=weird_objc %S/Inputs/module.map
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I %S/Inputs %s -verify
// expected-no-diagnostics
| {
"content_hash": "16bb7da84a9e1fc530d48045a4721500",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 135,
"avg_line_length": 36.61538461538461,
"alnum_prop": 0.7142857142857143,
"repo_name": "HackLinux/goblin-core",
"id": "28e47665f24f5fa46c9b6b0b9eb4a4276735f9c2",
"size": "476",
"binary": false,
"copies": "14",
"ref": "refs/heads/master",
"path": "riscv/llvm/3.5/cfe-3.5.0.src/test/Modules/objc_redef.m",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "AppleScript",
"bytes": "1429"
},
{
"name": "Assembly",
"bytes": "37233636"
},
{
"name": "Awk",
"bytes": "1296"
},
{
"name": "Batchfile",
"bytes": "31924"
},
{
"name": "C",
"bytes": "121284973"
},
{
"name": "C#",
"bytes": "12418"
},
{
"name": "C++",
"bytes": "125922408"
},
{
"name": "CMake",
"bytes": "710908"
},
{
"name": "CSS",
"bytes": "43924"
},
{
"name": "Common Lisp",
"bytes": "65656"
},
{
"name": "Cuda",
"bytes": "12393"
},
{
"name": "D",
"bytes": "16218707"
},
{
"name": "DIGITAL Command Language",
"bytes": "53633"
},
{
"name": "DTrace",
"bytes": "8175207"
},
{
"name": "E",
"bytes": "3290"
},
{
"name": "Eiffel",
"bytes": "2314"
},
{
"name": "Elixir",
"bytes": "314"
},
{
"name": "Emacs Lisp",
"bytes": "41146"
},
{
"name": "FORTRAN",
"bytes": "377751"
},
{
"name": "Forth",
"bytes": "4188"
},
{
"name": "GAP",
"bytes": "21991"
},
{
"name": "GDScript",
"bytes": "54941"
},
{
"name": "Gnuplot",
"bytes": "446"
},
{
"name": "Groff",
"bytes": "1976484"
},
{
"name": "HTML",
"bytes": "1119644"
},
{
"name": "JavaScript",
"bytes": "24233"
},
{
"name": "LLVM",
"bytes": "48362057"
},
{
"name": "Lex",
"bytes": "596732"
},
{
"name": "Limbo",
"bytes": "755"
},
{
"name": "M",
"bytes": "1797"
},
{
"name": "Makefile",
"bytes": "12715642"
},
{
"name": "Mathematica",
"bytes": "5497"
},
{
"name": "Matlab",
"bytes": "54444"
},
{
"name": "Mercury",
"bytes": "1222"
},
{
"name": "OCaml",
"bytes": "748821"
},
{
"name": "Objective-C",
"bytes": "4995355"
},
{
"name": "Objective-C++",
"bytes": "1419213"
},
{
"name": "Perl",
"bytes": "880961"
},
{
"name": "Perl6",
"bytes": "80742"
},
{
"name": "PicoLisp",
"bytes": "31994"
},
{
"name": "Pure Data",
"bytes": "22171"
},
{
"name": "Python",
"bytes": "1375992"
},
{
"name": "R",
"bytes": "627855"
},
{
"name": "Rebol",
"bytes": "51929"
},
{
"name": "Scheme",
"bytes": "4296232"
},
{
"name": "Shell",
"bytes": "1994645"
},
{
"name": "SourcePawn",
"bytes": "4564"
},
{
"name": "Standard ML",
"bytes": "5682"
},
{
"name": "SuperCollider",
"bytes": "734239"
},
{
"name": "Tcl",
"bytes": "2234"
},
{
"name": "TeX",
"bytes": "601780"
},
{
"name": "VimL",
"bytes": "26411"
},
{
"name": "Yacc",
"bytes": "769886"
}
],
"symlink_target": ""
} |
The cost of the pod infrastructure is highly coupled with the
Mach number at which the vehicle travels. In order to obey the choking constraint,
higher Mach numbers will necessitate a larger tube to prevent the flow around
the pod from accelerating to the speed of sound. This increases the material
cost of the tube and the energy required to pump down the tube. In this analysis,
the full system model will be run for a range of Mach numbers.
For each Mach number, the area of the tube is recorded along with the total energy cost.
In this analysis, the leakage rate is assumed to be a constant mass flow on the order 1 kg/s.
This value should be sufficient for illustrating the trend of energy
consumption as a function of Mach number. Different values of leakage rate will
not significantly alter the trend, but will instead directly scale the amount
of energy used by the vacuum system in a steady state condition.
\begin{figure}
\centering
\includegraphics{../../images/graphs/mach_trades/pressure_vs_mach.png}
\caption{Tube Area and Yearly Energy Cost vs. Mach Number}
\label{fig:tube_area_cost_vs_mach}
\end{figure}
\Cref{fig:tube_area_cost_vs_mach} indicates how the tube area and energy
consumption change over a range of Mach numbers. As is indicated in previous research,
tube area begins to increase rapidly around Mach 0.8 \cite{Chin}.
Beyond this Mach number, small increases in Mach number result in a large
increase in tube area, which will have a large impact on capital cost and energy
consumption during pump down. Conversely, \cref{fig:tube_area_cost_vs_mach}
indicates that tube area, and therfore material cost,
grows slowly with Mach number for Mach numbers below .8.
Based on these results, it is estimated that any
system level optimization of cost with respect to Mach number will likely result in a
Mach number near 0.8. For this reason, a Mach number of 0.8 will be used in
subsequent analyses to obtain reasonable evaluations of design trades and system behavior.
| {
"content_hash": "3c0719d847759483e0bf188c8c46a864",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 93,
"avg_line_length": 66.66666666666667,
"alnum_prop": 0.797,
"repo_name": "andipeng/MagnePlane",
"id": "816684a028c5610d60ef8858e23b7ca947549586",
"size": "2000",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "paper/sections/results/mach_number_trade.tex",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Arduino",
"bytes": "983"
},
{
"name": "Glyph",
"bytes": "16005"
},
{
"name": "Processing",
"bytes": "8275"
},
{
"name": "Python",
"bytes": "558002"
},
{
"name": "Shell",
"bytes": "1886"
},
{
"name": "TeX",
"bytes": "212439"
}
],
"symlink_target": ""
} |
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_loop_64b.c
Label Definition File: CWE121_Stack_Based_Buffer_Overflow__CWE806.label.xml
Template File: sources-sink-64b.tmpl.c
*/
/*
* @description
* CWE: 121 Stack Based Buffer Overflow
* BadSource: Initialize data as a large string
* GoodSource: Initialize data as a small string
* Sinks: loop
* BadSink : Copy data to string using a loop
* Flow Variant: 64 Data flow: void pointer to data passed from one function to another in different source files
*
* */
#include "std_testcase.h"
#include <wchar.h>
#ifndef OMITBAD
void CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_loop_64b_badSink(void * dataVoidPtr)
{
/* cast void pointer to a pointer of the appropriate type */
char * * dataPtr = (char * *)dataVoidPtr;
/* dereference dataPtr into data */
char * data = (*dataPtr);
{
char dest[50] = "";
size_t i, dataLen;
dataLen = strlen(data);
/* POTENTIAL FLAW: Possible buffer overflow if data is larger than dest */
for (i = 0; i < dataLen; i++)
{
dest[i] = data[i];
}
dest[50-1] = '\0'; /* Ensure the destination buffer is null terminated */
printLine(data);
}
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B uses the GoodSource with the BadSink */
void CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_loop_64b_goodG2BSink(void * dataVoidPtr)
{
/* cast void pointer to a pointer of the appropriate type */
char * * dataPtr = (char * *)dataVoidPtr;
/* dereference dataPtr into data */
char * data = (*dataPtr);
{
char dest[50] = "";
size_t i, dataLen;
dataLen = strlen(data);
/* POTENTIAL FLAW: Possible buffer overflow if data is larger than dest */
for (i = 0; i < dataLen; i++)
{
dest[i] = data[i];
}
dest[50-1] = '\0'; /* Ensure the destination buffer is null terminated */
printLine(data);
}
}
#endif /* OMITGOOD */
| {
"content_hash": "407ceb111397062597d4a7f6973840f9",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 113,
"avg_line_length": 31.602941176470587,
"alnum_prop": 0.6105165193113076,
"repo_name": "JianpingZeng/xcc",
"id": "785963f3c42c3a6850e4c91fe86d3e6969fba545",
"size": "2149",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "xcc/test/juliet/testcases/CWE121_Stack_Based_Buffer_Overflow/s06/CWE121_Stack_Based_Buffer_Overflow__CWE806_char_declare_loop_64b.c",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "bc7aed868836d2329d674a0496a12e26",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.307692307692308,
"alnum_prop": 0.6940298507462687,
"repo_name": "mdoering/backbone",
"id": "80e28c224bbbfc872be36737b4034332c2771c9c",
"size": "210",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Pteridophyta/Polypodiopsida/Polypodiales/Dennstaedtiaceae/Lindsaea/Lindsaea quadrangularis/Lindsaea quadrangularis antillensis/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
//
// JLScrollView.h
// JLPhotoBrowser
//
// Created by liao on 15/12/24.
// Copyright © 2015年 BangGu. All rights reserved.
// 展示放大图片的滑动视图
#import <UIKit/UIKit.h>
#import "JLPhoto.h"
#import "StorePhotoModel.h"
@interface JLPhotoBrowser : UIView
@property (nonatomic,copy)void (^showBlock)();
/**
* 存放图片的数组
*/
@property (nonatomic,strong) NSArray *photos;
/**
* 当前的index
*/
@property (nonatomic,assign) int currentIndex;
/**
* 存放所有的数据
*/
@property(nonatomic,strong)NSMutableArray*allDatasModel;
/**
* 显示图片浏览器
*/
-(void)show;
//两个回调 用来删除照片和修改照片名字的
@property(nonatomic,strong)void(^changeNameBlock)(NSInteger selectedNumber,NSString*title);
@property(nonatomic,strong)void(^deletePhotoBlock)(NSInteger selectedNumber);
@end
| {
"content_hash": "7a6169e593c2fe80ffb9b1203779efe9",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 91,
"avg_line_length": 17.80952380952381,
"alnum_prop": 0.7192513368983957,
"repo_name": "daidi-double/new_yuWaShop",
"id": "31168c6c140ba42ca98f2ccf375fac252f2c7e0e",
"size": "857",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "YuWaShop/Fundation/Custom Category/category/photoBrowser/JLPhotoBrowser.h",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "13345"
},
{
"name": "Objective-C",
"bytes": "3705114"
},
{
"name": "Ruby",
"bytes": "1934"
}
],
"symlink_target": ""
} |
from distutils.core import setup
setup(
name='SQLiteMaker',
author='calebhailey',
url='https://github.com/calebhailey/sqlitemaker',
packages=['main'],
py_modules=['sqlitemaker'],
data_files=[('', ['settings.json',]),],
requires=['SQLAlchemy'],
)
| {
"content_hash": "fc020d5ade49884d0620c4048d0cea90",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 55,
"avg_line_length": 26.818181818181817,
"alnum_prop": 0.5932203389830508,
"repo_name": "calebhailey/sqlitemaker",
"id": "adb67d4816dd209f48fbf2c66f304a0d648db58a",
"size": "318",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "setup.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "24480"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using DotVVM.CommandLine.Metadata;
namespace DotVVM.CommandLine.Commands
{
public abstract class CommandBase
{
public abstract string Name { get; }
public abstract string Usage { get; }
public abstract bool CanHandle(Arguments args, DotvvmProjectMetadata dotvvmProjectMetadata);
public abstract void Handle(Arguments args, DotvvmProjectMetadata dotvvmProjectMetadata);
protected string[] ExpandFileNames(string name)
{
// TODO: add wildcard support
return new[] { Path.GetFullPath(name) };
}
}
}
| {
"content_hash": "87cde9de755c199d98ca97423984b255",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 100,
"avg_line_length": 24.79310344827586,
"alnum_prop": 0.6856745479833102,
"repo_name": "kiraacorsac/dotvvm",
"id": "700bc055017a7b47df43b709b936071d98b2362f",
"size": "721",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/DotVVM.CommandLine/Commands/CommandBase.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "3088"
},
{
"name": "C#",
"bytes": "2212903"
},
{
"name": "CSS",
"bytes": "944"
},
{
"name": "JavaScript",
"bytes": "778699"
},
{
"name": "PowerShell",
"bytes": "3588"
},
{
"name": "TypeScript",
"bytes": "102108"
}
],
"symlink_target": ""
} |
__all__ = ["bls_fast", "bls_slow"]
from functools import partial
import numpy as np
from ._impl import bls_impl
def bls_slow(t, y, ivar, period, duration, oversample, use_likelihood):
"""Compute the periodogram using a brute force reference method
t : array-like
Sequence of observation times.
y : array-like
Sequence of observations associated with times t.
ivar : array-like
The inverse variance of ``y``.
period : array-like
The trial periods where the periodogram should be computed.
duration : array-like
The durations that should be tested.
oversample :
The resolution of the phase grid in units of durations.
use_likeliood : bool
If true, maximize the log likelihood over phase, duration, and depth.
Returns
-------
power : array-like
The periodogram evaluated at the periods in ``period``.
depth : array-like
The estimated depth of the maximum power model at each period.
depth_err : array-like
The 1-sigma uncertainty on ``depth``.
duration : array-like
The maximum power duration at each period.
transit_time : array-like
The maximum power phase of the transit in units of time. This
indicates the mid-transit time and it will always be in the range
(0, period).
depth_snr : array-like
The signal-to-noise with which the depth is measured at maximum power.
log_likelihood : array-like
The log likelihood of the maximum power model.
"""
f = partial(_bls_slow_one, t, y, ivar, duration, oversample, use_likelihood)
return _apply(f, period)
def bls_fast(t, y, ivar, period, duration, oversample, use_likelihood):
"""Compute the periodogram using an optimized Cython implementation
t : array-like
Sequence of observation times.
y : array-like
Sequence of observations associated with times t.
ivar : array-like
The inverse variance of ``y``.
period : array-like
The trial periods where the periodogram should be computed.
duration : array-like
The durations that should be tested.
oversample :
The resolution of the phase grid in units of durations.
use_likeliood : bool
If true, maximize the log likelihood over phase, duration, and depth.
Returns
-------
power : array-like
The periodogram evaluated at the periods in ``period``.
depth : array-like
The estimated depth of the maximum power model at each period.
depth_err : array-like
The 1-sigma uncertainty on ``depth``.
duration : array-like
The maximum power duration at each period.
transit_time : array-like
The maximum power phase of the transit in units of time. This
indicates the mid-transit time and it will always be in the range
(0, period).
depth_snr : array-like
The signal-to-noise with which the depth is measured at maximum power.
log_likelihood : array-like
The log likelihood of the maximum power model.
"""
return bls_impl(t, y, ivar, period, duration, oversample, use_likelihood)
def _bls_slow_one(t, y, ivar, duration, oversample, use_likelihood, period):
"""A private function to compute the brute force periodogram result"""
best = (-np.inf, None)
hp = 0.5 * period
min_t = np.min(t)
for dur in duration:
# Compute the phase grid (this is set by the duration and oversample).
d_phase = dur / oversample
phase = np.arange(0, period + d_phase, d_phase)
for t0 in phase:
# Figure out which data points are in and out of transit.
m_in = np.abs((t - min_t - t0 + hp) % period - hp) < 0.5 * dur
m_out = ~m_in
# Compute the estimates of the in and out-of-transit flux.
ivar_in = np.sum(ivar[m_in])
ivar_out = np.sum(ivar[m_out])
y_in = np.sum(y[m_in] * ivar[m_in]) / ivar_in
y_out = np.sum(y[m_out] * ivar[m_out]) / ivar_out
# Use this to compute the best fit depth and uncertainty.
depth = y_out - y_in
depth_err = np.sqrt(1.0 / ivar_in + 1.0 / ivar_out)
snr = depth / depth_err
# Compute the log likelihood of this model.
loglike = -0.5 * np.sum((y_in - y[m_in]) ** 2 * ivar[m_in])
loglike += 0.5 * np.sum((y_out - y[m_in]) ** 2 * ivar[m_in])
# Choose which objective should be used for the optimization.
if use_likelihood:
objective = loglike
else:
objective = snr
# If this model is better than any before, keep it.
if depth > 0 and objective > best[0]:
best = (
objective,
(
objective,
depth,
depth_err,
dur,
(t0 + min_t) % period,
snr,
loglike,
),
)
return best[1]
def _apply(f, period):
return tuple(map(np.array, zip(*map(f, period))))
| {
"content_hash": "8a02a9aaf773164a07c0bbc735ee9728",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 80,
"avg_line_length": 35.45945945945946,
"alnum_prop": 0.5889862804878049,
"repo_name": "pllim/astropy",
"id": "9686999e735be406b58390b159451c896d250bd0",
"size": "5313",
"binary": false,
"copies": "3",
"ref": "refs/heads/placeholder",
"path": "astropy/timeseries/periodograms/bls/methods.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "11040101"
},
{
"name": "C++",
"bytes": "47001"
},
{
"name": "Cython",
"bytes": "78776"
},
{
"name": "HTML",
"bytes": "1172"
},
{
"name": "Lex",
"bytes": "183333"
},
{
"name": "M4",
"bytes": "18757"
},
{
"name": "Makefile",
"bytes": "52508"
},
{
"name": "Python",
"bytes": "12404182"
},
{
"name": "Shell",
"bytes": "17024"
},
{
"name": "TeX",
"bytes": "853"
}
],
"symlink_target": ""
} |
/**
* Copyright (c) 2009 Carnegie Mellon University.
* 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.
*
* For more about this software visit:
*
* http://www.graphlab.ml.cmu.edu
*
*/
#ifndef GRAPHLAB_FLOAT_SELECTOR_HPP
#define GRAPHLAB_FLOAT_SELECTOR_HPP
namespace graphlab {
template <int len>
struct float_selector {
// invalid
};
template <>
struct float_selector<4> {
typedef float float_type;
};
template <>
struct float_selector<8> {
typedef double float_type;
};
template <>
struct float_selector<16> {
typedef long double float_type;
};
}
#endif
| {
"content_hash": "159630cd37c5e6281c5cebd97b91a49f",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 68,
"avg_line_length": 21.64814814814815,
"alnum_prop": 0.6834901625320787,
"repo_name": "ylow/SFrame",
"id": "1072dc4c37c1da9cb2ba347a662fbc15a8e56c0d",
"size": "1352",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "oss_src/graphlab/util/generics/float_selector.hpp",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "142132"
},
{
"name": "C++",
"bytes": "11675146"
},
{
"name": "CMake",
"bytes": "104941"
},
{
"name": "CSS",
"bytes": "127000"
},
{
"name": "HTML",
"bytes": "24407"
},
{
"name": "Hack",
"bytes": "277"
},
{
"name": "JavaScript",
"bytes": "20909"
},
{
"name": "Makefile",
"bytes": "9614"
},
{
"name": "Perl",
"bytes": "9663"
},
{
"name": "Python",
"bytes": "2225333"
},
{
"name": "R",
"bytes": "537"
},
{
"name": "Scala",
"bytes": "5232"
},
{
"name": "Shell",
"bytes": "53145"
},
{
"name": "Smarty",
"bytes": "966"
},
{
"name": "XSLT",
"bytes": "74068"
}
],
"symlink_target": ""
} |
@interface TYTomightyTests : XCTestCase
@end
@implementation TYTomightyTests
{
__strong id <TYTomighty> tomighty;
__strong id <TYTimer> timer;
__strong id <TYPreferences> preferences;
__strong TYMockEventBus *eventBus;
__strong MKTArgumentCaptor *timerContextArgument;
}
- (void)setUp
{
[super setUp];
timer = mockProtocol(@protocol(TYTimer));
preferences = mockProtocol(@protocol(TYPreferences));
eventBus = [[TYMockEventBus alloc] init];
tomighty = [[TYDefaultTomighty alloc] initWith:timer preferences:preferences eventBus:eventBus];
timerContextArgument = [[MKTArgumentCaptor alloc] init];
[given([preferences getInt:PREF_TIME_POMODORO]) willReturnInt:25];
[given([preferences getInt:PREF_TIME_LONG_BREAK]) willReturnInt:15];
[given([preferences getInt:PREF_TIME_SHORT_BREAK]) willReturnInt:5];
}
- (void)assertTimerContext:(id <TYTimerContext>)timerContext isOfType:(TYTimerContextType)type hasName:(NSString*)name hasRemainingSeconds:(int)remainingSeconds
{
assertThat([timerContext getName], equalTo(name));
assertThatInt([timerContext getContextType], equalToInt(type));
assertThatInt([timerContext getRemainingSeconds], equalToInt(remainingSeconds));
}
- (void)test_start_timer_in_pomodoro_context_when_starting_a_pomodoro
{
[tomighty startPomodoro];
[verify(timer) start:[timerContextArgument capture]];
[self assertTimerContext:[timerContextArgument value]
isOfType:POMODORO
hasName:@"Pomodoro"
hasRemainingSeconds:25 * 60];
}
- (void)test_start_timer_in_short_break_context_when_starting_a_short_break
{
[tomighty startShortBreak];
[verify(timer) start:[timerContextArgument capture]];
[self assertTimerContext:[timerContextArgument value]
isOfType:SHORT_BREAK
hasName:@"Short break"
hasRemainingSeconds:5 * 60];
}
- (void)test_start_timer_in_long_break_context_when_starting_a_long_break
{
[tomighty startLongBreak];
[verify(timer) start:[timerContextArgument capture]];
[self assertTimerContext:[timerContextArgument value]
isOfType:LONG_BREAK
hasName:@"Long break"
hasRemainingSeconds:15 * 60];
}
- (void)test_stop_timer
{
[tomighty stopTimer];
[(id<TYTimer>) verify(timer) stop];
}
- (void)test_publish_POMODORO_COUNT_CHANGE_each_time_when_a_POMODORO_COMPLETE_event_is_published
{
NSNumber *expectedPomodoroCount;
id <TYTimerContext> timerContext = mockProtocol(@protocol(TYTimerContext));
[eventBus publish:POMODORO_COMPLETE data:timerContext];
expectedPomodoroCount = [NSNumber numberWithInt:1];
XCTAssertEqual([eventBus getPublishedEventCount], (NSUInteger)2);
XCTAssertTrue([eventBus hasPublishedEvent:POMODORO_COMPLETE withData:timerContext atPosition:1]);
XCTAssertTrue([eventBus hasPublishedEvent:POMODORO_COUNT_CHANGE withData:expectedPomodoroCount atPosition:2]);
[eventBus clearPublishedEvents];
[eventBus publish:POMODORO_COMPLETE data:timerContext];
expectedPomodoroCount = [NSNumber numberWithInt:2];
XCTAssertEqual([eventBus getPublishedEventCount], (NSUInteger)2);
XCTAssertTrue([eventBus hasPublishedEvent:POMODORO_COMPLETE withData:timerContext atPosition:1]);
XCTAssertTrue([eventBus hasPublishedEvent:POMODORO_COUNT_CHANGE withData:expectedPomodoroCount atPosition:2]);
[eventBus clearPublishedEvents];
[eventBus publish:POMODORO_COMPLETE data:timerContext];
expectedPomodoroCount = [NSNumber numberWithInt:3];
XCTAssertEqual([eventBus getPublishedEventCount], (NSUInteger)2);
XCTAssertTrue([eventBus hasPublishedEvent:POMODORO_COMPLETE withData:timerContext atPosition:1]);
XCTAssertTrue([eventBus hasPublishedEvent:POMODORO_COUNT_CHANGE withData:expectedPomodoroCount atPosition:2]);
}
- (void)test_set_pomodoro_count_back_to_one_when_a_pomodoro_completes_after_four_completed_pomodoros
{
id <TYTimerContext> timerContext = mockProtocol(@protocol(TYTimerContext));
[eventBus publish:POMODORO_COMPLETE data:timerContext];
[eventBus publish:POMODORO_COMPLETE data:timerContext];
[eventBus publish:POMODORO_COMPLETE data:timerContext];
[eventBus publish:POMODORO_COMPLETE data:timerContext];
[eventBus clearPublishedEvents];
[eventBus publish:POMODORO_COMPLETE data:timerContext];
NSNumber *expectedPomodoroCount = [NSNumber numberWithInt:1];
XCTAssertEqual([eventBus getPublishedEventCount], (NSUInteger)2);
XCTAssertTrue([eventBus hasPublishedEvent:POMODORO_COMPLETE withData:timerContext atPosition:1]);
XCTAssertTrue([eventBus hasPublishedEvent:POMODORO_COUNT_CHANGE withData:expectedPomodoroCount atPosition:2]);
}
- (void)test_reset_pomodoro_count
{
[tomighty resetPomodoroCount];
NSNumber *expectedPomodoroCount = [NSNumber numberWithInt:0];
XCTAssertEqual([eventBus getPublishedEventCount], (NSUInteger)1);
XCTAssertTrue([eventBus hasPublishedEvent:POMODORO_COUNT_CHANGE withData:expectedPomodoroCount atPosition:1]);
}
- (void)test_pomodoro_count_after_the_count_is_reset
{
id <TYTimerContext> timerContext = mockProtocol(@protocol(TYTimerContext));
[eventBus publish:POMODORO_COMPLETE data:timerContext];
[eventBus publish:POMODORO_COMPLETE data:timerContext];
[tomighty resetPomodoroCount];
[eventBus clearPublishedEvents];
[eventBus publish:POMODORO_COMPLETE data:timerContext];
NSNumber *expectedPomodoroCount = [NSNumber numberWithInt:1];
XCTAssertEqual([eventBus getPublishedEventCount], (NSUInteger)2);
XCTAssertTrue([eventBus hasPublishedEvent:POMODORO_COMPLETE withData:timerContext atPosition:1]);
XCTAssertTrue([eventBus hasPublishedEvent:POMODORO_COUNT_CHANGE withData:expectedPomodoroCount atPosition:2]);
}
@end
| {
"content_hash": "58c263704bb063ce0a76f0ae5c79a729",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 160,
"avg_line_length": 38.74025974025974,
"alnum_prop": 0.7391887361716393,
"repo_name": "eduardonunesp/tomighty-osx",
"id": "adb15d54b45739bb8f9e71c5dd4f6dcab060e41c",
"size": "6430",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "src/TomightyTests/Core/TYTomightyTests.m",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Objective-C",
"bytes": "363794"
},
{
"name": "Shell",
"bytes": "354"
}
],
"symlink_target": ""
} |
vivekzhere.github.io
====================
My Home Page
| {
"content_hash": "c4e5acae35b18302ebe3b7f6c5d99abd",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 20,
"avg_line_length": 14,
"alnum_prop": 0.5,
"repo_name": "vivekzhere/vivekzhere.github.io",
"id": "0d6300c0bf6ac4315e071db08987acf5a2f94d19",
"size": "56",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "398"
},
{
"name": "Ruby",
"bytes": "1066"
},
{
"name": "TeX",
"bytes": "9882"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.axis--x path {
display: none;
}
.plot_line {
fill: none;
stroke: steelblue;
stroke-width: 1.5px;
}
</style>
<svg width="800" height="600"></svg>
<script src="http://d3js.org/d3.v4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
<script src="{{ url_for('static', filename='js/plot.js') }}"></script>
<script>
// logger
var logger = {{ logger|tojson }};
// get_data
var plot = {};
var last_date = -1;
function get_data(fun, interval) {
$.get("{{ baseurl }}/get/sink/" + logger,
{
"keys": JSON.stringify("log")
},
function(data) {
if (data.status == "error") {
console.log("Could not get data. Message = " + data.message);
return
}
// flatten data
var points = _.pluck(data.log, "object");
points = _.map(points, function(e) {
return _.flatten(e);
});
data = _.object(Object.keys(data.log), points);
console.log(data);
var dates = _.flatten(data.clock);
//console.log(dates);
var len = _.chain(data)
.mapObject(function(val) {
return val.length;
})
.values()
.first()
.value();
console.log("length = ", len);
// plot only if there is data
if (len > 0) {
delete data.clock;
last_date = dates[dates.length - 1];
var series = _.chain(data)
.mapObject(function(values, i) {
return _.map(values,
function(v, i) {
return {date: dates[i],
value: v};
});
})
.map(function(values, i) {
return {
id: i,
values: values
};
})
.value();
//console.log(dates);
//console.log(series);
}
// call fun
fun(plot, dates, series, interval);
})
.done(function() {
console.log("Got data @" + last_date.toFixed(2) + "s.");
})
.fail(function() {
alert("Could not get data from controller!");
});
};
// ready?
$(document).ready(function(){
// will get data every 1 second
console.log("Retrieving initial data...");
setTimeout(function() {
get_data(create_plot, 1000);
}, 1000);
});
</script>
| {
"content_hash": "f548b1d82be3c5ab5434c99da5101e8b",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 100,
"avg_line_length": 22.17241379310345,
"alnum_prop": 0.5217729393468118,
"repo_name": "mcdeoliveira/ctrl",
"id": "57a006723bff8896cc75ce7be2c845e1e91261c9",
"size": "2572",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "pyctrl/flask/templates/scope.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "17218"
},
{
"name": "Python",
"bytes": "379848"
}
],
"symlink_target": ""
} |
DataBindingDemo (Session03)
==========================
Demo theo toàn bộ hướng dẫn trên trang chủ của Google.
<br/>http://developer.android.com/tools/data-binding/guide.html
<br/> 
Thư mục apk chứa file chạy, mọi người kéo vào thiết bị và trải nghiệm app hoạt động thế nào nhé.
<br/> Apk file: https://github.com/9xkun/102-androiM-whathot/raw/master/Tutor01Day03_DataBindingDemo/apk/databindingdemo-debug.apk
Còn nếu siêu lười nữa thì mọi người chơi thử app trên web:
<br/> https://appetize.io/app/uqyvc0ur0c0pq4nyr0b8r77x10?device=nexus5&scale=75&orientation=portrait&osVersion=5.1
## Setup
Vì mình cho tất cả các source vào chung 1 dự án nên nếu các bạn git clone sẽ lấy cả repo về (có thể sẽ rất to. Một giải pháp nữa là sử dụng git sparse http://jasonkarns.com/blog/subdirectory-checkouts-with-git-sparse-checkout/)
<br/> Do đó mọi người có thể tải file src được nén riêng ở link sau
<br/> https://github.com/9xkun/102-androiM-whathot/raw/master/Tutor01Day03_DataBindingDemo/apk/Tutor01Day03_DataBindingDemo.zip
<br/> Sau đó giải nén bằng 7zip,winrar,winzip, ... và import vào Android Studio.
## Chú ý
Mọi người có thể tới link này để tham khảo toàn bộ thư viện DataBinding
<br/> https://developer.android.com/tools/data-binding/guide.html
hoặc nếu cần tham khảo prj thật có sử dụng databinding, hãy đăng ký học link này:
<br/> http://techmaster.vn/khoa-hoc/25482/101-android-khai-vi
hoặc lên trang của 9xkun.com, có 1 số link sau cho các bạn tham khảo:
<br/> Khóa học: http://iziroi.9xkun.com/course/103-androidM-whathot
<br/> Tuts: http://iziroi.9xkun.com/tuts/article/
| {
"content_hash": "8b0a137377185b4df3476281c6069a01",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 227,
"avg_line_length": 61.07142857142857,
"alnum_prop": 0.7596491228070176,
"repo_name": "hoangpt/102-androiM-whathot",
"id": "858c49a957bf2104c6d5a5ebe56b92114f1885bf",
"size": "1909",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Tutor01Day03_DataBindingDemo/Readme.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "33919"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using Archon.SwissArmyLib.Collections;
using Archon.SwissArmyLib.Pooling;
using UnityEngine;
namespace Archon.SwissArmyLib.Partitioning
{
/// <summary>
/// A simple GC-friendly two-dimensional <see href="https://en.wikipedia.org/wiki/Bin_(computational_geometry)">Bin (aka Spatial Grid)</see> implementation.
///
/// When you're done with the Bin, you should <see cref="Dispose"/> it so its resources can be freed in their object pool. If you forget this, no harm will be done but memory will be GC'ed.
///
/// <seealso cref="Bin3D{T}"/>
/// </summary>
/// <typeparam name="T">The type of items this Bin will hold.</typeparam>
public class Bin2D<T> : IDisposable
{
private static readonly Pool<LinkedListNode<T>> SharedNodePool = new Pool<LinkedListNode<T>>(() => new LinkedListNode<T>(default(T)));
private static readonly Pool<PooledLinkedList<T>> ListPool = new Pool<PooledLinkedList<T>>(() => new PooledLinkedList<T>(SharedNodePool));
private readonly Grid2D<PooledLinkedList<T>> _grid;
private readonly Vector2 _bottomLeft;
private readonly Vector2 _topRight;
/// <summary>
/// Gets the width (number of columns) of the Bin.
/// </summary>
public int Width { get { return _grid.Width; } }
/// <summary>
/// Gets the height (number of rows) of the Bin.
/// </summary>
public int Height { get { return _grid.Height; } }
/// <summary>
/// Gets the width of cells in the Bin.
/// </summary>
public float CellWidth { get; private set; }
/// <summary>
/// Gets the height of cells in the Bin.
/// </summary>
public float CellHeight { get; private set; }
/// <summary>
/// The coordinate at which this bin's bottom left corner lies.
/// </summary>
public Vector2 Origin { get { return _bottomLeft; }}
/// <summary>
/// Gets an <see cref="IEnumerable{T}"/> for the items in the given cell.
/// </summary>
/// <param name="x">The x coordinate of the cell.</param>
/// <param name="y">The y coordinate of the cell.</param>
/// <returns></returns>
public IEnumerable<T> this[int x, int y]
{
get { return _grid[x, y]; }
}
/// <summary>
/// Creates a new Bin.
/// </summary>
/// <param name="gridWidth">The width of the grid.</param>
/// <param name="gridHeight">The height of the grid.</param>
/// <param name="cellWidth">The width of a cell.</param>
/// <param name="cellHeight">The height of a cell.</param>
public Bin2D(int gridWidth, int gridHeight, float cellWidth, float cellHeight)
: this(gridWidth, gridHeight, cellWidth, cellHeight, Vector2.zero)
{
}
/// <summary>
/// Creates a new Bin.
/// </summary>
/// <param name="gridWidth">The width of the grid.</param>
/// <param name="gridHeight">The height of the grid.</param>
/// <param name="cellWidth">The width of a cell.</param>
/// <param name="cellHeight">The height of a cell.</param>
/// <param name="origin">The coordinate of the bottom left point of the grid.</param>
public Bin2D(int gridWidth, int gridHeight, float cellWidth, float cellHeight, Vector2 origin)
{
_grid = new Grid2D<PooledLinkedList<T>>(gridWidth, gridHeight);
CellWidth = cellWidth;
CellHeight = cellHeight;
_bottomLeft = origin;
_topRight = new Vector2(origin.x + gridWidth * cellWidth, origin.y + gridHeight * cellHeight);
}
/// <summary>
/// Inserts an item with the given bounds into the Bin.
/// </summary>
/// <param name="item">The item to insert.</param>
/// <param name="bounds">The bounds of the item.</param>
public void Insert(T item, Rect bounds)
{
if (IsOutOfBounds(bounds))
return;
var internalBounds = GetInternalBounds(bounds);
for (var y = internalBounds.MinY; y <= internalBounds.MaxY; y++)
{
for (var x = internalBounds.MinX; x <= internalBounds.MaxX; x++)
{
var cell = _grid[x, y];
if (cell == null)
_grid[x, y] = cell = ListPool.Spawn();
cell.AddLast(item);
}
}
}
/// <summary>
/// Goes through all cells and removes the specified item if they contain it.
/// If you can you should use <see cref="Remove(T, Rect)"/> instead.
/// </summary>
/// <param name="item">The item to remove</param>
public void Remove(T item)
{
for (var y = 0; y < Height; y++)
{
for (var x = 0; x < Width; x++)
{
var list = _grid[x, y];
if (list == null)
continue;
list.Remove(item);
}
}
}
/// <summary>
/// Removes an item which was inserted with the given bounds from the Bin.
/// </summary>
/// <param name="item">The item to remove.</param>
/// <param name="bounds">The bounds that the item was inserted with.</param>
public void Remove(T item, Rect bounds)
{
if (IsOutOfBounds(bounds))
return;
var internalBounds = GetInternalBounds(bounds);
for (var y = internalBounds.MinY; y <= internalBounds.MaxY; y++)
{
for (var x = internalBounds.MinX; x <= internalBounds.MaxX; x++)
{
var cell = _grid[x, y];
if (cell == null)
continue;
cell.Remove(item);
if (cell.Count == 0)
{
ListPool.Despawn(cell);
_grid[x, y] = null;
}
}
}
}
/// <summary>
/// Removes and reinserts an item with new bounds, essentially moving it.
/// </summary>
/// <param name="item">The item to update.</param>
/// <param name="prevBounds">The bounds that the item was inserted with earlier.</param>
/// <param name="newBounds">The new bounds to insert the item with.</param>
public void Update(T item, Rect prevBounds, Rect newBounds)
{
Remove(item, prevBounds);
Insert(item, newBounds);
}
/// <summary>
/// Gets all items in the Bin that could potentially intersect with the given bounds.
/// </summary>
/// <param name="bounds">The bounds to check for.</param>
/// <param name="results">Where to add results to.</param>
public void Retrieve(Rect bounds, HashSet<T> results)
{
if (IsOutOfBounds(bounds))
return;
var internalBounds = GetInternalBounds(bounds);
for (var y = internalBounds.MinY; y <= internalBounds.MaxY; y++)
{
for (var x = internalBounds.MinX; x <= internalBounds.MaxX; x++)
{
var cell = _grid[x, y];
if (cell == null)
continue;
var current = cell.First;
while (current != null)
{
results.Add(current.Value);
current = current.Next;
}
}
}
}
/// <summary>
/// Removes all items from the Bin.
/// </summary>
public void Clear()
{
for (var y = 0; y < _grid.Height; y++)
{
for (var x = 0; x < _grid.Width; x++)
{
var cell = _grid[x, y];
if (cell == null)
continue;
cell.Clear();
ListPool.Despawn(cell);
_grid[x, y] = null;
}
}
}
/// <summary>
/// Frees (clears) used resources that can be recycled.
///
/// Call this when you're done with the Bin.
/// </summary>
public void Dispose()
{
Clear();
}
private bool IsOutOfBounds(Rect bounds)
{
return !(bounds.xMax > _bottomLeft.x
&& bounds.xMin < _topRight.x
&& bounds.yMax > _bottomLeft.y
&& bounds.yMin < _topRight.y);
}
private InternalBounds GetInternalBounds(Rect bounds)
{
var internalBounds = new InternalBounds
{
MinX = Mathf.Max(0, (int)((bounds.xMin - _bottomLeft.x) / CellWidth)),
MinY = Mathf.Max(0, (int)((bounds.yMin - _bottomLeft.y) / CellHeight)),
MaxX = Mathf.Min(Width - 1, (int)((bounds.xMax - _bottomLeft.x) / CellWidth)),
MaxY = Mathf.Min(Height - 1, (int)((bounds.yMax - _bottomLeft.y) / CellHeight))
};
return internalBounds;
}
private struct InternalBounds
{
public int MinX, MinY,
MaxX, MaxY;
}
}
} | {
"content_hash": "0eca109b5f92723678dd68dcfd09449a",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 193,
"avg_line_length": 35.06934306569343,
"alnum_prop": 0.5031741076074513,
"repo_name": "ArchonInteractive/SwissArmyLib",
"id": "2e6246151d18929696eb5552fedb9c078258ab36",
"size": "9611",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Archon.SwissArmyLib/Partitioning/Bin2D.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "419313"
}
],
"symlink_target": ""
} |
module ApiResource
VERSION = "0.6.25"
end
| {
"content_hash": "ddee96ca6021d4c4a9e3607075693f1f",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 20,
"avg_line_length": 14.666666666666666,
"alnum_prop": 0.7045454545454546,
"repo_name": "LifebookerInc/api_resource",
"id": "7e0cfcd60cbab8aa68f6727842f93bb40dea7d25",
"size": "44",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/api_resource/version.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "297599"
}
],
"symlink_target": ""
} |
<?php
/**
* URIAssetBundle.php
* @author Revin Roman http://phptime.ru
*/
namespace common\_assets;
/**
* Class URIAssetBundle
* @package common\_assets
*/
class URIAssetBundle extends \yii\web\AssetBundle
{
public $sourcePath = '@bower';
public $js = [
'URIjs/src/URI.js',
];
} | {
"content_hash": "640c347503d620f49d16312f62002988",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 49,
"avg_line_length": 14.666666666666666,
"alnum_prop": 0.6266233766233766,
"repo_name": "rmrevin/yii2-application",
"id": "2fa9c1afb7c3e023edff9551f7eda66b8078fb46",
"size": "308",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "common/_assets/URIAssetBundle.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "200"
},
{
"name": "CSS",
"bytes": "204092"
},
{
"name": "CoffeeScript",
"bytes": "737"
},
{
"name": "HTML",
"bytes": "13309"
},
{
"name": "JavaScript",
"bytes": "6806"
},
{
"name": "PHP",
"bytes": "210458"
},
{
"name": "Shell",
"bytes": "1437"
}
],
"symlink_target": ""
} |
// Copyright 2014 The Closure Library Authors. 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.
/**
* @fileoverview Unit tests for goog.html.SafeStyle and its builders.
*/
goog.provide('goog.html.safeStyleTest');
goog.require('goog.html.SafeStyle');
goog.require('goog.html.SafeUrl');
goog.require('goog.object');
goog.require('goog.string.Const');
goog.require('goog.testing.jsunit');
goog.setTestOnly('goog.html.safeStyleTest');
function testSafeStyle() {
var style = 'width: 1em;height: 1em;';
var safeStyle =
goog.html.SafeStyle.fromConstant(goog.string.Const.from(style));
var extracted = goog.html.SafeStyle.unwrap(safeStyle);
assertEquals(style, extracted);
assertEquals(style, safeStyle.getTypedStringValue());
assertEquals('SafeStyle{' + style + '}', String(safeStyle));
// Interface marker is present.
assertTrue(safeStyle.implementsGoogStringTypedString);
}
/** @suppress {checkTypes} */
function testUnwrap() {
var privateFieldName = 'privateDoNotAccessOrElseSafeStyleWrappedValue_';
var markerFieldName = 'SAFE_STYLE_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_';
var propNames = goog.object.getKeys(
goog.html.SafeStyle.fromConstant(goog.string.Const.from('')));
assertContains(privateFieldName, propNames);
assertContains(markerFieldName, propNames);
var evil = {};
evil[privateFieldName] = 'width: expression(evil);';
evil[markerFieldName] = {};
var exception =
assertThrows(function() { goog.html.SafeStyle.unwrap(evil); });
assertContains('expected object of type SafeStyle', exception.message);
}
function testFromConstant_allowsEmptyString() {
assertEquals(
goog.html.SafeStyle.EMPTY,
goog.html.SafeStyle.fromConstant(goog.string.Const.from('')));
}
function testFromConstant_throwsOnForbiddenCharacters() {
assertThrows(function() {
goog.html.SafeStyle.fromConstant(goog.string.Const.from('width: x<;'));
});
assertThrows(function() {
goog.html.SafeStyle.fromConstant(goog.string.Const.from('width: x>;'));
});
}
function testFromConstant_throwsIfNoFinalSemicolon() {
assertThrows(function() {
goog.html.SafeStyle.fromConstant(goog.string.Const.from('width: 1em'));
});
}
function testFromConstant_throwsIfNoColon() {
assertThrows(function() {
goog.html.SafeStyle.fromConstant(goog.string.Const.from('width= 1em;'));
});
}
function testEmpty() {
assertEquals('', goog.html.SafeStyle.unwrap(goog.html.SafeStyle.EMPTY));
}
function testCreate() {
assertCreateEquals(
'background:url(i.png);margin:0;',
{'background': goog.string.Const.from('url(i.png)'), 'margin': '0'});
}
function testCreate_allowsEmpty() {
assertEquals(goog.html.SafeStyle.EMPTY, goog.html.SafeStyle.create({}));
}
function testCreate_skipsNull() {
var style = goog.html.SafeStyle.create({'background': null});
assertEquals(goog.html.SafeStyle.EMPTY, style);
}
function testCreate_allowsLengths() {
assertCreateEquals(
'padding:0 1px .2% 3.4em;', // expected
{'padding': '0 1px .2% 3.4em'});
}
function testCreate_allowsRgb() {
assertCreateEquals(
'color:rgb(10,20,30);', // expected
{'color': 'rgb(10,20,30)'});
assertCreateEquals(
'color:rgb(10%, 20%, 30%);', // expected
{'color': 'rgb(10%, 20%, 30%)'});
assertCreateEquals(
'background:0 5px rgb(10,20,30);', // expected
{'background': '0 5px rgb(10,20,30)'});
assertCreateEquals(
'background:rgb(10,0,0), rgb(0,0,30);',
{'background': 'rgb(10,0,0), rgb(0,0,30)'});
}
function testCreate_allowsRgba() {
assertCreateEquals(
'color:rgba(10,20,30,0.1);', // expected
{'color': 'rgba(10,20,30,0.1)'});
assertCreateEquals(
'color:rgba(10%, 20%, 30%, .5);', // expected
{'color': 'rgba(10%, 20%, 30%, .5)'});
}
function testCreate_allowsScale() {
assertCreateEquals(
'transform:scale(.5, 2);', // expected
{'transform': 'scale(.5, 2)'});
}
function testCreate_allowsRotate() {
assertCreateEquals(
'transform:rotate(45deg);', // expected
{'transform': 'rotate(45deg)'});
}
function testCreate_allowsTranslate() {
assertCreateEquals(
'transform:translate(10px);', // expected
{'transform': 'translate(10px)'});
assertCreateEquals(
'transform:translateX(5px);', // expected
{'transform': 'translateX(5px)'});
}
function testCreate_allowsUrl() {
assertCreateEquals(
'background:url(http://example.com);',
{'background': 'url(http://example.com)'});
assertCreateEquals(
'background:url("http://example.com");',
{'background': 'url("http://example.com")'});
assertCreateEquals(
'background:url( \'http://example.com\' );',
{'background': 'url( \'http://example.com\' )'});
assertCreateEquals(
'background:url(http://example.com) red;',
{'background': 'url(http://example.com) red'});
assertCreateEquals(
'background:url(' + goog.html.SafeUrl.INNOCUOUS_STRING + ');',
{'background': 'url(javascript:alert)'});
assertCreateEquals(
'background:url(")");', // Expected.
{'background': 'url(")")'});
assertCreateEquals(
'background:url(" ");', // Expected.
{'background': 'url(" ")'});
assertThrows(function() {
goog.html.SafeStyle.create({'background': 'url(\'http://example.com\'"")'});
});
assertThrows(function() {
goog.html.SafeStyle.create({'background': 'url("\\\\")'});
});
assertThrows(function() {
goog.html.SafeStyle.create({'background': 'url(a""b)'});
});
}
function testCreate_throwsOnForbiddenCharacters() {
assertThrows(function() { goog.html.SafeStyle.create({'<': '0'}); });
assertThrows(function() {
goog.html.SafeStyle.create({'color': goog.string.Const.from('<')});
});
}
function testCreate_values() {
var valids = [
'0', '0 0', '1px', '100%', '2.3px', '.1em', 'red', '#f00', 'red !important',
'"Times New Roman"', "'Times New Roman'", '"Bold \'nuff"',
'"O\'Connor\'s Revenge"'
];
for (var i = 0; i < valids.length; i++) {
var value = valids[i];
assertCreateEquals(
'background:' + value + ';', // expected
{'background': value});
}
var invalids = [
'', 'expression(alert(1))', '"', '"\'"\'', goog.string.Const.from('red;')
];
for (var i = 0; i < invalids.length; i++) {
var value = invalids[i];
assertThrows(function() {
goog.html.SafeStyle.create({'background': value});
});
}
}
/**
* Asserts that created SafeStyle matches expected value.
* @param {string} expected
* @param {!goog.html.SafeStyle.PropertyMap} style
*/
function assertCreateEquals(expected, style) {
var style = goog.html.SafeStyle.create(style);
assertEquals(expected, goog.html.SafeStyle.unwrap(style));
}
function testConcat() {
var width =
goog.html.SafeStyle.fromConstant(goog.string.Const.from('width: 1em;'));
var margin = goog.html.SafeStyle.create({'margin': '0'});
var padding = goog.html.SafeStyle.create({'padding': '0'});
var style = goog.html.SafeStyle.concat(width, margin);
assertEquals('width: 1em;margin:0;', goog.html.SafeStyle.unwrap(style));
style = goog.html.SafeStyle.concat([width, margin]);
assertEquals('width: 1em;margin:0;', goog.html.SafeStyle.unwrap(style));
style = goog.html.SafeStyle.concat([width], [padding, margin]);
assertEquals(
'width: 1em;padding:0;margin:0;', goog.html.SafeStyle.unwrap(style));
}
function testConcat_allowsEmpty() {
var empty = goog.html.SafeStyle.EMPTY;
assertEquals(empty, goog.html.SafeStyle.concat());
assertEquals(empty, goog.html.SafeStyle.concat([]));
assertEquals(empty, goog.html.SafeStyle.concat(empty));
}
| {
"content_hash": "bba41258291dc0bd5fb04b7fdf064828",
"timestamp": "",
"source": "github",
"line_count": 273,
"max_line_length": 80,
"avg_line_length": 30.09157509157509,
"alnum_prop": 0.662568472306756,
"repo_name": "carto-tragsatec/visorCatastroColombia",
"id": "7686d9be9c4e14ba268624cff67603c20c09a28e",
"size": "8215",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "WebContent/visorcatastrocol/lib/openlayers/v4.3.3/closure-library/closure/goog/html/safestyle_test.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "376209"
},
{
"name": "HTML",
"bytes": "19957"
},
{
"name": "Java",
"bytes": "10943"
},
{
"name": "JavaScript",
"bytes": "370944"
}
],
"symlink_target": ""
} |
package pl.surreal.finance.transaction.api;
import com.fasterxml.jackson.annotation.JsonProperty;
public class AccountApi
{
@JsonProperty
private long id;
@JsonProperty
private String number;
@JsonProperty
private String name;
public AccountApi() {}
public AccountApi(String number,String name) {
this.number = number;
this.name = name;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| {
"content_hash": "8d3a3144f27bbb22be0fed29184d0733",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 53,
"avg_line_length": 14.782608695652174,
"alnum_prop": 0.6941176470588235,
"repo_name": "mikouaj/finsight",
"id": "0ccfbca998e25cf4ecbe020f4557529cd4de1d34",
"size": "1236",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "finsight-backend/src/main/java/pl/surreal/finance/transaction/api/AccountApi.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "578"
},
{
"name": "HTML",
"bytes": "34611"
},
{
"name": "Java",
"bytes": "233056"
},
{
"name": "JavaScript",
"bytes": "33777"
},
{
"name": "Puppet",
"bytes": "2358"
}
],
"symlink_target": ""
} |
if [[ $# -eq 0 ]] ; then
echo 'Missing argument: directory with ndjson input files'
exit 1
fi
echo "converting FHIR files in $1"
bazel run //java/com/google/fhir/examples:ConvertNdJsonForBigQuery -- --output_directory $1 $1/*.ndjson
gzip $1/*.prototxt
| {
"content_hash": "762039e1c1364fb8a4c43ada25dbe96b",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 103,
"avg_line_length": 29.11111111111111,
"alnum_prop": 0.6984732824427481,
"repo_name": "google/fhir",
"id": "c73b510144afaf18d34d86838c424da8c1db0998",
"size": "851",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "examples/bulkdata/02-parse-into-protobuf.sh",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "5560"
},
{
"name": "C",
"bytes": "37522"
},
{
"name": "C++",
"bytes": "1376466"
},
{
"name": "Dockerfile",
"bytes": "966"
},
{
"name": "Go",
"bytes": "542973"
},
{
"name": "Java",
"bytes": "929152"
},
{
"name": "Python",
"bytes": "645991"
},
{
"name": "Shell",
"bytes": "17013"
},
{
"name": "Starlark",
"bytes": "308438"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
NUB Generator [autonym]
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "ce999a09c2460daf2dd9d2681b6ee86c",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 23,
"avg_line_length": 9.076923076923077,
"alnum_prop": 0.6779661016949152,
"repo_name": "mdoering/backbone",
"id": "d96a9baba5779e64e584d9f6be512c301be4136c",
"size": "183",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Oxalidales/Elaeocarpaceae/Elaeocarpus/Elaeocarpus myrtoides/Elaeocarpus myrtoides myrtoides/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
/**
* Test the request function
*/
import request from '../request';
import sinon from 'sinon';
import expect from 'expect';
describe('request', () => {
// Before each test, stub the fetch function
beforeEach(() => {
sinon.stub(window, 'fetch');
});
// After each test, restore the fetch function
afterEach(() => {
window.fetch.restore();
});
describe('stubbing successful response', () => {
// Before each test, pretend we got a successful response
beforeEach(() => {
const res = new Response('{"status":"OK","data":{"hello":"world"}}', {
status: 200,
headers: {
'Content-type': 'application/json',
},
});
window.fetch.returns(Promise.resolve(res));
});
it('should format the response correctly', (done) => {
request('/thisurliscorrect')
.then((json) => {
expect(json.data.hello).toEqual('world');
done();
});
});
});
describe('stubbing not found response', () => {
// Before each test, pretend we got a not found response
beforeEach(() => {
const res = new Response('', {
status: 404,
statusText: 'Not Found',
headers: {
'Content-type': 'application/json',
},
});
window.fetch.returns(Promise.resolve(res));
});
it('should catch errors', (done) => {
request('/thisdoesntexist')
.then((json) => {
expect(json.err.response.status).toEqual(404);
expect(json.err.response.statusText).toEqual('Not Found');
done();
});
});
});
describe('stubbing error response', () => {
// Before each test, pretend we got an unsuccessful response
beforeEach(() => {
const res = new Response('{"message":"Malformed request"}', {
status: 200,
headers: {
'Content-type': 'application/json',
},
});
window.fetch.returns(Promise.resolve(res));
});
it('should catch error response', (done) => {
request('/thisisinvalid')
.then((json) => {
expect(json.err.response.message).toEqual('Malformed request');
done();
});
});
});
});
| {
"content_hash": "a84fa3dcb53e1ddce4c95e29abbf7b16",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 76,
"avg_line_length": 25.39080459770115,
"alnum_prop": 0.5427795382526029,
"repo_name": "matusmarcin/special-disco",
"id": "094c0305d1454e5c3e86feeaf59ea638eeba8b0e",
"size": "2209",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/utils/tests/request.test.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "1526"
},
{
"name": "CSS",
"bytes": "3849"
},
{
"name": "HTML",
"bytes": "8767"
},
{
"name": "JavaScript",
"bytes": "101155"
}
],
"symlink_target": ""
} |
angular-barcode, an Angular barcode generator based on barcode-jquery
https://github.com/artdomg/barcode-jquery
| {
"content_hash": "c0d8ee175f7fef4bce0a4aac37945700",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 69,
"avg_line_length": 37.666666666666664,
"alnum_prop": 0.8230088495575221,
"repo_name": "DennisJaamann/angular-barcode",
"id": "07424db30bb6070cad8e51c901e679c2f7a80ff1",
"size": "131",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "7103"
},
{
"name": "JavaScript",
"bytes": "5861"
}
],
"symlink_target": ""
} |
using System;
namespace Xwt.Backends
{
/// <summary>
/// A backend for a scrollbar
/// </summary>
/// <remarks>
/// XWT supports creating standalone ScrollAdjustment instances, but toolkits don't need to provide
/// a backend for those cases, since XWT uses a default platform-agnostic implementation.
/// </remarks>
public interface IScrollAdjustmentBackend: IBackend
{
/// <summary>
/// Called to initialize the backend
/// </summary>
/// <param name='eventSink'>
/// The event sink to be used to report events
/// </param>
void Initialize (IScrollAdjustmentEventSink eventSink);
/// <summary>
/// Gets or sets the current position of the scrollbar.
/// </summary>
/// <value>
/// The position
/// </value>
/// <remarks>
/// Value is the position of top coordinate of the visible rect (or left for horizontal scrollbars).
/// So for example, if you set Value=35 and PageSize=100, the visible range will be 35 to 135.
/// Value must be >= LowerValue and <= (UpperValue - PageSize).
/// </remarks>
double Value { get; set; }
/// <summary>
/// Sets the scroll range and the inital value
/// </summary>
/// <param name="lowerValue">The lowest value of the scroll range</param>
/// <param name="upperValue">The highest value of the scroll range</param>
/// <param name="pageSize">Size of the visible range</param>
/// <param name="pageIncrement">How much Value will be incremented when you click on the scrollbar to move
/// to the next page (when the scrollbar supports it)</param>
/// <param name="stepIncrement">How much the Value is incremented/decremented when you click on the down/up button in the scrollbar</param>
/// <param name="value">Value.</param>
void SetRange (double lowerValue, double upperValue, double pageSize, double pageIncrement, double stepIncrement, double value);
}
public interface IScrollAdjustmentEventSink
{
/// <summary>
/// Raised when the position of the scrollbar changes
/// </summary>
void OnValueChanged ();
}
public enum ScrollAdjustmentEvent
{
ValueChanged
}
}
| {
"content_hash": "bca24f2f6a4ca6f95aeff9267ecc922d",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 141,
"avg_line_length": 34.40983606557377,
"alnum_prop": 0.6922343973320629,
"repo_name": "hwthomas/xwt",
"id": "c12c4b0cbee06e89e56a85d96a2e3c6985d4cf8d",
"size": "3309",
"binary": false,
"copies": "18",
"ref": "refs/heads/master",
"path": "Xwt/Xwt.Backends/IScrollAdjustmentBackend.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "3772740"
},
{
"name": "Makefile",
"bytes": "245"
}
],
"symlink_target": ""
} |
<?php
/**
* PipelineImpllinksTest
*
* PHP version 8.1.1
*
* @category Class
* @package OpenAPI\Server\Tests\Model
* @author openapi-generator contributors
* @link https://github.com/openapitools/openapi-generator
*/
/**
* Swaggy Jenkins
*
* Jenkins API clients generated from Swagger / Open API specification
*
* The version of the OpenAPI document: 1.5.1-pre.0
* Contact: blah@cliffano.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*
*/
/**
* NOTE: This class is auto generated by the openapi generator program.
* https://github.com/openapitools/openapi-generator
* Please update the test case below to test the model.
*/
namespace OpenAPI\Server\Model;
use PHPUnit\Framework\TestCase;
/**
* PipelineImpllinksTest Class Doc Comment
*
* @category Class */
// * @description PipelineImpllinks
/**
* @package OpenAPI\Server\Tests\Model
* @author openapi-generator contributors
* @link https://github.com/openapitools/openapi-generator
*/
class PipelineImpllinksTest extends TestCase
{
/**
* Setup before running any test case
*/
public static function setUpBeforeClass(): void
{
}
/**
* Setup before running each test case
*/
public function setUp(): void
{
}
/**
* Clean up after running each test case
*/
public function tearDown(): void
{
}
/**
* Clean up after running all test cases
*/
public static function tearDownAfterClass(): void
{
}
/**
* Test "PipelineImpllinks"
*/
public function testPipelineImpllinks()
{
$testPipelineImpllinks = new PipelineImpllinks();
}
/**
* Test attribute "runs"
*/
public function testPropertyRuns()
{
}
/**
* Test attribute "self"
*/
public function testPropertySelf()
{
}
/**
* Test attribute "queue"
*/
public function testPropertyQueue()
{
}
/**
* Test attribute "actions"
*/
public function testPropertyActions()
{
}
/**
* Test attribute "class"
*/
public function testPropertyClass()
{
}
}
| {
"content_hash": "50849d0aa527b80ce8dcf06af24b6d8f",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 71,
"avg_line_length": 18.794871794871796,
"alnum_prop": 0.6189176898590268,
"repo_name": "cliffano/swaggy-jenkins",
"id": "ba058585f4e6da6d2eb1f60469700017dcfaef2d",
"size": "2199",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "clients/php-symfony/generated/Tests/Model/PipelineImpllinksTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ada",
"bytes": "569823"
},
{
"name": "Apex",
"bytes": "741346"
},
{
"name": "Batchfile",
"bytes": "14792"
},
{
"name": "C",
"bytes": "971274"
},
{
"name": "C#",
"bytes": "5131336"
},
{
"name": "C++",
"bytes": "7799032"
},
{
"name": "CMake",
"bytes": "20609"
},
{
"name": "CSS",
"bytes": "4873"
},
{
"name": "Clojure",
"bytes": "129018"
},
{
"name": "Crystal",
"bytes": "864941"
},
{
"name": "Dart",
"bytes": "876777"
},
{
"name": "Dockerfile",
"bytes": "7385"
},
{
"name": "Eiffel",
"bytes": "424642"
},
{
"name": "Elixir",
"bytes": "139252"
},
{
"name": "Elm",
"bytes": "187067"
},
{
"name": "Emacs Lisp",
"bytes": "191"
},
{
"name": "Erlang",
"bytes": "373074"
},
{
"name": "F#",
"bytes": "556012"
},
{
"name": "Gherkin",
"bytes": "951"
},
{
"name": "Go",
"bytes": "345227"
},
{
"name": "Groovy",
"bytes": "89524"
},
{
"name": "HTML",
"bytes": "2367424"
},
{
"name": "Haskell",
"bytes": "680841"
},
{
"name": "Java",
"bytes": "12164874"
},
{
"name": "JavaScript",
"bytes": "1959006"
},
{
"name": "Kotlin",
"bytes": "1280953"
},
{
"name": "Lua",
"bytes": "322316"
},
{
"name": "Makefile",
"bytes": "11882"
},
{
"name": "Nim",
"bytes": "65818"
},
{
"name": "OCaml",
"bytes": "94665"
},
{
"name": "Objective-C",
"bytes": "464903"
},
{
"name": "PHP",
"bytes": "4383673"
},
{
"name": "Perl",
"bytes": "743304"
},
{
"name": "PowerShell",
"bytes": "678274"
},
{
"name": "Python",
"bytes": "5529523"
},
{
"name": "QMake",
"bytes": "6915"
},
{
"name": "R",
"bytes": "840841"
},
{
"name": "Raku",
"bytes": "10945"
},
{
"name": "Ruby",
"bytes": "328360"
},
{
"name": "Rust",
"bytes": "1735375"
},
{
"name": "Scala",
"bytes": "1387368"
},
{
"name": "Shell",
"bytes": "407167"
},
{
"name": "Swift",
"bytes": "342562"
},
{
"name": "TypeScript",
"bytes": "3060093"
}
],
"symlink_target": ""
} |
using base::TimeTicks;
using base::TimeDelta;
namespace views {
// Default menu offset.
static const int kDefaultMenuOffsetX = -2;
static const int kDefaultMenuOffsetY = -4;
// static
const char MenuButton::kViewClassName[] = "MenuButton";
const int MenuButton::kMenuMarkerPaddingLeft = 3;
const int MenuButton::kMenuMarkerPaddingRight = -1;
////////////////////////////////////////////////////////////////////////////////
//
// MenuButton::PressedLock
//
////////////////////////////////////////////////////////////////////////////////
MenuButton::PressedLock::PressedLock(MenuButton* menu_button)
: menu_button_(menu_button->weak_factory_.GetWeakPtr()) {
menu_button_->IncrementPressedLocked();
}
MenuButton::PressedLock::~PressedLock() {
if (menu_button_.get())
menu_button_->DecrementPressedLocked();
}
////////////////////////////////////////////////////////////////////////////////
//
// MenuButton - constructors, destructors, initialization
//
////////////////////////////////////////////////////////////////////////////////
MenuButton::MenuButton(ButtonListener* listener,
const base::string16& text,
MenuButtonListener* menu_button_listener,
bool show_menu_marker)
: LabelButton(listener, text),
menu_offset_(kDefaultMenuOffsetX, kDefaultMenuOffsetY),
listener_(menu_button_listener),
show_menu_marker_(show_menu_marker),
menu_marker_(ui::ResourceBundle::GetSharedInstance().GetImageNamed(
IDR_MENU_DROPARROW).ToImageSkia()),
destroyed_flag_(NULL),
pressed_lock_count_(0),
should_disable_after_press_(false),
weak_factory_(this) {
SetHorizontalAlignment(gfx::ALIGN_LEFT);
}
MenuButton::~MenuButton() {
if (destroyed_flag_)
*destroyed_flag_ = true;
}
////////////////////////////////////////////////////////////////////////////////
//
// MenuButton - Public APIs
//
////////////////////////////////////////////////////////////////////////////////
bool MenuButton::Activate() {
SetState(STATE_PRESSED);
if (listener_) {
gfx::Rect lb = GetLocalBounds();
// The position of the menu depends on whether or not the locale is
// right-to-left.
gfx::Point menu_position(lb.right(), lb.bottom());
if (base::i18n::IsRTL())
menu_position.set_x(lb.x());
View::ConvertPointToScreen(this, &menu_position);
if (base::i18n::IsRTL())
menu_position.Offset(-menu_offset_.x(), menu_offset_.y());
else
menu_position.Offset(menu_offset_.x(), menu_offset_.y());
int max_x_coordinate = GetMaximumScreenXCoordinate();
if (max_x_coordinate && max_x_coordinate <= menu_position.x())
menu_position.set_x(max_x_coordinate - 1);
// We're about to show the menu from a mouse press. By showing from the
// mouse press event we block RootView in mouse dispatching. This also
// appears to cause RootView to get a mouse pressed BEFORE the mouse
// release is seen, which means RootView sends us another mouse press no
// matter where the user pressed. To force RootView to recalculate the
// mouse target during the mouse press we explicitly set the mouse handler
// to NULL.
static_cast<internal::RootView*>(GetWidget()->GetRootView())->
SetMouseHandler(NULL);
bool destroyed = false;
destroyed_flag_ = &destroyed;
// We don't set our state here. It's handled in the MenuController code or
// by our click listener.
listener_->OnMenuButtonClicked(this, menu_position);
if (destroyed) {
// The menu was deleted while showing. Don't attempt any processing.
return false;
}
destroyed_flag_ = NULL;
menu_closed_time_ = TimeTicks::Now();
// We must return false here so that the RootView does not get stuck
// sending all mouse pressed events to us instead of the appropriate
// target.
return false;
}
return true;
}
void MenuButton::OnPaint(gfx::Canvas* canvas) {
LabelButton::OnPaint(canvas);
if (show_menu_marker_)
PaintMenuMarker(canvas);
}
////////////////////////////////////////////////////////////////////////////////
//
// MenuButton - Events
//
////////////////////////////////////////////////////////////////////////////////
gfx::Size MenuButton::GetPreferredSize() const {
gfx::Size prefsize = LabelButton::GetPreferredSize();
if (show_menu_marker_) {
prefsize.Enlarge(menu_marker_->width() + kMenuMarkerPaddingLeft +
kMenuMarkerPaddingRight,
0);
}
return prefsize;
}
const char* MenuButton::GetClassName() const {
return kViewClassName;
}
bool MenuButton::OnMousePressed(const ui::MouseEvent& event) {
if (request_focus_on_press())
RequestFocus();
if (state() != STATE_DISABLED && ShouldEnterPushedState(event) &&
HitTestPoint(event.location())) {
TimeDelta delta = TimeTicks::Now() - menu_closed_time_;
if (delta.InMilliseconds() > kMinimumMsBetweenButtonClicks)
return Activate();
}
return true;
}
void MenuButton::OnMouseReleased(const ui::MouseEvent& event) {
if (state() != STATE_DISABLED && ShouldEnterPushedState(event) &&
HitTestPoint(event.location()) && !InDrag()) {
Activate();
} else {
LabelButton::OnMouseReleased(event);
}
}
void MenuButton::OnMouseEntered(const ui::MouseEvent& event) {
if (pressed_lock_count_ == 0) // Ignore mouse movement if state is locked.
LabelButton::OnMouseEntered(event);
}
void MenuButton::OnMouseExited(const ui::MouseEvent& event) {
if (pressed_lock_count_ == 0) // Ignore mouse movement if state is locked.
LabelButton::OnMouseExited(event);
}
void MenuButton::OnMouseMoved(const ui::MouseEvent& event) {
if (pressed_lock_count_ == 0) // Ignore mouse movement if state is locked.
LabelButton::OnMouseMoved(event);
}
void MenuButton::OnGestureEvent(ui::GestureEvent* event) {
if (state() != STATE_DISABLED) {
if (ShouldEnterPushedState(*event) && !Activate()) {
// When |Activate()| returns |false|, it means that a menu is shown and
// has handled the gesture event. So, there is no need to further process
// the gesture event here.
return;
}
if (switches::IsTouchFeedbackEnabled()) {
if (event->type() == ui::ET_GESTURE_TAP_DOWN) {
event->SetHandled();
SetState(Button::STATE_HOVERED);
} else if (state() == Button::STATE_HOVERED &&
(event->type() == ui::ET_GESTURE_TAP_CANCEL ||
event->type() == ui::ET_GESTURE_END)) {
SetState(Button::STATE_NORMAL);
}
}
}
LabelButton::OnGestureEvent(event);
}
bool MenuButton::OnKeyPressed(const ui::KeyEvent& event) {
switch (event.key_code()) {
case ui::VKEY_SPACE:
// Alt-space on windows should show the window menu.
if (event.IsAltDown())
break;
case ui::VKEY_RETURN:
case ui::VKEY_UP:
case ui::VKEY_DOWN: {
// WARNING: we may have been deleted by the time Activate returns.
Activate();
// This is to prevent the keyboard event from being dispatched twice. If
// the keyboard event is not handled, we pass it to the default handler
// which dispatches the event back to us causing the menu to get displayed
// again. Return true to prevent this.
return true;
}
default:
break;
}
return false;
}
bool MenuButton::OnKeyReleased(const ui::KeyEvent& event) {
// Override CustomButton's implementation, which presses the button when
// you press space and clicks it when you release space. For a MenuButton
// we always activate the menu on key press.
return false;
}
void MenuButton::GetAccessibleState(ui::AXViewState* state) {
CustomButton::GetAccessibleState(state);
state->role = ui::AX_ROLE_POP_UP_BUTTON;
state->default_action = l10n_util::GetStringUTF16(IDS_APP_ACCACTION_PRESS);
state->AddStateFlag(ui::AX_STATE_HASPOPUP);
}
void MenuButton::PaintMenuMarker(gfx::Canvas* canvas) {
gfx::Insets insets = GetInsets();
// Using the Views mirroring infrastructure incorrectly flips icon content.
// Instead, manually mirror the position of the down arrow.
gfx::Rect arrow_bounds(width() - insets.right() -
menu_marker_->width() - kMenuMarkerPaddingRight,
height() / 2 - menu_marker_->height() / 2,
menu_marker_->width(),
menu_marker_->height());
arrow_bounds.set_x(GetMirroredXForRect(arrow_bounds));
canvas->DrawImageInt(*menu_marker_, arrow_bounds.x(), arrow_bounds.y());
}
gfx::Rect MenuButton::GetChildAreaBounds() {
gfx::Size s = size();
if (show_menu_marker_) {
s.set_width(s.width() - menu_marker_->width() - kMenuMarkerPaddingLeft -
kMenuMarkerPaddingRight);
}
return gfx::Rect(s);
}
bool MenuButton::ShouldEnterPushedState(const ui::Event& event) {
if (event.IsMouseEvent()) {
const ui::MouseEvent& mouseev = static_cast<const ui::MouseEvent&>(event);
// Active on left mouse button only, to prevent a menu from being activated
// when a right-click would also activate a context menu.
if (!mouseev.IsOnlyLeftMouseButton())
return false;
// If dragging is supported activate on release, otherwise activate on
// pressed.
ui::EventType active_on =
GetDragOperations(mouseev.location()) == ui::DragDropTypes::DRAG_NONE
? ui::ET_MOUSE_PRESSED
: ui::ET_MOUSE_RELEASED;
return event.type() == active_on;
}
return event.type() == ui::ET_GESTURE_TAP;
}
void MenuButton::StateChanged() {
if (pressed_lock_count_ != 0) {
// The button's state was changed while it was supposed to be locked in a
// pressed state. This shouldn't happen, but conceivably could if a caller
// tries to switch from enabled to disabled or vice versa while the button
// is pressed.
if (state() == STATE_NORMAL)
should_disable_after_press_ = false;
else if (state() == STATE_DISABLED)
should_disable_after_press_ = true;
}
}
void MenuButton::IncrementPressedLocked() {
++pressed_lock_count_;
should_disable_after_press_ = state() == STATE_DISABLED;
SetState(STATE_PRESSED);
}
void MenuButton::DecrementPressedLocked() {
--pressed_lock_count_;
DCHECK_GE(pressed_lock_count_, 0);
// If this was the last lock, manually reset state to the desired state.
if (pressed_lock_count_ == 0) {
ButtonState desired_state = STATE_NORMAL;
if (should_disable_after_press_) {
desired_state = STATE_DISABLED;
should_disable_after_press_ = false;
} else if (IsMouseHovered()) {
desired_state = STATE_HOVERED;
}
SetState(desired_state);
}
}
int MenuButton::GetMaximumScreenXCoordinate() {
if (!GetWidget()) {
NOTREACHED();
return 0;
}
gfx::Rect monitor_bounds = GetWidget()->GetWorkAreaBoundsInScreen();
return monitor_bounds.right() - 1;
}
} // namespace views
| {
"content_hash": "3af15e94da76bce52e8ed291534a516c",
"timestamp": "",
"source": "github",
"line_count": 333,
"max_line_length": 80,
"avg_line_length": 32.96396396396396,
"alnum_prop": 0.6241231666211169,
"repo_name": "ltilve/ChromiumGStreamerBackend",
"id": "dd7e489b661ddd6de86c0439f376ef024f39a441",
"size": "12006",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "ui/views/controls/button/menu_button.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "AppleScript",
"bytes": "6973"
},
{
"name": "Arduino",
"bytes": "464"
},
{
"name": "Assembly",
"bytes": "37073"
},
{
"name": "Batchfile",
"bytes": "8451"
},
{
"name": "C",
"bytes": "9568645"
},
{
"name": "C++",
"bytes": "246813997"
},
{
"name": "CSS",
"bytes": "943687"
},
{
"name": "DM",
"bytes": "60"
},
{
"name": "Groff",
"bytes": "2494"
},
{
"name": "HTML",
"bytes": "27371019"
},
{
"name": "Java",
"bytes": "15348315"
},
{
"name": "JavaScript",
"bytes": "20872607"
},
{
"name": "Makefile",
"bytes": "70983"
},
{
"name": "Objective-C",
"bytes": "2029825"
},
{
"name": "Objective-C++",
"bytes": "10156554"
},
{
"name": "PHP",
"bytes": "97817"
},
{
"name": "PLpgSQL",
"bytes": "182741"
},
{
"name": "Perl",
"bytes": "63937"
},
{
"name": "Protocol Buffer",
"bytes": "494625"
},
{
"name": "Python",
"bytes": "8594611"
},
{
"name": "Shell",
"bytes": "486464"
},
{
"name": "Standard ML",
"bytes": "5106"
},
{
"name": "XSLT",
"bytes": "418"
},
{
"name": "nesC",
"bytes": "18347"
}
],
"symlink_target": ""
} |
namespace formulate.app.Forms.Handlers.Email
{
// Namespaces.
using System;
using System.Collections.Generic;
/// <summary>
/// The portion of the email configuration used for the email sender and the email
/// recipients.
/// </summary>
public interface IEmailSenderRecipientConfiguration
{
#region Properties
/// <summary>
/// Gets the sender of the email.
/// </summary>
string SenderEmail { get; }
/// <summary>
/// Gets the recipients of the email.
/// </summary>
IEnumerable<string> Recipients { get; }
/// <summary>
/// Gets the fields containing the recipients of the email.
/// </summary>
IEnumerable<Guid> RecipientFields { get; }
/// <summary>
/// Gets the type of delivery for the recipients (e.g., to, cc, bcc).
/// </summary>
string DeliveryType { get; }
#endregion
}
}
| {
"content_hash": "ba386fe301c244e3363b809a9e329947",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 86,
"avg_line_length": 25.68421052631579,
"alnum_prop": 0.5676229508196722,
"repo_name": "rhythmagency/formulate",
"id": "b47bde8d1ecf29173a23f24515183abbccf71551",
"size": "978",
"binary": false,
"copies": "1",
"ref": "refs/heads/v3/master",
"path": "src/formulate.app/Forms/Handlers/Email/IEmailSenderRecipientConfiguration.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP.NET",
"bytes": "2203"
},
{
"name": "Batchfile",
"bytes": "270"
},
{
"name": "C#",
"bytes": "617212"
},
{
"name": "HTML",
"bytes": "105873"
},
{
"name": "JavaScript",
"bytes": "380893"
},
{
"name": "SCSS",
"bytes": "14746"
}
],
"symlink_target": ""
} |
'''
Created on 28 janv. 2014
@author: Alexandre Bonhomme
'''
from core.agents.AgentMovable import AgentMovable
class PacmanAgent(AgentMovable):
def __init__(self, x, y, sma):
AgentMovable.__init__(self, x, y, sma)
def action(self):
self.randomMoveInNeighborhood()
self.sma._computeDijkstraGrid(self.x, self.y)
| {
"content_hash": "1bd2a135ad3bf94c47deedec3936f42f",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 53,
"avg_line_length": 23.066666666666666,
"alnum_prop": 0.6705202312138728,
"repo_name": "blckshrk/DummySMA",
"id": "80ab76811242eb5fb7f1f6011827ecaa7693fd17",
"size": "346",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/pacman/agents/PacmanAgent.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "57644"
}
],
"symlink_target": ""
} |
#ifndef _SINPUT_H
#define _SINPUT_H
#ifndef _WINDOWS_
#include <windows.h>
#endif
#include <tchar.h>
// OW FIXME: this had to be added after installing the DX8 Beta 1 SDK
#define USE_DINPUT_8
#ifndef USE_DINPUT_8 // Retro 15Jan2004
#define DIRECTINPUT_VERSION 0x0700
#else
#define DIRECTINPUT_VERSION 0x0800
#endif
#include "dinput.h"
#include "tchar.h"
#include "stdhdr.h"
#include "Graphics/Include/grtypes.h"
#include "Graphics/Include/imagebuf.h"
#include "vu2.h"
#define SI_MOUSE_TIME_DELTA 1500 //in ms
//directional cursors
#define DEFAULT_CURSOR 0
#define N_CURSOR 1
#define NE_CURSOR 2
#define E_CURSOR 3
#define SE_CURSOR 4
#define S_CURSOR 5
#define SW_CURSOR 6
#define W_CURSOR 7
#define NW_CURSOR 8
#define SIM_CURSOR_FILE "6_cursor.dat"
#define SIM_CURSOR_DIR "\\art\\ckptart\\"
typedef struct
{
UInt16 Width;
UInt16 Height;
UInt16 xHotspot;
UInt16 yHotspot;
ImageBuffer* CursorBuffer;
BYTE* CursorRenderBuffer; //Wombat778 3-24-04
std::vector<TextureHandle *> CursorRenderTexture;
PaletteHandle *CursorRenderPalette;
} SimCursor;
#define SDIERR_INVALIDPARAM "SDIERR_INVALIDPARAM"
#define SDIERR_OUTOFMEMORY "SDIERR_OUTOFMEMORY"
#define SDIERR_OLDDIRECTINPUTVERSION "SDIERR_OLDDIRECTINPUTVERSION"
#define SDIERR_BETADIRECTINPUTVERSION "SDIERR_BETADIRECTINPUTVERSION"
#define SDIERR_NOINTERFACE "SDIERR_NOINTERFACE"
#define SDIERR_DEVICENOTREG "SDIERR_DEVICENOTREG"
#define SDIERR_ACQUIRED "SDIERR_ACQUIRED"
#define SDIERR_HANDLEEXISTS "SDIERR_HANDLEEXISTS"
#define SDI_PROPNOEFFECT "SDI_PROPNOEFFECT"
#define SDIERR_OBJECTNOTFOUND "SDIERR_OBJECTNOTFOUND"
#define SDIERR_UNSUPPORTED "SDIERR_UNSUPPORTED"
#define SDIERR_OTHERAPPHASPRIO "SDIERR_OTHERAPPHASPRIO"
#define SSI_GENERAL "General SIM Input Error"
#define SSI_NO_DI_INIT "Unable to Create Direct Input Object, Cannot Continue"
#define SSI_NO_MOUSE_INIT "Unable to Initialize Mouse, Click OK to Continue without Mouse"
#define SSI_NO_JOYSTICK_INIT "Unable to Initialize Joystick, Click OK to Continue without Joystick"
#define SSI_NO_CURSOR_INIT "Unable to Load Cursors, Click OK to Continue without Cursors"
#define SSI_NO_KEYBOARD_INIT "Unable to Initialize Keyboard, Cannot Continue"
#define DINPUT_BUFFERSIZE 16
// #define DMOUSE_BUFFERSIZE 16 // Retro 15Feb2004 -aaaargh
#define DMOUSE_BUFFERSIZE 128 // Retro 15Feb2004 - minimum
#define DKEYBOARD_BUFFERSIZE 256
#define DJOYSTICK_BUFFERSIZE 16
#define SIM_MOUSE 0
#define SIM_KEYBOARD 1
#define SIM_JOYSTICK1 2
#define SIM_NUMDEVICES 16
#define SIMKEY_SHIFTED 256
#define LO_SENSITIVITY 0
#define NORM_SENSITIVITY 1
#define HI_SENSITIVITY 2
#define POV_N 0
#define POV_NE 4500
#define POV_E 9000
#define POV_SE 13500
#define POV_S 18000
#define POV_SW 22500
#define POV_W 27000
#define POV_NW 31500
#define POV_HALF_RANGE 2250
extern int gMouseSensitivity;
extern int gxFuzz;
extern int gyFuzz;
extern int gxPos;
extern int gyPos;
extern int gxLast;
extern int gyLast;
extern SimCursor* gpSimCursors;
extern int gTotalCursors;
#ifndef USE_DINPUT_8 // Retro 15Jan2004
extern LPDIRECTINPUT7 gpDIObject;
extern LPDIRECTINPUTDEVICE7 gpDIDevice[SIM_NUMDEVICES];
#else
extern LPDIRECTINPUT8 gpDIObject;
extern LPDIRECTINPUTDEVICE8 gpDIDevice[SIM_NUMDEVICES];
#endif
extern HANDLE gphDeviceEvent[SIM_NUMDEVICES];
extern BOOL gpDeviceAcquired[SIM_NUMDEVICES];
// sfr: no need for this, not used
//extern BOOL gWindowActive;
extern BOOL gOccupiedBySim;
extern ImageBuffer* gpSaveBuffer;
extern int gSelectedCursor;
extern BOOL gSimInputEnabled;
extern VU_TIME gTimeLastMouseMove;
extern VU_TIME gTimeLastCursorUpdate; //Wombat778 1-24-04
extern int gTotalJoy;
extern _TCHAR* gDIDevNames[SIM_NUMDEVICES - SIM_JOYSTICK1];
extern DIDEVCAPS gCurJoyCaps;
// Functions called by other modules
BOOL SetupDIJoystick(HINSTANCE hInst, HWND hWnd);
BOOL SetupDIMouseAndKeyboard(HINSTANCE, HWND);
BOOL CleanupDIJoystick(void);
BOOL CleanupDIMouseAndKeyboard(void);
// sfr: touch buddy support
/** stops hardware mouse processing of events */
void SimMouseStopProcessing();
/** resumes hardware mouse processing of events
* @param in x cursor x
* @param in y cursor y
*/
void SimMouseResumeProcessing(const int x, const int y);
// end touch buddy
void CleanupDIAll(void);
void InputCycle(void);
void NoInputCycle(void);
void GetJoystickInput(void);
float ReadThrottle(void);
// Functions used only used internaly by this module
BOOL SetupDIDevice(HWND, BOOL, int, REFGUID, LPCDIDATAFORMAT, DIPROPDWORD*);
BOOL CleanupDIDevice(int);
void OnSimKeyboardInput(void);
void OnSimMouseInput(HWND);
void ProcessJoyButtonAndPOVHat(void);
void AcquireDeviceInput(int, BOOL);
BOOL CheckDeviceAcquisition(int DeviceIndex);
BOOL CreateSimCursors(void);
void CleanupSimCursors(void);
void UpdateCursorPosition(DWORD, DWORD);
void ClipAndDrawCursor(int, int);
BOOL VerifyResult(HRESULT);
BOOL DIMessageBox(int, int, char*);
void JoystickReleaseEffects(void);
#endif
| {
"content_hash": "6f5f47374b25e5e9330a98b158e4221f",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 99,
"avg_line_length": 28.719298245614034,
"alnum_prop": 0.7914884952148239,
"repo_name": "GPUWorks/freefalcon-central",
"id": "ab7f47a0ab83e26a6d95d6e7ffdf902aec644ac4",
"size": "4911",
"binary": false,
"copies": "3",
"ref": "refs/heads/develop",
"path": "src/sim/include/sinput.h",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "C",
"bytes": "1967284"
},
{
"name": "C++",
"bytes": "23638853"
},
{
"name": "Objective-C",
"bytes": "242831"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using _3.FactoryMethod.Product;
namespace _3.FactoryMethod.Manufacturer
{
class LG : Manufacturer
{
public override GSM ManufactureGSM()
{
var phone = new G5 { BatteryLife = 3000, Width = 6 };
return phone;
}
}
}
| {
"content_hash": "117404d1075064bf0aa34d70c29c3718",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 65,
"avg_line_length": 21.72222222222222,
"alnum_prop": 0.6419437340153452,
"repo_name": "VVoev/Telerik-Academy",
"id": "6336a508cf3b69489a21d2d85909465298bcb276",
"size": "393",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "14.Design-Patterns/03. Creational-Design-Patterns/demos/DesignPatterns/3.FactoryMethod/Manufacturer/LG.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "100"
},
{
"name": "C#",
"bytes": "5055520"
},
{
"name": "C++",
"bytes": "6554"
},
{
"name": "CSS",
"bytes": "220628"
},
{
"name": "CoffeeScript",
"bytes": "1570"
},
{
"name": "HTML",
"bytes": "2116929"
},
{
"name": "Java",
"bytes": "186556"
},
{
"name": "JavaScript",
"bytes": "3798933"
},
{
"name": "PLSQL",
"bytes": "139427"
},
{
"name": "PLpgSQL",
"bytes": "1336296"
},
{
"name": "PowerShell",
"bytes": "468"
},
{
"name": "SQLPL",
"bytes": "7996"
},
{
"name": "Smalltalk",
"bytes": "5031"
},
{
"name": "TypeScript",
"bytes": "19610"
},
{
"name": "Visual Basic",
"bytes": "7346"
},
{
"name": "XSLT",
"bytes": "1343"
}
],
"symlink_target": ""
} |
namespace falconn {
namespace core {
class LSHFunctionError : public FalconnError {
public:
LSHFunctionError(const char* msg) : FalconnError(msg) {}
};
// Helper class that contains the actual per-query state of an LSH function
// object (the transformed input point, the temporary datat of the
// transformation, and the multiprobe object).
// The helper class also has functions for retrieving the probing sequence,
// either in a "lazy" probe-by-probe way or with a "batch" method for a fixed
// number of probes.
template <typename HashFunction>
class HashObjectQuery {
private:
typedef typename HashFunction::MultiProbeLookup MultiProbeLookup;
typedef typename HashFunction::TransformedVectorType TransformedVectorType;
typedef typename HashFunction::HashTransformation HashTransformation;
public:
typedef typename HashFunction::HashType HashType;
typedef typename HashFunction::VectorType VectorType;
class ProbingSequenceIterator
: public std::iterator<std::forward_iterator_tag,
std::pair<HashType, int_fast32_t>> {
public:
ProbingSequenceIterator(HashObjectQuery* parent = nullptr)
: parent_(parent) {
if (parent_ != nullptr) {
if (!parent_->multiprobe_.get_next_probe(&cur_val_.first,
&cur_val_.second)) {
parent_ = nullptr;
}
}
}
// TODO: should also check cur_val for general use?
bool operator==(const ProbingSequenceIterator& rhs) const {
return parent_ == rhs.parent_;
}
// TODO: should also check cur_val for general use?
bool operator!=(const ProbingSequenceIterator& rhs) const {
return parent_ != rhs.parent_;
}
typename std::iterator<std::forward_iterator_tag,
std::pair<HashType, int_fast32_t>>::reference
operator*() const {
return cur_val_;
}
typename std::iterator<std::forward_iterator_tag,
std::pair<HashType, int_fast32_t>>::pointer
operator->() {
return &cur_val_;
}
ProbingSequenceIterator& operator++() {
if (!parent_->multiprobe_.get_next_probe(&cur_val_.first,
&cur_val_.second)) {
parent_ = nullptr;
}
return *this;
}
private:
HashObjectQuery* parent_;
std::pair<HashType, int_fast32_t> cur_val_;
};
HashObjectQuery(const HashFunction& parent)
: parent_(parent), multiprobe_(parent), hash_transformation_(parent) {
parent_.reserve_transformed_vector_memory(&transformed_vector_);
}
std::pair<ProbingSequenceIterator, ProbingSequenceIterator>
get_probing_sequence(const VectorType& point) {
hash_transformation_.apply(point, &transformed_vector_);
multiprobe_.setup_probing(transformed_vector_, -1);
return std::make_pair(ProbingSequenceIterator(this),
ProbingSequenceIterator(nullptr));
}
void get_probes_by_table(const VectorType& point,
std::vector<std::vector<HashType>>* probes,
int_fast64_t num_probes) {
if (num_probes < parent_.l_) {
throw LSHFunctionError(
"Number of probes must be at least "
"the number of tables.");
}
if (static_cast<int_fast64_t>(probes->size()) != parent_.l_) {
probes->resize(parent_.l_);
}
for (size_t ii = 0; ii < probes->size(); ++ii) {
(*probes)[ii].clear();
}
hash_transformation_.apply(point, &transformed_vector_);
multiprobe_.setup_probing(transformed_vector_, num_probes);
int_fast32_t cur_table;
HashType cur_probe;
for (int_fast64_t ii = 0; ii < num_probes; ++ii) {
if (!multiprobe_.get_next_probe(&cur_probe, &cur_table)) {
break;
}
// printf("%u %d\n", cur_probe, cur_table);
(*probes)[cur_table].push_back(cur_probe);
}
}
private:
const HashFunction& parent_;
MultiProbeLookup multiprobe_;
HashTransformation hash_transformation_;
TransformedVectorType transformed_vector_;
};
} // namespace core
} // namespace falconn
#endif
| {
"content_hash": "091511ccb882214de7153a5a71fdb99e",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 77,
"avg_line_length": 32.40625,
"alnum_prop": 0.6345226615236258,
"repo_name": "besser82/shogun",
"id": "d2e6780f948dc20174aa451c346bc268d734fe83",
"size": "4251",
"binary": false,
"copies": "22",
"ref": "refs/heads/develop",
"path": "src/shogun/lib/external/falconn/core/lsh_function_helpers.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "64"
},
{
"name": "Batchfile",
"bytes": "615"
},
{
"name": "C",
"bytes": "12178"
},
{
"name": "C++",
"bytes": "10261995"
},
{
"name": "CMake",
"bytes": "193647"
},
{
"name": "Dockerfile",
"bytes": "2046"
},
{
"name": "GDB",
"bytes": "89"
},
{
"name": "HTML",
"bytes": "2060"
},
{
"name": "MATLAB",
"bytes": "8755"
},
{
"name": "Makefile",
"bytes": "244"
},
{
"name": "Python",
"bytes": "286724"
},
{
"name": "SWIG",
"bytes": "385845"
},
{
"name": "Shell",
"bytes": "7267"
}
],
"symlink_target": ""
} |
from flask_wtf import FlaskForm
from wtforms import StringField, BooleanField, PasswordField, TextAreaField
from wtforms.validators import DataRequired, EqualTo, Length
class LoginForm(FlaskForm):
username = StringField('Username', validators=[DataRequired()])
password = PasswordField('Password', validators=[DataRequired()])
remember_me = BooleanField('remember_me', default=False)
class SignupForm(FlaskForm):
email = StringField('Email', validators=[DataRequired()])
password = PasswordField('Password', validators=[DataRequired(), EqualTo('confirm', 'Passwords must match')])
confirm = PasswordField('Repeat Password')
class EditProfileForm(FlaskForm):
username = StringField('Username', validators=[DataRequired()])
bio = TextAreaField('bio', validators=[Length(min=0, max=140)])
| {
"content_hash": "97423f13ee45afa49f92e71bfd1583bf",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 113,
"avg_line_length": 46.27777777777778,
"alnum_prop": 0.7430972388955582,
"repo_name": "thebigbadlonewolf/friendconnect",
"id": "070ed6033be5a2ff7b357cab84ee0bb91f1a0dd9",
"size": "833",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/forms.py",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "CSS",
"bytes": "2324"
},
{
"name": "HTML",
"bytes": "11708"
},
{
"name": "Python",
"bytes": "9302"
}
],
"symlink_target": ""
} |
import Modal from 'flarum/components/Modal';
import Button from 'flarum/components/Button';
export default class FlagPostModal extends Modal {
init() {
super.init();
this.success = false;
this.reason = m.prop('');
this.reasonDetail = m.prop('');
}
className() {
return 'FlagPostModal Modal--small';
}
title() {
return app.translator.trans('flarum-flags.forum.flag_post.title');
}
content() {
if (this.success) {
return (
<div className="Modal-body">
<div className="Form Form--centered">
<p className="helpText">{app.translator.trans('flarum-flags.forum.flag_post.confirmation_message')}</p>
<div className="Form-group">
<Button className="Button Button--primary Button--block" onclick={this.hide.bind(this)}>
{app.translator.trans('flarum-flags.forum.flag_post.dismiss_button')}
</Button>
</div>
</div>
</div>
);
}
const guidelinesUrl = app.forum.attribute('guidelinesUrl');
return (
<div className="Modal-body">
<div className="Form Form--centered">
<div className="Form-group">
<div>
<label className="checkbox">
<input type="radio" name="reason" checked={this.reason() === 'off_topic'} value="off_topic" onclick={m.withAttr('value', this.reason)}/>
<strong>{app.translator.trans('flarum-flags.forum.flag_post.reason_off_topic_label')}</strong>
{app.translator.trans('flarum-flags.forum.flag_post.reason_off_topic_text')}
</label>
<label className="checkbox">
<input type="radio" name="reason" checked={this.reason() === 'inappropriate'} value="inappropriate" onclick={m.withAttr('value', this.reason)}/>
<strong>{app.translator.trans('flarum-flags.forum.flag_post.reason_inappropriate_label')}</strong>
{app.translator.trans('flarum-flags.forum.flag_post.reason_inappropriate_text', {
a: guidelinesUrl ? <a href={guidelinesUrl} target="_blank"/> : undefined
})}
</label>
<label className="checkbox">
<input type="radio" name="reason" checked={this.reason() === 'spam'} value="spam" onclick={m.withAttr('value', this.reason)}/>
<strong>{app.translator.trans('flarum-flags.forum.flag_post.reason_spam_label')}</strong>
{app.translator.trans('flarum-flags.forum.flag_post.reason_spam_text')}
</label>
<label className="checkbox">
<input type="radio" name="reason" checked={this.reason() === 'other'} value="other" onclick={m.withAttr('value', this.reason)}/>
<strong>{app.translator.trans('flarum-flags.forum.flag_post.reason_other_label')}</strong>
{this.reason() === 'other' ? (
<textarea className="FormControl" value={this.reasonDetail()} oninput={m.withAttr('value', this.reasonDetail)}></textarea>
) : ''}
</label>
</div>
</div>
<div className="Form-group">
<Button
className="Button Button--primary Button--block"
type="submit"
loading={this.loading}
disabled={!this.reason()}>
{app.translator.trans('flarum-flags.forum.flag_post.submit_button')}
</Button>
</div>
</div>
</div>
);
}
onsubmit(e) {
e.preventDefault();
this.loading = true;
app.store.createRecord('flags').save({
reason: this.reason() === 'other' ? null : this.reason(),
reasonDetail: this.reasonDetail(),
relationships: {
user: app.session.user,
post: this.props.post
}
})
.then(() => this.success = true)
.catch(() => {})
.then(this.loaded.bind(this));
}
}
| {
"content_hash": "f642d58421bb8ca7c760c61879d78ef1",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 160,
"avg_line_length": 37.45283018867924,
"alnum_prop": 0.5639798488664988,
"repo_name": "azarro/flarum",
"id": "9921a54a26239984fcca3a45c14d156068fac432",
"size": "3970",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "vendor/flarum/flarum-ext-flags/js/forum/src/components/FlagPostModal.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "1336"
},
{
"name": "Shell",
"bytes": "3396"
}
],
"symlink_target": ""
} |
package iso20022
// Specifies whether the status is provided with a reason or not.
type RejectionStatus8Choice struct {
// Indicates that there is no reason available or to report.
NoSpecifiedReason *NoReasonCode `xml:"NoSpcfdRsn"`
// Specifies the reason of the RejectionStatus.
Reason []*RejectionReason11 `xml:"Rsn"`
}
func (r *RejectionStatus8Choice) SetNoSpecifiedReason(value string) {
r.NoSpecifiedReason = (*NoReasonCode)(&value)
}
func (r *RejectionStatus8Choice) AddReason() *RejectionReason11 {
newValue := new(RejectionReason11)
r.Reason = append(r.Reason, newValue)
return newValue
}
| {
"content_hash": "5d0f352319302b4770fa2f0adaff3e86",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 69,
"avg_line_length": 29.047619047619047,
"alnum_prop": 0.7704918032786885,
"repo_name": "fgrid/iso20022",
"id": "f81e89f52a1bae909a37e4e7cd6edf65a3b57688",
"size": "610",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "RejectionStatus8Choice.go",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Go",
"bytes": "21383920"
}
],
"symlink_target": ""
} |
if (ej.Autocomplete) ej.Autocomplete.Locale["ru-RU"] = {
addNewText: "Добавить новый",
emptyResultText: "Нет предложений",
actionFailure: "Указанное поле не существует в данном источнике данных",
watermarkText: " "
};
if (ej.ColorPicker) ej.ColorPicker.Locale["ru-RU"] = {
buttonText: {
apply: "Подать заявление",
cancel: "Отмена",
swatches: "Swatches"
},
tooltipText: {
switcher: "Switcher",
addbutton: "Добавить цвет",
basic: "базовый",
monochrome: "Монохромный",
flatcolors: "плоская печать",
seawolf: "Морской волк",
webcolors: "веб-Цвета",
sandy: "Сэнди",
pinkshades: "Розовые Оттенки",
misty: "туманный",
citrus: "Цитрусовые",
vintage: "марочный",
moonlight: "Лунный свет",
candycrush: "Конфеты Давка",
currentcolor: "Текущий цвет",
selectedcolor: "Выбранный цвет"
},
};
if (ej.CurrencyTextbox) ej.CurrencyTextbox.Locale["ru-RU"] = {
watermarkText: "Введите значение",
};
if (ej.DatePicker) ej.DatePicker.Locale["ru-RU"] = {
watermarkText: "Выбрать дату",
buttonText: "сегодня",
};
if (ej.DateRangePicker) ej.DateRangePicker.Locale["ru-RU"] = {
ButtonText: {
apply: "Подать заявление",
cancel: "Отмена",
reset: "Сброс"
},
watermarkText: "Выбор диапазона",
customPicker: "Пользовательские Picker",
};
if (ej.DateTimePicker) ej.DateTimePicker.Locale["ru-RU"] = {
watermarkText: "Выбор даты и времени",
buttonText: {
today: "сегодня",
timeNow: "Время сейчас",
done: "сделано",
timeTitle: "время"
},
};
if (ej.datavisualization && ej.datavisualization.Diagram) ej.datavisualization.Diagram.Locale["ru-RU"] = {
cut: "порез",
copy: "копия",
paste: "паста",
undo: "расстегивать",
redo: "переделывать",
selectAll: "Выбрать все",
grouping: "группировка",
group: "группа",
ungroup: "Разгруппировать",
order: "порядок",
bringToFront: "BringToFront",
moveForward: "двигаться вперед",
sendBackward: "Отправить назад",
sendToBack: "SendToBack",
};
if (ej.Dialog) ej.Dialog.Locale["ru-RU"] = {
tooltip: {
close: "близко",
collapse: "коллапс",
restore: "восстановление",
maximize: "максимизировать",
minimize: "минимизировать",
expand: "расширять",
unPin: "откалывать",
pin: "штифт"
},
closeIconTooltip: "близко",
};
if (ej.DropDownList) ej.DropDownList.Locale["ru-RU"] = {
emptyResultText: "Нет предложений,",
watermarkText: " ",
};
if (ej.ExcelFilter) ej.ExcelFilter.Locale["ru-RU"] = {
SortNoSmaller: "Сортировка меньших к большим",
SortNoLarger: "Сортировка большего к меньшему",
SortTextAscending: "Сортировать от А до Z",
SortTextDescending: "Сортировать от Я до А",
SortDateOldest: "Сортировка по возрастанию",
SortDateNewest: "Сортировка по самым новым",
SortByColor: "Сортировать по Цвет",
SortByCellColor: "Сортировка по Cell Color",
SortByFontColor: "Сортировка по Цвет шрифта",
FilterByColor: "Фильтровать по Цвет",
CustomSort: "Пользовательские Сортировать",
FilterByCellColor: "Фильтр по Cell Color",
FilterByFontColor: "Фильтр по Цвет шрифта",
ClearFilter: "Очистить фильтр",
NumberFilter: "Количество Фильтры",
GuidFilter: "гуд Фильтры",
TextFilter: "Текстовые фильтры",
DateFilter: "Дата Фильтры",
DateTimeFilter: "Дата Время Фильтры",
SelectAll: "Выбрать все",
Blanks: "Пробелы",
Search: "Поиск",
Showrowswhere: "Показать строки, где",
NumericTextboxWaterMark: "Введите значение",
StringMenuOptions: [{ text: "равным", value: "equal" }, { text: "Не равно", value: "notequal" }, { text: "Начинается с", value: "startswith" }, { text: "Окончание С", value: "endswith" }, { text: "Содержит", value: "contains" }, { text: "Пользовательский фильтр", value: "customfilter" }, ],
NumberMenuOptions: [{ text: "равным", value: "equal" }, { text: "Не равно", value: "notequal" }, { text: "Меньше", value: "lessthan" }, { text: "Меньше или равно", value: "lessthanorequal" }, { text: "Больше чем", value: "greaterthan" }, { text: "Больше или равно", value: "greaterthanorequal" }, { text: "между", value: "between" }, { text: "Пользовательский фильтр", value: "customfilter" }, ],
GuidMenuOptions: [{ text: "равным", value: "equal" }, { text: "Не равно", value: "notequal" }, { text: "Пользовательский фильтр", value: "customfilter" }, ],
DateMenuOptions: [{ text: "равным", value: "equal" }, { text: "Не равно", value: "notequal" }, { text: "Меньше", value: "lessthan" }, { text: "Меньше или равно", value: "lessthanorequal" }, { text: "Больше чем", value: "greaterthan" }, { text: "Больше или равно", value: "greaterthanorequal" }, { text: "между", value: "between" }, { text: "Пользовательский фильтр", value: "customfilter" }, ],
DatetimeMenuOptions: [{ text: "равным", value: "equal" }, { text: "Не равно", value: "notequal" }, { text: "Меньше", value: "lessthan" }, { text: "Меньше или равно", value: "lessthanorequal" }, { text: "Больше чем", value: "greaterthan" }, { text: "Больше или равно", value: "greaterthanorequal" }, { text: "между", value: "between" }, { text: "Пользовательский фильтр", value: "customfilter" }, ],
Top10MenuOptions: [{ text: "топ", value: "top" }, { text: "дно", value: "bottom" }, ],
title: "Пользовательский фильтр",
PredicateAnd: "И",
PredicateOr: "ИЛИ",
Ok: "хорошо",
MatchCase: "Учитывать регистр",
Cancel: "отменить",
NoResult: "Ничего не найдено",
CheckBoxStatusMsg: "Не все пункты показывают",
DatePickerWaterMark: "Выбрать дату",
DateTimePickerWaterMark: "Выбор даты и времени",
True: "правда",
False: "ложный",
};
if (ej.FileExplorer) ej.FileExplorer.Locale["ru-RU"] = {
EmptyFolder: "Эта папка пуста",
ProtectedFolder: "В настоящее время вы не имеете доступа к этой папке",
EmptyResult: "Нет ничего вашему запросу",
ContextMenuSortBy: "Сортировать по",
InvalidFileName: "Имя файла не может содержать любой из следующих символов: \\ /: * \ <> |",
Selected: "выбранный",
Permission: "разрешение",
SortBy: "Сортировать по",
Back: "назад",
Forward: "вперед",
Upward: "вверх",
Refresh: "обновление",
Addressbar: "Адресная строка",
Upload: "Загрузить",
Rename: "переименовать",
Delete: "удалять",
Download: "скачать",
Error: "ошибка",
Cut: "порез",
Copy: "копия",
Paste: "паста",
Details: "подробности",
Searchbar: "Строка поиска",
Open: "открытым",
Search: "поиск",
NewFolder: "Новая папка",
Size: "размер",
RenameAlert: "Пожалуйста, введите новое имя",
NewFolderAlert: "Пожалуйста, введите имя новой папки,",
ContextMenuOpen: "открытым",
ContextMenuNewFolder: "Новая папка",
ContextMenuDelete: "удалять",
ContextMenuRename: "переименовать",
ContextMenuUpload: "Загрузить",
ContextMenuDownload: "скачать",
ContextMenuCut: "порез",
ContextMenuCopy: "копия",
ContextMenuPaste: "паста",
ContextMenuGetinfo: "Получить информацию",
ContextMenuRefresh: "обновление",
ContextMenuOpenFolderLocation: "Открытое местоположение папки",
Item: "пункт",
Items: "предметы",
GeneralError: "См браузер окно консоли для получения дополнительной информации",
DeleteFolder: "Вы уверены, что хотите удалить",
CancelPasteAction: "Папка является вложенной папки источника.",
OkButton: "хорошо",
CancelButton: "отменить",
YesToAllButton: "Да для всех",
NoToAllButton: "Нет для всех",
YesButton: "да",
NoButton: "нет",
SkipButton: "пропускать",
Grid: "вид в виде таблицы",
Tile: "вид плитка",
LargeIcons: "Большие иконки",
Name: "имя",
Location: "расположение",
Type: "Тип товара",
Layout: "макет",
Created: "созданный",
Accessed: "Доступ",
Modified: "модифицированный",
DialogCloseToolTip: "близко",
UploadSettings: {
buttonText: {
upload: "Загрузить",
browse: "Просматривать",
cancel: "Отмена",
close: "Закрыть"
},
dialogText: {
title: "Загрузить Box",
name: "имя",
size: "Размер",
status: "Положение дел"
},
dropAreaText: "Перетащите файлы или нажмите, чтобы загрузить",
filedetail: "Выбранный размер файла слишком велик. Выберите файл в рамках допустимого размера.",
denyError: "Файлы с расширениями #Extension не допускаются.",
allowError: "Только файлы с расширениями #Extension допускается.",
cancelToolTip: "отменить",
removeToolTip: "удалять",
retryToolTip: "Повторить",
completedToolTip: "Завершено",
failedToolTip: "Не удалось",
closeToolTip: "близко"
},
};
if (ej.Gantt) ej.Gantt.Locale["ru-RU"] = {
emptyRecord: "Нет записей для отображения",
alertTexts: {
indentAlert: "Там нет Ганта запись выделяется для выполнения отступ",
outdentAlert: "Там нет Ганта запись выделяется для выполнения Outdent",
predecessorEditingValidationAlert: "Циклическая зависимость произошло, пожалуйста, проверьте Предшественник",
predecessorAddingValidationAlert: "Заполните все столбцы в таблице предшественника",
idValidationAlert: "Дубликат ID",
dateValidationAlert: "Неправильная дата завершения",
dialogResourceAlert: "Заполните все столбцы в таблице ресурсов"
},
columnHeaderTexts: {
taskId: "ID",
taskName: "Имя задачи",
startDate: "Дата начала",
endDate: "Конечная дата",
resourceInfo: "ресурсы",
duration: "продолжительность",
status: "прогресс",
predecessor: "Предшественники",
type: "тип",
offset: "смещение",
baselineStartDate: "Базовый дата начала",
baselineEndDate: "Базовый Окончание",
WBS: "WBS",
WBSpredecessor: "WBS Предшественник",
dialogCustomFieldName: "Имя столбца",
dialogCustomFieldValue: "Стоимость",
notes: "Заметки",
taskType: "Тип задачи",
work: "Работа",
unit: "Ед. изм",
effortDriven: "усилия приводом"
},
editDialogTexts: {
addFormTitle: "Новая задача",
editFormTitle: "Редактирование задачи",
saveButton: "Сохранить",
deleteButton: "удалять",
cancelButton: "отменить",
addPredecessor: "Добавить новый",
removePredecessor: "удалять"
},
columnDialogTexts: {
field: "поле",
headerText: "Текст заголовка",
editType: "Изменить тип",
filterEditType: "Фильтр Изменить тип",
allowFiltering: "Разрешить фильтрацию",
allowFilteringBlankContent: "Разрешить фильтрацию пустой Содержимое",
allowSorting: "Разрешить сортировка",
visible: "видимый",
width: "Ширина",
textAlign: "Выравнивание текста",
headerTextAlign: "Заголовок Выравнивание текста",
columnsDropdownData: "Колонка выпадающим данных",
dropdownTableText: "Текст",
dropdownTableValue: "Стоимость",
addData: "Добавить",
deleteData: "Удалить",
allowCellSelection: "Разрешить выбор ячеек"
},
toolboxTooltipTexts: {
addTool: "добавлять",
editTool: "редактировать",
saveTool: "обновление",
deleteTool: "удалять",
cancelTool: "отменить",
searchTool: "поиск",
indentTool: "отступ",
outdentTool: "Выступ",
expandAllTool: "Развернуть все",
collapseAllTool: "Свернуть все",
nextTimeSpanTool: "Следующая промежутка времени",
prevTimeSpanTool: "Предыдущая промежутка времени",
criticalPathTool: "Критический путь",
excelExportTool: "Excel Экспорт"
},
durationUnitTexts: {
days: "дней",
hours: "часов",
minutes: "минут",
day: "день",
hour: "час",
minute: "минут"
},
durationUnitEditText: {
minute: ["м", "мин", "минут", "минут"],
hour: ["час", "час", "час", "часов"],
day: ["d", "ду", "день", "дней"]
},
workUnitTexts: {
days: "дней",
hours: "часов",
minutes: "минут"
},
taskTypeTexts: {
fixedWork: "Исправлена работа",
fixedUnit: "Фиксированные Единицы измерения",
fixedDuration: "Фиксированная продолжительность"
},
effortDrivenTexts: {
yes: "да",
no: "Нет"
},
contextMenuTexts: {
taskDetailsText: "Задача Сведения ...",
addNewTaskText: "Новая задача",
indentText: "отступ",
outdentText: "Выступ",
deleteText: "удалять",
aboveText: "выше",
belowText: "ниже"
},
newTaskTexts: {
newTaskName: "Новая задача"
},
columnMenuTexts: {
sortAscendingText: "По возрастанию",
sortDescendingText: "Сортировка по убыванию",
columnsText: "Колонны",
insertColumnLeft: "Вставить столбец слева",
insertColumnRight: "Вставить столбец справа",
deleteColumn: "Удалить столбец",
renameColumn: "Переименовать столбец"
},
taskModeTexts: {
manual: "Руководство",
auto: "Авто"
},
columnDialogTitle: {
insertColumn: "Вставить столбец",
deleteColumn: "Удалить столбец",
renameColumn: "Переименовать столбец"
},
deleteColumnText: "Вы уверены, что хотите удалить этот столбец?",
okButtonText: "ОК",
cancelButtonText: "Отмена",
confirmDeleteText: "Подтвердите удаление",
predecessorEditingTexts: {
fromText: "от",
toText: "к"
}, dialogTabTitleTexts: {
generalTabText: "Генеральная",
predecessorsTabText: "Предшественники",
resourcesTabText: "Ресурсы",
customFieldsTabText: "Настраиваемые поля",
notesTabText: "Заметки"
},
predecessorCollectionText: [
{ id: "SS", text: "Начало-Начало", value: "Начало-Начало" },
{ id: "SF", text: "Начало-Конец", value: "Начало-Конец" },
{ id: "FS", text: "Конец-Начало", value: "Конец-Начало" },
{ id: "FF", text: "Конец-Конец", value: "Конец-Конец" }
],
};
if (ej.Grid) ej.Grid.Locale["ru-RU"] = {
EmptyRecord: "Нет записей для отображения",
GroupDropArea: "Перетащите сюда заголовок колонки для группировки его колонке",
DeleteOperationAlert: "Нет записей, выбранные для операции удаления",
EditOperationAlert: "Нет записей, выбранные для операции редактирования",
SaveButton: "Сохранить",
OkButton: "хорошо",
CancelButton: "отменить",
EditFormTitle: "Подробная информация о",
AddFormTitle: "Добавить запись",
Notactionkeyalert: "Этот ключ-комбинация не доступна",
Keyconfigalerttext: "Этот ключ-Комбинация уже назначены",
GroupCaptionFormat: "{{:headerText}}: {{:key}} - {{:count}} {{if count == 1 }} пункт {{else}} Предметы {{/if}} ",
BatchSaveConfirm: "Вы уверены, что хотите сохранить изменения?",
BatchSaveLostChanges: "Несохраненные изменения будут потеряны. Вы уверены, что хотите продолжить?",
ConfirmDelete: "Вы уверены, что хотите удалить запись?",
CancelEdit: "Вы уверены, что хотите отменить изменения?",
PagerInfo: "{0} {1} страниц ({2} элементов)",
FrozenColumnsViewAlert: "Закрепленные столбцы должны быть в GridView области",
FrozenColumnsScrollAlert: "Включить обеспечения прокрутки при использовании замороженных Колонны",
FrozenNotSupportedException: "Замороженные столбцы и строки не поддерживаются для группировки, Row Шаблон, подробно Шаблон, иерархия сетке и пакетного редактирования",
Add: "добавлять",
Edit: "редактировать",
Delete: "удалять",
Update: "обновление",
Cancel: "отменить",
Done: "сделано",
Columns: "Колонны",
SelectAll: "(Выбрать все)",
PrintGrid: "печать",
ExcelExport: "Excel Экспорт",
WordExport: "Слово Экспорт",
PdfExport: "Экспорт в PDF",
StringMenuOptions: [{ text: "Начинается с", value: "Starts With" }, { text: "Окончание: С", value: "Ends With" }, { text: "Содержит", value: "Contains" }, { text: "равным", value: "Equal" }, { text: "Не равно", value: "NotEqual" }, ],
NumberMenuOptions: [{ text: "Меньше", value: "LessThan" }, { text: "Больше чем", value: "GreaterThan" }, { text: "Меньше или равно", value: "LessThanOrEqual" }, { text: "Больше или равно", value: "GreaterThanOrEqual" }, { text: "равным", value: "Equal" }, { text: "Не равно", value: "NotEqual" }, ],
PredicateAnd: "И",
PredicateOr: "ИЛИ",
Filter: "фильтр",
FilterMenuCaption: "Фильтр Значение",
FilterbarTitle: "ы бар клетки фильтр",
MatchCase: "Учитывать регистр",
Clear: "ясно",
ResponsiveFilter: "фильтр",
ResponsiveSorting: "сортировать",
Search: "поиск",
DatePickerWaterMark: "Выбрать дату",
EmptyDataSource: "DataSource не должно быть пустым при первоначальном нагрузки, поскольку столбцы генерируются из источника данных в автогенерируемые Сетка колонн",
ForeignKeyAlert: "Обновленное значение должно быть допустимым значение внешнего ключа",
True: "правда",
False: "ложный",
UnGroup: "Нажмите здесь, чтобы отменить группировку",
AddRecord: "Добавить запись",
EditRecord: "Редактировать запись",
DeleteRecord: "Удалить запись",
Save: "Сохранить",
Grouping: "группа",
Ungrouping: "Разгруппировать",
SortInAscendingOrder: "Сортировка в порядке возрастания",
SortInDescendingOrder: "Сортировка по убыванию",
NextPage: "Следующая страница",
PreviousPage: "Предыдущая страница",
FirstPage: "Первая страница",
LastPage: "Предыдущая страница",
EmptyRowValidationMessage: "По крайней мере одно поле должно быть обновлено",
NoResult: "Совпадений не найдено"
};
;
if (ej.mobile !== undefined && ej.mobile.Grid !== undefined) {
ej.mobile.Grid.Locale["ru-RU"] = {
emptyResult: "Нет записей для отображения",
filterValidation: "Введите достоверные данные фильтра",
filterTypeValidation: "Введите действительные данные фильтра. Текущий столбец фильтра имеет тип",
captionText: "Предметы",
spinnerText: "загрузка ...",
HideColumnAlert: "По крайней мере один столбец должен отображаться в сетке",
columnSelectorText: "Скрыть столбец",
columnSelectorDone: "ОК",
columnSelectorCancel: "Отмена",
columnSelectorWarning: "Предупреждение",
filterOk: "ОК",
filterWarning: "Предупреждение"
};
;
}
if (ej.mobile !== undefined && ej.mobile.DatePicker !== undefined) {
ej.mobile.DatePicker.Locale["ru-RU"] = {
confirmText: "сделано",
Windows: {
cancelText: "отменить",
headerText: "Выберите дату",
toolbarConfirmText: "сделано",
toolbarCancelText: "близко"
},
};
;
}
if (ej.mobile !== undefined && ej.mobile.TimePicker !== undefined) {
ej.mobile.TimePicker.Locale["ru-RU"] = {
confirmText: "сделано",
AM: "А.М.",
PM: "PM",
Android: {
headerText: "Установить время"
},
Windows: {
cancelText: "отменить",
headerText: "Выбрать часовой",
toolbarCancelText: "близко",
toolbarConfirmText: "сделано"
},
};
;
}
if (ej.NumericTextbox) ej.NumericTextbox.Locale["ru-RU"] = {
watermarkText: "Введите значение",
};
if (ej.PivotChart) ej.PivotChart.Locale["ru-RU"] = {
Measure: "Мера",
Row: "строка",
Column: "колонка",
Expand: "расширять",
Collapse: "коллапс",
Exit: "выход",
Value: "Значение",
ChartTypes: "Типы диаграмм",
TDCharts: "3D-графики",
Tooltip: "Всплывающая подсказка",
Exporting: "Экспорт",
Line: "линия",
Spline: "сплайн",
Area: "площадь",
SplineArea: "сплайн Площадь",
StepLine: "Шаг линия",
StepArea: "Шаг уголок",
Pie: "пирог",
Bar: "бар",
StackingArea: "Укладка Площадь",
StackingColumn: "Укладка Колонка",
StackingBar: "Укладка Бар",
Pyramid: "пирамида",
Funnel: "воронка",
Doughnut: "пончик",
Scatter: "разброс",
Bubble: "Прозрачный купол",
TreeMap: "Дерево карты",
ColumnTD: "колонка 3D",
PieTD: "пирог 3D",
BarTD: "бар 3D",
StackingBarTD: "Укладка Бар 3D",
StackingColumnTD: "Укладка Колонка 3D",
Excel: "Excel",
Word: "Слово",
Pdf: "PDF",
PNG: "PNG",
EMF: "EMF",
GIF: "GIF",
JPG: "JPG",
BMF: "BMF"
};
if (ej.PivotClient) ej.PivotClient.Locale["ru-RU"] = {
DoesNotBeginsWith: "Не начинается с",
DoesNotEndsWith: "Не заканчивается на",
DoesNotContains: "Не содержит",
DoesNotEquals: "Не равняется",
IsGreaterThan: "Больше чем",
IsGreaterThanOrEqualTo: "Больше или равно",
IsLessThan: "Меньше",
IsLessThanOrEqualTo: "Меньше или равно",
DeferUpdate: "Отложить обновление",
MDXQuery: "MDX запросов",
Column: "колонка",
Row: "строка",
Slicer: "Тесак",
CubeSelector: "Куб Selector",
ReportName: "Имя отчета",
NewReport: "Новый отчет",
CubeDimensionBrowser: "Куб Размер Браузер",
AddReport: "Добавить отчет",
RemoveReport: "Удалить отчет",
CannotRemoveSingleReport: "Невозможно удалить один отчет,",
AreYouSureToDeleteTheReport: "Вы действительно хотите удалить отчет",
RenameReport: "Переименовать отчет",
ChartTypes: "Типы диаграмм",
ToggleAxis: "Переключить оси",
ExportToExcel: "Экспорт в Excel",
ExportToWord: "Экспорт в Слово",
ExportToPdf: "Экспорт в PDF",
FullScreen: "Полный экран",
Grid: "сетка",
Chart: "график",
OK: "хорошо",
Cancel: "отменить",
MeasureEditor: "Измерьте редактор",
MemberEditor: "Редактор член",
Measures: "меры",
SortOrFilterColumn: "Сортировка / Фильтр (колонка)",
SortOrFilterRow: "Сортировка / Фильтр (строка)",
SortingAndFiltering: "Сортировка и фильтрация",
Sorting: "сортировка",
Measure: "Измерьте",
Order: "порядок",
Filtering: "фильтрация",
Condition: "Состояние",
PreserveHierarchy: "Сохранения иерархии",
Ascending: "По возрастанию",
Descending: "По убыванию",
Enable: "Включить",
Disable: "Отключение",
and: "И",
Line: "линия",
Spline: "сплайн",
Area: "площадь",
SplineArea: "сплайн Площадь",
StepLine: "Шаг линия",
StepArea: "Шаг уголок",
Pie: "пирог",
Bar: "бар",
StackingArea: "Укладка Площадь",
StackingColumn: "Укладка Колонка",
StackingBar: "Укладка Бар",
Pyramid: "пирамида",
Funnel: "воронка",
Doughnut: "пончик",
Scatter: "разброс",
Sort: "Порядок сортировки",
SelectField: "Выберите поле",
LabelFilterLabel: "Показать элементы, для которых наклейка",
ValueFilterLabel: "Показать элементы, для которых",
LabelFilters: "Метка фильтры",
BeginsWith: "Начинается с",
NotBeginsWith: "Не начинается с",
EndsWith: "Заканчивается на",
NotEndsWith: "Не заканчивается на",
Contains: "Содержит",
NotContains: "Не содержит",
ValueFilters: "Значение фильтры",
ClearFilter: "Очистить фильтр",
Equals: "Равно",
NotEquals: "Не равняется",
GreaterThan: "Больше чем",
GreaterThanOrEqualTo: "Больше или равно",
LessThan: "Меньше",
LessThanOrEqualTo: "Меньше или равно",
Between: "Между",
NotBetween: "Не между",
Top10: "Верхний счетчик",
Close: "Закрыть",
AddToColumn: "Добавить в колонку",
AddToRow: "Добавить в строку",
AddToSlicer: "Добавить в резательное оборудование",
Value: "Значение",
EqualTo: "Равно",
ReportList: "Список отчетов",
Bubble: "Прозрачный купол",
TreeMap: "Дерево карты",
Alert: "Оповещение",
MDXAlertMsg: "Добавьте измерьте размер или иерархии в соответствующей оси для просмотра MDX запроса.",
FilterSortRowAlertMsg: "Размер не найдено в строке оси. Добавьте размер элемента в строке оси для сортировки и фильтрации.",
FilterSortColumnAlertMsg: "Размер не найден в столбце оси. Добавьте размер элемент в колонке оси для сортировки и фильтрации.",
FilterSortcolMeasureAlertMsg: "Добавьте измерения на рулевой колонке оси",
FilterSortrowMeasureAlertMsg: "Добавьте измерения на оси заднего ряда цилиндров",
FilterSortElementAlertMsg: "Элемент не найден в столбце оси. Просьба добавить элемент в колонке оси для сортировки и фильтрации.",
FilterMeasureSelectionAlertMsg: "Выберите действительный мерой.",
FilterConditionAlertMsg: "Укажите действительное состояние.",
FilterStartValueAlertMsg: "Задайте начальное значение.",
FilterEndValueAlertMsg: "Задайте конечного значения.",
FilterInvalidAlertMsg: "Неверная операция !",
SelectRecordAlertMsg: "Выберите действительную запись.",
RecordName: "Имя записи",
RemoveRecord: "Удалить запись",
RenameRecord: "Переименовать запись",
Load: "Загрузить",
Remove: "Снимите",
Save: "Сохранить",
SaveAs: "Сохранить как",
SelectRecord: "Выберите запись",
SelectReport: "Выберите отчет",
DBReport: "Доклад манипуляции в Дб",
Rename: "Переименовать",
Remove: "Снимите",
SetRecordNameAlertMsg: "Задайте имя записи.",
SetReportNameAlertMsg: "Задайте имя отчета.",
Search: "Поиск"
};
if (ej.PivotGauge) ej.PivotGauge.Locale["ru-RU"] = {
RevenueGoal: "Выручка Гол",
RevenueValue: "Доход Значение",
};
if (ej.Pager) ej.Pager.Locale["ru-RU"] = {
pagerInfo: "{0} {1} страниц ({2} элементов)",
firstPageTooltip: "Перейти к первой странице",
lastPageTooltip: "Перейти к последней странице",
nextPageTooltip: "Перейти к следующей странице",
previousPageTooltip: "Перейти к предыдущей странице",
nextPagerTooltip: "Перейти к следующей странице",
previousPagerTooltip: "Перейти к предыдущей странице",
};
if (ej.PdfViewer) ej.PdfViewer.Locale["ru-RU"] = {
toolbar: {
print: {
headerText: "печать",
contentText: "Печать документа PDF."
},
first: {
headerText: "первый",
contentText: "Перейти к первой странице PDF документа."
},
previous: {
headerText: "предыдущий",
contentText: "Перейти к предыдущей странице PDF документа."
},
next: {
headerText: "следующий",
contentText: "Перейти к следующей странице PDF документа."
},
last: {
headerText: "последний",
contentText: "Перейти к последней странице PDF документа."
},
zoomIn: {
headerText: "Zoom-В",
contentText: "Увеличение в PDF документе."
},
zoomOut: {
headerText: "Zoom-Out",
contentText: "Увеличить из PDF документа."
},
pageIndex: {
headerText: "Номер страницы",
contentText: "Номер текущей страницы для просмотра."
},
zoom: {
headerText: "Увеличить",
contentText: "Увеличение или уменьшение масштаба на PDF документ."
},
fitToWidth: {
headerText: 'По размеру Ширина',
contentText: 'Установить страницу PDF по ширине контейнера .',
},
fitToPage: {
headerText: 'По размеру страницы',
contentText: 'Установить страницу PDF в контейнер .',
},
search: {
headerText: 'Текст поиска',
contentText: 'Поиск текста в PDF-страниц.'
},
download: {
headerText: 'Скачать',
contentText: 'Скачать документ в формате PDF.'
},
},
};
if (ej.PercentageTextbox) ej.PercentageTextbox.Locale["ru-RU"] = {
watermarkText: "Введите значение",
};
if (ej.PivotGrid) ej.PivotGrid.Locale["ru-RU"] = {
Total: "Итого",
GrandTotal:"Итого",
DoesNotBeginsWith: "Не начинается с",
DoesNotEndsWith: "Не заканчивается на",
DoesNotContains: "Не содержит",
DoesNotEquals: "Не равняется",
IsGreaterThan: "Больше чем",
IsGreaterThanOrEqualTo: "Больше или равно",
IsLessThan: "Меньше",
IsLessThanOrEqualTo: "Меньше или равно",
NumberFormatting: "Числовое форматирование",
FrozenHeaders: "Замороженные жаток",
CellSelection: "Выбор ячейки",
CellContext: "Сотовый связи",
ColumnResize: "Изменение размера столбца",
ExcelLikeLayout: "Я хотел бы в Excel отчета",
FrozenHeader: "Замороженные жатки",
AdvancedFiltering: "Расширенная фильтрация",
Amount: "Сумма",
Quantity: "Количество",
Measures: "Меры",
NumberFormats: "Количество форматов",
Exporting: "Экспорт",
FileName: "Имя файла",
ToolTip: "Наконечник инструмента",
RTL: "RTL",
CollapseByDefault: "Свернуть по умолчанию",
EnableDisablePaging: "Enalbe / отключить пейджинг",
PagingOptions: "Параметры пейджинга",
CategoricalPageSize: "Категорическое размер страницы",
SeriesPageSize: "Серия размер страницы",
HyperLink: "Гиперссылка",
CellEditing: "Редактирование ячейки",
GroupingBar:"Группировка бар",
SummaryCustomization: "Резюме настройки",
SummaryTypes: "Типы сводок",
SummaryType: "Тип сводки",
EnableRowHeaderHyperlink: "Включение жатки приспособления для обработки пропашных культур гиперссылку",
EnableColumnHeaderHyperlink: "Включить заголовок столбца щелкните гиперссылку",
EnableValueCellHyperlink: "Включить значение ячейки гиперссылку",
EnableSummaryCellHyperlink: "Включить резюме ячейке гиперссылку",
HideGrandTotal: "Скрыть Итого",
HideSubTotal: "Скрыть SubTotal",
Both: "Оба",
Sum: "Сумма",
Average: "Средняя",
Count: "Счетчик",
Min: "Мин",
Max: "Max",
Excel: "Excel",
Word: "Слово",
PDF: "PDF",
CSV: "CSV",
ToolTipRow: "строка",
ToolTipColumn: "колонка",
ToolTipValue: "значение",
SeriesPage: "Серия страницу",
CategoricalPage: "Категорический страницу",
DragFieldHere: "Перетащите поля здесь",
ColumnArea: "Оставьте колонку здесь",
RowArea: "Оставьте строку здесь",
ValueArea: "Значения сюда вставить",
OK: "хорошо",
Cancel: "отменить",
Remove: "удалять",
ConditionalFormatting: "Условное форматирование",
Condition: "Условный Тип",
Value1: "Значение 1",
Value2: "Значение2",
Editcondtion: "Редактировать Состояние",
Backcolor: "Задний цвет",
Borderrange: "Пограничный Диапазон",
Borderstyle: "Пограничный Стиль",
Fontsize: "Размер шрифта",
Fontstyle: "Стиль шрифта",
Bordercolor: "выделяющий цвет",
Sort: "Порядок сортировки",
SelectField: "Выберите поле",
LabelFilterLabel: "Показать элементы, для которых наклейка",
ValueFilterLabel: "Показать элементы, для которых",
LabelFilters: "Метка фильтры",
BeginsWith: "Начинается с",
NotBeginsWith: "Не начинается с",
EndsWith: "Заканчивается на",
NotEndsWith: "Не заканчивается на",
Contains: "Содержит",
NotContains: "Не содержит",
ValueFilters: "Значение фильтры",
ClearFilter: "Очистить фильтр",
Equals: "Равно",
NotEquals: "Не равняется",
GreaterThan: "Больше чем",
GreaterThanOrEqualTo: "Больше или равно",
LessThan: "Меньше",
LessThanOrEqualTo: "Меньше или равно",
Between: "Между",
NotBetween: "Не между",
AddToFilter: "Добавить в фильтр",
AddToRow: "Добавить в строку",
AddToColumn: "Добавить в колонку",
AddToValues: "Добавить в значения",
Warning: "Предупреждение",
Error: "Сообщение об ошибке",
GroupingBarAlertMsg: "Поле вы сдвигаете не могут быть помещены в этой области в докладе",
Measures: "Меры",
Expand: "Расширить",
Collapse: "Свернуть",
NoValue: "Не имеет значения",
Close: "Закрыть",
Goal: "Цели",
Status: "Статус",
Trend: "Тенденция",
Value: "Значение",
ConditionalFormattingErrorMsg: "Указанное значение не соответствует",
ConditionalFormattingConformMsg: "Вы действительно хотите удалить выбранный формат?",
EnterOperand1: "Введите операнд1",
EnterOperand2: "Введите операнд2",
ConditionalFormatting: "Условное форматирование",
AddNew: "Добавить новый",
Format: "Формат",
NoMeasure: "Добавьте любые меры",
AliceBlue: "Элис синего цвета",
Black: "Черный",
Blue: "Синий",
Brown: "Коричневый",
Gold: "Золото",
Green: "Зеленый",
Lime: "Известь",
Maroon: "Бордовая",
Orange: "Оранжевый",
Pink: "Розовый",
Red: "Красный",
Violet: "Фиолетовый",
White: "Белый",
Yellow: "Желтый",
Solid: "Твердые",
Dashed: "Пунктирной",
Dotted: "Пунктирной линией",
Double: "Дважды",
Groove: "Паз",
Inset: "Вставка",
Outset: "Прежде всего",
Ridge: "Выступ",
None: "При этом никто не голосовал",
Algerian: "Алжирская",
Arial: "Arial",
BodoniMT: "Bodoni MT",
BritannicBold: "Британского Bold",
Cambria: "Cambria",
Calibri: "Calibri",
CourierNew: "Courier New",
DejaVuSans: "DejaVu Sans",
Forte: "Forte",
Gerogia: "В ГРУЗИЮ 10/10",
Impact: "Воздействие",
SegoeUI: "Segoe UI",
Tahoma: "Подобный Tahoma",
TimesNewRoman: "Times New Roman",
Verdana: "Verdana",
CubeDimensionBrowser: "Cube размер браузера",
SelectHierarchy: "Выберите Иерархия",
CalculatedField: "Вычисляемое поле",
Name: "Имя:",
Add: "Добавить",
Formula: "Формула:",
Delete: "Удалить",
Fields: "Поля:",
CalculatedFieldNameNotFound: "Учитывая CalculatedField имя не найдено",
InsertField: "Вставить поле",
EmptyField: "Введите поле вычисляется имя или формулы",
NotValid: "С учетом формулы не действителен",
NotPresent: "Поле значение используется в любом из поле вычисляется по формуле не присутствует в таблицу PivotGrid",
Confirm: "Вычисляемое поле с таким же именем уже существует. Вследствие хотите заменить ?",
CalcValue: "Вычисляемое поле может быть вставлен только в значение области",
MultipleItems: "Несколько пунктов",
All: "Все",
Search: "Поиск"
};
if (ej.PivotPager) ej.PivotPager.Locale["ru-RU"] = {
SeriesPage: "Серия страницу",
CategoricalPage: "Категорический страницу",
Error: "Сообщение об ошибке",
OK: "OK",
Close: "Закрыть",
PageCountErrorMsg: "Введите допустимый номер страницы"
};
if (ej.PivotSchemaDesigner) ej.PivotSchemaDesigner.Locale["ru-RU"] = {
DoesNotBeginsWith: "Не начинается с",
DoesNotEndsWith: "Не заканчивается на",
DoesNotContains: "Не содержит",
DoesNotEquals: "Не равняется",
IsGreaterThan: "Больше чем",
IsGreaterThanOrEqualTo: "Больше или равно",
IsLessThan: "Меньше",
IsLessThanOrEqualTo: "Меньше или равно",
PivotTableFieldList: "Сводная таблица Список поле",
ChooseFieldsToAddToReport: "Выберите поля для добавления, чтобы сообщить:",
DragFieldBetweenAreasBelow: "Перетащите поля между областями ниже:",
ReportFilter: "Фильтр отчета",
ColumnLabel: "Этикетка колонки",
RowLabel: "Ряд Этикетка",
Values: "ценности",
DeferLayoutUpdate: "Отложить листа Обновление",
Update: "обновление",
Sort: "Порядок сортировки",
SelectField: "Выберите поле",
LabelFilterLabel: "Показать элементы, для которых наклейка",
ValueFilterLabel: "Показать элементы, для которых",
LabelFilters: "Метка фильтры",
BeginsWith: "Начинается с",
NotBeginsWith: "Не начинается с",
EndsWith: "Заканчивается на",
NotEndsWith: "Не заканчивается на",
Contains: "Содержит",
NotContains: "Не содержит",
ValueFilters: "Значение фильтры",
ClearFilter: "Очистить фильтр",
Equals: "Равно",
NotEquals: "Не равняется",
GreaterThan: "Больше чем",
GreaterThanOrEqualTo: "Больше или равно",
LessThan: "Меньше",
LessThanOrEqualTo: "Меньше или равно",
Between: "Между",
NotBetween: "Не между",
Measures: "Меры",
AlertMsg: "Поле вы сдвигаете не могут быть помещены в этой области в докладе",
Close: "Закрыть",
Goal: "Цели",
Status: "Статус",
Trend: "Тенденция",
Value: "Значение",
AddToFilter: "Добавить в фильтр",
AddToRow: "Добавить в строку",
AddToColumn: "Добавить в колонку",
AddToValues: "Добавить в значения",
Warning: "Предупреждение",
OK: "OK",
Cancel: "Отмена",
Search: "Поиск"
};
if (ej.datavisualization && ej.datavisualization.RangeNavigator) ej.datavisualization.RangeNavigator.Locale["ru-RU"] = {
intervals: {
quarter: {
longQuarters: "Квартал,",
shortQuarters: "Q"
},
week: {
longWeeks: "Неделя,",
shortWeeks: "W"
},
},
};
if (ej.ReportViewer) ej.ReportViewer.Locale["ru-RU"] = {
toolbar: {
print: {
headerText: "печать",
contentText: "Печать отчета."
},
exportformat: {
headerText: "экспорт",
contentText: "Выберите экспортированный файл формата.",
Pdf: "PDF",
Excel: "превосходить",
Word: "слово",
Html: "Html",
PPT: 'PPT'
},
first: {
headerText: "первый",
contentText: "Перейти к первой странице отчета."
},
previous: {
headerText: "предыдущий",
contentText: "Перейти к предыдущей странице отчета."
},
next: {
headerText: "следующий",
contentText: "Перейти к следующей странице отчета."
},
last: {
headerText: "последний",
contentText: "Перейти к последней странице отчета."
},
documentMap: {
headerText: "Схема документа",
contentText: "Показать или скрыть схему документа."
},
parameter: {
headerText: "параметр",
contentText: "Показать или скрыть панель параметров."
},
zoomIn: {
headerText: "Zoom-В",
contentText: "Увеличение в докладе."
},
zoomOut: {
headerText: "Zoom-Out",
contentText: "Уменьшить масштаб отчета."
},
refresh: {
headerText: "обновление",
contentText: "Обновить отчет."
},
printLayout: {
headerText: "Разметка печати",
contentText: "Переключение между макет печати и нормальных режимах."
},
pageIndex: {
headerText: "Номер страницы",
contentText: "Номер текущей страницы для просмотра."
},
zoom: {
headerText: "Увеличить",
contentText: "Увеличение или уменьшение масштаба в отчете."
},
back: {
headerText: "назад",
contentText: "Вернитесь к родительского отчета."
},
fittopage: {
headerText: "По размеру страницы",
contentText: "Установите страницы отчета в контейнер.",
pageWidth: "Ширина страницы",
pageHeight: "Страница целиком"
},
pagesetup: {
headerText: "Параметры страницы",
contentText: "Выберите страницу параметр настройки, чтобы изменить размер бумаги, ориентацию и поля."
},
},
pagesetupDialog: {
paperSize: 'Размер бумаги',
height: 'Высота',
width: 'Ширина',
margins: 'Маржа',
top: 'верхний',
bottom: 'Дно',
right: 'Правильно',
left: 'Оставил',
unit: 'в',
orientation: 'ориентация',
portrait: 'Портрет',
landscape: 'Пейзаж',
doneButton: 'Готово',
cancelButton: 'Отмена'
},
viewButton: "Просмотреть отчет",
};
if (ej.Ribbon) ej.Ribbon.Locale["ru-RU"] = {
CustomizeQuickAccess: "Настройка панели быстрого доступа",
RemoveFromQuickAccessToolbar: "Удалить из панели быстрого доступа",
AddToQuickAccessToolbar: "Добавить на панель быстрого доступа",
ShowAboveTheRibbon: "Показать Над лентой",
ShowBelowTheRibbon: "Показать под лентой",
MoreCommands: "Дополнительные команды ..."
};
if (ej.Kanban) ej.Kanban.Locale["ru-RU"] = {
EmptyCard: "Нет карт для отображения",
SaveButton: "Сохранить",
CancelButton: "Отмена",
EditFormTitle: "Детали ",
AddFormTitle: "Добавить новую карточку",
SwimlaneCaptionFormat: "- {{:count}}{{if count == 1 }} пункт {{else}} Предметы {{/if}}",
FilterSettings: "фильтры:",
FilterOfText: "из",
Max: "Максимум",
Min: "Min",
Cards: " Карты",
ItemsCount: "Пункты Count :",
Unassigned: "Неназначенный",
AddCard: "Добавить карту",
EditCard: "Редактировать карточку",
DeleteCard: "Удалить карточку",
TopofRow: "Верх-Роу",
BottomofRow: "Дно Row",
MoveUp: "Переместить вверх",
MoveDown: "Переместить вниз",
MoveLeft: "Двигай влево",
MoveRight: "Двигаться вправо",
MovetoSwimlane: "Переместить в Swimlane",
HideColumn: "Скрыть столбец",
VisibleColumns: "Видимые столбцы",
PrintCard: "Печать карты"
};
if (ej.RTE) ej.RTE.Locale["ru-RU"] = {
bold: "Жирный",
italic: "курсив",
underline: "подчеркивание",
strikethrough: "Зачеркивание",
superscript: "верхний индекс",
subscript: "индекс",
justifyCenter: "Выравнивание текста центр",
justifyLeft: "Выравнивание текста влево",
justifyRight: "Выровнять текст по правому краю",
justifyFull: "обосновывать",
unorderedList: "Вставьте неупорядоченный список",
orderedList: "Вставить упорядоченный список",
indent: "Увеличить отступ",
fileBrowser: "Браузер файлов",
outdent: "Уменьшить отступ",
cut: "Порез",
copy: "копия",
paste: "Вставить",
paragraph: "Параграф",
undo: "расстегивать",
redo: "переделывать",
upperCase: "Верхний регистр",
lowerCase: "Нижний регистр",
clearAll: "Очистить все",
clearFormat: "Очистить Формат",
createLink: "Вставить / редактировать гиперссылок",
removeLink: "Удалить гиперссылку",
tableProperties: "Свойства таблицы",
insertTable: "Вставить",
deleteTables: "Удалить",
imageProperties: "Свойства изображения",
openLink: "Открыть гиперссылок",
image: "Вставить изображение",
video: "Вставить видео",
editTable: "Свойства Edit Table",
embedVideo: "Вставьте ваш код ниже",
viewHtml: "Просмотр HTML",
fontName: "Выберите семейство шрифтов",
fontSize: "Выберите размер шрифта",
fontColor: "Выбрать цвет",
format: "Формат",
backgroundColor: "Фоновый цвет",
style: "Стили",
deleteAlert: "Вы уверены, что хотите удалить все содержимое?",
copyAlert: "Ваш браузер не поддерживает прямой доступ к буферу обмена. Пожалуйста, используйте клавиатуру Ctrl + C Shortcut вместо операции копирования.",
pasteAlert: "Ваш браузер не поддерживает прямой доступ к буферу обмена. Пожалуйста, используйте сочетание клавиш Ctrl + V вместо операции вставки.",
cutAlert: "Ваш браузер не поддерживает прямой доступ к буферу обмена. Пожалуйста, используйте Ctrl + X комбинацию клавиш вместо операции вырезания.",
videoError: "Область текста не может быть пустым",
imageWebUrl: "Веб-адрес",
imageAltText: "Альтернативный текст",
dimensions: "Габаритные размеры",
constrainProportions: "Constrain Proportions",
linkWebUrl: "Веб-адрес",
imageLink: "Изображение как ссылку",
imageBorder: "изображение Border",
imageStyle: "Стиль",
linkText: "Текст",
linkToolTip: "подсказке",
html5Support: "Этот значок только инструмент включен в HTML5 поддерживаемых браузеров",
linkOpenInNewWindow: "Открыть ссылку в новом окне",
tableColumns: "No.of Колонны",
tableRows: "No.of Ряды",
tableWidth: "Ширина",
tableHeight: "Высота",
tableCellSpacing: "CELLSPACING",
tableCellPadding: "CELLPADDING",
tableBorder: "бордюр",
tableCaption: "подпись",
tableAlignment: "центровка",
textAlign: "Выравнивание текста",
dialogUpdate: "Обновить",
dialogInsert: "Вставить",
dialogCancel: "Отмена",
dialogApply: "Подать заявление",
dialogOk: "ОК",
createTable: "Вставить таблицу",
insertTable: "Вставить",
addColumnLeft: "Вставить столбцы слева",
addColumnRight: "Вставка столбцов вправо",
addRowAbove: "Вставка строки выше",
addRowBelow: "Вставить строки Ниже",
deleteRow: "Удалить всю строку",
deleteColumn: "Удалить весь столбец",
deleteTable: "Удалить таблицу",
customTable: "Создание пользовательских таблицу ...",
characters: "Персонажи",
words: "слова",
general: "Генеральная",
advanced: "продвинутый",
table: "Таблица",
row: "Ряд",
column: "колонка",
cell: "клеточной",
solid: "твердое тело",
dotted: "Пунктирный",
dashed: "Пунктирная",
doubled: "двойной",
maximize: "максимизировать",
resize: "Минимизировать",
swatches: "Swatches",
paragraph: "Параграф",
quotation: "Цитата",
heading1: "Заголовок 1",
heading2: "Заголовок 2",
heading3: "Заголовок 3",
heading4: "Заголовок 4",
heading5: "Заголовок 5",
heading6: "Заголовок 6",
segoeui: "Segoe UI",
arial: "Arial",
couriernew: "Новый Курьер",
georgia: "Грузия",
impact: "Влияние",
lucidaconsole: "Lucida Console",
tahoma: "Tahoma",
timesnewroman: "Times New Roman",
trebuchetms: "Требучет MS",
verdana: "Verdana",
disc: "диск",
circle: "Круг",
square: "Квадрат",
number: "Число",
loweralpha: "Нижняя Альфа",
upperalpha: "Верхний Альфа",
lowerroman: "Нижняя Римская",
upperroman: "Верхняя римская",
none: "Никто",
linktooltip: "Ctrl + клик, чтобы следовать по ссылке",
charSpace: "Символы (с пробелами)",
charNoSpace: "нет Персонажи (без пробелов)",
wordCount: "Количество слов",
left: "Оставил",
right: "Правильно",
center: "Центр",
zoomIn: "приблизить",
zoomOut: "Уменьшить",
print: "Распечатать",
wordExport: "Экспорт в документ в формате Word",
pdfExport: "Экспорт в PDF-файл",
FindAndReplace: "Найти и заменить",
Find: "найти",
MatchCase: "Учитывать регистр",
WholeWord: "Целое слово",
ReplaceWith: "Заменить",
Replace: "замещать",
ReplaceAll: "Заменить все",
FindErrorMsg: "Не удалось найти указанный слово.",
};
if (ej.Schedule) ej.Schedule.Locale["ru-RU"] = {
ReminderWindowTitle: "окно Напоминание",
CreateAppointmentTitle: "Создать назначение",
RecurrenceEditTitle: "Редактировать Повторите Назначение",
RecurrenceEditMessage: "Как бы вы хотели изменить назначение в серии?",
RecurrenceEditOnly: "Только это назначение",
RecurrenceEditSeries: "Вся серия",
PreviousAppointment: "Предыдущая Назначение",
NextAppointment: "Следующая Назначение",
AppointmentSubject: "субъект",
StartTime: "Время начала",
EndTime: "Время окончания",
AllDay: "весь день",
StartTimeZone: "Время начала зоны",
EndTimeZone: "Конец часовой пояс",
Today: "сегодня",
Recurrence: "повторение",
Done: "сделано",
Cancel: "отменить",
Ok: "Хорошо",
RepeatBy: "Повторите по",
RepeatEvery: "Повторять каждые",
RepeatOn: "Повторите",
StartsOn: "Запускает на",
Ends: "концы",
Summary: "резюме",
Daily: "ежедневно",
Weekly: "еженедельно",
Monthly: "ежемесячно",
Yearly: "годовой",
Every: "каждый",
EveryWeekDay: "Каждый будний день",
Never: "никогда не",
After: "после",
Occurence: "Возникновение (ы)",
On: "на",
Edit: "редактировать",
RecurrenceDay: "День (ы)",
RecurrenceWeek: "Неделя (ы)",
RecurrenceMonth: "Месяц (ев)",
RecurrenceYear: "Год (ы)",
The: "The",
OfEvery: "каждых",
First: "первый",
Second: "второй",
Third: "третий",
Fourth: "четвертый",
Last: "последний",
WeekDay: "будний день",
WeekEndDay: "Day Weekend",
Subject: "субъект",
Categorize: "категории",
DueIn: "Благодаря В",
DismissAll: "Закрыть все",
Dismiss: "увольнять",
OpenItem: "Открытое товара",
Snooze: "вздремнуть",
Day: "день",
Week: "неделю",
WorkWeek: "Рабочая неделя",
Month: "месяц",
AddEvent: "Добавить событие",
CustomView: "Пользовательский просмотр",
Agenda: "повестка",
Detailed: "Изменить назначение",
EventBeginsin: "Назначение начинается в",
Editevent: "Изменить назначение",
Editseries: "Редактировать серии",
Times: "раз",
Until: "до",
Eventwas: "Назначение было",
Hours: "часов",
Minutes: "мин",
Overdue: "Просроченная Назначение",
Days: "день (ей)",
Event: "событие",
Select: "выбрать",
Previous: "предыдущая",
Next: "следующий",
Close: "близко",
Delete: "удалять",
Date: "дата",
Showin: "Показать в",
Gotodate: "Перейти к дате",
Resources: "РЕСУРСЫ",
RecurrenceDeleteTitle: "Удалить Повтор Назначение",
Location: "расположение",
Priority: "приоритет",
RecurrenceAlert: "тревога",
NoTitle: "Без названия",
OverFlowAppCount: "больше назначений)",
WrongPattern: "Шаблон повторений не является действительным",
CreateError: "Продолжительность назначения должны быть короче, чем, как часто это происходит. Уменьшите длину",
DragResizeError: "Не можете перепланировать вхождение повторяющейся встречи, если она пропускает более позднем наступлении же назначения.",
StartEndError: "Время окончания должно быть больше, чем время начала",
MouseOverDeleteTitle: "Удалить встречу",
DeleteConfirmation: "Вы уверены, что хотите удалить этот прием?",
Time: "время",
EmptyResultText: "Нет предложений",
};
if (ej.Spreadsheet) ej.Spreadsheet.Locale["ru-RU"] = {
Cut: "Порез",
Copy: "копия",
FormatPainter: "Формат Painter",
Paste: "Вставить",
PasteValues: "Вставить только значения",
PasteSpecial: "Вставить",
Filter: "Фильтр",
FilterContent: "Включите фильтрацию для выбранных ячеек.",
FilterSelected: "Фильтр по значению в выбранной ячейке",
Sort: "Сортировать",
Clear: "Очистить",
ClearContent: "Удалить все содержимое в ячейке, или удалить только форматирование, содержание, комментарии или гиперссылок.",
ClearFilter: "Очистить фильтр",
ClearFilterContent: "Очистите фильтр и сортировку состояния для текущего диапазона данных.",
SortAtoZ: "Сортировка от А до Я",
SortAtoZContent: "Низшего к высшему.",
SortZtoA: "Сортировка от Я до А",
SortZtoAContent: "Самый высокий Нижайшего.",
SortSmallesttoLargest: "Сортировать меньших к большим",
SortLargesttoSmallest: "Сортировать наибольшего к наименьшему",
SortOldesttoNewest: "Сортировать От старых к новым",
SortNewesttoOldest: "Сортировка новых к старым",
Insert: "Вставить",
InsertTitle: "Вставить ячейки",
InsertContent: "Добавьте новые ячейки, строки или столбцы в книге <br /> <br /> FYI:. Чтобы вставить несколько строк или столбцов в то время, выбрать несколько строк или столбцов в таблице, и нажмите Вставить.",
InsertSBContent: "Добавить ячейки, строки, столбцы или листы рабочей книги.",
Delete: "Удалить",
DeleteTitle: "Удалить ячейки",
DeleteContent: "Удалить ячейки, строки, столбцы или листы из рабочей книги <br /> <br /> FYI:. Чтобы удалить несколько строк или столбцов в то время, выбрать несколько строк или столбцов в таблице, и нажмите кнопку Удалить.",
FindSelectTitle: "Найти и выберите",
FindSelectContent: "Нажмите, чтобы увидеть варианты для поиска текста в документе.",
CalculationOptions: "параметры расчета",
CalcOptTitle: "параметры расчета",
CalcOptContent: "Выберите для расчета формул автоматически или вручную. <br/> <br/> Если вы сделаете изменения, которые влияют на значение, электронная таблица будет автоматически пересчитать его.",
CalculateSheet: "Подсчитайте Sheet",
CalculateNow: "Рассчитать сейчас",
CalculateNowContent: "Вычислить всю рабочую книгу прямо сейчас. <br/> <br/> Вам нужно всего лишь использовать эту функцию, если автоматический расчет выключен.",
CalculateSheetContent: "Вычислить активный лист прямо сейчас. <br/> <br/> Вам нужно всего лишь использовать эту функцию, если автоматический расчет выключен.",
Title: "таблица",
Ok: "ОК",
Cancel: "Отмена",
Alert: "Мы не могли сделать это для выбранного диапазона ячеек. Выберите одну ячейку в диапазоне данных, а затем повторите попытку.",
HeaderAlert: "Команда не может быть выполнена, как вы пытаетесь фильтровать с заголовком фильтра. Выберите одну ячейку в диапазоне фильтра и повторите команду.",
FlashFillAlert: "Все данные, рядом с вашего выбора была проверена и не было никакого образца для заполнения значений.",
Formatcells: "Формат ячеек",
FontFamily: "Шрифт",
FFContent: "Выберите новый шрифт для вашего текста.",
FontSize: "Размер шрифта",
FSContent: "Изменение размера вашего текста.",
IncreaseFontSize: "Увеличить размер шрифта",
IFSContent: "Сделайте ваш текст немного больше.",
DecreaseFontSize: "Уменьшить размер шрифта",
DFSContent: "Сделайте ваш текст немного меньше.",
Bold: "Жирный",
Italic: "курсив",
Underline: "подчеркивание",
Linethrough: "Линия, проходящая через",
FillColor: "Цвет заливки",
FontColor: "Цвет шрифта",
TopAlign: "Топ Align",
TopAlignContent: "Выравнивание текста в верхней части.",
MiddleAlign: "Средний Align",
MiddleAlignContent: "Выравнивание текста таким образом, чтобы он находился по центру между верхней и нижней части клетки.",
BottomAlign: "Bottom Align",
BottomAlignContent: "Выравнивание текста в нижней части.",
WrapText: "Перенос текста",
WrapTextContent: "Оберните экстра-длинный текст в несколько строк, чтобы вы могли видеть все это.",
AlignLeft: "Выровнять по левому краю",
AlignLeftContent: "Совместите содержание влево.",
AlignCenter: "Центр",
AlignCenterContent: "Сосредоточьте свое содержание.",
AlignRight: "Выровнять по правому краю",
AlignRightContent: "Совместите ваше содержание вправо.",
Undo: "расстегивать",
Redo: "переделывать",
NumberFormat: "Формат номера",
NumberFormatContent: "Выберите формат для ваших клеток, таких как процент, валюта, дату или время.",
AccountingStyle: "Учет Стиль",
AccountingStyleContent: "Формат как формат номера учета доллар.",
PercentageStyle: "Процент Стиль",
PercentageStyleContent: "Формат как процент.",
CommaStyle: "Запятая Стиль",
CommaStyleContent: "Формат без разделителя.",
IncreaseDecimal: "Увеличение -десятичная",
IncreaseDecimalContent: "Показать больше десятичных знаков для более точного значения.",
DecreaseDecimal: "Уменьшение -десятичная",
DecreaseDecimalContent: "Показать меньше знаков после запятой.",
AutoSum: "AutoSum",
AutoSumTitle: "сумма",
AutoSumContent: "Автоматически добавлять быстрый расчет на листе, такие как сумма или среднее.",
Fill: "заполнить",
ExportXL: "превосходить",
ExportCsv: "CSV",
SaveXml: "Сохранить XML",
BackgroundColor: "Цвет заливки",
BGContent: "Цвет фона ячеек, чтобы заставить их выделиться.",
ColorContent: "Изменение цвета текста.",
Border: "бордюр",
BorderContent: "Применить границы для выбранных ячеек.",
BottomBorder: "Нижняя граница",
TopBorder: "Верхняя граница",
LeftBorder: "Левая граница",
RightBorder: "правая граница",
OutsideBorder: "Внешние границы",
NoBorder: "Без границ",
AllBorder: "Все границы",
ThickBoxBorder: "Толстые Box Пограничный",
ThickBottomBorder: "Толстая нижняя граница",
TopandThickBottomBorder: "Верхняя и нижняя граница Толстые",
DrawBorderGrid: "Draw Border сетки",
DrawBorder: "Draw Border",
TopandBottomBorder: "Верхняя и нижняя граница",
BorderColor: "Цвет линии",
BorderStyle: "Стиль линии",
Number: "Номер используется для общего отображения чисел. Валюта и бухгалтерский учет предлагают специализированные форматирование денежной стоимости.",
General: "Общий формат ячейки не имеют никакого определенного формата номера.",
Currency: "формат валюты используются для общих денежных значений. Использование учета в форматы для выравнивания десятичной точки в столбце.",
Accounting: "Бухгалтерская форматы выстраиваются в очередь валютных символов и десятичной точки в столбце.",
Text: "Клетки формата текста рассматриваются как текст, даже если число в ячейке. Ячейки отображается точно так, как поступил.",
Percentage: "Форматы в процентах умножить значение ячейки на 100 и отображает результат с символом процента.",
CustomMessage: "Введите код формата номер, используя один из существующего кода в качестве отправной точки.",
Fraction: " ",
Scientific: " ",
Type: "Тип:",
CustomFormatAlert: "Введите действительный формат",
Date: "Форматы даты отображения даты и времени серийные номера в качестве значений даты.",
Time: "Время форматы отображения даты и времени серийные номера в качестве значения даты.",
File: "ФАЙЛ",
New: "новый",
Open: "открыто",
SaveAs: "Сохранить как",
Print: "Распечатать",
PrintContent: "Печать текущего листа.",
PrintSheet: "Печать листа",
PrintSelected: "Печать Выбранные",
PrintSelectedContent: "Выберите область на листе, который вы хотели бы напечатать.",
HighlightVal: "Формат Неверные данные",
ClearVal: "Очистить проверки",
Validation: "Проверка",
DataValidation: "Валидация данных",
DVContent: "Выберите из списка правил, чтобы ограничить тип данных, которые могут быть введены в ячейку.",
A4: "A4",
A3: "A3",
Letter: "Письмо",
PageSize: "Размер страницы",
PageSizeContent: "Выберите размер страницы для документа.",
FormatCells: "Формат ячеек",
ConditionalFormat: "Условное форматирование",
CFContent: "Легко определить тенденции и закономерности в данных с использованием цветов, чтобы визуально выделить важные значения.",
And: "а также",
With: "с",
GTTitle: "Больше чем",
GTContent: "Форматирование ячеек, которые более, чем:",
LTTitle: "Меньше, чем",
LTContent: "Форматирование ячеек, которые являются менее:",
BWTitle: "Между",
BWContent: "Форматирование ячеек, которые находятся между:",
EQTitle: "Равно",
EQContent: "Форматирование ячеек, которые равны:",
DateTitle: "A Дата Происходящие",
DateContent: "Клетки формата, которые содержат ДАТА:",
ContainsTitle: "Текст, который содержит",
ContainsContent: "Клетки формата, которые содержат текст:",
GreaterThan: "Больше чем",
LessThan: "Меньше, чем",
Between: "Между",
EqualTo: "Равно",
TextthatContains: "Текст, который содержит",
DateOccurring: "A Дата Происходящие",
ClearRules: "Четкие правила",
ClearRulesfromSelected: "Четкие правила выбранных ячеек",
ClearRulesfromEntireSheets: "Четкие правила из целого листа",
CellStyles: "Стили ячейки",
CellStylesContent: "Красочный стиль является отличным способом, чтобы сделать важные данные выделяются на листе.",
CellStyleHeaderText: "Хорошие, плохие и нейтральные / Названия и заголовки / Тематические Стили ячейки",
Custom: "Введите код формата номер, используя один из существующих кодов в качестве отправной точки.",
CellStyleGBN: "Нормальный / Bad / Good / Нейтральная",
CellStyleTH: "Заголовок 4 / Название",
CellsStyleTCS: "20% - Accent1 / 20% - Accent2 / 20% - Accent3 / 20% - Accent4 / 60% - Accent1 / 60% - Accent2 / 60% - Accent3 / 60% - Accent4 / Accent1 / Accent2 / Accent3 / Accent4",
Style: "Стиль",
FormatAsTable: "Как видно из таблицы Формат",
FormatasTable: "Формат как таблицу",
FATContent: "Быстро преобразовать диапазон ячеек в таблицу со своим собственным стилем.",
FATHeaderText: "Свет / Medium / Dark",
FATNameDlgText: "Название таблицы: / Моя таблица содержит заголовки",
InvalidReference: "Вы указали диапазон недействителен",
ResizeAlert: "Указанный диапазон является недействительным. В верхней части таблицы должны оставаться в той же строке, и в результате таблица должна перекрывать исходную таблицу. Укажите допустимый диапазон.",
RangeNotCreated: "Увеличение строки за пределы максимального числа строк листа ограничен в формате, как таблицы.",
ResizeRestrictAlert: "Увеличение или уменьшение количество столбцов и уменьшение счетчика строк ограничено в формате, как таблицы.",
FATResizeTableText: "Введите новый диапазон данных для таблицы:",
FATReizeTableNote: "Примечание: Заголовки должны оставаться в той же строке и результирующий диапазон таблицы должен перекрывать первоначальный диапазон таблицы.",
FormatAsTableAlert: "Невозможно создать таблицу с одной строкой. Таблица должна иметь по крайней мере два ряда, один для заголовка таблицы и один для данных",
FormatAsTableTitle: "Свет 1 / Свет 2 / Свет 3 / Свет 4 / Свет 5 / Свет 6 / Свет 7 / Свет 8 / Свет 9 / Свет 10 / Light 11 / Light 12 / Medium 1 / средний 2 / Средние 3 / Medium 4 / Medium 5 / Medium 6 / Medium 7 / Medium 8 / Dark 1 / Dark 2 / Dark 3 / Dark 4",
NewTableStyle: "Новый Стиль таблицы",
ResizeTable: "Изменение размера таблицы",
ResizeTableContent: "Изменение размера этой таблицы путем добавления или удаления строк и столбцов.",
ConvertToRange: "Преобразовать в диапазон",
ConvertToRangeContent: "Преобразование эту таблицу в нормальный диапазон ячеек.",
ConverToRangeAlert: "Вы хотите, чтобы преобразовать таблицу в пределах нормы?",
TableID: "Таблица ID:",
Table: "Таблица",
TableContent: "Создание таблицы для организации и анализа соответствующих данных.",
TableStyleOptions: "Первая колонка / Последняя колонка / Total Row / Кнопка Фильтр",
Format: "Формат",
NameManager: "Имя менеджера",
NameManagerContent: "Создание, редактирование, удаление и найти все имена, используемые в книге. <br /> <br /> Имена могут быть использованы в формулах в качестве заменителей ссылок на ячейки.",
DefinedNames: "Задаваемые Названия",
DefineName: "Определить имя",
DefineNameContent: "Определение и применение имен.",
UseInFormula: "Использование В формуле",
UseInFormulaContent: "Выберите имя, используемое в этой книге и вставить его в текущую формулу.",
RefersTo: "Относится к",
Name: "имя",
Scope: "Объем",
NMNameAlert: "Имя, которое вы ввели не valid./Reason для этого может включать в себя: / имя не начинается с буквы или символа подчеркивания / имя содержит пробел или другие недопустимые символы / именем конфликты с электронной таблицей встроенного имени или имя другого объекта в книге, // не используется полностью",
NMUniqueNameAlert: "Введенное имя уже существует. Введите уникальное имя.",
NMRangeAlert: "Введите допустимый диапазон",
FORMULAS: "ФОРМУЛЫ",
DataValue: "Значения:",
Value:"Значения",
Formula: "Формулы",
MissingParenthesisAlert: "Ваша формула не хватает parenthesis--) или (. Проверьте формулу, а затем добавить круглые скобки в соответствующем месте.",
UnsupportedFile: "Unsupported File",
IncorrectPassword: "Невозможно открыть файл или рабочий лист с указанным паролем",
InvalidUrl: "Пожалуйста, укажите надлежащий URL",
Up: "вверх",
Down: "вниз",
Sheet: "Лист",
Workbook: "рабочая тетрадь",
Rows: "По Ряды",
Columns: "столбцами",
FindReplace: "Найти и заменить",
FindnReplace: "Найти и заменить",
Find: "найти",
Replace: "замещать",
FindLabel: "Найти то, что:",
ReplaceLabel: "Заменить:",
ReplaceAll: "Заменить все",
Close: "Закрыть",
FindNext: "Найти следующее",
FindPrev: "Найти Пред",
Automatic: "автоматический",
Manual: "Руководство",
Settings: "настройки",
MatchCase: "Учитывать регистр",
MatchAll: "Матч все содержимое ячейки",
Within: "В:",
Search: "Поиск:",
Lookin: "Заглянуть:",
ShiftRight: "Сдвинуть ячейки вправо",
ShiftBottom: "Сдвинуть ячейки вниз",
EntireRow: "Весь ряд",
EntireColumn: "Вся колонна",
ShiftUp: "Сдвинуть ячейки вверх",
ShiftLeft: "Сдвинуть ячейки влево",
Direction: "Направление:",
GoTo: "Идти к",
GoToName: "Идти к:",
Reference: "Справка:",
Special: "Особый",
Select: "Выбрать",
Comments: "Комментарии",
Formulas: "Формулы",
Constants: "Константы",
RowDiff: "различия строк",
ColDiff: "различия столбцов",
LastCell: "Последняя ячейка",
CFormat: "Условные форматы",
Blanks: "Пробелы",
GotoError: "ошибка",
GotoLogicals: "логические выражения",
GotoNumbers: "чисел",
GotoText: "Текст",
FindSelect: "Найти и выберите",
Comment: "Комментарий",
NewComment: "новый",
InsertComment: "Вставить комментарий",
EditComment: "редактировать",
DeleteComment: "Удалить комментарий",
DeleteCommentContent: "Удалить выбранный комментарий.",
HideComment: "Скрыть комментарий",
Next: "следующий",
NextContent: "Перейти к следующему комментарию.",
Previous: "предыдущий",
PreviousContent: "Перейти к предыдущему комментарию.",
ShowHide: "Показать / скрыть комментарий",
ShowHideContent: "Показать или скрыть комментарий к активной ячейке.",
ShowAll: "Показать все комментарии",
ShowAllContent: "Показать все комментарии в листе.",
UserName: "Имя пользователя",
Hide: "Спрятать",
Unhide: "Unhide",
Add: "Добавить",
DropAlert: "Вы хотите, чтобы заменить существующие данные?",
PutCellColor: "Положите сотовый цвет Selected To The Top",
PutFontColor: "Помещенный Выбранный цвет шрифта To The Top",
WebPage: "Веб-страница",
WorkSheet: "Рабочий лист Ссылка",
SheetReference: "Лист Ссылки",
InsertHyperLink: "Вставить ссылку",
HyperLink: "Гиперссылка",
EditLink: "Изменить ссылку",
OpenLink: "Открыть ссылку",
HyperlinkText: "Текст:",
RemoveLink: "Удалить ссылку",
WebAddress: "Веб-адрес:",
CellAddress: "Ссылка на ячейку:",
SheetIndex: "Выберите место в данном документе",
ClearAll: "Очистить все",
ClearFormats: "Очистить форматы",
ClearContents: "Очистить Содержание",
ClearComments: "Очистить Комментарии",
ClearHyperLinks: "Ясно гиперссылок",
SortFilter: "Сортировка и фильтр",
SortFilterContent: "Организуйте свои данные, так что легче анализировать.",
NumberStart: "Минимум:",
NumberEnd: "Максимум:",
DecimalStart: "Минимум:",
DecimalEnd: "Максимум:",
DateStart: "Дата начала:",
DateEnd: "Дата окончания:",
ListStart: "Источник:",
FreeText: "вводится предупреждение Показать ошибки после того, как недостоверные данные",
ListEnd: "Ссылка на ячейку:",
TimeStart: "Время начала:",
TimeEnd: "Время окончания:",
TextLengthStart: "Минимум:",
TextLengthEnd: "Максимум:",
CommentFindEndAlert: "Электронная таблица достигли конца книги. Вы хотите продолжить пересмотр с начала книги?",
InsertSheet: "Вставить",
DeleteSheet: "Удалить",
RenameSheet: "переименовывать",
MoveorCopy: "Переместить или Копировать",
HideSheet: "Спрятать",
UnhideSheet: "Unhide",
SheetRenameAlert: "Это имя уже занято. Попробуйте другой.",
SheetRenameEmptyAlert: "Введен недопустимый имя листа. Убедитесь, что: <UL> <LI> Имя, которое вы вводите, не превышает 31 символа </ li> <li> Имя не содержит какой-либо из следующих символов:. \ /? * [Или] </ li> <li> Вы не оставил имя пустым. </ Li> </ UL>",
SheetDeleteAlert: "Вы не можете отменить удаление листов, и вы можете быть удалить некоторые данные. Если вы не нуждаетесь в этом, нажмите кнопку OK, чтобы удалить.",
SheetDeleteErrorAlert: "Рабочая книга должна содержать по меньшей мере один видимый рабочий лист. Чтобы скрыть, удалить или переместить выбранный лист, необходимо сначала вставить новый лист или показать лист, который уже скрыто.",
CtrlKeyErrorAlert: "Эта команда не может быть использована на множественный выбор.",
MoveToEnd: "Move To End",
Beforesheet: "Перед тем как лист:",
CreateaCopy: "Создать копию",
AutoFillOptions: "Копирование ячеек / Fill Series / Fill Форматирование Только / Заполнить без форматирования / Flash Fill",
NumberValidationMsg: "Введите только цифры",
DateValidationMsg: "Введите только дату",
Required: "необходимые",
TimeValidationMsg: "Время, которое вы ввели в течение времени, является недействительным.",
CellAddrsValidationMsg: "Ссылка не является действительным.",
PivotTable: "Сводная таблица",
PivotTableContent: "Легко организовать и суммировать сложные данные в сводную таблицу.",
NumberTab: "Число",
AlignmentTab: "центровка",
FontTab: "Шрифт",
FillTab: "заполнить",
TextAlignment: "выравнивание текста",
Horizontal: "По горизонтали:",
Vertical: "По вертикали:",
Indent: "индент",
TextControl: "Текст управления",
FontGroup: "Шрифт:",
FontStyle: "Стиль шрифта:",
Size: "Размер:",
PSize: "Размер страницы",
Effects: "Последствия:",
StrikeThrough: "Зачеркивание",
Overline: "Overline",
NormalFont: "Обычный шрифт",
Preview: "предварительный просмотр",
PreviewText: "AABBCC ZyZz",
Line: "Линия",
Presets: "Предварительные настройки",
None: "Никто",
Outline: "Контур",
AllSide: "Все стороны",
InsCells: "Вставить ячейки",
InsRows: "Вставка листа Ряды",
InsCols: "Вставка листа Столбцы",
InsSheet: "Вставить лист",
DelCells: "Удалить ячейки",
DelRows: "Удалить лист Ряды",
DelCols: "Удалить Лист Столбцы",
DelSheet: "Удалить лист",
HyperLinkAlert: "Адрес этого сайта не valid.Check адрес и повторите попытку.",
ReplaceData: "Все сделано. Мы сделали / замены.",
NotFound: "Мы не смогли найти то, что вы искали. Выберите Настройки вкладки для более способов поиска",
Data: "Данные:",
Allow: "Позволять:",
IgnoreBlank: "Игнорировать пустой",
NotFind: "Не удалось найти матч, чтобы заменить",
FreezeRow: "Замораживание Верхний ряд",
FreezeColumn: "Замораживание первой колонке",
UnFreezePanes: "Разморозить Panes",
DestroyAlert: "Вы уверены, что хотите уничтожить текущую рабочую книгу без сохранения и создать новую книгу?",
ImageValAlert: "Загрузить только файлы изображений",
Pictures: "Картинки",
PicturesTitle: "Из файла",
PicturesContent: "Вставка изображений с компьютера или с других компьютеров, которые подключены.",
ImportAlert: "Вы уверены, что хотите уничтожить текущую рабочую книгу без сохранения и откройте новую книгу?",
UnmergeCells: "Отменить объединение ячеек",
MergeCells: "Объединить ячейки",
MergeAcross: "Слияние Через",
MergeAndCenter: "Слияние и Центр",
MergeAndCenterContent: "Комбинирование и центрировать содержимое выбранных ячеек в новой крупной клетке.",
MergeCellsAlert: "Объединение ячеек сохраняет только верхний левый значение ячейки и отбрасывает другие значения.",
MergeInsertAlert: "Эта операция вызовет некоторые слившиеся клетки разъединить. Вы хотите продолжить ?",
Axes: "Топоры",
PHAxis: "Первичный Горизонтальный",
PVAxis: "Первичный вертикальный",
AxisTitle: "Заголовок оси",
CTNone: "Никто",
CTCenter: "Центр",
CTFar: "далеко",
CTNear: "Возле",
DataLabels: "Подписи данных",
DLNone: "Никто",
DLCenter: "Центр",
DLIEnd: "Внутри End",
DLIBase: "Внутри базы",
DLOEnd: "Внешний конец",
ErrorBar: "Столбики ошибок",
Gridline: "линии сетки",
PMajorH: "Первичный Major Горизонтальный",
PMajorV: "Первичный Major Вертикальная",
PMinorH: "Первичный Незначительное Горизонтальный",
PMinorV: "Первичный Major Вертикальная",
Legend: "Легенды",
LNone: "Никто",
LLeft: "Оставил",
LRight: "Правильно",
LBottom: "Дно",
LTop: "верхний",
ChartTitleDlgText: "Введите заголовок",
ChartTitle: "заглавие",
InvalidTitle: "Введен недопустимое имя для названия.",
CorrectFormat: "Выберите правильный формат файла",
ResetPicture: "Сброс изображения",
ResetPictureContent: "Отбросить все изменения форматирования, сделанные в этой картине.",
PictureBorder: "Изображение Border",
PictureBorderContent: "Выберите цвет, ширину и стиль линии для контура фигуры.",
ResetSize: "Reset Picture & Размер",
Height: "Высота",
Width: "Ширина",
ThemeColor: "Тема Цвета",
NoOutline: "Нет Outline",
Weight: "вес",
Dashes: "Штрихи",
ColumnChart: "2-D Колонка / 3D Колонка",
ColumnChartTitle: "Вставьте Гистограмма",
ColumnChartContent: "Используйте этот тип диаграммы визуально сравнить значений через несколько категорий.",
BarChart: "2-D Бар / 3D Bar",
BarChartTitle: "Вставить Гистограмма",
BarChartContent: "Используйте этот тип диаграммы визуально сравнить значений через несколько категорий, когда график показывает длительность или текст категория долго.",
StockChart: "радиолокационный",
StockChartTitle: "Вставьте лепестковая диаграмма",
StockChartContent: "Используйте этот тип диаграммы для отображения значений по отношению к центральной точке.",
LineChart: "2-D линии",
LineChartTitle: "Вставьте Line Chart",
LineChartContent: "Используйте этот тип диаграммы, чтобы показать тенденции в течение долгого времени (годы, месяцы и дни) или категории.",
AreaChart: "2-D Площадь / 3D Площадь",
AreaChartTitle: "Вставить Область диаграммы",
AreaChartContent: "Используйте этот тип диаграммы, чтобы показать тенденции в течение долгого времени (годы, месяцы и дни) или категории. Используйте его, чтобы выделить величину изменения с течением времени.",
ComboChart: "Combo",
PieChart: "пирог",
PieChartTitle: "Вставьте Pie / Кольцевая диаграмма",
PieChartContent: "Используйте этот тип диаграммы, чтобы показать пропорции в целом. Используйте его, когда сумма ваших чисел составляет 100%.",
ScatterChart: "рассеивать",
ScatterChartTitle: "Вставьте Точечная (X, Y) Диаграмма",
ScatterChartContent: "Используйте этот тип диаграммы, чтобы показать связь между наборами значений.",
ClusteredColumn: "Кластерный & NBSP; колонка",
StackedColumn: "Stacked & NBSP; колонка",
Stacked100Column: "100% & NBSP; & NBSP штабелях; колонка",
Cluster3DColumn: "3D & NBSP; & NBSP кластерного Колонка",
Stacked3DColumn: "3D & NBSP; & NBSP штабелях; колонка",
Stacked100Column3D: "3D & NBSP; 100% & NBSP; & NBSP штабелях; колонка",
ClusteredBar: "Кластерный & NBSP; Bar",
StackedBar: "Stacked & NBSP; Bar",
Stacked100Bar: "100% & NBSP; & NBSP штабелях; Bar",
Cluster3DBar: "3D & NBSP; & NBSP кластерного; Bar",
Stacked3DBar: "3D & NBSP; & NBSP штабелях; Bar",
Stacked100Bar3D: "3D & NBSP; 100% & NBSP; & NBSP штабелях; Bar",
Radar: "радиолокационный",
RadarMarkers: "Радар & NBSP; ширина & NBSP; Маркеры",
LineMarkers: "Line & NBSP; ширина & NBSP; Маркеры",
Area: "Площадка",
StackedArea: "Stacked & NBSP; Площадь",
Stacked100Area: "100% & NBSP; & NBSP штабелях; Площадь",
Pie: "пирог",
Pie3D: "3-D & NBSP; Pie",
Doughnut: "Пончик",
Scatter: "рассеивать",
ChartRange: "размахов",
XAxisRange: "Введите диапазон по оси Х:",
YAxisRange: "Введите диапазон Y-ось:",
LegendRange: "Введите диапазон условных обозначений:",
YAxisMissing: "Введите диапазон Y-оси для создания диаграммы",
InvalidYAxis: "Диапазон Y-ось должна быть в пределах выбранного диапазона",
InvalidXAxis: "Диапазон оси Х должна быть в пределах выбранного диапазона",
InvalidLegend: "Диапазон Легенда должна быть в пределах выбранного диапазона",
InvalidXAxisColumns: "Диапазон оси Х должна быть в пределах одного столбца",
FreezePanes: "Замерзшие оконные стекла",
FreezePanesContent: "Замораживание часть листа, чтобы держать его видимым во время прокрутки через остальную часть листа.",
PasteTitle: "Вставить (Ctrl + V)",
PasteContent: "Добавить содержимое в буфер обмена в документ.",
PasteSplitContent: "Выберите опцию вставить, например, сохранение форматирования или вставки только содержание.",
CutTitle: "Вырезать (Ctrl + X)",
CutContent: "Снимите выделение и поместить его в буфер обмена, так что вы можете вставить его где-нибудь в другом месте.",
CopyTitle: "Копировать (Ctrl + C)",
CopyContent: "Поместите копию выбора в буфере обмена, так что вы можете вставить его где-нибудь в другом месте.",
FPTitle: "Формат Painter",
FPContent: "Как и внешний вид конкретного выбора? Вы можете применить этот взгляд на другое содержимое в документе.",
BoldTitle: "Жирный (Ctrl + B)",
BoldContent: "Сделайте ваш текст жирным шрифтом.",
ItalicTitle: "Курсив (Ctrl + I)",
ItalicContent: "Курсив текст.",
ULineTitle: "Подчеркивание (Ctrl + U)",
ULineContent: "Подчеркните свой текст.",
LineTrTitle: "Зачеркнутый (Ctrl + 5)",
LineTrContent: "Крест что-то рисуя удар через него.",
UndoTitle: "Отменить (Ctrl + Z)",
UndoContent: "Отменить последнее действие.",
RedoTitle: "Повторить (Ctrl + Y)",
RedoContent: "Повторить последнее действие.",
TableTitle: "Таблица (Ctrl + T)",
HyperLinkTitle: "Добавление гиперссылки (Ctrl + K)",
HyperLinkContent: "Создание ссылки в документе для быстрого доступа к веб-страницам и файлам. <br /> <br /> гиперссылок также может принять вас места в вашем документе.",
NewCommentTitle: "Вставьте комментарий",
NewCommentContent: "Добавить заметку об этой части документа.",
RefreshTitle: "обновление",
RefreshContent: "Получить последние данные от источника, подключенного к активной ячейке",
FieldListTitle: "Список полей",
FieldListContent: "Показать или скрыть список полей. <br /> <br /> В списке поля позволяет добавлять и удалять поля из отчета сводной таблицы",
AddChartElement: "Добавить элемент диаграммы",
AddChartElementContent: "Добавление элементов в созданной таблице.",
SwitchRowColumn: "Переключатель Row / Column",
SwitchRowColumnContent: "Обменяйте данные по оси.",
MergeAlert: "Мы не можем сделать это в объединенную ячейку.",
UnhideDlgText: "Unhide Sheet:",
ChartThemes: "График Темы",
ChartThemesContent: "Выберите новую тему для вашей диаграммы.",
ChangePicture: "Изменить изображение",
ChangePictureContent: "Изменение к другой картинке, сохраняя форматирование и размер текущего изображения.",
ChangeChartType: "Изменение типа диаграммы",
SelectData: "Выбор данных",
SelectDataContent: "Измените диапазон данных, включенных в график.",
Sum: "сумма",
Average: "В среднем",
CountNumber: "Считать цифры",
Max: "Максимум",
Min: "Min",
ChartType: "Изменение типа диаграммы",
ChartTypeContent: "Изменение на другой тип диаграммы.",
AllCharts: "Все диаграммы",
defaultfont: "По умолчанию",
LGeneral: "Генеральная",
LCurrency: "валюта",
LAccounting: "бухгалтерский учет",
LDate: "Дата",
LTime: "Время",
LPercentage: "процент",
LFraction: "Доля",
LScientific: "научный",
LText: "Текст",
LCustom: "изготовленный на заказ",
FormatSample: "Образец",
Category: "Категория:",
Top: "верхний",
Center: "Центр",
Bottom: "Дно",
Left: "Левая (Отступ)",
Right: "Правильно",
Justify: "обосновывать",
GeneralTxt: "Общий формат ячейки не имеют никакого определенного формата номера.",
NegativeNumbersTxt: "Отрицательные цифры",
ThousandSeparatorTxt: "Использовать 1000 разделитель",
DecimalPlacesTxt: "Десятичные места:",
TextTxt: "Клетки формата текста рассматриваются как текст, даже если число в ячейке. Ячейки отображается точно так, как поступил.",
BoldItalic: "Жирный Курсив",
Regular: "регулярное",
HyperLinkHide: "<< Выбор в документе >>",
InvalidSheetIndex: "Укажите правильное SheetIndex",
HugeDataAlert: "Файл имеет слишком большой, чтобы открыть.",
ImportExportUrl: "Дайте импорта / экспорта, URL и повторите попытку.",
TitleColumnChart: "Кластерный Column / Stacked Column / 100% Stacked Column / 3D Кластерный Колонка / 3D Stacked Column / 3D 100% Stacked Column",
TitleBarChart: "Кластерный Бар / столбчатой / 100% столбчатой / 3D кластерного Бар / 3D столбчатой / 3D 100% столбчатой",
TitleRadarChart: "Радар / радар с маркерами",
TitleLineChart: "Line / Линия с маркерами",
TitleAreaChart: "Площадь / штабелях Площадь / 100% штабелях Площадь",
TitlePieChart: "Pie / 3D Pie / Кольцевая",
TitleScatterChart: "рассеивать",
BetweenAlert: "Максимальная должен быть больше или равен минимальному.",
BorderStyles: "Твердая / пунктирная / пунктирный",
FPaneAlert: "Замораживание Панель не применяется для первой ячейки",
ReplaceNotFound: "Электронная таблица не может найти соответствие.",
BlankWorkbook: "Пустая рабочая тетрадь",
SaveAsExcel: "Сохранить как Excel",
SaveAsCsv: "Сохранить как CSV",
Design: "ДИЗАЙН",
NewName: "Новое имя",
FormulaBar: "Панель формул",
NameBox: "Имя Box",
NumberValMsg: "Десятичные значения не могут быть использованы для условий чисел.",
NumberAlertMsg: "Введите только цифры.",
ListAlert: "Диапазон ячеек неверно, Пожалуйста, введите правильный диапазон ячеек.",
ListValAlert: "Исходный список должен быть ограничен список, или ссылка на одной строке или столбце.",
ListAlertMsg: "Введенное вами значение не является действительным",
AutoFillTitle: "параметры автозаполнения",
NewSheet: "Новый лист",
FullSheetCopyPasteAlert: "Мы не можем вставить, потому что область Копирование и область пасты не одинакового размера.",
Heading: "Заголовки",
Gridlines: "линии сетки",
Firstsheet: "Выделите первый лист",
Lastsheet: "Выделите последнего листа",
Nextsheet: "Выделите следующий лист",
Prevsheet: "Выделите предыдущий лист",
ProtectWorkbook: "Защита рабочей книги",
UnProtectWorkbook: "Unprotect Рабочая тетрадь",
ProtectWBContent: "Держите от других структурных изменений в вашей книге",
Password: "пароль",
ConfirmPassword: "Re Введите пароль для продолжения:",
PasswordAlert1: "Подтверждение пароля не совпадает.",
PasswordAlert2: "Пожалуйста, введите пароль.",
PasswordAlert3: "Вы указали пароль не является правильным. Убедитесь, что CAPS LOCK ключ выключен и обязательно использовать правильную капитализацию.",
Protect: "защищена.",
Lock: "Блокировка ячеек",
Unlock: "Разблокировать сотовый",
Protectsheet: "защитить лист",
ProtectSheetToolTip: "Предотвращение нежелательных изменений от других, ограничивая их возможность редактировать",
Unprotect: "Unprotect Sheet",
LockAlert: "Клетка вы пытаетесь изменить на защищенном листе. Чтобы внести изменения, нажмите кнопку Unprotect лист на вкладке Review.",
CreateRule: "Новое правило",
NewRule: "Новое форматирование Правило",
NewRuleLabelContent: "Значения формата, где эта формула верна:",
InsertDeleteAlert: "Эта операция не разрешена. Операция пытается переложить клетки в таблице на листе.",
ReadOnly: "Диапазон вы пытаетесь изменить содержит только для чтения ячеек.",
CreatePivotTable: "Создание сводной таблицы",
Range: "Ассортимент:",
ChoosePivotTable: "Выберите, где вы хотите, чтобы PivotTable быть помещены",
NewWorksheet: "Новый рабочий лист",
ExistingWorksheet: "Существующий рабочий лист",
Location: "Место нахождения:",
Refresh: "обновление",
PivotRowsAlert: "Эта команда требует, по меньшей мере, два ряда исходных данных. Вы не можете использовать команду на выбор только в одном ряду.",
PivotLabelsAlert: "Имя поля сводной таблицы не является действительным, чтобы создать отчет сводной таблицы, необходимо использовать данные, организованные в виде списка с мечеными столбцов. Если вы меняете имя поля сводной таблицы, вы должны ввести новое имя для поля.",
FieldList: "Список полей",
MergeSortAlert: "Чтобы сделать это, все слившиеся клетки должны быть одинакового размера.",
FormulaSortAlert: "Диапазон сортировки с формулой не могут быть отсортированы.",
MergePreventInsertDelete: "Эта операция не разрешена. Операция пытается переложить слияние ячеек на листе.",
FormulaRuleMsg: "Пожалуйста, введите правильный формат.",
MovePivotTable: "Переместить сводную таблицу",
MovePivotTableContent: "Переместить сводную таблицу в другое место в книге.",
ClearAllContent: "Удалить поля и фильтры.",
ChangeDataSource: "изменять",
ChangeDataSourceContent: "Измените исходные данные для этого сводной таблицы",
ChangePivotTableDataSource: "Изменение сводной таблицы источника данных",
TotalRowAlert: "Эта операция не разрешена. Операция пытается переложить клетки в таблице на листе. Нажмите кнопку ОК для продолжения всей строки.",
CellTypeAlert: "Эта операция не разрешена в прикладной диапазоне типа клеток.",
PivotOverlapAlert: "Отчет сводной таблицы не может перекрывать другой отчет сводной таблицы",
NoCellFound: "Не было обнаружено ни клетки",
};
if (ej.TreeGrid) ej.TreeGrid.Locale["ru-RU"] = {
toolboxTooltipTexts: {
addTool: "добавлять",
editTool: "редактировать",
updateTool: "обновление",
deleteTool: "удалять",
cancelTool: "отменить",
expandAllTool: "Развернуть все",
collapseAllTool: "Свернуть все",
pdfExportTool: "Экспорт в PDF",
excelExportTool: "Excel Экспорт"
},
contextMenuTexts: {
addRowText: "Добавить строку",
editText: "редактировать",
deleteText: "удалять",
saveText: "Сохранить",
cancelText: "отменить",
aboveText: "выше",
belowText: "ниже"
},
columnMenuTexts: {
sortAscendingText: "По возрастанию",
sortDescendingText: "Сортировка по убыванию",
columnsText: "Колонны",
freezeText: "замораживать",
unfreezeText: "размораживать",
freezePrecedingColumnsText: "Замораживание предыдущие столбцы",
insertColumnLeft: "Вставить столбец слева",
insertColumnRight: "Вставить столбец справа",
deleteColumn: "Удалить столбец",
renameColumn: "Переименовать столбец",
menuFilter: "Фильтр"
},
filterMenuTexts: {
stringMenuOptions: [
{ text: "Начинается с", value: "startswith" },
{ text: "Окончание: С", value: "endswith" },
{ text: "Содержит", value: "contains" },
{ text: "Равно", value: "equal" },
{ text: "Не равно", value: "notequal" }
],
numberMenuOptions: [
{ text: "Меньше, чем", value: "lessthan" },
{ text: "Больше чем", value: "greaterthan" },
{ text: "Меньше или равно", value: "lessthanorequal" },
{ text: "Больше или равно", value: "greaterthanorequal" },
{ text: "Равно", value: "equal" },
{ text: "Не равно", value: "notequal" }
],
filterValue: "Фильтр Значение",
filterButton: "Фильтр",
clearButton: "Очистить",
enterValueText: "введите значение"
},
columnDialogTexts: {
field: "поле",
headerText: "Текст заголовка",
editType: "Изменить тип",
filterEditType: "Фильтр Изменить тип",
allowFiltering: "Разрешить фильтрацию",
allowFilteringBlankContent: "Разрешить фильтрацию пустой Содержимое",
allowSorting: "Разрешить сортировка",
visible: "видимый",
width: "Ширина",
textAlign: "Выравнивание текста",
headerTextAlign: "Заголовок Выравнивание текста",
isFrozen: "Замерз",
allowFreezing: "Разрешить Замораживание",
columnsDropdownData: "Колонка выпадающим данных",
dropdownTableText: "Текст",
dropdownTableValue: "Стоимость",
addData: "Добавить",
deleteData: "Удалить",
allowCellSelection: "Разрешить выбор ячеек"
},
columnDialogTitle: {
insertColumn: "Вставить столбец",
deleteColumn: "Удалить столбец",
renameColumn: "Переименовать столбец"
},
deleteColumnText: "Вы уверены, что хотите удалить этот столбец?",
okButtonText: "ОК",
cancelButtonText: "Отмена",
confirmDeleteText: "Подтвердите удаление",
dropDownListBlanksText: "(Бланки)",
dropDownListClearText: "(Очистить фильтр)",
trueText: "правда",
falseText: "ложный",
emptyRecord: "Нет записей для отображения",
};
if (ej.Uploadbox) ej.Uploadbox.Locale["ru-RU"] = {
buttonText: {
upload: "Загрузить",
browse: "просматривать",
cancel: "отменить",
close: "близко"
},
dialogText: {
title: "Загрузить Box",
name: "имя",
size: "размер",
status: "статус"
},
dropAreaText: "Перетащите файлы или нажмите, чтобы загрузить",
filedetail: "Выбранный размер файла слишком велик. Выберите файл в рамках допустимого размера.",
denyError: "Файлы с расширениями #Extension не допускаются.",
allowError: "Только файлы с расширениями #Extension допускается.",
cancelToolTip: "отменить",
removeToolTip: "удалять",
retryToolTip: "Повторить",
completedToolTip: "Завершено",
failedToolTip: "Не удалось",
closeToolTip: "близко",
};
;
if (ej.Tile) ej.Tile.Locale["ru-RU"] = {
captionText: "текст"
};
if (ej.ListView) ej.ListView.Locale["ru-RU"] = {
headerTitle: "Название",
headerBackButtonText: "Назад"
};
if (ej.SpellCheck) ej.SpellCheck.Locale["ru-RU"] = {
SpellCheckButtonText: "орфография",
NotInDictionary: "Не в словаре",
SuggestionLabel: "Предложения",
IgnoreOnceButtonText: "Игнорировать После",
IgnoreAllButtonText: "Игнорировать все",
AddToDictionary: "Добавить в словарь",
ChangeButtonText: "+ Изменить",
ChangeAllButtonText: "Изменить все",
CloseButtonText: "Закрыть",
CompletionPopupMessage: "Проверка орфографии завершена",
CompletionPopupTitle: "Проверка орфографии",
Ok: "ОК",
NoSuggestionMessage: "Нет предложений, доступных"
}; | {
"content_hash": "fd66f2e257771236a804ef46bcf076f2",
"timestamp": "",
"source": "github",
"line_count": 2178,
"max_line_length": 402,
"avg_line_length": 41.304866850321396,
"alnum_prop": 0.6738289500011115,
"repo_name": "Asaf-S/jsdelivr",
"id": "fb2c437ef09d76c693a3d4d21c825cfd402ba0e9",
"size": "125270",
"binary": false,
"copies": "6",
"ref": "refs/heads/patch-1",
"path": "files/syncfusion-ej-global/15.1.34/l10n/ej.localetexts.ru-RU.js",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
/*
* Copyright 2007-2010 Joern Huxhorn
*
* 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 de.huxhorn.sulky.conditions;
import java.util.List;
public interface ConditionGroup
extends Condition
{
List<Condition> getConditions();
void setConditions(List<Condition> conditions);
}
| {
"content_hash": "3601bbb6845d0df8763bcb252485d09c",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 75,
"avg_line_length": 28.79310344827586,
"alnum_prop": 0.7245508982035929,
"repo_name": "166MMX/sulky",
"id": "6a8970ab1561368ea2026605e3409f9184048368",
"size": "1623",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sulky-conditions/src/main/java/de/huxhorn/sulky/conditions/ConditionGroup.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
from __future__ import annotations
import subprocess
from typing import TYPE_CHECKING, Any
from airflow.exceptions import AirflowException, AirflowNotFoundException
from airflow.hooks.base import BaseHook
if TYPE_CHECKING:
from airflow.models.connection import Connection
class SparkSqlHook(BaseHook):
"""
This hook is a wrapper around the spark-sql binary. It requires that the
"spark-sql" binary is in the PATH.
:param sql: The SQL query to execute
:param conf: arbitrary Spark configuration property
:param conn_id: connection_id string
:param total_executor_cores: (Standalone & Mesos only) Total cores for all executors
(Default: all the available cores on the worker)
:param executor_cores: (Standalone & YARN only) Number of cores per
executor (Default: 2)
:param executor_memory: Memory per executor (e.g. 1000M, 2G) (Default: 1G)
:param keytab: Full path to the file that contains the keytab
:param master: spark://host:port, mesos://host:port, yarn, or local
(Default: The ``host`` and ``port`` set in the Connection, or ``"yarn"``)
:param name: Name of the job.
:param num_executors: Number of executors to launch
:param verbose: Whether to pass the verbose flag to spark-sql
:param yarn_queue: The YARN queue to submit to
(Default: The ``queue`` value set in the Connection, or ``"default"``)
"""
conn_name_attr = "conn_id"
default_conn_name = "spark_sql_default"
conn_type = "spark_sql"
hook_name = "Spark SQL"
def __init__(
self,
sql: str,
conf: str | None = None,
conn_id: str = default_conn_name,
total_executor_cores: int | None = None,
executor_cores: int | None = None,
executor_memory: str | None = None,
keytab: str | None = None,
principal: str | None = None,
master: str | None = None,
name: str = "default-name",
num_executors: int | None = None,
verbose: bool = True,
yarn_queue: str | None = None,
) -> None:
super().__init__()
options: dict = {}
conn: Connection | None = None
try:
conn = self.get_connection(conn_id)
except AirflowNotFoundException:
conn = None
if conn:
options = conn.extra_dejson
# Set arguments to values set in Connection if not explicitly provided.
if master is None:
if conn is None:
master = "yarn"
elif conn.port:
master = f"{conn.host}:{conn.port}"
else:
master = conn.host
if yarn_queue is None:
yarn_queue = options.get("queue", "default")
self._sql = sql
self._conf = conf
self._total_executor_cores = total_executor_cores
self._executor_cores = executor_cores
self._executor_memory = executor_memory
self._keytab = keytab
self._principal = principal
self._master = master
self._name = name
self._num_executors = num_executors
self._verbose = verbose
self._yarn_queue = yarn_queue
self._sp: Any = None
def get_conn(self) -> Any:
pass
def _prepare_command(self, cmd: str | list[str]) -> list[str]:
"""
Construct the spark-sql command to execute. Verbose output is enabled
as default.
:param cmd: command to append to the spark-sql command
:return: full command to be executed
"""
connection_cmd = ["spark-sql"]
if self._conf:
for conf_el in self._conf.split(","):
connection_cmd += ["--conf", conf_el]
if self._total_executor_cores:
connection_cmd += ["--total-executor-cores", str(self._total_executor_cores)]
if self._executor_cores:
connection_cmd += ["--executor-cores", str(self._executor_cores)]
if self._executor_memory:
connection_cmd += ["--executor-memory", self._executor_memory]
if self._keytab:
connection_cmd += ["--keytab", self._keytab]
if self._principal:
connection_cmd += ["--principal", self._principal]
if self._num_executors:
connection_cmd += ["--num-executors", str(self._num_executors)]
if self._sql:
sql = self._sql.strip()
if sql.endswith(".sql") or sql.endswith(".hql"):
connection_cmd += ["-f", sql]
else:
connection_cmd += ["-e", sql]
if self._master:
connection_cmd += ["--master", self._master]
if self._name:
connection_cmd += ["--name", self._name]
if self._verbose:
connection_cmd += ["--verbose"]
if self._yarn_queue:
connection_cmd += ["--queue", self._yarn_queue]
if isinstance(cmd, str):
connection_cmd += cmd.split()
elif isinstance(cmd, list):
connection_cmd += cmd
else:
raise AirflowException(f"Invalid additional command: {cmd}")
self.log.debug("Spark-Sql cmd: %s", connection_cmd)
return connection_cmd
def run_query(self, cmd: str = "", **kwargs: Any) -> None:
"""
Remote Popen (actually execute the Spark-sql query)
:param cmd: command to append to the spark-sql command
:param kwargs: extra arguments to Popen (see subprocess.Popen)
"""
spark_sql_cmd = self._prepare_command(cmd)
self._sp = subprocess.Popen(
spark_sql_cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True, **kwargs
)
for line in iter(self._sp.stdout): # type: ignore
self.log.info(line)
returncode = self._sp.wait()
if returncode:
raise AirflowException(
f"Cannot execute '{self._sql}' on {self._master} (additional parameters: '{cmd}'). "
f"Process exit code: {returncode}."
)
def kill(self) -> None:
"""Kill Spark job"""
if self._sp and self._sp.poll() is None:
self.log.info("Killing the Spark-Sql job")
self._sp.kill()
| {
"content_hash": "5888fd69349a58da3799c568a36af1e6",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 110,
"avg_line_length": 36.00574712643678,
"alnum_prop": 0.5771747805267359,
"repo_name": "nathanielvarona/airflow",
"id": "d6f8f56c277321f776ebc36715c9636632fc3e0d",
"size": "7052",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "airflow/providers/apache/spark/hooks/spark_sql.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "25980"
},
{
"name": "Dockerfile",
"bytes": "70681"
},
{
"name": "HCL",
"bytes": "3786"
},
{
"name": "HTML",
"bytes": "173025"
},
{
"name": "JavaScript",
"bytes": "142848"
},
{
"name": "Jinja",
"bytes": "38895"
},
{
"name": "Jupyter Notebook",
"bytes": "5482"
},
{
"name": "Mako",
"bytes": "1339"
},
{
"name": "Python",
"bytes": "23169682"
},
{
"name": "R",
"bytes": "313"
},
{
"name": "Shell",
"bytes": "211967"
},
{
"name": "TypeScript",
"bytes": "484556"
}
],
"symlink_target": ""
} |
package fr.neamar.kiss.result;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.preference.PreferenceManager;
import android.support.annotation.MenuRes;
import android.text.Html;
import android.text.Spanned;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.PopupMenu;
import android.widget.Toast;
import fr.neamar.kiss.KissApplication;
import fr.neamar.kiss.MainActivity;
import fr.neamar.kiss.R;
import fr.neamar.kiss.adapter.RecordAdapter;
import fr.neamar.kiss.db.DBHelper;
import fr.neamar.kiss.pojo.AppPojo;
import fr.neamar.kiss.pojo.ContactsPojo;
import fr.neamar.kiss.pojo.PhonePojo;
import fr.neamar.kiss.pojo.Pojo;
import fr.neamar.kiss.pojo.SearchPojo;
import fr.neamar.kiss.pojo.SettingsPojo;
import fr.neamar.kiss.pojo.ShortcutsPojo;
import fr.neamar.kiss.pojo.TogglesPojo;
import fr.neamar.kiss.searcher.QueryInterface;
public abstract class Result {
/**
* Current information pojo
*/
Pojo pojo = null;
public static Result fromPojo(QueryInterface parent, Pojo pojo) {
if (pojo instanceof AppPojo)
return new AppResult((AppPojo) pojo);
else if (pojo instanceof ContactsPojo)
return new ContactsResult(parent, (ContactsPojo) pojo);
else if (pojo instanceof SearchPojo)
return new SearchResult((SearchPojo) pojo);
else if (pojo instanceof SettingsPojo)
return new SettingsResult((SettingsPojo) pojo);
else if (pojo instanceof TogglesPojo)
return new TogglesResult((TogglesPojo) pojo);
else if (pojo instanceof PhonePojo)
return new PhoneResult((PhonePojo) pojo);
else if (pojo instanceof ShortcutsPojo)
return new ShortcutsResult((ShortcutsPojo) pojo);
throw new RuntimeException("Unable to create a result from POJO");
}
/**
* How to display this record ?
*
* @param context android context
* @param convertView a view to be recycled
* @return a view to display as item
*/
public abstract View display(Context context, int position, View convertView);
/**
* How to display the popup menu
*
* @return a PopupMenu object
*/
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public PopupMenu getPopupMenu(final Context context, final RecordAdapter parent, View parentView) {
PopupMenu menu = buildPopupMenu(context, parent, parentView);
menu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
public boolean onMenuItemClick(MenuItem item) {
return popupMenuClickHandler(context, parent, item);
}
});
return menu;
}
/**
* Default popup menu implementation, can be overridden by children class to display a more specific menu
*
* @return an inflated, listener-free PopupMenu
*/
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
PopupMenu buildPopupMenu(Context context, final RecordAdapter parent, View parentView) {
return inflatePopupMenu(R.menu.menu_item_default, context, parentView);
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
protected PopupMenu inflatePopupMenu(@MenuRes int menuId, Context context, View parentView) {
PopupMenu menu = new PopupMenu(context, parentView);
menu.getMenuInflater().inflate(menuId, menu.getMenu());
// If app already pinned, do not display the "add to favorite" option
String favApps = PreferenceManager.getDefaultSharedPreferences(context).
getString("favorite-apps-list", "");
if (favApps.contains(this.pojo.id + ";")) {
menu.getMenu().removeItem(R.id.item_favorites_add);
}
return menu;
}
/**
* Handler for popup menu action.
* Default implementation only handle remove from history action.
*
* @return Works in the same way as onOptionsItemSelected, return true if the action has been handled, false otherwise
*/
Boolean popupMenuClickHandler(Context context, RecordAdapter parent, MenuItem item) {
switch (item.getItemId()) {
case R.id.item_remove:
removeItem(context, parent);
return true;
case R.id.item_favorites_add:
launchAddToFavorites(context, pojo);
break;
}
return false;
}
private void launchAddToFavorites(Context context, Pojo app) {
String msg = context.getResources().getString(R.string.toast_favorites_added);
KissApplication.getDataHandler(context).addToFavorites((MainActivity) context, app.id);
Toast.makeText(context, String.format(msg, app.name), Toast.LENGTH_SHORT).show();
}
/**
* Remove the current result from the list
*
* @param context android context
* @param parent adapter on which to remove the item
*/
private void removeItem(Context context, RecordAdapter parent) {
Toast.makeText(context, R.string.removed_item, Toast.LENGTH_SHORT).show();
parent.removeResult(this);
}
public final void launch(Context context, View v) {
Log.i("log", "Launching " + pojo.id);
recordLaunch(context);
// Launch
doLaunch(context, v);
}
/**
* How to launch this record ? Most probably, will fire an intent. This
* function must call recordLaunch()
*
* @param context android context
*/
protected abstract void doLaunch(Context context, View v);
/**
* How to launch this record "quickly" ? Most probably, same as doLaunch().
* Override to define another behavior.
*
* @param context android context
*/
public void fastLaunch(Context context) {
this.launch(context, null);
}
/**
* Return the icon for this Result, or null if non existing.
*
* @param context android context
*/
public Drawable getDrawable(Context context) {
return null;
}
/**
* Helper function to get a view
*
* @param context android context
* @param id id to inflate
* @return the view specified by the id
*/
View inflateFromId(Context context, int id) {
LayoutInflater vi = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
return vi.inflate(id, null);
}
/**
* Enrich text for display. Put text requiring highlighting between {}
*
* @param text to highlight
* @return text displayable on a textview
*/
Spanned enrichText(String text) {
return Html.fromHtml(text.replaceAll("\\{", "<font color=#4caf50>").replaceAll("\\}", "</font>"));
}
/**
* Put this item in application history
*
* @param context android context
*/
void recordLaunch(Context context) {
// Save in history
KissApplication.getDataHandler(context).addToHistory(pojo.id);
}
public void deleteRecord(Context context) {
DBHelper.removeFromHistory(context, pojo.id);
}
/*
* Get fill color from theme
*
*/
public int getThemeFillColor(Context context) {
int[] attrs = new int[]{R.attr.resultColor /* index 0 */};
TypedArray ta = context.obtainStyledAttributes(attrs);
return ta.getColor(0, Color.WHITE);
}
}
| {
"content_hash": "513597bd54086e1ba1647fbfdcfc44f6",
"timestamp": "",
"source": "github",
"line_count": 230,
"max_line_length": 122,
"avg_line_length": 33.11739130434783,
"alnum_prop": 0.662202967047394,
"repo_name": "bdube/KISS",
"id": "40fe7c5bb49cb45db36141319550d1ca2e705e32",
"size": "7617",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/java/fr/neamar/kiss/result/Result.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "192339"
}
],
"symlink_target": ""
} |
package org.netbeans.modeler.properties.util;
import java.beans.PropertyVetoException;
import java.util.Map;
import org.netbeans.modeler.component.IModelerPanel;
import org.netbeans.modeler.properties.view.manager.BasePropertyViewManager;
import org.netbeans.modeler.widget.properties.handler.PropertyVisibilityHandler;
import org.openide.nodes.Node;
import org.openide.nodes.NodeOperation;
import org.openide.util.Exceptions;
public class PropertyUtil {
public static void exploreProperties(BasePropertyViewManager node, String displayName, Map<String, PropertyVisibilityHandler> propertyVisibilityHandlerList) {
node.setDisplayName(displayName);
node.reloadSheet(propertyVisibilityHandlerList);
IModelerPanel modelerPanel = node.getModelerScene().getModelerPanelTopComponent();
if (modelerPanel.getExplorerManager().getRootContext() != node) {
modelerPanel.getExplorerManager().setRootContext(node);
try {
modelerPanel.getExplorerManager().setSelectedNodes(new Node[]{node});
} catch (PropertyVetoException ex) {
Exceptions.printStackTrace(ex);
}
modelerPanel.setActivatedNodes(new Node[]{node});
}
}
public static void refreshProperties(BasePropertyViewManager node, String displayName, Map<String, PropertyVisibilityHandler> propertyVisibilityHandlerList) {
node.setDisplayName(displayName);
node.reloadSheet(propertyVisibilityHandlerList);
IModelerPanel modelerPanel = node.getModelerScene().getModelerPanelTopComponent();
modelerPanel.getExplorerManager().setRootContext(node);
try {
modelerPanel.getExplorerManager().setSelectedNodes(new Node[]{node});
} catch (PropertyVetoException ex) {
Exceptions.printStackTrace(ex);
}
modelerPanel.setActivatedNodes(new Node[]{node});
}
public static void showProperties(BasePropertyViewManager node, String displayName, Map<String, PropertyVisibilityHandler> propertyVisibilityHandlerList) {
node.setDisplayName(displayName);
node.reloadSheet(propertyVisibilityHandlerList);
NodeOperation.getDefault().showProperties(node);
}
}
| {
"content_hash": "5eb9efe83d73dbe6209db0ac6ac3f85a",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 162,
"avg_line_length": 46.91836734693877,
"alnum_prop": 0.724227925184863,
"repo_name": "jGauravGupta/nbmodeler",
"id": "4d5ca1f2de3c58a5aa4108870e5737f404b41975",
"size": "2910",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "modeler-properties/src/main/java/org/netbeans/modeler/properties/util/PropertyUtil.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "1547130"
}
],
"symlink_target": ""
} |
#if !defined(AL_ALUT_H)
#define AL_ALUT_H
#if defined(_MSC_VER)
#include <OpenAL/alc.h>
#include <OpenAL/al.h>
#elif defined(__APPLE__)
#include <OpenAL/alc.h>
#include <OpenAL/al.h>
#else
#include <AL/al.h>
#include <AL/alc.h>
#endif
#if defined(__cplusplus)
extern "C" {
#endif
#if defined(_WIN32) && !defined(_XBOX)
#if defined (ALUT_BUILD_LIBRARY)
#define ALUT_API __declspec(dllexport)
#else
#define ALUT_API __declspec(dllimport)
#endif
#else
#if defined(ALUT_BUILD_LIBRARY) && defined(HAVE_GCC_VISIBILITY)
#define ALUT_API __attribute__((visibility("default")))
#else
#define ALUT_API extern
#endif
#endif
#if defined(_WIN32)
#define ALUT_APIENTRY __cdecl
#else
#define ALUT_APIENTRY
#endif
#if defined(__MWERKS_)
#pragma export on
#endif
/* Flag deprecated functions if possible (VisualC++ .NET and GCC >= 3.1.1). */
#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(MIDL_PASS)
#define ALUT_ATTRIBUTE_DEPRECATED __declspec(deprecated)
#elif defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && (__GNUC_MINOR__ > 1 || (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 1))))
#define ALUT_ATTRIBUTE_DEPRECATED __attribute__((deprecated))
#else
#define ALUT_ATTRIBUTE_DEPRECATED
#endif
#define ALUT_API_MAJOR_VERSION 1
#define ALUT_API_MINOR_VERSION 1
#define ALUT_ERROR_NO_ERROR 0
#define ALUT_ERROR_OUT_OF_MEMORY 0x200
#define ALUT_ERROR_INVALID_ENUM 0x201
#define ALUT_ERROR_INVALID_VALUE 0x202
#define ALUT_ERROR_INVALID_OPERATION 0x203
#define ALUT_ERROR_NO_CURRENT_CONTEXT 0x204
#define ALUT_ERROR_AL_ERROR_ON_ENTRY 0x205
#define ALUT_ERROR_ALC_ERROR_ON_ENTRY 0x206
#define ALUT_ERROR_OPEN_DEVICE 0x207
#define ALUT_ERROR_CLOSE_DEVICE 0x208
#define ALUT_ERROR_CREATE_CONTEXT 0x209
#define ALUT_ERROR_MAKE_CONTEXT_CURRENT 0x20A
#define ALUT_ERROR_DESTROY_CONTEXT 0x20B
#define ALUT_ERROR_GEN_BUFFERS 0x20C
#define ALUT_ERROR_BUFFER_DATA 0x20D
#define ALUT_ERROR_IO_ERROR 0x20E
#define ALUT_ERROR_UNSUPPORTED_FILE_TYPE 0x20F
#define ALUT_ERROR_UNSUPPORTED_FILE_SUBTYPE 0x210
#define ALUT_ERROR_CORRUPT_OR_TRUNCATED_DATA 0x211
#define ALUT_WAVEFORM_SINE 0x100
#define ALUT_WAVEFORM_SQUARE 0x101
#define ALUT_WAVEFORM_SAWTOOTH 0x102
#define ALUT_WAVEFORM_WHITENOISE 0x103
#define ALUT_WAVEFORM_IMPULSE 0x104
#define ALUT_LOADER_BUFFER 0x300
#define ALUT_LOADER_MEMORY 0x301
ALUT_API ALboolean ALUT_APIENTRY alutInit (int *argcp, char **argv);
ALUT_API ALboolean ALUT_APIENTRY alutInitWithoutContext (int *argcp, char **argv);
ALUT_API ALboolean ALUT_APIENTRY alutExit (void);
ALUT_API ALenum ALUT_APIENTRY alutGetError (void);
ALUT_API const char *ALUT_APIENTRY alutGetErrorString (ALenum error);
ALUT_API ALuint ALUT_APIENTRY alutCreateBufferFromFile (const char *fileName);
ALUT_API ALuint ALUT_APIENTRY alutCreateBufferFromFileImage (const ALvoid *data, ALsizei length);
ALUT_API ALuint ALUT_APIENTRY alutCreateBufferHelloWorld (void);
ALUT_API ALuint ALUT_APIENTRY alutCreateBufferWaveform (ALenum waveshape, ALfloat frequency, ALfloat phase, ALfloat duration);
ALUT_API ALvoid *ALUT_APIENTRY alutLoadMemoryFromFile (const char *fileName, ALenum *format, ALsizei *size, ALfloat *frequency);
ALUT_API ALvoid *ALUT_APIENTRY alutLoadMemoryFromFileImage (const ALvoid *data, ALsizei length, ALenum *format, ALsizei *size, ALfloat *frequency);
ALUT_API ALvoid *ALUT_APIENTRY alutLoadMemoryHelloWorld (ALenum *format, ALsizei *size, ALfloat *frequency);
ALUT_API ALvoid *ALUT_APIENTRY alutLoadMemoryWaveform (ALenum waveshape, ALfloat frequency, ALfloat phase, ALfloat duration, ALenum *format, ALsizei *size, ALfloat *freq);
ALUT_API const char *ALUT_APIENTRY alutGetMIMETypes (ALenum loader);
ALUT_API ALint ALUT_APIENTRY alutGetMajorVersion (void);
ALUT_API ALint ALUT_APIENTRY alutGetMinorVersion (void);
ALUT_API ALboolean ALUT_APIENTRY alutSleep (ALfloat duration);
/* Nasty Compatibility stuff, WARNING: THESE FUNCTIONS ARE STRONGLY DEPRECATED */
#if defined(__APPLE__)
ALUT_API ALUT_ATTRIBUTE_DEPRECATED void ALUT_APIENTRY alutLoadWAVFile (ALbyte *fileName, ALenum *format, void **data, ALsizei *size, ALsizei *frequency);
ALUT_API ALUT_ATTRIBUTE_DEPRECATED void ALUT_APIENTRY alutLoadWAVMemory (ALbyte *buffer, ALenum *format, void **data, ALsizei *size, ALsizei *frequency);
#else
ALUT_API ALUT_ATTRIBUTE_DEPRECATED void ALUT_APIENTRY alutLoadWAVFile (ALbyte *fileName, ALenum *format, void **data, ALsizei *size, ALsizei *frequency, ALboolean *loop);
ALUT_API ALUT_ATTRIBUTE_DEPRECATED void ALUT_APIENTRY alutLoadWAVMemory (ALbyte *buffer, ALenum *format, void **data, ALsizei *size, ALsizei *frequency, ALboolean *loop);
#endif
ALUT_API ALUT_ATTRIBUTE_DEPRECATED void ALUT_APIENTRY alutUnloadWAV (ALenum format, ALvoid *data, ALsizei size, ALsizei frequency);
#if defined(__MWERKS_)
#pragma export off
#endif
#if defined(__cplusplus)
}
#endif
#endif
| {
"content_hash": "2ec2042beba402ee0bd53abd9c05e1da",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 171,
"avg_line_length": 41.20634920634921,
"alnum_prop": 0.7120570107858244,
"repo_name": "flayneorange/DontBlink",
"id": "ad5b337d177153c07a009986f84e1b1af05f1e56",
"size": "5192",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "thirdParty/OpenAL/alut.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "267"
},
{
"name": "C",
"bytes": "1680074"
},
{
"name": "C++",
"bytes": "3808864"
},
{
"name": "CMake",
"bytes": "5947"
},
{
"name": "GLSL",
"bytes": "12330"
},
{
"name": "JavaScript",
"bytes": "1058"
},
{
"name": "Makefile",
"bytes": "35348"
},
{
"name": "Objective-C",
"bytes": "39969"
},
{
"name": "Shell",
"bytes": "153"
}
],
"symlink_target": ""
} |
/**
* \file
* Device drivers header file for MTS300 sensor board.
* \author
* Kasun Hewage <kasun.ch@gmail.com>
*/
#ifndef MTS300_H_
#define MTS300_H_
#include <avr/io.h>
#include "contiki-conf.h"
#define SOUNDER_PORT PORTC
#define SOUNDER_MASK _BV(2)
#define SOUNDER_DDR DDRC
/* MTS300CA and MTS310CA, the light sensor power is controlled
* by setting signal INT1(PORTE pin 5).
* Both light and thermistor use the same ADC channel.
*/
#define LIGHT_PORT_DDR DDRE
#define LIGHT_PORT PORTE
#define LIGHT_PIN_MASK _BV(5)
#define LIGHT_ADC_CHANNEL 1
/* MTS300CA and MTS310CA, the thermistor power is controlled
* by setting signal INT2(PORTE pin 6).
* Both light and thermistor use the same ADC channel.
*/
#define TEMP_PORT_DDR DDRE
#define TEMP_PORT PORTE
#define TEMP_PIN_MASK _BV(6)
#define TEMP_ADC_CHANNEL 1
/* Power is controlled to the accelerometer by setting signal
* PW4(PORTC pin 4), and the analog data is sampled on ADC3 and ADC4.
*/
#define ACCEL_PORT_DDR DDRC
#define ACCEL_PORT PORTC
#define ACCEL_PIN_MASK _BV(4)
#define ACCELX_ADC_CHANNEL 3
#define ACCELY_ADC_CHANNEL 4
/* Power is controlled to the magnetometer by setting signal
* PW5(PORTC pin 5), and the analog data is sampled on ADC5 and ADC6.
*/
#define MAGNET_PORT_DDR DDRC
#define MAGNET_PORT PORTC
#define MAGNET_PIN_MASK _BV(5)
#define MAGNETX_ADC_CHANNEL 5
#define MAGNETY_ADC_CHANNEL 6
#define MIC_PORT_DDR DDRC
#define MIC_PORT PORTC
#define MIC_PIN_MASK _BV(3)
#define MIC_ADC_CHANNEL 2
void sounder_on();
void sounder_off();
uint16_t get_light();
uint16_t get_temp();
uint16_t get_accx();
uint16_t get_accy();
uint16_t get_magx();
uint16_t get_magy();
uint16_t get_mic();
void mts300_init();
#endif /* MTS300_H_ */
| {
"content_hash": "33b4b9949d3a2fa44aed6c1bd70d8967",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 69,
"avg_line_length": 21.59259259259259,
"alnum_prop": 0.7169811320754716,
"repo_name": "Mfrielink/Project-Domotica-PowerModule",
"id": "0e07af0344fb3273d1eaee1c57a690b58ebe637c",
"size": "3406",
"binary": false,
"copies": "14",
"ref": "refs/heads/master",
"path": "Contiki/GccApplication1/contiki/platform/micaz/dev/sensors/mts300.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Awk",
"bytes": "95"
},
{
"name": "C",
"bytes": "13924401"
},
{
"name": "C++",
"bytes": "914247"
},
{
"name": "CSS",
"bytes": "10705"
},
{
"name": "D",
"bytes": "377478"
},
{
"name": "Gnuplot",
"bytes": "3141"
},
{
"name": "Java",
"bytes": "2806759"
},
{
"name": "JavaScript",
"bytes": "14044"
},
{
"name": "Makefile",
"bytes": "93690"
},
{
"name": "Objective-C",
"bytes": "3769"
},
{
"name": "Perl",
"bytes": "89010"
},
{
"name": "Python",
"bytes": "427565"
},
{
"name": "Shell",
"bytes": "7672"
},
{
"name": "XSLT",
"bytes": "4947"
}
],
"symlink_target": ""
} |
@implementation ZHTableResultCell
- (instancetype) initWithTableView :(UITableView *)tableView
{
static NSString *MatchesTableResult = @"resultCell";
ZHTableResultCell *cell = [tableView dequeueReusableCellWithIdentifier:MatchesTableResult];
if (cell == nil) {
cell = [[[NSBundle mainBundle] loadNibNamed:@"ZHTableResultCell" owner:nil options:nil] firstObject];
}
return cell;
}
+ (instancetype) cellWithTableView :(UITableView *)tableView
{
return [[self alloc]initWithTableView:tableView];
}
-(void)setPerformance:(ZHTeamPerformance *)performance
{
_performance = performance;
self.cellRowNumL.text = performance.rank;
self.teamNameL.text = performance.club_name;
NSString *picName = [NSString stringWithFormat:@"%@.png-small",performance.team_id];
[self.teamIconView sd_setImageWithURL:[NSURL URLWithString:ZHTeamsIconURL(picName)] placeholderImage:[UIImage imageNamed:@"teams_zqkong_ic_logo"]];
self.totalL.text = performance.matches_total;
self.wonL.text = performance.matches_won;
self.drawL.text = performance.matches_draw;
self.loseL.text = performance.matches_lost;
self.pro_againstL.text = [NSString stringWithFormat:@"%@/%@",performance.goals_pro,performance.goals_against];
self.pureWonL.text = [NSString stringWithFormat:@"%ld",[performance.goals_pro integerValue] - [performance.goals_against integerValue]];
self.pointsL.text = performance.points;
//给背景染色
if ([performance.rank integerValue] % 2) {
self.backgroundColor = tableViewBGColor;
}else
{
self.backgroundColor = [UIColor whiteColor];
}
//给前三名 染色
if ([performance.rank integerValue] <= 3) {
self.cellRowNumL.textColor = [UIColor orangeColor];
}else
{
self.cellRowNumL.textColor = [UIColor blackColor];
}
}
@end
| {
"content_hash": "b19ebb2a8b757658551d90906de45762",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 151,
"avg_line_length": 37.18,
"alnum_prop": 0.708445400753093,
"repo_name": "AppriaTT/zuqiukong",
"id": "b98c17d22dcf79036f887a7b8cfbe00068424390",
"size": "2139",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "足球控(DIY)/Matches/View/pageViewCell/ZHTableResultCell.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "875"
},
{
"name": "Objective-C",
"bytes": "464366"
}
],
"symlink_target": ""
} |
namespace FarmersCreed.Units
{
using System;
public abstract class GameObject
{
private string id;
public GameObject(string id)
{
this.Id = id;
}
public string Id
{
get { return this.id; }
set
{
if (String.IsNullOrEmpty(value))
{
throw new ArgumentNullException("Object id cannot be null!");
}
this.id = value;
}
}
public override string ToString()
{
return String.Format("--{0} {1}", this.GetType().Name, this.id);
}
}
}
| {
"content_hash": "4e164669286357aa7712d7e2debfd9f5",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 81,
"avg_line_length": 20.606060606060606,
"alnum_prop": 0.4411764705882353,
"repo_name": "g-yonchev/TelerikAcademy",
"id": "7463c7984302ffc1c7fc89843875ec3deb2574af",
"size": "682",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "Homeworks/C# OOP/ExamsPractice/SoftUni/12. OOP-Exam-24-Oct-2014/Problem-2-Farmers-Creed/Farmers-Creed-Solution/Farmers-Creed/Units/GameObject.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "227"
},
{
"name": "Batchfile",
"bytes": "326"
},
{
"name": "C#",
"bytes": "1857534"
},
{
"name": "CSS",
"bytes": "246579"
},
{
"name": "CoffeeScript",
"bytes": "2149"
},
{
"name": "HTML",
"bytes": "371407"
},
{
"name": "JavaScript",
"bytes": "225124"
},
{
"name": "Smalltalk",
"bytes": "1729"
},
{
"name": "XSLT",
"bytes": "1997"
}
],
"symlink_target": ""
} |
package org.zaproxy.zap.extension.spider;
import java.util.ArrayList;
import java.util.List;
import org.parosproxy.paros.Constant;
import org.zaproxy.zap.spider.DomainAlwaysInScopeMatcher;
import org.zaproxy.zap.view.AbstractMultipleOptionsTableModel;
class DomainsAlwaysInScopeTableModel extends AbstractMultipleOptionsTableModel<DomainAlwaysInScopeMatcher> {
private static final long serialVersionUID = -5411351965957264957L;
private static final String[] COLUMN_NAMES = {
Constant.messages.getString("spider.options.domains.in.scope.table.header.enabled"),
Constant.messages.getString("spider.options.domains.in.scope.table.header.regex"),
Constant.messages.getString("spider.options.domains.in.scope.table.header.value") };
private static final int COLUMN_COUNT = COLUMN_NAMES.length;
private List<DomainAlwaysInScopeMatcher> domainsInScope = new ArrayList<>(5);
public DomainsAlwaysInScopeTableModel() {
super();
}
@Override
public String getColumnName(int col) {
return COLUMN_NAMES[col];
}
@Override
public int getColumnCount() {
return COLUMN_COUNT;
}
@Override
public int getRowCount() {
return domainsInScope.size();
}
@Override
public boolean isCellEditable(int rowIndex, int columnIndex) {
return (columnIndex == 0);
}
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
switch (columnIndex) {
case 0:
return Boolean.valueOf(getElement(rowIndex).isEnabled());
case 1:
return Boolean.valueOf(getElement(rowIndex).isRegex());
case 2:
return getElement(rowIndex).getValue();
}
return null;
}
@Override
public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
if (columnIndex == 0 && aValue instanceof Boolean) {
domainsInScope.get(rowIndex).setEnabled(((Boolean) aValue).booleanValue());
fireTableCellUpdated(rowIndex, columnIndex);
}
}
@Override
public Class<?> getColumnClass(int c) {
if (c == 0 || c == 1) {
return Boolean.class;
}
return String.class;
}
public List<DomainAlwaysInScopeMatcher> getDomainsAlwaysInScope() {
return domainsInScope;
}
public void setDomainsAlwaysInScope(List<DomainAlwaysInScopeMatcher> domainsInScope) {
this.domainsInScope = new ArrayList<>(domainsInScope.size());
for (DomainAlwaysInScopeMatcher excludedDomain : domainsInScope) {
this.domainsInScope.add(new DomainAlwaysInScopeMatcher(excludedDomain));
}
fireTableDataChanged();
}
@Override
public List<DomainAlwaysInScopeMatcher> getElements() {
return domainsInScope;
}
}
| {
"content_hash": "93d3f3b74070f88a1059d0eff4b5b7dc",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 108,
"avg_line_length": 30.042105263157893,
"alnum_prop": 0.6748423265592152,
"repo_name": "GillesMoris/OSS",
"id": "2b4c0ff93b43f1dbe041d8967e885242340840e4",
"size": "3595",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/org/zaproxy/zap/extension/spider/DomainsAlwaysInScopeTableModel.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "184"
},
{
"name": "HTML",
"bytes": "3966192"
},
{
"name": "Java",
"bytes": "8169772"
},
{
"name": "JavaScript",
"bytes": "161857"
},
{
"name": "Lex",
"bytes": "7594"
},
{
"name": "PHP",
"bytes": "118474"
},
{
"name": "Perl",
"bytes": "3826"
},
{
"name": "Python",
"bytes": "54211"
},
{
"name": "Shell",
"bytes": "5827"
},
{
"name": "XSLT",
"bytes": "30697"
}
],
"symlink_target": ""
} |
module GeoConcerns
module Discovery
class DocumentBuilder
class SpatialBuilder
attr_reader :geo_concern
def initialize(geo_concern)
@geo_concern = geo_concern
end
# Builds spatial fields such as bounding box and solr geometry.
# @param [AbstractDocument] discovery document
def build(document)
document.solr_coverage = to_solr
end
private
# Parses coverage field from geo work and instantiates a coverage object.
# @return [GeoConcerns::Coverage] coverage object
def coverage
@coverage ||= GeoConcerns::Coverage.parse(geo_concern.coverage.first)
end
# Returns the coverage in solr format. For example:
# `ENVELOPE(minX, maxX, maxY, minY)`
# @see 'https://cwiki.apache.org/confluence/display/solr/Spatial+Search'
# @return [String] coverage in solr format
def to_solr
"ENVELOPE(#{coverage.w}, #{coverage.e}, #{coverage.n}, #{coverage.s})"
rescue
''
end
end
end
end
end
| {
"content_hash": "afa223eaa6df7717ce5bbfcc6ecd33f1",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 83,
"avg_line_length": 30.45945945945946,
"alnum_prop": 0.5962732919254659,
"repo_name": "projecthydra-labs/pcdm-geo-models",
"id": "20a6d182fc78f2e188621cf52b20dd96dea8faf3",
"size": "1127",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "app/services/geo_concerns/discovery/document_builder/spatial_builder.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "769"
},
{
"name": "HTML",
"bytes": "18156"
},
{
"name": "JavaScript",
"bytes": "766"
},
{
"name": "Ruby",
"bytes": "146842"
}
],
"symlink_target": ""
} |
/*
* Copyright (c) 2012, LiteStack, 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.
*/
#include <assert.h>
#include <sys/mman.h>
#include "src/loader/elf_util.h"
#include "src/syscalls/switch_to_app.h"
#include "src/platform/sel_memory.h"
#include "src/loader/sel_addrspace.h"
/*
* Fill from static_text_end to end of that page with halt
* instruction, which is at least NACL_HALT_LEN in size when no
* dynamic text is present. Does not touch dynamic text region, which
* should be pre-filled with HLTs.
*
* By adding NACL_HALT_SLED_SIZE, we ensure that the code region ends
* with HLTs, just in case the CPU has a bug in which it fails to
* check for running off the end of the x86 code segment.
*/
void static FillEndOfTextRegion(struct NaClApp *nap)
{
size_t page_pad;
/*
* NOTE: make sure we are not silently overwriting data. It is the
* toolchain's responsibility to ensure that a NACL_HALT_SLED_SIZE
* gap exists.
*/
ZLOGFAIL(0 != nap->data_start && nap->static_text_end
+ NACL_HALT_SLED_SIZE > nap->data_start, EFAULT,
"Missing gap between text and data for halt_sled");
ZLOGFAIL(0 != nap->rodata_start && nap->static_text_end
+ NACL_HALT_SLED_SIZE > nap->rodata_start, EFAULT,
"Missing gap between text and rodata for halt_sled");
/* No dynamic text exists. Space for NACL_HALT_SLED_SIZE must exist */
page_pad = ROUNDUP_64K(nap->static_text_end + NACL_HALT_SLED_SIZE)
- nap->static_text_end;
ZLOGFAIL(page_pad < NACL_HALT_SLED_SIZE, EFAULT, FAILED_MSG);
ZLOGFAIL(page_pad >= NACL_MAP_PAGESIZE + NACL_HALT_SLED_SIZE, EFAULT, FAILED_MSG);
ZLOGS(LOG_INSANE, "Filling with halts: %08lx, %08lx bytes",
nap->mem_start + nap->static_text_end, page_pad);
FillMemoryRegionWithHalt((void*)(nap->mem_start + nap->static_text_end), page_pad);
nap->static_text_end += page_pad;
}
/* Basic address space layout sanity check */
static void CheckAddressSpaceLayoutSanity(struct NaClApp *nap,
uintptr_t rodata_end, uintptr_t data_end, uintptr_t max_vaddr)
{
/* fail if Data segment exists, but is not last segment */
if(0 != nap->data_start)
ZLOGFAIL(data_end != max_vaddr, ENOEXEC, FAILED_MSG);
/*
* This should be unreachable, but we include it just for completeness
*
* Here is why it is unreachable:
*
* PhdrChecks checks the test segment starting address. The
* only allowed loaded segments are text, data, and rodata.
* Thus unless the rodata is in the trampoline region, it must
* be after the text. And ValidateProgramHeaders ensures that
* all segments start after the trampoline region.
*
* d'b: fail if no data segment. read-only data segment exists
* but is not last segment
*/
else if(0 != nap->rodata_start)
ZLOGFAIL(ROUNDUP_64K(rodata_end) != max_vaddr, ENOEXEC, FAILED_MSG);
/* fail if Read-only data segment overlaps data segment */
if(0 != nap->rodata_start && 0 != nap->data_start)
ZLOGFAIL(rodata_end > nap->data_start, ENOEXEC, FAILED_MSG);
/* fail if Text segment overlaps rodata segment */
if(0 != nap->rodata_start)
ZLOGFAIL(ROUNDUP_64K(NaClEndOfStaticText(nap)) > nap->rodata_start,
ENOEXEC, FAILED_MSG);
/* fail if No rodata segment, and text segment overlaps data segment */
else if(0 != nap->data_start)
ZLOGFAIL(ROUNDUP_64K(NaClEndOfStaticText(nap)) > nap->data_start,
ENOEXEC, FAILED_MSG);
/* fail if rodata_start not a multiple of allocation size */
ZLOGFAIL(0 != nap->rodata_start && ROUNDUP_64K(nap->rodata_start)
!= nap->rodata_start, ENOEXEC, FAILED_MSG);
/* fail if data_start not a multiple of allocation size */
ZLOGFAIL(0 != nap->data_start && ROUNDUP_64K(nap->data_start)
!= nap->data_start, ENOEXEC, FAILED_MSG);
}
#define DUMP(a) ZLOGS(LOG_INSANE, "%-24s = 0x%016x", #a, a)
static void LogAddressSpaceLayout(struct NaClApp *nap)
{
ZLOGS(LOG_INSANE, "NaClApp addr space layout:");
DUMP(nap->static_text_end);
DUMP(nap->dynamic_text_start);
DUMP(nap->dynamic_text_end);
DUMP(nap->rodata_start);
DUMP(nap->data_start);
DUMP(nap->data_end);
DUMP(nap->break_addr);
DUMP(nap->initial_entry_pt);
DUMP(nap->user_entry_pt);
}
static int AddrIsValidEntryPt(struct NaClApp *nap, uintptr_t addr)
{
if(0 != (addr & (NACL_INSTR_BLOCK_SIZE - 1))) return 0;
return addr < nap->static_text_end;
}
void AppLoadFile(struct Gio *gp, struct NaClApp *nap)
{
uintptr_t rodata_end;
uintptr_t data_end;
uintptr_t max_vaddr;
struct ElfImage *image = NULL;
int err;
/* fail if Address space too big */
ZLOGFAIL(nap->addr_bits > NACL_MAX_ADDR_BITS, EFAULT, FAILED_MSG);
nap->stack_size = ROUNDUP_64K(nap->stack_size);
/* temporay object will be deleted at end of function */
image = ElfImageNew(gp);
ValidateElfHeader(image);
ValidateProgramHeaders(image, nap->addr_bits, &nap->static_text_end,
&nap->rodata_start, &rodata_end, &nap->data_start, &data_end, &max_vaddr);
/*
* if no rodata and no data, we make sure that there is space for
* the halt sled. else if no data, but there is rodata. this means
* max_vaddr is just where rodata ends. this might not be at an
* allocation boundary, and in this the page would not be writable.
* round max_vaddr up to the next allocation boundary so that bss
* will be at the next writable region.
*/
if(0 == nap->data_start)
{
if(0 == nap->rodata_start)
{
if(ROUNDUP_64K(max_vaddr) - max_vaddr < NACL_HALT_SLED_SIZE)
max_vaddr += NACL_MAP_PAGESIZE;
}
max_vaddr = ROUNDUP_64K(max_vaddr);
}
/*
* max_vaddr -- the break or the boundary between data (initialized
* and bss) and the address space hole -- does not have to be at a
* page boundary.
*/
nap->break_addr = max_vaddr;
nap->data_end = max_vaddr;
ZLOGS(LOG_INSANE, "Values from ValidateProgramHeaders:");
DUMP(nap->rodata_start);
DUMP(rodata_end);
DUMP(nap->data_start);
DUMP(data_end);
DUMP(max_vaddr);
nap->initial_entry_pt = ElfImageGetEntryPoint(image);
LogAddressSpaceLayout(nap);
/* Bad program entry point address */
ZLOGFAIL(!AddrIsValidEntryPt(nap, nap->initial_entry_pt), ENOEXEC, FAILED_MSG);
CheckAddressSpaceLayoutSanity(nap, rodata_end, data_end, max_vaddr);
ZLOGS(LOG_DEBUG, "Allocating address space");
AllocAddrSpace(nap);
/*
* Make sure the static image pages are marked writable before we try
* to write them.
*/
ZLOGS(LOG_DEBUG, "Loading into memory");
err = NaCl_mprotect((void *)(nap->mem_start + NACL_TRAMPOLINE_START),
ROUNDUP_64K(nap->data_end) - NACL_TRAMPOLINE_START,
PROT_READ | PROT_WRITE);
ZLOGFAIL(0 != err, EFAULT, "Failed to make image pages writable. errno = %d", err);
ElfImageLoad(image, gp, nap->addr_bits, nap->mem_start);
/* d'b: shared memory for the dynamic text disabled */
nap->dynamic_text_start = ROUNDUP_64K(NaClEndOfStaticText(nap));
nap->dynamic_text_end = nap->dynamic_text_start;
/*
* FillEndOfTextRegion will fill with halt instructions the
* padding space after the static text region.
*
* Shm-backed dynamic text space was filled with halt instructions
* in NaClMakeDynamicTextShared. This extends to the rodata. For
* non-shm-backed text space, this extend to the next page (and not
* allocation page). static_text_end is updated to include the
* padding.
*/
FillEndOfTextRegion(nap);
ZLOGS(LOG_DEBUG, "Initializing arch switcher");
InitSwitchToApp(nap);
ZLOGS(LOG_DEBUG, "Installing trampoline");
LoadTrampoline(nap);
/*
* NaClMemoryProtect also initializes the mem_map w/ information
* about the memory pages and their current protection value.
*
* The contents of the dynamic text region will get remapped as
* non-writable.
*/
ZLOGS(LOG_DEBUG, "Applying memory protection");
MemoryProtection(nap);
ZLOGS(LOG_DEBUG, "AppLoadFile done");
LogAddressSpaceLayout(nap);
ElfImageDelete(image);
}
#undef DUMP
NORETURN void CreateSession(struct NaClApp *nap)
{
uintptr_t stack_ptr;
assert(nap != NULL);
/* set up user stack */
stack_ptr = nap->mem_start + ((uintptr_t)1U << nap->addr_bits);
stack_ptr -= STACK_USER_DATA_SIZE;
memset((void*)stack_ptr, 0, STACK_USER_DATA_SIZE);
((uint32_t*)stack_ptr)[4] = 1;
((uint32_t*)stack_ptr)[5] = 0xfffffff0;
/*
* construct "nacl_user" and "nacl_sys" globals
* note: nacl_sys->prog_ctr meaningless but should not be 0
*/
ThreadContextCtor(nacl_user, nap, nap->initial_entry_pt, stack_ptr);
ThreadContextCtor(nacl_sys, nap, 1, GetStackPtr());
/* pass control to the user side */
ZLOGS(LOG_DEBUG, "SESSION %d STARTED", nap->manifest->node);
ContextSwitch(nacl_user);
ZLOGFAIL(1, EFAULT, "the unreachable has been reached");
}
| {
"content_hash": "c261c87ca73469c5f424c09a4626e9d1",
"timestamp": "",
"source": "github",
"line_count": 271,
"max_line_length": 85,
"avg_line_length": 34.25092250922509,
"alnum_prop": 0.6889678948502478,
"repo_name": "painterjd/zerovm-2.0",
"id": "09b71a7381ce7e342ab868fc9f42e1dbf004cae4",
"size": "9462",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/loader/sel.c",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
#include <numeric>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include "sdd/sdd.hh"
#include "sdd/tools/size.hh"
using namespace std;
struct conf
: public sdd::flat_set_default_configuration
{
using Identifier = unsigned int;
using Values = sdd::values::flat_set<char>;
};
using SDD = sdd::SDD<conf>;
using values_type = conf::Values;
int
main (int argc, const char** argv)
{
if (argc < 3)
{
cerr << "Not enough arguments: width height" << endl;
return 1;
}
const size_t width = stoi (argv[1]);
const size_t height = stoi (argv[2]);
cout << "Width: " << width << ", Height: " << height << endl;
conf c;
c.final_cleanup = false;
c.hom_cache_size = 2;
c.hom_unique_table_size = 2;
c.sdd_unique_table_size = 100000000;
auto manager = sdd::init<conf>(c);
/*
vector<unsigned int> v(height);
iota(v.begin(), v.end(), 0);
sdd::order_builder<conf> ob;
const sdd::order<conf> order(sdd::order_builder<conf>(v.begin(), v.end()));
*/
values_type values;
for (char j = 0; j != width; ++j)
values.insert(j);
auto result = new SDD(sdd::one<conf>());
for (unsigned int i = 0; i != height; ++i)
{
*result = SDD (i, values, *result);
}
//cout << "Size: " << result.size() << " bytes" << endl;
return 0;
}
| {
"content_hash": "f62a4767812f0a5bce63163b15562503",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 77,
"avg_line_length": 21.044776119402986,
"alnum_prop": 0.6106382978723405,
"repo_name": "saucisson/dd-words",
"id": "a8bdc95993c77d73d63eaf509f43cef94ced4638",
"size": "1410",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/height/sdd.cc",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "61186"
},
{
"name": "Lua",
"bytes": "27637"
},
{
"name": "Shell",
"bytes": "5036"
}
],
"symlink_target": ""
} |
package vars
import "github.com/codegangsta/cli"
var Cli *cli.App
func init() {
Cli = cli.NewApp()
Cli.Name = NAME
Cli.Usage = DESCRIPTION
Cli.Version = VERSION
Cli.Author = AUTHOR + " " + AUTHOR_EMAIL
}
| {
"content_hash": "033aa8708684c4c0107426b66ccbdc79",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 41,
"avg_line_length": 16.307692307692307,
"alnum_prop": 0.6839622641509434,
"repo_name": "insionng/purine",
"id": "869ac733b8332869c07b02bd5ca63fc6481c6de3",
"size": "212",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/vars/cmd.go",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "23561"
},
{
"name": "Go",
"bytes": "2430177"
},
{
"name": "JavaScript",
"bytes": "147294"
},
{
"name": "XSLT",
"bytes": "3909"
}
],
"symlink_target": ""
} |
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("DEMO")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DEMO")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("a06bb380-5c7e-45b6-9463-ecfc68a872e2")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| {
"content_hash": "71fd507322daeebd1d09da60b0b49002",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 84,
"avg_line_length": 38.361111111111114,
"alnum_prop": 0.7422157856625634,
"repo_name": "kalinmarkov/SoftUni",
"id": "0ccddbcff717d39a8c35ca376ef49ce9e95448b6",
"size": "1384",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Programming Fundamentals/05.MethodsAndDebuggingLab/DEMO/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "399"
},
{
"name": "Batchfile",
"bytes": "13483"
},
{
"name": "C#",
"bytes": "1616313"
},
{
"name": "CSS",
"bytes": "919718"
},
{
"name": "HTML",
"bytes": "119725"
},
{
"name": "Java",
"bytes": "59878"
},
{
"name": "JavaScript",
"bytes": "400825"
},
{
"name": "PHP",
"bytes": "9586"
},
{
"name": "PLSQL",
"bytes": "598162"
},
{
"name": "SQLPL",
"bytes": "3168"
},
{
"name": "Shell",
"bytes": "14116"
}
],
"symlink_target": ""
} |
require 'remit/common'
module Remit
module GetAccountBalance
class Request < Remit::Request
action :GetAccountBalance
end
class Response < Remit::Response
class GetAccountBalanceResult < Remit::BaseResponse
class AccountBalance < Remit::BaseResponse
class AvailableBalances < Remit::BaseResponse
parameter :disburse_balance, :type => Amount
parameter :refund_balance, :type => Amount
end
parameter :total_balance, :type => Amount
parameter :pending_in_balance, :type => Amount
parameter :pending_out_balance, :type => Amount
parameter :available_balances, :type => AvailableBalances
end
parameter :account_balance, :type=>AccountBalance
end
parameter :get_account_balance_result, :type => GetAccountBalanceResult
parameter :response_metadata, :type=>ResponseMetadata
end
def get_account_balance(request = Request.new)
call(request, Response)
end
end
end
| {
"content_hash": "2902a61da7eac4a94270164adfa3df66",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 77,
"avg_line_length": 32.25,
"alnum_prop": 0.6637596899224806,
"repo_name": "tylerhunt/remit",
"id": "0e5983578577f99dab64fd115bf034cfff3870fc",
"size": "1032",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/remit/operations/get_account_balance.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "124282"
}
],
"symlink_target": ""
} |
package catan.client.graphics.ui;
/**
* Created by greg on 6/4/16.
* Interface for objects that have structure that needs an update following an external change.
*/
@FunctionalInterface
public interface Updatable {
void update();
}
| {
"content_hash": "f3a3d58609acce1be7fa2dbb963c3f8a",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 95,
"avg_line_length": 21.90909090909091,
"alnum_prop": 0.7385892116182573,
"repo_name": "gharris1727/Catan",
"id": "b7bbecc3768f1d008985aa227d76b7edfa265328",
"size": "241",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "catan/src/main/java/catan/client/graphics/ui/Updatable.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "717707"
}
],
"symlink_target": ""
} |
package com.microsoft.azure.management.network.v2018_12_01.implementation;
import java.util.List;
import com.microsoft.azure.management.network.v2018_12_01.ExpressRouteCircuitRoutesTableSummary;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Response for ListRoutesTable associated with the Express Route Circuits API.
*/
public class ExpressRouteCircuitsRoutesTableSummaryListResultInner {
/**
* A list of the routes table.
*/
@JsonProperty(value = "value")
private List<ExpressRouteCircuitRoutesTableSummary> value;
/**
* The URL to get the next set of results.
*/
@JsonProperty(value = "nextLink")
private String nextLink;
/**
* Get a list of the routes table.
*
* @return the value value
*/
public List<ExpressRouteCircuitRoutesTableSummary> value() {
return this.value;
}
/**
* Set a list of the routes table.
*
* @param value the value value to set
* @return the ExpressRouteCircuitsRoutesTableSummaryListResultInner object itself.
*/
public ExpressRouteCircuitsRoutesTableSummaryListResultInner withValue(List<ExpressRouteCircuitRoutesTableSummary> value) {
this.value = value;
return this;
}
/**
* Get the URL to get the next set of results.
*
* @return the nextLink value
*/
public String nextLink() {
return this.nextLink;
}
/**
* Set the URL to get the next set of results.
*
* @param nextLink the nextLink value to set
* @return the ExpressRouteCircuitsRoutesTableSummaryListResultInner object itself.
*/
public ExpressRouteCircuitsRoutesTableSummaryListResultInner withNextLink(String nextLink) {
this.nextLink = nextLink;
return this;
}
}
| {
"content_hash": "cbead60c3b51fcabf7c44bed7ee28cc3",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 127,
"avg_line_length": 27.815384615384616,
"alnum_prop": 0.6858407079646017,
"repo_name": "navalev/azure-sdk-for-java",
"id": "2f9f9e08e2693d7feba64c388b2273abd4890a49",
"size": "2038",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "sdk/network/mgmt-v2018_12_01/src/main/java/com/microsoft/azure/management/network/v2018_12_01/implementation/ExpressRouteCircuitsRoutesTableSummaryListResultInner.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "7230"
},
{
"name": "CSS",
"bytes": "5411"
},
{
"name": "Groovy",
"bytes": "1570436"
},
{
"name": "HTML",
"bytes": "29221"
},
{
"name": "Java",
"bytes": "250218562"
},
{
"name": "JavaScript",
"bytes": "15605"
},
{
"name": "PowerShell",
"bytes": "30924"
},
{
"name": "Python",
"bytes": "42119"
},
{
"name": "Shell",
"bytes": "1408"
}
],
"symlink_target": ""
} |
#pragma once
#include "../Core/Object.h"
namespace Urho3D
{
/// Physics world is about to be stepped.
URHO3D_EVENT(E_PHYSICSPRESTEP, PhysicsPreStep)
{
URHO3D_PARAM(P_WORLD, World); // PhysicsWorld pointer
URHO3D_PARAM(P_TIMESTEP, TimeStep); // float
}
/// Physics world has been stepped.
URHO3D_EVENT(E_PHYSICSPOSTSTEP, PhysicsPostStep)
{
URHO3D_PARAM(P_WORLD, World); // PhysicsWorld pointer
URHO3D_PARAM(P_TIMESTEP, TimeStep); // float
}
/// Physics collision started. Global event sent by the PhysicsWorld.
URHO3D_EVENT(E_PHYSICSCOLLISIONSTART, PhysicsCollisionStart)
{
URHO3D_PARAM(P_WORLD, World); // PhysicsWorld pointer
URHO3D_PARAM(P_NODEA, NodeA); // Node pointer
URHO3D_PARAM(P_NODEB, NodeB); // Node pointer
URHO3D_PARAM(P_BODYA, BodyA); // RigidBody pointer
URHO3D_PARAM(P_BODYB, BodyB); // RigidBody pointer
URHO3D_PARAM(P_TRIGGER, Trigger); // bool
URHO3D_PARAM(P_CONTACTS, Contacts); // Buffer containing position (Vector3), normal (Vector3), distance (float), impulse (float) for each contact
}
/// Physics collision ongoing. Global event sent by the PhysicsWorld.
URHO3D_EVENT(E_PHYSICSCOLLISION, PhysicsCollision)
{
URHO3D_PARAM(P_WORLD, World); // PhysicsWorld pointer
URHO3D_PARAM(P_NODEA, NodeA); // Node pointer
URHO3D_PARAM(P_NODEB, NodeB); // Node pointer
URHO3D_PARAM(P_BODYA, BodyA); // RigidBody pointer
URHO3D_PARAM(P_BODYB, BodyB); // RigidBody pointer
URHO3D_PARAM(P_TRIGGER, Trigger); // bool
URHO3D_PARAM(P_CONTACTS, Contacts); // Buffer containing position (Vector3), normal (Vector3), distance (float), impulse (float) for each contact
}
/// Physics collision ended. Global event sent by the PhysicsWorld.
URHO3D_EVENT(E_PHYSICSCOLLISIONEND, PhysicsCollisionEnd)
{
URHO3D_PARAM(P_WORLD, World); // PhysicsWorld pointer
URHO3D_PARAM(P_NODEA, NodeA); // Node pointer
URHO3D_PARAM(P_NODEB, NodeB); // Node pointer
URHO3D_PARAM(P_BODYA, BodyA); // RigidBody pointer
URHO3D_PARAM(P_BODYB, BodyB); // RigidBody pointer
URHO3D_PARAM(P_TRIGGER, Trigger); // bool
}
/// Node's physics collision started. Sent by scene nodes participating in a collision.
URHO3D_EVENT(E_NODECOLLISIONSTART, NodeCollisionStart)
{
URHO3D_PARAM(P_BODY, Body); // RigidBody pointer
URHO3D_PARAM(P_OTHERNODE, OtherNode); // Node pointer
URHO3D_PARAM(P_OTHERBODY, OtherBody); // RigidBody pointer
URHO3D_PARAM(P_TRIGGER, Trigger); // bool
URHO3D_PARAM(P_CONTACTS, Contacts); // Buffer containing position (Vector3), normal (Vector3), distance (float), impulse (float) for each contact
}
/// Node's physics collision ongoing. Sent by scene nodes participating in a collision.
URHO3D_EVENT(E_NODECOLLISION, NodeCollision)
{
URHO3D_PARAM(P_BODY, Body); // RigidBody pointer
URHO3D_PARAM(P_OTHERNODE, OtherNode); // Node pointer
URHO3D_PARAM(P_OTHERBODY, OtherBody); // RigidBody pointer
URHO3D_PARAM(P_TRIGGER, Trigger); // bool
URHO3D_PARAM(P_CONTACTS, Contacts); // Buffer containing position (Vector3), normal (Vector3), distance (float), impulse (float) for each contact
}
/// Node's physics collision ended. Sent by scene nodes participating in a collision.
URHO3D_EVENT(E_NODECOLLISIONEND, NodeCollisionEnd)
{
URHO3D_PARAM(P_BODY, Body); // RigidBody pointer
URHO3D_PARAM(P_OTHERNODE, OtherNode); // Node pointer
URHO3D_PARAM(P_OTHERBODY, OtherBody); // RigidBody pointer
URHO3D_PARAM(P_TRIGGER, Trigger); // bool
}
}
| {
"content_hash": "dc24eb0ab7ff9d5479a9c3645dbd28e2",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 160,
"avg_line_length": 47.32183908045977,
"alnum_prop": 0.6113675006072383,
"repo_name": "henu/Urho3D",
"id": "36cb690980c60011a380873b932da980e8008705",
"size": "5266",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Source/Urho3D/Physics/PhysicsEvents.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "AngelScript",
"bytes": "1469823"
},
{
"name": "Batchfile",
"bytes": "16525"
},
{
"name": "C++",
"bytes": "8447844"
},
{
"name": "CMake",
"bytes": "419059"
},
{
"name": "GLSL",
"bytes": "154112"
},
{
"name": "HLSL",
"bytes": "178063"
},
{
"name": "HTML",
"bytes": "1375"
},
{
"name": "Kotlin",
"bytes": "37830"
},
{
"name": "Lua",
"bytes": "589903"
},
{
"name": "MAXScript",
"bytes": "94704"
},
{
"name": "Objective-C",
"bytes": "6539"
},
{
"name": "Ruby",
"bytes": "56113"
},
{
"name": "Shell",
"bytes": "27473"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "7f4bf761815458b5451fe106b4822bda",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "c198b788d0177697e7e22beee9401024bf3e246a",
"size": "179",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Rosales/Moraceae/Piratinera/Piratinera angustifolia/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
#undef __NO_VERSION__
#include <linux/file.h>
#include "device.h"
#include "card.h"
#include "channel.h"
#include "baseband.h"
#include "mac.h"
#include "power.h"
#include "rxtx.h"
#include "dpc.h"
#include "rf.h"
#include <linux/delay.h>
#include <linux/kthread.h>
#include <linux/slab.h>
/*--------------------- Static Definitions -------------------------*/
/*
* Define module options
*/
MODULE_AUTHOR("VIA Networking Technologies, Inc., <lyndonchen@vntek.com.tw>");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("VIA Networking Solomon-A/B/G Wireless LAN Adapter Driver");
#define DEVICE_PARAM(N, D)
#define RX_DESC_MIN0 16
#define RX_DESC_MAX0 128
#define RX_DESC_DEF0 32
DEVICE_PARAM(RxDescriptors0, "Number of receive descriptors0");
#define RX_DESC_MIN1 16
#define RX_DESC_MAX1 128
#define RX_DESC_DEF1 32
DEVICE_PARAM(RxDescriptors1, "Number of receive descriptors1");
#define TX_DESC_MIN0 16
#define TX_DESC_MAX0 128
#define TX_DESC_DEF0 32
DEVICE_PARAM(TxDescriptors0, "Number of transmit descriptors0");
#define TX_DESC_MIN1 16
#define TX_DESC_MAX1 128
#define TX_DESC_DEF1 64
DEVICE_PARAM(TxDescriptors1, "Number of transmit descriptors1");
#define INT_WORKS_DEF 20
#define INT_WORKS_MIN 10
#define INT_WORKS_MAX 64
DEVICE_PARAM(int_works, "Number of packets per interrupt services");
#define RTS_THRESH_DEF 2347
#define FRAG_THRESH_DEF 2346
#define SHORT_RETRY_MIN 0
#define SHORT_RETRY_MAX 31
#define SHORT_RETRY_DEF 8
DEVICE_PARAM(ShortRetryLimit, "Short frame retry limits");
#define LONG_RETRY_MIN 0
#define LONG_RETRY_MAX 15
#define LONG_RETRY_DEF 4
DEVICE_PARAM(LongRetryLimit, "long frame retry limits");
/* BasebandType[] baseband type selected
0: indicate 802.11a type
1: indicate 802.11b type
2: indicate 802.11g type
*/
#define BBP_TYPE_MIN 0
#define BBP_TYPE_MAX 2
#define BBP_TYPE_DEF 2
DEVICE_PARAM(BasebandType, "baseband type");
/*
* Static vars definitions
*/
static const struct pci_device_id vt6655_pci_id_table[] = {
{ PCI_VDEVICE(VIA, 0x3253) },
{ 0, }
};
/*--------------------- Static Functions --------------------------*/
static int vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent);
static void device_free_info(struct vnt_private *priv);
static void device_print_info(struct vnt_private *priv);
static void device_init_rd0_ring(struct vnt_private *priv);
static void device_init_rd1_ring(struct vnt_private *priv);
static void device_init_td0_ring(struct vnt_private *priv);
static void device_init_td1_ring(struct vnt_private *priv);
static int device_rx_srv(struct vnt_private *priv, unsigned int idx);
static int device_tx_srv(struct vnt_private *priv, unsigned int idx);
static bool device_alloc_rx_buf(struct vnt_private *, struct vnt_rx_desc *);
static void device_init_registers(struct vnt_private *priv);
static void device_free_tx_buf(struct vnt_private *, struct vnt_tx_desc *);
static void device_free_td0_ring(struct vnt_private *priv);
static void device_free_td1_ring(struct vnt_private *priv);
static void device_free_rd0_ring(struct vnt_private *priv);
static void device_free_rd1_ring(struct vnt_private *priv);
static void device_free_rings(struct vnt_private *priv);
/*--------------------- Export Variables --------------------------*/
/*--------------------- Export Functions --------------------------*/
static void vt6655_remove(struct pci_dev *pcid)
{
struct vnt_private *priv = pci_get_drvdata(pcid);
if (priv == NULL)
return;
device_free_info(priv);
}
static void device_get_options(struct vnt_private *priv)
{
struct vnt_options *opts = &priv->opts;
opts->rx_descs0 = RX_DESC_DEF0;
opts->rx_descs1 = RX_DESC_DEF1;
opts->tx_descs[0] = TX_DESC_DEF0;
opts->tx_descs[1] = TX_DESC_DEF1;
opts->int_works = INT_WORKS_DEF;
opts->short_retry = SHORT_RETRY_DEF;
opts->long_retry = LONG_RETRY_DEF;
opts->bbp_type = BBP_TYPE_DEF;
}
static void
device_set_options(struct vnt_private *priv)
{
priv->byShortRetryLimit = priv->opts.short_retry;
priv->byLongRetryLimit = priv->opts.long_retry;
priv->byBBType = priv->opts.bbp_type;
priv->byPacketType = priv->byBBType;
priv->byAutoFBCtrl = AUTO_FB_0;
priv->bUpdateBBVGA = true;
priv->byPreambleType = 0;
pr_debug(" byShortRetryLimit= %d\n", (int)priv->byShortRetryLimit);
pr_debug(" byLongRetryLimit= %d\n", (int)priv->byLongRetryLimit);
pr_debug(" byPreambleType= %d\n", (int)priv->byPreambleType);
pr_debug(" byShortPreamble= %d\n", (int)priv->byShortPreamble);
pr_debug(" byBBType= %d\n", (int)priv->byBBType);
}
/*
* Initialisation of MAC & BBP registers
*/
static void device_init_registers(struct vnt_private *priv)
{
unsigned long flags;
unsigned int ii;
unsigned char byValue;
unsigned char byCCKPwrdBm = 0;
unsigned char byOFDMPwrdBm = 0;
MACbShutdown(priv->PortOffset);
BBvSoftwareReset(priv);
/* Do MACbSoftwareReset in MACvInitialize */
MACbSoftwareReset(priv->PortOffset);
priv->bAES = false;
/* Only used in 11g type, sync with ERP IE */
priv->bProtectMode = false;
priv->bNonERPPresent = false;
priv->bBarkerPreambleMd = false;
priv->wCurrentRate = RATE_1M;
priv->byTopOFDMBasicRate = RATE_24M;
priv->byTopCCKBasicRate = RATE_1M;
/* init MAC */
MACvInitialize(priv->PortOffset);
/* Get Local ID */
VNSvInPortB(priv->PortOffset + MAC_REG_LOCALID, &priv->byLocalID);
spin_lock_irqsave(&priv->lock, flags);
SROMvReadAllContents(priv->PortOffset, priv->abyEEPROM);
spin_unlock_irqrestore(&priv->lock, flags);
/* Get Channel range */
priv->byMinChannel = 1;
priv->byMaxChannel = CB_MAX_CHANNEL;
/* Get Antena */
byValue = SROMbyReadEmbedded(priv->PortOffset, EEP_OFS_ANTENNA);
if (byValue & EEP_ANTINV)
priv->bTxRxAntInv = true;
else
priv->bTxRxAntInv = false;
byValue &= (EEP_ANTENNA_AUX | EEP_ANTENNA_MAIN);
/* if not set default is All */
if (byValue == 0)
byValue = (EEP_ANTENNA_AUX | EEP_ANTENNA_MAIN);
if (byValue == (EEP_ANTENNA_AUX | EEP_ANTENNA_MAIN)) {
priv->byAntennaCount = 2;
priv->byTxAntennaMode = ANT_B;
priv->dwTxAntennaSel = 1;
priv->dwRxAntennaSel = 1;
if (priv->bTxRxAntInv)
priv->byRxAntennaMode = ANT_A;
else
priv->byRxAntennaMode = ANT_B;
} else {
priv->byAntennaCount = 1;
priv->dwTxAntennaSel = 0;
priv->dwRxAntennaSel = 0;
if (byValue & EEP_ANTENNA_AUX) {
priv->byTxAntennaMode = ANT_A;
if (priv->bTxRxAntInv)
priv->byRxAntennaMode = ANT_B;
else
priv->byRxAntennaMode = ANT_A;
} else {
priv->byTxAntennaMode = ANT_B;
if (priv->bTxRxAntInv)
priv->byRxAntennaMode = ANT_A;
else
priv->byRxAntennaMode = ANT_B;
}
}
/* Set initial antenna mode */
BBvSetTxAntennaMode(priv, priv->byTxAntennaMode);
BBvSetRxAntennaMode(priv, priv->byRxAntennaMode);
/* zonetype initial */
priv->byOriginalZonetype = priv->abyEEPROM[EEP_OFS_ZONETYPE];
if (!priv->bZoneRegExist)
priv->byZoneType = priv->abyEEPROM[EEP_OFS_ZONETYPE];
pr_debug("priv->byZoneType = %x\n", priv->byZoneType);
/* Init RF module */
RFbInit(priv);
/* Get Desire Power Value */
priv->byCurPwr = 0xFF;
priv->byCCKPwr = SROMbyReadEmbedded(priv->PortOffset, EEP_OFS_PWR_CCK);
priv->byOFDMPwrG = SROMbyReadEmbedded(priv->PortOffset, EEP_OFS_PWR_OFDMG);
/* Load power Table */
for (ii = 0; ii < CB_MAX_CHANNEL_24G; ii++) {
priv->abyCCKPwrTbl[ii + 1] =
SROMbyReadEmbedded(priv->PortOffset,
(unsigned char)(ii + EEP_OFS_CCK_PWR_TBL));
if (priv->abyCCKPwrTbl[ii + 1] == 0)
priv->abyCCKPwrTbl[ii+1] = priv->byCCKPwr;
priv->abyOFDMPwrTbl[ii + 1] =
SROMbyReadEmbedded(priv->PortOffset,
(unsigned char)(ii + EEP_OFS_OFDM_PWR_TBL));
if (priv->abyOFDMPwrTbl[ii + 1] == 0)
priv->abyOFDMPwrTbl[ii + 1] = priv->byOFDMPwrG;
priv->abyCCKDefaultPwr[ii + 1] = byCCKPwrdBm;
priv->abyOFDMDefaultPwr[ii + 1] = byOFDMPwrdBm;
}
/* recover 12,13 ,14channel for EUROPE by 11 channel */
for (ii = 11; ii < 14; ii++) {
priv->abyCCKPwrTbl[ii] = priv->abyCCKPwrTbl[10];
priv->abyOFDMPwrTbl[ii] = priv->abyOFDMPwrTbl[10];
}
/* Load OFDM A Power Table */
for (ii = 0; ii < CB_MAX_CHANNEL_5G; ii++) {
priv->abyOFDMPwrTbl[ii + CB_MAX_CHANNEL_24G + 1] =
SROMbyReadEmbedded(priv->PortOffset,
(unsigned char)(ii + EEP_OFS_OFDMA_PWR_TBL));
priv->abyOFDMDefaultPwr[ii + CB_MAX_CHANNEL_24G + 1] =
SROMbyReadEmbedded(priv->PortOffset,
(unsigned char)(ii + EEP_OFS_OFDMA_PWR_dBm));
}
if (priv->byLocalID > REV_ID_VT3253_B1) {
MACvSelectPage1(priv->PortOffset);
VNSvOutPortB(priv->PortOffset + MAC_REG_MSRCTL + 1,
(MSRCTL1_TXPWR | MSRCTL1_CSAPAREN));
MACvSelectPage0(priv->PortOffset);
}
/* use relative tx timeout and 802.11i D4 */
MACvWordRegBitsOn(priv->PortOffset,
MAC_REG_CFG, (CFG_TKIPOPT | CFG_NOTXTIMEOUT));
/* set performance parameter by registry */
MACvSetShortRetryLimit(priv->PortOffset, priv->byShortRetryLimit);
MACvSetLongRetryLimit(priv->PortOffset, priv->byLongRetryLimit);
/* reset TSF counter */
VNSvOutPortB(priv->PortOffset + MAC_REG_TFTCTL, TFTCTL_TSFCNTRST);
/* enable TSF counter */
VNSvOutPortB(priv->PortOffset + MAC_REG_TFTCTL, TFTCTL_TSFCNTREN);
/* initialize BBP registers */
BBbVT3253Init(priv);
if (priv->bUpdateBBVGA) {
priv->byBBVGACurrent = priv->abyBBVGA[0];
priv->byBBVGANew = priv->byBBVGACurrent;
BBvSetVGAGainOffset(priv, priv->abyBBVGA[0]);
}
BBvSetRxAntennaMode(priv, priv->byRxAntennaMode);
BBvSetTxAntennaMode(priv, priv->byTxAntennaMode);
/* Set BB and packet type at the same time. */
/* Set Short Slot Time, xIFS, and RSPINF. */
priv->wCurrentRate = RATE_54M;
priv->bRadioOff = false;
priv->byRadioCtl = SROMbyReadEmbedded(priv->PortOffset,
EEP_OFS_RADIOCTL);
priv->bHWRadioOff = false;
if (priv->byRadioCtl & EEP_RADIOCTL_ENABLE) {
/* Get GPIO */
MACvGPIOIn(priv->PortOffset, &priv->byGPIO);
if (((priv->byGPIO & GPIO0_DATA) &&
!(priv->byRadioCtl & EEP_RADIOCTL_INV)) ||
(!(priv->byGPIO & GPIO0_DATA) &&
(priv->byRadioCtl & EEP_RADIOCTL_INV)))
priv->bHWRadioOff = true;
}
if (priv->bHWRadioOff || priv->bRadioControlOff)
CARDbRadioPowerOff(priv);
/* get Permanent network address */
SROMvReadEtherAddress(priv->PortOffset, priv->abyCurrentNetAddr);
pr_debug("Network address = %pM\n", priv->abyCurrentNetAddr);
/* reset Tx pointer */
CARDvSafeResetRx(priv);
/* reset Rx pointer */
CARDvSafeResetTx(priv);
if (priv->byLocalID <= REV_ID_VT3253_A1)
MACvRegBitsOn(priv->PortOffset, MAC_REG_RCR, RCR_WPAERR);
/* Turn On Rx DMA */
MACvReceive0(priv->PortOffset);
MACvReceive1(priv->PortOffset);
/* start the adapter */
MACvStart(priv->PortOffset);
}
static void device_print_info(struct vnt_private *priv)
{
dev_info(&priv->pcid->dev, "MAC=%pM IO=0x%lx Mem=0x%lx IRQ=%d\n",
priv->abyCurrentNetAddr, (unsigned long)priv->ioaddr,
(unsigned long)priv->PortOffset, priv->pcid->irq);
}
static void device_free_info(struct vnt_private *priv)
{
if (!priv)
return;
if (priv->mac_hw)
ieee80211_unregister_hw(priv->hw);
if (priv->PortOffset)
iounmap(priv->PortOffset);
if (priv->pcid)
pci_release_regions(priv->pcid);
if (priv->hw)
ieee80211_free_hw(priv->hw);
}
static bool device_init_rings(struct vnt_private *priv)
{
void *vir_pool;
/*allocate all RD/TD rings a single pool*/
vir_pool = dma_zalloc_coherent(&priv->pcid->dev,
priv->opts.rx_descs0 * sizeof(struct vnt_rx_desc) +
priv->opts.rx_descs1 * sizeof(struct vnt_rx_desc) +
priv->opts.tx_descs[0] * sizeof(struct vnt_tx_desc) +
priv->opts.tx_descs[1] * sizeof(struct vnt_tx_desc),
&priv->pool_dma, GFP_ATOMIC);
if (vir_pool == NULL) {
dev_err(&priv->pcid->dev, "allocate desc dma memory failed\n");
return false;
}
priv->aRD0Ring = vir_pool;
priv->aRD1Ring = vir_pool +
priv->opts.rx_descs0 * sizeof(struct vnt_rx_desc);
priv->rd0_pool_dma = priv->pool_dma;
priv->rd1_pool_dma = priv->rd0_pool_dma +
priv->opts.rx_descs0 * sizeof(struct vnt_rx_desc);
priv->tx0_bufs = dma_zalloc_coherent(&priv->pcid->dev,
priv->opts.tx_descs[0] * PKT_BUF_SZ +
priv->opts.tx_descs[1] * PKT_BUF_SZ +
CB_BEACON_BUF_SIZE +
CB_MAX_BUF_SIZE,
&priv->tx_bufs_dma0,
GFP_ATOMIC);
if (priv->tx0_bufs == NULL) {
dev_err(&priv->pcid->dev, "allocate buf dma memory failed\n");
dma_free_coherent(&priv->pcid->dev,
priv->opts.rx_descs0 * sizeof(struct vnt_rx_desc) +
priv->opts.rx_descs1 * sizeof(struct vnt_rx_desc) +
priv->opts.tx_descs[0] * sizeof(struct vnt_tx_desc) +
priv->opts.tx_descs[1] * sizeof(struct vnt_tx_desc),
vir_pool, priv->pool_dma);
return false;
}
priv->td0_pool_dma = priv->rd1_pool_dma +
priv->opts.rx_descs1 * sizeof(struct vnt_rx_desc);
priv->td1_pool_dma = priv->td0_pool_dma +
priv->opts.tx_descs[0] * sizeof(struct vnt_tx_desc);
/* vir_pool: pvoid type */
priv->apTD0Rings = vir_pool
+ priv->opts.rx_descs0 * sizeof(struct vnt_rx_desc)
+ priv->opts.rx_descs1 * sizeof(struct vnt_rx_desc);
priv->apTD1Rings = vir_pool
+ priv->opts.rx_descs0 * sizeof(struct vnt_rx_desc)
+ priv->opts.rx_descs1 * sizeof(struct vnt_rx_desc)
+ priv->opts.tx_descs[0] * sizeof(struct vnt_tx_desc);
priv->tx1_bufs = priv->tx0_bufs +
priv->opts.tx_descs[0] * PKT_BUF_SZ;
priv->tx_beacon_bufs = priv->tx1_bufs +
priv->opts.tx_descs[1] * PKT_BUF_SZ;
priv->pbyTmpBuff = priv->tx_beacon_bufs +
CB_BEACON_BUF_SIZE;
priv->tx_bufs_dma1 = priv->tx_bufs_dma0 +
priv->opts.tx_descs[0] * PKT_BUF_SZ;
priv->tx_beacon_dma = priv->tx_bufs_dma1 +
priv->opts.tx_descs[1] * PKT_BUF_SZ;
return true;
}
static void device_free_rings(struct vnt_private *priv)
{
dma_free_coherent(&priv->pcid->dev,
priv->opts.rx_descs0 * sizeof(struct vnt_rx_desc) +
priv->opts.rx_descs1 * sizeof(struct vnt_rx_desc) +
priv->opts.tx_descs[0] * sizeof(struct vnt_tx_desc) +
priv->opts.tx_descs[1] * sizeof(struct vnt_tx_desc),
priv->aRD0Ring, priv->pool_dma);
if (priv->tx0_bufs)
dma_free_coherent(&priv->pcid->dev,
priv->opts.tx_descs[0] * PKT_BUF_SZ +
priv->opts.tx_descs[1] * PKT_BUF_SZ +
CB_BEACON_BUF_SIZE +
CB_MAX_BUF_SIZE,
priv->tx0_bufs, priv->tx_bufs_dma0);
}
static void device_init_rd0_ring(struct vnt_private *priv)
{
int i;
dma_addr_t curr = priv->rd0_pool_dma;
struct vnt_rx_desc *desc;
/* Init the RD0 ring entries */
for (i = 0; i < priv->opts.rx_descs0;
i ++, curr += sizeof(struct vnt_rx_desc)) {
desc = &priv->aRD0Ring[i];
desc->rd_info = kzalloc(sizeof(*desc->rd_info), GFP_ATOMIC);
if (!device_alloc_rx_buf(priv, desc))
dev_err(&priv->pcid->dev, "can not alloc rx bufs\n");
desc->next = &(priv->aRD0Ring[(i+1) % priv->opts.rx_descs0]);
desc->next_desc = cpu_to_le32(curr + sizeof(struct vnt_rx_desc));
}
if (i > 0)
priv->aRD0Ring[i-1].next_desc = cpu_to_le32(priv->rd0_pool_dma);
priv->pCurrRD[0] = &priv->aRD0Ring[0];
}
static void device_init_rd1_ring(struct vnt_private *priv)
{
int i;
dma_addr_t curr = priv->rd1_pool_dma;
struct vnt_rx_desc *desc;
/* Init the RD1 ring entries */
for (i = 0; i < priv->opts.rx_descs1;
i ++, curr += sizeof(struct vnt_rx_desc)) {
desc = &priv->aRD1Ring[i];
desc->rd_info = kzalloc(sizeof(*desc->rd_info), GFP_ATOMIC);
if (!device_alloc_rx_buf(priv, desc))
dev_err(&priv->pcid->dev, "can not alloc rx bufs\n");
desc->next = &(priv->aRD1Ring[(i+1) % priv->opts.rx_descs1]);
desc->next_desc = cpu_to_le32(curr + sizeof(struct vnt_rx_desc));
}
if (i > 0)
priv->aRD1Ring[i-1].next_desc = cpu_to_le32(priv->rd1_pool_dma);
priv->pCurrRD[1] = &priv->aRD1Ring[0];
}
static void device_free_rd0_ring(struct vnt_private *priv)
{
int i;
for (i = 0; i < priv->opts.rx_descs0; i++) {
struct vnt_rx_desc *desc = &(priv->aRD0Ring[i]);
struct vnt_rd_info *rd_info = desc->rd_info;
dma_unmap_single(&priv->pcid->dev, rd_info->skb_dma,
priv->rx_buf_sz, DMA_FROM_DEVICE);
dev_kfree_skb(rd_info->skb);
kfree(desc->rd_info);
}
}
static void device_free_rd1_ring(struct vnt_private *priv)
{
int i;
for (i = 0; i < priv->opts.rx_descs1; i++) {
struct vnt_rx_desc *desc = &priv->aRD1Ring[i];
struct vnt_rd_info *rd_info = desc->rd_info;
dma_unmap_single(&priv->pcid->dev, rd_info->skb_dma,
priv->rx_buf_sz, DMA_FROM_DEVICE);
dev_kfree_skb(rd_info->skb);
kfree(desc->rd_info);
}
}
static void device_init_td0_ring(struct vnt_private *priv)
{
int i;
dma_addr_t curr;
struct vnt_tx_desc *desc;
curr = priv->td0_pool_dma;
for (i = 0; i < priv->opts.tx_descs[0];
i++, curr += sizeof(struct vnt_tx_desc)) {
desc = &priv->apTD0Rings[i];
desc->td_info = kzalloc(sizeof(*desc->td_info), GFP_ATOMIC);
desc->td_info->buf = priv->tx0_bufs + i * PKT_BUF_SZ;
desc->td_info->buf_dma = priv->tx_bufs_dma0 + i * PKT_BUF_SZ;
desc->next = &(priv->apTD0Rings[(i+1) % priv->opts.tx_descs[0]]);
desc->next_desc = cpu_to_le32(curr + sizeof(struct vnt_tx_desc));
}
if (i > 0)
priv->apTD0Rings[i-1].next_desc = cpu_to_le32(priv->td0_pool_dma);
priv->apTailTD[0] = priv->apCurrTD[0] = &priv->apTD0Rings[0];
}
static void device_init_td1_ring(struct vnt_private *priv)
{
int i;
dma_addr_t curr;
struct vnt_tx_desc *desc;
/* Init the TD ring entries */
curr = priv->td1_pool_dma;
for (i = 0; i < priv->opts.tx_descs[1];
i++, curr += sizeof(struct vnt_tx_desc)) {
desc = &priv->apTD1Rings[i];
desc->td_info = kzalloc(sizeof(*desc->td_info), GFP_ATOMIC);
desc->td_info->buf = priv->tx1_bufs + i * PKT_BUF_SZ;
desc->td_info->buf_dma = priv->tx_bufs_dma1 + i * PKT_BUF_SZ;
desc->next = &(priv->apTD1Rings[(i + 1) % priv->opts.tx_descs[1]]);
desc->next_desc = cpu_to_le32(curr + sizeof(struct vnt_tx_desc));
}
if (i > 0)
priv->apTD1Rings[i-1].next_desc = cpu_to_le32(priv->td1_pool_dma);
priv->apTailTD[1] = priv->apCurrTD[1] = &priv->apTD1Rings[0];
}
static void device_free_td0_ring(struct vnt_private *priv)
{
int i;
for (i = 0; i < priv->opts.tx_descs[0]; i++) {
struct vnt_tx_desc *desc = &priv->apTD0Rings[i];
struct vnt_td_info *td_info = desc->td_info;
dev_kfree_skb(td_info->skb);
kfree(desc->td_info);
}
}
static void device_free_td1_ring(struct vnt_private *priv)
{
int i;
for (i = 0; i < priv->opts.tx_descs[1]; i++) {
struct vnt_tx_desc *desc = &priv->apTD1Rings[i];
struct vnt_td_info *td_info = desc->td_info;
dev_kfree_skb(td_info->skb);
kfree(desc->td_info);
}
}
/*-----------------------------------------------------------------*/
static int device_rx_srv(struct vnt_private *priv, unsigned int idx)
{
struct vnt_rx_desc *rd;
int works = 0;
for (rd = priv->pCurrRD[idx];
rd->rd0.owner == OWNED_BY_HOST;
rd = rd->next) {
if (works++ > 15)
break;
if (!rd->rd_info->skb)
break;
if (vnt_receive_frame(priv, rd)) {
if (!device_alloc_rx_buf(priv, rd)) {
dev_err(&priv->pcid->dev,
"can not allocate rx buf\n");
break;
}
}
rd->rd0.owner = OWNED_BY_NIC;
}
priv->pCurrRD[idx] = rd;
return works;
}
static bool device_alloc_rx_buf(struct vnt_private *priv,
struct vnt_rx_desc *rd)
{
struct vnt_rd_info *rd_info = rd->rd_info;
rd_info->skb = dev_alloc_skb((int)priv->rx_buf_sz);
if (rd_info->skb == NULL)
return false;
rd_info->skb_dma =
dma_map_single(&priv->pcid->dev,
skb_put(rd_info->skb, skb_tailroom(rd_info->skb)),
priv->rx_buf_sz, DMA_FROM_DEVICE);
*((unsigned int *)&rd->rd0) = 0; /* FIX cast */
rd->rd0.res_count = cpu_to_le16(priv->rx_buf_sz);
rd->rd0.owner = OWNED_BY_NIC;
rd->rd1.req_count = cpu_to_le16(priv->rx_buf_sz);
rd->buff_addr = cpu_to_le32(rd_info->skb_dma);
return true;
}
static const u8 fallback_rate0[5][5] = {
{RATE_18M, RATE_18M, RATE_12M, RATE_12M, RATE_12M},
{RATE_24M, RATE_24M, RATE_18M, RATE_12M, RATE_12M},
{RATE_36M, RATE_36M, RATE_24M, RATE_18M, RATE_18M},
{RATE_48M, RATE_48M, RATE_36M, RATE_24M, RATE_24M},
{RATE_54M, RATE_54M, RATE_48M, RATE_36M, RATE_36M}
};
static const u8 fallback_rate1[5][5] = {
{RATE_18M, RATE_18M, RATE_12M, RATE_6M, RATE_6M},
{RATE_24M, RATE_24M, RATE_18M, RATE_6M, RATE_6M},
{RATE_36M, RATE_36M, RATE_24M, RATE_12M, RATE_12M},
{RATE_48M, RATE_48M, RATE_24M, RATE_12M, RATE_12M},
{RATE_54M, RATE_54M, RATE_36M, RATE_18M, RATE_18M}
};
static int vnt_int_report_rate(struct vnt_private *priv,
struct vnt_td_info *context, u8 tsr0, u8 tsr1)
{
struct vnt_tx_fifo_head *fifo_head;
struct ieee80211_tx_info *info;
struct ieee80211_rate *rate;
u16 fb_option;
u8 tx_retry = (tsr0 & TSR0_NCR);
s8 idx;
if (!context)
return -ENOMEM;
if (!context->skb)
return -EINVAL;
fifo_head = (struct vnt_tx_fifo_head *)context->buf;
fb_option = (le16_to_cpu(fifo_head->fifo_ctl) &
(FIFOCTL_AUTO_FB_0 | FIFOCTL_AUTO_FB_1));
info = IEEE80211_SKB_CB(context->skb);
idx = info->control.rates[0].idx;
if (fb_option && !(tsr1 & TSR1_TERR)) {
u8 tx_rate;
u8 retry = tx_retry;
rate = ieee80211_get_tx_rate(priv->hw, info);
tx_rate = rate->hw_value - RATE_18M;
if (retry > 4)
retry = 4;
if (fb_option & FIFOCTL_AUTO_FB_0)
tx_rate = fallback_rate0[tx_rate][retry];
else if (fb_option & FIFOCTL_AUTO_FB_1)
tx_rate = fallback_rate1[tx_rate][retry];
if (info->band == IEEE80211_BAND_5GHZ)
idx = tx_rate - RATE_6M;
else
idx = tx_rate;
}
ieee80211_tx_info_clear_status(info);
info->status.rates[0].count = tx_retry;
if (!(tsr1 & TSR1_TERR)) {
info->status.rates[0].idx = idx;
if (info->flags & IEEE80211_TX_CTL_NO_ACK)
info->flags |= IEEE80211_TX_STAT_NOACK_TRANSMITTED;
else
info->flags |= IEEE80211_TX_STAT_ACK;
}
return 0;
}
static int device_tx_srv(struct vnt_private *priv, unsigned int idx)
{
struct vnt_tx_desc *desc;
int works = 0;
unsigned char byTsr0;
unsigned char byTsr1;
for (desc = priv->apTailTD[idx]; priv->iTDUsed[idx] > 0; desc = desc->next) {
if (desc->td0.owner == OWNED_BY_NIC)
break;
if (works++ > 15)
break;
byTsr0 = desc->td0.tsr0;
byTsr1 = desc->td0.tsr1;
/* Only the status of first TD in the chain is correct */
if (desc->td1.tcr & TCR_STP) {
if ((desc->td_info->flags & TD_FLAGS_NETIF_SKB) != 0) {
if (!(byTsr1 & TSR1_TERR)) {
if (byTsr0 != 0) {
pr_debug(" Tx[%d] OK but has error. tsr1[%02X] tsr0[%02X]\n",
(int)idx, byTsr1,
byTsr0);
}
} else {
pr_debug(" Tx[%d] dropped & tsr1[%02X] tsr0[%02X]\n",
(int)idx, byTsr1, byTsr0);
}
}
if (byTsr1 & TSR1_TERR) {
if ((desc->td_info->flags & TD_FLAGS_PRIV_SKB) != 0) {
pr_debug(" Tx[%d] fail has error. tsr1[%02X] tsr0[%02X]\n",
(int)idx, byTsr1, byTsr0);
}
}
vnt_int_report_rate(priv, desc->td_info, byTsr0, byTsr1);
device_free_tx_buf(priv, desc);
priv->iTDUsed[idx]--;
}
}
priv->apTailTD[idx] = desc;
return works;
}
static void device_error(struct vnt_private *priv, unsigned short status)
{
if (status & ISR_FETALERR) {
dev_err(&priv->pcid->dev, "Hardware fatal error\n");
MACbShutdown(priv->PortOffset);
return;
}
}
static void device_free_tx_buf(struct vnt_private *priv,
struct vnt_tx_desc *desc)
{
struct vnt_td_info *td_info = desc->td_info;
struct sk_buff *skb = td_info->skb;
if (skb)
ieee80211_tx_status_irqsafe(priv->hw, skb);
td_info->skb = NULL;
td_info->flags = 0;
}
static void vnt_check_bb_vga(struct vnt_private *priv)
{
long dbm;
int i;
if (!priv->bUpdateBBVGA)
return;
if (priv->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL)
return;
if (!(priv->vif->bss_conf.assoc && priv->uCurrRSSI))
return;
RFvRSSITodBm(priv, (u8)priv->uCurrRSSI, &dbm);
for (i = 0; i < BB_VGA_LEVEL; i++) {
if (dbm < priv->ldBmThreshold[i]) {
priv->byBBVGANew = priv->abyBBVGA[i];
break;
}
}
if (priv->byBBVGANew == priv->byBBVGACurrent) {
priv->uBBVGADiffCount = 1;
return;
}
priv->uBBVGADiffCount++;
if (priv->uBBVGADiffCount == 1) {
/* first VGA diff gain */
BBvSetVGAGainOffset(priv, priv->byBBVGANew);
dev_dbg(&priv->pcid->dev,
"First RSSI[%d] NewGain[%d] OldGain[%d] Count[%d]\n",
(int)dbm, priv->byBBVGANew,
priv->byBBVGACurrent,
(int)priv->uBBVGADiffCount);
}
if (priv->uBBVGADiffCount >= BB_VGA_CHANGE_THRESHOLD) {
dev_dbg(&priv->pcid->dev,
"RSSI[%d] NewGain[%d] OldGain[%d] Count[%d]\n",
(int)dbm, priv->byBBVGANew,
priv->byBBVGACurrent,
(int)priv->uBBVGADiffCount);
BBvSetVGAGainOffset(priv, priv->byBBVGANew);
}
}
static void vnt_interrupt_process(struct vnt_private *priv)
{
struct ieee80211_low_level_stats *low_stats = &priv->low_stats;
int max_count = 0;
u32 mib_counter;
u32 isr;
unsigned long flags;
MACvReadISR(priv->PortOffset, &isr);
if (isr == 0)
return;
if (isr == 0xffffffff) {
pr_debug("isr = 0xffff\n");
return;
}
MACvIntDisable(priv->PortOffset);
spin_lock_irqsave(&priv->lock, flags);
/* Read low level stats */
MACvReadMIBCounter(priv->PortOffset, &mib_counter);
low_stats->dot11RTSSuccessCount += mib_counter & 0xff;
low_stats->dot11RTSFailureCount += (mib_counter >> 8) & 0xff;
low_stats->dot11ACKFailureCount += (mib_counter >> 16) & 0xff;
low_stats->dot11FCSErrorCount += (mib_counter >> 24) & 0xff;
/*
* TBD....
* Must do this after doing rx/tx, cause ISR bit is slow
* than RD/TD write back
* update ISR counter
*/
while (isr && priv->vif) {
MACvWriteISR(priv->PortOffset, isr);
if (isr & ISR_FETALERR) {
pr_debug(" ISR_FETALERR\n");
VNSvOutPortB(priv->PortOffset + MAC_REG_SOFTPWRCTL, 0);
VNSvOutPortW(priv->PortOffset +
MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPECTI);
device_error(priv, isr);
}
if (isr & ISR_TBTT) {
if (priv->op_mode != NL80211_IFTYPE_ADHOC)
vnt_check_bb_vga(priv);
priv->bBeaconSent = false;
if (priv->bEnablePSMode)
PSbIsNextTBTTWakeUp((void *)priv);
if ((priv->op_mode == NL80211_IFTYPE_AP ||
priv->op_mode == NL80211_IFTYPE_ADHOC) &&
priv->vif->bss_conf.enable_beacon) {
MACvOneShotTimer1MicroSec(priv->PortOffset,
(priv->vif->bss_conf.beacon_int - MAKE_BEACON_RESERVED) << 10);
}
/* TODO: adhoc PS mode */
}
if (isr & ISR_BNTX) {
if (priv->op_mode == NL80211_IFTYPE_ADHOC) {
priv->bIsBeaconBufReadySet = false;
priv->cbBeaconBufReadySetCnt = 0;
}
priv->bBeaconSent = true;
}
if (isr & ISR_RXDMA0)
max_count += device_rx_srv(priv, TYPE_RXDMA0);
if (isr & ISR_RXDMA1)
max_count += device_rx_srv(priv, TYPE_RXDMA1);
if (isr & ISR_TXDMA0)
max_count += device_tx_srv(priv, TYPE_TXDMA0);
if (isr & ISR_AC0DMA)
max_count += device_tx_srv(priv, TYPE_AC0DMA);
if (isr & ISR_SOFTTIMER1) {
if (priv->vif->bss_conf.enable_beacon)
vnt_beacon_make(priv, priv->vif);
}
/* If both buffers available wake the queue */
if (AVAIL_TD(priv, TYPE_TXDMA0) &&
AVAIL_TD(priv, TYPE_AC0DMA) &&
ieee80211_queue_stopped(priv->hw, 0))
ieee80211_wake_queues(priv->hw);
MACvReadISR(priv->PortOffset, &isr);
MACvReceive0(priv->PortOffset);
MACvReceive1(priv->PortOffset);
if (max_count > priv->opts.int_works)
break;
}
spin_unlock_irqrestore(&priv->lock, flags);
MACvIntEnable(priv->PortOffset, IMR_MASK_VALUE);
}
static void vnt_interrupt_work(struct work_struct *work)
{
struct vnt_private *priv =
container_of(work, struct vnt_private, interrupt_work);
if (priv->vif)
vnt_interrupt_process(priv);
}
static irqreturn_t vnt_interrupt(int irq, void *arg)
{
struct vnt_private *priv = arg;
if (priv->vif)
schedule_work(&priv->interrupt_work);
return IRQ_HANDLED;
}
static int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb)
{
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
struct vnt_tx_desc *head_td;
u32 dma_idx;
unsigned long flags;
spin_lock_irqsave(&priv->lock, flags);
if (ieee80211_is_data(hdr->frame_control))
dma_idx = TYPE_AC0DMA;
else
dma_idx = TYPE_TXDMA0;
if (AVAIL_TD(priv, dma_idx) < 1) {
spin_unlock_irqrestore(&priv->lock, flags);
ieee80211_stop_queues(priv->hw);
return -ENOMEM;
}
head_td = priv->apCurrTD[dma_idx];
head_td->td1.tcr = 0;
head_td->td_info->skb = skb;
if (dma_idx == TYPE_AC0DMA)
head_td->td_info->flags = TD_FLAGS_NETIF_SKB;
priv->apCurrTD[dma_idx] = head_td->next;
spin_unlock_irqrestore(&priv->lock, flags);
vnt_generate_fifo_header(priv, dma_idx, head_td, skb);
spin_lock_irqsave(&priv->lock, flags);
priv->bPWBitOn = false;
/* Set TSR1 & ReqCount in TxDescHead */
head_td->td1.tcr |= (TCR_STP | TCR_EDP | EDMSDU);
head_td->td1.req_count = cpu_to_le16(head_td->td_info->req_count);
head_td->buff_addr = cpu_to_le32(head_td->td_info->buf_dma);
/* Poll Transmit the adapter */
wmb();
head_td->td0.owner = OWNED_BY_NIC;
wmb(); /* second memory barrier */
if (head_td->td_info->flags & TD_FLAGS_NETIF_SKB)
MACvTransmitAC0(priv->PortOffset);
else
MACvTransmit0(priv->PortOffset);
priv->iTDUsed[dma_idx]++;
spin_unlock_irqrestore(&priv->lock, flags);
return 0;
}
static void vnt_tx_80211(struct ieee80211_hw *hw,
struct ieee80211_tx_control *control,
struct sk_buff *skb)
{
struct vnt_private *priv = hw->priv;
if (vnt_tx_packet(priv, skb))
ieee80211_free_txskb(hw, skb);
}
static int vnt_start(struct ieee80211_hw *hw)
{
struct vnt_private *priv = hw->priv;
int ret;
priv->rx_buf_sz = PKT_BUF_SZ;
if (!device_init_rings(priv))
return -ENOMEM;
ret = request_irq(priv->pcid->irq, &vnt_interrupt,
IRQF_SHARED, "vt6655", priv);
if (ret) {
dev_dbg(&priv->pcid->dev, "failed to start irq\n");
return ret;
}
dev_dbg(&priv->pcid->dev, "call device init rd0 ring\n");
device_init_rd0_ring(priv);
device_init_rd1_ring(priv);
device_init_td0_ring(priv);
device_init_td1_ring(priv);
device_init_registers(priv);
dev_dbg(&priv->pcid->dev, "call MACvIntEnable\n");
MACvIntEnable(priv->PortOffset, IMR_MASK_VALUE);
ieee80211_wake_queues(hw);
return 0;
}
static void vnt_stop(struct ieee80211_hw *hw)
{
struct vnt_private *priv = hw->priv;
ieee80211_stop_queues(hw);
cancel_work_sync(&priv->interrupt_work);
MACbShutdown(priv->PortOffset);
MACbSoftwareReset(priv->PortOffset);
CARDbRadioPowerOff(priv);
device_free_td0_ring(priv);
device_free_td1_ring(priv);
device_free_rd0_ring(priv);
device_free_rd1_ring(priv);
device_free_rings(priv);
free_irq(priv->pcid->irq, priv);
}
static int vnt_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
{
struct vnt_private *priv = hw->priv;
priv->vif = vif;
switch (vif->type) {
case NL80211_IFTYPE_STATION:
break;
case NL80211_IFTYPE_ADHOC:
MACvRegBitsOff(priv->PortOffset, MAC_REG_RCR, RCR_UNICAST);
MACvRegBitsOn(priv->PortOffset, MAC_REG_HOSTCR, HOSTCR_ADHOC);
break;
case NL80211_IFTYPE_AP:
MACvRegBitsOff(priv->PortOffset, MAC_REG_RCR, RCR_UNICAST);
MACvRegBitsOn(priv->PortOffset, MAC_REG_HOSTCR, HOSTCR_AP);
break;
default:
return -EOPNOTSUPP;
}
priv->op_mode = vif->type;
return 0;
}
static void vnt_remove_interface(struct ieee80211_hw *hw,
struct ieee80211_vif *vif)
{
struct vnt_private *priv = hw->priv;
switch (vif->type) {
case NL80211_IFTYPE_STATION:
break;
case NL80211_IFTYPE_ADHOC:
MACvRegBitsOff(priv->PortOffset, MAC_REG_TCR, TCR_AUTOBCNTX);
MACvRegBitsOff(priv->PortOffset,
MAC_REG_TFTCTL, TFTCTL_TSFCNTREN);
MACvRegBitsOff(priv->PortOffset, MAC_REG_HOSTCR, HOSTCR_ADHOC);
break;
case NL80211_IFTYPE_AP:
MACvRegBitsOff(priv->PortOffset, MAC_REG_TCR, TCR_AUTOBCNTX);
MACvRegBitsOff(priv->PortOffset,
MAC_REG_TFTCTL, TFTCTL_TSFCNTREN);
MACvRegBitsOff(priv->PortOffset, MAC_REG_HOSTCR, HOSTCR_AP);
break;
default:
break;
}
priv->op_mode = NL80211_IFTYPE_UNSPECIFIED;
}
static int vnt_config(struct ieee80211_hw *hw, u32 changed)
{
struct vnt_private *priv = hw->priv;
struct ieee80211_conf *conf = &hw->conf;
u8 bb_type;
if (changed & IEEE80211_CONF_CHANGE_PS) {
if (conf->flags & IEEE80211_CONF_PS)
PSvEnablePowerSaving(priv, conf->listen_interval);
else
PSvDisablePowerSaving(priv);
}
if ((changed & IEEE80211_CONF_CHANGE_CHANNEL) ||
(conf->flags & IEEE80211_CONF_OFFCHANNEL)) {
set_channel(priv, conf->chandef.chan);
if (conf->chandef.chan->band == IEEE80211_BAND_5GHZ)
bb_type = BB_TYPE_11A;
else
bb_type = BB_TYPE_11G;
if (priv->byBBType != bb_type) {
priv->byBBType = bb_type;
CARDbSetPhyParameter(priv, priv->byBBType);
}
}
if (changed & IEEE80211_CONF_CHANGE_POWER) {
if (priv->byBBType == BB_TYPE_11B)
priv->wCurrentRate = RATE_1M;
else
priv->wCurrentRate = RATE_54M;
RFbSetPower(priv, priv->wCurrentRate,
conf->chandef.chan->hw_value);
}
return 0;
}
static void vnt_bss_info_changed(struct ieee80211_hw *hw,
struct ieee80211_vif *vif, struct ieee80211_bss_conf *conf,
u32 changed)
{
struct vnt_private *priv = hw->priv;
priv->current_aid = conf->aid;
if (changed & BSS_CHANGED_BSSID && conf->bssid) {
unsigned long flags;
spin_lock_irqsave(&priv->lock, flags);
MACvWriteBSSIDAddress(priv->PortOffset, (u8 *)conf->bssid);
spin_unlock_irqrestore(&priv->lock, flags);
}
if (changed & BSS_CHANGED_BASIC_RATES) {
priv->basic_rates = conf->basic_rates;
CARDvUpdateBasicTopRate(priv);
dev_dbg(&priv->pcid->dev,
"basic rates %x\n", conf->basic_rates);
}
if (changed & BSS_CHANGED_ERP_PREAMBLE) {
if (conf->use_short_preamble) {
MACvEnableBarkerPreambleMd(priv->PortOffset);
priv->byPreambleType = true;
} else {
MACvDisableBarkerPreambleMd(priv->PortOffset);
priv->byPreambleType = false;
}
}
if (changed & BSS_CHANGED_ERP_CTS_PROT) {
if (conf->use_cts_prot)
MACvEnableProtectMD(priv->PortOffset);
else
MACvDisableProtectMD(priv->PortOffset);
}
if (changed & BSS_CHANGED_ERP_SLOT) {
if (conf->use_short_slot)
priv->bShortSlotTime = true;
else
priv->bShortSlotTime = false;
CARDbSetPhyParameter(priv, priv->byBBType);
BBvSetVGAGainOffset(priv, priv->abyBBVGA[0]);
}
if (changed & BSS_CHANGED_TXPOWER)
RFbSetPower(priv, priv->wCurrentRate,
conf->chandef.chan->hw_value);
if (changed & BSS_CHANGED_BEACON_ENABLED) {
dev_dbg(&priv->pcid->dev,
"Beacon enable %d\n", conf->enable_beacon);
if (conf->enable_beacon) {
vnt_beacon_enable(priv, vif, conf);
MACvRegBitsOn(priv->PortOffset, MAC_REG_TCR,
TCR_AUTOBCNTX);
} else {
MACvRegBitsOff(priv->PortOffset, MAC_REG_TCR,
TCR_AUTOBCNTX);
}
}
if (changed & (BSS_CHANGED_ASSOC | BSS_CHANGED_BEACON_INFO) &&
priv->op_mode != NL80211_IFTYPE_AP) {
if (conf->assoc && conf->beacon_rate) {
CARDbUpdateTSF(priv, conf->beacon_rate->hw_value,
conf->sync_tsf);
CARDbSetBeaconPeriod(priv, conf->beacon_int);
CARDvSetFirstNextTBTT(priv, conf->beacon_int);
} else {
VNSvOutPortB(priv->PortOffset + MAC_REG_TFTCTL,
TFTCTL_TSFCNTRST);
VNSvOutPortB(priv->PortOffset + MAC_REG_TFTCTL,
TFTCTL_TSFCNTREN);
}
}
}
static u64 vnt_prepare_multicast(struct ieee80211_hw *hw,
struct netdev_hw_addr_list *mc_list)
{
struct vnt_private *priv = hw->priv;
struct netdev_hw_addr *ha;
u64 mc_filter = 0;
u32 bit_nr = 0;
netdev_hw_addr_list_for_each(ha, mc_list) {
bit_nr = ether_crc(ETH_ALEN, ha->addr) >> 26;
mc_filter |= 1ULL << (bit_nr & 0x3f);
}
priv->mc_list_count = mc_list->count;
return mc_filter;
}
static void vnt_configure(struct ieee80211_hw *hw,
unsigned int changed_flags, unsigned int *total_flags, u64 multicast)
{
struct vnt_private *priv = hw->priv;
u8 rx_mode = 0;
*total_flags &= FIF_ALLMULTI | FIF_OTHER_BSS | FIF_BCN_PRBRESP_PROMISC;
VNSvInPortB(priv->PortOffset + MAC_REG_RCR, &rx_mode);
dev_dbg(&priv->pcid->dev, "rx mode in = %x\n", rx_mode);
if (changed_flags & FIF_ALLMULTI) {
if (*total_flags & FIF_ALLMULTI) {
unsigned long flags;
spin_lock_irqsave(&priv->lock, flags);
if (priv->mc_list_count > 2) {
MACvSelectPage1(priv->PortOffset);
VNSvOutPortD(priv->PortOffset +
MAC_REG_MAR0, 0xffffffff);
VNSvOutPortD(priv->PortOffset +
MAC_REG_MAR0 + 4, 0xffffffff);
MACvSelectPage0(priv->PortOffset);
} else {
MACvSelectPage1(priv->PortOffset);
VNSvOutPortD(priv->PortOffset +
MAC_REG_MAR0, (u32)multicast);
VNSvOutPortD(priv->PortOffset +
MAC_REG_MAR0 + 4,
(u32)(multicast >> 32));
MACvSelectPage0(priv->PortOffset);
}
spin_unlock_irqrestore(&priv->lock, flags);
rx_mode |= RCR_MULTICAST | RCR_BROADCAST;
} else {
rx_mode &= ~(RCR_MULTICAST | RCR_BROADCAST);
}
}
if (changed_flags & (FIF_OTHER_BSS | FIF_BCN_PRBRESP_PROMISC)) {
rx_mode |= RCR_MULTICAST | RCR_BROADCAST;
if (*total_flags & (FIF_OTHER_BSS | FIF_BCN_PRBRESP_PROMISC))
rx_mode &= ~RCR_BSSID;
else
rx_mode |= RCR_BSSID;
}
VNSvOutPortB(priv->PortOffset + MAC_REG_RCR, rx_mode);
dev_dbg(&priv->pcid->dev, "rx mode out= %x\n", rx_mode);
}
static int vnt_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
struct ieee80211_vif *vif, struct ieee80211_sta *sta,
struct ieee80211_key_conf *key)
{
struct vnt_private *priv = hw->priv;
switch (cmd) {
case SET_KEY:
if (vnt_set_keys(hw, sta, vif, key))
return -EOPNOTSUPP;
break;
case DISABLE_KEY:
if (test_bit(key->hw_key_idx, &priv->key_entry_inuse))
clear_bit(key->hw_key_idx, &priv->key_entry_inuse);
default:
break;
}
return 0;
}
static int vnt_get_stats(struct ieee80211_hw *hw,
struct ieee80211_low_level_stats *stats)
{
struct vnt_private *priv = hw->priv;
memcpy(stats, &priv->low_stats, sizeof(*stats));
return 0;
}
static u64 vnt_get_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
{
struct vnt_private *priv = hw->priv;
u64 tsf;
CARDbGetCurrentTSF(priv, &tsf);
return tsf;
}
static void vnt_set_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u64 tsf)
{
struct vnt_private *priv = hw->priv;
CARDvUpdateNextTBTT(priv, tsf, vif->bss_conf.beacon_int);
}
static void vnt_reset_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
{
struct vnt_private *priv = hw->priv;
/* reset TSF counter */
VNSvOutPortB(priv->PortOffset + MAC_REG_TFTCTL, TFTCTL_TSFCNTRST);
}
static const struct ieee80211_ops vnt_mac_ops = {
.tx = vnt_tx_80211,
.start = vnt_start,
.stop = vnt_stop,
.add_interface = vnt_add_interface,
.remove_interface = vnt_remove_interface,
.config = vnt_config,
.bss_info_changed = vnt_bss_info_changed,
.prepare_multicast = vnt_prepare_multicast,
.configure_filter = vnt_configure,
.set_key = vnt_set_key,
.get_stats = vnt_get_stats,
.get_tsf = vnt_get_tsf,
.set_tsf = vnt_set_tsf,
.reset_tsf = vnt_reset_tsf,
};
static int vnt_init(struct vnt_private *priv)
{
SET_IEEE80211_PERM_ADDR(priv->hw, priv->abyCurrentNetAddr);
vnt_init_bands(priv);
if (ieee80211_register_hw(priv->hw))
return -ENODEV;
priv->mac_hw = true;
CARDbRadioPowerOff(priv);
return 0;
}
static int
vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent)
{
struct vnt_private *priv;
struct ieee80211_hw *hw;
struct wiphy *wiphy;
int rc;
dev_notice(&pcid->dev,
"%s Ver. %s\n", DEVICE_FULL_DRV_NAM, DEVICE_VERSION);
dev_notice(&pcid->dev,
"Copyright (c) 2003 VIA Networking Technologies, Inc.\n");
hw = ieee80211_alloc_hw(sizeof(*priv), &vnt_mac_ops);
if (!hw) {
dev_err(&pcid->dev, "could not register ieee80211_hw\n");
return -ENOMEM;
}
priv = hw->priv;
priv->pcid = pcid;
spin_lock_init(&priv->lock);
priv->hw = hw;
SET_IEEE80211_DEV(priv->hw, &pcid->dev);
if (pci_enable_device(pcid)) {
device_free_info(priv);
return -ENODEV;
}
dev_dbg(&pcid->dev,
"Before get pci_info memaddr is %x\n", priv->memaddr);
pci_set_master(pcid);
priv->memaddr = pci_resource_start(pcid, 0);
priv->ioaddr = pci_resource_start(pcid, 1);
priv->PortOffset = ioremap(priv->memaddr & PCI_BASE_ADDRESS_MEM_MASK,
256);
if (!priv->PortOffset) {
dev_err(&pcid->dev, ": Failed to IO remapping ..\n");
device_free_info(priv);
return -ENODEV;
}
rc = pci_request_regions(pcid, DEVICE_NAME);
if (rc) {
dev_err(&pcid->dev, ": Failed to find PCI device\n");
device_free_info(priv);
return -ENODEV;
}
if (dma_set_mask(&pcid->dev, DMA_BIT_MASK(32))) {
dev_err(&pcid->dev, ": Failed to set dma 32 bit mask\n");
device_free_info(priv);
return -ENODEV;
}
INIT_WORK(&priv->interrupt_work, vnt_interrupt_work);
/* do reset */
if (!MACbSoftwareReset(priv->PortOffset)) {
dev_err(&pcid->dev, ": Failed to access MAC hardware..\n");
device_free_info(priv);
return -ENODEV;
}
/* initial to reload eeprom */
MACvInitialize(priv->PortOffset);
MACvReadEtherAddress(priv->PortOffset, priv->abyCurrentNetAddr);
/* Get RFType */
priv->byRFType = SROMbyReadEmbedded(priv->PortOffset, EEP_OFS_RFTYPE);
priv->byRFType &= RF_MASK;
dev_dbg(&pcid->dev, "RF Type = %x\n", priv->byRFType);
device_get_options(priv);
device_set_options(priv);
wiphy = priv->hw->wiphy;
wiphy->frag_threshold = FRAG_THRESH_DEF;
wiphy->rts_threshold = RTS_THRESH_DEF;
wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
BIT(NL80211_IFTYPE_ADHOC) | BIT(NL80211_IFTYPE_AP);
ieee80211_hw_set(priv->hw, TIMING_BEACON_ONLY);
ieee80211_hw_set(priv->hw, SIGNAL_DBM);
ieee80211_hw_set(priv->hw, RX_INCLUDES_FCS);
ieee80211_hw_set(priv->hw, REPORTS_TX_ACK_STATUS);
ieee80211_hw_set(priv->hw, SUPPORTS_PS);
priv->hw->max_signal = 100;
if (vnt_init(priv))
return -ENODEV;
device_print_info(priv);
pci_set_drvdata(pcid, priv);
return 0;
}
/*------------------------------------------------------------------*/
#ifdef CONFIG_PM
static int vt6655_suspend(struct pci_dev *pcid, pm_message_t state)
{
struct vnt_private *priv = pci_get_drvdata(pcid);
unsigned long flags;
spin_lock_irqsave(&priv->lock, flags);
pci_save_state(pcid);
MACbShutdown(priv->PortOffset);
pci_disable_device(pcid);
pci_set_power_state(pcid, pci_choose_state(pcid, state));
spin_unlock_irqrestore(&priv->lock, flags);
return 0;
}
static int vt6655_resume(struct pci_dev *pcid)
{
pci_set_power_state(pcid, PCI_D0);
pci_enable_wake(pcid, PCI_D0, 0);
pci_restore_state(pcid);
return 0;
}
#endif
MODULE_DEVICE_TABLE(pci, vt6655_pci_id_table);
static struct pci_driver device_driver = {
.name = DEVICE_NAME,
.id_table = vt6655_pci_id_table,
.probe = vt6655_probe,
.remove = vt6655_remove,
#ifdef CONFIG_PM
.suspend = vt6655_suspend,
.resume = vt6655_resume,
#endif
};
module_pci_driver(device_driver);
| {
"content_hash": "f8705f109f78e31c12a76784d9ada671",
"timestamp": "",
"source": "github",
"line_count": 1682,
"max_line_length": 80,
"avg_line_length": 25.333531510107015,
"alnum_prop": 0.6582807256342259,
"repo_name": "mikedlowis-prototypes/albase",
"id": "fefbf826c622380380e47fd7d55e3cfc812e924b",
"size": "44397",
"binary": false,
"copies": "180",
"ref": "refs/heads/master",
"path": "source/kernel/drivers/staging/vt6655/device_main.c",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Assembly",
"bytes": "10263145"
},
{
"name": "Awk",
"bytes": "55187"
},
{
"name": "Batchfile",
"bytes": "31438"
},
{
"name": "C",
"bytes": "551654518"
},
{
"name": "C++",
"bytes": "11818066"
},
{
"name": "CMake",
"bytes": "122998"
},
{
"name": "Clojure",
"bytes": "945"
},
{
"name": "DIGITAL Command Language",
"bytes": "232099"
},
{
"name": "GDB",
"bytes": "18113"
},
{
"name": "Gherkin",
"bytes": "5110"
},
{
"name": "HTML",
"bytes": "18291"
},
{
"name": "Lex",
"bytes": "58937"
},
{
"name": "M4",
"bytes": "561745"
},
{
"name": "Makefile",
"bytes": "7082768"
},
{
"name": "Objective-C",
"bytes": "634652"
},
{
"name": "POV-Ray SDL",
"bytes": "546"
},
{
"name": "Perl",
"bytes": "1229221"
},
{
"name": "Perl6",
"bytes": "11648"
},
{
"name": "Python",
"bytes": "316536"
},
{
"name": "Roff",
"bytes": "4201130"
},
{
"name": "Shell",
"bytes": "2436879"
},
{
"name": "SourcePawn",
"bytes": "2711"
},
{
"name": "TeX",
"bytes": "182745"
},
{
"name": "UnrealScript",
"bytes": "12824"
},
{
"name": "Visual Basic",
"bytes": "11568"
},
{
"name": "XS",
"bytes": "1239"
},
{
"name": "Yacc",
"bytes": "146537"
}
],
"symlink_target": ""
} |
<?php
namespace Tableless\CoreBundle\Controller;
use Tableless\ModelBundle\Entity\Author;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Request;
/**
* Author controller.
*
* @Route("author")
*/
class AuthorController extends Controller
{
/**
* Lists all author entities.
*
* @Route("/", name="author_index")
* @Method("GET")
*/
public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$authors = $em->getRepository('TablelessModelBundle:Author')->findAll();
return $this->render('TablelessCoreBundle:author:index.html.twig', array(
'authors' => $authors,
));
}
/**
* Creates a new author entity.
*
* @Route("/new", name="author_new")
* @Method({"GET", "POST"})
*/
public function newAction(Request $request)
{
$author = new Author();
$form = $this->createForm('Tableless\ModelBundle\Form\AuthorType', $author);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($author);
$em->flush($author);
return $this->redirectToRoute('author_show', array('id' => $author->getId()));
}
return $this->render('TablelessCoreBundle:author:new.html.twig', array(
'author' => $author,
'form' => $form->createView(),
));
}
/**
* Finds and displays a author entity.
*
* @Route("/{id}", name="author_show")
* @Method("GET")
*/
public function showAction(Author $author)
{
$deleteForm = $this->createDeleteForm($author);
return $this->render('TablelessCoreBundle:author:show.html.twig', array(
'author' => $author,
'delete_form' => $deleteForm->createView(),
));
}
/**
* Displays a form to edit an existing author entity.
*
* @Route("/{id}/edit", name="author_edit")
* @Method({"GET", "POST"})
*/
public function editAction(Request $request, Author $author)
{
$deleteForm = $this->createDeleteForm($author);
$editForm = $this->createForm('Tableless\ModelBundle\Form\AuthorType', $author);
$editForm->handleRequest($request);
if ($editForm->isSubmitted() && $editForm->isValid()) {
$this->getDoctrine()->getManager()->flush();
return $this->redirectToRoute('author_edit', array('id' => $author->getId()));
}
return $this->render('TablelessCoreBundle:author:edit.html.twig', array(
'author' => $author,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
));
}
/**
* Deletes a author entity.
*
* @Route("/{id}", name="author_delete")
* @Method("DELETE")
*/
public function deleteAction(Request $request, Author $author)
{
$form = $this->createDeleteForm($author);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->remove($author);
$em->flush($author);
}
return $this->redirectToRoute('author_index');
}
/**
* Creates a form to delete a author entity.
*
* @param Author $author The author entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createDeleteForm(Author $author)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('author_delete', array('id' => $author->getId())))
->setMethod('DELETE')
->getForm()
;
}
}
| {
"content_hash": "05b7e1e16ae1d09b73dad20ca227e929",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 93,
"avg_line_length": 28.83211678832117,
"alnum_prop": 0.5675949367088607,
"repo_name": "uirapeixoto/tableless",
"id": "7e0a7148bae4b51f33e1da419a8f2f62c7aba3df",
"size": "3950",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Tableless/CoreBundle/Controller/AuthorController.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "3605"
},
{
"name": "CSS",
"bytes": "131713"
},
{
"name": "HTML",
"bytes": "33823"
},
{
"name": "JavaScript",
"bytes": "900804"
},
{
"name": "PHP",
"bytes": "101789"
}
],
"symlink_target": ""
} |
<?php
abstract class model_methods_Abstract extends base
{
public $code;
public $title;
public $description;
public $enabled;
private $_check;
private $_currentCharge;
public function getEnabled() {
return defined('MODULE_PAYMENT_CHECKOUTAPIPAYMENT_STATUS') &&
(MODULE_PAYMENT_CHECKOUTAPIPAYMENT_STATUS == 'True') ? true : false;
}
abstract public function javascript_validation();
abstract public function selection();
abstract public function pre_confirmation_check();
abstract public function confirmation();
abstract public function process_button();
public function before_process() {
global $order, $_POST;
$config = array();
$Api = CheckoutApi_Api::getApi(
array('mode' => MODULE_PAYMENT_CHECKOUTAPIPAYMENT_TRANSACTION_SERVER,
'authorization' => MODULE_PAYMENT_CHECKOUTAPIPAYMENT_SECRET_KEY)
);
$amount = $order->info['total'];
$amountCents = $Api->valueToDecimal($amount, $order->info['currency']);
$config['authorization'] = MODULE_PAYMENT_CHECKOUTAPIPAYMENT_SECRET_KEY;
$config['mode'] = MODULE_PAYMENT_CHECKOUTAPIPAYMENT_TRANSACTION_SERVER;
$products = array();
$i = 1;
foreach ($order->products as $product) {
$products[] = array(
'name' => $product['name'],
'sku' => $product['id'],
'price' => $product['final_price'],
'quantity' => $product['qty'],
);
$i++;
}
$config['postedParam'] = array(
'email' => $order->customer['email_address'],
'value' => $amountCents,
'currency' => $order->info['currency'],
'products' => $products,
'shippingDetails' => array(
'addressLine1' => $order->delivery['street_address'],
'addressLine2' => $order->delivery['suburb'],
'postcode' => $order->delivery['postcode'],
'country' => $order->delivery['country']['iso_code_2'],
'city' => $order->delivery['city'],
'phone' => array('number' => $order->customer['telephone']),
)
);
if (MODULE_PAYMENT_CHECKOUTAPIPAYMENT_TRANSACTION_METHOD == 'Authorize and Capture') {
$config = array_merge($this->_captureConfig(), $config);
}
else {
$config = array_merge($this->_authorizeConfig(), $config);
}
return $config;
}
protected function _placeorder($config) {
global $messageStack, $order;
//building charge
$respondCharge = $this->_createCharge($config);
$this->_currentCharge = $respondCharge;
if ($respondCharge->isValid()) {
if (preg_match('/^1[0-9]+$/', $respondCharge->getResponseCode())) {
$order->info['order_status'] = MODULE_PAYMENT_CHECKOUAPIPAYMENT_REVIEW_ORDER_STATUS_ID;
}
else {
$messageStack->add_session('header', MODULE_PAYMENT_CHECKOUTAPIPAYMENT_ERROR_TITLE, 'error');
$messageStack->add_session('header', MODULE_PAYMENT_CHECKOUTAPIPAYMENT_ERROR_GENERAL, 'error');
$messageStack->add_session('header', $respondCharge->getResponseMessage(), 'error');
zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $respondCharge->getErrorCode(), 'SSL'));
}
}
else {
$messageStack->add_session('header', MODULE_PAYMENT_CHECKOUTAPIPAYMENT_ERROR_TITLE, 'error');
$messageStack->add_session('header', MODULE_PAYMENT_CHECKOUTAPIPAYMENT_ERROR_GENERAL, 'error');
$messageStack->add_session('header', $respondCharge->getExceptionState()->getErrorMessage(), 'error');
zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $respondCharge->getErrorCode(), 'SSL'));
}
}
protected function _createCharge($config) {
$Api = CheckoutApi_Api::getApi(array('mode' => MODULE_PAYMENT_CHECKOUTAPIPAYMENT_TRANSACTION_SERVER));
return $Api->createCharge($config);
}
protected function _captureConfig() {
$to_return['postedParam'] = array(
'autoCapture' => CheckoutApi_Client_Constant::AUTOCAPUTURE_CAPTURE,
'autoCapTime' => MODULE_PAYMENT_CHECKOUAPIPAYMENT_AUTOCAPTIME
);
return $to_return;
}
protected function _authorizeConfig() {
$to_return['postedParam'] = array(
'autoCapture' => CheckoutApi_Client_Constant::AUTOCAPUTURE_AUTH,
'autoCapTime' => 0
);
return $to_return;
}
public function after_process() {
global $insert_id, $customer_id, $stripe_result, $db;
if ($this->_currentCharge) {
$Api = CheckoutApi_Api::getApi(
array('mode' => MODULE_PAYMENT_CHECKOUTAPIPAYMENT_TRANSACTION_SERVER,
'authorization' => MODULE_PAYMENT_CHECKOUTAPIPAYMENT_SECRET_KEY)
);
$status_comment = array('Transaction ID: ' . $this->_currentCharge->getId(),
'Transaction has been process using "' . MODULE_PAYMENT_CHECKOUTAPIPAYMENT_TEXT_PUBLIC_TITLE . '" and paid with card ' . $this->_currentCharge->getCard()->getPaymentMethod(),
'Response code:' . $this->_currentCharge->getResponseCode(),
'Response Message: ' . $this->_currentCharge->getResponseMessage());
$sql = "UPDATE " . TABLE_ORDERS . "
SET orders_status = " . (int) 2 . "
WHERE orders_id = '" . (int) $insert_id . "'";
$db->Execute($sql);
$sql_data_array = array('orders_id' => $insert_id,
'orders_status_id' => (int) 2,
'date_added' => 'now()',
'customer_notified' => '0',
'comments' => implode("\n", $status_comment));
zen_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
$chargeUpdated = $Api->updateTrackId($this->_currentCharge, $insert_id);
}
$this->_currentCharge = '';
}
public function get_error() {
}
public function check() {
global $db;
if (!isset($this->_check)) {
$check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION .
" where configuration_key = 'MODULE_PAYMENT_CHECKOUTAPIPAYMENT_STATUS'");
$this->_check = $check_query->RecordCount();
}
return $this->_check;
}
public function keys() {
return array(
'MODULE_PAYMENT_CHECKOUTAPIPAYMENT_STATUS',
'MODULE_PAYMENT_CHECKOUTAPIPAYMENT_PUBLISHABLE_KEY',
'MODULE_PAYMENT_CHECKOUTAPIPAYMENT_SECRET_KEY',
'MODULE_PAYMENT_CHECKOUTAPIPAYMENT_TRANSACTION_METHOD',
'MODULE_PAYMENT_CHECKOUAPIPAYMENT_REVIEW_ORDER_STATUS_ID',
'MODULE_PAYMENT_CHECKOUTAPIPAYMENT_ZONE',
'MODULE_PAYMENT_CHECKOUTAPIPAYMENT_TRANSACTION_SERVER',
'MODULE_PAYMENT_CHECKOUAPIPAYMENT_TYPE',
'MODULE_PAYMENT_CHECKOUAPIPAYMENT_LOCALPAYMENT_ENABLE',
'MODULE_PAYMENT_CHECKOUAPIPAYMENT_GATEWAY_TIMEOUT',
'MODULE_PAYMENT_CHECKOUAPIPAYMENT_AUTOCAPTIME',
'MODULE_PAYMENT_CHECKOUTAPIPAYMENT_SORT_ORDER',
'MODULE_PAYMENT_CHECKOUAPIPAYMENT_GATEWAY_LOGO_URL',
'MODULE_PAYMENT_CHECKOUAPIPAYMENT_GATEWAY_THEME_COLOR',
'MODULE_PAYMENT_CHECKOUAPIPAYMENT_GATEWAY_BUTTON_COLOR',
'MODULE_PAYMENT_CHECKOUAPIPAYMENT_GATEWAY_ICON_COLOR',
'MODULE_PAYMENT_CHECKOUAPIPAYMENT_GATEWAY_CURRENCY_FORMAT',
'MODULE_PAYMENT_CHECKOUAPIPAYMENT_GATEWAY_IS_3D',
'MODULE_PAYMENT_CHECKOUAPIPAYMENT_GATEWAY_MIN_AMOUNT_3D',
);
}
public function remove() {
global $db;
$db->Execute("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
}
function update_status() {
global $order;
if (($this->getEnabled()) && ((int) MODULE_PAYMENT_CHECKOUTAPIPAYMENT_ZONE > 0) && ( isset($order) && is_object($order) )) {
$check_flag = false;
$check_query = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_STRIPE_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
while (!$check->EOF) {
if ($check['zone_id'] < 1) {
$check_flag = true;
break;
}
elseif ($check['zone_id'] == $order->delivery['zone_id']) {
$check_flag = true;
break;
}
$check->MoveNext();
}
if ($check_flag == false) {
$this->enabled = false;
}
}
}
function install() {
global $db, $messageStack;
if (defined('MODULE_PAYMENT_CHECKOUTAPIPAYMENT_STATUS')) {
$messageStack->add_session('Credit Card (Checkout.com) module already installed.', 'error');
zen_redirect(zen_href_link(FILENAME_MODULES, 'set=payment&module=Checkoutapipayment', 'NONSSL'));
return 'failed';
}
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Credit Card (Checkout.com)', 'MODULE_PAYMENT_CHECKOUTAPIPAYMENT_STATUS', 'True', 'Do you want to accept Credit Card (Checkout.com) payments?', '6', '0', 'zen_cfg_select_option(array(\'True\', \'False\'), ', now())");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Publishable API Key', 'MODULE_PAYMENT_CHECKOUTAPIPAYMENT_PUBLISHABLE_KEY', '', 'The Checkout.com account publishable API key to use.', '6', '0', now())");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Secret API Key', 'MODULE_PAYMENT_CHECKOUTAPIPAYMENT_SECRET_KEY', '', 'The Checkout.com account secret API key to use.', '6', '0', now())");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Type', 'MODULE_PAYMENT_CHECKOUTAPIPAYMENT_TRANSACTION_METHOD', 'Authorize', 'The processing method to use for each transaction.', '6', '0', 'zen_cfg_select_option(array(\'Authorize\', \'Authorize and Capture\'), ', now())");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Server', 'MODULE_PAYMENT_CHECKOUTAPIPAYMENT_TRANSACTION_SERVER', 'Sandbox', 'Perform transactions on the production server or on the testing server.', '6', '0', 'zen_cfg_select_option(array(\'Live\', \'Sandbox\'), ', now())");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Method Type', 'MODULE_PAYMENT_CHECKOUAPIPAYMENT_TYPE', 'True', 'Verify gateway server SSL certificate on connection?', '6', '0', 'zen_cfg_select_option(array(\'True\', \'False\'), ', now())");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_CHECKOUTAPIPAYMENT_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '0', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now())");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Local Payment', 'MODULE_PAYMENT_CHECKOUAPIPAYMENT_LOCALPAYMENT_ENABLE', 'False', 'Enable localpayment using the js.', '6', '0', 'zen_cfg_select_option(array(\'True\', \'False\'), ', now())");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Set Gateway Timeout', 'MODULE_PAYMENT_CHECKOUAPIPAYMENT_GATEWAY_TIMEOUT', '60', 'Set how long request timeout on server.', '6', '0', now())");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Set auto capture time', 'MODULE_PAYMENT_CHECKOUAPIPAYMENT_AUTOCAPTIME', '0', 'When transaction is set to authorize and caputure , the gateway will use this time to caputure the transaction.', '6', '0', now())");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Review Order Status', 'MODULE_PAYMENT_CHECKOUAPIPAYMENT_REVIEW_ORDER_STATUS_ID', '0', 'Set the status of orders flagged as being under review to this value', '6', '0', 'zen_get_order_status_name', 'zen_cfg_pull_down_order_statuses(', now())");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_CHECKOUTAPIPAYMENT_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Logo Url', 'MODULE_PAYMENT_CHECKOUAPIPAYMENT_GATEWAY_LOGO_URL', '', 'Display your logo on checkout.js (Max size: 180 x 36)', '6', '0', now())");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Theme color ', 'MODULE_PAYMENT_CHECKOUAPIPAYMENT_GATEWAY_THEME_COLOR', '', 'Set theme color for checkout.js', '6', '0', now())");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Button color', 'MODULE_PAYMENT_CHECKOUAPIPAYMENT_GATEWAY_BUTTON_COLOR', '', 'Set color for Pay now button', '6', '0', now())");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Icon color', 'MODULE_PAYMENT_CHECKOUAPIPAYMENT_GATEWAY_ICON_COLOR', '', 'Set icon color for checkout.js', '6', '0', now())");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Currency format', 'MODULE_PAYMENT_CHECKOUAPIPAYMENT_GATEWAY_CURRENCY_FORMAT', 'Code', 'Display currency code or currency symbol on the checkout.js', '6', '0','zen_cfg_select_option(array(\'Code\', \'Symbol\'), ', now())");
// $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Is 3D?', 'MODULE_PAYMENT_CHECKOUAPIPAYMENT_GATEWAY_IS_3D', 'No', 'User will also be required to enter a password to complete the process.', '6', '0','zen_cfg_select_option(array(\'Yes\', \'No\'), ', now())");
//
// $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Minumum amount for 3d secure transaction', 'MODULE_PAYMENT_CHECKOUAPIPAYMENT_GATEWAY_MIN_AMOUNT_3D', '', 'Set minimum amount for 3d transaction', '6', '0', now())");
}
function format_raw($number, $currency_code = '', $currency_value = '') {
global $currencies, $currency;
if (empty($currency_code) || !$currencies->is_set($currency_code)) {
$currency_code = $currency;
}
if (empty($currency_value) || !is_numeric($currency_value)) {
$currency_value = $currencies->currencies[$currency_code]['value'];
}
return number_format(zen_round($number * $currency_value, $currencies->currencies[$currency_code]['decimal_places']), $currencies->currencies[$currency_code]['decimal_places'], '', '');
}
}
| {
"content_hash": "314d51dc226175e0d61fb9f81c487c18",
"timestamp": "",
"source": "github",
"line_count": 278,
"max_line_length": 475,
"avg_line_length": 60.35971223021583,
"alnum_prop": 0.6733611442193087,
"repo_name": "jason-footing-cko/checkout-zencart-plugin",
"id": "06d51d4ad1cdc15affc181afd76869ce7ed39ff4",
"size": "16780",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "includes/modules/payment/checkoutapipayment/model/methods/Abstract.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "333"
},
{
"name": "PHP",
"bytes": "50586"
}
],
"symlink_target": ""
} |
<html>
<head>
<title>OgreMaterialSerializer.h File Reference - OGRE Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link type="text/css" rel="stylesheet" href="doxygen.css">
<link type="text/css" rel="stylesheet" href="tabs.css">
</head>
<body>
<!-- Generated by Doxygen 1.7.6.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li><a href="dirs.html"><span>Directories</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>File Members</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_8388db04747d7625d426abbcac0905dd.html">OgreMain</a> </li>
<li class="navelem"><a class="el" href="dir_697e021d2615ffc0898007e3a5fb29f4.html">include</a> </li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> |
<a href="#namespaces">Namespaces</a> |
<a href="#typedef-members">Typedefs</a> |
<a href="#enum-members">Enumerations</a> </div>
<div class="headertitle">
<div class="title">OgreMaterialSerializer.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include "<a class="el" href="OgrePrerequisites_8h_source.html">OgrePrerequisites.h</a>"</code><br/>
<code>#include "<a class="el" href="OgreMaterial_8h_source.html">OgreMaterial.h</a>"</code><br/>
<code>#include "<a class="el" href="OgreBlendMode_8h_source.html">OgreBlendMode.h</a>"</code><br/>
<code>#include "<a class="el" href="OgreTextureUnitState_8h_source.html">OgreTextureUnitState.h</a>"</code><br/>
<code>#include "<a class="el" href="OgreGpuProgram_8h_source.html">OgreGpuProgram.h</a>"</code><br/>
<code>#include "<a class="el" href="OgreStringVector_8h_source.html">OgreStringVector.h</a>"</code><br/>
</div>
<p><a href="OgreMaterialSerializer_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structOgre_1_1MaterialScriptProgramDefinition.html">Ogre::MaterialScriptProgramDefinition</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Struct for holding a program definition which is in progress. <a href="structOgre_1_1MaterialScriptProgramDefinition.html#details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structOgre_1_1MaterialScriptContext.html">Ogre::MaterialScriptContext</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Struct for holding the script context while parsing. <a href="structOgre_1_1MaterialScriptContext.html#details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classOgre_1_1MaterialSerializer.html">Ogre::MaterialSerializer</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Class for serializing Materials to / from a .material script. <a href="classOgre_1_1MaterialSerializer.html#details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classOgre_1_1MaterialSerializer_1_1Listener.html">Ogre::MaterialSerializer::Listener</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Class that allows listening in on the various stages of material serialization process. <a href="classOgre_1_1MaterialSerializer_1_1Listener.html#details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="namespaces"></a>
Namespaces</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">namespace  </td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceOgre.html">Ogre</a></td></tr>
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef bool(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__Materials.html#ga315137b78f2d739ab0e41e07b1fcf51d">Ogre::ATTRIBUTE_PARSER</a> )(String &params, MaterialScriptContext &context)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Function def for material attribute parser; return value determines if the next line should be {. <a href="group__Materials.html#ga315137b78f2d739ab0e41e07b1fcf51d"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="group__Materials.html#ga83c5c9e6cd44a657c97dd7494800676c">Ogre::MaterialScriptSection</a> { <br/>
  <a class="el" href="group__Materials.html#gga83c5c9e6cd44a657c97dd7494800676caa8ecf2298f0401fa132fbe09d7306e22">Ogre::MSS_NONE</a>,
<a class="el" href="group__Materials.html#gga83c5c9e6cd44a657c97dd7494800676ca03535ff3b3deaf08ce6e4cf28f247396">Ogre::MSS_MATERIAL</a>,
<a class="el" href="group__Materials.html#gga83c5c9e6cd44a657c97dd7494800676ca75dcdf27cd2c26a79997de2e6670f4a1">Ogre::MSS_TECHNIQUE</a>,
<a class="el" href="group__Materials.html#gga83c5c9e6cd44a657c97dd7494800676ca4dbef3e527e942ad0fdf8790ff79ca91">Ogre::MSS_PASS</a>,
<br/>
  <a class="el" href="group__Materials.html#gga83c5c9e6cd44a657c97dd7494800676caf7bf31ae13f2c3b042d78aa28626b1e5">Ogre::MSS_TEXTUREUNIT</a>,
<a class="el" href="group__Materials.html#gga83c5c9e6cd44a657c97dd7494800676cac22fc0112f378c4652e0335c5369a501">Ogre::MSS_PROGRAM_REF</a>,
<a class="el" href="group__Materials.html#gga83c5c9e6cd44a657c97dd7494800676ca1482036b89dfe855d5722f4280bb9136">Ogre::MSS_PROGRAM</a>,
<a class="el" href="group__Materials.html#gga83c5c9e6cd44a657c97dd7494800676ca485e4dd851bfd5d5db3ca78b4a031d44">Ogre::MSS_DEFAULT_PARAMETERS</a>,
<br/>
  <a class="el" href="group__Materials.html#gga83c5c9e6cd44a657c97dd7494800676cadd3efa1f0af549e1fbe112beb544bf69">Ogre::MSS_TEXTURESOURCE</a>
<br/>
}</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Enum to identify material sections. <a href="group__Materials.html#ga83c5c9e6cd44a657c97dd7494800676c">More...</a><br/></td></tr>
</table>
</div><!-- contents -->
<hr>
<p>
Copyright © 2012 Torus Knot Software Ltd<br />
<!--Creative Commons License--><a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.<br/>
<!--/Creative Commons License--><!-- <rdf:RDF xmlns="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<Work rdf:about="">
<license rdf:resource="http://creativecommons.org/licenses/by-sa/2.5/" />
<dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" />
</Work>
<License rdf:about="http://creativecommons.org/licenses/by-sa/2.5/"><permits rdf:resource="http://web.resource.org/cc/Reproduction"/><permits rdf:resource="http://web.resource.org/cc/Distribution"/><requires rdf:resource="http://web.resource.org/cc/Notice"/><requires rdf:resource="http://web.resource.org/cc/Attribution"/><permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/><requires rdf:resource="http://web.resource.org/cc/ShareAlike"/></License></rdf:RDF> -->
Last modified Sun Sep 2 2012 07:27:24
</p>
</body>
</html>
| {
"content_hash": "963e7fc80311269c537fa303b493ced5",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 481,
"avg_line_length": 82.83495145631068,
"alnum_prop": 0.7117909048288795,
"repo_name": "jjenki11/blaze-chem-rendering",
"id": "0a705ab0568aee488cbeb2c6a7ed0721d8cc5c14",
"size": "8532",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "ogre/ogre_src_v1-8-1/Docs/api/html/OgreMaterialSerializer_8h.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Shell",
"bytes": "2476"
}
],
"symlink_target": ""
} |
/* 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.
*/
//the file has been added by SAP Research, 2014
package org.activiti.engine.impl.bpmn.helper;
import noNamespace.NotifyContextRequest;
import noNamespace.NotifyContextRequestDocument;
import noNamespace.NotifyContextResponse;
import noNamespace.NotifyContextResponseDocument;
import noNamespace.StatusCode;
import org.activiti.engine.impl.bpmn.helper.NGSISubscriptionManager.NotFoundException;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.xmlbeans.XmlException;
import org.apache.xmlbeans.XmlString;
import org.restlet.resource.Post;
import org.restlet.resource.ServerResource;
/**
* Provides an HTTP endpoint to receive context notification requests and trigger NGSI start events
*/
public class NGSINotifyContextEndpoint extends ServerResource {
protected static final Logger LOGGER = Logger.getLogger(NGSINotifyContextEndpoint.class.getName());
private String requestBody;
private NotifyContextRequest notifyContextRequest;
private StatusCode statusCode;
private String response;
@Post
public String notifyContext(String requestBody) {
this.requestBody = requestBody;
handleRequest();
return response;
}
private void handleRequest() {
try {
parseRequest();
startProcess();
createOKStatusCode();
}
catch(XmlException e){
createBadRequestStatusCode(e);
}
catch(NotFoundException e) {
createSubscriptionNotFoundStatusCode();
}
catch(Exception e) {
createInternalErrorStatusCode(e);
}
createResponse();
}
private void parseRequest() throws XmlException {
NotifyContextRequestDocument notifyContextRequestDocument = NotifyContextRequestDocument.Factory.parse(requestBody);
if(!notifyContextRequestDocument.validate()) {
throw new XmlException("Request from NGSI server is not valid");
}
notifyContextRequest = notifyContextRequestDocument.getNotifyContextRequest();
}
private void startProcess() throws NotFoundException, Exception {
String subscriptionID = notifyContextRequest.getSubscriptionId();
String dataObject = notifyContextRequest.getContextResponseList().toString();
NGSISubscriptionManager.get().notify(subscriptionID, dataObject);
}
private void createResponse() {
NotifyContextResponseDocument notifyContextResponseDocument = NotifyContextResponseDocument.Factory.newInstance();
NotifyContextResponse notifyContextResponse = notifyContextResponseDocument.addNewNotifyContextResponse();
notifyContextResponse.setResponseCode(statusCode);
response = notifyContextResponseDocument.toString();
}
private void createInternalErrorStatusCode(Exception e) {
statusCode = StatusCode.Factory.newInstance();
e.printStackTrace();
//this is a server problem and no communication problem. It's already logged within the execution
statusCode.setCode(500);
statusCode.xsetReasonPhrase(XmlString.Factory.newValue(e.getStackTrace().toString()));
}
private void createSubscriptionNotFoundStatusCode() {
statusCode = StatusCode.Factory.newInstance();
LOGGER.info("Received a NGSI notification request for a non-existing subscription");
statusCode.setCode(470);
statusCode.xsetReasonPhrase(XmlString.Factory.newValue("The subscription ID is unknown"));
}
private void createBadRequestStatusCode(XmlException e) {
statusCode = StatusCode.Factory.newInstance();
LOGGER.info("Received an invalid NGSI notification request: " + e.getMessage());
statusCode.setCode(400);
statusCode.xsetReasonPhrase(XmlString.Factory.newValue(e.getMessage()));
}
private void createOKStatusCode() {
statusCode = StatusCode.Factory.newInstance();
LOGGER.log(Level.INFO,"Answering the notification request with success.");
statusCode.setCode(200);
statusCode.xsetReasonPhrase(XmlString.Factory.newValue("OK"));
}
}
| {
"content_hash": "87e40392f0bbf02c0386a8aa9e1a3ecd",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 120,
"avg_line_length": 36.87603305785124,
"alnum_prop": 0.7698341550874047,
"repo_name": "iotsap/FiWare-Template-Handler",
"id": "ccb1a5c1f537ee4feb33ad421ccef73f418cc8e4",
"size": "4462",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ExecutionEnvironment/modules/activiti-engine/src/main/java/org/activiti/engine/impl/bpmn/helper/NGSINotifyContextEndpoint.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "481305"
},
{
"name": "Java",
"bytes": "8276608"
},
{
"name": "JavaScript",
"bytes": "3364343"
},
{
"name": "Shell",
"bytes": "2529"
},
{
"name": "XSLT",
"bytes": "19610"
}
],
"symlink_target": ""
} |
@interface SFToolInformation : SFODataObject
{
}
@property (nonatomic, strong) NSString *ToolName;
@property (nonatomic, strong) NSString *Version;
@end
| {
"content_hash": "9952b803479a0a742f1240e926f39076",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 49,
"avg_line_length": 17.333333333333332,
"alnum_prop": 0.7628205128205128,
"repo_name": "citrix/ShareFile-ObjectiveC",
"id": "15dc9f1132dd5085e58548cb10beee2af8fbd79e",
"size": "306",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ShareFileSDK/ShareFileSDK/Generated Code/Models/SFToolInformation.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "45"
},
{
"name": "Objective-C",
"bytes": "1261492"
}
],
"symlink_target": ""
} |
package io.reactivex.internal.util;
import static org.junit.Assert.assertEquals;
import java.util.List;
import java.util.concurrent.atomic.AtomicLong;
import org.junit.*;
import io.reactivex.TestHelper;
import io.reactivex.plugins.RxJavaPlugins;
public class BackpressureHelperTest {
@Ignore("BackpressureHelper is an enum")
@Test
public void constructorShouldBePrivate() {
TestHelper.checkUtilityClass(BackpressureHelper.class);
}
@Test
public void testAddCap() {
assertEquals(2L, BackpressureHelper.addCap(1, 1));
assertEquals(Long.MAX_VALUE, BackpressureHelper.addCap(1, Long.MAX_VALUE - 1));
assertEquals(Long.MAX_VALUE, BackpressureHelper.addCap(1, Long.MAX_VALUE));
assertEquals(Long.MAX_VALUE, BackpressureHelper.addCap(Long.MAX_VALUE - 1, Long.MAX_VALUE - 1));
assertEquals(Long.MAX_VALUE, BackpressureHelper.addCap(Long.MAX_VALUE, Long.MAX_VALUE));
}
@Test
public void testMultiplyCap() {
assertEquals(6, BackpressureHelper.multiplyCap(2, 3));
assertEquals(Long.MAX_VALUE, BackpressureHelper.multiplyCap(2, Long.MAX_VALUE));
assertEquals(Long.MAX_VALUE, BackpressureHelper.multiplyCap(Long.MAX_VALUE, Long.MAX_VALUE));
assertEquals(Long.MAX_VALUE, BackpressureHelper.multiplyCap(1L << 32, 1L << 32));
}
@Test
public void producedMore() {
List<Throwable> list = TestHelper.trackPluginErrors();
try {
AtomicLong requested = new AtomicLong(1);
assertEquals(0, BackpressureHelper.produced(requested, 2));
TestHelper.assertError(list, 0, IllegalStateException.class, "More produced than requested: -1");
} finally {
RxJavaPlugins.reset();
}
}
@Test
public void producedMoreCancel() {
List<Throwable> list = TestHelper.trackPluginErrors();
try {
AtomicLong requested = new AtomicLong(1);
assertEquals(0, BackpressureHelper.producedCancel(requested, 2));
TestHelper.assertError(list, 0, IllegalStateException.class, "More produced than requested: -1");
} finally {
RxJavaPlugins.reset();
}
}
@Test
public void requestProduceRace() {
final AtomicLong requested = new AtomicLong(1);
for (int i = 0; i < TestHelper.RACE_DEFAULT_LOOPS; i++) {
Runnable r1 = new Runnable() {
@Override
public void run() {
BackpressureHelper.produced(requested, 1);
}
};
Runnable r2 = new Runnable() {
@Override
public void run() {
BackpressureHelper.add(requested, 1);
}
};
TestHelper.race(r1, r2);
}
}
@Test
public void requestCancelProduceRace() {
final AtomicLong requested = new AtomicLong(1);
for (int i = 0; i < TestHelper.RACE_DEFAULT_LOOPS; i++) {
Runnable r1 = new Runnable() {
@Override
public void run() {
BackpressureHelper.produced(requested, 1);
}
};
Runnable r2 = new Runnable() {
@Override
public void run() {
BackpressureHelper.addCancel(requested, 1);
}
};
TestHelper.race(r1, r2);
}
}
@Test
public void utilityClass() {
TestHelper.checkUtilityClass(BackpressureHelper.class);
}
@Test
public void capped() {
final AtomicLong requested = new AtomicLong(Long.MIN_VALUE);
assertEquals(Long.MIN_VALUE, BackpressureHelper.addCancel(requested, 1));
assertEquals(Long.MIN_VALUE, BackpressureHelper.addCancel(requested, Long.MAX_VALUE));
requested.set(0);
assertEquals(0, BackpressureHelper.addCancel(requested, Long.MAX_VALUE));
assertEquals(Long.MAX_VALUE, BackpressureHelper.addCancel(requested, 1));
assertEquals(Long.MAX_VALUE, BackpressureHelper.addCancel(requested, Long.MAX_VALUE));
requested.set(0);
assertEquals(0, BackpressureHelper.add(requested, Long.MAX_VALUE));
assertEquals(Long.MAX_VALUE, BackpressureHelper.add(requested, 1));
assertEquals(Long.MAX_VALUE, BackpressureHelper.add(requested, Long.MAX_VALUE));
assertEquals(Long.MAX_VALUE, BackpressureHelper.produced(requested, 1));
assertEquals(Long.MAX_VALUE, BackpressureHelper.produced(requested, Long.MAX_VALUE));
}
@Test
public void multiplyCap() {
assertEquals(Long.MAX_VALUE, BackpressureHelper.multiplyCap(3, Long.MAX_VALUE >> 1));
assertEquals(Long.MAX_VALUE, BackpressureHelper.multiplyCap(1, Long.MAX_VALUE));
}
}
| {
"content_hash": "49aa7e747e38b970cf3b07d2d43b14e4",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 109,
"avg_line_length": 32.12582781456954,
"alnum_prop": 0.6229643372500515,
"repo_name": "akarnokd/RxJava",
"id": "fbcff0ab958e15e0748bc3de9b167eec81ba8c6a",
"size": "5464",
"binary": false,
"copies": "3",
"ref": "refs/heads/2.x",
"path": "src/test/java/io/reactivex/internal/util/BackpressureHelperTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "11138"
},
{
"name": "Java",
"bytes": "13685741"
},
{
"name": "Shell",
"bytes": "1240"
}
],
"symlink_target": ""
} |
namespace SuperheroesUniverse.Importer
{
using Data.Common;
public interface IImporter
{
void ImportData(ISuperheroesDataProvider db);
}
} | {
"content_hash": "57ebac31ee40d7282a8599dbd0ee0282",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 53,
"avg_line_length": 18.22222222222222,
"alnum_prop": 0.7012195121951219,
"repo_name": "RuzmanovDev/Telerik-Academy-Season-2016-2017",
"id": "7d8e049d1a343e392bcf570bca44a23af8c6ab97",
"size": "166",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Modul-II/04.Databases/Exam/db-nice-solution/Exam/01-SuperheroesUniverse-CodeFirst/SuperheroesUniverse.Importer/IImporter.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "156062"
},
{
"name": "C#",
"bytes": "6854317"
},
{
"name": "CSS",
"bytes": "151173"
},
{
"name": "CoffeeScript",
"bytes": "3700"
},
{
"name": "HTML",
"bytes": "3848453"
},
{
"name": "JavaScript",
"bytes": "2098645"
},
{
"name": "PowerShell",
"bytes": "287"
},
{
"name": "SQLPL",
"bytes": "4671"
},
{
"name": "XSLT",
"bytes": "3306"
}
],
"symlink_target": ""
} |
namespace Certify.Models
{
public enum DeploymentOption
{
/// <summary>
/// Use defaults/best guess for deployment
/// </summary>
Auto = 5,
/// <summary>
/// Apply certificate to single site
/// </summary>
SingleSite = 10,
/// <summary>
/// Apply certificate to all sites
/// </summary>
AllSites = 20,
/// <summary>
/// Store in certificate store only
/// </summary>
DeploymentStoreOnly = 30,
/// <summary>
/// No Deployment
/// </summary>
NoDeployment = 40
}
public enum DeploymentBindingOption
{
/// <summary>
/// Add or Update https bindings as required
/// </summary>
AddOrUpdate = 10,
/// <summary>
/// Update existing https bindings only (as required)
/// </summary>
UpdateOnly = 20
}
}
| {
"content_hash": "3911475945878ee8e038c99fd0eeb29e",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 62,
"avg_line_length": 22.209302325581394,
"alnum_prop": 0.48900523560209425,
"repo_name": "ndouthit/Certify",
"id": "547deb0a1803124cfe5b043bdcdcff91566874da",
"size": "957",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/Certify.Models/Util/DeploymentOptions.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "348522"
}
],
"symlink_target": ""
} |
ldap_dir =
case os.family
when 'debian'
'/etc/ldap'
when 'redhat', 'amazon', 'fedora', 'suse'
'/etc/openldap'
when 'bsd'
'/usr/local/etc/openldap'
end
control 'type_consumer' do
describe file "#{ldap_dir}/slapd.conf" do
its('content') { should match %r{syncrepl rid=102\n\s+provider=ldap://ldap\.example\.com:389\n\s+type=refreshAndPersist\n\s+interval=01:00:00:00\n\s+searchbase="dc=example,dc=com"\n\s+filter="\(objectClass=\*\)"\n\s+scope=sub\n\s+schemachecking=off\n\s+bindmethod=simple\n\s+binddn="cn=syncrole,dc=example,dc=com"\n\s+starttls=no\n\s+credentials=""} }
end
end
| {
"content_hash": "8d5309e9888d1ba0e6d8fb7e08bfce15",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 355,
"avg_line_length": 40.733333333333334,
"alnum_prop": 0.6808510638297872,
"repo_name": "chef-cookbooks/openldap",
"id": "bddcb312265d16a7c6f54c12a8a799bc9776ff0b",
"size": "611",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "test/integration/type_consumer/controls/type_consumer_spec.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "14125"
},
{
"name": "Ruby",
"bytes": "14286"
}
],
"symlink_target": ""
} |
/**
* @file chsem.h
* @brief Semaphores macros and structures.
*
* @addtogroup semaphores
* @{
*/
#ifndef _CHSEM_H_
#define _CHSEM_H_
#if CH_USE_SEMAPHORES || defined(__DOXYGEN__)
/**
* @brief Semaphore structure.
*/
typedef struct Semaphore {
ThreadsQueue s_queue; /**< @brief Queue of the threads sleeping
on this semaphore. */
cnt_t s_cnt; /**< @brief The semaphore counter. */
} Semaphore;
#ifdef __cplusplus
extern "C" {
#endif
void chSemInit(Semaphore *sp, cnt_t n);
void chSemReset(Semaphore *sp, cnt_t n);
void chSemResetI(Semaphore *sp, cnt_t n);
msg_t chSemWait(Semaphore *sp);
msg_t chSemWaitS(Semaphore *sp);
msg_t chSemWaitTimeout(Semaphore *sp, systime_t time);
msg_t chSemWaitTimeoutS(Semaphore *sp, systime_t time);
void chSemSignal(Semaphore *sp);
void chSemSignalI(Semaphore *sp);
void chSemAddCounterI(Semaphore *sp, cnt_t n);
#if CH_USE_SEMSW
msg_t chSemSignalWait(Semaphore *sps, Semaphore *spw);
#endif
#ifdef __cplusplus
}
#endif
/**
* @brief Data part of a static semaphore initializer.
* @details This macro should be used when statically initializing a semaphore
* that is part of a bigger structure.
*
* @param[in] name the name of the semaphore variable
* @param[in] n the counter initial value, this value must be
* non-negative
*/
#define _SEMAPHORE_DATA(name, n) {_THREADSQUEUE_DATA(name.s_queue), n}
/**
* @brief Static semaphore initializer.
* @details Statically initialized semaphores require no explicit
* initialization using @p chSemInit().
*
* @param[in] name the name of the semaphore variable
* @param[in] n the counter initial value, this value must be
* non-negative
*/
#define SEMAPHORE_DECL(name, n) Semaphore name = _SEMAPHORE_DATA(name, n)
/**
* @name Macro Functions
* @{
*/
/**
* @brief Decreases the semaphore counter.
* @details This macro can be used when the counter is known to be positive.
*
* @iclass
*/
#define chSemFastWaitI(sp) ((sp)->s_cnt--)
/**
* @brief Increases the semaphore counter.
* @details This macro can be used when the counter is known to be not
* negative.
*
* @iclass
*/
#define chSemFastSignalI(sp) ((sp)->s_cnt++)
/**
* @brief Returns the semaphore counter current value.
*
* @iclass
*/
#define chSemGetCounterI(sp) ((sp)->s_cnt)
/** @} */
#endif /* CH_USE_SEMAPHORES */
#endif /* _CHSEM_H_ */
/** @} */
| {
"content_hash": "509e81891987730d0473868932fbe4bb",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 78,
"avg_line_length": 25.84,
"alnum_prop": 0.6261609907120743,
"repo_name": "silentsight/cansat",
"id": "d8de2c8cd817e1cf355012ad0acdfaf893daa989",
"size": "3733",
"binary": false,
"copies": "20",
"ref": "refs/heads/master",
"path": "scheduller/chibios/libraries/ChibiOS_AVR/utility/chsem.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Arduino",
"bytes": "225044"
},
{
"name": "C",
"bytes": "1467496"
},
{
"name": "C++",
"bytes": "953596"
},
{
"name": "CSS",
"bytes": "17452"
},
{
"name": "JavaScript",
"bytes": "21064"
},
{
"name": "Processing",
"bytes": "70884"
}
],
"symlink_target": ""
} |
package com.suscipio_solutions.consecro_mud.Commands;
import java.util.List;
import java.util.Vector;
import com.suscipio_solutions.consecro_mud.Common.interfaces.CMMsg;
import com.suscipio_solutions.consecro_mud.Items.interfaces.Food;
import com.suscipio_solutions.consecro_mud.Items.interfaces.Item;
import com.suscipio_solutions.consecro_mud.Items.interfaces.Wearable;
import com.suscipio_solutions.consecro_mud.MOBS.interfaces.MOB;
import com.suscipio_solutions.consecro_mud.core.CMClass;
import com.suscipio_solutions.consecro_mud.core.CMLib;
import com.suscipio_solutions.consecro_mud.core.CMParms;
import com.suscipio_solutions.consecro_mud.core.CMProps;
import com.suscipio_solutions.consecro_mud.core.interfaces.Drink;
@SuppressWarnings("rawtypes")
public class Feed extends StdCommand
{
public Feed(){}
private final String[] access=I(new String[]{"FEED"});
@Override public String[] getAccessWords(){return access;}
@Override
public boolean execute(MOB mob, Vector commands, int metaFlags)
throws java.io.IOException
{
if(commands.size()<3)
{
mob.tell(L("Feed who what?"));
return false;
}
commands.removeElementAt(0);
final String what=(String)commands.lastElement();
commands.removeElement(what);
final String whom=CMParms.combine(commands,0);
final MOB target=mob.location().fetchInhabitant(whom);
if((target==null)||(!CMLib.flags().canBeSeenBy(target,mob)))
{
mob.tell(L("I don't see @x1 here.",whom));
return false;
}
if(mob.isInCombat())
{
mob.tell(L("Not while you are in combat!"));
return false;
}
if(target.willFollowOrdersOf(mob)||(CMLib.flags().isBoundOrHeld(target)))
{
final Item item=mob.findItem(null,what);
if((item==null)||(!CMLib.flags().canBeSeenBy(item,mob)))
{
mob.tell(L("I don't see @x1 here.",what));
return false;
}
if(!item.amWearingAt(Wearable.IN_INVENTORY))
{
mob.tell(L("You might want to remove that first."));
return false;
}
if((!(item instanceof Food))&&(!(item instanceof Drink)))
{
mob.tell(L("You might want to try feeding them something edibile or drinkable."));
return false;
}
if(target.isInCombat())
{
mob.tell(L("Not while @x1 is in combat!",target.name(mob)));
return false;
}
CMMsg msg=CMClass.getMsg(mob,target,item,CMMsg.MSG_NOISYMOVEMENT,L("<S-NAME> feed(s) @x1 to <T-NAMESELF>.",item.name()));
if(mob.location().okMessage(mob,msg))
{
mob.location().send(mob,msg);
if((CMLib.commands().postDrop(mob,item,true,false,false))
&&(mob.location().isContent(item)))
{
msg=CMClass.getMsg(target,item,CMMsg.MASK_ALWAYS|CMMsg.MSG_GET,null);
target.location().send(target,msg);
if(target.isMine(item))
{
if(item instanceof Food)
msg=CMClass.getMsg(target,item,null,CMMsg.MASK_ALWAYS|CMMsg.MSG_EAT,CMMsg.MSG_EAT,CMMsg.MSG_EAT,null);
else
msg=CMClass.getMsg(target,item,null,CMMsg.MASK_ALWAYS|CMMsg.MSG_DRINK,CMMsg.MSG_DRINK,CMMsg.MSG_DRINK,null);
if(target.location().okMessage(target,msg))
target.location().send(target,msg);
if(target.isMine(item))
{
msg=CMClass.getMsg(target,item,null,CMMsg.MASK_ALWAYS|CMMsg.MSG_DROP,CMMsg.MSG_DROP,CMMsg.MSG_DROP,null);
if(mob.location().okMessage(mob,msg))
{
mob.location().send(mob,msg);
CMLib.commands().postGet(mob,null,item,true);
}
}
}
}
}
}
else
mob.tell(L("@x1 won't let you.",target.name(mob)));
return false;
}
@Override public double combatActionsCost(final MOB mob, final List<String> cmds){return CMProps.getCommandCombatActionCost(ID());}
@Override public double actionsCost(final MOB mob, final List<String> cmds){return CMProps.getCommandActionCost(ID());}
@Override public boolean canBeOrdered(){return true;}
}
| {
"content_hash": "39858a44b6193f148492814d658064d6",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 132,
"avg_line_length": 34.75454545454546,
"alnum_prop": 0.6989275438137589,
"repo_name": "ConsecroMUD/ConsecroMUD",
"id": "0808610b7218785fff66dc377dd4d547e8a1575b",
"size": "3823",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "com/suscipio_solutions/consecro_mud/Commands/Feed.java",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1413"
},
{
"name": "Java",
"bytes": "21670655"
},
{
"name": "JavaScript",
"bytes": "23366"
},
{
"name": "Perl",
"bytes": "732"
},
{
"name": "Shell",
"bytes": "6214"
}
],
"symlink_target": ""
} |
This program displays the well-known Sierpinski triangle. This is done by
computing Pascal's triangle modulo 2. See [Wikipedia]
(https://en.wikipedia.org/wiki/Sierpinski_triangle).
I know there are smaller versions out there but they look different. :)
ruelle, 2010
| {
"content_hash": "3c76486a534e0965faabf1a79b36f894",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 73,
"avg_line_length": 38.285714285714285,
"alnum_prop": 0.7873134328358209,
"repo_name": "volleyballschlaeger/sierp",
"id": "fa7a4c456a60f4e7dd7873878ad617aed5161ef4",
"size": "334",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Assembly",
"bytes": "1159"
},
{
"name": "Makefile",
"bytes": "189"
}
],
"symlink_target": ""
} |
<?php
/**
* The contents of this file was generated using the WSDLs as provided by eBay.
*
* DO NOT EDIT THIS FILE!
*/
namespace DTS\eBaySDK\MerchantData\Types;
/**
*
* @property \DTS\eBaySDK\MerchantData\Enums\UserIdentityCodeType $type
*/
class UserIdentityType extends \DTS\eBaySDK\Types\StringType
{
/**
* @var array Properties belonging to objects of this class.
*/
private static $propertyTypes = [
'type' => [
'type' => 'string',
'repeatable' => false,
'attribute' => true,
'attributeName' => 'type'
]
];
/**
* @param array $values Optional properties and values to assign to the object.
*/
public function __construct(array $values = [])
{
list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values);
parent::__construct($parentValues);
if (!array_key_exists(__CLASS__, self::$properties)) {
self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes);
}
if (!array_key_exists(__CLASS__, self::$xmlNamespaces)) {
self::$xmlNamespaces[__CLASS__] = 'xmlns="urn:ebay:apis:eBLBaseComponents"';
}
$this->setValues(__CLASS__, $childValues);
}
}
| {
"content_hash": "0b65ab287c2a06c605b767b0b4cb9678",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 116,
"avg_line_length": 28.21276595744681,
"alnum_prop": 0.5920060331825038,
"repo_name": "chain24/ebayprocess-lumen",
"id": "8b834581cc6689ef0c2e86d60f6cffb92bccaa12",
"size": "1326",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "vendor/dts/ebay-sdk-php/src/MerchantData/Types/UserIdentityType.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "412"
},
{
"name": "PHP",
"bytes": "302973"
}
],
"symlink_target": ""
} |
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Exploring Destinasia discount rules</title>
<meta name="description" content="Exploring discount travel rules project">
<meta name="author" content="Eric D. Schabell">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="css/reveal.min.css">
<link rel="stylesheet" href="css/theme/serif.css" id="theme">
<!-- For syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- If the query includes 'print-pdf', include the PDF print sheet -->
<script>
if (window.location.search.match(/print-pdf/gi)) {
var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'css/print/pdf.css';
document.getElementsByTagName('head')[0].appendChild(link);
}
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section>
<div style="width: 1056px; height: 130px;">
<h2>Lab 3</h2>
<h4>Exploring travel discount rules project</h4>
</div>
</section>
<section>
<div style="width: 1056px; height: 130px;">
<h2>Lab Goal</h2>
<h4>To explore JBoss BRMS project with travel discount rules and rule tests to understand how they work.</h4>
</div>
<div style="width: 1056px; height: 600px;">
<img src="images/destinasia-workshop/image01.png">
</div>
</section>
<section>
<div style="width: 1056px; height: 130px;">
<h2>ARCHITECTURE</h2>
<h4>Deploy travel discount rules on OpenShift Container Platform</h4>
</div>
<div style="width: 1056px; height: 600px;">
<img src="images/destinasia-workshop/image14.png">
</div>
</section>
<section>
<div style="width: 1056px; height: 130px;">
<h2>VIEW PROJECT</h2>
</div>
<div style="width: 1056px; height: 500px;">
<ul>
<li>Open project by clicking on menu entry <i>Authoring -> Project Authoring:</i></li>
</ul>
<img src="images/destinasia-workshop/image26.png" align="right">
</div>
</section>
<section>
<div style="width: 1056px; height: 120px;">
<h2>DECISION TABLE</h2>
<h5>Project opens with discount rules in decision table</h5>
</div>
<div style="width: 1056px; height: 600px;">
<img src="images/destinasia-workshop/image27.png">
</div>
</section>
<section>
<div style="width: 1056px; height: 130px;">
<h2>DISCOUNT RULES</h2>
</div>
<div style="width: 1056px; height: 500px;">
<ul>
<li>Table has rules for Flights, Cars and Hotels:</li>
<br>
<ul>
<li><p style="font-size: 24px">Flights: for diverse asian airport codes gets 10 discount</p></li>
<li><p style="font-size: 24px">Cars: for Hertz car rental company gets 15 discount</p></li>
<li><p style="font-size: 24px">Hotel: for length of stay six or more days gets 10 discount</p></li>
</ul>
<br>
<img src="images/destinasia-workshop/image28.png" align="right">
</ul>
</div>
</section>
<section>
<div style="width: 1056px; height: 160px;">
<h2>RULES TEST</h2>
<h5>Open the <i>TEST SCENARIOS</i> tab on right in <i>Project Explorer</i> and click on <i>TestDiscountRules</i> to open...</h5>
</div>
<div style="width: 1056px; height: 600px;">
<img src="images/destinasia-workshop/image29.png">
</div>
</section>
<section>
<div style="width: 1056px; height: 100px;">
<h2>TEST OVERVIEW</h2>
</div>
<div style="width: 1056px; height: 600px;">
<img src="images/destinasia-workshop/image30.png">
</div>
</section>
<section>
<div style="width: 1056px; height: 120px;">
<h2>TEST RUN FAILS</h2>
<h5>Click on <i>Run scenario</i> button top righ to see test fail...</h5>
</div>
<div style="width: 1056px; height: 600px;">
<img src="images/destinasia-workshop/image31.png">
</div>
</section>
<section>
<div style="width: 1056px; height: 120px;">
<h2>FIX RULE TEST</h2>
</div>
<div style="width: 1056px; height: 600px;" align="left">
Note red failure, look where it failed and fix:
<br><br>
<ul>
<li><p style="font-size: 24px"><i>Flight Destination (flightTo)</i> change to <i>SIN</i> for Singapore</p></li>
<li><p style="font-size: 24px">Click on <i>Save</i> button to enter commit message and rerun test</p></li>
</ul>
<br><br>
<img src="images/destinasia-workshop/image32.png" align="right">
</div>
</section>
<section>
<div style="width: 1056px; height: 120px;">
<h2>TEST RUN SUCCESS</h2>
</div>
<div style="width: 1056px; height: 600px;">
<img src="images/destinasia-workshop/image33.png">
</div>
</section>
<section>
<div style="width: 1056px; height: 170px;">
<h2>WHAT'S NEXT?</h2>
<h5>Infrastructure automation to deploy applications...</h5>
</div>
<div style="width: 1056px; height: 400px;">
<ul>
<li>You understand the discount rules and have tested them</li>
<li>Going to use Ansible Playbooks to automate container deployments</li>
</ul>
<br><br>
<img style="border: 2px solid black" src="images/destinasia-workshop/image35.jpg" align="right">
</div>
</section>
<section>
<img src="images/destinasia-workshop/image23.png">
</section>
<section>
<img src="images/destinasia-workshop/image24.png">
</section>
<section>
<div style="width: 1056px; height: 100px;">
<h2>END LAB 3</h2>
</div>
<div style="width: 1056px; height: 500px;">
<img style="border: 2px solid black" src="images/destinasia-workshop/image25.png">
</div>
</section>
<section>
<div style="width: 1056px; height: 200px; color: white">
<h2>QUESTIONS?</h2>
</div>
<div style="width: 600px; height: 100px; text-align: left">
Eric D. Schabell<br/>
Global Technology Evangelist Director<br/>
<a href="http://twitter.com/ericschabell" style="color: midnightblue" target="_blank">@ericschabell</a><br/>
<a href="http://schabell.org" style="color: midnightblue">http://schabell.org</a>
</div>
</section>
<section>
<h2>UP NEXT...</h2>
<h3><a href="lab04-ocp36.html" style="color: midnightblue" target="_blank">Lab 4 - Automated rule service deployment</a></h3>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.min.js"></script>
<script>
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/zoom/linear/fade/none
// Parallax scrolling
// parallaxBackgroundImage: 'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg',
// parallaxBackgroundSize: '2100px 900px',
// Optional libraries used to extend on reveal.js
dependencies: [{
src: 'lib/js/classList.js',
condition: function() {
return !document.body.classList;
}
}, {
src: 'plugin/markdown/marked.js',
condition: function() {
return !!document.querySelector('[data-markdown]');
}
}, {
src: 'plugin/markdown/markdown.js',
condition: function() {
return !!document.querySelector('[data-markdown]');
}
}, {
src: 'plugin/highlight/highlight.js',
async: true,
callback: function() {
hljs.initHighlightingOnLoad();
}
}, {
src: 'plugin/zoom-js/zoom.js',
async: true,
condition: function() {
return !!document.body.classList;
}
}, {
src: 'plugin/notes/notes.js',
async: true,
condition: function() {
return !!document.body.classList;
}
}]
});
</script>
</body>
</html>
| {
"content_hash": "5aa05ecff88793c60b61f9d2d538b534",
"timestamp": "",
"source": "github",
"line_count": 277,
"max_line_length": 144,
"avg_line_length": 36.59205776173285,
"alnum_prop": 0.5158839779005525,
"repo_name": "appdevcloudworkshop/appdevcloudworkshop.github.io",
"id": "6d01f2a3b41237f5f695e58cbeff42cf5fa9ecb0",
"size": "10136",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lab03-ocp36.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "129704"
},
{
"name": "HTML",
"bytes": "440002"
},
{
"name": "JavaScript",
"bytes": "213646"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using System.Collections;
using Microsoft.Xna.Framework;
using RenderingLibrary.Graphics;
namespace RenderingLibrary.Math.Geometry
{
public class LinePrimitive
{
#region Fields
/// <summary>
/// Determines whether the line is broken up into separate segments or
/// if it should be treated as one continual line. This defaults to false.
/// </summary>
public bool BreakIntoSegments
{
get;
set;
}
Texture2D mTexture;
List<Vector2> mVectors;
/// <summary>
/// Gets/sets the color of the primitive line object.
/// </summary>
public Color Color;
/// <summary>
/// Gets/sets the position of the primitive line object.
/// </summary>
public Vector2 Position;
/// <summary>
/// Gets/sets the render depth of the primitive line object (0 = front, 1 = back)
/// </summary>
public float Depth;
#endregion
/// <summary>
/// Gets the number of vectors which make up the primtive line object.
/// </summary>
public int VectorCount
{
get
{
return mVectors.Count;
}
}
/// <summary>
/// Creates a new primitive line object.
/// </summary>
/// <param name="graphicsDevice">The Graphics Device object to use.</param>
public LinePrimitive(Texture2D singlePixelTexture)
{
// create pixels
mTexture = singlePixelTexture;
Color = Color.White;
Position = new Vector2(0, 0);
Depth = 0;
mVectors = new List<Vector2>();
}
/// <summary>
/// Adds a vector to the primive live object.
/// </summary>
/// <param name="vector">The vector to add.</param>
public void Add(Vector2 vector)
{
mVectors.Add(vector);
}
/// <summary>
/// Adds a vector to the primive live object.
/// </summary>
/// <param name="x">The X position of the new point.</param>
/// <param name="y">The Y position of the new point.</param>
public void Add(float x, float y)
{
Add(new Vector2(x, y));
}
/// <summary>
/// Insers a vector into the primitive line object.
/// </summary>
/// <param name="index">The index to insert it at.</param>
/// <param name="vector">The vector to insert.</param>
public void Insert(int index, Vector2 vector)
{
mVectors.Insert(index, vector);
}
/// <summary>
/// Removes a vector from the primitive line object.
/// </summary>
/// <param name="vector">The vector to remove.</param>
public void Remove(Vector2 vector)
{
mVectors.Remove(vector);
}
/// <summary>
/// Removes a vector from the primitive line object.
/// </summary>
/// <param name="index">The index of the vector to remove.</param>
public void RemoveAt(int index)
{
mVectors.RemoveAt(index);
}
/// <summary>
/// Replaces a vector at the given index with the argument Vector2.
/// </summary>
/// <param name="index">What index to replace.</param>
/// <param name="whatToReplaceWith">The new vector that will be placed at the given index</param>
public void Replace(int index, Vector2 whatToReplaceWith)
{
mVectors[index] = whatToReplaceWith;
}
/// <summary>
/// Clears all vectors from the primitive line object.
/// </summary>
public void ClearVectors()
{
mVectors.Clear();
}
/// <summary>
/// Renders the primtive line object.
/// </summary>
/// <param name="spriteRenderer">The sprite renderer to use to render the primitive line object.</param>
public void Render(SpriteRenderer spriteRenderer, SystemManagers managers)
{
Render(spriteRenderer, managers, mTexture, .2f);
}
public void Render(SpriteRenderer spriteRenderer, SystemManagers managers, Texture2D textureToUse, float repetitionsPerLength)
{
if (mVectors.Count < 2)
return;
Renderer renderer;
if (managers == null)
{
renderer = Renderer.Self;
}
else
{
renderer = managers.Renderer;
}
Vector2 offset = new Vector2(renderer.Camera.RenderingXOffset, renderer.Camera.RenderingYOffset);
int extraStep = 0;
if (BreakIntoSegments)
{
extraStep = 1;
}
for (int i = 1; i < mVectors.Count; i++)
{
Vector2 vector1 = mVectors[i - 1];
Vector2 vector2 = mVectors[i];
// calculate the distance between the two vectors
float distance = Vector2.Distance(vector1, vector2);
int repetitions = (int)(distance * repetitionsPerLength);
if (repetitions < 1)
{
repetitions = 1;
}
//repetitions = 128;
// calculate the angle between the two vectors
float angle = (float)System.Math.Atan2((double)(vector2.Y - vector1.Y),
(double)(vector2.X - vector1.X));
Rectangle sourceRectangle = new Rectangle(
0,
0,
textureToUse.Width * repetitions,
textureToUse.Height);
// stretch the pixel between the two vectors
spriteRenderer.Draw(textureToUse,
offset + Position + vector1,
sourceRectangle,
Color,
angle,
Vector2.Zero,
new Vector2(distance / ((float)repetitions * textureToUse.Width), 1/renderer.CurrentZoom),
SpriteEffects.None,
Depth,
this);
i += extraStep;
}
}
/// <summary>
/// Creates a circle starting from 0, 0.
/// </summary>
/// <param name="radius">The radius (half the width) of the circle.</param>
/// <param name="sides">The number of sides on the circle (the more the detailed).</param>
public void CreateCircle(float radius, int sides)
{
mVectors.Clear();
float max = 2 * (float)System.Math.PI;
float step = max / (float)sides;
for (float theta = 0; theta < max; theta += step)
{
mVectors.Add(new Vector2(radius * (float)System.Math.Cos((double)theta),
radius * (float)System.Math.Sin((double)theta)));
}
// then add the first vector again so it's a complete loop
mVectors.Add(new Vector2(radius * (float)System.Math.Cos(0),
radius * (float)System.Math.Sin(0)));
}
public void Shift(float x, float y)
{
Vector2 shiftAmount = new Vector2(x, y);
for(int i = 0; i < mVectors.Count; i++)
{
mVectors[i] = mVectors[i] + shiftAmount;
}
}
}
}
| {
"content_hash": "45cdd60657f302380f4f4006cbcffbe4",
"timestamp": "",
"source": "github",
"line_count": 246,
"max_line_length": 134,
"avg_line_length": 31.40650406504065,
"alnum_prop": 0.5172146000517732,
"repo_name": "kainazzzo/FRBInput",
"id": "2200bf034bdfc6c7612a73ba4d73c07204949dc4",
"size": "7728",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "RacingController/RacingController/GumCore/LinePrimitive.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "2289927"
},
{
"name": "PowerShell",
"bytes": "5234"
}
],
"symlink_target": ""
} |
<?php
namespace AppBundle\Repository;
/**
* The country repository.
*/
class CountryRepository extends AbstractRepository implements CountryRepositoryInterface
{
/**
* {@inheritdoc}
*/
public function findAll()
{
return parent::findAll();
}
} | {
"content_hash": "9c44cafca9ad52aeab2809440b141378",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 88,
"avg_line_length": 15.61111111111111,
"alnum_prop": 0.6548042704626335,
"repo_name": "thomasnisole/nfcave-api",
"id": "cd3eaec461b3c2432c2f43e53e550ce74aab35cc",
"size": "463",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "src/AppBundle/Repository/CountryRepository.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1835"
},
{
"name": "HTML",
"bytes": "6164460"
},
{
"name": "PHP",
"bytes": "339945"
},
{
"name": "PLpgSQL",
"bytes": "28611"
}
],
"symlink_target": ""
} |
<div class="support-info-wrap">
<div class="support-info-block">
<h3>Need help? Get in touch!</h3>
<p>Email, call, text, or visit us. We've got support teams in the USA and Europe to make sure we're there when you need us.<br/>We'd love to hear from you.</p>
<div class="btn-wrap">
<a href="<?php echo esc_url(Printful_Base::get_printful_host()); ?>support" class="button button-primary button-large" target="_blank">Contact support</a>
</div>
</div>
<div class="support-info-block">
<h3>Read our FAQs</h3>
<p>Getting started made easy – read the FAQs to jumpstart your business.<br/>Whether you're a video tutorial fan or prefer the written answers – we've got it covered!</p>
<div class="btn-wrap">
<a href="<?php echo esc_url(Printful_Base::get_printful_host()); ?>faq" class="button button-primary button-large" target="_blank">See Printful FAQ</a>
</div>
</div>
<div class="support-info-block">
<h3>Integration help</h3>
<p>Are you experiencing technical issues? Solve them on your own by reading these helpful guides and video tutorials.</p>
<div class="btn-wrap">
<a href="<?php echo esc_url(Printful_Base::get_printful_host()); ?>faq/integrations/woocommerce" class="button button-primary button-large" target="_blank">Integration help</a>
</div>
</div>
</div> | {
"content_hash": "4376444b46783530f3e0fe2aabcc8c34",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 179,
"avg_line_length": 48.55555555555556,
"alnum_prop": 0.6964149504195271,
"repo_name": "smpetrey/leahconstantine.com",
"id": "c3637bcf99fab80baacd66956dff5fa807313113",
"size": "1315",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "web/app/plugins/printful-shipping-for-woocommerce/includes/templates/support-info.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "559906"
},
{
"name": "JavaScript",
"bytes": "1835754"
},
{
"name": "PHP",
"bytes": "10414634"
}
],
"symlink_target": ""
} |
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#pragma once
#define TEXTURE_COMPRESSOR_MODULENAME "TextureCompressor"
/**
* Compressed image data.
*/
struct FCompressedImage2D
{
TArray<uint8> RawData;
int32 SizeX;
int32 SizeY;
uint8 PixelFormat; // EPixelFormat, opaque to avoid dependencies on Engine headers.
};
/**
* Color adjustment parameters.
*/
struct FColorAdjustmentParameters
{
/** Brightness adjustment (scales HSV value) */
float AdjustBrightness;
/** Curve adjustment (raises HSV value to the specified power) */
float AdjustBrightnessCurve;
/** Saturation adjustment (scales HSV saturation) */
float AdjustSaturation;
/** "Vibrance" adjustment (HSV saturation algorithm adjustment) */
float AdjustVibrance;
/** RGB curve adjustment (raises linear-space RGB color to the specified power) */
float AdjustRGBCurve;
/** Hue adjustment (offsets HSV hue by value in degrees) */
float AdjustHue;
/** Remaps the alpha to the specified min/max range (Non-destructive; Requires texture source art to be available.) */
float AdjustMinAlpha;
/** Remaps the alpha to the specified min/max range (Non-destructive; Requires texture source art to be available.) */
float AdjustMaxAlpha;
/** Constructor */
FColorAdjustmentParameters()
: AdjustBrightness( 1.0f ),
AdjustBrightnessCurve( 1.0f ),
AdjustSaturation( 1.0f ),
AdjustVibrance( 0.0f ),
AdjustRGBCurve( 1.0f ),
AdjustHue( 0.0f ),
AdjustMinAlpha( 0.0f ),
AdjustMaxAlpha( 1.0f )
{
}
};
/**
* Texture build settings.
*/
struct FTextureBuildSettings
{
/** Color adjustment parameters. */
FColorAdjustmentParameters ColorAdjustment;
/** The desired amount of mip sharpening. */
float MipSharpening;
/** For angular filtered cubemaps, the mip level which contains convolution with the diffuse cosine lobe. */
uint32 DiffuseConvolveMipLevel;
/** The size of the kernel with which mips should be sharpened. 2 for 2x2, 4 for 4x4, 6 for 6x6, 8 for 8x8 */
uint32 SharpenMipKernelSize;
/** For maximum resolution. */
uint32 MaxTextureResolution;
/** Format of the compressed texture, used to choose a compression DLL. */
FName TextureFormatName;
/** Mipmap generation settings. */
uint8 MipGenSettings; // TextureMipGenSettings, opaque to avoid dependencies on engine headers.
/** Whether the texture being built is a cubemap. */
uint32 bCubemap : 1;
/** Whether the texture being built from long/lat source to cubemap. */
uint32 bLongLatSource : 1;
/** Whether the texture contains color data in the sRGB colorspace. */
uint32 bSRGB : 1;
/** Whether the texture should use the legacy gamma space for converting to sRGB */
uint32 bUseLegacyGamma : 1;
/** Whether the border of the image should be maintained during mipmap generation. */
uint32 bPreserveBorder : 1;
/** Whether the alpha channel should contain a dithered alpha value. */
uint32 bDitherMipMapAlpha : 1;
/** Whether bokeh alpha values should be computed for the texture. */
uint32 bComputeBokehAlpha : 1;
/** Whether the contents of the red channel should be replicated to all channels. */
uint32 bReplicateRed : 1;
/** Whether the contents of the alpha channel should be replicated to all channels. */
uint32 bReplicateAlpha : 1;
/** Whether each mip should use the downsampled-with-average result instead of the sharpened result. */
uint32 bDownsampleWithAverage : 1;
/** Whether sharpening should prevent color shifts. */
uint32 bSharpenWithoutColorShift : 1;
/** Whether the border color should be black. */
uint32 bBorderColorBlack : 1;
/** Whether the green channel should be flipped. Typically only done on normal maps. */
uint32 bFlipGreenChannel : 1;
/** 1:apply mip sharpening/blurring kernel to top mip as well (at half the kernel size), 0:don't */
uint32 bApplyKernelToTopMip : 1;
/** 1: renormalizes the top mip (only useful for normal maps, prevents artists errors and adds quality) 0:don't */
uint32 bRenormalizeTopMip : 1;
/** e.g. CTM_RoughnessFromNormalAlpha */
uint8 CompositeTextureMode; // ECompositeTextureMode, opaque to avoid dependencies on engine headers.
/* default 1, high values result in a stronger effect */
float CompositePower;
/** The source texture's final LOD bias (i.e. includes LODGroup based biases) */
uint32 LODBias;
/** The texture's top mip size without LODBias applied, should be moved into a separate struct together with bImageHasAlphaChannel */
mutable FIntPoint TopMipSize;
/** Can the texture be streamed */
uint32 bStreamable : 1;
/** Whether to chroma key the image, replacing any pixels that match ChromaKeyColor with transparent black */
uint32 bChromaKeyTexture : 1;
/** How to stretch or pad the texture to a power of 2 size (if necessary); ETexturePowerOfTwoSetting::Type, opaque to avoid dependencies on Engine headers. */
uint8 PowerOfTwoMode;
/** The color used to pad the texture out if it is resized due to PowerOfTwoMode */
FColor PaddingColor;
/** The color that will be replaced with transparent black if chroma keying is enabled */
FColor ChromaKeyColor;
/** The threshold that components have to match for the texel to be considered equal to the ChromaKeyColor when chroma keying (<=, set to 0 to require a perfect exact match) */
float ChromaKeyThreshold;
/** Default settings. */
FTextureBuildSettings()
: MipSharpening( 0.0f )
, DiffuseConvolveMipLevel( 0 )
, SharpenMipKernelSize( 2 )
, MaxTextureResolution(TNumericLimits<uint32>::Max())
, MipGenSettings( 1 /*TMGS_SimpleAverage*/ )
, bCubemap( false )
, bLongLatSource(false)
, bSRGB( false )
, bUseLegacyGamma( false )
, bPreserveBorder( false )
, bDitherMipMapAlpha( false )
, bComputeBokehAlpha( false )
, bReplicateRed( false )
, bReplicateAlpha( false )
, bDownsampleWithAverage( false )
, bSharpenWithoutColorShift( false )
, bBorderColorBlack( false )
, bFlipGreenChannel( false )
, bApplyKernelToTopMip( false )
, bRenormalizeTopMip( false )
, CompositeTextureMode( 0 /*CTM_Disabled*/ )
, CompositePower( 1.0f )
, LODBias(0)
, TopMipSize(0, 0)
, bStreamable(false)
, bChromaKeyTexture(false)
, PowerOfTwoMode(0 /*ETexturePowerOfTwoSetting::None*/)
, PaddingColor(FColor::Black)
, ChromaKeyColor(FColorList::Magenta)
, ChromaKeyThreshold(1.0f / 255.0f)
{
}
FORCEINLINE EGammaSpace GetGammaSpace() const
{
return bSRGB ? ( bUseLegacyGamma ? EGammaSpace::Pow22 : EGammaSpace::sRGB ) : EGammaSpace::Linear;
}
};
/**
* Texture compression module interface.
*/
class ITextureCompressorModule : public IModuleInterface
{
public:
/**
* Builds a texture from source images.
* @param SourceMips - The input mips.
* @param BuildSettings - Build settings.
* @param OutCompressedMips - The compressed mips built by the compressor.
* @returns true on success
*/
virtual bool BuildTexture(
const TArray<struct FImage>& SourceMips,
const TArray<struct FImage>& AssociatedNormalSourceMips,
const FTextureBuildSettings& BuildSettings,
TArray<FCompressedImage2D>& OutTextureMips
) = 0;
};
| {
"content_hash": "471eb874ec1cca8a0ef13babfc4fd512",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 177,
"avg_line_length": 36.770833333333336,
"alnum_prop": 0.738243626062323,
"repo_name": "PopCap/GameIdea",
"id": "a2c09e8927b1979318bf3da4afb164d6c879c28d",
"size": "7060",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Engine/Source/Developer/TextureCompressor/Public/TextureCompressorModule.h",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "ASP",
"bytes": "238055"
},
{
"name": "Assembly",
"bytes": "184134"
},
{
"name": "Batchfile",
"bytes": "116983"
},
{
"name": "C",
"bytes": "84264210"
},
{
"name": "C#",
"bytes": "9612596"
},
{
"name": "C++",
"bytes": "242290999"
},
{
"name": "CMake",
"bytes": "548754"
},
{
"name": "CSS",
"bytes": "134910"
},
{
"name": "GLSL",
"bytes": "96780"
},
{
"name": "HLSL",
"bytes": "124014"
},
{
"name": "HTML",
"bytes": "4097051"
},
{
"name": "Java",
"bytes": "757767"
},
{
"name": "JavaScript",
"bytes": "2742822"
},
{
"name": "Makefile",
"bytes": "1976144"
},
{
"name": "Objective-C",
"bytes": "75778979"
},
{
"name": "Objective-C++",
"bytes": "312592"
},
{
"name": "PAWN",
"bytes": "2029"
},
{
"name": "PHP",
"bytes": "10309"
},
{
"name": "PLSQL",
"bytes": "130426"
},
{
"name": "Pascal",
"bytes": "23662"
},
{
"name": "Perl",
"bytes": "218656"
},
{
"name": "Python",
"bytes": "21593012"
},
{
"name": "SAS",
"bytes": "1847"
},
{
"name": "Shell",
"bytes": "2889614"
},
{
"name": "Tcl",
"bytes": "1452"
}
],
"symlink_target": ""
} |
#ifndef __FORK_XA2_CORE_H__
#define __FORK_XA2_CORE_H__
namespace Fork
{
namespace Audio
{
//! Releases the specified DirectX object.
template <class T> void DXSafeRelease(T*& object)
{
if (object)
{
object->Release();
object = nullptr;
}
}
//! Releases the specified list of DirectX objects.
template <class T> void DXSafeReleaseList(T& list)
{
for (auto& object : list)
DXSafeRelease(object);
list.clear();
}
} // /namespace Audio
} // /namespace Fork
#endif
// ======================== | {
"content_hash": "fe562b2d574bdfa4d05a8bcc92933ceb",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 51,
"avg_line_length": 13.047619047619047,
"alnum_prop": 0.593065693430657,
"repo_name": "LukasBanana/ForkENGINE",
"id": "774adcbe2d38a4cff40bbb877fdaca0f5c243b92",
"size": "716",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sources/Audio/SoundSystem/XAudio2/XA2Core.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "1439895"
},
{
"name": "C++",
"bytes": "3993678"
},
{
"name": "CMake",
"bytes": "51757"
},
{
"name": "GLSL",
"bytes": "71104"
},
{
"name": "HLSL",
"bytes": "40489"
},
{
"name": "HTML",
"bytes": "481"
},
{
"name": "PowerShell",
"bytes": "79"
},
{
"name": "Python",
"bytes": "11661"
},
{
"name": "TeX",
"bytes": "23660"
}
],
"symlink_target": ""
} |
namespace cc {
class DisplayItemList;
}
namespace gfx {
class Canvas;
}
class SkPictureRecorder;
namespace ui {
class ClipTransformRecorder;
class CompositingRecorder;
class PaintRecorder;
class COMPOSITOR_EXPORT PaintContext {
public:
// Construct a PaintContext that may only re-paint the area in the
// |invalidation|.
PaintContext(cc::DisplayItemList* list,
float device_scale_factor,
const gfx::Rect& bounds,
const gfx::Rect& invalidation);
// Clone a PaintContext with an additional |offset|.
PaintContext(const PaintContext& other, const gfx::Vector2d& offset);
// Clone a PaintContext that has no consideration for invalidation.
enum CloneWithoutInvalidation {
CLONE_WITHOUT_INVALIDATION,
};
PaintContext(const PaintContext& other, CloneWithoutInvalidation c);
~PaintContext();
// When true, IsRectInvalid() can be called, otherwise its result would be
// invalid.
bool CanCheckInvalid() const { return !invalidation_.IsEmpty(); }
// When true, the |bounds| touches an invalidated area, so should be
// re-painted. When false, re-painting can be skipped. Bounds should be in
// the local space with offsets up to the painting root in the PaintContext.
bool IsRectInvalid(const gfx::Rect& bounds) const {
DCHECK(CanCheckInvalid());
return invalidation_.Intersects(bounds + offset_);
}
#if DCHECK_IS_ON()
void Visited(void* visited) const {
if (!root_visited_)
root_visited_ = visited;
}
void* RootVisited() const { return root_visited_; }
const gfx::Vector2d& PaintOffset() const { return offset_; }
#endif
const gfx::Rect& InvalidationForTesting() const { return invalidation_; }
private:
// The Recorder classes need access to the internal canvas and friends, but we
// don't want to expose them on this class so that people must go through the
// recorders to access them.
friend class ClipTransformRecorder;
friend class CompositingRecorder;
friend class PaintRecorder;
// The Cache class also needs to access the DisplayItemList to append its
// cache contents.
friend class PaintCache;
cc::DisplayItemList* list_;
scoped_ptr<SkPictureRecorder> owned_recorder_;
// A pointer to the |owned_recorder_| in this PaintContext, or in another one
// which this was copied from. We expect a copied-from PaintContext to outlive
// copies made from it.
SkPictureRecorder* recorder_;
// The device scale of the frame being painted. Used to determine which bitmap
// resources to use in the frame.
float device_scale_factor_;
// The bounds of the area being painted. Not all of it may be invalidated from
// the previous frame.
gfx::Rect bounds_;
// Invalidation in the space of the paint root (ie the space of the layer
// backing the paint taking place).
gfx::Rect invalidation_;
// Offset from the PaintContext to the space of the paint root and the
// |invalidation_|.
gfx::Vector2d offset_;
#if DCHECK_IS_ON()
// Used to verify that the |invalidation_| is only used to compare against
// rects in the same space.
mutable void* root_visited_;
// Used to verify that paint recorders are not nested. True while a paint
// recorder is active.
mutable bool inside_paint_recorder_;
#endif
DISALLOW_COPY_AND_ASSIGN(PaintContext);
};
} // namespace ui
#endif // UI_COMPOSITOR_PAINT_CONTEXT_H_
| {
"content_hash": "2cb4f89215c6748d1f0a9ed5ada10bb2",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 80,
"avg_line_length": 32.932038834951456,
"alnum_prop": 0.7211084905660378,
"repo_name": "SaschaMester/delicium",
"id": "8a27a1bee3b47a1a2ffc042869ba0dbeb6f4a742",
"size": "3779",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ui/compositor/paint_context.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "AppleScript",
"bytes": "6973"
},
{
"name": "Arduino",
"bytes": "464"
},
{
"name": "Assembly",
"bytes": "23829"
},
{
"name": "Batchfile",
"bytes": "8451"
},
{
"name": "C",
"bytes": "4171711"
},
{
"name": "C++",
"bytes": "243066171"
},
{
"name": "CSS",
"bytes": "935112"
},
{
"name": "DM",
"bytes": "60"
},
{
"name": "Groff",
"bytes": "2494"
},
{
"name": "HTML",
"bytes": "27211018"
},
{
"name": "Java",
"bytes": "14285999"
},
{
"name": "JavaScript",
"bytes": "20413885"
},
{
"name": "Makefile",
"bytes": "23496"
},
{
"name": "Objective-C",
"bytes": "1725804"
},
{
"name": "Objective-C++",
"bytes": "9880229"
},
{
"name": "PHP",
"bytes": "97817"
},
{
"name": "PLpgSQL",
"bytes": "178732"
},
{
"name": "Perl",
"bytes": "63937"
},
{
"name": "Protocol Buffer",
"bytes": "478406"
},
{
"name": "Python",
"bytes": "8261413"
},
{
"name": "Shell",
"bytes": "482077"
},
{
"name": "Standard ML",
"bytes": "5034"
},
{
"name": "XSLT",
"bytes": "418"
},
{
"name": "nesC",
"bytes": "18347"
}
],
"symlink_target": ""
} |
/**
* This very basic implementation of a priority queue is used to select the
* next node of the graph to walk to.
*
* The queue is always sorted to have the least expensive node on top.
* Some helper methods are also implemented.
*
* You should **never** modify the queue directly, but only using the methods
* provided by the class.
*/
class PriorityQueue {
/**
* Creates a new empty priority queue
*/
constructor() {
// The `keys` set is used to greatly improve the speed at which we can
// check the presence of a value in the queue
this.keys = new Set();
this.queue = [];
}
/**
* Sort the queue to have the least expensive node to visit on top
*
* @private
*/
sort() {
this.queue.sort((a, b) => a.priority - b.priority);
}
/**
* Sets a priority for a key in the queue.
* Inserts it in the queue if it does not already exists.
*
* @param {any} key Key to update or insert
* @param {number} value Priority of the key
* @return {number} Size of the queue
*/
set(key, value) {
const priority = Number(value);
if (isNaN(priority)) throw new TypeError('"priority" must be a number');
if (!this.keys.has(key)) {
// Insert a new entry if the key is not already in the queue
this.keys.add(key);
this.queue.push({ key, priority });
} else {
// Update the priority of an existing key
this.queue.map((element) => {
if (element.key === key) {
Object.assign(element, { priority });
}
return element;
});
}
this.sort();
return this.queue.length;
}
/**
* The next method is used to dequeue a key:
* It removes the first element from the queue and returns it
*
* @return {object} First priority queue entry
*/
next() {
const element = this.queue.shift();
// Remove the key from the `_keys` set
this.keys.delete(element.key);
return element;
}
/**
* @return {boolean} `true` when the queue is empty
*/
isEmpty() {
return Boolean(this.queue.length === 0);
}
/**
* Check if the queue has a key in it
*
* @param {any} key Key to lookup
* @return {boolean}
*/
has(key) {
return this.keys.has(key);
}
/**
* Get the element in the queue with the specified key
*
* @param {any} key Key to lookup
* @return {object}
*/
get(key) {
return this.queue.find(element => element.key === key);
}
}
module.exports = PriorityQueue;
| {
"content_hash": "d22705c9f5a6ee282f600aeb6722f8b8",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 77,
"avg_line_length": 23.570093457943926,
"alnum_prop": 0.6003172085646312,
"repo_name": "albertorestifo/node-dijkstra",
"id": "3cb9aa8354284b982376de82c6bbfa993de853b5",
"size": "2522",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "libs/PriorityQueue.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "29676"
}
],
"symlink_target": ""
} |
package com.beastbikes.restful.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Indicates the annotated method using HTTP PUT to access the RESTful service
*
* @author johnsonlee
* @since 1.0.0
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface HttpPut {
String value();
}
| {
"content_hash": "d1f6ad5c00dd48e72aeb322ed6f596b2",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 78,
"avg_line_length": 22.5,
"alnum_prop": 0.7755555555555556,
"repo_name": "beastbikes/sphere",
"id": "75cc371192820e7399c4559d93d7d21b1ef274cf",
"size": "450",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "restful/src/main/java/com/beastbikes/restful/annotation/HttpPut.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "41823"
}
],
"symlink_target": ""
} |
package com.resmed.refresh.utils;
public class MeasureManager
{
public static float convertCelsiusToFahrenheit(float paramFloat)
{
return 9.0F * paramFloat / 5.0F + 32.0F;
}
public static float convertFahrenheitToCelsius(float paramFloat)
{
return (paramFloat - 32.0F) * 5.0F / 9.0F;
}
public static float getInchFromMeters(float paramFloat)
{
return (float)(paramFloat / 2.54D);
}
public static float getKilogramFromPound(float paramFloat)
{
return (float)(paramFloat * 0.453592D);
}
public static float getMetersFromInch(float paramFloat)
{
return (float)(paramFloat * 2.54D);
}
public static float getPoundFromKilogram(float paramFloat)
{
return (float)(paramFloat / 0.453592D);
}
}
/* Location: [...]
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | {
"content_hash": "e856f59c2357454b673b924e61cce490",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 66,
"avg_line_length": 21.65,
"alnum_prop": 0.6674364896073903,
"repo_name": "Venryx/LucidLink",
"id": "b7ec7441bba641f5af04d589766f31e59f24d7ff",
"size": "866",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "android/app/src/main/java/com/resmed/refresh/utils/MeasureManager.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "130"
},
{
"name": "Java",
"bytes": "319937"
},
{
"name": "JavaScript",
"bytes": "3435"
},
{
"name": "Objective-C",
"bytes": "4425"
},
{
"name": "Python",
"bytes": "1639"
},
{
"name": "TypeScript",
"bytes": "393450"
}
],
"symlink_target": ""
} |
FROM balenalib/kitra520-alpine:edge-run
ENV NODE_VERSION 16.14.0
ENV YARN_VERSION 1.22.4
# Install dependencies
RUN apk add --no-cache libgcc libstdc++ libuv \
&& apk add --no-cache libssl1.0 || apk add --no-cache libssl1.1
RUN buildDeps='curl' \
&& set -x \
&& for key in \
6A010C5166006599AA17F08146C2130DFD2497F5 \
; do \
gpg --keyserver pgp.mit.edu --recv-keys "$key" || \
gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \
gpg --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \
done \
&& apk add --no-cache $buildDeps \
&& curl -SLO "http://resin-packages.s3.amazonaws.com/node/v$NODE_VERSION/node-v$NODE_VERSION-linux-alpine-armv7hf.tar.gz" \
&& echo "2595e3e74ed70c242a026160ce2ed9954bda98e953fd8093a33db40cf43ea22b node-v$NODE_VERSION-linux-alpine-armv7hf.tar.gz" | sha256sum -c - \
&& tar -xzf "node-v$NODE_VERSION-linux-alpine-armv7hf.tar.gz" -C /usr/local --strip-components=1 \
&& rm "node-v$NODE_VERSION-linux-alpine-armv7hf.tar.gz" \
&& curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
&& curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \
&& gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
&& mkdir -p /opt/yarn \
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
&& npm config set unsafe-perm true -g --unsafe-perm \
&& rm -rf /tmp/*
CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"]
RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@node.sh" \
&& echo "Running test-stack@node" \
&& chmod +x test-stack@node.sh \
&& bash test-stack@node.sh \
&& rm -rf test-stack@node.sh
RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v7 \nOS: Alpine Linux edge \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nNode.js v16.14.0, Yarn v1.22.4 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info
RUN echo $'#!/bin/bash\nbalena-info\nbusybox ln -sf /bin/busybox /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \
&& chmod +x /bin/sh-shim \
&& ln -f /bin/sh /bin/sh.real \
&& ln -f /bin/sh-shim /bin/sh | {
"content_hash": "0dd3741218a97357a2cdc61e47652ca7",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 697,
"avg_line_length": 62.416666666666664,
"alnum_prop": 0.7076101468624834,
"repo_name": "resin-io-library/base-images",
"id": "7245884d90aaec39e2726cd48b3b8d026d6592b5",
"size": "3017",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "balena-base-images/node/kitra520/alpine/edge/16.14.0/run/Dockerfile",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "71234697"
},
{
"name": "JavaScript",
"bytes": "13096"
},
{
"name": "Shell",
"bytes": "12051936"
},
{
"name": "Smarty",
"bytes": "59789"
}
],
"symlink_target": ""
} |
from pprint import pprint
from diffengine.difference import hierarchical_matcher
from diffengine.tokenization import wikitext_split
tokens1 = wikitext_split.tokenize("Foo bar derp.")
print(tokens1)
for i, op in enumerate(hierarchical_matcher.diff([], tokens1)):
print("#{0}: {1}".format(i+1, repr(op)))
print("-----------------------")
tokens2 = wikitext_split.tokenize("Foo bar derp. Foo bar derp.")
print(tokens2)
for i, op in enumerate(hierarchical_matcher.diff(tokens1, tokens2)):
print("#{0}: {1}".format(i+1, repr(op)))
print("-----------------------")
tokens3 = wikitext_split.tokenize("Foo bar derp. Foo this is a bar derp.")
print(tokens3)
for i, op in enumerate(hierarchical_matcher.diff(tokens2, tokens3)):
print("#{0}: {1}".format(i+1, repr(op)))
| {
"content_hash": "856943e9041363f65c6666cb9ce9844a",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 74,
"avg_line_length": 32.416666666666664,
"alnum_prop": 0.6696658097686375,
"repo_name": "halfak/Difference-Engine",
"id": "77491ef51101e6b62653946807c3e44388f15a25",
"size": "778",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_tmp/test.hierarchical_matcher.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "66126"
}
],
"symlink_target": ""
} |
/**
* @created Lei)Leo) SHI <foxshee@gmail.com>
* @date 1/23/16
*/
'use strict';
/* ***************************************************************************
* ### Angular Module - Chats ###
*
*/
// Define your `project module`
var angular = require('angular');
var chatsModule = angular.module('app.chats',
[]
);
// Use `bulk` to load `all` angular elements under this module folder.
var bulk = require('bulk-require');
// TODO Make the `paths` in `bulk` to be a variable.
//
// For now, `bulk` does not support a variable as the `paths`, since when doing `buuikify` on `browserify`, it will be
// ignored.
var angularElements = bulk(__dirname, ['./**/!(*.module|*.unit|*.spec).js']);
// Load Angular Module Declarator
var moduleDeclarator = require('../module.declarator');
moduleDeclarator.angularModuleDeclarator(chatsModule, angularElements);
module.exports = chatsModule;
| {
"content_hash": "0c3d69fbfbfcba49d6eed27b97ab947a",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 118,
"avg_line_length": 28.903225806451612,
"alnum_prop": 0.6205357142857143,
"repo_name": "cowfox/ionic-boilerplate",
"id": "afdb7d941968ad460000cb83fb9876148d831229",
"size": "896",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/scripts/chats/chats.module.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1360"
},
{
"name": "HTML",
"bytes": "4314"
},
{
"name": "JavaScript",
"bytes": "153978"
}
],
"symlink_target": ""
} |
<!--
~ Copyright (c) 2010-2014 Evolveum
~
~ 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.
-->
<report xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
oid="AUDITLOG-3333-3333-TEST-1DATASOURCE"
version="0">
<name>
<orig xmlns="http://prism.evolveum.com/xml/ns/public/types-3">Audit logs report with datasource</orig>
<norm xmlns="http://prism.evolveum.com/xml/ns/public/types-3">Audit logs report with datasource</norm>
</name>
<description>Report made from audit records. With special datasource</description>
<reportOrientation>landscape</reportOrientation>
<reportField>
<nameReportField>timestamp</nameReportField>
<nameHeaderField>Timestamp</nameHeaderField>
<itemPathField>c:timestamp</itemPathField>
<sortOrderNumber>1</sortOrderNumber>
<sortOrder>ascending</sortOrder>
<widthField>12</widthField>
<classTypeField>xsd:dateTime</classTypeField>
</reportField>
<reportField>
<nameReportField>initiatorName</nameReportField>
<nameHeaderField>Initiator</nameHeaderField>
<itemPathField>c:initiatorName</itemPathField>
<widthField>10</widthField>
<classTypeField>xsd:string</classTypeField>
</reportField>
<reportField>
<nameReportField>eventType</nameReportField>
<nameHeaderField>Event Type</nameHeaderField>
<itemPathField>c:eventType</itemPathField>
<widthField>12</widthField>
<classTypeField>c:AuditEventType</classTypeField>
</reportField>
<reportField>
<nameReportField>eventStage</nameReportField>
<nameHeaderField>Event Stage</nameHeaderField>
<itemPathField>c:eventStage</itemPathField>
<widthField>12</widthField>
<classTypeField>c:AuditEventStage</classTypeField>
</reportField>
<reportField>
<nameReportField>targetName</nameReportField>
<nameHeaderField>Target</nameHeaderField>
<itemPathField>c:targetName</itemPathField>
<widthField>10</widthField>
<classTypeField>xsd:string</classTypeField>
</reportField>
<reportField>
<nameReportField>outcome</nameReportField>
<nameHeaderField>Outcome</nameHeaderField>
<itemPathField>c:outcome</itemPathField>
<widthField>12</widthField>
<classTypeField>c:OperationResultStatusType</classTypeField>
</reportField>
<reportField>
<nameReportField>message</nameReportField>
<nameHeaderField>Message</nameHeaderField>
<itemPathField>c:message</itemPathField>
<widthField>20</widthField>
<classTypeField>xsd:string</classTypeField>
</reportField>
<reportField>
<nameReportField>delta</nameReportField>
<nameHeaderField>Delta</nameHeaderField>
<itemPathField>c:delta</itemPathField>
<widthField>12</widthField>
<classTypeField>xsd:string</classTypeField>
</reportField>
<reportParameter>
<nameParameter>LOGO_PATH</nameParameter>
<valueParameter>src/test/resources/reports/logo.jpg</valueParameter>
<classTypeParameter>xsd:string</classTypeParameter>
</reportParameter>
<reportParameter>
<nameParameter>BaseTemplateStyles</nameParameter>
<valueParameter>src/test/resources/styles/midpoint_base_styles.jrtx</valueParameter>
<classTypeParameter>xsd:string</classTypeParameter>
</reportParameter>
<reportParameter>
<nameParameter>DATA_FROM</nameParameter>
<valueParameter>2000-01-01</valueParameter>
<classTypeParameter>xsd:dateTime</classTypeParameter>
</reportParameter>
<reportParameter>
<nameParameter>DATA_TO</nameParameter>
<valueParameter>2020-12-31</valueParameter>
<classTypeParameter>xsd:dateTime</classTypeParameter>
</reportParameter>
<reportParameter>
<nameParameter>EVENT_TYPE</nameParameter>
<valueParameter>"ALL"</valueParameter>
<classTypeParameter>xsd:string</classTypeParameter>
</reportParameter>
</report> | {
"content_hash": "ad661eb8a9950f7e03f15d09350ecfd5",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 104,
"avg_line_length": 39.3859649122807,
"alnum_prop": 0.7532293986636971,
"repo_name": "gureronder/midpoint",
"id": "91554a88bccae51f8f2675d7abb67ce4106a93f8",
"size": "4490",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "model/report-impl/src/test/resources/reports/reportAuditLogs-with-datasource.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "176525"
},
{
"name": "Groovy",
"bytes": "10361"
},
{
"name": "HTML",
"bytes": "450709"
},
{
"name": "Java",
"bytes": "19619257"
},
{
"name": "JavaScript",
"bytes": "70636"
},
{
"name": "PLSQL",
"bytes": "2171"
},
{
"name": "PLpgSQL",
"bytes": "3307"
},
{
"name": "SQLPL",
"bytes": "4091"
},
{
"name": "Shell",
"bytes": "3606"
}
],
"symlink_target": ""
} |
#include <common.h>
#include <command.h>
#include <rtc.h>
#if defined(CONFIG_CMD_DATE)
#include <asm/blackfin.h>
#include <asm/mach-common/bits/rtc.h>
#define pr_stamp() debug("%s:%s:%i: here i am\n", __FILE__, __func__, __LINE__)
#define MIN_TO_SECS(x) (60 * (x))
#define HRS_TO_SECS(x) (60 * MIN_TO_SECS(x))
#define DAYS_TO_SECS(x) (24 * HRS_TO_SECS(x))
#define NUM_SECS_IN_MIN MIN_TO_SECS(1)
#define NUM_SECS_IN_HR HRS_TO_SECS(1)
#define NUM_SECS_IN_DAY DAYS_TO_SECS(1)
/* Enable the RTC prescaler enable register */
static void rtc_init(void)
{
if (!(bfin_read_RTC_PREN() & 0x1))
bfin_write_RTC_PREN(0x1);
}
/* Our on-chip RTC has no notion of "reset" */
void rtc_reset(void)
{
rtc_init();
}
/* Wait for pending writes to complete */
static void wait_for_complete(void)
{
pr_stamp();
while (!(bfin_read_RTC_ISTAT() & WRITE_COMPLETE))
if (!(bfin_read_RTC_ISTAT() & WRITE_PENDING))
break;
bfin_write_RTC_ISTAT(WRITE_COMPLETE);
}
/* Set the time. Get the time_in_secs which is the number of seconds since Jan 1970 and set the RTC registers
* based on this value.
*/
int rtc_set(struct rtc_time *tmp)
{
unsigned long remain, days, hrs, mins, secs;
pr_stamp();
if (tmp == NULL) {
puts("Error setting the date/time\n");
return -1;
}
rtc_init();
wait_for_complete();
/* Calculate number of seconds this incoming time represents */
remain = mktime(tmp->tm_year, tmp->tm_mon, tmp->tm_mday,
tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
/* Figure out how many days since epoch */
days = remain / NUM_SECS_IN_DAY;
/* From the remaining secs, compute the hrs(0-23), mins(0-59) and secs(0-59) */
remain = remain % NUM_SECS_IN_DAY;
hrs = remain / NUM_SECS_IN_HR;
remain = remain % NUM_SECS_IN_HR;
mins = remain / NUM_SECS_IN_MIN;
secs = remain % NUM_SECS_IN_MIN;
/* Encode these time values into our RTC_STAT register */
bfin_write_RTC_STAT(SET_ALARM(days, hrs, mins, secs));
return 0;
}
/* Read the time from the RTC_STAT. time_in_seconds is seconds since Jan 1970 */
int rtc_get(struct rtc_time *tmp)
{
uint32_t cur_rtc_stat;
int time_in_sec;
int tm_sec, tm_min, tm_hr, tm_day;
pr_stamp();
if (tmp == NULL) {
puts("Error getting the date/time\n");
return -1;
}
rtc_init();
wait_for_complete();
/* Read the RTC_STAT register */
cur_rtc_stat = bfin_read_RTC_STAT();
/* Convert our encoded format into actual time values */
tm_sec = (cur_rtc_stat & RTC_SEC) >> RTC_SEC_P;
tm_min = (cur_rtc_stat & RTC_MIN) >> RTC_MIN_P;
tm_hr = (cur_rtc_stat & RTC_HR ) >> RTC_HR_P;
tm_day = (cur_rtc_stat & RTC_DAY) >> RTC_DAY_P;
/* Calculate the total number of seconds since epoch */
time_in_sec = (tm_sec) + MIN_TO_SECS(tm_min) + HRS_TO_SECS(tm_hr) + DAYS_TO_SECS(tm_day);
to_tm(time_in_sec, tmp);
return 0;
}
#endif
| {
"content_hash": "a99569cdf335f355d48dcff8a8c356c7",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 109,
"avg_line_length": 24.304347826086957,
"alnum_prop": 0.6457960644007156,
"repo_name": "EleVenPerfect/S3C2440",
"id": "21a2189e2753b8d2fffceecc41a5e3c2b4c780e6",
"size": "2971",
"binary": false,
"copies": "34",
"ref": "refs/heads/master",
"path": "bootloader/u-boot-2014.04 for tq2440/drivers/rtc/bfin_rtc.c",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "107623"
},
{
"name": "Awk",
"bytes": "145"
},
{
"name": "C",
"bytes": "53471003"
},
{
"name": "C++",
"bytes": "4794882"
},
{
"name": "CSS",
"bytes": "7584"
},
{
"name": "GDB",
"bytes": "3642"
},
{
"name": "Makefile",
"bytes": "507759"
},
{
"name": "Objective-C",
"bytes": "33048"
},
{
"name": "PHP",
"bytes": "108169"
},
{
"name": "Perl",
"bytes": "213214"
},
{
"name": "Python",
"bytes": "223908"
},
{
"name": "Roff",
"bytes": "197018"
},
{
"name": "Shell",
"bytes": "86972"
},
{
"name": "Tcl",
"bytes": "967"
},
{
"name": "XSLT",
"bytes": "445"
}
],
"symlink_target": ""
} |
package org.elasticsearch.search.suggest.term;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.text.Text;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentBuilderString;
import org.elasticsearch.search.suggest.SortBy;
import org.elasticsearch.search.suggest.Suggest.Suggestion;
import org.elasticsearch.search.suggest.Suggest.Suggestion.Entry.Option;
import java.io.IOException;
import java.util.Comparator;
/**
* The suggestion responses corresponding with the suggestions in the request.
*/
public class TermSuggestion extends Suggestion<TermSuggestion.Entry> {
public static final Comparator<Suggestion.Entry.Option> SCORE = new Score();
public static final Comparator<Suggestion.Entry.Option> FREQUENCY = new Frequency();
public static final int TYPE = 1;
private SortBy sort;
public TermSuggestion() {
}
public TermSuggestion(String name, int size, SortBy sort) {
super(name, size);
this.sort = sort;
}
// Same behaviour as comparators in suggest module, but for SuggestedWord
// Highest score first, then highest freq first, then lowest term first
public static class Score implements Comparator<Suggestion.Entry.Option> {
@Override
public int compare(Suggestion.Entry.Option first, Suggestion.Entry.Option second) {
// first criteria: the distance
int cmp = Float.compare(second.getScore(), first.getScore());
if (cmp != 0) {
return cmp;
}
return FREQUENCY.compare(first, second);
}
}
// Same behaviour as comparators in suggest module, but for SuggestedWord
// Highest freq first, then highest score first, then lowest term first
public static class Frequency implements Comparator<Suggestion.Entry.Option> {
@Override
public int compare(Suggestion.Entry.Option first, Suggestion.Entry.Option second) {
// first criteria: the popularity
int cmp = ((TermSuggestion.Entry.Option) second).getFreq() - ((TermSuggestion.Entry.Option) first).getFreq();
if (cmp != 0) {
return cmp;
}
// second criteria (if first criteria is equal): the distance
cmp = Float.compare(second.getScore(), first.getScore());
if (cmp != 0) {
return cmp;
}
// third criteria: term text
return first.getText().compareTo(second.getText());
}
}
@Override
public int getType() {
return TYPE;
}
@Override
protected Comparator<Option> sortComparator() {
switch (sort) {
case SCORE:
return SCORE;
case FREQUENCY:
return FREQUENCY;
default:
throw new ElasticsearchException("Could not resolve comparator for sort key: [" + sort + "]");
}
}
@Override
protected void innerReadFrom(StreamInput in) throws IOException {
super.innerReadFrom(in);
sort = SortBy.PROTOTYPE.readFrom(in);
}
@Override
public void innerWriteTo(StreamOutput out) throws IOException {
super.innerWriteTo(out);
sort.writeTo(out);
}
@Override
protected Entry newEntry() {
return new Entry();
}
/**
* Represents a part from the suggest text with suggested options.
*/
public static class Entry extends
org.elasticsearch.search.suggest.Suggest.Suggestion.Entry<TermSuggestion.Entry.Option> {
Entry(Text text, int offset, int length) {
super(text, offset, length);
}
Entry() {
}
@Override
protected Option newOption() {
return new Option();
}
/**
* Contains the suggested text with its document frequency and score.
*/
public static class Option extends org.elasticsearch.search.suggest.Suggest.Suggestion.Entry.Option {
static class Fields {
static final XContentBuilderString FREQ = new XContentBuilderString("freq");
}
private int freq;
protected Option(Text text, int freq, float score) {
super(text, score);
this.freq = freq;
}
@Override
protected void mergeInto(Suggestion.Entry.Option otherOption) {
super.mergeInto(otherOption);
freq += ((Option) otherOption).freq;
}
protected Option() {
super();
}
public void setFreq(int freq) {
this.freq = freq;
}
/**
* @return How often this suggested text appears in the index.
*/
public int getFreq() {
return freq;
}
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
freq = in.readVInt();
}
@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeVInt(freq);
}
@Override
protected XContentBuilder innerToXContent(XContentBuilder builder, Params params) throws IOException {
builder = super.innerToXContent(builder, params);
builder.field(Fields.FREQ, freq);
return builder;
}
}
}
}
| {
"content_hash": "9ca3d454257e7c60b9a72c4f5eebc8a7",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 121,
"avg_line_length": 30.689839572192515,
"alnum_prop": 0.6032409827496079,
"repo_name": "mapr/elasticsearch",
"id": "bc4006469ad1a2f12a88aa08a75e021cc5d14062",
"size": "6527",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "core/src/main/java/org/elasticsearch/search/suggest/term/TermSuggestion.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "8172"
},
{
"name": "Batchfile",
"bytes": "11820"
},
{
"name": "Emacs Lisp",
"bytes": "3341"
},
{
"name": "FreeMarker",
"bytes": "45"
},
{
"name": "Groovy",
"bytes": "221486"
},
{
"name": "HTML",
"bytes": "5595"
},
{
"name": "Java",
"bytes": "33739530"
},
{
"name": "Perl",
"bytes": "7111"
},
{
"name": "Python",
"bytes": "75936"
},
{
"name": "Ruby",
"bytes": "1917"
},
{
"name": "Shell",
"bytes": "90919"
}
],
"symlink_target": ""
} |
<?php
namespace Vardius\Bundle\ListBundle\Action;
/**
* Action
*
* @author Rafał Lorenz <vardius@gmail.com>
*/
class Action implements ActionInterface
{
/** @var string */
protected $name;
/** @var string */
protected $path;
/** @var string */
protected $icon;
/** @var array */
protected $parameters;
/**
* @inheritDoc
*/
function __construct(string $path, string $name = null, string $icon = null, array $parameters = [])
{
$this->name = $name;
$this->path = $path;
$this->icon = $icon;
$this->parameters = $parameters;
}
/**
* @inheritDoc
*/
public function getName():string
{
return $this->name;
}
/**
* @inheritDoc
*/
public function setName(string $name):self
{
$this->name = $name;
return $this;
}
/**
* @inheritDoc
*/
public function getPath():string
{
return $this->path;
}
/**
* @inheritDoc
*/
public function setPath(string $path):self
{
$this->path = $path;
return $this;
}
/**
* @inheritDoc
*/
public function getIcon():string
{
return $this->icon;
}
/**
* @inheritDoc
*/
public function setIcon(string $icon):self
{
$this->icon = $icon;
return $this;
}
/**
* @inheritDoc
*/
public function getParameters():array
{
return $this->parameters;
}
/**
* @inheritDoc
*/
public function setParameters(array $parameters):self
{
$this->parameters = $parameters;
return $this;
}
}
| {
"content_hash": "87ab1d22cca3759db102d915831c5353",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 104,
"avg_line_length": 16.98,
"alnum_prop": 0.502944640753828,
"repo_name": "Vardius/list-bundle",
"id": "dc075f6c7bffaa2a04fd31949049dbacd11e3670",
"size": "1937",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Action/Action.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "9081"
},
{
"name": "JavaScript",
"bytes": "465"
},
{
"name": "PHP",
"bytes": "112256"
}
],
"symlink_target": ""
} |
require 'date'
module Sequel
module Plugins
module TimeMachine
def self.configure(model, opts={})
model.period_start_date_column = opts[:period_start_column]
model.period_end_date_column = opts[:period_end_column]
model.delegate :point_in_time, to: model
end
module ClassMethods
attr_accessor :period_start_date_column, :period_end_date_column
Plugins.def_dataset_methods self, [:actual, :with_actual]
# Inheriting classes have the same start/end date columns
def inherited(subclass)
super
ds = dataset
subclass.period_start_date_column = period_start_date_column
subclass.period_end_date_column = period_end_date_column
subclass.instance_eval do
set_dataset(ds)
end
end
def period_start_date_column
@period_start_date_column.presence || Sequel.qualify(table_name, :validity_start_date)
end
def period_end_date_column
@period_end_date_column.presence || Sequel.qualify(table_name, :validity_end_date)
end
def point_in_time
Thread.current[::TimeMachine::THREAD_DATETIME_KEY]
end
def relevant_query?
Thread.current[::TimeMachine::THREAD_RELEVANT_KEY]
end
end
module InstanceMethods
# Use for fetching associated records with relevant validity period
# to parent record.
def actual_or_relevant(klass)
if self.class.point_in_time.present?
klass.filter{|o| o.<=(self.class.period_start_date_column, self.class.point_in_time) & (o.>=(self.class.period_end_date_column, self.class.point_in_time) | ({self.class.period_end_date_column => nil})) }
elsif self.class.relevant_query?
klass.filter{|o| o.<=(klass.period_start_date_column, self.send(self.class.period_start_date_column.column)) & (o.>=(klass.period_end_date_column, self.send(self.class.period_end_date_column.column)) | ({klass.period_end_date_column => nil})) }
else
klass
end
end
end
module DatasetMethods
# Use for fetching record inside TimeMachine block.
#
# Example:
#
# TimeMachine.now { Commodity.actual.first }
#
# Will fetch first commodity that is valid at this point in time.
# Invoking outside time machine block will probably yield no as
# current time variable will be nil.
#
def actual
if model.point_in_time.present?
filter{|o| o.<=(model.period_start_date_column, model.point_in_time) & (o.>=(model.period_end_date_column, model.point_in_time) | ({model.period_end_date_column => nil})) }
else
self
end
end
# Use for extending datasets and associations, so that specified
# klass would respect current time in TimeMachine.
#
# Example
#
# TimeMachine.now { Footnote.actual
# .with_actual(FootnoteDescriptionPeriod)
# .joins(:footnote_description_periods)
# .first }
#
# Useful for forming time bound associations.
#
def with_actual(assoc, parent = nil)
klass = assoc.to_s.classify.constantize
if parent && klass.relevant_query?
filter{|o| o.<=(klass.period_start_date_column, parent.send(parent.class.period_start_date_column.column)) & (o.>=(klass.period_end_date_column, parent.send(parent.class.period_end_date_column.column)) | ({klass.period_end_date_column => nil})) }
elsif klass.point_in_time.present?
filter{|o| o.<=(klass.period_start_date_column, klass.point_in_time) & (o.>=(klass.period_end_date_column, klass.point_in_time) | ({klass.period_end_date_column => nil})) }
else
self
end
end
end
end
end
end
| {
"content_hash": "9e48281aca776ed7f9d98f6f33472323",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 258,
"avg_line_length": 37.83177570093458,
"alnum_prop": 0.5983201581027668,
"repo_name": "alphagov/trade-tariff-backend",
"id": "a2528b7d31c21c80f15714cbaf8c934fc4013cff",
"size": "4048",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "lib/sequel/plugins/time_machine.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "6122"
},
{
"name": "Ruby",
"bytes": "1248540"
},
{
"name": "Shell",
"bytes": "2599"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.