text stringlengths 2 1.04M | meta dict |
|---|---|
fugu_cookbook Cookbook
======================
TODO: Enter the cookbook description here.
e.g.
This cookbook makes your favorite breakfast sandwich.
Requirements
------------
TODO: List your cookbook requirements. Be sure to include any requirements this cookbook has on platforms, libraries, other cookbooks, packages, operating systems, etc.
e.g.
#### packages
- `toaster` - fugu_cookbook needs toaster to brown your bagel.
Attributes
----------
TODO: List your cookbook attributes here.
e.g.
#### fugu_cookbook::default
<table>
<tr>
<th>Key</th>
<th>Type</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr>
<td><tt>['fugu_cookbook']['bacon']</tt></td>
<td>Boolean</td>
<td>whether to include bacon</td>
<td><tt>true</tt></td>
</tr>
</table>
Usage
-----
#### fugu_cookbook::default
TODO: Write usage instructions for each cookbook.
e.g.
Just include `fugu_cookbook` in your node's `run_list`:
```json
{
"name":"my_node",
"run_list": [
"recipe[fugu_cookbook]"
]
}
```
Contributing
------------
TODO: (optional) If this is a public cookbook, detail the process for contributing. If this is a private cookbook, remove this section.
e.g.
1. Fork the repository on Github
2. Create a named feature branch (like `add_component_x`)
3. Write your change
4. Write tests for your change (if applicable)
5. Run the tests, ensuring they all pass
6. Submit a Pull Request using Github
License and Authors
-------------------
Authors: TODO: List authors
| {
"content_hash": "685f262092f04f5f71d37f3267e1a771",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 168,
"avg_line_length": 22.11764705882353,
"alnum_prop": 0.6622340425531915,
"repo_name": "enriko-iskandar/chef",
"id": "783cc506242c2b0eac53f42116b862cfa02b5a4f",
"size": "1504",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "cookbooks/fugu_cookbook/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "187369"
},
{
"name": "Perl",
"bytes": "82975"
},
{
"name": "Python",
"bytes": "1654898"
},
{
"name": "Ruby",
"bytes": "769796"
},
{
"name": "Shell",
"bytes": "8647"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using JetBrains.Annotations;
namespace AspNetHttpLogger
{
public class LogEvent
{
[PublicAPI] public readonly string AbsoluteUrl;
[PublicAPI] public readonly IPAddress ClientIp;
[PublicAPI] public readonly HttpStatusCode HttpStatusCode;
[PublicAPI] public readonly int HttpStatusCodeNumber;
[PublicAPI] public readonly string HttpStatusReasonPhrase;
[PublicAPI] public readonly bool IsSuccess;
[PublicAPI] public readonly string RelativeUrl;
[PublicAPI, NotNull] public readonly HttpRequestMessage Request;
[PublicAPI] public readonly string RequestContent;
[PublicAPI] public readonly Guid RequestId;
[PublicAPI, NotNull] public readonly HttpResponseMessage Response;
[PublicAPI] public readonly string ResponseContent;
[PublicAPI, NotNull] public readonly string ShortRequestId;
[PublicAPI, NotNull] public readonly string Summary;
[PublicAPI] public readonly string UserHostAddress;
[PublicAPI, NotNull] public readonly string UserName;
private readonly Lazy<string> _toStringLazy = new Lazy<string>(() => "");
[UsedImplicitly]
public LogEvent()
{
}
public LogEvent([NotNull] HttpRequestMessage request, [NotNull] HttpResponseMessage response, Guid requestId,
[NotNull] string shortRequestId,
[NotNull] string userName, string userHostAddress, string requestContent, string responseContent,
[NotNull] string summary)
{
if (request == null) throw new ArgumentNullException("request");
if (response == null) throw new ArgumentNullException("response");
if (shortRequestId == null) throw new ArgumentNullException("shortRequestId");
if (userName == null) throw new ArgumentNullException("userName");
if (summary == null) throw new ArgumentNullException("summary");
RequestId = requestId;
Request = request;
Response = response;
UserName = userName;
UserHostAddress = userHostAddress;
RelativeUrl = request.RequestUri.AbsolutePath;
AbsoluteUrl = request.RequestUri.ToString();
HttpStatusCodeNumber = (int) response.StatusCode;
HttpStatusCode = response.StatusCode;
HttpStatusReasonPhrase = response.ReasonPhrase;
RequestContent = requestContent;
ResponseContent = responseContent;
Summary = summary;
ShortRequestId = shortRequestId;
IsSuccess = response.IsSuccessStatusCode;
IPAddress.TryParse(UserHostAddress, out ClientIp);
_toStringLazy = new Lazy<string>(GetToString);
}
private string GetToString()
{
var sb = new StringBuilder();
sb.AppendLine("REQUEST");
sb.AppendLine("-------");
sb.AppendFormat("{0} {1}\n", Request.Method.Method, AbsoluteUrl);
AppendHeaders(sb, Request.Headers);
sb.AppendLine("");
sb.AppendLine(RequestContent);
sb.AppendLine("");
sb.AppendLine("");
sb.AppendLine("RESPONSE");
sb.AppendLine("--------");
sb.AppendFormat("HTTP/{0} {1} {2}\n", Response.Version, (int) Response.StatusCode, Response.StatusCode);
AppendHeaders(sb, Response.Headers);
sb.AppendLine("");
sb.AppendLine(ResponseContent);
string str = sb.ToString();
return str;
}
public override string ToString()
{
return _toStringLazy.Value;
}
// ReSharper disable once ParameterTypeCanBeEnumerable.Local
private static void AppendHeaders(StringBuilder sb, HttpHeaders headers)
{
foreach (var headerNameToValues in headers)
{
string headerName = headerNameToValues.Key;
sb.Append(headerName + ": ");
IEnumerable<string> headerValues = headerNameToValues.Value;
foreach (string value in headerValues)
{
sb.Append(value);
}
sb.Append("\n");
}
}
}
} | {
"content_hash": "0c3cf83bad63be2c2b0c3b0274ea55ef",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 117,
"avg_line_length": 39.07017543859649,
"alnum_prop": 0.6171980242478671,
"repo_name": "anjdreas/AspNetHttpLogger",
"id": "dab3df898874a5a8b2c222042a9570237e5be2f9",
"size": "4454",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Src/AspNetHttpLogger/src/LogEvent.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "24860"
},
{
"name": "PowerShell",
"bytes": "13708"
}
],
"symlink_target": ""
} |
class SmaChart
def initialize
@all_vidyas = {}
@all_dates = {}
@all_vdevs = {}
end
def plot(record, file_path)
soks = Sok.joins(:company).where('companies.code = ? and date >= ? and date <= ?',
record.code,
record.from - 72,
record.to + 20).order(:date)
dates = Soks.parse(soks, :date)
values =Soks.parse(soks, :open, :high, :low, :close)
opens = values[0]
if @all_vidyas[record.code].nil?
tmp_value = Sok.joins(:company).where('companies.code = ?', record.code)
tmp_date, tmp_value = Soks.parse(tmp_value,:date, :close)
@all_vidyas[record.code] = tmp_value.kama(10,4,30)
min = @all_vidyas[record.code].length
@all_dates[record.code] = tmp_date[-min..-1]
end
index = @all_dates[record.code].index(dates.last)
vidyas = @all_vidyas[record.code][0..index]
marks = Soks.new
dates.zip(opens).each do |date, open|
marks << case date
when record.from, record.to
open
else
Float::NAN
end
end
case record.position
when :buy
mark_point = '9'
when :sell
mark_point = '11'
end
dates, values, marks, vidyas = Soks.cut_off_tail(dates, values, marks, vidyas )
up_stick, down_stick = values.split_up_and_down_sticks
Numo.gnuplot do
reset
set terminal: 'jpeg'
set output: file_path
set yrange: values.yrange
set ytics: :nomirror
set y2tics: true
set xtics: dates.xtics
set grid: true
plot [dates.x, *up_stick.y, with: :candlesticks, lt: 6, notitle: true],
[dates.x, *down_stick.y, with: :candlesticks, lt: 7, notitle: true],
[dates.x, marks.y, with: :points, notitle: true, pt: mark_point, ps: 2, lc: "'dark-green'"],
[dates.x, vidyas.y, with: :lines, notitle: true, lc: "'salmon'"]
end
end
end
| {
"content_hash": "a2c10ed576f3a265cccbdf45dec57ed6",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 100,
"avg_line_length": 30.546875,
"alnum_prop": 0.5626598465473146,
"repo_name": "Traver1/sok",
"id": "93ca00d4d0752b624769fdf49990ffd071a21ca8",
"size": "1955",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "example/back_test/strategy2-3/sma_chart.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "199519"
},
{
"name": "Shell",
"bytes": "204"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2015 StreamSets 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. See accompanying LICENSE file.
-->
<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.streamsets</groupId>
<artifactId>streamsets-datacollector-root</artifactId>
<version>2.2.0.0-SNAPSHOT</version>
<relativePath>../root</relativePath>
</parent>
<groupId>com.streamsets</groupId>
<artifactId>streamsets-datacollector-common</artifactId>
<version>2.2.0.0-SNAPSHOT</version>
<description>StreamSets Data Collector Common</description>
<name>StreamSets Data Collector Common</name>
<packaging>jar</packaging>
<properties>
<commons-csv.version>1.1</commons-csv.version>
</properties>
<dependencies>
<dependency>
<groupId>com.streamsets</groupId>
<artifactId>streamsets-datacollector-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.streamsets</groupId>
<artifactId>streamsets-utils</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.streamsets</groupId>
<artifactId>streamsets-testing</artifactId>
<scope>test</scope>
</dependency>
<!-- This is for testing Kafka Consumer with XML messages. Need to create XML messages -->
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>${commons-csv.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
| {
"content_hash": "3c8ce1be3cd4cd0100246f5911bfd3d8",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 108,
"avg_line_length": 32.196850393700785,
"alnum_prop": 0.6720469552457814,
"repo_name": "WgStreamsets/datacollector",
"id": "0b5dd0a56261188521774896bf3c39ab1373a3c1",
"size": "4089",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "common/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "89702"
},
{
"name": "CSS",
"bytes": "112118"
},
{
"name": "Groovy",
"bytes": "15336"
},
{
"name": "HTML",
"bytes": "397587"
},
{
"name": "Java",
"bytes": "12551673"
},
{
"name": "JavaScript",
"bytes": "905534"
},
{
"name": "Protocol Buffer",
"bytes": "3463"
},
{
"name": "Python",
"bytes": "28037"
},
{
"name": "Shell",
"bytes": "24655"
}
],
"symlink_target": ""
} |
import {
Meteor
} from 'meteor/meteor';
import {
Mongo
} from 'meteor/mongo';
import {
check
} from 'meteor/check';
export const Tasks = new Mongo.Collection('tasks');
if (Meteor.isServer) {
// This code only runs on the server
Meteor.publish('tasks', function tasksPublication() {
return Tasks.find({
$or: [{
private: {
$ne: true
}
}, {
owner: this.userId
}, ],
});
});
}
Meteor.methods({
'tasks.insert' (text) {
check(text, String);
// Make sure the user is logged in before inserting a task
if (!Meteor.userId()) {
throw new Meteor.Error('not-authorized');
}
Tasks.insert({
text,
createdAt: new Date(),
owner: Meteor.userId(),
username: Meteor.user().username,
});
},
'tasks.remove' (taskId) {
check(taskId, String);
const task = Tasks.findOne(taskId);
if (task.private && task.owner !== Meteor.userId()) {
// If the task is private, make sure only the owner can delete it
throw new Meteor.Error('not-authorized');
}
Tasks.remove(taskId);
},
'tasks.setChecked' (taskId, setChecked) {
check(taskId, String);
check(setChecked, Boolean);
const task = Tasks.findOne(taskId);
if (task.private && task.owner !== Meteor.userId()) {
// If the task is private, make sure only the owner can check it off
throw new Meteor.Error('not-authorized');
}
Tasks.update(taskId, {
$set: {
checked: setChecked
}
});
},
'tasks.setPrivate' (taskId, setToPrivate) {
check(taskId, String);
check(setToPrivate, Boolean);
const task = Tasks.findOne(taskId);
// Make sure only the task owner can make a task private
if (task.owner !== Meteor.userId()) {
throw new Meteor.Error('not-authorized');
}
Tasks.update(taskId, {
$set: {
private: setToPrivate
}
});
},
});
| {
"content_hash": "e56778da3246e9955f2b94524e2db586",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 80,
"avg_line_length": 17.7734375,
"alnum_prop": 0.5006593406593407,
"repo_name": "ankaimer/meteor",
"id": "56a2c67e3ace0b3fa7a37a50371d11470bb87fb8",
"size": "2275",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "simple-todos/imports/api/tasks.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "27895"
},
{
"name": "CoffeeScript",
"bytes": "2386"
},
{
"name": "HTML",
"bytes": "36084"
},
{
"name": "JavaScript",
"bytes": "791065"
}
],
"symlink_target": ""
} |
#import <UIKit/UIColor.h>
// Not exported
@interface UIPlaceholderColor : UIColor
{
}
- (void)dealloc;
- (_Bool)retainWeakReference;
- (_Bool)allowsWeakReference;
- (oneway void)release;
- (unsigned long long)retainCount;
- (id)retain;
- (id)autorelease;
@end
| {
"content_hash": "21603c49dc9064b27ae0bace88d05e23",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 39,
"avg_line_length": 14,
"alnum_prop": 0.7105263157894737,
"repo_name": "matthewsot/CocoaSharp",
"id": "472e12bd77fe71a638f5b86ab58c5353dea4e15f",
"size": "406",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Headers/Frameworks/UIKit/UIPlaceholderColor.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "259784"
},
{
"name": "C#",
"bytes": "2789005"
},
{
"name": "C++",
"bytes": "252504"
},
{
"name": "Objective-C",
"bytes": "24301417"
},
{
"name": "Smalltalk",
"bytes": "167909"
}
],
"symlink_target": ""
} |
module API
class Templates < Grape::API
include PaginationParams
GLOBAL_TEMPLATE_TYPES = {
gitignores: {
klass: Gitlab::Template::GitignoreTemplate,
gitlab_version: 8.8
},
gitlab_ci_ymls: {
klass: Gitlab::Template::GitlabCiYmlTemplate,
gitlab_version: 8.9
},
dockerfiles: {
klass: Gitlab::Template::DockerfileTemplate,
gitlab_version: 8.15
}
}.freeze
PROJECT_TEMPLATE_REGEX =
/[\<\{\[]
(project|description|
one\sline\s.+\swhat\sit\sdoes\.) # matching the start and end is enough here
[\>\}\]]/xi.freeze
YEAR_TEMPLATE_REGEX = /[<{\[](year|yyyy)[>}\]]/i.freeze
FULLNAME_TEMPLATE_REGEX =
/[\<\{\[]
(fullname|name\sof\s(author|copyright\sowner))
[\>\}\]]/xi.freeze
helpers do
def parsed_license_template
# We create a fresh Licensee::License object since we'll modify its
# content in place below.
template = Licensee::License.new(params[:name])
template.content.gsub!(YEAR_TEMPLATE_REGEX, Time.now.year.to_s)
template.content.gsub!(PROJECT_TEMPLATE_REGEX, params[:project]) if params[:project].present?
fullname = params[:fullname].presence || current_user.try(:name)
template.content.gsub!(FULLNAME_TEMPLATE_REGEX, fullname) if fullname
template
end
def render_response(template_type, template)
not_found!(template_type.to_s.singularize) unless template
present template, with: Entities::Template
end
end
desc 'Get the list of the available license template' do
detail 'This feature was introduced in GitLab 8.7.'
success ::API::Entities::RepoLicense
end
params do
optional :popular, type: Boolean, desc: 'If passed, returns only popular licenses'
use :pagination
end
get "templates/licenses" do
options = {
featured: declared(params)[:popular].present? ? true : nil
}
licences = ::Kaminari.paginate_array(Licensee::License.all(options))
present paginate(licences), with: Entities::RepoLicense
end
desc 'Get the text for a specific license' do
detail 'This feature was introduced in GitLab 8.7.'
success ::API::Entities::RepoLicense
end
params do
requires :name, type: String, desc: 'The name of the template'
end
get "templates/licenses/:name", requirements: { name: /[\w\.-]+/ } do
not_found!('License') unless Licensee::License.find(declared(params)[:name])
template = parsed_license_template
present template, with: ::API::Entities::RepoLicense
end
GLOBAL_TEMPLATE_TYPES.each do |template_type, properties|
klass = properties[:klass]
gitlab_version = properties[:gitlab_version]
desc 'Get the list of the available template' do
detail "This feature was introduced in GitLab #{gitlab_version}."
success Entities::TemplatesList
end
params do
use :pagination
end
get "templates/#{template_type}" do
templates = ::Kaminari.paginate_array(klass.all)
present paginate(templates), with: Entities::TemplatesList
end
desc 'Get the text for a specific template present in local filesystem' do
detail "This feature was introduced in GitLab #{gitlab_version}."
success Entities::Template
end
params do
requires :name, type: String, desc: 'The name of the template'
end
get "templates/#{template_type}/:name" do
new_template = klass.find(declared(params)[:name])
render_response(template_type, new_template)
end
end
end
end
| {
"content_hash": "17c8de5c17710b336ee9046af5b21a81",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 101,
"avg_line_length": 33.432432432432435,
"alnum_prop": 0.6383724063594718,
"repo_name": "t-zuehlsdorff/gitlabhq",
"id": "f70bc0622b766c11c8e5e190a268226d1a073906",
"size": "3711",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/api/templates.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "558077"
},
{
"name": "Gherkin",
"bytes": "115565"
},
{
"name": "HTML",
"bytes": "1054670"
},
{
"name": "JavaScript",
"bytes": "2305094"
},
{
"name": "Ruby",
"bytes": "12136142"
},
{
"name": "Shell",
"bytes": "27385"
},
{
"name": "Vue",
"bytes": "222165"
}
],
"symlink_target": ""
} |
package com.alibaba.dubbo.rpc.listener;
import com.alibaba.dubbo.rpc.Invoker;
import com.alibaba.dubbo.rpc.InvokerListener;
import com.alibaba.dubbo.rpc.RpcException;
/**
* InvokerListenerAdapter
*
* @author william.liangf
*/
public abstract class InvokerListenerAdapter implements InvokerListener {
public void referred(Invoker<?> invoker) throws RpcException {
}
public void destroyed(Invoker<?> invoker) {
}
} | {
"content_hash": "9f50a6451f69fe46535495ff9809b0e4",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 73,
"avg_line_length": 21.80952380952381,
"alnum_prop": 0.7183406113537117,
"repo_name": "mingbotang/dubbo",
"id": "298b7b91f22681d53279939c01f0901ffaaa1d32",
"size": "1081",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/listener/InvokerListenerAdapter.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "8441"
},
{
"name": "CSS",
"bytes": "21097"
},
{
"name": "Java",
"bytes": "5730251"
},
{
"name": "JavaScript",
"bytes": "76109"
},
{
"name": "Lex",
"bytes": "2077"
},
{
"name": "Shell",
"bytes": "13751"
},
{
"name": "Thrift",
"bytes": "668"
}
],
"symlink_target": ""
} |
package com.grndctl.model.station;
import javax.xml.bind.annotation.*;
/**
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(propOrder = {"visibility", "weather", "meta", "temp","wind"})
@XmlRootElement(name = "weather")
public class FaaWeather {
@XmlElement
private int visibility;
@XmlElement
private String weather;
@XmlElement
private FaaWeatherMeta meta;
@XmlElement
private String temp;
@XmlElement
private String wind;
public FaaWeather(){ }
public int getVisibility() {
return visibility;
}
public void setVisibility(int visibility) {
this.visibility = visibility;
}
public String getWeather() {
return weather;
}
public void setWeather(String weather) {
this.weather = weather;
}
public FaaWeatherMeta getMeta() {
return meta;
}
public void setMeta(FaaWeatherMeta meta) {
this.meta = meta;
}
public String getTemp() {
return temp;
}
public void setTemp(String temp) {
this.temp = temp;
}
public String getWind() {
return wind;
}
public void setWind(String wind) {
this.wind = wind;
}
@Override
public String toString() {
return "weather: {" +
"visibility=" + visibility +
", weather='" + weather + '\'' +
", meta=" + meta +
", temp='" + temp + '\'' +
", wind='" + wind + '\'' +
'}';
}
}
| {
"content_hash": "06421d43686cdfb36c98455a2914e1be",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 70,
"avg_line_length": 21.17105263157895,
"alnum_prop": 0.5276569297700435,
"repo_name": "mdisalvo/grndctl",
"id": "bde1849a79d88c8d3ab70116f6573552ab20da5d",
"size": "2761",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/grndctl/model/station/FaaWeather.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "720292"
}
],
"symlink_target": ""
} |
"""Helper functions for Quantity.
In particular, this implements the logic that determines scaling and result
units for a given ufunc, given input units.
"""
from fractions import Fraction
import numpy as np
from .core import (UnitsError, UnitConversionError, UnitTypeError,
dimensionless_unscaled, get_current_unit_registry)
def _d(unit):
if unit is None:
return dimensionless_unscaled
else:
return unit
def get_converter(from_unit, to_unit):
"""Like Unit._get_converter, except returns None if no scaling is needed,
i.e., if the inferred scale is unity."""
try:
scale = from_unit._to(to_unit)
except UnitsError:
return from_unit._apply_equivalencies(
from_unit, to_unit, get_current_unit_registry().equivalencies)
except AttributeError:
raise UnitTypeError("Unit '{0}' cannot be converted to '{1}'"
.format(from_unit, to_unit))
if scale == 1.:
return None
else:
return lambda val: scale * val
def get_converters_and_unit(f, unit1, unit2):
converters = [None, None]
# By default, we try adjusting unit2 to unit1, so that the result will
# be unit1 as well. But if there is no second unit, we have to try
# adjusting unit1 (to dimensionless, see below).
if unit2 is None:
if unit1 is None:
# No units for any input -- e.g., np.add(a1, a2, out=q)
return converters, dimensionless_unscaled
changeable = 0
# swap units.
unit2 = unit1
unit1 = None
elif unit2 is unit1:
# ensure identical units is fast ("==" is slow, so avoid that).
return converters, unit1
else:
changeable = 1
# Try to get a converter from unit2 to unit1.
if unit1 is None:
try:
converters[changeable] = get_converter(unit2,
dimensionless_unscaled)
except UnitsError:
# special case: would be OK if unitless number is zero, inf, nan
converters[1-changeable] = False
return converters, unit2
else:
return converters, dimensionless_unscaled
else:
try:
converters[changeable] = get_converter(unit2, unit1)
except UnitsError:
raise UnitConversionError(
"Can only apply '{0}' function to quantities "
"with compatible dimensions"
.format(f.__name__))
return converters, unit1
def can_have_arbitrary_unit(value):
"""Test whether the items in value can have arbitrary units
Numbers whose value does not change upon a unit change, i.e.,
zero, infinity, or not-a-number
Parameters
----------
value : number or array
Returns
-------
`True` if each member is either zero or not finite, `False` otherwise
"""
return np.all(np.logical_or(np.equal(value, 0.), ~np.isfinite(value)))
# SINGLE ARGUMENT UFUNC HELPERS
#
# The functions below take a single argument, which is the quantity upon which
# the ufunc is being used. The output of the helper function should be two
# values: a list with a single converter to be used to scale the input before
# it is being passed to the ufunc (or None if no conversion is needed), and
# the unit the output will be in.
def helper_onearg_test(f, unit):
return ([None], None)
def helper_invariant(f, unit):
return ([None], _d(unit))
def helper_sqrt(f, unit):
return ([None], unit ** Fraction(1, 2) if unit is not None
else dimensionless_unscaled)
def helper_square(f, unit):
return ([None], unit ** 2 if unit is not None else dimensionless_unscaled)
def helper_reciprocal(f, unit):
return ([None], unit ** -1 if unit is not None else dimensionless_unscaled)
def helper_cbrt(f, unit):
return ([None], (unit ** Fraction(1, 3) if unit is not None
else dimensionless_unscaled))
def helper_modf(f, unit):
if unit is None:
return [None], (dimensionless_unscaled, dimensionless_unscaled)
try:
return ([get_converter(unit, dimensionless_unscaled)],
(dimensionless_unscaled, dimensionless_unscaled))
except UnitsError:
raise UnitTypeError("Can only apply '{0}' function to "
"dimensionless quantities"
.format(f.__name__))
def helper__ones_like(f, unit):
return [None], dimensionless_unscaled
def helper_dimensionless_to_dimensionless(f, unit):
if unit is None:
return [None], dimensionless_unscaled
try:
return ([get_converter(unit, dimensionless_unscaled)],
dimensionless_unscaled)
except UnitsError:
raise UnitTypeError("Can only apply '{0}' function to "
"dimensionless quantities"
.format(f.__name__))
def helper_dimensionless_to_radian(f, unit):
from .si import radian
if unit is None:
return [None], radian
try:
return [get_converter(unit, dimensionless_unscaled)], radian
except UnitsError:
raise UnitTypeError("Can only apply '{0}' function to "
"dimensionless quantities"
.format(f.__name__))
def helper_degree_to_radian(f, unit):
from .si import degree, radian
try:
return [get_converter(unit, degree)], radian
except UnitsError:
raise UnitTypeError("Can only apply '{0}' function to "
"quantities with angle units"
.format(f.__name__))
def helper_radian_to_degree(f, unit):
from .si import degree, radian
try:
return [get_converter(unit, radian)], degree
except UnitsError:
raise UnitTypeError("Can only apply '{0}' function to "
"quantities with angle units"
.format(f.__name__))
def helper_radian_to_dimensionless(f, unit):
from .si import radian
try:
return [get_converter(unit, radian)], dimensionless_unscaled
except UnitsError:
raise UnitTypeError("Can only apply '{0}' function to "
"quantities with angle units"
.format(f.__name__))
def helper_frexp(f, unit):
if not unit.is_unity():
raise UnitTypeError("Can only apply '{0}' function to "
"unscaled dimensionless quantities"
.format(f.__name__))
return [None], (None, None)
# TWO ARGUMENT UFUNC HELPERS
#
# The functions below take a two arguments. The output of the helper function
# should be two values: a tuple of two converters to be used to scale the
# inputs before being passed to the ufunc (None if no conversion is needed),
# and the unit the output will be in.
def helper_multiplication(f, unit1, unit2):
return [None, None], _d(unit1) * _d(unit2)
def helper_division(f, unit1, unit2):
return [None, None], _d(unit1) / _d(unit2)
def helper_power(f, unit1, unit2):
# TODO: find a better way to do this, currently need to signal that one
# still needs to raise power of unit1 in main code
if unit2 is None:
return [None, None], False
try:
return [None, get_converter(unit2, dimensionless_unscaled)], False
except UnitsError:
raise UnitTypeError("Can only raise something to a "
"dimensionless quantity")
def helper_ldexp(f, unit1, unit2):
if unit2 is not None:
raise TypeError("Cannot use ldexp with a quantity "
"as second argument.")
else:
return [None, None], _d(unit1)
def helper_copysign(f, unit1, unit2):
# if first arg is not a quantity, just return plain array
if unit1 is None:
return [None, None], None
else:
return [None, None], unit1
def helper_heaviside(f, unit1, unit2):
try:
converter2 = (get_converter(unit2, dimensionless_unscaled)
if unit2 is not None else None)
except UnitsError:
raise UnitTypeError("Can only apply 'heaviside' function with a "
"dimensionless second argument.")
return ([None, converter2], dimensionless_unscaled)
def helper_two_arg_dimensionless(f, unit1, unit2):
try:
converter1 = (get_converter(unit1, dimensionless_unscaled)
if unit1 is not None else None)
converter2 = (get_converter(unit2, dimensionless_unscaled)
if unit2 is not None else None)
except UnitsError:
raise UnitTypeError("Can only apply '{0}' function to "
"dimensionless quantities"
.format(f.__name__))
return ([converter1, converter2], dimensionless_unscaled)
# This used to be a separate function that just called get_converters_and_unit.
# Using it directly saves a few us; keeping the clearer name.
helper_twoarg_invariant = get_converters_and_unit
def helper_twoarg_comparison(f, unit1, unit2):
converters, _ = get_converters_and_unit(f, unit1, unit2)
return converters, None
def helper_twoarg_invtrig(f, unit1, unit2):
from .si import radian
converters, _ = get_converters_and_unit(f, unit1, unit2)
return converters, radian
def helper_twoarg_floor_divide(f, unit1, unit2):
converters, _ = get_converters_and_unit(f, unit1, unit2)
return converters, dimensionless_unscaled
def helper_divmod(f, unit1, unit2):
converters, result_unit = get_converters_and_unit(f, unit1, unit2)
return converters, (dimensionless_unscaled, result_unit)
def helper_degree_to_dimensionless(f, unit):
from .si import degree
try:
return [get_converter(unit, degree)], dimensionless_unscaled
except UnitsError:
raise UnitTypeError("Can only apply '{0}' function to "
"quantities with angle units"
.format(f.__name__))
def helper_degree_minute_second_to_radian(f, unit1, unit2, unit3):
from .si import degree, arcmin, arcsec, radian
try:
return [get_converter(unit1, degree),
get_converter(unit2, arcmin),
get_converter(unit3, arcsec)], radian
except UnitsError:
raise UnitTypeError("Can only apply '{0}' function to "
"quantities with angle units"
.format(f.__name__))
# list of ufuncs:
# http://docs.scipy.org/doc/numpy/reference/ufuncs.html#available-ufuncs
UFUNC_HELPERS = {}
UNSUPPORTED_UFUNCS = {
np.bitwise_and, np.bitwise_or, np.bitwise_xor, np.invert, np.left_shift,
np.right_shift, np.logical_and, np.logical_or, np.logical_xor,
np.logical_not}
for name in 'isnat', 'gcd', 'lcm':
# isnat was introduced in numpy 1.14, gcd+lcm in 1.15
ufunc = getattr(np, name, None)
if isinstance(ufunc, np.ufunc):
UNSUPPORTED_UFUNCS |= {ufunc}
# SINGLE ARGUMENT UFUNCS
# ufuncs that return a boolean and do not care about the unit
onearg_test_ufuncs = (np.isfinite, np.isinf, np.isnan, np.sign, np.signbit)
for ufunc in onearg_test_ufuncs:
UFUNC_HELPERS[ufunc] = helper_onearg_test
# ufuncs that return a value with the same unit as the input
invariant_ufuncs = (np.absolute, np.fabs, np.conj, np.conjugate, np.negative,
np.spacing, np.rint, np.floor, np.ceil, np.trunc)
for ufunc in invariant_ufuncs:
UFUNC_HELPERS[ufunc] = helper_invariant
# positive was added in numpy 1.13
if isinstance(getattr(np, 'positive', None), np.ufunc):
UFUNC_HELPERS[np.positive] = helper_invariant
# ufuncs that require dimensionless input and and give dimensionless output
dimensionless_to_dimensionless_ufuncs = (np.exp, np.expm1, np.exp2, np.log,
np.log10, np.log2, np.log1p)
for ufunc in dimensionless_to_dimensionless_ufuncs:
UFUNC_HELPERS[ufunc] = helper_dimensionless_to_dimensionless
# ufuncs that require dimensionless input and give output in radians
dimensionless_to_radian_ufuncs = (np.arccos, np.arcsin, np.arctan, np.arccosh,
np.arcsinh, np.arctanh)
for ufunc in dimensionless_to_radian_ufuncs:
UFUNC_HELPERS[ufunc] = helper_dimensionless_to_radian
# ufuncs that require input in degrees and give output in radians
degree_to_radian_ufuncs = (np.radians, np.deg2rad)
for ufunc in degree_to_radian_ufuncs:
UFUNC_HELPERS[ufunc] = helper_degree_to_radian
# ufuncs that require input in radians and give output in degrees
radian_to_degree_ufuncs = (np.degrees, np.rad2deg)
for ufunc in radian_to_degree_ufuncs:
UFUNC_HELPERS[ufunc] = helper_radian_to_degree
# ufuncs that require input in radians and give dimensionless output
radian_to_dimensionless_ufuncs = (np.cos, np.sin, np.tan, np.cosh, np.sinh,
np.tanh)
for ufunc in radian_to_dimensionless_ufuncs:
UFUNC_HELPERS[ufunc] = helper_radian_to_dimensionless
# ufuncs handled as special cases
UFUNC_HELPERS[np.sqrt] = helper_sqrt
UFUNC_HELPERS[np.square] = helper_square
UFUNC_HELPERS[np.reciprocal] = helper_reciprocal
UFUNC_HELPERS[np.cbrt] = helper_cbrt
UFUNC_HELPERS[np.core.umath._ones_like] = helper__ones_like
UFUNC_HELPERS[np.modf] = helper_modf
UFUNC_HELPERS[np.frexp] = helper_frexp
# TWO ARGUMENT UFUNCS
# two argument ufuncs that require dimensionless input and and give
# dimensionless output
two_arg_dimensionless_ufuncs = (np.logaddexp, np.logaddexp2)
for ufunc in two_arg_dimensionless_ufuncs:
UFUNC_HELPERS[ufunc] = helper_two_arg_dimensionless
# two argument ufuncs that return a value with the same unit as the input
twoarg_invariant_ufuncs = (np.add, np.subtract, np.hypot, np.maximum,
np.minimum, np.fmin, np.fmax, np.nextafter,
np.remainder, np.mod, np.fmod)
for ufunc in twoarg_invariant_ufuncs:
UFUNC_HELPERS[ufunc] = helper_twoarg_invariant
# two argument ufuncs that need compatible inputs and return a boolean
twoarg_comparison_ufuncs = (np.greater, np.greater_equal, np.less,
np.less_equal, np.not_equal, np.equal)
for ufunc in twoarg_comparison_ufuncs:
UFUNC_HELPERS[ufunc] = helper_twoarg_comparison
# two argument ufuncs that do inverse trigonometry
twoarg_invtrig_ufuncs = (np.arctan2,)
# another private function in numpy; use getattr in case it disappears
if isinstance(getattr(np.core.umath, '_arg', None), np.ufunc):
twoarg_invtrig_ufuncs += (np.core.umath._arg,)
for ufunc in twoarg_invtrig_ufuncs:
UFUNC_HELPERS[ufunc] = helper_twoarg_invtrig
# ufuncs handled as special cases
UFUNC_HELPERS[np.multiply] = helper_multiplication
UFUNC_HELPERS[np.divide] = helper_division
UFUNC_HELPERS[np.true_divide] = helper_division
UFUNC_HELPERS[np.power] = helper_power
UFUNC_HELPERS[np.ldexp] = helper_ldexp
UFUNC_HELPERS[np.copysign] = helper_copysign
UFUNC_HELPERS[np.floor_divide] = helper_twoarg_floor_divide
# heaviside only was added in numpy 1.13
if isinstance(getattr(np, 'heaviside', None), np.ufunc):
UFUNC_HELPERS[np.heaviside] = helper_heaviside
# float_power was added in numpy 1.12
if isinstance(getattr(np, 'float_power', None), np.ufunc):
UFUNC_HELPERS[np.float_power] = helper_power
# divmod only was added in numpy 1.13
if isinstance(getattr(np, 'divmod', None), np.ufunc):
UFUNC_HELPERS[np.divmod] = helper_divmod
# UFUNCS FROM SCIPY.SPECIAL
# available ufuncs in this module are at
# https://docs.scipy.org/doc/scipy/reference/special.html
try:
import scipy
import scipy.special as sps
except ImportError:
pass
else:
from ..utils import minversion
# ufuncs that require dimensionless input and give dimensionless output
dimensionless_to_dimensionless_sps_ufuncs = [
sps.erf, sps.gamma, sps.gammasgn,
sps.psi, sps.rgamma, sps.erfc, sps.erfcx, sps.erfi, sps.wofz,
sps.dawsn, sps.entr, sps.exprel, sps.expm1, sps.log1p, sps.exp2,
sps.exp10, sps.j0, sps.j1, sps.y0, sps.y1, sps.i0, sps.i0e, sps.i1,
sps.i1e, sps.k0, sps.k0e, sps.k1, sps.k1e, sps.itj0y0,
sps.it2j0y0, sps.iti0k0, sps.it2i0k0]
# TODO: Revert https://github.com/astropy/astropy/pull/7219 when astropy
# requires scipy>=0.18.
# See https://github.com/astropy/astropy/issues/7159
if minversion(scipy, "0.18"):
dimensionless_to_dimensionless_sps_ufuncs.append(sps.loggamma)
for ufunc in dimensionless_to_dimensionless_sps_ufuncs:
UFUNC_HELPERS[ufunc] = helper_dimensionless_to_dimensionless
# ufuncs that require input in degrees and give dimensionless output
degree_to_dimensionless_sps_ufuncs = (
sps.cosdg, sps.sindg, sps.tandg, sps.cotdg)
for ufunc in degree_to_dimensionless_sps_ufuncs:
UFUNC_HELPERS[ufunc] = helper_degree_to_dimensionless
# ufuncs that require 2 dimensionless inputs and give dimensionless output.
# note: sps.jv and sps.jn are aliases in some scipy versions, which will
# cause the same key to be written twice, but since both are handled by the
# same helper there is no harm done.
two_arg_dimensionless_sps_ufuncs = (
sps.jv, sps.jn, sps.jve, sps.yn, sps.yv, sps.yve, sps.kn, sps.kv,
sps.kve, sps.iv, sps.ive, sps.hankel1, sps.hankel1e, sps.hankel2,
sps.hankel2e)
for ufunc in two_arg_dimensionless_sps_ufuncs:
UFUNC_HELPERS[ufunc] = helper_two_arg_dimensionless
# ufuncs handled as special cases
UFUNC_HELPERS[sps.cbrt] = helper_cbrt
UFUNC_HELPERS[sps.radian] = helper_degree_minute_second_to_radian
def converters_and_unit(function, method, *args):
"""Determine the required converters and the unit of the ufunc result.
Converters are functions required to convert to a ufunc's expected unit,
e.g., radian for np.sin; or to ensure units of two inputs are consistent,
e.g., for np.add. In these examples, the unit of the result would be
dimensionless_unscaled for np.sin, and the same consistent unit for np.add.
Parameters
----------
function : `~numpy.ufunc`
Numpy universal function
method : str
Method with which the function is evaluated, e.g.,
'__call__', 'reduce', etc.
*args : Quantity or other ndarray subclass
Input arguments to the function
Raises
------
TypeError : when the specified function cannot be used with Quantities
(e.g., np.logical_or), or when the routine does not know how to handle
the specified function (in which case an issue should be raised on
https://github.com/astropy/astropy).
UnitTypeError : when the conversion to the required (or consistent) units
is not possible.
"""
# Check whether we support this ufunc, by getting the helper function
# (defined above) which returns a list of function(s) that convert the
# input(s) to the unit required for the ufunc, as well as the unit the
# result will have (a tuple of units if there are multiple outputs).
try:
ufunc_helper = UFUNC_HELPERS[function]
except KeyError:
if function in UNSUPPORTED_UFUNCS:
raise TypeError("Cannot use function '{0}' with quantities"
.format(function.__name__))
else:
raise TypeError("Unknown ufunc {0}. Please raise issue on "
"https://github.com/astropy/astropy"
.format(function.__name__))
if method == '__call__' or (method == 'outer' and function.nin == 2):
# Find out the units of the arguments passed to the ufunc; usually,
# at least one is a quantity, but for two-argument ufuncs, the second
# could also be a Numpy array, etc. These are given unit=None.
units = [getattr(arg, 'unit', None) for arg in args]
# Determine possible conversion functions, and the result unit.
converters, result_unit = ufunc_helper(function, *units)
if any(converter is False for converter in converters):
# for two-argument ufuncs with a quantity and a non-quantity,
# the quantity normally needs to be dimensionless, *except*
# if the non-quantity can have arbitrary unit, i.e., when it
# is all zero, infinity or NaN. In that case, the non-quantity
# can just have the unit of the quantity
# (this allows, e.g., `q > 0.` independent of unit)
maybe_arbitrary_arg = args[converters.index(False)]
try:
if can_have_arbitrary_unit(maybe_arbitrary_arg):
converters = [None, None]
else:
raise UnitsError("Can only apply '{0}' function to "
"dimensionless quantities when other "
"argument is not a quantity (unless the "
"latter is all zero/infinity/nan)"
.format(function.__name__))
except TypeError:
# _can_have_arbitrary_unit failed: arg could not be compared
# with zero or checked to be finite. Then, ufunc will fail too.
raise TypeError("Unsupported operand type(s) for ufunc {0}: "
"'{1}' and '{2}'"
.format(function.__name__,
args[0].__class__.__name__,
args[1].__class__.__name__))
# In the case of np.power and np.float_power, the unit itself needs to
# be modified by an amount that depends on one of the input values,
# so we need to treat this as a special case.
# TODO: find a better way to deal with this.
if result_unit is False:
if units[0] is None or units[0] == dimensionless_unscaled:
result_unit = dimensionless_unscaled
else:
if units[1] is None:
p = args[1]
else:
p = args[1].to(dimensionless_unscaled).value
try:
result_unit = units[0] ** p
except ValueError as exc:
# Changing the unit does not work for, e.g., array-shaped
# power, but this is OK if we're (scaled) dimensionless.
try:
converters[0] = units[0]._get_converter(
dimensionless_unscaled)
except UnitConversionError:
raise exc
else:
result_unit = dimensionless_unscaled
else: # methods for which the unit should stay the same
nin = function.nin
unit = getattr(args[0], 'unit', None)
if method == 'at' and nin <= 2:
if nin == 1:
units = [unit]
else:
units = [unit, getattr(args[2], 'unit', None)]
converters, result_unit = ufunc_helper(function, *units)
# ensure there is no 'converter' for indices (2nd argument)
converters.insert(1, None)
elif method in {'reduce', 'accumulate', 'reduceat'} and nin == 2:
converters, result_unit = ufunc_helper(function, unit, unit)
converters = converters[:1]
if method == 'reduceat':
# add 'scale' for indices (2nd argument)
converters += [None]
else:
if method in {'reduce', 'accumulate',
'reduceat', 'outer'} and nin != 2:
raise ValueError("{0} only supported for binary functions"
.format(method))
raise TypeError("Unexpected ufunc method {0}. If this should "
"work, please raise an issue on"
"https://github.com/astropy/astropy"
.format(method))
# for all but __call__ method, scaling is not allowed
if unit is not None and result_unit is None:
raise TypeError("Cannot use '{1}' method on ufunc {0} with a "
"Quantity instance as the result is not a "
"Quantity.".format(function.__name__, method))
if (converters[0] is not None or
(unit is not None and unit is not result_unit and
(not result_unit.is_equivalent(unit) or
result_unit.to(unit) != 1.))):
raise UnitsError("Cannot use '{1}' method on ufunc {0} with a "
"Quantity instance as it would change the unit."
.format(function.__name__, method))
return converters, result_unit
def check_output(output, unit, inputs, function=None):
"""Check that function output can be stored in the output array given.
Parameters
----------
output : array or `~astropy.units.Quantity` or tuple
Array that should hold the function output (or tuple of such arrays).
unit : `~astropy.units.Unit` or None, or tuple
Unit that the output will have, or `None` for pure numbers (should be
tuple of same if output is a tuple of outputs).
inputs : tuple
Any input arguments. These should be castable to the output.
function : callable
The function that will be producing the output. If given, used to
give a more informative error message.
Returns
-------
arrays : `~numpy.ndarray` view of ``output`` (or tuple of such views).
Raises
------
UnitTypeError : If ``unit`` is inconsistent with the class of ``output``
TypeError : If the ``inputs`` cannot be cast safely to ``output``.
"""
if isinstance(output, tuple):
return tuple(check_output(output_, unit_, inputs, function)
for output_, unit_ in zip(output, unit))
# ``None`` indicates no actual array is needed. This can happen, e.g.,
# with np.modf(a, out=(None, b)).
if output is None:
return None
if hasattr(output, '__quantity_subclass__'):
# Check that we're not trying to store a plain Numpy array or a
# Quantity with an inconsistent unit (e.g., not angular for Angle).
if unit is None:
raise TypeError("Cannot store non-quantity output{0} in {1} "
"instance".format(
(" from {0} function".format(function.__name__)
if function is not None else ""),
type(output)))
if output.__quantity_subclass__(unit)[0] is not type(output):
raise UnitTypeError(
"Cannot store output with unit '{0}'{1} "
"in {2} instance. Use {3} instance instead."
.format(unit, (" from {0} function".format(function.__name__)
if function is not None else ""), type(output),
output.__quantity_subclass__(unit)[0]))
# Turn into ndarray, so we do not loop into array_wrap/array_ufunc
# if the output is used to store results of a function.
output = output.view(np.ndarray)
else:
# output is not a Quantity, so cannot obtain a unit.
if not (unit is None or unit is dimensionless_unscaled):
raise UnitTypeError("Cannot store quantity with dimension "
"{0}in a non-Quantity instance."
.format("" if function is None else
"resulting from {0} function "
.format(function.__name__)))
# check we can handle the dtype (e.g., that we are not int
# when float is required).
if not np.can_cast(np.result_type(*inputs), output.dtype,
casting='same_kind'):
raise TypeError("Arguments cannot be cast safely to inplace "
"output with dtype={0}".format(output.dtype))
return output
| {
"content_hash": "6e07aa85d640f0ee451976a8c885d4f2",
"timestamp": "",
"source": "github",
"line_count": 719,
"max_line_length": 79,
"avg_line_length": 39.30876216968011,
"alnum_prop": 0.6146905848636026,
"repo_name": "DougBurke/astropy",
"id": "c2f6b8a7b8101ea8960da1e6777a77cf335f5a2d",
"size": "28474",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "astropy/units/quantity_helper.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "367279"
},
{
"name": "C++",
"bytes": "1057"
},
{
"name": "HTML",
"bytes": "1172"
},
{
"name": "Python",
"bytes": "8390850"
},
{
"name": "TeX",
"bytes": "805"
}
],
"symlink_target": ""
} |
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
| {
"content_hash": "dd851c71d5fbaab5983d65d8dfb29850",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 60,
"avg_line_length": 16.857142857142858,
"alnum_prop": 0.7796610169491526,
"repo_name": "aa88bb/xiaomage_iOS",
"id": "09e5837503e76ff9da9e0c80c55a765a4d812718",
"size": "279",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "901autolayout/901autolayout/AppDelegate.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "167306"
}
],
"symlink_target": ""
} |
page_type: sample
products:
- office-sp
languages:
- csharp
extensions:
contentType: samples
createdDate: 7/26/2014 7:08:15 PM
---
# Patterns and Practices #
> **ARCHIVED** - Notice that many of the samples in this repository are for legacy add-in model. You should be using [SharePoint Framework](https://aka.ms/spfx) for UX layer extensibility for SharePoint and Microsoft Teams. You can find [SPFx web part](https://aka.ms/spfx-webparts) and [SPFx extension](https://aka.ms/spfx-webparts) samples from different repository. You can use Azure AD and Microsoft Teams Solution model as replacement for the provider hosted add-in model. Please see https://aka.ms/m365pnp for the up to date guidance and samples.
This is the main repository for the community driven [Microsoft 365 Patterns and Practices](http://aka.ms/m365pnp) (PnP) initiative. If you are looking for latest news around PnP or related topics, please have a look on our one pager at [http://aka.ms/m365pnp](http://aka.ms/m365pnp).
PnP initiative has numerous GitHub repositories, so that you can more easily find what's relevant for you depending on your interest. Easiest way to follow up on latest changes is our landing page at http://aka.ms/m365pnp.
- [Projects and tools](http://aka.ms/m365pnp)
- [Community blog](http://aka.ms/m365pnp/community/blog)
- [PnP videos](http://aka.ms/m365pnp/videos) at YouTube
## "Sharing is caring"
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
| {
"content_hash": "836937f7ceb58c9bac15ae9d37b26097",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 552,
"avg_line_length": 70.04,
"alnum_prop": 0.7692747001713307,
"repo_name": "OfficeDev/PnP",
"id": "4a31893fd50e35c37ca200f3da795c72fe3126a8",
"size": "1755",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "184077"
},
{
"name": "C#",
"bytes": "4794636"
},
{
"name": "CSS",
"bytes": "812378"
},
{
"name": "Cucumber",
"bytes": "8723"
},
{
"name": "HTML",
"bytes": "264529"
},
{
"name": "JavaScript",
"bytes": "1252081"
},
{
"name": "PowerShell",
"bytes": "33003"
},
{
"name": "TypeScript",
"bytes": "94705"
}
],
"symlink_target": ""
} |
using System;
using System.IO;
namespace NuGet {
internal static class PackageUtility {
internal static bool IsManifest(string path) {
return Path.GetExtension(path).Equals(Constants.ManifestExtension, StringComparison.OrdinalIgnoreCase);
}
}
}
| {
"content_hash": "d7bfadd77cc436ea5593d25eb687d689",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 115,
"avg_line_length": 29.3,
"alnum_prop": 0.6825938566552902,
"repo_name": "grendello/nuget",
"id": "c82bf42896c6b965baff9e1a40c533f9ae4c38ad",
"size": "295",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Tools/NuGet/NuGetPackageExplorer/Core/Utility/PackageUtility.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "27288"
},
{
"name": "C#",
"bytes": "2679355"
},
{
"name": "F#",
"bytes": "359"
},
{
"name": "PowerShell",
"bytes": "118198"
},
{
"name": "Puppet",
"bytes": "835"
}
],
"symlink_target": ""
} |
+function ($) { "use strict";
// TAB CLASS DEFINITION
// ====================
var Tab = function (element) {
this.element = $(element)
}
Tab.prototype.show = function () {
var $this = this.element
var $ul = $this.closest('ul:not(.dropdown-menu)')
var selector = $this.data('target')
if (!selector) {
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
}
if ($this.parent('li').hasClass('active')) return
var previous = $ul.find('.active:last a')[0]
var e = $.Event('show.bs.tab', {
relatedTarget: previous
})
$this.trigger(e)
if (e.isDefaultPrevented()) return
var $target = $(selector)
this.activate($this.parent('li'), $ul)
this.activate($target, $target.parent(), function () {
$this.trigger({
type: 'shown.bs.tab'
, relatedTarget: previous
})
})
}
Tab.prototype.activate = function (element, container, callback) {
var $active = container.find('> .active')
var transition = callback
&& $.support.transition
&& $active.hasClass('fade')
function next() {
$active
.removeClass('active')
.find('> .dropdown-menu > .active')
.removeClass('active')
element.addClass('active')
if (transition) {
element[0].offsetWidth // reflow for transition
element.addClass('in')
} else {
element.removeClass('fade')
}
if (element.parent('.dropdown-menu')) {
element.closest('li.dropdown').addClass('active')
}
callback && callback()
}
transition ?
$active
.one($.support.transition.end, next)
.emulateTransitionEnd(150) :
next()
$active.removeClass('in')
}
// TAB PLUGIN DEFINITION
// =====================
var old = $.fn.tab
$.fn.tab = function ( option ) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.tab')
if (!data) $this.data('bs.tab', (data = new Tab(this)))
if (typeof option == 'string') data[option]()
})
}
$.fn.tab.Constructor = Tab
// TAB NO CONFLICT
// ===============
$.fn.tab.noConflict = function () {
$.fn.tab = old
return this
}
// TAB DATA-API
// ============
$(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
e.preventDefault()
$(this).tab('show')
})
}(jQuery);
| {
"content_hash": "9c01d2620b0225a789d839f6aac28462",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 101,
"avg_line_length": 21.39830508474576,
"alnum_prop": 0.5354455445544555,
"repo_name": "N00bface/Real-Dolmen-Stage-Opdrachten",
"id": "ae1dbd3cec6a39b0ffa2c280314b1802e1291fcb",
"size": "2770",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "stageopdracht/src/main/resources/static/vendors/parsleyjs/bower_components/bootstrap/js/tab.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "212672"
},
{
"name": "HTML",
"bytes": "915596"
},
{
"name": "Java",
"bytes": "78870"
},
{
"name": "JavaScript",
"bytes": "9181"
}
],
"symlink_target": ""
} |
/**
* Created by jayachandranj on 2/14/17.
*/
angular.module('F1FeederApp.services', [])
.factory('ergastAPIservice', function($http) {
var ergastAPI = {};
ergastAPI.getDrivers = function() {
return $http({
method: 'JSONP',
url: 'http://ergast.com/api/f1/2013/driverStandings.json?callback=JSON_CALLBACK'
});
}
ergastAPI.getDriverDetails = function(id) {
return $http({
method: 'JSONP',
url: 'http://ergast.com/api/f1/2013/drivers/'+ id +'/driverStandings.json?callback=JSON_CALLBACK'
});
}
ergastAPI.getDriverRaces = function(id) {
return $http({
method: 'JSONP',
url: 'http://ergast.com/api/f1/2013/drivers/'+ id +'/results.json?callback=JSON_CALLBACK'
});
}
return ergastAPI;
});
| {
"content_hash": "fb7ff48977bba31c977376d86d822434",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 113,
"avg_line_length": 29.09375,
"alnum_prop": 0.518796992481203,
"repo_name": "Jaya83/AngularJS",
"id": "436b805ad89a03845c119f7a8391485bb22981de",
"size": "931",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/js/services.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "306"
},
{
"name": "HTML",
"bytes": "5758"
},
{
"name": "JavaScript",
"bytes": "8308"
}
],
"symlink_target": ""
} |
package com.smartdevicelink.test.rpc.enums;
import com.smartdevicelink.proxy.rpc.enums.AudioType;
import junit.framework.TestCase;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* This is a unit test class for the SmartDeviceLink library project class :
* {@link com.smartdevicelink.proxy.rpc.enums.AudioType}
*/
public class AudioTypeTests extends TestCase {
/**
* Verifies that the enum values are not null upon valid assignment.
*/
public void testValidEnums() {
String example = "PCM";
AudioType enumPcm = AudioType.valueForString(example);
assertNotNull("PCM returned null", enumPcm);
}
/**
* Verifies that an invalid assignment is null.
*/
public void testInvalidEnum() {
String example = "pCM";
try {
AudioType temp = AudioType.valueForString(example);
assertNull("Result of valueForString should be null.", temp);
} catch (IllegalArgumentException exception) {
fail("Invalid enum throws IllegalArgumentException.");
}
}
/**
* Verifies that a null assignment is invalid.
*/
public void testNullEnum() {
String example = null;
try {
AudioType temp = AudioType.valueForString(example);
assertNull("Result of valueForString should be null.", temp);
} catch (NullPointerException exception) {
fail("Null string throws NullPointerException.");
}
}
/**
* Verifies the possible enum values of AudioType.
*/
public void testListEnum() {
List<AudioType> enumValueList = Arrays.asList(AudioType.values());
List<AudioType> enumTestList = new ArrayList<AudioType>();
enumTestList.add(AudioType.PCM);
assertTrue("Enum value list does not match enum class list",
enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList));
}
} | {
"content_hash": "278987ba5ae7ca475e3f8ad5d3755272",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 100,
"avg_line_length": 30.12121212121212,
"alnum_prop": 0.6524144869215291,
"repo_name": "smartdevicelink/sdl_android",
"id": "714265d3a9656e79be7a2cce1bbc26e36c90d424",
"size": "1988",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/AudioTypeTests.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Java",
"bytes": "4666491"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<item>
<version>1.0.0.1</version>
<url></url>
<changelog>https://raw.githubusercontent.com/realGhostGamerE/ExploFinity/master/ChangeLog</changelog>
</item>
| {
"content_hash": "103f8134ea187a8e6712e8c16c61a733",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 101,
"avg_line_length": 32.5,
"alnum_prop": 0.7333333333333333,
"repo_name": "realGhostGamerE/ExploFinity",
"id": "858ea198c85f1dcf9c5f44d5b94e936aa9118a0e",
"size": "195",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Update.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
import { Bounds, Coordinates, RequestOptions } from '../types';
import { arrayToString, boundsToString, coordinatesToString } from '../utils';
import { fetchGet } from '../fetch';
export interface AutosuggestResponse {
suggestions: {
country: string;
nearestPlace: string;
words: string;
distanceToFocusKm: number;
rank: number;
language: string;
}[];
}
export interface AutosuggestOptions {
nResults?: number;
focus?: Coordinates;
nFocusResults?: number;
clipToCountry?: string[];
clipToBoundingBox?: Bounds;
clipToCircle?: { center: Coordinates; radius: number };
clipToPolygon?: number[];
inputType?: 'text' | 'vocon-hybrid' | 'nmdp-asr' | 'generic-voice';
language?: string;
preferLand?: boolean;
}
export function autosuggestOptionsToQuery(options?: AutosuggestOptions): {
[key: string]: string;
} {
const requestOptions: { [key: string]: string } = {};
if (options !== undefined) {
if (options.nResults !== undefined) {
requestOptions['n-results'] = options.nResults.toString();
}
if (options.focus !== undefined) {
requestOptions['focus'] = coordinatesToString(options.focus);
}
if (options.nFocusResults !== undefined) {
requestOptions['n-focus-results'] = options.nFocusResults.toString();
}
if (
options.clipToCountry !== undefined &&
Array.isArray(options.clipToCountry) &&
options.clipToCountry.length > 0
) {
requestOptions['clip-to-country'] = arrayToString(options.clipToCountry);
}
if (options.clipToBoundingBox !== undefined) {
requestOptions['clip-to-bounding-box'] = boundsToString(
options.clipToBoundingBox
);
}
if (options.clipToCircle !== undefined) {
requestOptions['clip-to-circle'] = `${coordinatesToString(
options.clipToCircle.center
)},${options.clipToCircle.radius}`;
}
if (options.clipToPolygon !== undefined) {
requestOptions['clip-to-polygon'] = arrayToString(options.clipToPolygon);
}
if (options.inputType !== undefined) {
requestOptions['input-type'] = options.inputType;
}
if (options.language !== undefined) {
requestOptions['language'] = options.language;
}
if (options.preferLand !== undefined) {
requestOptions['prefer-land'] = options.preferLand.toString();
}
}
return requestOptions;
}
export const autosuggest = (
input: string,
options?: AutosuggestOptions,
signal?: AbortSignal
): Promise<AutosuggestResponse> => {
const requestOptions: RequestOptions = {
input,
...autosuggestOptionsToQuery(options),
};
return fetchGet('autosuggest', requestOptions, signal);
};
| {
"content_hash": "2e30c6b028ab3515ad7de6c23608fc7c",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 79,
"avg_line_length": 32.27710843373494,
"alnum_prop": 0.6700261291526689,
"repo_name": "OpenCageData/js-geo-what3words",
"id": "ea3c51ed387e07488b1e2605d1324aa93c7dd92e",
"size": "2679",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/requests/autosuggest.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "6837"
},
{
"name": "Makefile",
"bytes": "53"
}
],
"symlink_target": ""
} |
require_relative './hw6graphics'
# class responsible for the pieces and their movements
class Piece
# creates a new Piece from the given point array, holding the board for
# determining if movement is possible for the piece, and gives the piece a
# color, rotation, and starting position.
def initialize (point_array, board)
@all_rotations = point_array
@rotation_index = rand(@all_rotations.size)
@color = All_Colors.sample
@base_position = [5, 0] # [column, row]
@board = board
@moved = true
end
def current_rotation
@all_rotations[@rotation_index]
end
def moved
@moved
end
def position
@base_position
end
def color
@color
end
def drop_by_one
@moved = move(0, 1, 0)
end
# takes the intended movement in x, y and rotation and checks to see if the
# movement is possible. If it is, makes this movement and returns true.
# Otherwise returns false.
def move (delta_x, delta_y, delta_rotation)
# Ensures that the rotation will always be a possible formation (as opposed
# to nil) by altering the intended rotation so that it stays
# within the bounds of the rotation array
moved = true
potential = @all_rotations[(@rotation_index + delta_rotation) % @all_rotations.size]
# for each individual block in the piece, checks if the intended move
# will put this block in an occupied space
potential.each{|posns|
if !(@board.empty_at([posns[0] + delta_x + @base_position[0],
posns[1] + delta_y + @base_position[1]]))
moved = false
end
}
if moved
@base_position[0] += delta_x
@base_position[1] += delta_y
@rotation_index = (@rotation_index + delta_rotation) % @all_rotations.size
end
moved
end
# class method to figures out the different rotations of the provided piece
def self.rotations (point_array)
rotate1 = point_array.map {|x,y| [-y,x]}
rotate2 = point_array.map {|x,y| [-x,-y]}
rotate3 = point_array.map {|x,y| [y,-x]}
[point_array, rotate1, rotate2, rotate3]
end
# class method to choose the next piece
def self.next_piece (board)
if board.cheat
board.cheat = false
if board.score >= 100
board.score -= 100
Piece.new([[0, 0]], board)
end
else
Piece.new(All_Pieces.sample, board)
end
end
# class array holding all the pieces and their rotations
All_Pieces = [[[[0, 0], [1, 0], [0, 1], [1, 1]]], # square (only needs one)
rotations([[0, 0], [-1, 0], [1, 0], [0, -1]]), # T
[[[0, 0], [-1, 0], [1, 0], [2, 0]], # long (only needs two)
[[0, 0], [0, -1], [0, 1], [0, 2]]],
rotations([[0, 0], [0, -1], [0, 1], [1, 1]]), # L
rotations([[0, 0], [0, -1], [0, 1], [-1, 1]]), # inverted L
rotations([[0, 0], [-1, 0], [0, -1], [1, -1]]), # S
rotations([[0, 0], [1, 0], [0, -1], [-1, -1]]), # Z
rotations([[0, 0], [1, 0], [0, 1], [1, 1], [2, 1]]),
[[[0, 0], [-1, 0], [-2, 0], [1, 0], [2, 0]], # very long
[[0, 0], [0, -1], [0, -2], [0, 1], [0, 2]]],
rotations([[0, 0], [0, 1], [1, 1]])]
# class array
All_Colors = ['DarkGreen', 'dark blue', 'dark red', 'gold2', 'Purple3',
'OrangeRed2', 'LightSkyBlue']
end
# Class responsible for the interaction between the pieces and the game itself
class Board
attr_accessor :cheat, :score
def initialize (game)
@grid = Array.new(num_rows) {Array.new(num_columns)}
@current_block = Piece.next_piece(self)
@score = 0
@cheat = false
@game = game
@delay = 500
@action = {
:l => [-1, 0, 0],
:r => [1, 0, 0],
:cw => [0, 0, 1],
:ccw => [0, 0, -1]
}
end
# both the length and the width of a block, since it is a square
def block_size
15
end
def num_columns
10
end
def num_rows
27
end
# the current delay
def delay
@delay
end
# the game is over when there is a piece extending into the second row
# from the top
def game_over?
@grid[1].any?
end
# moves the current piece down by one, if this is not possible stores the
# current piece and replaces it with a new one.
def run
ran = @current_block.drop_by_one
if !ran
store_current
if !game_over?
next_piece
end
end
@game.update_score
draw
end
# move piece left or right or turn it clockwise or counter-clockwise
def move (choice)
if !game_over? and @game.is_running?
x, y, rot = @action[choice]
@current_block.move(x, y, rot)
end
draw
end
# drops the piece to the lowest location in the currently occupied columns.
# Then replaces it with a new piece
# Change the score to reflect the distance dropped.
def drop_all_the_way
if @game.is_running?
ran = @current_block.drop_by_one
while ran
@current_pos.each{|block| block.remove}
@score += 1
ran = @current_block.drop_by_one
end
draw
store_current
if !game_over?
next_piece
end
@game.update_score
draw
end
end
# gets the next piece
def next_piece
@current_block = Piece.next_piece(self)
@current_pos = nil
end
# gets the information from the current piece about where it is and uses this
# to store the piece on the board itself. Then calls remove_filled.
def store_current
locations = @current_block.current_rotation
displacement = @current_block.position
(0..locations.length-1).each{|index|
current = locations[index];
@grid[current[1]+displacement[1]][current[0]+displacement[0]] =
@current_pos[index]
}
remove_filled
@delay = [@delay - 2, 80].max
end
# Takes a point and checks to see if it is in the bounds of the board and
# currently empty.
def empty_at (point)
if !(point[0] >= 0 and point[0] < num_columns)
return false
elsif point[1] < 1
return true
elsif point[1] >= num_rows
return false
end
@grid[point[1]][point[0]] == nil
end
# removes all filled rows and replaces them with empty ones, dropping all rows
# above them down each time a row is removed and increasing the score.
def remove_filled
(2..(@grid.size-1)).each{|num| row = @grid.slice(num);
# see if this row is full (has no nil)
if @grid[num].all?
# remove from canvas blocks in full row
(0..(num_columns-1)).each{|index|
@grid[num][index].remove;
@grid[num][index] = nil
}
# move down all rows above and move their blocks on the canvas
((@grid.size - num + 1)..(@grid.size)).each{|num2|
@grid[@grid.size - num2].each{|rect| rect && rect.move(0, block_size)};
@grid[@grid.size-num2+1] = Array.new(@grid[@grid.size - num2])
}
# insert new blank row at top
@grid[0] = Array.new(num_columns);
# adjust score for full flow
@score += 10;
end}
self
end
# current_pos holds the intermediate blocks of a piece before they are placed
# in the grid. If there were any before, they are sent to the piece drawing
# method to be removed and replaced with that of the new position
def draw
@current_pos = @game.draw_piece(@current_block, @current_pos)
end
end
class Tetris
# creates the window and starts the game
def initialize
@root = TetrisRoot.new
@timer = TetrisTimer.new
set_board
@running = true
key_bindings
buttons
run_game
end
# creates a canvas and the board that interacts with it
def set_board
@canvas = TetrisCanvas.new
@board = Board.new(self)
@canvas.place(@board.block_size * @board.num_rows + 3,
@board.block_size * @board.num_columns + 6, 24, 80)
@board.draw
end
def key_bindings
@root.bind('n', proc {self.new_game})
@root.bind('p', proc {self.pause})
@root.bind('q', proc {exitProgram})
@root.bind('c', proc {@board.cheat = true})
@root.bind('a', proc {@board.move(:l)})
@root.bind('Left', proc {@board.move(:l)})
@root.bind('d', proc {@board.move(:r)})
@root.bind('Right', proc {@board.move(:r)})
@root.bind('s', proc {@board.move(:cw)})
@root.bind('Down', proc {@board.move(:cw)})
@root.bind('w', proc {@board.move(:ccw)})
@root.bind('Up', proc {@board.move(:ccw)})
@root.bind('u', proc {@board.move(:cw); @board.move(:cw)})
@root.bind('space' , proc {@board.drop_all_the_way})
end
def buttons
pause = TetrisButton.new('pause', 'lightcoral'){self.pause}
pause.place(35, 50, 90, 7)
new_game = TetrisButton.new('new game', 'lightcoral'){self.new_game}
new_game.place(35, 75, 15, 7)
quit = TetrisButton.new('quit', 'lightcoral'){exitProgram}
quit.place(35, 50, 140, 7)
move_left = TetrisButton.new('left', 'lightgreen'){@board.move(:l)}
move_left.place(35, 50, 27, 536)
move_right = TetrisButton.new('right', 'lightgreen'){@board.move(:r)}
move_right.place(35, 50, 127, 536)
rotate_clock = TetrisButton.new('^_)', 'lightgreen'){@board.move(:cw)}
rotate_clock.place(35, 50, 77, 501)
rotate_counter = TetrisButton.new('(_^', 'lightgreen'){
@board.move(:ccw)}
rotate_counter.place(35, 50, 77, 571)
drop = TetrisButton.new('drop', 'lightgreen'){@board.drop_all_the_way}
drop.place(35, 50, 77, 536)
label = TetrisLabel.new(@root) do
text 'Current Score: '
background 'lightblue'
end
label.place(35, 100, 26, 45)
@score = TetrisLabel.new(@root) do
background 'lightblue'
end
@score.text(@board.score)
@score.place(35, 50, 126, 45)
end
# starts the game over, replacing the old board and score
def new_game
@canvas.unplace
@canvas.delete
set_board
@score.text(@board.score)
@running = true
run_game
end
# pauses the game or resumes it
def pause
if @running
@running = false
@timer.stop
else
@running = true
self.run_game
end
end
# alters the displayed score to reflect what is currently stored in the board
def update_score
@score.text(@board.score)
end
# repeatedly calls itself so that the process is fully automated. Checks if
# the game is over and if it isn't, calls the board's run method which moves
# a piece down and replaces it with a new one when the old one can't move any
# more
def run_game
if !@board.game_over? and @running
@timer.stop
@timer.start(@board.delay, (proc{@board.run; run_game}))
end
end
# whether the game is running
def is_running?
@running
end
# takes a piece and optionally the list of old TetrisRects corresponding
# to it and returns a new set of TetrisRects which are how the piece is
# visible to the user.
def draw_piece (piece, old=nil)
if old != nil and piece.moved
old.each{|block| block.remove}
end
size = @board.block_size
blocks = piece.current_rotation
start = piece.position
blocks.map{|block|
TetrisRect.new(@canvas, start[0]*size + block[0]*size + 3,
start[1]*size + block[1]*size,
start[0]*size + size + block[0]*size + 3,
start[1]*size + size + block[1]*size,
piece.color)}
end
end
# To help each game of Tetris be unique.
srand
| {
"content_hash": "c5bedbfe9144559d325723677578fdad",
"timestamp": "",
"source": "github",
"line_count": 405,
"max_line_length": 88,
"avg_line_length": 29.580246913580247,
"alnum_prop": 0.5737061769616026,
"repo_name": "ltongues/programming-languages-coursera",
"id": "9a1885ca7016f00b98eb1511e9b4db5045646354",
"size": "12059",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "hw6provided.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Racket",
"bytes": "18710"
},
{
"name": "Ruby",
"bytes": "16412"
},
{
"name": "Standard ML",
"bytes": "22599"
}
],
"symlink_target": ""
} |
// Type: Highsoft.Web.Mvc.Charts.PlotOptionsBoxplotStatesHover
using System.Collections;
using Newtonsoft.Json;
namespace Highsoft.Web.Mvc.Charts
{
public class PlotOptionsBoxplotStatesHover : BaseObject
{
public PlotOptionsBoxplotStatesHover()
{
this.Animation = this.Animation_DefaultValue = new Animation()
{
Enabled = true
};
bool? nullable1 = new bool?(true);
this.Enabled_DefaultValue = nullable1;
this.Enabled = nullable1;
this.Halo = this.Halo_DefaultValue = new PlotOptionsBoxplotStatesHoverHalo();
double? nullable2 = new double?(2.0);
this.LineWidth_DefaultValue = nullable2;
this.LineWidth = nullable2;
nullable2 = new double?(1.0);
this.LineWidthPlus_DefaultValue = nullable2;
this.LineWidthPlus = nullable2;
}
public Animation Animation { get; set; }
private Animation Animation_DefaultValue { get; set; }
public bool? Enabled { get; set; }
private bool? Enabled_DefaultValue { get; set; }
public PlotOptionsBoxplotStatesHoverHalo Halo { get; set; }
private PlotOptionsBoxplotStatesHoverHalo Halo_DefaultValue { get; set; }
public double? LineWidth { get; set; }
private double? LineWidth_DefaultValue { get; set; }
public double? LineWidthPlus { get; set; }
private double? LineWidthPlus_DefaultValue { get; set; }
internal override Hashtable ToHashtable()
{
Hashtable hashtable = new Hashtable();
if (this.Animation.IsDirty())
hashtable.Add((object) "animation", (object) this.Animation.ToJSON());
bool? enabled = this.Enabled;
bool? enabledDefaultValue = this.Enabled_DefaultValue;
if (enabled.GetValueOrDefault() != enabledDefaultValue.GetValueOrDefault() ||
enabled.HasValue != enabledDefaultValue.HasValue)
hashtable.Add((object) "enabled", (object) this.Enabled);
if (this.Halo.IsDirty())
hashtable.Add((object) "halo", (object) this.Halo.ToHashtable());
double? nullable1 = this.LineWidth;
double? nullable2 = this.LineWidth_DefaultValue;
if (nullable1.GetValueOrDefault() != nullable2.GetValueOrDefault() ||
nullable1.HasValue != nullable2.HasValue)
hashtable.Add((object) "lineWidth", (object) this.LineWidth);
nullable2 = this.LineWidthPlus;
nullable1 = this.LineWidthPlus_DefaultValue;
if (nullable2.GetValueOrDefault() != nullable1.GetValueOrDefault() ||
nullable2.HasValue != nullable1.HasValue)
hashtable.Add((object) "lineWidthPlus", (object) this.LineWidthPlus);
return hashtable;
}
internal override string ToJSON()
{
Hashtable hashtable = this.ToHashtable();
if (hashtable.Count > 0)
return JsonConvert.SerializeObject((object) this.ToHashtable());
return "";
}
internal override bool IsDirty()
{
return this.ToHashtable().Count > 0;
}
}
} | {
"content_hash": "91913c85868a40a3c021e623cf9cdf4d",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 89,
"avg_line_length": 37.06741573033708,
"alnum_prop": 0.603819339193695,
"repo_name": "pmrozek/highcharts",
"id": "091760192af0b0aa07225707fe8db3c17e51525e",
"size": "3301",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Highsoft.Web.Mvc/src/Highsoft.Web.Mvc/Charts/PlotOptionsBoxplotStatesHover.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "6702932"
}
],
"symlink_target": ""
} |
// Copyright 2022 Google LLC
//
// 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
//
// https://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.
// Generated by the Codegen C++ plugin.
// If you make any local changes, they will be lost.
// source: google/cloud/notebooks/v1/managed_service.proto
#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_MANAGED_NOTEBOOK_OPTIONS_H
#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_MANAGED_NOTEBOOK_OPTIONS_H
#include "google/cloud/notebooks/managed_notebook_connection.h"
#include "google/cloud/notebooks/managed_notebook_connection_idempotency_policy.h"
#include "google/cloud/backoff_policy.h"
#include "google/cloud/options.h"
#include "google/cloud/version.h"
#include <memory>
namespace google {
namespace cloud {
namespace notebooks {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
/**
* Use with `google::cloud::Options` to configure the retry policy.
*
* @ingroup google-cloud-notebooks-options
*/
struct ManagedNotebookServiceRetryPolicyOption {
using Type = std::shared_ptr<ManagedNotebookServiceRetryPolicy>;
};
/**
* Use with `google::cloud::Options` to configure the backoff policy.
*
* @ingroup google-cloud-notebooks-options
*/
struct ManagedNotebookServiceBackoffPolicyOption {
using Type = std::shared_ptr<BackoffPolicy>;
};
/**
* Use with `google::cloud::Options` to configure which operations are retried.
*
* @ingroup google-cloud-notebooks-options
*/
struct ManagedNotebookServiceConnectionIdempotencyPolicyOption {
using Type =
std::shared_ptr<ManagedNotebookServiceConnectionIdempotencyPolicy>;
};
/**
* Use with `google::cloud::Options` to configure the long-running operations
* polling policy.
*
* @ingroup google-cloud-notebooks-options
*/
struct ManagedNotebookServicePollingPolicyOption {
using Type = std::shared_ptr<PollingPolicy>;
};
/**
* The options applicable to ManagedNotebookService.
*
* @ingroup google-cloud-notebooks-options
*/
using ManagedNotebookServicePolicyOptionList =
OptionList<ManagedNotebookServiceRetryPolicyOption,
ManagedNotebookServiceBackoffPolicyOption,
ManagedNotebookServicePollingPolicyOption,
ManagedNotebookServiceConnectionIdempotencyPolicyOption>;
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
} // namespace notebooks
} // namespace cloud
} // namespace google
#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_NOTEBOOKS_MANAGED_NOTEBOOK_OPTIONS_H
| {
"content_hash": "26d1e923910694aaec979b5f68eee4ae",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 82,
"avg_line_length": 32.61363636363637,
"alnum_prop": 0.7634146341463415,
"repo_name": "googleapis/google-cloud-cpp",
"id": "8381397b89c42ad91e5e3f511294c6ba9ea5da18",
"size": "2870",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "google/cloud/notebooks/managed_notebook_options.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Awk",
"bytes": "2387"
},
{
"name": "Batchfile",
"bytes": "3052"
},
{
"name": "C",
"bytes": "21004"
},
{
"name": "C++",
"bytes": "41174129"
},
{
"name": "CMake",
"bytes": "1350320"
},
{
"name": "Dockerfile",
"bytes": "111570"
},
{
"name": "Makefile",
"bytes": "138270"
},
{
"name": "PowerShell",
"bytes": "41266"
},
{
"name": "Python",
"bytes": "21338"
},
{
"name": "Shell",
"bytes": "249894"
},
{
"name": "Starlark",
"bytes": "722015"
}
],
"symlink_target": ""
} |
__pragma(warning(push)); \
__pragma(warning(disable \
: x))
#define DISABLE_WARNING_POP __pragma(warning(pop))
#define ATL_ADD_LIBRARY(x) __pragma(comment(lib, x))
#define _WIN32_WINNT 0x0600 // minimum Windows Vista
#include <sdkddkver.h>
#define _ATL_APARTMENT_THREADED
#define _ATL_NO_AUTOMATIC_NAMESPACE
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS
#define ATL_NO_ASSERT_ON_DESTROY_NONEXISTENT_WINDOW
#define _CRT_SECURE_NO_WARNINGS 1
#include <atlbase.h>
#if (_ATL_VER < 0x0700) // linking with system (WDK) atl.dll
extern ATL::CComModule& _Module;
ATL_ADD_LIBRARY("atlthunk.lib")
#endif
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <time.h>
#include <math.h>
#include <tchar.h>
#include <imagehlp.h>
#include <mmsystem.h>
#include <ddraw.h>
// MClib
#ifdef _DEBUG
// _ARMOR;USE_PROTOTYPES;STRICT;WIN32;_DEBUG;_WINDOWS;VIEWER
#define _ARMOR 1
#define LAB_ONLY 1
#else
// VIEWER;WIN32;NDEBUG;_WINDOWS
#endif
#ifndef VIEWER
#define VIEWER 1
#endif
namespace Utilities
{
// HRESULT WINAPI FormatCLSID(_Out_writes_(nCharacters) PWCHAR pszCLSID,_In_
// size_t nCharacters,_In_ REFGUID clsid); HRESULT WINAPI
// PrivateUpdateRegistry(_In_ BOOL bRegister,_In_ UINT nID,_In_ REFGUID
// clsid,_In_ REFGUID libid,_In_opt_ ULONG dwOleMisc,_In_opt_
// ATL::_ATL_REGMAP_ENTRY* pregMap);
// ModuleHelper - helper functions for ATL3 and ATL7 module classes (modified
// from WTL)
namespace ModuleHelper
{
inline HINSTANCE
GetModuleInstance(void)
{
#if (_ATL_VER >= 0x0700)
return ATL::_AtlBaseModule.GetModuleInstance();
#else
return ATL::_pModule->GetModuleInstance();
#endif
}
inline HINSTANCE
GetResourceInstance(void)
{
#if (_ATL_VER >= 0x0700)
return ATL::_AtlBaseModule.GetResourceInstance();
#else
return ATL::_pModule->GetResourceInstance();
#endif
}
inline HINSTANCE
SetResourceInstance(_In_ HINSTANCE hInstance)
{
#if (_ATL_VER >= 0x0700)
return ATL::_AtlBaseModule.SetResourceInstance(hInstance);
#else
return ATL::_pModule->SetResourceInstance(hInstance);
#endif
}
inline void
AddCreateWndData(_Inout_ ATL::_AtlCreateWndData* pData, _In_ void* pObject)
{
#if (_ATL_VER >= 0x0700)
ATL::_AtlWinModule.AddCreateWndData(pData, pObject);
#else
ATL::_pModule->AddCreateWndData(pData, pObject);
#endif
}
inline void*
ExtractCreateWndData(void)
{
#if (_ATL_VER >= 0x0700)
return ATL::_AtlWinModule.ExtractCreateWndData();
#else
return ATL::_pModule->ExtractCreateWndData();
#endif
}
inline void
AtlTerminate(void)
{
#if (_ATL_VER >= 0x0700)
return ATL::_AtlWinModule.Term();
#else
return ATL::_pModule->Term();
#endif
}
#if (_ATL_VER >= 0x0700)
inline ATL::CAtlModule*
GetModulePtr(void)
{
return ATL::_pAtlModule;
}
#else
inline ATL::CComModule*
GetModulePtr(void)
{
return ATL::_pModule;
}
#endif
inline bool
AtlInitFailed(void)
{
#if (_ATL_VER >= 0x0700)
return ATL::CAtlBaseModule::m_bInitFailed;
#else
return ATL::_bInitFailed;
#endif
}
inline void
AtlSetTraceLevel(_In_ UINT nLevel)
{
#if defined _DEBUG && (_ATL_VER >= 0x0700)
ATL::CTrace::SetLevel(nLevel);
#else
UNREFERENCED_PARAMETER(nLevel);
#endif
}
}; // namespace ModuleHelper
}; // namespace Utilities
using namespace Utilities;
#ifndef _CONSIDERED_OBSOLETE
#define _CONSIDERED_OBSOLETE 0
#endif
#ifndef _CONSIDERED_UNSUPPORTED
#define _CONSIDERED_UNSUPPORTED 0
#endif
#ifndef _CONSIDERED_DISABLED
#define _CONSIDERED_DISABLED 0
#endif
//#ifdef _MSC_VER
//#pragma comment(linker,"/manifestdependency:\"type='win32'
// name='Microsoft.Windows.Common-Controls' version='6.0.0.0'
// processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
//#endif
| {
"content_hash": "3f08653a3a51d4b98e9c06fcc7f78042",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 79,
"avg_line_length": 21.040697674418606,
"alnum_prop": 0.7325227963525835,
"repo_name": "mechasource/mechcommander2",
"id": "138efb73c133d2255885220962bc3be21a9b2385",
"size": "3863",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "source/tools/viewer/stdafx.h",
"mode": "33261",
"license": "bsd-2-clause",
"language": [
{
"name": "Batchfile",
"bytes": "4848"
},
{
"name": "C",
"bytes": "499088"
},
{
"name": "C++",
"bytes": "12057913"
},
{
"name": "CMake",
"bytes": "37250"
},
{
"name": "Objective-C",
"bytes": "7354"
},
{
"name": "PHP",
"bytes": "7506"
},
{
"name": "Rich Text Format",
"bytes": "22446"
},
{
"name": "Shell",
"bytes": "853"
}
],
"symlink_target": ""
} |
extern crate amqp;
extern crate env_logger;
use amqp::{Session, Options, Table, Basic, protocol, Channel};
use amqp::protocol::basic;
use std::default::Default;
fn consumer_function(channel: &mut Channel, deliver: protocol::basic::Deliver, headers: protocol::basic::BasicProperties, body: Vec<u8>){
println!("[function] Got a delivery:");
println!("[function] Deliver info: {:?}", deliver);
println!("[function] Content headers: {:?}", headers);
println!("[function] Content body: {:?}", body);
println!("[function] Content body(as string): {:?}", String::from_utf8(body));
channel.basic_ack(deliver.delivery_tag, false).unwrap();
}
struct MyConsumer {
deliveries_number: u64
}
impl amqp::Consumer for MyConsumer {
fn handle_delivery(&mut self, channel: &mut Channel, deliver: protocol::basic::Deliver, headers: protocol::basic::BasicProperties, body: Vec<u8>){
println!("[struct] Got a delivery # {}", self.deliveries_number);
println!("[struct] Deliver info: {:?}", deliver);
println!("[struct] Content headers: {:?}", headers);
println!("[struct] Content body: {:?}", body);
println!("[struct] Content body(as string): {:?}", String::from_utf8(body));
// DO SOME JOB:
self.deliveries_number += 1;
channel.basic_ack(deliver.delivery_tag, false).unwrap();
}
}
fn main() {
env_logger::init().unwrap();
let mut session = Session::new(Options{ vhost: "/".to_string(), .. Default::default()}).ok().expect("Can't create session");
let mut channel = session.open_channel(1).ok().expect("Error openning channel 1");
println!("Openned channel: {:?}", channel.id);
let queue_name = "test_queue";
//queue: &str, passive: bool, durable: bool, exclusive: bool, auto_delete: bool, nowait: bool, arguments: Table
let queue_declare = channel.queue_declare(queue_name, false, true, false, false, false, Table::new());
println!("Queue declare: {:?}", queue_declare);
channel.basic_prefetch(10).ok().expect("Failed to prefetch");
//consumer, queue: &str, consumer_tag: &str, no_local: bool, no_ack: bool, exclusive: bool, nowait: bool, arguments: Table
println!("Declaring consumers...");
let consumer_name = channel.basic_consume(consumer_function, queue_name, "", false, false, false, false, Table::new());
println!("Starting consumer {:?}", consumer_name);
let my_consumer = MyConsumer { deliveries_number: 0 };
let consumer_name = channel.basic_consume(my_consumer, queue_name, "", false, false, false, false, Table::new());
println!("Starting consumer {:?}", consumer_name);
let mut delivery_log = vec![];
let closure_consumer = move |_chan: &mut Channel, deliver: basic::Deliver, headers: basic::BasicProperties, data: Vec<u8>|
{
println!("[closure] Deliver info: {:?}", deliver);
println!("[closure] Content headers: {:?}", headers);
println!("[closure] Content body: {:?}", data);
delivery_log.push(deliver);
};
let consumer_name = channel.basic_consume(closure_consumer, queue_name, "", false, false, false, false, Table::new());
println!("Starting consumer {:?}", consumer_name);
channel.start_consuming();
channel.close(200, "Bye").unwrap();
session.close(200, "Good Bye");
}
| {
"content_hash": "78fdc64593b09ab5897927e305dc3c76",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 150,
"avg_line_length": 46.67605633802817,
"alnum_prop": 0.6472540736270368,
"repo_name": "Ryanl92/rust-amqp",
"id": "d708ba89ad96b7306719a5fa396e2c4e8a68b2d2",
"size": "3314",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "examples/consumer.rs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Rust",
"bytes": "44468"
}
],
"symlink_target": ""
} |
from typing import Dict, List, Tuple, TYPE_CHECKING
import cirq
if TYPE_CHECKING:
import cirq_google
EDGE = Tuple[cirq.GridQubit, cirq.GridQubit]
def above(qubit: cirq.GridQubit) -> cirq.GridQubit:
"""Gives qubit with one unit less on the second coordinate.
Args:
qubit: Reference qubit.
Returns:
New translated qubit.
"""
return cirq.GridQubit(qubit.row, qubit.col - 1)
def left_of(qubit: cirq.GridQubit) -> cirq.GridQubit:
"""Gives qubit with one unit less on the first coordinate.
Args:
qubit: Reference qubit.
Returns:
New translated qubit.
"""
return cirq.GridQubit(qubit.row - 1, qubit.col)
def below(qubit: cirq.GridQubit) -> cirq.GridQubit:
"""Gives qubit with one unit more on the second coordinate.
Args:
qubit: Reference qubit.
Returns:
New translated qubit.
"""
return cirq.GridQubit(qubit.row, qubit.col + 1)
def right_of(qubit: cirq.GridQubit) -> cirq.GridQubit:
"""Gives node with one unit more on the first coordinate.
Args:
qubit: Reference node.
Returns:
New translated node.
"""
return cirq.GridQubit(qubit.row + 1, qubit.col)
def chip_as_adjacency_list(
device: 'cirq_google.GridDevice',
) -> Dict[cirq.GridQubit, List[cirq.GridQubit]]:
"""Gives adjacency list representation of a chip.
The adjacency list is constructed in order of above, left_of, below and
right_of consecutively.
Args:
device: Chip to be converted.
Returns:
Map from nodes to list of qubits which represent all the neighbours of
given qubit.
"""
c_set = device.metadata.qubit_set
c_adj: Dict[cirq.GridQubit, List[cirq.GridQubit]] = {}
for n in c_set:
c_adj[n] = []
for m in [above(n), left_of(n), below(n), right_of(n)]:
if m in c_set:
c_adj[n].append(m)
return c_adj
| {
"content_hash": "a694fd13858b3f58d5b6a229871072f6",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 78,
"avg_line_length": 23.695121951219512,
"alnum_prop": 0.6345856922285126,
"repo_name": "quantumlib/Cirq",
"id": "90d8755ff213d0a32454ec01f8b3977775c20d97",
"size": "2528",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "cirq-google/cirq_google/line/placement/chip.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "4616"
},
{
"name": "HTML",
"bytes": "262"
},
{
"name": "JavaScript",
"bytes": "660"
},
{
"name": "Jupyter Notebook",
"bytes": "672675"
},
{
"name": "Makefile",
"bytes": "634"
},
{
"name": "Python",
"bytes": "8643017"
},
{
"name": "Scilab",
"bytes": "735"
},
{
"name": "Shell",
"bytes": "64230"
},
{
"name": "TypeScript",
"bytes": "91766"
}
],
"symlink_target": ""
} |
This addon provides a component for changing the title of the page you're on.
### Installing via ember-cli
If inside an ember-cli project, you can install the component as an addon:
```bash
ember install:addon ember-document-title
```
### Usage
To start, let's add a root title for your application. This goes in `application.hbs`.
```handlebars
{{#document-title}}My App{{/document-title}}
```
This sets the title for your application. When your application loads, you should see the title `My App` appear. If you would like a block-less version of this component, it's available by setting the title property:
```handlebars
{{document-title title="My App"}}
```
By default, using the component will allow an interaction where additional titles are appended to the root:

You can change the separator by specifying the `separator` attribute.

Separators can be changed at arbitrary levels:

Titles can be prepended to the parent, by setting the `prepend` attribute to `true`.

This allows one to swap the order at arbitrary levels:

And for special templates that need to complete control over the title, set the `replace` attribute to `true`. This will only apply for that level.

In addition, there's no limit to the amount of titles you can put in a route:

### API
| attribute | type | default |
|-----------|:--------|:--------|
| separator | string | `" | "` |
| prepend | boolean | false |
| replace | boolean | false |
| {
"content_hash": "c764b706e39e2f4950a8a67c4a61c4ab",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 216,
"avg_line_length": 28.683333333333334,
"alnum_prop": 0.7234166182452063,
"repo_name": "knownasilya/ember-document-title",
"id": "1350da67aa523b54d85e5371d972f5a8790e8baf",
"size": "2169",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "31"
},
{
"name": "HTML",
"bytes": "1574"
},
{
"name": "Handlebars",
"bytes": "801"
},
{
"name": "JavaScript",
"bytes": "14005"
}
],
"symlink_target": ""
} |
<?php
namespace App\Base\Models;
use Illuminate\Database\Eloquent\Model;
class Attachment extends Model
{
}
| {
"content_hash": "738f1f9466b7d868fbb3aa3b1914ae28",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 39,
"avg_line_length": 12.333333333333334,
"alnum_prop": 0.7747747747747747,
"repo_name": "iluminar/goodwork",
"id": "e6a307c5412c24b3959951eeb7bd6de9a6ea77a8",
"size": "111",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/Base/Models/Attachment.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "2133"
},
{
"name": "HTML",
"bytes": "13010"
},
{
"name": "JavaScript",
"bytes": "42172"
},
{
"name": "PHP",
"bytes": "1108328"
},
{
"name": "Shell",
"bytes": "3791"
},
{
"name": "Vue",
"bytes": "290009"
}
],
"symlink_target": ""
} |
<?php
/**
* Contains the Property meta class.
*
* @author Lukas Rezek <lukas@miratronix.com>
* @license MIT
* @filesource
* @version GIT: $Id$
*/
namespace LRezek\Arachnid\Meta;
use LRezek\Arachnid\Exception;
/**
* Defines meta for a Property.
*
* This is a meta class that defines the meta for a Property. It does NOT contain actual property values, just a list of
* property types (AUTO, PROPERTY, INDEX, START, END), the format of the property and the name of it. Properties are
* constructed with an AnnotationReader, so that they can read what sort of property they should act as.
*
* @package Arachnid
* @subpackage Meta
*/
class Property
{
const ANNOTATION_NAMESPACE = 'LRezek\\Arachnid\\Annotation';
const AUTO = 'LRezek\\Arachnid\\Annotation\\Auto';
const PROPERTY = 'LRezek\\Arachnid\\Annotation\\Property';
const INDEX = 'LRezek\\Arachnid\\Annotation\\Index';
//Relation types
const START = 'LRezek\\Arachnid\\Annotation\\Start';
const END = 'LRezek\\Arachnid\\Annotation\\End';
/** @var \Doctrine\Common\Annotations\AnnotationReader The annotation reader to use.*/
private $reader;
/** @var \ReflectionProperty Reflection Property object.*/
private $property;
/** @var string The name of the property.*/
private $name;
/** @var string The format of the property. */
private $format = 'scalar';
/** @var array The annotations attached ot the property. */
private $annotations = array();
/**
* Constructor. Saves the annotation reader and the actual property.
*
* @param \Doctrine\Common\Annotations\AnnotationReader $reader Annotation reader to use.
* @param \ReflectionProperty $property A reflection property from the entity class.
*/
function __construct($reader, $property)
{
//Take the reader
$this->reader = $reader;
//Take the reflection property
$this->property = $property;
//Get the reflection properties name, after normalizing
$this->name = Reflection::normalizeProperty($property->getName());
//Save the properties annotations.
$this->annotations = $this->reader->getPropertyAnnotations($this->property);
//Validate annotations
$this->validateAnnotations();
//Make the property accessible if it is private
$property->setAccessible(true);
}
/**
* Checks if this property is a primary key.
*
* @return bool
*/
function isPrimaryKey()
{
return $this->getAnnotationIndex(self::AUTO) >= 0;
}
/**
* Checks if this property is a start node.
*
* @return bool
*/
function isStart()
{
return $this->getAnnotationIndex(self::START) >= 0;
}
/**
* Checks if this property is a end node.
*
* @return bool
*/
function isEnd()
{
return $this->getAnnotationIndex(self::END) >= 0;
}
/**
* Checks if this property is indeed a property.
*
* @return bool
*/
function isProperty()
{
//Get the annotation index
$i = $this->getAnnotationIndex(self::PROPERTY);
//If the property annotation is on here
if($i >= 0)
{
//Set the format (Date, JSON, scalar, etc)
$this->format = $this->annotations[$i]->format;
//This is a property
return true;
}
else
{
//Not a property
return false;
}
}
/**
* Checks if this property is indexed.
*
* @return bool
*/
function isIndexed()
{
return $this->getAnnotationIndex(self::INDEX) >= 0;
}
/**
* Checks if this property is private.
*
* @return bool
*/
function isPrivate()
{
return $this->property->isPrivate();
}
/**
* Gets this property's value in the given entity.
*
* @param Relation|Node $entity The entity to get the value from.
* @return mixed The property value.
*/
function getValue($entity)
{
$raw = $this->property->getValue($entity);
switch ($this->format)
{
case 'scalar':
return $raw;
//Serialize classes and arrays before putting them in the DB
case 'object':
case 'array':
return serialize($raw);
//Json encode before putting into DB
case 'json':
return json_encode($raw);
//Format the date correctly before putting in DB
case 'date':
if ($raw)
{
$value = clone $raw;
$value->setTimezone(new \DateTimeZone('UTC'));
return $value->format('Y-m-d H:i:s');
}
else
{
return null;
}
}
return null;
}
/**
* Sets this property's value in the given entity.
*
* @param Relation|Node $entity The entity to set the property of.
* @param mixed $value The value to set it to.
*/
function setValue($entity, $value)
{
switch ($this->format)
{
case 'scalar':
$this->property->setValue($entity, $value);
break;
//Unserialize classes and arrays before putting them back in the entity.
case 'object':
case 'array':
$this->property->setValue($entity, unserialize($value));
break;
//Decode Json from DB back into a regular assoc array before putting it into the entity.
case 'json':
$this->property->setValue($entity, json_decode($value, true));
break;
//Create a date time object out of the db stored date before putting it into the entity.
case 'date':
$date = null;
if ($value) {
$date = new \DateTime($value . ' UTC');
$date->setTimezone(new \DateTimeZone(date_default_timezone_get()));
}
$this->property->setValue($entity, $date);
break;
}
}
/**
* Get the property's name.
*
* @return string The property's name.
*/
function getName()
{
return $this->name;
}
/**
* Checks if a supplied name matches this property's name.
*
* @param mixed $names List of names to check.
* @return bool
*/
function matches($names)
{
//Check every argument supplied
foreach (func_get_args() as $name)
{
//Check for any possible match
if (
0 === strcasecmp($name, $this->name) ||
0 === strcasecmp($name, $this->property->getName()) ||
0 === strcasecmp($name, Reflection::normalizeProperty($this->property->getName()))
)
{
return true;
}
}
return false;
}
/**
* Returns the format of the property.
*
* @return string
*/
public function getFormat()
{
return $this->format;
}
/**
* Validates the annotation combination on a property.
*
* @throws Exception If the combination is invalid in some way.
*/
private function validateAnnotations()
{
//Count annotations in the annotation namespace, ignore annotations not in our namespace
$count = 0;
foreach($this->annotations as $a)
{
//If you find the namespace in the class name, add to count
if(strrpos(get_class($a), self::ANNOTATION_NAMESPACE) !== false)
{
$count++;
}
}
switch($count)
{
//0 annotations, just ignore
case 0:
return;
//1 Annotation, it can't be index.
case 1:
if($this->getAnnotationIndex(self::INDEX) < 0)
{
//It's not index, return.
return;
}
throw new Exception("@Index cannot be the only annotation on {$this->name} in {$this->property->getDeclaringClass()->getName()}.");
//2 Annotations, they have to be index and property.
case 2:
if( ($this->getAnnotationIndex(self::PROPERTY) >= 0) && ($this->getAnnotationIndex(self::INDEX) >= 0))
{
//They are index and property, return
return;
}
break;
}
//It didn't fall into any of the categories, must be invalid
throw new Exception("Invalid annotation combination on {$this->name} in {$this->property->getDeclaringClass()->getName()}.");
}
/**
* Gets the index of a annotation with the value specified, or -1 if it's not in the annotations array.
*
* @param String $name The annotation class.
* @return int The index of the annotation in the annotations array().
*/
private function getAnnotationIndex($name)
{
for($i = 0; $i < count($this->annotations); $i++)
{
if($this->annotations[$i] instanceof $name)
{
return $i;
}
}
return -1;
}
}
| {
"content_hash": "346ad8164303cf63a1ede91618347eea",
"timestamp": "",
"source": "github",
"line_count": 351,
"max_line_length": 147,
"avg_line_length": 27.085470085470085,
"alnum_prop": 0.5365520143052488,
"repo_name": "lrezek/Arachnid",
"id": "cb2571120a96ec488ca80983ebd38b78e7bfefaa",
"size": "9507",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/LRezek/Arachnid/Meta/Property.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "253839"
}
],
"symlink_target": ""
} |
package gov.nist;
import java.io.File;
import io.proleap.cobol.preprocessor.CobolPreprocessor.CobolSourceFormatEnum;
import io.proleap.cobol.runner.CobolParseTestRunner;
import io.proleap.cobol.runner.impl.CobolParseTestRunnerImpl;
import org.junit.Test;
public class IX119ATest {
@Test
public void test() throws Exception {
final File inputFile = new File("src/test/resources/gov/nist/IX119A.CBL");
final CobolParseTestRunner runner = new CobolParseTestRunnerImpl();
runner.parseFile(inputFile, CobolSourceFormatEnum.FIXED);
}
} | {
"content_hash": "f892d9f61033e103d38ccf53a5210b1e",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 77,
"avg_line_length": 30.11111111111111,
"alnum_prop": 0.8062730627306273,
"repo_name": "uwol/cobol85parser",
"id": "43a000db508db5941607eaea7e4ab36927440c33",
"size": "542",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/test/java/gov/nist/IX119ATest.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ANTLR",
"bytes": "89712"
},
{
"name": "COBOL",
"bytes": "28337364"
},
{
"name": "Java",
"bytes": "2908548"
}
],
"symlink_target": ""
} |
<header>Cluster Firewall Servers</header>
Met deze pagina kunt u uw firewall configuratie in 1 keer naar diverse andere
systemen tegelijk invoeren, zodat u een cluster met firewall systemen vanaf een enkel
systeem kunt beheren.
Voordat een server kan worden toegevoegd aan deze pagina moet u controleren dat die
minimaal de Webmin versie 1.170 of nieuwer geïnstalleerd heeft en is toegevoegd aan
de "Webmin Servers Index" module. Op dit systeem moet ook de noodzakelijke <tt>iptables</tt>
programma's geïnstalleerd zijn en op de juiste manier geconfigureerd zijn. <p>
<hr>
| {
"content_hash": "446caad1202b8a88affbaef4550dbcfc",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 92,
"avg_line_length": 49.166666666666664,
"alnum_prop": 0.7898305084745763,
"repo_name": "xtso520ok/webmin",
"id": "9c176b6935f2ad23fa5bacfa9ce2d51c7a73aa3b",
"size": "594",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "firewall/help/cluster.nl.UTF-8.html",
"mode": "33261",
"license": "bsd-3-clause",
"language": [
{
"name": "AGS Script",
"bytes": "1320"
},
{
"name": "C",
"bytes": "17338"
},
{
"name": "CSS",
"bytes": "53609"
},
{
"name": "Emacs Lisp",
"bytes": "8933"
},
{
"name": "Erlang",
"bytes": "16977"
},
{
"name": "Frege",
"bytes": "39901"
},
{
"name": "Groovy",
"bytes": "678"
},
{
"name": "Java",
"bytes": "270046"
},
{
"name": "JavaScript",
"bytes": "7342598"
},
{
"name": "PHP",
"bytes": "78912"
},
{
"name": "Perl",
"bytes": "17754783"
},
{
"name": "Prolog",
"bytes": "1906042"
},
{
"name": "Python",
"bytes": "312240"
},
{
"name": "R",
"bytes": "34817"
},
{
"name": "Ruby",
"bytes": "104377"
},
{
"name": "Scala",
"bytes": "542"
},
{
"name": "Shell",
"bytes": "764630"
},
{
"name": "SystemVerilog",
"bytes": "17137"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">API Demos</string>
<string name="sign_up_already_login">You are currently logged in, register will cause login as another user.</string>
<string name="sign_up_desc">Kii Cloud allows users to register with username, email and phone number. You need to fill in at least one of them.</string>
<string name="sign_up_howto_enable_verification">Read below link to enable email or phone verification.\r\nhttp://documentation.kii.com/en/guides/android/managing-users/sign-up/</string>
<string name="username">Username</string>
<string name="email">Email</string>
<string name="phone">Phone</string>
<string name="optional">Optional</string>
<string name="phone_hint">Optional, without country code</string>
<string name="password">Password</string>
<string name="password_hint">At least 6 letters</string>
<string name="register">Register</string>
<string name="username_invalid">Username is not valid</string>
<string name="email_invalid">Email is not valid</string>
<string name="phone_invalid">Phone is not valid</string>
<string name="password_invalid">Password is not valid</string>
<string name="reg_at_least_one">You need to fill in at least one of username, email or phone to create an account.</string>
<string name="registering">Registering</string>
<string name="in_progressing">In progressing…</string>
<string name="verifying_code">Verifying code…</string>
<string name="refreshing_status">Refreshing status…</string>
<string name="refresh_status">Refresh status</string>
<string name="verify_phone">Verify phone when you got sms</string>
<string name="email_verified">Email is verified</string>
<string name="phone_verified">Phone is verified</string>
<string name="email_not_verified">Email is not verified</string>
<string name="phone_not_verified">Phone is not verified</string>
<string name="score">Score</string>
<string name="app_version">AppVersion</string>
<string name="level">Level</string>
<string name="save">Save</string>
<string name="need_to_login_first">You need to sign in or sign up first to try this</string>
<string name="logout">Logout</string>
<string name="delete">Delete</string>
<string name="flex_analytics_des">This is utility for fill-in data for testing. Please refer to http://documentation.kii.com/en/guides/android/managing-analytics/flex-analytics/analyze-application-data/ for how to use flex analytics.</string>
<string name="current_user">Current user: %s</string>
<string name="gender">Gender</string>
<string name="age">Age</string>
<string name="login_with_token">Login with token</string>
<string name="login_with_username">Login with username or email</string>
<string name="login_with_phone">Login with phone</string>
<string name="ua_email_phone">Username or email or phone</string>
<string name="login">Login</string>
<string name="no_token">There is no token saved</string>
<string name="token_label">Token: %s</string>
<string name="sign_in_already_login">You are currently logged in, sign in again will cause login as another user.</string>
<string name="login_succ">Login successfully</string>
<string name="login_failed">Login failed</string>
<string name="not_login">Not login yet</string>
<string name="enter_new_password">Enter new password</string>
<string name="current_password">Enter current password</string>
<string name="change_password">Change password</string>
<string name="change_pwd_succ">Change password successfully</string>
<string name="change_pwd_failed">Change password failed</string>
<string name="action_settings">Settings</string>
<string name="title_activity_file_storage">File Storage</string>
<string name="title_activity_downloading_files">Downloading Files</string>
<string name="title_activity_file_browser">File Browser</string>
<string name="title_activity_publishing_files">Pbulishing Files</string>
<string name="title_activity_uploading_files">Uploading Files</string>
<string name="title_activity_syncing_folder">Syncing Folder</string>
<string name="start_syncing">Start syncing</string>
<string name="changing_sync_folder">Changing sync folder</string>
<string name="uploading_a_file_with_resumable_transfer">Uploading a file with resumable transfer</string>
<string name="resuming_a_suspended_upload">Resuming a suspended upload</string>
<string name="manually_suspending_a_file_upload">Manually suspending a file upload</string>
<string name="manually_terminating_a_file_upload">Manually terminating a file upload</string>
<string name="publishing_files">Publishing files</string>
<string name="downloading_a_file_with_resumable_transfer">Downloading a file with resumable transfer</string>
<string name="resuming_a_suspended_download">Resuming a suspended download</string>
<string name="manually_suspending_a_file_download">Manually suspending a file download</string>
<string name="manually_terminating_a_file_download">Manually terminating a file download</string>
<string name="title">Title</string>
<string name="add">Add</string>
<string name="file_browser">File broswer</string>
<string name="go">Go</string>
<string name="url">URL</string>
<string name="expiration_time">Expiration time(Minutes):</string>
<string name="default_expiration_time">10</string>
<string name="current_path">Current path:</string>
<string name="back">Back</string>
<string name="ok">OK</string>
<string name="select_folder">Select folder</string>
<string name="sync_folder">Sync folder:</string>
<string name="current_folder">Current folder</string>
<string name="sync">Sync</string>
<string name="reset">Reset</string>
<string name="enter_user_name">Enter user name</string>
<string name="enter_password">Enter password</string>
<string name="invalid_folder">Invalid folder!</string>
<string name="files_in_cloud">Files in cloud:</string>
<string name="size">Size</string>
<string name="downloading_files">Downloading files:</string>
<string name="status">Status:</string>
<string name="suspended">Suspended</string>
<string name="error">Error</string>
<string name="downloading">Downloading</string>
<string name="finished">Finished</string>
<string name="delete_failed">Delete failed</string>
<string name="suspend_failed">Suspend failed</string>
<string name="default_title">default</string>
<string name="add_downloader_failed">Add downloader failed</string>
<string name="common_yes">Yes</string>
<string name="common_no">No</string>
<string name="ask_resume">Would you like to resume it?</string>
<string name="ask_suspend">Would you like to suspend it?</string>
<string name="ask_download">Would you like to download it?</string>
<string name="ask_delete">Would you like to delete it?</string>
<string name="load_downloader_failed">Load downloader failed</string>
<string name="load_kiifile_failed">Load KiiFile failed</string>
<string name="download_failed">Download failed</string>
<string name="ask_publish_file">Would you like to publish this file?</string>
<string name="publish_failed">Publish failed</string>
<string name="publish_succ">Publish successfully</string>
<string name="open_url_failed">Open URL failed</string>
<string name="create_uploader_failed">Create uploader failed</string>
<string name="file_does_not_exist">File does not exist</string>
<string name="load_uploaders_failed">Load uploaders failed</string>
<string name="delete_uploader_failed">Delete uploader failed</string>
<string name="uploading">Uploading</string>
<string name="Sync_folder_succ">Sync folder successfully</string>
<string name="Sync_folder_failed">Sync folder failed</string>
<string name="reset_succ">Reset successfully</string>
<string name="reset_failed">Reset failed</string>
<string name="save_folder">Save folder:</string>
<string name="simple_sign_up_in_title">Simple sign up and sign in</string>
<string name="sign_up">Sign Up</string>
<string name="sign_in">Sign In</string>
<string name="user_attributes">User attributes</string>
<string name="retrie_other_user">Retrieving data from other users</string>
<string name="logout_delete_title">Logout or delete user</string>
<string name="add_geopoint">Add POI</string>
<string name="query_pois_by_geodistance">Query POIs by GeoDistance</string>
<string name="query_pois_by_geobox">Query POIs by Geobox</string>
<string name="noteslist_title">Notes</string>
<string name="new_note">New</string>
<string name="refresh_note">Refresh</string>
<string name="latitude">Latitude</string>
<string name="longitude">Longitude</string>
<string name="update_image">Update Image</string>
<string name="delete_image">Delete Image</string>
<string name="download_image">Download Image</string>
<string name="upload_image">Upload Image</string>
<string name="menu_showcode">Code</string>
<string name="showcode_title">Code for %s</string>
<string name="login_with_facebook_account">Login with Facebook Account</string>
<string name="linking_a_kii_account_to_a_facebook_account">Linking a Kii Account to a Facebook Account</string>
<string name="unlinking_a_kii_account_from_a_facebook_account">Unlinking a Kii Account from a Facebook Account</string>
<string name="login_with_twitter_account">Login with Twitter Account</string>
<string name="linking_a_kii_account_to_a_twitter_account">Linking a Kii Account to a Twitter Account</string>
<string name="unlinking_a_kii_account_from_a_twitter_account">Unlinking a Kii Account from a Twitter Account</string>
<string name="social_network_integration_title">Social network integration</string>
<string name="link_succ">Link successfully</string>
<string name="link_failed">Link failed</string>
<string name="unlink_succ">Unlink successfully</string>
<string name="unlink_failed">Unlink failed</string>
<string name="home_title">Home</string>
<string name="notepad_title">Notepad</string>
<string name="reg_phone_hint">Phone (Optional)</string>
<string name="reg_password_hint">Password (At least 6 letters)</string>
</resources> | {
"content_hash": "4793b1201ea0c2e197e86166fa3be4fd",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 246,
"avg_line_length": 64.01829268292683,
"alnum_prop": 0.7232117344509,
"repo_name": "firstfan/KiiDemo_Notepad",
"id": "615069de6fac9a142503c2f6281c343de0e4f03e",
"size": "10505",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "res/values/strings.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "38619"
}
],
"symlink_target": ""
} |
//
// BBCell.h
// CircleView
//
// Created by Bharath Booshan on 6/8/12.
// Copyright (c) 2012 Bharath Booshan Inc. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
@interface BBCell : UITableViewCell
{
UILabel *mCellTtleLabel;
CALayer *mImageLayer;
}
-(void)setCellTitle:(NSString*)title;
-(void)setIcon:(UIImage*)image;
@end
| {
"content_hash": "e0733f080644d21df05a0275ec59ddb9",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 64,
"avg_line_length": 16.434782608695652,
"alnum_prop": 0.6931216931216931,
"repo_name": "bharath2020/UITableViewTricks",
"id": "7ab437794834755380d784dec972637edb57568b",
"size": "1607",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "CircleView/BBTableView/BBCell/BBCell.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "29576"
}
],
"symlink_target": ""
} |
package org.jetbrains.plugins.scala.worksheet.settings
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.extensions.ExtensionPointName
import com.intellij.psi.PsiFile
import org.jetbrains.plugins.scala.lang.psi.api.ScalaFile
import org.jetbrains.plugins.scala.worksheet.cell.{CellDescriptor, RunCellAction}
import org.jetbrains.plugins.scala.worksheet.processor.WorksheetCompilerUtil._
import org.jetbrains.plugins.scala.worksheet.processor.WorksheetSourceProcessor
import org.jetbrains.plugins.scala.worksheet.ui._
/**
* User: Dmitry.Naydanov
* Date: 13.07.18.
*/
abstract class WorksheetExternalRunType {
def getName: String
def isReplRunType: Boolean
def isUsesCell: Boolean
def createPrinter(editor: Editor, file: ScalaFile): WorksheetEditorPrinter
def showAdditionalSettingsPanel(): PsiFile => Unit = null
def process(srcFile: ScalaFile, ifEditor: Option[Editor]): WorksheetCompileRunRequest = RunSimple(
WorksheetSourceProcessor.processSimple(srcFile, ifEditor)
)
def process(srcFile: ScalaFile, editor: Editor): WorksheetCompileRunRequest =
process(srcFile, Option(editor))
def createRunCellAction(cellDescriptor: CellDescriptor): AnAction = null
def onSettingsConfirmed(file: PsiFile): Unit = {}
override def toString: String = getName
}
object RunTypes {
private val PREDEFINED_TYPES = Array(PlainRunType, ReplRunType, ReplCellRunType)
private val PREDEFINED_TYPES_MAP = PREDEFINED_TYPES.map(rt => (rt.getName, rt)).toMap
val EP_NAME: ExtensionPointName[WorksheetExternalRunType] =
ExtensionPointName.create[WorksheetExternalRunType]("org.intellij.scala.worksheetExternalRunType")
private def findEPRunTypes(): Array[WorksheetExternalRunType] = EP_NAME.getExtensions
def findRunTypeByName(name: String): Option[WorksheetExternalRunType] =
PREDEFINED_TYPES_MAP.get(name).orElse(findEPRunTypes().find(_.getName == name))
def getDefaultRunType: WorksheetExternalRunType = ReplRunType
def getAllRunTypes: Array[WorksheetExternalRunType] = PREDEFINED_TYPES ++ findEPRunTypes()
object PlainRunType extends WorksheetExternalRunType {
override def getName: String = "Plain"
override def isReplRunType: Boolean = false
override def isUsesCell: Boolean = false
override def createPrinter(editor: Editor, file: ScalaFile): WorksheetEditorPrinter =
WorksheetEditorPrinterFactory.getDefaultUiFor(editor, file)
override def process(srcFile: ScalaFile, ifEditor: Option[Editor]): WorksheetCompileRunRequest =
WorksheetSourceProcessor.processDefault(srcFile, ifEditor.map(_.getDocument)) match {
case Left((code, className)) => RunCompile(code, className)
case Right(errorElement) => ErrorWhileCompile(errorElement, ifEditor)
}
}
object ReplRunType extends WorksheetExternalRunType {
override def getName: String = "REPL"
override def isReplRunType: Boolean = true
override def isUsesCell: Boolean = false
override def createPrinter(editor: Editor, file: ScalaFile): WorksheetEditorPrinter =
WorksheetEditorPrinterFactory.getIncrementalUiFor(editor, file)
override def process(srcFile: ScalaFile, ifEditor: Option[Editor]): WorksheetCompileRunRequest =
WorksheetSourceProcessor.processIncremental(srcFile, ifEditor) match {
case Left((code, _)) => RunRepl(code)
case Right(errorElement) => ErrorWhileCompile(errorElement, ifEditor)
}
}
object ReplCellRunType extends WorksheetExternalRunType {
override def getName: String = "REPL with Cells"
override def isReplRunType: Boolean = true
override def isUsesCell: Boolean = true
override def createPrinter(editor: Editor, file: ScalaFile): WorksheetEditorPrinter =
WorksheetEditorPrinterFactory.getConsoleUiFor(editor, file)
override def createRunCellAction(cellDescriptor: CellDescriptor): AnAction = new RunCellAction(cellDescriptor)
}
}
| {
"content_hash": "d5eb93467f36e6f3efe7c98c34d5eb93",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 114,
"avg_line_length": 38.43269230769231,
"alnum_prop": 0.7755816862646985,
"repo_name": "jastice/intellij-scala",
"id": "be9a9084bcb53e7e5f81db40fe00f24229497d13",
"size": "3997",
"binary": false,
"copies": "1",
"ref": "refs/heads/travis",
"path": "scala/scala-impl/src/org/jetbrains/plugins/scala/worksheet/settings/WorksheetExternalRunType.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "57114"
},
{
"name": "Java",
"bytes": "1431473"
},
{
"name": "Lex",
"bytes": "35728"
},
{
"name": "Python",
"bytes": "8254"
},
{
"name": "Scala",
"bytes": "12225520"
},
{
"name": "Shell",
"bytes": "2411"
}
],
"symlink_target": ""
} |
Change Log
==========
## Version 2.0.1
* Removed unused code related to WebView
## Version 2.0.0
* Replaced WebView usage with Custom Tabs since Google and Facebook Login no longer support WebViews for authenticating users.
* Removed AuthorizationClient#clearCookies method from the API. Custom Tabs use the cookies from the browser.
* Bumped targetSdkVersion to 31
## Version 1.2.6
* Fixes an issue related to package visibility changes in API 30
## Version 1.2.5
* Updated targetSdkVersion (API 30), buildTools and Gradle plugin
* Removed unused jcenter repository
* Conform to package visibility restrictions when targeting Android 11 (API 30)
## Version 1.2.3
* Fixed a few issues with the webview based redirect
## Version 1.2.2
* Remove custom-tabs handling due to issues
## Version 1.2.1
* Fixes an issue that produced a redirect error when the redirect uri contains CAPS.
## Version 1.2.0
* Breaking changes: Rename classes from AuthenticationClassName to AuthorizationClassName
* Pass state parameter in AuthorizationResponse
2019-08-12
* Add method to clear Spotify and Facebook cookies to AuthenticationClient
* Upgrade buildToolsVersion to 27.0.3
* Replace deprecated compile keyword in gradle files
## Version 1.1.0
_2018-02-28_
* Upgrade target and compile SDKs to 27
* Upgrade android support libraries to 27.0.2
| {
"content_hash": "0518e0b380afe740da59f50275137901",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 126,
"avg_line_length": 30.5,
"alnum_prop": 0.7749627421758569,
"repo_name": "spotify/android-sdk",
"id": "0e6581f0e52c42759a3cf9843a450b4005c21dc5",
"size": "1342",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "auth-lib/CHANGELOG.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "35113"
},
{
"name": "HTML",
"bytes": "1705906"
},
{
"name": "Java",
"bytes": "36892"
},
{
"name": "JavaScript",
"bytes": "20166"
},
{
"name": "Kotlin",
"bytes": "31286"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ramsey: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.5.2~camlp4 / ramsey - 8.7.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
ramsey
<small>
8.7.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-11-08 00:01:27 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-11-08 00:01:27 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-threads base
base-unix base
camlp4 4.03+1 Camlp4 is a system for writing extensible parsers for programming languages
conf-findutils 1 Virtual package relying on findutils
conf-which 1 Virtual package relying on which
coq 8.5.2~camlp4 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.03.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.03.0 Official 4.03.0 release
ocaml-config 1 OCaml Switch Configuration
ocamlbuild 0.14.2 OCamlbuild is a build system with builtin rules to easily build most OCaml projects
# opam file:
opam-version: "2.0"
maintainer: "Hugo.Herbelin@inria.fr"
homepage: "https://github.com/coq-contribs/ramsey"
license: "LGPL 2.1"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/Ramsey"]
depends: [
"ocaml"
"coq" {>= "8.7" & < "8.8~"}
]
tags: [
"keyword: dimension one Ramsey theorem"
"keyword: constructive mathematics"
"keyword: almost full sets"
"category: Mathematics/Logic"
"category: Mathematics/Combinatorics and Graph Theory"
"category: Miscellaneous/Extracted Programs/Combinatorics"
]
authors: [ "Marc Bezem" ]
bug-reports: "https://github.com/coq-contribs/ramsey/issues"
dev-repo: "git+https://github.com/coq-contribs/ramsey.git"
synopsis: "Ramsey Theory"
description: """
For dimension one, the Infinite Ramsey Theorem states that, for any
subset A of the natural numbers nat, either A or nat\\A is
infinite. This special case of the Pigeon Hole Principle is
classically equivalent to: if A and B are both co-finite, then so is
their intersection. None of these principles is constructively
valid. In [VB] the notion of an almost full set is introduced,
classically equivalent to co-finiteness, for which closure under
finite intersection can be proved constructively. A is almost full if
for every (strictly) increasing sequence f: nat -> nat there exists an
x in nat such that f(x) in A. The notion of almost full and its
closure under finite intersection are generalized to all finite
dimensions, yielding constructive Ramsey Theorems. The proofs for
dimension two and higher essentially use Brouwer's Bar Theorem.
In the proof development below we strengthen the notion of almost full
for dimension one in the following sense. A: nat -> Prop is called
Y-full if for every (strictly) increasing sequence f: nat -> nat we
have (A (f (Y f))). Here of course Y : (nat -> nat) -> nat. Given
YA-full A and YB-full B we construct X from YA and YB such that the
intersection of A and B is X-full. This is essentially [VB, Th. 5.4],
but now it can be done without using axioms, using only inductive
types. The generalization to higher dimensions will be much more
difficult and is not pursued here."""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/ramsey/archive/v8.7.0.tar.gz"
checksum: "md5=2dae4557a10bb6ab518e14e2cc8e7b8e"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-ramsey.8.7.0 coq.8.5.2~camlp4</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.5.2~camlp4).
The following dependencies couldn't be met:
- coq-ramsey -> coq >= 8.7 -> ocaml >= 4.05.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-ramsey.8.7.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "8bd287de2d345b9c9cc89c8dacec822e",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 159,
"avg_line_length": 44.21649484536083,
"alnum_prop": 0.5855677314059221,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "68182790935edab7df3cc8da5b5e5737d280fc4a",
"size": "8603",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.03.0-2.0.5/released/8.5.2~camlp4/ramsey/8.7.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
Cu.import("resource://gre/modules/PlacesUtils.jsm");
Cu.import("resource://gre/modules/Log.jsm");
Cu.import("resource://services-sync/engines.js");
Cu.import("resource://services-sync/engines/bookmarks.js");
Cu.import("resource://services-sync/service.js");
Cu.import("resource://services-sync/util.js");
Cu.import("resource://testing-common/services/sync/utils.js");
const SMART_BOOKMARKS_ANNO = "Places/SmartBookmark";
var IOService = Cc["@mozilla.org/network/io-service;1"]
.getService(Ci.nsIIOService);
("http://www.mozilla.com", null, null);
Service.engineManager.register(BookmarksEngine);
let engine = Service.engineManager.get("bookmarks");
let store = engine._store;
// Clean up after other tests. Only necessary in XULRunner.
store.wipe();
function newSmartBookmark(parent, uri, position, title, queryID) {
let id = PlacesUtils.bookmarks.insertBookmark(parent, uri, position, title);
PlacesUtils.annotations.setItemAnnotation(id, SMART_BOOKMARKS_ANNO,
queryID, 0,
PlacesUtils.annotations.EXPIRE_NEVER);
return id;
}
function smartBookmarkCount() {
// We do it this way because PlacesUtils.annotations.getItemsWithAnnotation
// doesn't work the same (or at all?) between 3.6 and 4.0.
let out = {};
PlacesUtils.annotations.getItemsWithAnnotation(SMART_BOOKMARKS_ANNO, out);
return out.value;
}
function clearBookmarks() {
_("Cleaning up existing items.");
PlacesUtils.bookmarks.removeFolderChildren(PlacesUtils.bookmarks.bookmarksMenuFolder);
PlacesUtils.bookmarks.removeFolderChildren(PlacesUtils.bookmarks.tagsFolder);
PlacesUtils.bookmarks.removeFolderChildren(PlacesUtils.bookmarks.toolbarFolder);
PlacesUtils.bookmarks.removeFolderChildren(PlacesUtils.bookmarks.unfiledBookmarksFolder);
startCount = smartBookmarkCount();
}
function serverForFoo(engine) {
return serverForUsers({"foo": "password"}, {
meta: {global: {engines: {bookmarks: {version: engine.version,
syncID: engine.syncID}}}},
bookmarks: {}
});
}
// Verify that Places smart bookmarks have their annotation uploaded and
// handled locally.
add_test(function test_annotation_uploaded() {
let server = serverForFoo(engine);
new SyncTestingInfrastructure(server.server);
let startCount = smartBookmarkCount();
_("Start count is " + startCount);
if (startCount > 0) {
// This can happen in XULRunner.
clearBookmarks();
_("Start count is now " + startCount);
}
_("Create a smart bookmark in the toolbar.");
let parent = PlacesUtils.toolbarFolderId;
let uri =
Utils.makeURI("place:sort=" +
Ci.nsINavHistoryQueryOptions.SORT_BY_VISITCOUNT_DESCENDING +
"&maxResults=10");
let title = "Most Visited";
let mostVisitedID = newSmartBookmark(parent, uri, -1, title, "MostVisited");
_("New item ID: " + mostVisitedID);
do_check_true(!!mostVisitedID);
let annoValue = PlacesUtils.annotations.getItemAnnotation(mostVisitedID,
SMART_BOOKMARKS_ANNO);
_("Anno: " + annoValue);
do_check_eq("MostVisited", annoValue);
let guid = store.GUIDForId(mostVisitedID);
_("GUID: " + guid);
do_check_true(!!guid);
_("Create record object and verify that it's sane.");
let record = store.createRecord(guid);
do_check_true(record instanceof Bookmark);
do_check_true(record instanceof BookmarkQuery);
do_check_eq(record.bmkUri, uri.spec);
_("Make sure the new record carries with it the annotation.");
do_check_eq("MostVisited", record.queryId);
_("Our count has increased since we started.");
do_check_eq(smartBookmarkCount(), startCount + 1);
_("Sync record to the server.");
let collection = server.user("foo").collection("bookmarks");
try {
engine.sync();
let wbos = collection.keys(function (id) {
return ["menu", "toolbar", "mobile"].indexOf(id) == -1;
});
do_check_eq(wbos.length, 1);
_("Verify that the server WBO has the annotation.");
let serverGUID = wbos[0];
do_check_eq(serverGUID, guid);
let serverWBO = collection.wbo(serverGUID);
do_check_true(!!serverWBO);
let body = JSON.parse(JSON.parse(serverWBO.payload).ciphertext);
do_check_eq(body.queryId, "MostVisited");
_("We still have the right count.");
do_check_eq(smartBookmarkCount(), startCount + 1);
_("Clear local records; now we can't find it.");
// "Clear" by changing attributes: if we delete it, apparently it sticks
// around as a deleted record...
PlacesUtils.bookmarks.setItemTitle(mostVisitedID, "Not Most Visited");
PlacesUtils.bookmarks.changeBookmarkURI(
mostVisitedID, Utils.makeURI("http://something/else"));
PlacesUtils.annotations.removeItemAnnotation(mostVisitedID,
SMART_BOOKMARKS_ANNO);
store.wipe();
engine.resetClient();
do_check_eq(smartBookmarkCount(), startCount);
_("Sync. Verify that the downloaded record carries the annotation.");
engine.sync();
_("Verify that the Places DB now has an annotated bookmark.");
_("Our count has increased again.");
do_check_eq(smartBookmarkCount(), startCount + 1);
_("Find by GUID and verify that it's annotated.");
let newID = store.idForGUID(serverGUID);
let newAnnoValue = PlacesUtils.annotations.getItemAnnotation(
newID, SMART_BOOKMARKS_ANNO);
do_check_eq(newAnnoValue, "MostVisited");
do_check_eq(PlacesUtils.bookmarks.getBookmarkURI(newID).spec, uri.spec);
_("Test updating.");
let newRecord = store.createRecord(serverGUID);
do_check_eq(newRecord.queryId, newAnnoValue);
newRecord.queryId = "LeastVisited";
store.update(newRecord);
do_check_eq("LeastVisited", PlacesUtils.annotations.getItemAnnotation(
newID, SMART_BOOKMARKS_ANNO));
} finally {
// Clean up.
store.wipe();
Svc.Prefs.resetBranch("");
Service.recordManager.clearCache();
server.stop(run_next_test);
}
});
add_test(function test_smart_bookmarks_duped() {
let server = serverForFoo(engine);
new SyncTestingInfrastructure(server.server);
let parent = PlacesUtils.toolbarFolderId;
let uri =
Utils.makeURI("place:sort=" +
Ci.nsINavHistoryQueryOptions.SORT_BY_VISITCOUNT_DESCENDING +
"&maxResults=10");
let title = "Most Visited";
let mostVisitedID = newSmartBookmark(parent, uri, -1, title, "MostVisited");
let mostVisitedGUID = store.GUIDForId(mostVisitedID);
let record = store.createRecord(mostVisitedGUID);
_("Prepare sync.");
let collection = server.user("foo").collection("bookmarks");
try {
engine._syncStartup();
_("Verify that mapDupe uses the anno, discovering a dupe regardless of URI.");
do_check_eq(mostVisitedGUID, engine._mapDupe(record));
record.bmkUri = "http://foo/";
do_check_eq(mostVisitedGUID, engine._mapDupe(record));
do_check_neq(PlacesUtils.bookmarks.getBookmarkURI(mostVisitedID).spec,
record.bmkUri);
_("Verify that different annos don't dupe.");
let other = new BookmarkQuery("bookmarks", "abcdefabcdef");
other.queryId = "LeastVisited";
other.parentName = "Bookmarks Toolbar";
other.bmkUri = "place:foo";
other.title = "";
do_check_eq(undefined, engine._findDupe(other));
_("Handle records without a queryId entry.");
record.bmkUri = uri;
delete record.queryId;
do_check_eq(mostVisitedGUID, engine._mapDupe(record));
engine._syncFinish();
} finally {
// Clean up.
store.wipe();
server.stop(do_test_finished);
Svc.Prefs.resetBranch("");
Service.recordManager.clearCache();
}
});
function run_test() {
initTestLogging("Trace");
Log.repository.getLogger("Sync.Engine.Bookmarks").level = Log.Level.Trace;
generateNewKeys(Service.collectionKeys);
run_next_test();
}
| {
"content_hash": "a85cfa605ce05674186d9ce09b8fa9d7",
"timestamp": "",
"source": "github",
"line_count": 234,
"max_line_length": 91,
"avg_line_length": 34.098290598290596,
"alnum_prop": 0.6780298282992856,
"repo_name": "GaloisInc/hacrypto",
"id": "4e9b2834dd0ae092af542a1589c03516af84809d",
"size": "8086",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Javascript/Mozilla/old_snapshots/sync/tests/unit/test_bookmark_smart_bookmarks.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "AGS Script",
"bytes": "62991"
},
{
"name": "Ada",
"bytes": "443"
},
{
"name": "AppleScript",
"bytes": "4518"
},
{
"name": "Assembly",
"bytes": "25398957"
},
{
"name": "Awk",
"bytes": "36188"
},
{
"name": "Batchfile",
"bytes": "530568"
},
{
"name": "C",
"bytes": "344517599"
},
{
"name": "C#",
"bytes": "7553169"
},
{
"name": "C++",
"bytes": "36635617"
},
{
"name": "CMake",
"bytes": "213895"
},
{
"name": "CSS",
"bytes": "139462"
},
{
"name": "Coq",
"bytes": "320964"
},
{
"name": "Cuda",
"bytes": "103316"
},
{
"name": "DIGITAL Command Language",
"bytes": "1545539"
},
{
"name": "DTrace",
"bytes": "33228"
},
{
"name": "Emacs Lisp",
"bytes": "22827"
},
{
"name": "GDB",
"bytes": "93449"
},
{
"name": "Gnuplot",
"bytes": "7195"
},
{
"name": "Go",
"bytes": "393057"
},
{
"name": "HTML",
"bytes": "41466430"
},
{
"name": "Hack",
"bytes": "22842"
},
{
"name": "Haskell",
"bytes": "64053"
},
{
"name": "IDL",
"bytes": "3205"
},
{
"name": "Java",
"bytes": "49060925"
},
{
"name": "JavaScript",
"bytes": "3476841"
},
{
"name": "Jolie",
"bytes": "412"
},
{
"name": "Lex",
"bytes": "26290"
},
{
"name": "Logos",
"bytes": "108920"
},
{
"name": "Lua",
"bytes": "427"
},
{
"name": "M4",
"bytes": "2508986"
},
{
"name": "Makefile",
"bytes": "29393197"
},
{
"name": "Mathematica",
"bytes": "48978"
},
{
"name": "Mercury",
"bytes": "2053"
},
{
"name": "Module Management System",
"bytes": "1313"
},
{
"name": "NSIS",
"bytes": "19051"
},
{
"name": "OCaml",
"bytes": "981255"
},
{
"name": "Objective-C",
"bytes": "4099236"
},
{
"name": "Objective-C++",
"bytes": "243505"
},
{
"name": "PHP",
"bytes": "22677635"
},
{
"name": "Pascal",
"bytes": "99565"
},
{
"name": "Perl",
"bytes": "35079773"
},
{
"name": "Prolog",
"bytes": "350124"
},
{
"name": "Python",
"bytes": "1242241"
},
{
"name": "Rebol",
"bytes": "106436"
},
{
"name": "Roff",
"bytes": "16457446"
},
{
"name": "Ruby",
"bytes": "49694"
},
{
"name": "Scheme",
"bytes": "138999"
},
{
"name": "Shell",
"bytes": "10192290"
},
{
"name": "Smalltalk",
"bytes": "22630"
},
{
"name": "Smarty",
"bytes": "51246"
},
{
"name": "SourcePawn",
"bytes": "542790"
},
{
"name": "SystemVerilog",
"bytes": "95379"
},
{
"name": "Tcl",
"bytes": "35696"
},
{
"name": "TeX",
"bytes": "2351627"
},
{
"name": "Verilog",
"bytes": "91541"
},
{
"name": "Visual Basic",
"bytes": "88541"
},
{
"name": "XS",
"bytes": "38300"
},
{
"name": "Yacc",
"bytes": "132970"
},
{
"name": "eC",
"bytes": "33673"
},
{
"name": "q",
"bytes": "145272"
},
{
"name": "sed",
"bytes": "1196"
}
],
"symlink_target": ""
} |
require 'rails_helper'
RSpec.describe GoalsController, type: :controller do
let(:user) { create(:user) }
let(:current_user) { user }
before do
allow(controller).to receive(:current_user).and_return(current_user)
end
describe '#create' do
let(:project) { create(:project, user_id: current_user.id) }
let(:goal) { build(:goal, project: project) }
context 'with valid attributes' do
it 'creates a new goal' do
expect {
post :create, format: :json, project_id: goal.project_id, goal: goal.attributes.compact
}.to change(Goal, :count).by(1)
end
end
end
end
| {
"content_hash": "b0a92b3a359fce4a59b0c393c06ac3ab",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 97,
"avg_line_length": 27.217391304347824,
"alnum_prop": 0.6437699680511182,
"repo_name": "catarse/catarse",
"id": "1d44ff05f7ba7097d564bd210ab44f77705cc187",
"size": "674",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "spec/controllers/goals_controller_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "176958"
},
{
"name": "Dockerfile",
"bytes": "3702"
},
{
"name": "HTML",
"bytes": "257435"
},
{
"name": "JavaScript",
"bytes": "70834"
},
{
"name": "Ruby",
"bytes": "2888978"
},
{
"name": "Shell",
"bytes": "757"
}
],
"symlink_target": ""
} |
<?php
namespace ChrisNoden\Facebook\Exception;
/**
* Class DuplicateObjectException
* Thrown if the object already exists in the target collection or array
*
* @category Graph\Exception
* @package facebook-graph
* @author Chris Noden <chris.noden@gmail.com>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @link https://github.com/chrisnoden/synergy
*/
class DuplicateObjectException extends InvalidArgumentException
{
}
| {
"content_hash": "bc26d41667b9e51d0efbcffc7919af6d",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 83,
"avg_line_length": 25.157894736842106,
"alnum_prop": 0.7510460251046025,
"repo_name": "chrisnoden/facebook-utils",
"id": "1d7bc80ebb802154fcd853e9f3b2a0a6054f27be",
"size": "1369",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/ChrisNoden/Facebook/Exception/DuplicateObjectException.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "PHP",
"bytes": "148265"
}
],
"symlink_target": ""
} |
CREATE OR REPLACE FUNCTION "_central"."site__init_schema"()
RETURNS TRIGGER
LANGUAGE plpgsql
AS $$
DECLARE
"v_site_id" INTEGER;
BEGIN
SELECT "id"
INTO "v_site_id"
FROM "_central"."site"
WHERE "schema" = (
SELECT "value"
FROM "_central"."settings"
WHERE "key" = 'site.createSchema.siteCreatorSiteSchema'
LIMIT 1
);
-- insert developer(s)
INSERT INTO "_central"."user_x_site"
( "userId",
"siteId",
"displayName",
"passwordHash",
"state",
"confirmed",
"original",
"groupId",
"locale" )
SELECT "userId",
NEW."id" AS "siteId",
"displayName",
"passwordHash",
'active' AS "state",
TRUE AS "confirmed",
FALSE AS "original",
1 AS "groupId", -- developer
"locale"
FROM "_central"."user_x_site"
WHERE "siteId" = "v_site_id"
AND "groupId" = 1;
-- insert site-owner
INSERT INTO "_central"."user_x_site"
( "userId",
"siteId",
"displayName",
"passwordHash",
"state",
"confirmed",
"original",
"groupId",
"locale" )
SELECT "userId",
NEW."id" AS "siteId",
"displayName",
"passwordHash",
'active' AS "state",
TRUE AS "confirmed",
TRUE AS "original",
2 AS "groupId", -- site-owner
"locale"
FROM "_central"."user_x_site"
WHERE "siteId" = "v_site_id"
AND "userId" = NEW."ownerId"
AND "groupId" <> 1
LIMIT 1;
-- every auto-generated user will be unified
INSERT INTO "_central"."user_unified"
SELECT "siteId",
"userId"
FROM "_central"."user_x_site"
WHERE "siteId" = NEW."id";
RETURN NEW;
END $$;
--------------------------------------------------------------------------------
-- function: user__insert_data_to_site --
--------------------------------------------------------------------------------
CREATE OR REPLACE FUNCTION "_central"."user__insert_data_to_site"()
RETURNS TRIGGER
LANGUAGE plpgsql
AS $$
DECLARE
"v_schema" CHARACTER VARYING;
"v_not_exists" BOOLEAN;
BEGIN
SELECT "schema"
INTO "v_schema"
FROM "_central"."site"
WHERE "site"."id" = NEW."siteId";
EXECUTE format(
'SELECT COUNT( * ) = 0
FROM %I."user"
WHERE "id" = $1',
"v_schema"
)
INTO "v_not_exists"
USING NEW."userId";
IF "v_not_exists" THEN
EXECUTE format(
'INSERT INTO %I."user" ( "id", "email", "displayName",
"passwordHash", "state",
"confirmed", "groupId", "locale" )
VALUES ( $1, ( SELECT "user"."email"
FROM "_central"."user"
WHERE "user"."id" = $1 ),
$2, $3, $4, $5, $6, $7 )',
"v_schema"
)
USING NEW."userId",
NEW."displayName",
NEW."passwordHash",
NEW."state",
NEW."confirmed",
NEW."groupId",
NEW."locale";
ELSE
EXECUTE format(
'UPDATE %I."user"
SET "displayName" = $2,
"passwordHash" = $3,
"state" = $4,
"confirmed" = $5,
"groupId" = $6,
"locale" = $7
WHERE "id" = $1',
"v_schema"
)
USING NEW."userId",
NEW."displayName",
NEW."passwordHash",
NEW."state",
NEW."confirmed",
NEW."groupId",
NEW."locale";
END IF;
RETURN NEW;
END $$;
--------------------------------------------------------------------------------
-- trigger: user_x_site.1000__user__update_unified_users --
--------------------------------------------------------------------------------
CREATE TRIGGER "1000__user__update_unified_users"
AFTER UPDATE
ON "_central"."user_x_site"
FOR EACH ROW
EXECUTE PROCEDURE "_central"."user__update_unified_users"();
--------------------------------------------------------------------------------
-- trigger: user_x_site.2000__user__user__update_data_to_site --
--------------------------------------------------------------------------------
CREATE TRIGGER "2000__user__user__update_data_to_site"
AFTER UPDATE
ON "_central"."user_x_site"
FOR EACH ROW
EXECUTE PROCEDURE "_central"."user__update_data_to_site"();
| {
"content_hash": "57d2c31da59f9b9eb56e0a6429a5cb68",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 80,
"avg_line_length": 32.52571428571429,
"alnum_prop": 0.35260014054813776,
"repo_name": "webriq/multisite",
"id": "20df14b52c4d7f508e4dd0aae4b3c29ac7df07cf",
"size": "5936",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "module/MultisitePlatform/sql/grid-multisiteplatform/central/schema.0.1.1-0.2.1.sql",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "2289"
},
{
"name": "HTML",
"bytes": "19567"
},
{
"name": "JavaScript",
"bytes": "4752"
},
{
"name": "PHP",
"bytes": "129088"
},
{
"name": "PLpgSQL",
"bytes": "71723"
},
{
"name": "SQLPL",
"bytes": "1049"
}
],
"symlink_target": ""
} |
FROM mcr.microsoft.com/vscode/devcontainers/repos/microsoft/vscode:0-0
# ** [Optional] Uncomment this section to install additional packages. **
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>
| {
"content_hash": "7c421a154f92fcd414058e9018eba9ba",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 76,
"avg_line_length": 48,
"alnum_prop": 0.75,
"repo_name": "glenngillen/dotfiles",
"id": "00ff7256ec621222e28245d64f9b7207febad4cf",
"size": "472",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": ".vscode/extensions/ms-vscode-remote.remote-containers-0.209.6/dist/node_modules/vscode-dev-containers/repository-containers/images/github.com/microsoft/vscode/.devcontainer/Dockerfile",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "3634"
},
{
"name": "Shell",
"bytes": "4225"
},
{
"name": "Vim script",
"bytes": "16306"
}
],
"symlink_target": ""
} |
package example
import spray.http.StatusCodes._
import spray.httpx.encoding.Gzip
import spray.routing.HttpService
import spray.routing.directives.CachingDirectives._
import scala.concurrent.duration.Duration
trait LiveDocService extends HttpService with ClientAuthentication{
val simpleCache = routeCache(maxCapacity = 1000, timeToIdle = Duration("30 min"))
val docRoute = {
//authenticate( BasicAuth("Akka Cassandra Cluster Test") ) {
//client =>
path("doc"){
redirect("doc/v0", Found) // point to latest
} ~
path( "doc" / "v0" ~ Slash.?) {
cache(simpleCache) {
getFromFile("./src/main/webapp/apiv0/doc/apidoc.html")
}
} ~
pathPrefix("style") {
cache(simpleCache) {
getFromDirectory("./src/main/webapp/style")
}
} ~
pathPrefix("style/images") {
cache(simpleCache) { getFromDirectory("./src/main/webapp/style/images") }
} ~
pathPrefix("classpath") {
cache(simpleCache) { getFromDirectory("./src/main/webapp/classpath") }
} ~
pathPrefix("css") {
getFromDirectory("./src/main/webapp/css")
} ~
pathPrefix("js") {
cache(simpleCache) { getFromDirectory("./src/main/webapp/js") }
} ~
pathPrefix("img") {
cache(simpleCache) { getFromDirectory("./src/main/webapp/img") }
} ~
path(Rest) {
leftover => {
encodeResponse(Gzip) {
getFromDirectory("./src/main/webapp/")
}
}
}
//}
}
}
| {
"content_hash": "8b8e0020aa4e1de67649b9acbf20fb21",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 83,
"avg_line_length": 27.12280701754386,
"alnum_prop": 0.593143596377749,
"repo_name": "johanprinsloo/akka-cassandra-cluster-test",
"id": "0cabb975bbc5426e6b8d0af7ef4ee22ade998d04",
"size": "1546",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/scala/example/LiveDocService.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "31866"
},
{
"name": "JavaScript",
"bytes": "174714"
},
{
"name": "Scala",
"bytes": "19224"
},
{
"name": "Shell",
"bytes": "15817"
}
],
"symlink_target": ""
} |
package com.AppointmentSystem.controller.restApi;
import com.AppointmentSystem.dto.DoctorLoginDto;
import com.AppointmentSystem.model.Appointment;
import com.AppointmentSystem.model.Doctor;
import com.AppointmentSystem.model.Document;
import com.AppointmentSystem.model.Patient;
import com.AppointmentSystem.service.*;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by Ruzal on 9/17/2017.
*/
@RestController
@RequestMapping(value = "/api/v1/doctors")
public class ControllerDoctor {
private static final Logger Log= Logger.getLogger(ControllerDoctor.class);
@Autowired
DoctorService doctorService;
@Autowired
AppointmentService appointmentService;
@Autowired
PatientService patientService;
@Autowired
DocumentService documentService;
@Autowired
MailService mailService;
//doctor appointment list
@GetMapping("/appointmentlist/{id}")
public ResponseEntity<Object> appointmentList(@PathVariable("id") long id ){
try {
Doctor doctor = doctorService.getDoctorById(id);
DoctorLoginDto doctorLoginDto= new DoctorLoginDto();
doctorLoginDto.setId(doctor.getDid());
List<Appointment> appointments = appointmentService.displayByDate(doctorLoginDto);
if (appointments==null){
Map<String, String> map= new HashMap<String, String>();
map.put("result","No Appointments for Today!");
return new ResponseEntity<Object>(map, HttpStatus.NOT_FOUND);
}
return new ResponseEntity<Object>(appointments, HttpStatus.OK);
}catch (Exception e){
e.printStackTrace();
return new ResponseEntity<Object>(HttpStatus.NOT_FOUND);
}
}
// patient profile for doctor
@GetMapping("/patients/{id}")
public ResponseEntity<Patient> patientProfile(@PathVariable("id") long id){
Patient patient=patientService.selectById(id);
patient.setPp("http://10.10.20.123:8520/resources/image/"+patient.getPp());
List<String> document =documentService.viewById(id);
if (document==null){
return new ResponseEntity<Patient>(patient,HttpStatus.OK);
}
List<String> docwithPath=new ArrayList<String>();
for (String stringDocument:document){
docwithPath.add("http://10.10.20.123:8520/resources/image/"+stringDocument+" ");
}
String string="";
for (String doc: docwithPath){
string=string+doc;
}
Document document1= new Document(patient.getId(),string);
patient.setDocument(document1);
return new ResponseEntity<Patient>(patient,HttpStatus.OK);
}
// doctor login
@PostMapping(value = "/login",consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
produces = {MediaType.APPLICATION_ATOM_XML_VALUE, MediaType.APPLICATION_JSON_VALUE})
public ResponseEntity<?> docLogin(@Valid DoctorLoginDto doctorLoginDto, BindingResult result){
Map<String,String> map=new HashMap<String, String>();
if (result.hasErrors()|| String.valueOf(doctorLoginDto.getId()).length()<4){
Log.info(result);
map.put("result","Error-->"+result);
return new ResponseEntity<Object>(map,HttpStatus.NOT_FOUND);
}
Doctor doctor=new Doctor();
doctor.setDid(doctorLoginDto.getId());
doctor.setDpass(doctorLoginDto.getPass());
doctor=doctorService.getDoctor(doctor);
if (doctor!=null){
map.put("result","Login Successsfull!");
map.put("id", String.valueOf(doctor.getDid()));
return new ResponseEntity<Object>(map,HttpStatus.OK);
}else {
map.put("result","Doctor not found!");
return new ResponseEntity<Object>(map,HttpStatus.NOT_FOUND);
}
}
@GetMapping(value = "/appointments/approval/{idd}")
public ResponseEntity<Object> appointmentApproval(@PathVariable("idd") long idd){
Appointment appointment=appointmentService.displayById(idd);
Map<Object,Object> map=new HashMap<Object, Object>();
System.out.println(appointment.getStatus());
if (appointment.getStatus().equals("Approved!!")) {
appointment.setStatus("Approve!");
appointmentService.update(appointment);
mailService.sendEmail(appointment,"appointmentrejected");
map.put("result","Approved undone");
}else {
appointment.setStatus("Approved!!");
appointmentService.update(appointment);
mailService.sendEmail(appointment,"appointmentapproval");
map.put("result","Approved");
}
return new ResponseEntity<Object>(map,HttpStatus.OK);
}
@GetMapping(value = "/list")
public ResponseEntity<Object> doctorlist(){
return new ResponseEntity<Object>(doctorService.getAllDoctor(),HttpStatus.OK);
}
}
| {
"content_hash": "fab6eda11f036dc700506c9afb97613c",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 98,
"avg_line_length": 39.06521739130435,
"alnum_prop": 0.6735299573363013,
"repo_name": "ruzalsh/AppointmentSystem",
"id": "1e1fbc0510dab4c26177f9df6c5ebb345a08d614",
"size": "5391",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/AppointmentSystem/controller/restApi/ControllerDoctor.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "722220"
},
{
"name": "HTML",
"bytes": "1899273"
},
{
"name": "Java",
"bytes": "268428"
},
{
"name": "JavaScript",
"bytes": "3677516"
},
{
"name": "PHP",
"bytes": "3841"
}
],
"symlink_target": ""
} |
from .related import RelatedResource
| {
"content_hash": "a3c3e71cad2cd9a1833f85e0e8bda521",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 36,
"avg_line_length": 37,
"alnum_prop": 0.8648648648648649,
"repo_name": "callowayproject/django-resources",
"id": "2fcc4e2e39e0d45f0b81cc2f1b2e1b6e5019136c",
"size": "37",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "contentrelations/models.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "3065"
},
{
"name": "CSS",
"bytes": "13735"
},
{
"name": "HTML",
"bytes": "18131"
},
{
"name": "JavaScript",
"bytes": "2935"
},
{
"name": "Makefile",
"bytes": "3140"
},
{
"name": "Python",
"bytes": "59117"
}
],
"symlink_target": ""
} |
package com.alibaba.csp.sentinel.dashboard.discovery;
import static org.junit.Assert.*;
import org.junit.Test;
import com.alibaba.csp.sentinel.dashboard.config.DashboardConfig;
/**
* @author Jason Joo
*/
public class MachineInfoTest {
@Test
public void testHealthyAndDead() {
System.setProperty(DashboardConfig.CONFIG_UNHEALTHY_MACHINE_MILLIS, "60000");
System.setProperty(DashboardConfig.CONFIG_AUTO_REMOVE_MACHINE_MILLIS, "600000");
DashboardConfig.clearCache();
MachineInfo machineInfo = new MachineInfo();
machineInfo.setHeartbeatVersion(1);
machineInfo.setLastHeartbeat(System.currentTimeMillis() - 10000);
assertTrue(machineInfo.isHealthy());
assertFalse(machineInfo.isDead());
machineInfo.setLastHeartbeat(System.currentTimeMillis() - 100000);
assertFalse(machineInfo.isHealthy());
assertFalse(machineInfo.isDead());
machineInfo.setLastHeartbeat(System.currentTimeMillis() - 1000000);
assertFalse(machineInfo.isHealthy());
assertTrue(machineInfo.isDead());
}
}
| {
"content_hash": "1532fef3bfe8e832eb98784dc7dfff56",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 88,
"avg_line_length": 32.411764705882355,
"alnum_prop": 0.7132486388384754,
"repo_name": "alibaba/Sentinel",
"id": "bb526b9e83bfc1862afd869273360587064fcced",
"size": "1717",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sentinel-dashboard/src/test/java/com/alibaba/csp/sentinel/dashboard/discovery/MachineInfoTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "46183"
},
{
"name": "Dockerfile",
"bytes": "264"
},
{
"name": "HTML",
"bytes": "154941"
},
{
"name": "Java",
"bytes": "3786973"
},
{
"name": "JavaScript",
"bytes": "218906"
},
{
"name": "Shell",
"bytes": "593"
},
{
"name": "Starlark",
"bytes": "115"
}
],
"symlink_target": ""
} |
def extractWeissnoveltranslationWordpressCom(item):
'''
Parser for 'weissnoveltranslation.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('The School Prince is a Girl', 'The School Prince is a Girl', 'translated'),
('Mr. President, Unbridled Love', 'Mr. President, Unbridled Love', 'translated'),
]
for tagname, name, tl_type in tagmap:
if tagname in item['tags']:
return buildReleaseMessageWithType(item, name, vol, chp, frag=frag, postfix=postfix, tl_type=tl_type)
return False | {
"content_hash": "6d01bbc2153de359c9e179627d49eb15",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 110,
"avg_line_length": 36.26315789473684,
"alnum_prop": 0.6560232220609579,
"repo_name": "fake-name/ReadableWebProxy",
"id": "db852ddd8a93f2aeee5f7769aad64fd6e961ceab",
"size": "689",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "WebMirror/management/rss_parser_funcs/feed_parse_extractWeissnoveltranslationWordpressCom.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "105811"
},
{
"name": "Dockerfile",
"bytes": "1178"
},
{
"name": "HTML",
"bytes": "119737"
},
{
"name": "JavaScript",
"bytes": "3006524"
},
{
"name": "Jupyter Notebook",
"bytes": "148075"
},
{
"name": "Mako",
"bytes": "1454"
},
{
"name": "Python",
"bytes": "5264346"
},
{
"name": "Shell",
"bytes": "1059"
}
],
"symlink_target": ""
} |
<!--
********************************************************************************
WARNING:
DO NOT EDIT "redmine/README.md"
IT IS AUTO-GENERATED
(from the other files in "redmine/" combined with a set of templates)
********************************************************************************
-->
# Quick reference
- **Maintained by**:
[the Docker Community](https://github.com/docker-library/redmine)
- **Where to get help**:
[the Docker Community Forums](https://forums.docker.com/), [the Docker Community Slack](https://dockr.ly/slack), or [Stack Overflow](https://stackoverflow.com/search?tab=newest&q=docker)
# Supported tags and respective `Dockerfile` links
- [`4.2.1`, `4.2`, `4`, `latest`](https://github.com/docker-library/redmine/blob/7736d321ea194e82731f0fa79b8a91f053e36aa2/4.2/Dockerfile)
- [`4.2.1-passenger`, `4.2-passenger`, `4-passenger`, `passenger`](https://github.com/docker-library/redmine/blob/88e2dafa2719a4196069257c2049f1a4ae457551/4.2/passenger/Dockerfile)
- [`4.2.1-alpine`, `4.2-alpine`, `4-alpine`, `alpine`](https://github.com/docker-library/redmine/blob/02809f9dead7b26e490f84107c7a2170f11fd2b9/4.2/alpine/Dockerfile)
- [`4.1.3`, `4.1`](https://github.com/docker-library/redmine/blob/7736d321ea194e82731f0fa79b8a91f053e36aa2/4.1/Dockerfile)
- [`4.1.3-passenger`, `4.1-passenger`](https://github.com/docker-library/redmine/blob/88e2dafa2719a4196069257c2049f1a4ae457551/4.1/passenger/Dockerfile)
- [`4.1.3-alpine`, `4.1-alpine`](https://github.com/docker-library/redmine/blob/02809f9dead7b26e490f84107c7a2170f11fd2b9/4.1/alpine/Dockerfile)
- [`4.0.9`, `4.0`](https://github.com/docker-library/redmine/blob/02809f9dead7b26e490f84107c7a2170f11fd2b9/4.0/Dockerfile)
- [`4.0.9-passenger`, `4.0-passenger`](https://github.com/docker-library/redmine/blob/88e2dafa2719a4196069257c2049f1a4ae457551/4.0/passenger/Dockerfile)
- [`4.0.9-alpine`, `4.0-alpine`](https://github.com/docker-library/redmine/blob/02809f9dead7b26e490f84107c7a2170f11fd2b9/4.0/alpine/Dockerfile)
# Quick reference (cont.)
- **Where to file issues**:
[https://github.com/docker-library/redmine/issues](https://github.com/docker-library/redmine/issues)
- **Supported architectures**: ([more info](https://github.com/docker-library/official-images#architectures-other-than-amd64))
[`amd64`](https://hub.docker.com/r/amd64/redmine/), [`arm32v5`](https://hub.docker.com/r/arm32v5/redmine/), [`arm32v7`](https://hub.docker.com/r/arm32v7/redmine/), [`arm64v8`](https://hub.docker.com/r/arm64v8/redmine/), [`i386`](https://hub.docker.com/r/i386/redmine/), [`ppc64le`](https://hub.docker.com/r/ppc64le/redmine/), [`s390x`](https://hub.docker.com/r/s390x/redmine/)
- **Published image artifact details**:
[repo-info repo's `repos/redmine/` directory](https://github.com/docker-library/repo-info/blob/master/repos/redmine) ([history](https://github.com/docker-library/repo-info/commits/master/repos/redmine))
(image metadata, transfer size, etc)
- **Image updates**:
[official-images repo's `library/redmine` label](https://github.com/docker-library/official-images/issues?q=label%3Alibrary%2Fredmine)
[official-images repo's `library/redmine` file](https://github.com/docker-library/official-images/blob/master/library/redmine) ([history](https://github.com/docker-library/official-images/commits/master/library/redmine))
- **Source of this description**:
[docs repo's `redmine/` directory](https://github.com/docker-library/docs/tree/master/redmine) ([history](https://github.com/docker-library/docs/commits/master/redmine))
# What is Redmine?
Redmine is a free and open source, web-based project management and issue tracking tool. It allows users to manage multiple projects and associated subprojects. It features per project wikis and forums, time tracking, and flexible role based access control. It includes a calendar and Gantt charts to aid visual representation of projects and their deadlines. Redmine integrates with various version control systems and includes a repository browser and diff viewer.
> [wikipedia.org/wiki/Redmine](https://en.wikipedia.org/wiki/Redmine)

# How to use this image
## Run Redmine with SQLite3
This is the simplest setup; just run redmine.
```console
$ docker run -d --name some-redmine redmine
```
> not for multi-user production use ([redmine wiki](http://www.redmine.org/projects/redmine/wiki/RedmineInstall#Supported-database-back-ends))
## Run Redmine with a Database Container
Running Redmine with a database server is the recommended way.
1. start a database container
- PostgreSQL
```console
$ docker run -d --name some-postgres --network some-network -e POSTGRES_PASSWORD=secret -e POSTGRES_USER=redmine postgres
```
- MySQL (replace `-e REDMINE_DB_POSTGRES=some-postgres` with `-e REDMINE_DB_MYSQL=some-mysql` when running Redmine)
```console
$ docker run -d --name some-mysql --network some-network -e MYSQL_USER=redmine -e MYSQL_PASSWORD=secret -e MYSQL_DATABASE=redmine -e MYSQL_RANDOM_ROOT_PASSWORD=1 mysql:5.7
```
2. start redmine
```console
$ docker run -d --name some-redmine --network some-network -e REDMINE_DB_POSTGRES=some-postgres -e REDMINE_DB_USERNAME=redmine -e REDMINE_DB_PASSWORD=secret redmine
```
## ... via [`docker stack deploy`](https://docs.docker.com/engine/reference/commandline/stack_deploy/) or [`docker-compose`](https://github.com/docker/compose)
Example `stack.yml` for `redmine`:
```yaml
version: '3.1'
services:
redmine:
image: redmine
restart: always
ports:
- 8080:3000
environment:
REDMINE_DB_MYSQL: db
REDMINE_DB_PASSWORD: example
REDMINE_SECRET_KEY_BASE: supersecretkey
db:
image: mysql:5.7
restart: always
environment:
MYSQL_ROOT_PASSWORD: example
MYSQL_DATABASE: redmine
```
[](http://play-with-docker.com?stack=https://raw.githubusercontent.com/docker-library/docs/cd78c2e058c5a648c0ef42590943736612332666/redmine/stack.yml)
Run `docker stack deploy -c stack.yml redmine` (or `docker-compose -f stack.yml up`), wait for it to initialize completely, and visit `http://swarm-ip:8080`, `http://localhost:8080`, or `http://host-ip:8080` (as appropriate).
## Alternative Web Server
The other tags in this repository, like those with `passenger`, use the same environment and `--links` as the default tags that use WEBrick (`rails s`) but instead give you the option of a different web and application server. `passenger` uses [Phusion Passenger](https://www.phusionpassenger.com/). [`tini`](https://github.com/krallin/tini) is used for reaping [zombies](https://en.wikipedia.org/wiki/Zombie_process).
## Accessing the Application
Currently, the default user and password from upstream is admin/admin ([logging into the application](https://www.redmine.org/projects/redmine/wiki/RedmineInstall#Step-10-Logging-into-the-application)).
## Where to Store Data
Important note: There are several ways to store data used by applications that run in Docker containers. We encourage users of the `redmine` images to familiarize themselves with the options available, including:
- Let Docker manage the storage of your files [by writing the files to disk on the host system using its own internal volume management](https://docs.docker.com/engine/tutorials/dockervolumes/#adding-a-data-volume). This is the default and is easy and fairly transparent to the user. The downside is that the files may be hard to locate for tools and applications that run directly on the host system, i.e. outside containers.
- Create a data directory on the host system (outside the container) and [mount this to a directory visible from inside the container](https://docs.docker.com/engine/tutorials/dockervolumes/#mount-a-host-directory-as-a-data-volume). This places the database files in a known location on the host system, and makes it easy for tools and applications on the host system to access the files. The downside is that the user needs to make sure that the directory exists, and that e.g. directory permissions and other security mechanisms on the host system are set up correctly.
The Docker documentation is a good starting point for understanding the different storage options and variations, and there are multiple blogs and forum postings that discuss and give advice in this area. We will simply show the basic procedure here for the latter option above:
1. Create a data directory on a suitable volume on your host system, e.g. `/my/own/datadir`.
2. Start your `redmine` container like this:
```console
$ docker run -d --name some-redmine -v /my/own/datadir:/usr/src/redmine/files --link some-postgres:postgres redmine
```
The `-v /my/own/datadir:/usr/src/redmine/files` part of the command mounts the `/my/own/datadir` directory from the underlying host system as `/usr/src/redmine/files` inside the container, where Redmine will store uploaded files.
## Port Mapping
If you'd like to be able to access the instance from the host without the container's IP, standard port mappings can be used. Just add `-p 3000:3000` to the `docker run` arguments and then access either `http://localhost:3000` or `http://host-ip:3000` in a browser.
## Environment Variables
When you start the `redmine` image, you can adjust the configuration of the instance by passing one or more environment variables on the `docker run` command line.
### `REDMINE_DB_MYSQL`, `REDMINE_DB_POSTGRES`, or `REDMINE_DB_SQLSERVER`
These variables allow you to set the hostname or IP address of the MySQL, PostgreSQL, or Microsoft SQL host, respectively. These values are mutually exclusive so it is undefined behavior if any two are set. If no variable is set, the image will fall back to using SQLite.
### `REDMINE_DB_PORT`
This variable allows you to specify a custom database connection port. If unspecified, it will default to the regular connection ports: 3306 for MySQL, 5432 for PostgreSQL, and empty string for SQLite.
### `REDMINE_DB_USERNAME`
This variable sets the user that Redmine and any rake tasks use to connect to the specified database. If unspecified, it will default to `root` for MySQL, `postgres` for PostgreSQL, or `redmine` for SQLite.
### `REDMINE_DB_PASSWORD`
This variable sets the password that the specified user will use in connecting to the database. There is no default value.
### `REDMINE_DB_DATABASE`
This variable sets the database that Redmine will use in the specified database server. If not specified, it will default to `redmine` for MySQL, the value of `REDMINE_DB_USERNAME` for PostgreSQL, or `sqlite/redmine.db` for SQLite.
### `REDMINE_DB_ENCODING`
This variable sets the character encoding to use when connecting to the database server. If unspecified, it will use the default for the `mysql2` library ([`UTF-8`](https://github.com/brianmario/mysql2/tree/18673e8d8663a56213a980212e1092c2220faa92#mysql2---a-modern-simple-and-very-fast-mysql-library-for-ruby---binding-to-libmysql)) for MySQL, `utf8` for PostgreSQL, or `utf8` for SQLite.
### `REDMINE_NO_DB_MIGRATE`
This variable allows you to control if `rake db:migrate` is run on container start. Just set the variable to a non-empty string like `1` or `true` and the migrate script will not automatically run on container start.
`db:migrate` will also not run if you start your image with something other than the default `CMD`, like `bash`. See the current `docker-entrypoint.sh` in your image for details.
### `REDMINE_PLUGINS_MIGRATE`
This variable allows you to control if `rake redmine:plugins:migrate` is run on container start. Just set the variable to a non-empty string like `1` or `true` and the migrate script will be automatically run on every container start. It will be run after `db:migrate`.
`redmine:plugins:migrate` will not run if you start your image with something other than the default `CMD`, like `bash`. See the current `docker-entrypoint.sh` in your image for details.
### `REDMINE_SECRET_KEY_BASE`
This variable is required when using Docker Swarm replicas to maintain session connections when being loadbalanced between containers. It will create an initial `config/secrets.yml` and set the `secret_key_base` value, which is "used by Rails to encode cookies storing session data thus preventing their tampering. Generating a new secret token invalidates all existing sessions after restart" ([session store](https://www.redmine.org/projects/redmine/wiki/RedmineInstall#Step-5-Session-store-secret-generation)). If you do not set this variable or provide a `secrets.yml` one will be generated using `rake generate_secret_token`.
## Running as an arbitrary user
For running Redmine without Phusion Passenger you can simply use the [`--user`](https://docs.docker.com/engine/reference/run/#user) flag to `docker run` and give it a `username:group` or `UID:GID`, the user doesn't need to exist in the container
For running the `redmine:passenger` variant as an arbitrary user you will however need the user to exist in `/etc/passwd`. Here are a few examples for doing that:
1. Create the user on your host and mount `/etc/passwd:/etc/passwd:ro`
2. Create a Dockerfile `FROM redmine:passenger` and include something like [`RUN groupadd -r group && useradd --no-log-init -r -g group user`](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#user)
```dockerfile
FROM redmine:passenger
RUN groupadd -r group && useradd --no-log-init -r -g group user
USER user
```
## Docker Secrets
As an alternative to passing sensitive information via environment variables, `_FILE` may be appended to the previously listed environment variables, causing the initialization script to load the values for those variables from files present in the container. In particular, this can be used to load passwords from Docker secrets stored in `/run/secrets/<secret_name>` files. For example:
```console
$ docker run -d --name some-redmine -e REDMINE_DB_MYSQL_FILE=/run/secrets/mysql-host -e REDMINE_DB_PASSWORD_FILE=/run/secrets/mysql-root redmine:tag
```
Currently, this is only supported for `REDMINE_DB_MYSQL`, `REDMINE_DB_POSTGRES`, `REDMINE_DB_PORT`, `REDMINE_DB_USERNAME`, `REDMINE_DB_PASSWORD`, `REDMINE_DB_DATABASE`, `REDMINE_DB_ENCODING`, and `REDMINE_SECRET_KEY_BASE`.
# Image Variants
The `redmine` images come in many flavors, each designed for a specific use case.
## `redmine:<version>`
This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.
## `redmine:<version>-alpine`
This image is based on the popular [Alpine Linux project](https://alpinelinux.org), available in [the `alpine` official image](https://hub.docker.com/_/alpine). Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.
This variant is useful when final image size being as small as possible is your primary concern. The main caveat to note is that it does use [musl libc](https://musl.libc.org) instead of [glibc and friends](https://www.etalabs.net/compare_libcs.html), so software will often run into issues depending on the depth of their libc requirements/assumptions. See [this Hacker News comment thread](https://news.ycombinator.com/item?id=10782897) for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.
To minimize image size, it's uncommon for additional related tools (such as `git` or `bash`) to be included in Alpine-based images. Using this image as a base, add the things you need in your own Dockerfile (see the [`alpine` image description](https://hub.docker.com/_/alpine/) for examples of how to install packages if you are unfamiliar).
# License
[Redmine](https://www.redmine.org/projects/redmine/wiki) is open source and released under the terms of the [GNU General Public License v2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html) (GPL).
As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).
Some additional license information which was able to be auto-detected might be found in [the `repo-info` repository's `redmine/` directory](https://github.com/docker-library/repo-info/tree/master/repos/redmine).
As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.
| {
"content_hash": "2dff8cbe042d4508a6a8a23ad2d010e1",
"timestamp": "",
"source": "github",
"line_count": 255,
"max_line_length": 630,
"avg_line_length": 66.53725490196078,
"alnum_prop": 0.7576471975010314,
"repo_name": "31z4/docs",
"id": "1ba4b793c333b394abffda354b16fdf61fc1c59b",
"size": "16967",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "redmine/README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "1674"
},
{
"name": "Perl",
"bytes": "6540"
},
{
"name": "Shell",
"bytes": "22432"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0) on Fri Nov 02 12:25:57 PDT 2012 -->
<TITLE>
dblook (Apache Derby 10.8 API Documentation)
</TITLE>
<META NAME="date" CONTENT="2012-11-02">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="dblook (Apache Derby 10.8 API Documentation)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../serialized-form.html"><FONT CLASS="NavBarFont1"><B>Serialized</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
Apache Derby 10.8</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV CLASS
<A HREF="../../../../org/apache/derby/tools/ij.html" title="class in org.apache.derby.tools"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/apache/derby/tools/dblook.html" target="_top"><B>FRAMES</B></A>
<A HREF="dblook.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.derby.tools</FONT>
<BR>
Class dblook</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.derby.tools.dblook</B>
</PRE>
<HR>
<DL>
<DT><PRE>public final class <B>dblook</B><DT>extends java.lang.Object</DL>
</PRE>
<P>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../org/apache/derby/tools/dblook.html#dblook(java.lang.String[])">dblook</A></B>(java.lang.String[] args)</CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/derby/tools/dblook.html#addQuotes(java.lang.String)">addQuotes</A></B>(java.lang.String name)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/derby/tools/dblook.html#addSingleQuotes(java.lang.String)">addSingleQuotes</A></B>(java.lang.String name)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/derby/tools/dblook.html#expandDoubleQuotes(java.lang.String)">expandDoubleQuotes</A></B>(java.lang.String name)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/derby/tools/dblook.html#getColNameFromNumber(java.lang.String, int)">getColNameFromNumber</A></B>(java.lang.String tableId,
int colNum)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/derby/tools/dblook.html#getColumnListFromDescription(java.lang.String, java.lang.String)">getColumnListFromDescription</A></B>(java.lang.String tableId,
java.lang.String description)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/derby/tools/dblook.html#isExcludedTable(java.lang.String)">isExcludedTable</A></B>(java.lang.String tableName)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/derby/tools/dblook.html#isIgnorableSchema(java.lang.String)">isIgnorableSchema</A></B>(java.lang.String schemaName)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/derby/tools/dblook.html#lookupMessage(java.lang.String)">lookupMessage</A></B>(java.lang.String key)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/derby/tools/dblook.html#lookupMessage(java.lang.String, java.lang.String[])">lookupMessage</A></B>(java.lang.String key,
java.lang.String[] vals)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/derby/tools/dblook.html#lookupSchemaId(java.lang.String)">lookupSchemaId</A></B>(java.lang.String schemaId)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/derby/tools/dblook.html#lookupTableId(java.lang.String)">lookupTableId</A></B>(java.lang.String tableId)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/derby/tools/dblook.html#main(java.lang.String[])">main</A></B>(java.lang.String[] args)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/derby/tools/dblook.html#removeNewlines(java.lang.String)">removeNewlines</A></B>(java.lang.String str)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/derby/tools/dblook.html#stringContainsTargetTable(java.lang.String)">stringContainsTargetTable</A></B>(java.lang.String str)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/derby/tools/dblook.html#stripQuotes(java.lang.String)">stripQuotes</A></B>(java.lang.String quotedName)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/derby/tools/dblook.html#writeVerboseOutput(java.lang.String, java.lang.String)">writeVerboseOutput</A></B>(java.lang.String key,
java.lang.String value)</CODE>
<BR>
</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="dblook(java.lang.String[])"><!-- --></A><H3>
dblook</H3>
<PRE>
public <B>dblook</B>(java.lang.String[] args)
throws java.lang.Exception</PRE>
<DL>
<DL>
<DT><B>Throws:</B>
<DD><CODE>java.lang.Exception</CODE></DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="main(java.lang.String[])"><!-- --></A><H3>
main</H3>
<PRE>
public static void <B>main</B>(java.lang.String[] args)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getColumnListFromDescription(java.lang.String, java.lang.String)"><!-- --></A><H3>
getColumnListFromDescription</H3>
<PRE>
public static java.lang.String <B>getColumnListFromDescription</B>(java.lang.String tableId,
java.lang.String description)
throws java.sql.SQLException</PRE>
<DL>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE>java.sql.SQLException</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="getColNameFromNumber(java.lang.String, int)"><!-- --></A><H3>
getColNameFromNumber</H3>
<PRE>
public static java.lang.String <B>getColNameFromNumber</B>(java.lang.String tableId,
int colNum)
throws java.sql.SQLException</PRE>
<DL>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE>java.sql.SQLException</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="addQuotes(java.lang.String)"><!-- --></A><H3>
addQuotes</H3>
<PRE>
public static java.lang.String <B>addQuotes</B>(java.lang.String name)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="addSingleQuotes(java.lang.String)"><!-- --></A><H3>
addSingleQuotes</H3>
<PRE>
public static java.lang.String <B>addSingleQuotes</B>(java.lang.String name)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="stripQuotes(java.lang.String)"><!-- --></A><H3>
stripQuotes</H3>
<PRE>
public static java.lang.String <B>stripQuotes</B>(java.lang.String quotedName)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="isExcludedTable(java.lang.String)"><!-- --></A><H3>
isExcludedTable</H3>
<PRE>
public static boolean <B>isExcludedTable</B>(java.lang.String tableName)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="isIgnorableSchema(java.lang.String)"><!-- --></A><H3>
isIgnorableSchema</H3>
<PRE>
public static boolean <B>isIgnorableSchema</B>(java.lang.String schemaName)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="stringContainsTargetTable(java.lang.String)"><!-- --></A><H3>
stringContainsTargetTable</H3>
<PRE>
public static boolean <B>stringContainsTargetTable</B>(java.lang.String str)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="expandDoubleQuotes(java.lang.String)"><!-- --></A><H3>
expandDoubleQuotes</H3>
<PRE>
public static java.lang.String <B>expandDoubleQuotes</B>(java.lang.String name)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="lookupSchemaId(java.lang.String)"><!-- --></A><H3>
lookupSchemaId</H3>
<PRE>
public static java.lang.String <B>lookupSchemaId</B>(java.lang.String schemaId)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="lookupTableId(java.lang.String)"><!-- --></A><H3>
lookupTableId</H3>
<PRE>
public static java.lang.String <B>lookupTableId</B>(java.lang.String tableId)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="writeVerboseOutput(java.lang.String, java.lang.String)"><!-- --></A><H3>
writeVerboseOutput</H3>
<PRE>
public static void <B>writeVerboseOutput</B>(java.lang.String key,
java.lang.String value)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="lookupMessage(java.lang.String)"><!-- --></A><H3>
lookupMessage</H3>
<PRE>
public static java.lang.String <B>lookupMessage</B>(java.lang.String key)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="lookupMessage(java.lang.String, java.lang.String[])"><!-- --></A><H3>
lookupMessage</H3>
<PRE>
public static java.lang.String <B>lookupMessage</B>(java.lang.String key,
java.lang.String[] vals)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="removeNewlines(java.lang.String)"><!-- --></A><H3>
removeNewlines</H3>
<PRE>
public static java.lang.String <B>removeNewlines</B>(java.lang.String str)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../serialized-form.html"><FONT CLASS="NavBarFont1"><B>Serialized</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
Built on Fri 2012-11-02 12:25:54-0700, from revision 1405108</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV CLASS
<A HREF="../../../../org/apache/derby/tools/ij.html" title="class in org.apache.derby.tools"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/apache/derby/tools/dblook.html" target="_top"><B>FRAMES</B></A>
<A HREF="dblook.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Apache Derby 10.8 API Documentation - <i>Copyright © 2004,2012 The Apache Software Foundation. All Rights Reserved.</i>
</BODY>
</HTML>
| {
"content_hash": "c800ac6613512355e6ac0d373ae87346",
"timestamp": "",
"source": "github",
"line_count": 556,
"max_line_length": 202,
"avg_line_length": 37.23381294964029,
"alnum_prop": 0.6152545647763501,
"repo_name": "mminella/jsr-352-ri-tck",
"id": "db973a4e2faa6f740e885690642964bc1d6b9b36",
"size": "20702",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "JSR352.BinaryDependencies/shipped/derby/javadoc/jdbc3/org/apache/derby/tools/dblook.html",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "1743336"
},
{
"name": "Perl",
"bytes": "80042"
},
{
"name": "Racket",
"bytes": "180"
},
{
"name": "Ruby",
"bytes": "1444"
},
{
"name": "Shell",
"bytes": "45633"
}
],
"symlink_target": ""
} |
module Role
class Diviner < GenericRole
def initialize
super
@name = "占い師"
@night_action_name = '占う'
@player_list_f = :player_list_with_selections
@night_action_direct = true
end
def execute_actions
if @action_queue.last then
divine = @action_queue.last.divine
name = @action_queue.last.name
super
msg = "#{name}を占った結果#{divine}でした。"
else
msg = '占う相手を選択してください。'
end
end
end
end
| {
"content_hash": "909775d49193edc030bcee9d3dbfc267",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 51,
"avg_line_length": 21.17391304347826,
"alnum_prop": 0.5770020533880903,
"repo_name": "tomoyat1/yawg",
"id": "db08167ac9f7fd0a6820366db7180b74007284c2",
"size": "545",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "models/diviner.rb",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "CSS",
"bytes": "7059"
},
{
"name": "HTML",
"bytes": "14362"
},
{
"name": "JavaScript",
"bytes": "11851"
},
{
"name": "Ruby",
"bytes": "45893"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of the Sylius package.
(c) Paweł Jędrzejewski
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
-->
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/services/constraint-mapping-1.0.xsd">
<class name="Sylius\Component\Taxation\Model\TaxRate">
<constraint name="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity" >
<option name="fields">code</option>
<option name="message">sylius.tax_rate.code.unique</option>
<option name="groups">sylius</option>
</constraint>
<property name="code">
<constraint name="NotBlank">
<option name="message">sylius.tax_rate.code.not_blank</option>
<option name="groups">sylius</option>
</constraint>
<constraint name="Regex">
<option name="message">sylius.tax_rate.code.regex</option>
<option name="pattern">/^[\w-]*$/</option>
<option name="groups">sylius</option>
</constraint>
</property>
<property name="name">
<constraint name="NotBlank">
<option name="message">sylius.tax_rate.name.not_blank</option>
<option name="groups">sylius</option>
</constraint>
<constraint name="Length">
<option name="min">2</option>
<option name="max">255</option>
<option name="minMessage">sylius.tax_rate.name.min_length</option>
<option name="maxMessage">sylius.tax_rate.name.max_length</option>
<option name="groups">sylius</option>
</constraint>
</property>
<property name="category">
<constraint name="NotBlank">
<option name="message">sylius.tax_rate.category.not_blank</option>
<option name="groups">sylius</option>
</constraint>
</property>
<property name="amount">
<constraint name="NotBlank">
<option name="message">sylius.tax_rate.amount.not_blank</option>
<option name="groups">sylius</option>
</constraint>
<constraint name="PositiveOrZero">
<option name="message">sylius.tax_rate.amount.invalid</option>
<option name="groups">sylius</option>
</constraint>
</property>
<property name="calculator">
<constraint name="NotBlank">
<option name="message">sylius.tax_rate.calculator.not_blank</option>
<option name="groups">sylius</option>
</constraint>
</property>
<property name="endDate">
<constraint name="GreaterThan">
<option name="propertyPath">startDate</option>
<option name="message">sylius.tax_rate.date.greater_than_start_date</option>
<option name="groups">sylius</option>
</constraint>
</property>
</class>
</constraint-mapping>
| {
"content_hash": "4402a57dcee94d0525ff0b87e42db4c7",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 267,
"avg_line_length": 44.46666666666667,
"alnum_prop": 0.5835082458770615,
"repo_name": "Sylius/Sylius",
"id": "0e09fc77cb737e76152d6a441f962c8570fc4595",
"size": "3337",
"binary": false,
"copies": "2",
"ref": "refs/heads/1.13",
"path": "src/Sylius/Bundle/TaxationBundle/Resources/config/validation/TaxRate.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "674"
},
{
"name": "Gherkin",
"bytes": "1269548"
},
{
"name": "JavaScript",
"bytes": "102771"
},
{
"name": "Makefile",
"bytes": "1478"
},
{
"name": "PHP",
"bytes": "8145147"
},
{
"name": "SCSS",
"bytes": "53880"
},
{
"name": "Shell",
"bytes": "11411"
},
{
"name": "Twig",
"bytes": "446530"
}
],
"symlink_target": ""
} |
using BaseClients.Architecture;
using GAAPICommon.Architecture;
using SchedulingClients.Core.ServicingServiceReference;
using System;
namespace SchedulingClients.Core
{
/// <summary>
/// Monitors and completes service requests.
/// </summary>
public interface IServicingClient : ICallbackClient
{
/// <summary>
/// Gets all outstanding service requests.
/// </summary>
/// <returns>Array of service state dtos.</returns>
IServiceCallResult<ServiceStateDto[]> GetOutstandingServiceRequests();
/// <summary>
/// Marks a service task as complete.
/// </summary>
/// <param name="taskId">target task id</param>
/// <returns>Successful service call result on success</returns>
IServiceCallResult SetServiceComplete(int taskId);
/// <summary>
/// Fired whenever a new service request is received.
/// </summary>
event Action<ServiceStateDto> ServiceRequest;
}
} | {
"content_hash": "7e47f09cd260c5ffcc0f0d5e7b418185",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 78,
"avg_line_length": 32.41935483870968,
"alnum_prop": 0.6487562189054726,
"repo_name": "GuidanceAutomation/SchedulingClients",
"id": "78259a490864b1478aaf1671cf390a232fb4e68f",
"size": "1007",
"binary": false,
"copies": "1",
"ref": "refs/heads/devel",
"path": "src/SchedulingClients.Core/Client Interfaces/IServicingClient.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "168"
},
{
"name": "C#",
"bytes": "232359"
},
{
"name": "CSS",
"bytes": "5560"
}
],
"symlink_target": ""
} |
{% extends "base_email.html" %}
{% block content %}
<p>Please verify the following blogpost to complete your submission.</p>
<p><a href="http://{{ site }}{% url publisher_authorize code=code %}" target="_blank">Verify and complete this submission</a></p>
<hr />
<h3>{{ post.title }}</h3>
{{ post.body|safe|linebreaks }}
{% if post.attachments.all %}
<hr />
<h3>You submitted the following attachments:</h3>
<ul>
{% for attachment in post.attachments.all %}
<li>{{ attachment.file }}</li>
{% endfor %}
</ul>
{% endif %}
{% endblock %} | {
"content_hash": "f2b51035a62756efc52000c5bcf8d45e",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 129,
"avg_line_length": 28.210526315789473,
"alnum_prop": 0.6511194029850746,
"repo_name": "charlesmastin/django-wordpress-publisher",
"id": "9d266c2937758a0344bad6eea79352d2956f2b5f",
"size": "536",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "publisher/templates/authorize_email.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "JavaScript",
"bytes": "31186"
},
{
"name": "Python",
"bytes": "35548"
}
],
"symlink_target": ""
} |
<?php
/* @var $this TblHerdSetupController */
/* @var $model TblHerdSetup */
Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . '/assets/js/customer.js');
Yii::app()->clientScript->registerCoreScript('jquery-ui-1.10.2.custom');
$this->breadcrumbs=array(
'Other'=>array('admin'),
'Herd Setup'=>array('admin'),
'List',
);
$this->menu=array(
//array('label'=>'List Farm & Herd', 'url'=>array('index')),
//array('label'=>'Create Farm & Herd', 'url'=>array('create')),
);
Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
$('.search-form').toggle();
return false;
});
$('.search-form form').submit(function(){
$('#tbl-herd-setup-grid').yiiGridView('update', {
data: $(this).serialize()
});
return false;
});
");
/* Yii::app()->clientScript->registerScript('row_dblclick', "
$('table > tbody > tr').on('dblclick', function(id){
$(this).click();
});"
); */
Yii::app()->clientScript->registerScript('row_dblclick', "$('#tbl-herd-setup-grid tbody > tr').on('click', function(id){
//$(this).click();
var link = $(this).find('a.update').attr('href');
location.href = link;
});"
);
?>
<div style="float: left;">
<a class="buttons" href="index.php?r=tblHerdSetup/admin"><input type="button" value="List Farm & Herd"></a>
<a class="buttons" href="index.php?r=tblHerdSetup/create"><input type="button" value="New"></a>
</div>
<div style="float: left; margin-left: 40%">
<?php
$form=$this->beginWidget('CActiveForm', array(
'id'=>'tbl-sold-hogs-form',
'enableAjaxValidation'=>false,
));
$pages = (isset($_REQUEST['pages']))?$_REQUEST['pages']:20;
echo CHtml::dropDownList('pages',$pages, array('2'=>'2','5'=>'5','10'=>'10','20'=>'20','50'=>'50','100'=>'100','500'=>'500'),array('size'=>0,'tabindex'=>23,'maxlength'=>0));
echo " ";
echo CHtml::submitButton('Redisplay',array('onClick'=>''));
$this->endWidget();
?>
</div>
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'tbl-herd-setup-grid',
'dataProvider'=>$model->search(),
'selectionChanged'=>'function(id){
//location.href = "'.$this->createUrl('update').'/id/"+$.fn.yiiGridView.getSelection(id);
}',
'afterAjaxUpdate'=>'function(id, data){autoSuggestSearch();}',
'filter'=>$model,
'columns'=>array(
'farm_herd',
'breeder_name',
'farm_name',
'address1',
'address2',
/*
'city',
'state',
'zip',
'phone',
'breeder_number',
'breeder_herd_mark',
'home_country',
'breed',
'is_weight',
'breeder_no',
'weighted',
'is_hog_tag',
'hog_numbering',
'passover_days',
'due_days',
'take_boars_gilts',
'take_sow_scores',
'spring_start',
'spring_end',
'spring_letter',
'fall_start',
'fall_end',
'fall_letter',
'shift_year',
'take_weaned_date',
'take_deffects',
'prev_herd_mark',
'fax',
'date_modified',
*/
array(
'class'=>'CButtonColumn',
'template' => '{update}',
'htmlOptions' => array("style"=>'display: none'),
'headerHtmlOptions'=> array("style"=>'display: none'),
),
),
)); ?>
<a class="buttons" href="index.php?r=tblHerdSetup/admin"><input type="button" value="List Farm & Herd"></a>
<a class="buttons" href="index.php?r=tblHerdSetup/create"><input type="button" value="New"></a>
<p>
You may optionally enter a comparison operator (<b><</b>, <b><=</b>, <b>></b>, <b>>=</b>, <b><></b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>
<p><?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?></p>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
'model'=>$model,
)); ?>
</div><!-- search-form --> | {
"content_hash": "3b6b25aee51888b31963241b6e5b8115",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 173,
"avg_line_length": 29.436507936507937,
"alnum_prop": 0.6133728767861958,
"repo_name": "jntd11/yiitest",
"id": "9f1f0eaf7aecf44e0edcf00e9dc56b7656057710",
"size": "3709",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "testdrive/protected/views/tblHerdSetup/admin.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "265"
},
{
"name": "Batchfile",
"bytes": "2870"
},
{
"name": "CSS",
"bytes": "274565"
},
{
"name": "Groff",
"bytes": "5425235"
},
{
"name": "HTML",
"bytes": "58242"
},
{
"name": "JavaScript",
"bytes": "1433874"
},
{
"name": "PHP",
"bytes": "18094692"
}
],
"symlink_target": ""
} |
#pragma once
#include <cstdint>
#include <list>
#include <string>
#include "envoy/common/platform.h"
#include "envoy/config/core/v3/address.pb.h"
#include "envoy/network/connection.h"
#include "envoy/network/listener.h"
#include "absl/strings/string_view.h"
namespace Envoy {
namespace Network {
/**
* Utility class to represent TCP/UDP port range
*/
class PortRange {
public:
PortRange(uint32_t min, uint32_t max) : min_(min), max_(max) {}
bool contains(uint32_t port) const { return (port >= min_ && port <= max_); }
private:
const uint32_t min_;
const uint32_t max_;
};
using PortRangeList = std::list<PortRange>;
/**
* A callback interface used by readFromSocket() to pass packets read from
* socket.
*/
class UdpPacketProcessor {
public:
virtual ~UdpPacketProcessor() = default;
/**
* Consume the packet read out of the socket with the information from UDP
* header.
* @param local_address is the destination address in the UDP header.
* @param peer_address is the source address in the UDP header.
* @param buffer contains the packet read.
* @param receive_time is the time when the packet is read.
*/
virtual void processPacket(Address::InstanceConstSharedPtr local_address,
Address::InstanceConstSharedPtr peer_address,
Buffer::InstancePtr buffer, MonotonicTime receive_time) PURE;
/**
* Called whenever datagrams are dropped due to overflow or truncation.
* @param dropped supplies the number of dropped datagrams.
*/
virtual void onDatagramsDropped(uint32_t dropped) PURE;
/**
* The expected max size of the datagram to be read. If it's smaller than
* the size of datagrams received, they will be dropped.
*/
virtual uint64_t maxDatagramSize() const PURE;
/**
* An estimated number of packets to read in each read event.
*/
virtual size_t numPacketsExpectedPerEventLoop() const PURE;
};
static const uint64_t DEFAULT_UDP_MAX_DATAGRAM_SIZE = 1500;
static const uint64_t NUM_DATAGRAMS_PER_RECEIVE = 16;
static const uint64_t MAX_NUM_PACKETS_PER_EVENT_LOOP = 6000;
/**
* Wrapper which resolves UDP socket proto config with defaults.
*/
struct ResolvedUdpSocketConfig {
ResolvedUdpSocketConfig(const envoy::config::core::v3::UdpSocketConfig& config,
bool prefer_gro_default);
uint64_t max_rx_datagram_size_;
bool prefer_gro_;
};
/**
* Common network utility routines.
*/
class Utility {
public:
static constexpr absl::string_view TCP_SCHEME{"tcp://"};
static constexpr absl::string_view UDP_SCHEME{"udp://"};
static constexpr absl::string_view UNIX_SCHEME{"unix://"};
/**
* Resolve a URL.
* @param url supplies the url to resolve.
* @return Address::InstanceConstSharedPtr the resolved address.
* @throw EnvoyException if url is invalid.
*/
static Address::InstanceConstSharedPtr resolveUrl(const std::string& url);
/**
* Match a URL to the TCP scheme
* @param url supplies the URL to match.
* @return bool true if the URL matches the TCP scheme, false otherwise.
*/
static bool urlIsTcpScheme(absl::string_view url);
/**
* Match a URL to the UDP scheme
* @param url supplies the URL to match.
* @return bool true if the URL matches the UDP scheme, false otherwise.
*/
static bool urlIsUdpScheme(absl::string_view url);
/**
* Match a URL to the Unix scheme
* @param url supplies the Unix to match.
* @return bool true if the URL matches the Unix scheme, false otherwise.
*/
static bool urlIsUnixScheme(absl::string_view url);
/**
* Parses the host from a TCP URL
* @param the URL to parse host from
* @return std::string the parsed host
*/
static std::string hostFromTcpUrl(const std::string& url);
/**
* Parses the port from a TCP URL
* @param the URL to parse port from
* @return uint32_t the parsed port
*/
static uint32_t portFromTcpUrl(const std::string& url);
/**
* Parses the host from a UDP URL
* @param the URL to parse host from
* @return std::string the parsed host
*/
static std::string hostFromUdpUrl(const std::string& url);
/**
* Parses the port from a UDP URL
* @param the URL to parse port from
* @return uint32_t the parsed port
*/
static uint32_t portFromUdpUrl(const std::string& url);
/**
* Parse an internet host address (IPv4 or IPv6) and create an Instance from it. The address must
* not include a port number. Throws EnvoyException if unable to parse the address.
* @param ip_address string to be parsed as an internet address.
* @param port optional port to include in Instance created from ip_address, 0 by default.
* @param v6only disable IPv4-IPv6 mapping for IPv6 addresses?
* @return pointer to the Instance.
* @throw EnvoyException in case of a malformed IP address.
*/
static Address::InstanceConstSharedPtr
parseInternetAddress(const std::string& ip_address, uint16_t port = 0, bool v6only = true);
/**
* Parse an internet host address (IPv4 or IPv6) and create an Instance from it. The address must
* not include a port number.
* @param ip_address string to be parsed as an internet address.
* @param port optional port to include in Instance created from ip_address, 0 by default.
* @param v6only disable IPv4-IPv6 mapping for IPv6 addresses?
* @return pointer to the Instance, or nullptr if unable to parse the address.
*/
static Address::InstanceConstSharedPtr
parseInternetAddressNoThrow(const std::string& ip_address, uint16_t port = 0, bool v6only = true);
/**
* Parse an internet host address (IPv4 or IPv6) AND port, and create an Instance from it. Throws
* EnvoyException if unable to parse the address. This is needed when a shared pointer is needed
* but only a raw instance is available.
* @param Address::Ip& to be copied to the new instance.
* @return pointer to the Instance.
*/
static Address::InstanceConstSharedPtr copyInternetAddressAndPort(const Address::Ip& ip);
/**
* Create a new Instance from an internet host address (IPv4 or IPv6) and port.
* @param ip_addr string to be parsed as an internet address and port. Examples:
* - "1.2.3.4:80"
* - "[1234:5678::9]:443"
* @param v6only disable IPv4-IPv6 mapping for IPv6 addresses?
* @return pointer to the Instance.
* @throw EnvoyException in case of a malformed IP address.
*/
static Address::InstanceConstSharedPtr parseInternetAddressAndPort(const std::string& ip_address,
bool v6only = true);
/**
* Create a new Instance from an internet host address (IPv4 or IPv6) and port.
* @param ip_addr string to be parsed as an internet address and port. Examples:
* - "1.2.3.4:80"
* - "[1234:5678::9]:443"
* @param v6only disable IPv4-IPv6 mapping for IPv6 addresses?
* @return pointer to the Instance, or a nullptr in case of a malformed IP address.
*/
static Address::InstanceConstSharedPtr
parseInternetAddressAndPortNoThrow(const std::string& ip_address, bool v6only = true);
/**
* Get the local address of the first interface address that is of type
* version and is not a loopback address. If no matches are found, return the
* loopback address of type version.
* @param the local address IP version.
* @return the local IP address of the server
*/
static Address::InstanceConstSharedPtr getLocalAddress(const Address::IpVersion version);
/**
* Determine whether this is a local connection.
* @return bool the address is a local connection.
*/
static bool isSameIpOrLoopback(const ConnectionSocket& socket);
/**
* Determine whether this is an internal (RFC1918) address.
* @return bool the address is an RFC1918 address.
*/
static bool isInternalAddress(const Address::Instance& address);
/**
* Check if address is loopback address.
* @param address IP address to check.
* @return true if so, otherwise false
*/
static bool isLoopbackAddress(const Address::Instance& address);
/**
* @return Address::InstanceConstSharedPtr an address that represents the canonical IPv4 loopback
* address (i.e. "127.0.0.1"). Note that the range "127.0.0.0/8" is all defined as the
* loopback range, but the address typically used (e.g. in tests) is "127.0.0.1".
*/
static Address::InstanceConstSharedPtr getCanonicalIpv4LoopbackAddress();
/**
* @return Address::InstanceConstSharedPtr an address that represents the IPv6 loopback address
* (i.e. "::1").
*/
static Address::InstanceConstSharedPtr getIpv6LoopbackAddress();
/**
* @return Address::InstanceConstSharedPtr an address that represents the IPv4 wildcard address
* (i.e. "0.0.0.0"). Used during binding to indicate that incoming connections to any
* local IPv4 address are to be accepted.
*/
static Address::InstanceConstSharedPtr getIpv4AnyAddress();
/**
* @return Address::InstanceConstSharedPtr an address that represents the IPv6 wildcard address
* (i.e. "::"). Used during binding to indicate that incoming connections to any local
* IPv6 address are to be accepted.
*/
static Address::InstanceConstSharedPtr getIpv6AnyAddress();
/**
* @return the IPv4 CIDR catch-all address (0.0.0.0/0).
*/
static const std::string& getIpv4CidrCatchAllAddress();
/**
* @return the IPv6 CIDR catch-all address (::/0).
*/
static const std::string& getIpv6CidrCatchAllAddress();
/**
* @param address IP address instance.
* @param port to update.
* @return Address::InstanceConstSharedPtr a new address instance with updated port.
*/
static Address::InstanceConstSharedPtr getAddressWithPort(const Address::Instance& address,
uint32_t port);
/**
* Retrieve the original destination address from an accepted socket.
* The address (IP and port) may be not local and the port may differ from
* the listener port if the packets were redirected using iptables
* @param sock is accepted socket
* @return the original destination or nullptr if not available.
*/
static Address::InstanceConstSharedPtr getOriginalDst(Socket& sock);
/**
* Parses a string containing a comma-separated list of port numbers and/or
* port ranges and appends the values to a caller-provided list of PortRange structures.
* For example, the string "1-1024,2048-4096,12345" causes 3 PortRange structures
* to be appended to the supplied list.
* @param str is the string containing the port numbers and ranges
* @param list is the list to append the new data structures to
*/
static void parsePortRangeList(absl::string_view string, std::list<PortRange>& list);
/**
* Checks whether a given port number appears in at least one of the port ranges in a list
* @param address supplies the IP address to compare.
* @param list the list of port ranges in which the port may appear
* @return whether the port appears in at least one of the ranges in the list
*/
static bool portInRangeList(const Address::Instance& address, const std::list<PortRange>& list);
/**
* Converts IPv6 absl::uint128 in network byte order to host byte order.
* @param address supplies the IPv6 address in network byte order.
* @return the absl::uint128 IPv6 address in host byte order.
*/
static absl::uint128 Ip6ntohl(const absl::uint128& address);
/**
* Converts IPv6 absl::uint128 in host byte order to network byte order.
* @param address supplies the IPv6 address in host byte order.
* @return the absl::uint128 IPv6 address in network byte order.
*/
static absl::uint128 Ip6htonl(const absl::uint128& address);
static Address::InstanceConstSharedPtr
protobufAddressToAddress(const envoy::config::core::v3::Address& proto_address);
/**
* Copies the address instance into the protobuf representation of an address.
* @param address is the address to be copied into the protobuf representation of this address.
* @param proto_address is the protobuf address to which the address instance is copied into.
*/
static void addressToProtobufAddress(const Address::Instance& address,
envoy::config::core::v3::Address& proto_address);
/**
* Returns socket type corresponding to SocketAddress.protocol value of the
* given address, or SocketType::Stream if the address is a pipe address.
* @param proto_address the address protobuf
* @return socket type
*/
static Socket::Type
protobufAddressSocketType(const envoy::config::core::v3::Address& proto_address);
/**
* Send a packet via given UDP socket with specific source address.
* @param handle is the UDP socket used to send.
* @param slices points to the buffers containing the packet.
* @param num_slices is the number of buffers.
* @param local_ip is the source address to be used to send.
* @param peer_address is the destination address to send to.
*/
static Api::IoCallUint64Result writeToSocket(IoHandle& handle, Buffer::RawSlice* slices,
uint64_t num_slices, const Address::Ip* local_ip,
const Address::Instance& peer_address);
static Api::IoCallUint64Result writeToSocket(IoHandle& handle, const Buffer::Instance& buffer,
const Address::Ip* local_ip,
const Address::Instance& peer_address);
/**
* Read a packet from a given UDP socket and pass the packet to given UdpPacketProcessor.
* @param handle is the UDP socket to read from.
* @param local_address is the socket's local address used to populate port.
* @param udp_packet_processor is the callback to receive the packet.
* @param receive_time is the timestamp passed to udp_packet_processor for the
* receive time of the packet.
* @param prefer_gro supplies whether to use GRO if the OS supports it.
* @param packets_dropped is the output parameter for number of packets dropped in kernel. If the
* caller is not interested in it, nullptr can be passed in.
*/
static Api::IoCallUint64Result readFromSocket(IoHandle& handle,
const Address::Instance& local_address,
UdpPacketProcessor& udp_packet_processor,
MonotonicTime receive_time, bool use_gro,
uint32_t* packets_dropped);
/**
* Read some packets from a given UDP socket and pass the packet to a given
* UdpPacketProcessor. Read no more than MAX_NUM_PACKETS_PER_EVENT_LOOP packets.
* @param handle is the UDP socket to read from.
* @param local_address is the socket's local address used to populate port.
* @param udp_packet_processor is the callback to receive the packets.
* @param time_source is the time source used to generate the time stamp of the received packets.
* @param prefer_gro supplies whether to use GRO if the OS supports it.
* @param packets_dropped is the output parameter for number of packets dropped in kernel.
* Return the io error encountered or nullptr if no io error but read stopped
* because of MAX_NUM_PACKETS_PER_EVENT_LOOP.
*
* TODO(mattklein123): Allow the number of packets read to be limited for fairness. Currently
* this function will always return an error, even if EAGAIN. In the future
* we can return no error if we limited the number of packets read and have
* to fake another read event.
* TODO(mattklein123): Can we potentially share this with the TCP stack somehow? Similar code
* exists there.
*/
static Api::IoErrorPtr readPacketsFromSocket(IoHandle& handle,
const Address::Instance& local_address,
UdpPacketProcessor& udp_packet_processor,
TimeSource& time_source, bool prefer_gro,
uint32_t& packets_dropped);
private:
static void throwWithMalformedIp(absl::string_view ip_address);
/**
* Takes a number and flips the order in byte chunks. The last byte of the input will be the
* first byte in the output. The second to last byte will be the second to first byte in the
* output. Etc..
* @param input supplies the input to have the bytes flipped.
* @return the absl::uint128 of the input having the bytes flipped.
*/
static absl::uint128 flipOrder(const absl::uint128& input);
};
} // namespace Network
} // namespace Envoy
| {
"content_hash": "ff618338b230f716ac158a105690a0cc",
"timestamp": "",
"source": "github",
"line_count": 412,
"max_line_length": 100,
"avg_line_length": 41.15291262135922,
"alnum_prop": 0.6800353877912121,
"repo_name": "lyft/envoy",
"id": "d042d130071f6517302e3cd3be347aa55bb11918",
"size": "16955",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "source/common/network/utility.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "439"
},
{
"name": "C",
"bytes": "9840"
},
{
"name": "C++",
"bytes": "30180292"
},
{
"name": "Dockerfile",
"bytes": "891"
},
{
"name": "Emacs Lisp",
"bytes": "966"
},
{
"name": "Go",
"bytes": "558"
},
{
"name": "Jinja",
"bytes": "46306"
},
{
"name": "Makefile",
"bytes": "303"
},
{
"name": "PureBasic",
"bytes": "472"
},
{
"name": "Python",
"bytes": "659418"
},
{
"name": "Rust",
"bytes": "38417"
},
{
"name": "Shell",
"bytes": "177423"
},
{
"name": "Starlark",
"bytes": "1743784"
},
{
"name": "Thrift",
"bytes": "748"
}
],
"symlink_target": ""
} |
void thingo(void);
#endif | {
"content_hash": "710a689b0374ca3354d0a230ad4ead65",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 18,
"avg_line_length": 8.666666666666666,
"alnum_prop": 0.7307692307692307,
"repo_name": "uozuAho/doit_helpers",
"id": "34a615a18fe60869dd5d28ded2f26413772f95df",
"size": "59",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "examples/simple_c_proj/src/thing.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Makefile",
"bytes": "265"
},
{
"name": "Python",
"bytes": "39425"
}
],
"symlink_target": ""
} |
#if !defined (LOCKMANAGER_LOCKMGR_INTERNAL_WINDOWS_H)
#define LOCKMANAGER_LOCKMGR_INTERNAL_WINDOWS_H
// Windows defines some macros that interfere with regular C++
// source. We use this header to include windows.h and undefine such
// conflicting macros.
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
#undef min
#undef max
#endif // LOCKMANAGER_LOCKMGR_INTERNAL_WINDOWS_H
| {
"content_hash": "4695aabc2cff1a7da8ff88c3205a7687",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 68,
"avg_line_length": 26.5,
"alnum_prop": 0.7429245283018868,
"repo_name": "wilx/lockmgr",
"id": "7049b86701f826cbc0f24bf458d10be507c8a1f9",
"size": "1851",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "include/lockmgr/internal/windows.h",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "C",
"bytes": "1851"
},
{
"name": "C++",
"bytes": "98007"
},
{
"name": "CMake",
"bytes": "2213"
}
],
"symlink_target": ""
} |
//
// RNSharedElementNode.m
// react-native-shared-element
//
#import <UIKit/UIKit.h>
#import <React/RCTView.h>
#import "RNSharedElementNode.h"
#import "RNSharedElementContent.h"
#import <QuartzCore/QuartzCore.h>
@interface RNSharedElementNodeResolvedSource : NSObject
@property (nonatomic, readonly) UIView* view;
@property (nonatomic, readonly) BOOL hasChildImageView;
- (instancetype)initWithView:(UIView*) view hasChildImageView:(BOOL)hasChildImageView;
@end
@implementation RNSharedElementNodeResolvedSource
- (instancetype)initWithView:(UIView*) view hasChildImageView:(BOOL)hasChildImageView
{
_view = view;
_hasChildImageView = hasChildImageView;
return self;
}
+ (instancetype)sourceWithView:(UIView*) view {
return [[RNSharedElementNodeResolvedSource alloc]initWithView:view hasChildImageView:NO];
}
+ (instancetype)sourceWithView:(UIView*) view hasChildImageView:(BOOL)hasChildImageView {
return [[RNSharedElementNodeResolvedSource alloc]initWithView:view hasChildImageView:hasChildImageView];
}
- (UIView*) contentView {
return (_hasChildImageView && _view.subviews.count) ? _view.subviews[0] : _view;
}
@end
@implementation RNSharedElementNode
{
long _refCount;
long _hideRefCount;
NSMutableArray* _contentRequests;
RNSharedElementContent* _contentCache;
CFTimeInterval _contentCacheTimeInterval;
NSMutableArray* _styleRequests;
RNSharedElementStyle* _styleCache;
CFTimeInterval _styleCacheTimeInterval;
CADisplayLink* _displayLink;
__weak UIView* _sourceView;
RNSharedElementNodeResolvedSource* _resolvedSource;
}
@synthesize reactTag = _reactTag;
NSArray* _imageResolvers;
+ (void) setImageResolvers:(NSArray*) imageResolvers
{
_imageResolvers = imageResolvers;
}
- (instancetype)init:(NSNumber *)reactTag view:(UIView*) view isParent:(BOOL)isParent
{
_reactTag = reactTag;
_sourceView = view;
_isParent = isParent;
_refCount = 1;
_hideRefCount = 0;
_contentRequests = nil;
_contentCache = nil;
_contentCacheTimeInterval = 0.0;
_styleRequests = nil;
_styleCache = nil;
_styleCacheTimeInterval = 0.0;
_displayLink = nil;
_resolvedSource = [RNSharedElementNodeResolvedSource sourceWithView:nil];
[self updateResolvedSource:YES];
if (_isParent) [self addStyleObservers:_sourceView];
return self;
}
- (UIView*) view
{
return _resolvedSource ? _resolvedSource.view : nil;
}
- (void) updateResolvedSource:(BOOL)noReset
{
RNSharedElementNodeResolvedSource* resolvedSource = noReset
? [RNSharedElementNode resolveSource:_isParent ? _sourceView.subviews.firstObject : _sourceView]
: [RNSharedElementNodeResolvedSource sourceWithView:nil];
if ((_resolvedSource.view == resolvedSource.view) && (_resolvedSource.contentView == resolvedSource.contentView)) return;
// Remove old observers
if (_resolvedSource.view != nil && _resolvedSource.view != resolvedSource.view) {
if (_hideRefCount) _resolvedSource.view.hidden = NO;
[self removeStyleObservers: _resolvedSource.view];
}
if (_resolvedSource.contentView != nil && _resolvedSource.contentView != resolvedSource.contentView) {
[self removeContentObservers: _resolvedSource.contentView];
}
// Add new observers
if (resolvedSource.view != nil && _resolvedSource.view != resolvedSource.view) {
if (_hideRefCount) resolvedSource.view.hidden = YES;
[self addStyleObservers:resolvedSource.view];
}
if (resolvedSource.contentView != nil && _resolvedSource.contentView != resolvedSource.contentView) {
[self addContentObservers:resolvedSource.contentView];
}
// Update resolved source
_resolvedSource = resolvedSource;
}
+ (RNSharedElementNodeResolvedSource*) resolveSource:(UIView*) view
{
if (view == nil || _imageResolvers == nil) return [RNSharedElementNodeResolvedSource sourceWithView:view];
// If the view is an ImageView, then use that.
if ([RNSharedElementContent isKindOfImageView:view]) {
return [RNSharedElementNodeResolvedSource sourceWithView:view];
}
// In case the view contains a single UIImageView child
// which is also the same size as the parent, then
// use child image-view. This fixes <ImageBackground>.
UIView* subview = view;
for (int i = 0; i < 2; i++) {
if (subview.subviews.count != 1) break;
subview = subview.subviews.firstObject;
if ([RNSharedElementContent isKindOfImageView:subview]) {
CGRect bounds = view.bounds;
if ([view isKindOfClass:[RCTView class]]) {
RCTView* rctView = (RCTView*) view;
CGFloat borderWidth = rctView.borderWidth;
if (borderWidth > 0.0f) {
bounds.origin.x += borderWidth;
bounds.origin.y += borderWidth;
bounds.size.width -= (borderWidth * 2.0f);
bounds.size.height -= (borderWidth * 2.0f);
}
}
if (CGRectEqualToRect(subview.frame, bounds)) {
//NSLog(@"RESOLVED IMAGE VIEW, frame: %@, bounds: %@", NSStringFromCGRect(subview.frame), NSStringFromCGRect(bounds));
return [RNSharedElementNodeResolvedSource sourceWithView:view hasChildImageView:YES];
}
}
}
// Resolve the underlying ImageViews of well known
// react-native libs (e.g. react-native-fast-image)
for (NSArray* imageResolver in _imageResolvers) {
NSArray* subviews = @[view];
UIView* foundImageView = nil;
for (NSString* name in imageResolver) {
foundImageView = nil;
for (UIView* subview in subviews) {
if ([name isEqualToString:NSStringFromClass(subview.class)]) {
foundImageView = subview;
subviews = subview.subviews;
break;
}
}
}
if (foundImageView != nil) {
return [RNSharedElementNodeResolvedSource sourceWithView:foundImageView];
}
}
return [RNSharedElementNodeResolvedSource sourceWithView:view];
}
- (void) addStyleObservers:(UIView*)view
{
[view addObserver:self forKeyPath:@"bounds" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:nil];
[view addObserver:self forKeyPath:@"frame" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:nil];
}
- (void) removeStyleObservers:(UIView*)view
{
[view removeObserver:self forKeyPath:@"bounds"];
[view removeObserver:self forKeyPath:@"frame"];
}
- (void) addContentObservers:(UIView*)view
{
if ([RNSharedElementContent isKindOfImageView:view]) {
UIImageView* imageView = [RNSharedElementContent imageViewFromView:view];
[imageView addObserver:self forKeyPath:@"image" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:nil];
}
}
- (void) removeContentObservers:(UIView*)view
{
if ([RNSharedElementContent isKindOfImageView:view]) {
UIImageView* imageView = [RNSharedElementContent imageViewFromView:view];
[imageView removeObserver:self forKeyPath:@"image"];
}
}
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
//NSLog(@"observeValueForKeyPath: %@, changed: %@", keyPath, change);
if ([keyPath isEqualToString:@"image"]) {
[self updateContent];
} else {
[self updateStyle];
}
}
- (void) setRefCount:(long)refCount {
_refCount = refCount;
if (_refCount == 0) {
if (_displayLink != nil) {
[_displayLink removeFromRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];
_displayLink = nil;
}
[self updateResolvedSource:NO];
if (_isParent && (_sourceView != nil)) {
[self removeStyleObservers:_sourceView];
}
}
}
- (long) refCount {
return _refCount;
}
- (void) setHideRefCount:(long)refCount
{
_hideRefCount = refCount;
if (_hideRefCount == 1) {
if (_resolvedSource.view != nil) _resolvedSource.view.hidden = YES;
}
else if (_hideRefCount == 0) {
if (_resolvedSource.view != nil) _resolvedSource.view.hidden = NO;
}
}
- (long) hideRefCount
{
return _hideRefCount;
}
- (void) requestContent:(__weak id <RNSharedElementDelegate>) delegate
{
if (_contentCache != nil && ((CACurrentMediaTime() - _contentCacheTimeInterval) <= 0.3)) {
[delegate didLoadContent:_contentCache node:self];
return;
}
if (_contentRequests == nil) _contentRequests = [[NSMutableArray alloc]init];
[_contentRequests addObject:delegate];
[self updateContent];
}
- (void) updateContent
{
// Update the resolved source
[self updateResolvedSource:YES];
RNSharedElementNodeResolvedSource* resolvedSource = _resolvedSource;
UIView* view = resolvedSource.view;
UIView* contentView = resolvedSource.contentView;
if (view == nil) return;
if (_contentRequests == nil) return;
CGRect bounds = view.bounds;
CGRect frame = contentView.frame;
if (!bounds.size.width || !bounds.size.height) {
return;
}
// Obtain snapshot content
RNSharedElementContent* content;
if ([RNSharedElementContent isKindOfImageView:contentView]) {
UIImageView* imageView = [RNSharedElementContent imageViewFromView:contentView];
UIImage* image = imageView.image;
UIEdgeInsets imageInsets = UIEdgeInsetsZero;
if (contentView != view) {
imageInsets.left = frame.origin.x;
imageInsets.top = frame.origin.y;
imageInsets.right = bounds.size.width - frame.size.width - frame.origin.x;
imageInsets.bottom = bounds.size.height - frame.size.height - frame.origin.y;
}
content = [[RNSharedElementContent alloc]initWithData:image type:RNSharedElementContentTypeRawImage insets:imageInsets];
}
else if ([NSStringFromClass(view.class) isEqualToString:@"RCTView"] && !view.subviews.count) {
UIView* dummyView = [[UIView alloc]init];
content = [[RNSharedElementContent alloc]initWithData:dummyView type:RNSharedElementContentTypeSnapshotView insets:UIEdgeInsetsZero];
}
else {
UIView* snapshotView = [view snapshotViewAfterScreenUpdates:NO];
content = [[RNSharedElementContent alloc]initWithData:snapshotView type:RNSharedElementContentTypeSnapshotView insets:UIEdgeInsetsZero];
}
/*else {
NSLog(@"drawViewHierarchyInRect: bounds: %@", NSStringFromCGRect(bounds));
UIGraphicsBeginImageContextWithOptions(bounds.size, NO, 0.0f);
BOOL res = [view drawViewHierarchyInRect:bounds afterScreenUpdates:NO]; // NEVER USE YES, IT CREATED VISUAL ARTEFACTS ON THE CREEN
UIImage* image = res ? UIGraphicsGetImageFromCurrentImageContext() : nil;
UIGraphicsEndImageContext();
NSLog(@"drawViewHierarchyInRect: RESULT: %li", res);
content = image;
contentType = RNSharedElementContentTypeSnapshotImage;
}*/
// If the content could not be obtained, then try again later
if (content == nil || content.data == nil) {
return [self updateRetryLoop];
}
// NSLog(@"Content fetched: %@, size: %@", content, NSStringFromCGSize(bounds.size));
_contentCache = content;
_contentCacheTimeInterval = CACurrentMediaTime();
NSArray* delegates = _contentRequests;
_contentRequests = nil;
[self updateRetryLoop];
for (__weak id <RNSharedElementDelegate> delegate in delegates) {
if (delegate != nil) {
[delegate didLoadContent:content node:self];
}
}
}
- (void) requestStyle:(__weak id <RNSharedElementDelegate>) delegate
{
if (_styleCache != nil && ((CACurrentMediaTime() - _styleCacheTimeInterval) <= 0.3)) {
[delegate didLoadStyle:_styleCache node:self];
return;
}
if (_styleRequests == nil) _styleRequests = [[NSMutableArray alloc]init];
[_styleRequests addObject:delegate];
[self updateStyle];
}
- (void) updateStyle
{
[self updateResolvedSource:YES];
RNSharedElementNodeResolvedSource* resolvedSource = _resolvedSource;
UIView* view = resolvedSource.view;
UIView* contentView = resolvedSource.contentView;
if (_styleRequests == nil) return;
if (view == nil) return;
// If the window could not be obtained, then try again later
if (view.window == nil) {
return [self updateRetryLoop];
}
// Get absolute layout
CGRect layout = [view convertRect:view.bounds toView:nil];
if (CGRectIsEmpty(layout)) return;
// Create style
RNSharedElementStyle* style = [[RNSharedElementStyle alloc]initWithView:view];
style.layout = layout;
if ([RNSharedElementContent isKindOfImageView:contentView]) {
UIImageView* imageView = [RNSharedElementContent imageViewFromView:contentView];
style.contentMode = imageView.contentMode;
} else {
style.contentMode = view.contentMode;
}
/* NSLog(@"Style fetched, window: %@, alpha: %f, hidden: %@, parent: %@, layout: %@, realSize: %@, opacity: %lf, transform: %@, borderWidth: %lf, contentMode: %ld", view.window, view.alpha, @(view.hidden), @(_isParent), NSStringFromCGRect(layout), NSStringFromCGSize(style.size), style.opacity, [RNSharedElementStyle stringFromTransform:style.transform], style.borderWidth, style.contentMode); */
_styleCache = style;
_styleCacheTimeInterval = CACurrentMediaTime();
NSArray* delegates = _styleRequests;
_styleRequests = nil;
[self updateRetryLoop];
for (__weak id <RNSharedElementDelegate> delegate in delegates) {
if (delegate != nil) {
[delegate didLoadStyle:style node:self];
}
}
}
- (void) cancelRequests:(id <RNSharedElementDelegate>) delegate
{
if (_styleRequests != nil) [_styleRequests removeObject:delegate];
if (_contentRequests != nil) [_contentRequests removeObject:delegate];
}
- (void)updateRetryLoop
{
BOOL shouldRun = _styleRequests != nil || _contentRequests != nil;
if (shouldRun && _displayLink == nil) {
_displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(onDisplayLinkUpdate:)];
[_displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];
} else if (!shouldRun && _displayLink != nil) {
[_displayLink removeFromRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];
_displayLink = nil;
}
}
- (void)onDisplayLinkUpdate:(CADisplayLink *)sender
{
// NSLog(@"onDisplayLinkUpdate");
if (_styleRequests != nil) [self updateStyle];
if (_contentRequests != nil) [self updateContent];
}
@end
| {
"content_hash": "5bb186e7c8c8198d448fc8544b4d16bb",
"timestamp": "",
"source": "github",
"line_count": 408,
"max_line_length": 398,
"avg_line_length": 34.345588235294116,
"alnum_prop": 0.7199743095696853,
"repo_name": "exponent/exponent",
"id": "09ecc2695c6ae09a993461ac53a05afb6c487888",
"size": "14013",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "ios/Exponent/Versioned/Core/Api/Components/SharedElement/RNSharedElementNode.m",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "113276"
},
{
"name": "Batchfile",
"bytes": "127"
},
{
"name": "C",
"bytes": "1744836"
},
{
"name": "C++",
"bytes": "1801159"
},
{
"name": "CSS",
"bytes": "7854"
},
{
"name": "HTML",
"bytes": "176329"
},
{
"name": "IDL",
"bytes": "897"
},
{
"name": "Java",
"bytes": "6251130"
},
{
"name": "JavaScript",
"bytes": "4416558"
},
{
"name": "Makefile",
"bytes": "18061"
},
{
"name": "Objective-C",
"bytes": "13971362"
},
{
"name": "Objective-C++",
"bytes": "725480"
},
{
"name": "Perl",
"bytes": "5860"
},
{
"name": "Prolog",
"bytes": "287"
},
{
"name": "Python",
"bytes": "125673"
},
{
"name": "Ruby",
"bytes": "61190"
},
{
"name": "Shell",
"bytes": "4441"
}
],
"symlink_target": ""
} |
#ifndef BOOST_PROTO_FUSION_HPP_EAN_11_04_2006
#define BOOST_PROTO_FUSION_HPP_EAN_11_04_2006
#include <boost/config.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/long.hpp>
#include <boost/mpl/sequence_tag_fwd.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/fusion/include/is_view.hpp>
#include <boost/fusion/include/tag_of_fwd.hpp>
#include <boost/fusion/include/category_of.hpp>
#include <boost/fusion/include/iterator_base.hpp>
#include <boost/fusion/include/intrinsic.hpp>
#include <boost/fusion/include/single_view.hpp>
#include <boost/fusion/include/transform_view.hpp>
#include <boost/fusion/support/ext_/is_segmented.hpp>
#include <boost/fusion/sequence/intrinsic/ext_/segments.hpp>
#include <boost/fusion/sequence/intrinsic/ext_/size_s.hpp>
#include <boost/fusion/sequence/comparison/enable_comparison.hpp>
#include <boost/fusion/view/ext_/segmented_iterator.hpp>
#include <boost/proto/proto_fwd.hpp>
#include <boost/proto/traits.hpp>
#include <boost/proto/eval.hpp>
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable : 4510) // default constructor could not be generated
#pragma warning(disable : 4512) // assignment operator could not be generated
#pragma warning(disable : 4610) // can never be instantiated - user defined constructor required
#endif
namespace boost { namespace proto
{
namespace detail
{
template<typename Expr, long Pos>
struct expr_iterator
: fusion::iterator_base<expr_iterator<Expr, Pos> >
{
typedef Expr expr_type;
typedef typename Expr::proto_tag proto_tag;
BOOST_STATIC_CONSTANT(long, index = Pos);
typedef fusion::random_access_traversal_tag category;
typedef tag::proto_expr_iterator fusion_tag;
expr_iterator(Expr &e)
: expr(e)
{}
Expr &expr;
};
template<typename Expr>
struct flat_view
{
typedef Expr expr_type;
typedef typename Expr::proto_tag proto_tag;
typedef fusion::forward_traversal_tag category;
typedef tag::proto_flat_view fusion_tag;
explicit flat_view(Expr &e)
: expr_(e)
{}
Expr &expr_;
};
template<typename Tag>
struct as_element
{
template<typename Sig>
struct result;
template<typename This, typename Expr>
struct result<This(Expr)>
: result<This(Expr const &)>
{};
template<typename This, typename Expr>
struct result<This(Expr &)>
: mpl::if_c<
is_same<Tag, typename Expr::proto_tag>::value
, flat_view<Expr>
, fusion::single_view<Expr &>
>
{};
template<typename Expr>
typename result<as_element(Expr &)>::type const
operator ()(Expr &e) const
{
return typename result<as_element(Expr &)>::type(e);
}
template<typename Expr>
typename result<as_element(Expr const &)>::type const
operator ()(Expr const &e) const
{
return typename result<as_element(Expr const &)>::type(e);
}
};
}
namespace result_of
{
template<typename Expr>
struct flatten
: flatten<Expr const &>
{};
template<typename Expr>
struct flatten<Expr &>
{
typedef detail::flat_view<Expr> type;
};
}
namespace functional
{
/// \brief A PolymorphicFunctionObject type that returns a "flattened"
/// view of a Proto expression tree.
///
/// A PolymorphicFunctionObject type that returns a "flattened"
/// view of a Proto expression tree. For a tree with a top-most node
/// tag of type \c T, the elements of the flattened sequence are
/// determined by recursing into each child node with the same
/// tag type and returning those nodes of different type. So for
/// instance, the Proto expression tree corresponding to the
/// expression <tt>a | b | c</tt> has a flattened view with elements
/// [a, b, c], even though the tree is grouped as
/// <tt>((a | b) | c)</tt>.
struct flatten
{
BOOST_PROTO_CALLABLE()
template<typename Sig>
struct result;
template<typename This, typename Expr>
struct result<This(Expr)>
: result<This(Expr const &)>
{};
template<typename This, typename Expr>
struct result<This(Expr &)>
{
typedef proto::detail::flat_view<Expr> type;
};
template<typename Expr>
proto::detail::flat_view<Expr> const
operator ()(Expr &e) const
{
return proto::detail::flat_view<Expr>(e);
}
template<typename Expr>
proto::detail::flat_view<Expr const> const
operator ()(Expr const &e) const
{
return proto::detail::flat_view<Expr const>(e);
}
};
}
/// \brief A function that returns a "flattened"
/// view of a Proto expression tree.
///
/// For a tree with a top-most node
/// tag of type \c T, the elements of the flattened sequence are
/// determined by recursing into each child node with the same
/// tag type and returning those nodes of different type. So for
/// instance, the Proto expression tree corresponding to the
/// expression <tt>a | b | c</tt> has a flattened view with elements
/// [a, b, c], even though the tree is grouped as
/// <tt>((a | b) | c)</tt>.
template<typename Expr>
proto::detail::flat_view<Expr> const
flatten(Expr &e)
{
return proto::detail::flat_view<Expr>(e);
}
/// \overload
///
template<typename Expr>
proto::detail::flat_view<Expr const> const
flatten(Expr const &e)
{
return proto::detail::flat_view<Expr const>(e);
}
/// INTERNAL ONLY
///
template<typename Context>
struct eval_fun
: proto::callable
{
explicit eval_fun(Context &ctx)
: ctx_(ctx)
{}
template<typename Sig>
struct result;
template<typename This, typename Expr>
struct result<This(Expr)>
: result<This(Expr const &)>
{};
template<typename This, typename Expr>
struct result<This(Expr &)>
: proto::result_of::eval<Expr, Context>
{};
template<typename Expr>
typename proto::result_of::eval<Expr, Context>::type
operator ()(Expr &e) const
{
return proto::eval(e, this->ctx_);
}
template<typename Expr>
typename proto::result_of::eval<Expr const, Context>::type
operator ()(Expr const &e) const
{
return proto::eval(e, this->ctx_);
}
private:
Context &ctx_;
};
/// INTERNAL ONLY
///
template<typename Context>
struct is_callable<eval_fun<Context> >
: mpl::true_
{};
}}
namespace boost { namespace fusion
{
namespace extension
{
template<typename Tag>
struct is_sequence_impl;
template<>
struct is_sequence_impl<proto::tag::proto_flat_view>
{
template<typename Sequence>
struct apply
: mpl::true_
{};
};
template<>
struct is_sequence_impl<proto::tag::proto_expr>
{
template<typename Sequence>
struct apply
: mpl::true_
{};
};
template<typename Tag>
struct is_view_impl;
template<>
struct is_view_impl<proto::tag::proto_flat_view>
{
template<typename Sequence>
struct apply
: mpl::true_
{};
};
template<>
struct is_view_impl<proto::tag::proto_expr>
{
template<typename Sequence>
struct apply
: mpl::false_
{};
};
template<typename Tag>
struct value_of_impl;
template<>
struct value_of_impl<proto::tag::proto_expr_iterator>
{
template<
typename Iterator
, long Arity = proto::arity_of<typename Iterator::expr_type>::value
>
struct apply
{
typedef
typename proto::result_of::child_c<
typename Iterator::expr_type
, Iterator::index
>::value_type
type;
};
template<typename Iterator>
struct apply<Iterator, 0>
{
typedef
typename proto::result_of::value<
typename Iterator::expr_type
>::value_type
type;
};
};
template<typename Tag>
struct deref_impl;
template<>
struct deref_impl<proto::tag::proto_expr_iterator>
{
template<
typename Iterator
, long Arity = proto::arity_of<typename Iterator::expr_type>::value
>
struct apply
{
typedef
typename proto::result_of::child_c<
typename Iterator::expr_type &
, Iterator::index
>::type
type;
static type call(Iterator const &iter)
{
return proto::child_c<Iterator::index>(iter.expr);
}
};
template<typename Iterator>
struct apply<Iterator, 0>
{
typedef
typename proto::result_of::value<
typename Iterator::expr_type &
>::type
type;
static type call(Iterator const &iter)
{
return proto::value(iter.expr);
}
};
};
template<typename Tag>
struct advance_impl;
template<>
struct advance_impl<proto::tag::proto_expr_iterator>
{
template<typename Iterator, typename N>
struct apply
{
typedef
typename proto::detail::expr_iterator<
typename Iterator::expr_type
, Iterator::index + N::value
>
type;
static type call(Iterator const &iter)
{
return type(iter.expr);
}
};
};
template<typename Tag>
struct distance_impl;
template<>
struct distance_impl<proto::tag::proto_expr_iterator>
{
template<typename IteratorFrom, typename IteratorTo>
struct apply
: mpl::long_<IteratorTo::index - IteratorFrom::index>
{};
};
template<typename Tag>
struct next_impl;
template<>
struct next_impl<proto::tag::proto_expr_iterator>
{
template<typename Iterator>
struct apply
: advance_impl<proto::tag::proto_expr_iterator>::template apply<Iterator, mpl::long_<1> >
{};
};
template<typename Tag>
struct prior_impl;
template<>
struct prior_impl<proto::tag::proto_expr_iterator>
{
template<typename Iterator>
struct apply
: advance_impl<proto::tag::proto_expr_iterator>::template apply<Iterator, mpl::long_<-1> >
{};
};
template<typename Tag>
struct category_of_impl;
template<>
struct category_of_impl<proto::tag::proto_expr>
{
template<typename Sequence>
struct apply
{
typedef random_access_traversal_tag type;
};
};
template<typename Tag>
struct size_impl;
template<>
struct size_impl<proto::tag::proto_expr>
{
template<typename Sequence>
struct apply
: mpl::long_<0 == Sequence::proto_arity_c ? 1 : Sequence::proto_arity_c>
{};
};
template<typename Tag>
struct begin_impl;
template<>
struct begin_impl<proto::tag::proto_expr>
{
template<typename Sequence>
struct apply
{
typedef proto::detail::expr_iterator<Sequence, 0> type;
static type call(Sequence &seq)
{
return type(seq);
}
};
};
template<typename Tag>
struct end_impl;
template<>
struct end_impl<proto::tag::proto_expr>
{
template<typename Sequence>
struct apply
{
typedef
proto::detail::expr_iterator<
Sequence
, 0 == Sequence::proto_arity_c ? 1 : Sequence::proto_arity_c
>
type;
static type call(Sequence &seq)
{
return type(seq);
}
};
};
template<typename Tag>
struct value_at_impl;
template<>
struct value_at_impl<proto::tag::proto_expr>
{
template<
typename Sequence
, typename Index
, long Arity = proto::arity_of<Sequence>::value
>
struct apply
{
typedef
typename proto::result_of::child_c<
Sequence
, Index::value
>::value_type
type;
};
template<typename Sequence, typename Index>
struct apply<Sequence, Index, 0>
{
typedef
typename proto::result_of::value<
Sequence
>::value_type
type;
};
};
template<typename Tag>
struct at_impl;
template<>
struct at_impl<proto::tag::proto_expr>
{
template<
typename Sequence
, typename Index
, long Arity = proto::arity_of<Sequence>::value
>
struct apply
{
typedef
typename proto::result_of::child_c<
Sequence &
, Index::value
>::type
type;
static type call(Sequence &seq)
{
return proto::child_c<Index::value>(seq);
}
};
template<typename Sequence, typename Index>
struct apply<Sequence, Index, 0>
{
typedef
typename proto::result_of::value<
Sequence &
>::type
type;
static type call(Sequence &seq)
{
return proto::value(seq);
}
};
};
template<typename Tag>
struct is_segmented_impl;
template<>
struct is_segmented_impl<proto::tag::proto_flat_view>
{
template<typename Iterator>
struct apply
: mpl::true_
{};
};
template<typename Tag>
struct segments_impl;
template<>
struct segments_impl<proto::tag::proto_flat_view>
{
template<typename Sequence>
struct apply
{
typedef typename Sequence::proto_tag proto_tag;
typedef fusion::transform_view<
typename Sequence::expr_type
, proto::detail::as_element<proto_tag>
> type;
static type call(Sequence &sequence)
{
return type(sequence.expr_, proto::detail::as_element<proto_tag>());
}
};
};
template<>
struct category_of_impl<proto::tag::proto_flat_view>
{
template<typename Sequence>
struct apply
{
typedef forward_traversal_tag type;
};
};
template<>
struct begin_impl<proto::tag::proto_flat_view>
{
template<typename Sequence>
struct apply
: fusion::segmented_begin<Sequence>
{};
};
template<>
struct end_impl<proto::tag::proto_flat_view>
{
template<typename Sequence>
struct apply
: fusion::segmented_end<Sequence>
{};
};
template<>
struct size_impl<proto::tag::proto_flat_view>
{
template<typename Sequence>
struct apply
: fusion::segmented_size<Sequence>
{};
};
}
namespace traits
{
template<typename Seq1, typename Seq2>
struct enable_equality<
Seq1
, Seq2
, typename enable_if_c<
mpl::or_<
proto::is_expr<Seq1>
, proto::is_expr<Seq2>
>::value
>::type
>
: mpl::false_
{};
template<typename Seq1, typename Seq2>
struct enable_comparison<
Seq1
, Seq2
, typename enable_if_c<
mpl::or_<
proto::is_expr<Seq1>
, proto::is_expr<Seq2>
>::value
>::type
>
: mpl::false_
{};
}
}}
namespace boost { namespace mpl
{
template<typename Tag, typename Args, long Arity>
struct sequence_tag< proto::expr<Tag, Args, Arity> >
{
typedef fusion::fusion_sequence_tag type;
};
template<typename Tag, typename Args, long Arity>
struct sequence_tag< proto::basic_expr<Tag, Args, Arity> >
{
typedef fusion::fusion_sequence_tag type;
};
}}
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#endif
| {
"content_hash": "2a28adbfc4d856d7db814f8feae981e7",
"timestamp": "",
"source": "github",
"line_count": 687,
"max_line_length": 104,
"avg_line_length": 28.48471615720524,
"alnum_prop": 0.47452603607746946,
"repo_name": "pennwin2013/netsvr",
"id": "ec638a0407497a406e4f163c52cf106ff67ae51d",
"size": "19922",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "include/boost/proto/fusion.hpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "67355"
},
{
"name": "C++",
"bytes": "52439988"
},
{
"name": "Python",
"bytes": "2525"
}
],
"symlink_target": ""
} |
<?php
/**
* @file
* Contains \Drupal\system\Tests\Theme\TwigDebugMarkupTest.
*/
namespace Drupal\system\Tests\Theme;
use Drupal\simpletest\WebTestBase;
/**
* Tests for Twig debug markup.
*
* @group Theme
*/
class TwigDebugMarkupTest extends WebTestBase {
/**
* Modules to enable.
*
* @var array
*/
public static $modules = array('theme_test', 'node');
/**
* Tests debug markup added to Twig template output.
*/
function testTwigDebugMarkup() {
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = $this->container->get('renderer');
$extension = twig_extension();
\Drupal::service('theme_handler')->install(array('test_theme'));
$this->config('system.theme')->set('default', 'test_theme')->save();
$this->drupalCreateContentType(array('type' => 'page'));
// Enable debug, rebuild the service container, and clear all caches.
$parameters = $this->container->getParameter('twig.config');
$parameters['debug'] = TRUE;
$this->setContainerParameter('twig.config', $parameters);
$this->rebuildContainer();
$this->resetAll();
$cache = $this->container->get('theme.registry')->get();
// Create array of Twig templates.
$templates = drupal_find_theme_templates($cache, $extension, drupal_get_path('theme', 'test_theme'));
$templates += drupal_find_theme_templates($cache, $extension, drupal_get_path('module', 'node'));
// Create a node and test different features of the debug markup.
$node = $this->drupalCreateNode();
$build = node_view($node);
$output = $renderer->renderRoot($build);
$this->assertTrue(strpos($output, '<!-- THEME DEBUG -->') !== FALSE, 'Twig debug markup found in theme output when debug is enabled.');
$this->setRawContent($output);
$this->assertTrue(strpos($output, "THEME HOOK: 'node'") !== FALSE, 'Theme call information found.');
$this->assertTrue(strpos($output, '* node--1--full' . $extension . PHP_EOL . ' x node--1' . $extension . PHP_EOL . ' * node--page--full' . $extension . PHP_EOL . ' * node--page' . $extension . PHP_EOL . ' * node--full' . $extension . PHP_EOL . ' * node' . $extension) !== FALSE, 'Suggested template files found in order and node ID specific template shown as current template.');
$this->assertEscaped('node--<script type="text/javascript">alert(\'yo\');</script>');
$template_filename = $templates['node__1']['path'] . '/' . $templates['node__1']['template'] . $extension;
$this->assertTrue(strpos($output, "BEGIN OUTPUT from '$template_filename'") !== FALSE, 'Full path to current template file found.');
// Create another node and make sure the template suggestions shown in the
// debug markup are correct.
$node2 = $this->drupalCreateNode();
$build = node_view($node2);
$output = $renderer->renderRoot($build);
$this->assertTrue(strpos($output, '* node--2--full' . $extension . PHP_EOL . ' * node--2' . $extension . PHP_EOL . ' * node--page--full' . $extension . PHP_EOL . ' * node--page' . $extension . PHP_EOL . ' * node--full' . $extension . PHP_EOL . ' x node' . $extension) !== FALSE, 'Suggested template files found in order and base template shown as current template.');
// Create another node and make sure the template suggestions shown in the
// debug markup are correct.
$node3 = $this->drupalCreateNode();
$build = array('#theme' => 'node__foo__bar');
$build += node_view($node3);
$output = $renderer->renderRoot($build);
$this->assertTrue(strpos($output, "THEME HOOK: 'node__foo__bar'") !== FALSE, 'Theme call information found.');
$this->assertTrue(strpos($output, '* node--foo--bar' . $extension . PHP_EOL . ' * node--foo' . $extension . PHP_EOL . ' * node--<script type="text/javascript">alert('yo');</script>' . $extension . PHP_EOL . ' * node--3--full' . $extension . PHP_EOL . ' * node--3' . $extension . PHP_EOL . ' * node--page--full' . $extension . PHP_EOL . ' * node--page' . $extension . PHP_EOL . ' * node--full' . $extension . PHP_EOL . ' x node' . $extension) !== FALSE, 'Suggested template files found in order and base template shown as current template.');
// Disable debug, rebuild the service container, and clear all caches.
$parameters = $this->container->getParameter('twig.config');
$parameters['debug'] = FALSE;
$this->setContainerParameter('twig.config', $parameters);
$this->rebuildContainer();
$this->resetAll();
$build = node_view($node);
$output = $renderer->renderRoot($build);
$this->assertFalse(strpos($output, '<!-- THEME DEBUG -->') !== FALSE, 'Twig debug markup not found in theme output when debug is disabled.');
}
}
| {
"content_hash": "7a5246c78a4ad992f1271766e1eedbc4",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 593,
"avg_line_length": 54.04545454545455,
"alnum_prop": 0.6421362489486964,
"repo_name": "fian005/asiavia_dev",
"id": "1b330d0d37f78a11a9cc0c2bf252dcf260ce5299",
"size": "4756",
"binary": false,
"copies": "199",
"ref": "refs/heads/master",
"path": "core/modules/system/src/Tests/Theme/TwigDebugMarkupTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "34257"
},
{
"name": "C++",
"bytes": "50616"
},
{
"name": "CSS",
"bytes": "419955"
},
{
"name": "HTML",
"bytes": "488556"
},
{
"name": "JavaScript",
"bytes": "853618"
},
{
"name": "PHP",
"bytes": "28482046"
},
{
"name": "Shell",
"bytes": "47922"
}
],
"symlink_target": ""
} |
require 'rails_helper'
RSpec.describe Hyrax::EtdsController do
it "has tests" do
skip "Add your tests here"
end
end
| {
"content_hash": "596fcdccba2c2fb278622849607eefa8",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 39,
"avg_line_length": 17.857142857142858,
"alnum_prop": 0.72,
"repo_name": "RepoCamp/JabaJc",
"id": "f97b0710ec675c729852889dbd4c90e407fdf59c",
"size": "176",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/controllers/hyrax/etds_controller_spec.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1239"
},
{
"name": "HTML",
"bytes": "9212"
},
{
"name": "JavaScript",
"bytes": "1477"
},
{
"name": "Ruby",
"bytes": "166973"
},
{
"name": "XSLT",
"bytes": "46036"
}
],
"symlink_target": ""
} |
using FrameworkLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Web.UI.WebControls;
namespace WebApplication.Admin.Controls.Fields
{
public class ControlsHolder
{
public Panel AdminPanel { get; set; }
public Panel FrontEndPanel { get; set; }
public PlaceHolder DynamicContent { get; set; }
}
public abstract class BaseFieldControl : System.Web.UI.UserControl, IFieldControl
{
public virtual void Page_PreRender(object sender, EventArgs e)
{
if (BasePage.IsInAdminSection)
{
RenderControlInAdmin();
}
else
{
RenderControlInFrontEnd();
}
}
public long FieldID { get; set; }
private MediaDetailField _field = null;
public new bool IsPostBack
{
get
{
return HttpContext.Current.Request.HttpMethod == "POST";
}
}
public MediaDetailField GetField()
{
if (_field != null)
return _field;
_field = (MediaDetailField)BaseMapper.GetDataModel().Fields.Find(FieldID);
if (_field == null)
_field = new MediaDetailField();
return _field;
}
public abstract void SetValue(object value);
public abstract object GetValue();
public ControlsHolder GetControlsHolder()
{
var adminPanel = (Panel)this.FindControl("AdminPanel");
var frontEndPanel = (Panel)this.FindControl("FrontEndPanel");
var dynamicContent = (PlaceHolder)this.FindControl("DynamicContent");
if (adminPanel == null || frontEndPanel == null)
throw new Exception("You must have 3 controls, 2 panels with the IDs 'AdminPanel' and 'FrontEndPanel' and 1 PlaceHolder control inside the frontend control called 'DynamicContent'");
return new ControlsHolder { AdminPanel = adminPanel, FrontEndPanel = frontEndPanel, DynamicContent = dynamicContent };
}
public virtual void RenderControlInAdmin()
{
var controlsHolder = GetControlsHolder();
controlsHolder.AdminPanel.Visible = true;
controlsHolder.FrontEndPanel.Visible = false;
}
public virtual void RenderControlInFrontEnd()
{
var controlsHolder = GetControlsHolder();
controlsHolder.AdminPanel.Visible = false;
controlsHolder.FrontEndPanel.Visible = true;
var found = GetField();
var code = found.FrontEndLayout;
if (found.UseMediaTypeFieldFrontEndLayout && found.MediaTypeField != null)
code = found.MediaTypeField.FrontEndLayout;
var data = ParserHelper.ParseData(code, found);
data = ParserHelper.ParseData(data, found);
controlsHolder.DynamicContent.Controls.Add(this.ParseControl(data));
}
}
} | {
"content_hash": "7206ccb7a232bc5eb882c7e93ef1cce0",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 198,
"avg_line_length": 30.821782178217823,
"alnum_prop": 0.6061676839061998,
"repo_name": "MacdonaldRobinson/FlexDotnetCMS",
"id": "d7e5779a6455af7c1789ccfe6bc176bfd9f38cfd",
"size": "3115",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "WebApplication/Admin/Controls/Fields/BaseFieldControl.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP.NET",
"bytes": "373529"
},
{
"name": "C#",
"bytes": "1165892"
},
{
"name": "CSS",
"bytes": "111904"
},
{
"name": "HTML",
"bytes": "85392"
},
{
"name": "JavaScript",
"bytes": "765962"
},
{
"name": "SCSS",
"bytes": "174495"
}
],
"symlink_target": ""
} |
"""iriot URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^accounts/', include('accounts.urls', namespace="accounts")),
url(r'^rooms/', include('rooms.urls', namespace="rooms")),
url(r'^hubs/', include('hubs.urls', namespace="hubs")),
url(r'^devices/', include('devices.urls', namespace="devices")),
url(r'^', include('master.urls', namespace="master")),
]
| {
"content_hash": "d6d8f53400122bcfcf7d7d1393d1f4f7",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 79,
"avg_line_length": 42.03846153846154,
"alnum_prop": 0.6797804208600183,
"repo_name": "j-windsor/iRiot-WebApp",
"id": "3b91e82aed9113eb96847b2b20aab02c5eb2c5ff",
"size": "1093",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "iriot/urls.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "23695"
},
{
"name": "Python",
"bytes": "46591"
},
{
"name": "Shell",
"bytes": "3258"
}
],
"symlink_target": ""
} |
%make evenly spaced points on the color circle
hue=0:.002:1;
%calculate the difference in hue between all the points
%setup matrices with values of hue1 and hue2
[h1,h2]=meshgrid(hue,hue);
%calculate the absolute difference
dhue=abs(h1-h2);
%for hues more than .5 apart, take the complement distance which is smaller
badones=find(dhue>.5);
dhue(badones)=1-dhue(badones);
%we want constant saturation and value for our HSV values
saturation=ones(size(hue));
value=ones(size(hue));
%construct an hsv colormap
hsv=[hue;saturation;value]';
%plot out our color wheel
figure(1);
clf;
%calculate the x and y positions
x=cos(hue*2*pi);
y=sin(hue*2*pi);
%scatter plot the results using our hsv values to color them
scatter(x,y,10,hsv2rgb(hsv));
%load the data
data=load('synapsinR_7thA.tif.Pivots.txt.Features.txt');
numchannels=size(data,2)/6;
goodones=1:size(data,2);
goodones=reshape(goodones',6,numchannels)';
goodones=goodones(:,1:4)';
goodones=goodones(:);
data=data(:,goodones);
%N is the number of synapses
N=size(data,1);
%M is the number of features
M=size(data,2);
%%
%K is the number of points in our kohonen network
K=length(hue);
%calculate the min, max, range, standard deviation and mean
%of every feature
maxvals=max(data,1);
minvals=min(data,1);
range=maxvals-minvals;
stds=std(data,[],1);
means=mean(data,1);
%normalize the data, by subtracting the mean and dividing by the standard
%deviation of every feature
data=(data-repmat(means,N,1))./repmat(stds,N,1);
%start out with random positions for each member of the kohonen network
%in this normalized space. Each row is a member of our network along the
%color wheel, each column is the value in the dimension of the feature space.
positions=randn(K,M);
%%
%loop through time
T=50000;
counts=zeros(1,K);
for t=1:T
%have a factor which gets smaller and smaller over time
eta=.3*exp(-t/(T/5))+1*exp(-t/(100));
%define the coefficents which will modulate the pull of all the other hues
%when you pull on one.
sig_hue=.01*((T-t)/T)+.005+.2*exp(-t/(5000))+1*exp(-t/(100));
move_coeff=exp(-dhue.^2/(2*sig_hue.^2));
%pull out a random index from all the synanpses
randguy=ceil(N*rand(1));
%calculate the differential vector from our random guy
%to each of the members of the kohonen network
deltv_inspace=repmat(data(randguy,:),K,1)-positions;
%calculate the absolute euclidean distance
distances_inspace=sqrt(sum(deltv_inspace.^2,2));
%find out the minimum distance amongst the members of the kohonen
%network and which member is the minimum
[mindist,minguy]=min(distances_inspace);
%calculate the delta vector that we want to move each of the members
%of the kohonen network. It should be in the direction of the
%difference between each member and the random point
%but modulated in strength by eta, and the movement coefficents
%which will drag the guy closest and the guys near the closest guy
%(near in terms of the color hue space) farther than those "far" away
%(again.. far in terms of the color hue space).
positions=positions+eta*repmat(move_coeff(:,minguy),1,M).*deltv_inspace;
counts(minguy)=counts(minguy)+1;
%plot out the positions every 100th time step
if (mod(t,100)==1)
figure(4);
clf;
bar(counts);
figure(5);
clf;
for i=1:4
subplot(2,2,i)
imagesc(positions(:,1+i-1:4:end));
caxis([-1 1]);
end
end
end
%%
%after we have the positions of the synapse we want to go through the
%entire list of synapses, find the kohonen network guy closest
%and then give him the hue value of that closest guy
N=length(data);
data_hue=zeros(N,1);
mindist=zeros(N,1);
minguy=zeros(N,1);
for i=1:N
if mod(i,10000)==1
disp(i*1.0/N);
disp(i);
end
delt=repmat(data(i,:),K,1)-positions;
dist=sum(delt.^2,2);
[mindist(i),minguy(i)]=min(dist);
data_hue(i)=hue(minguy(i));
end
%%
numbins=150;
dist_prob=zeros(K,numbins+1);
for i=1:K
dist_prob(i,:)=histc(mindist(minguy==i),0:numbins);
dist_prob(i,:)=dist_prob(i,:)./(repmat(sum(dist_prob(i,:),2),1,numbins+1));
end
%%
%we want constant saturation and value for our HSV values
data_hsv=[data_hue ones(size(data_hue)) ones(size(data_hue))];
%convert this to RGB values from 0 to 255
data_rgb=floor(256*hsv2rgb(data_hsv));
%save this as a txt file
fid=fopen('synapsinR_7thA.tif.Pivots.kohonen_rgb5.txt','w');
fprintf(fid,'%d,%d,%d\n',data_rgb');
fclose(fid);
%%
classes=zeros(size(data,1),4);
classes(:,1)=load('VGluT1Predictions.txt');
classes(:,2)=load('VGluT2Predictions.txt');
classes(:,3)=load('GabaPredictions.txt');
classes(:,4)=load('THPredictions.txt');
%%
pivots=load('synapsinR_7thA.tif.Pivots.txt');
data_minguy=round(data_hue*500);
data_minguy=data_minguy+1;
numbins=100;
densities=zeros(K,numbins);
densities_x=zeros(K,numbins/4);
max_x=max(pivots(:,1));
max_y=max(pivots(:,2));
for i=1:K
goodones=find(data_minguy==i);
N=hist(pivots(goodones,2),1:max_y/numbins:max_y);
densities(i,:)=N;
N=hist(pivots(goodones,1),1:4*max_x/numbins:max_x);
densities_x(i,:)=N;
end
densities_norm=densities./repmat(sum(densities,2),1,numbins);
densities_norm_x=densities_x./repmat(sum(densities_x,2),1,numbins/4);
%%
%%
bottom=.15;
height=.75;
std_buff=.03;
numplots=5;
mini=.02;
std_width=(1-mini-std_buff*numplots-.005)/numplots;
std_total=std_width+std_buff;
figure(90);
set(gcf,'Position',[20 500 1024 768]);
clf;
subplot('position',[0 bottom mini height]);
scatter(zeros(1,K),-(1:K),10,hsv2rgb(hsv));
axis tight;
xlim([-.01 .01]);
axis off;
% Set the X-Tick locations so that every other month is labeled.
%Xt = 1:2:11;
%Xl = [1 12];
%set(gca,'XTick',Xt,'XLim',Xl);
% Add the months as tick labels.
labels = ['Synap ';
'Synap ';
'VGlut1';
'VGlut1';
'VGlut2';
'Vglut3';
'psd ';
'glur2 ';
'nmdar1';
'nr2b ';
'gad ';
'VGAT ';
'PV ';
'Gephyr';
'GABAR1';
'GABABR';
'CR1 ';
'5HT1A ';
'NOS ';
'TH ';
'VACht ';
'Synapo';
'tubuli';
'DAPI '];
subplot('position',[mini+std_buff bottom std_width height]);
set(gca,'FontSize',16)
imagesc(positions(:,1:4:end));
caxis([-2 5]);
ylabel('Points on Circle');
%xlabel('Channels');
title('Localized Brightness');
%set(gca,'XTick',[1:14]);
%set(gca,'XTickLabel',{'syna','synaGP','vglut1-3', 'vglut1-8', 'vglut3-1','psd','gad','vgat','pv','gephy','GABARa1','TH','VAChT','DAPI'})
% Place the text labels
set(gca,'XTick',.5:1:size(labels,1),'Xlim',[0.5 size(labels,1)+.5]);
ax = axis; % Current axis limits
axis(axis); % Set the axis limit modes (e.g. XLimMode) to manual
Yl = ax(3:4); % Y-axis limits
t = text((.1:1:size(labels,1)),(K+5)*ones(1,size(labels,1)),labels);
set(t,'HorizontalAlignment','right','VerticalAlignment','top','Rotation',90,'FontSize',16);
set(gca,'XTickLabel','');
subplot('position',[mini+std_buff+std_total bottom std_width height]);
imagesc(positions(:,3:4:end));
caxis([-2 5]);
set(gca,'XTick',.5:1:size(labels,1),'Xlim',[0.5 size(labels,1)+.5]);
%xlabel('Channels');
title('Distance to COM');
t = text((.3:1:size(labels,1)),(K+5)*ones(1,size(labels,1)),labels);
set(t,'HorizontalAlignment','right','VerticalAlignment','top', 'Rotation',90);
set(gca,'XTickLabel','');
subplot('position',[mini+std_buff+2*std_total bottom std_width height]);
set(gca,'FontSize',16)
imagesc(densities_norm);
set(gca,'YTick',[]);
xlabel('Percentage through volume in Y');
title('Normalized density of types');
caxis([0 .1]);
subplot('position',[mini+std_buff+3*std_total bottom std_width height]);
set(gca,'FontSize',16)
imagesc(densities_norm_x);
set(gca,'YTick',[]);
xlabel('Percentage through volume in X');
title('Normalized density of types');
caxis([0 .1]);
%
% SUBPLOT('position',[mini+std_buff+4*std_total bottom std_width height]);
% imagesc(dist_prob);
% set(gca,'YTick',[]);
% xlabel('Distance (standard deviations^2)');
% title('Distribution of distances to circle');
% caxis([0 .1]);
%%
figure(5);
clf;
for i=1:4
subplot(2,2,i)
imagesc(positions(:,1+i-1:4:end));
caxis([-2 5]);
end
| {
"content_hash": "c4a4039cf21d60054e81db1393069a8d",
"timestamp": "",
"source": "github",
"line_count": 316,
"max_line_length": 137,
"avg_line_length": 25.876582278481013,
"alnum_prop": 0.6683380212791977,
"repo_name": "Upward-Spiral-Science/the-fat-boys",
"id": "91da7cb872996f54556e49a950fd524f877184ac",
"size": "8177",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "code/Exploratory/kohonen_modified.m",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Jupyter Notebook",
"bytes": "205664995"
},
{
"name": "Matlab",
"bytes": "82331"
},
{
"name": "R",
"bytes": "36120"
}
],
"symlink_target": ""
} |
namespace chainerx {
namespace internal {
BackpropId GetArrayBackpropId(const Array& array, const absl::optional<BackpropId>& backprop_id);
Array MakeArray(const Shape& shape, const Strides& strides, Dtype dtype, Device& device, std::shared_ptr<void> data, int64_t offset = 0);
inline const std::shared_ptr<ArrayBody>& GetArrayBody(const Array& array);
inline std::shared_ptr<ArrayBody>&& MoveArrayBody(Array&& array);
} // namespace internal
// The user interface of multi-dimensional arrays.
//
// This wraps an ArrayBody, providing accessors, an interface for graph operations and differentiable operations.
class Array {
public:
Array() = default;
~Array() = default;
// TODO(hvy): Consider making this contructor private and prohibit body from being null (assert that given body is not null).
explicit Array(std::shared_ptr<internal::ArrayBody> body) : body_{std::move(body)} {
if (body_ == nullptr) {
throw ChainerxError{"Cannot create an array from null."};
}
}
// Copy constructor that copies the pointer to the body instead of the body itself.
//
// Use MakeView if you want to clone the body.
Array(const Array& other) = default;
Array(Array&& other) = default;
// Assign operators just replace the body. They do not copy data between arrays.
Array& operator=(const Array&) = default;
Array& operator=(Array&& other) = default;
Array operator-() const;
Array operator==(const Array& rhs) const;
Array operator!=(const Array& rhs) const;
Array operator>(const Array& rhs) const;
Array operator>=(const Array& rhs) const;
Array operator<(const Array& rhs) const;
Array operator<=(const Array& rhs) const;
Array& operator+=(const Array& rhs);
Array& operator+=(Scalar rhs);
Array& operator-=(const Array& rhs);
Array& operator-=(Scalar rhs);
Array& operator*=(const Array& rhs);
Array& operator*=(Scalar rhs);
Array& operator/=(const Array& rhs);
Array& operator/=(Scalar rhs);
Array& operator%=(const Array& rhs);
Array& operator%=(Scalar rhs);
Array& operator&=(const Array& rhs);
Array& operator&=(Scalar rhs);
Array& operator|=(const Array& rhs);
Array& operator|=(Scalar rhs);
Array& operator^=(const Array& rhs);
Array& operator^=(Scalar rhs);
Array& operator<<=(const Array& rhs);
Array& operator<<=(Scalar rhs);
Array& operator>>=(const Array& rhs);
Array& operator>>=(Scalar rhs);
const Array& operator+=(const Array& rhs) const;
const Array& operator+=(Scalar rhs) const;
const Array& operator-=(const Array& rhs) const;
const Array& operator-=(Scalar rhs) const;
const Array& operator*=(const Array& rhs) const;
const Array& operator*=(Scalar rhs) const;
const Array& operator/=(const Array& rhs) const;
const Array& operator/=(Scalar rhs) const;
const Array& operator%=(const Array& rhs) const;
const Array& operator%=(Scalar rhs) const;
const Array& operator&=(const Array& rhs) const;
const Array& operator&=(Scalar rhs) const;
const Array& operator|=(const Array& rhs) const;
const Array& operator|=(Scalar rhs) const;
const Array& operator^=(const Array& rhs) const;
const Array& operator^=(Scalar rhs) const;
const Array& operator<<=(const Array& rhs) const;
const Array& operator<<=(Scalar rhs) const;
const Array& operator>>=(const Array& rhs) const;
const Array& operator>>=(Scalar rhs) const;
Array operator+(const Array& rhs) const;
Array operator+(Scalar rhs) const;
Array operator-(const Array& rhs) const;
Array operator-(Scalar rhs) const;
Array operator*(const Array& rhs) const;
Array operator*(Scalar rhs) const;
Array operator/(const Array& rhs) const;
Array operator/(Scalar rhs) const;
Array operator%(const Array& rhs) const;
Array operator%(Scalar rhs) const;
Array operator&(const Array& rhs) const;
Array operator&(Scalar rhs) const;
Array operator|(const Array& rhs) const;
Array operator|(Scalar rhs) const;
Array operator^(const Array& rhs) const;
Array operator^(Scalar rhs) const;
Array operator<<(const Array& rhs) const;
Array operator<<(Scalar rhs) const;
Array operator>>(const Array& rhs) const;
Array operator>>(Scalar rhs) const;
// Returns a view selected with the indices.
Array At(const std::vector<ArrayIndex>& indices) const;
// Returns a transposed view of the array.
Array Transpose(const OptionalAxes& axes = absl::nullopt) const;
Array Ravel() const;
// Returns a reshaped array.
// TODO(niboshi): Support shape with dimension -1.
Array Reshape(const Shape& newshape) const;
// Returns a squeezed array with unit-length axes removed.
//
// If no axes are specified, all axes of unit-lengths are removed.
// If no axes can be removed, an array with aliased data is returned.
Array Squeeze(const OptionalAxes& axis = absl::nullopt) const;
// Interchange two axes of an array.
Array Swapaxes(int8_t axis1, int8_t axis2) const;
// Broadcasts the array to the specified shape.
// Returned array is always a view to this array.
Array BroadcastTo(const Shape& shape) const;
// Returns the indices of the maximum values along the given axis.
Array ArgMax(const OptionalAxes& axis = absl::nullopt) const;
// Returns the indices of the minimum values along the given axis.
Array ArgMin(const OptionalAxes& axis = absl::nullopt) const;
// Returns a sum of the array.
// If `axis` is set, it will be summed over the specified axes.
// Otherwise, it will be summed over all the existing axes.
// Note: When implementing chainerx::Sum(), be careful of the semantics of the default value of `keepdims`. See NumPy documentation.
Array Sum(const OptionalAxes& axis = absl::nullopt, bool keepdims = false) const;
// Returns the maximum value of the array.
// If `axis` is set, the maximum value is chosen along the specified axes.
// Otherwise, all the elements are searched at once.
Array Max(const OptionalAxes& axis = absl::nullopt, bool keepdims = false) const;
// Returns the minimum value of the array.
// If `axis` is set, the minimum value is chosen along the specified axes.
// Otherwise, all the elements are searched at once.
Array Min(const OptionalAxes& axis = absl::nullopt, bool keepdims = false) const;
Array Mean(const OptionalAxes& axis = absl::nullopt, bool keepdims = false) const;
Array Var(const OptionalAxes& axis = absl::nullopt, bool keepdims = false) const;
Array All(const OptionalAxes& axis = absl::nullopt, bool keepdims = false) const;
Array Any(const OptionalAxes& axis = absl::nullopt, bool keepdims = false) const;
// Returns a dot product of the array with another one.
Array Dot(const Array& b) const;
// Takes elements specified by indices from the array.
//
// TODO(niboshi): Support Scalar and StackVector as indices.
// TODO(niboshi): Support axis=None behavior in NumPy.
// TODO(niboshi): Support indices dtype other than int64.
Array Take(const Array& indices, int8_t axis, IndexBoundsMode mode = IndexBoundsMode::kDefault) const;
// Creates a copy.
// It will be connected to all the graphs.
// It will be always C-contiguous.
Array Copy() const;
Array Flatten() const;
// Creates a view.
// It creates a new array node and connects graphs.
Array MakeView() const;
// Transfers the array to another device. It will be connected to all the graphs.
//
// If the destination is the same device, an array with aliased data is returned.
// Otherwise, a C-contiguous Array will be created on the target device.
// TODO(niboshi): Currently control over whether to make an alias is not supported.
Array ToDevice(Device& dst_device) const;
// Transfer the array to the native device. It will be connected to all the graphs.
//
// This is a wrapper function which calls Array::ToDevice with the native:0 device.
// See also: Array::ToDevice();
Array ToNative() const;
// Creates a copy or a view. It will be disconnected from all the graphs.
// If `kind` is `CopyKind::kCopy`, the returned array will be always C-contiguous.
Array AsGradStopped(CopyKind kind = CopyKind::kView) const;
// Creates a copy or a view. It will be disconnected from the specified graphs.
// If `kind` is `CopyKind::kCopy`, the returned array will be always C-contiguous.
Array AsGradStopped(absl::Span<const BackpropId> backprop_ids, CopyKind kind = CopyKind::kView) const;
Array AsGradStopped(std::initializer_list<const BackpropId> backprop_ids, CopyKind kind = CopyKind::kView) const {
return AsGradStopped(absl::MakeConstSpan(backprop_ids.begin(), backprop_ids.end()), kind);
}
// Casts to a specified type.
// By default, always returns a newly allocated array. If `copy` is false,
// and the dtype requirement is satisfied, the input array is returned instead of a copy.
Array AsType(Dtype dtype, bool copy = true) const;
void Fill(Scalar value) const;
// Returns the gradient of the array.
//
// ChainerxError is thrown if the array is constant with respect to the computation for the specified backprop ID.
// ChainerxError is thrown if the array is not flagged as requiring gradient.
// This function ignores no/force-backprop mode.
const absl::optional<Array>& GetGrad(const absl::optional<BackpropId>& backprop_id = absl::nullopt) const;
// Sets the gradient of the array.
// This function also flags the array as requiring gradient, so that preceding GetGrad() can return the gradient.
//
// ChainerxError is thrown if the array is constant with respect to the computation for the specified backprop ID.
// This function ignores no/force-backprop mode.
void SetGrad(Array grad, const absl::optional<BackpropId>& backprop_id = absl::nullopt) const;
// Clears the gradient of the array if set.
// This function does not change the state of the array other than that. For example, if the array is flagged as requiring gradient,
// that will not change.
//
// ChainerxError is thrown if the array is constant with respect to the computation for the specified backprop ID.
// This function ignores no/force-backprop mode.
void ClearGrad(const absl::optional<BackpropId>& backprop_id = absl::nullopt) const;
// Returns whether the array needs to backprop.
//
// If no-backprop mode is set with respect to the specified backprop ID, this function returns false.
bool IsBackpropRequired(const absl::optional<BackpropId>& backprop_id = absl::nullopt) const;
bool IsBackpropRequired(AnyGraph any_graph) const;
// Returns whether the array is flagged to compute the gradient during backprop.
//
// This function ignores no/force-backprop mode.
bool IsGradRequired(const absl::optional<BackpropId>& backprop_id = absl::nullopt) const;
// Flags the array to compute the gradient during backprop.
// If the array is constant with respect to the computation of the backprop ID, this function makes the array non-constant.
//
// This function ignores no/force-backprop mode.
const Array& RequireGrad(const absl::optional<BackpropId>& backprop_id = absl::nullopt) const {
return RequireGradImpl(*this, backprop_id);
}
Array& RequireGrad(const absl::optional<BackpropId>& backprop_id = absl::nullopt) { return RequireGradImpl(*this, backprop_id); }
int64_t GetTotalSize() const { return body_->GetTotalSize(); }
int64_t GetNBytes() const { return body_->GetNBytes(); }
int64_t GetItemSize() const { return body_->GetItemSize(); }
bool IsContiguous() const { return body_->IsContiguous(); }
std::string ToString() const;
Context& context() const { return body_->device().context(); }
Dtype dtype() const { return body_->dtype(); }
Device& device() const { return body_->device(); }
int8_t ndim() const { return body_->ndim(); }
const Shape& shape() const { return body_->shape(); }
const Strides& strides() const { return body_->strides(); }
const std::shared_ptr<void>& data() const { return body_->data(); }
void* raw_data() const { return body_->data().get(); }
int64_t offset() const { return body_->offset(); }
private:
friend Array internal::MakeArray(
const Shape& shape, const Strides& strides, Dtype dtype, Device& device, std::shared_ptr<void> data, int64_t offset);
friend const std::shared_ptr<internal::ArrayBody>& internal::GetArrayBody(const Array& array);
friend std::shared_ptr<internal::ArrayBody>&& internal::MoveArrayBody(Array&& array);
Array(const Shape& shape, const Strides& strides, Dtype dtype, Device& device, std::shared_ptr<void> data, int64_t offset = 0);
template <typename T>
static T& RequireGradImpl(T& array, const absl::optional<BackpropId>& backprop_id);
std::shared_ptr<internal::ArrayBody> body_;
};
Array operator+(Scalar lhs, const Array& rhs);
Array operator-(Scalar lhs, const Array& rhs);
Array operator*(Scalar lhs, const Array& rhs);
Array operator/(Scalar lhs, const Array& rhs);
Array operator%(Scalar lhs, const Array& rhs);
Array operator<<(Scalar lhs, const Array& rhs);
Array operator>>(Scalar lhs, const Array& rhs);
namespace internal {
inline const std::shared_ptr<ArrayBody>& GetArrayBody(const Array& array) { return array.body_; }
inline std::shared_ptr<ArrayBody>&& MoveArrayBody(Array&& array) { return std::move(array.body_); }
std::vector<std::shared_ptr<ArrayBody>> MoveArrayBodies(std::vector<Array>&& arrays);
std::vector<std::shared_ptr<ArrayBody>> MoveArrayBodies(std::vector<absl::optional<Array>>&& arrays);
} // namespace internal
void DebugDumpComputationalGraph(
std::ostream& os,
const Array& array,
const absl::optional<BackpropId>& backprop_id,
int indent = 0,
const std::vector<std::pair<ConstArrayRef, std::string>>& array_name_map = {});
} // namespace chainerx
| {
"content_hash": "26aa95dbfbba0c0c42e93af537de346c",
"timestamp": "",
"source": "github",
"line_count": 332,
"max_line_length": 137,
"avg_line_length": 42.8433734939759,
"alnum_prop": 0.6936164229471317,
"repo_name": "niboshi/chainer",
"id": "cc16a6d6c4544d0b079187082cf9727603d8ff76",
"size": "14916",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "chainerx_cc/chainerx/array.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "3796"
},
{
"name": "C",
"bytes": "1099"
},
{
"name": "C++",
"bytes": "1685561"
},
{
"name": "CMake",
"bytes": "51563"
},
{
"name": "Cuda",
"bytes": "191182"
},
{
"name": "Dockerfile",
"bytes": "6422"
},
{
"name": "PowerShell",
"bytes": "7197"
},
{
"name": "Python",
"bytes": "6334795"
},
{
"name": "Shell",
"bytes": "47473"
}
],
"symlink_target": ""
} |
<?php
namespace support;
/**
* Class Request
* @package support
*/
class Request extends \Webman\Http\Request
{
} | {
"content_hash": "11e37c0da9d2783031e97fb528e95513",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 42,
"avg_line_length": 9.23076923076923,
"alnum_prop": 0.675,
"repo_name": "goldeagle/think-builder",
"id": "e3f6ac370d58c41579a2a6f93944c71fbee0cc35",
"size": "548",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "resource/backend/webman/src/support/Request.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "14"
},
{
"name": "CSS",
"bytes": "2807106"
},
{
"name": "CoffeeScript",
"bytes": "83631"
},
{
"name": "HTML",
"bytes": "112049"
},
{
"name": "JavaScript",
"bytes": "796675"
},
{
"name": "PHP",
"bytes": "177004"
},
{
"name": "Shell",
"bytes": "444"
},
{
"name": "TSQL",
"bytes": "255"
}
],
"symlink_target": ""
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>V8 API Reference Guide for node.js v8.5.0: v8::RegisterState Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">V8 API Reference Guide for node.js v8.5.0
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="structv8_1_1RegisterState.html">RegisterState</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-attribs">Public Attributes</a> |
<a href="structv8_1_1RegisterState-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">v8::RegisterState Struct Reference</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:aa0d0327871d9f95d5e64f47b7f183907"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa0d0327871d9f95d5e64f47b7f183907"></a>
void * </td><td class="memItemRight" valign="bottom"><b>pc</b></td></tr>
<tr class="separator:aa0d0327871d9f95d5e64f47b7f183907"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a867bb9d0b9e81c3f7256aa81dc0daee4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a867bb9d0b9e81c3f7256aa81dc0daee4"></a>
void * </td><td class="memItemRight" valign="bottom"><b>sp</b></td></tr>
<tr class="separator:a867bb9d0b9e81c3f7256aa81dc0daee4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aaeb80a1d7f6df3ae418f3e9b1295d156"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaeb80a1d7f6df3ae418f3e9b1295d156"></a>
void * </td><td class="memItemRight" valign="bottom"><b>fp</b></td></tr>
<tr class="separator:aaeb80a1d7f6df3ae418f3e9b1295d156"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>deps/v8/include/<a class="el" href="v8_8h_source.html">v8.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
| {
"content_hash": "74751b1e436f597a02aa488086598fce",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 170,
"avg_line_length": 47.385245901639344,
"alnum_prop": 0.66476388168137,
"repo_name": "v8-dox/v8-dox.github.io",
"id": "febad18547eb6c53f8036d9f59130c6a34846e38",
"size": "5781",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ba5a697/html/structv8_1_1RegisterState.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
from ConfigParser import ConfigParser
from cStringIO import StringIO
import unittest
from nose.tools import assert_true, assert_equals, assert_raises, assert_false
def test_import_config_enhance ():
import config_enhance
buildout_inherit_cfg ='''\
[base]
alpha = 1.0
beta = 2.0
[derived]
<= base
beta = 5.0
gamma = 6.0
'''
def test_load_with_buildout_inherit ():
import config_enhance as zp
# load up the config file with a base
buildout_cfg_fp = StringIO (buildout_inherit_cfg)
cp = ConfigParser ()
cp.readfp(buildout_cfg_fp, "buildout.cfg")
zp.enhance_platform_versions(cp)
assert_equals ("1.0", cp.get("base", "alpha"))
assert_equals ("2.0", cp.get("base", "beta"))
assert_equals ("1.0", cp.get("derived", "alpha"))
assert_equals ("5.0", cp.get("derived", "beta"))
assert_equals ("6.0", cp.get("derived", "gamma"))
assert_false (cp.has_option ("derived", "<<"))
base_cfg ='''\
[base]
alpha = 1.0
beta = 2.0
[derived]
<<= <base
beta = 5.0
gamma = 6.0
'''
def test_load_with_base ():
import config_enhance as zp
# load up the config file with a base
base_cfg_fp = StringIO (base_cfg)
cp = ConfigParser ()
cp.readfp(base_cfg_fp, "base.cfg")
zp.enhance_platform_versions(cp)
assert_equals ("1.0", cp.get("base", "alpha"))
assert_equals ("2.0", cp.get("base", "beta"))
assert_equals ("1.0", cp.get("derived", "alpha"))
assert_equals ("5.0", cp.get("derived", "beta"))
assert_equals ("6.0", cp.get("derived", "gamma"))
assert_false (cp.has_option ("derived", "<<"))
override_cfg ='''\
[base]
alpha = 1.0
beta = 2.0
[derived]
<<= +base
beta = 5.0
gamma = 6.0
'''
def test_load_with_override ():
import config_enhance as zp
# load up the config file with a base
override_cfg_fp = StringIO (override_cfg)
cp = ConfigParser ()
cp.readfp(override_cfg_fp, "override.cfg")
zp.enhance_platform_versions(cp)
assert_equals ("1.0", cp.get("base", "alpha"))
assert_equals ("2.0", cp.get("base", "beta"))
assert_equals ("1.0", cp.get("derived", "alpha"))
assert_equals ("2.0", cp.get("derived", "beta"))
assert_equals ("6.0", cp.get("derived", "gamma"))
assert_false (cp.has_option ("derived", "<<"))
remove_cfg ='''\
[remove]
alpha = 1.0
beta = 2.0
[derived]
<<= -remove
beta = 5.0
gamma = 6.0
'''
def test_load_with_remove ():
import config_enhance as zp
# load up the config file with a base
remove_cfg_fp = StringIO (remove_cfg)
cp = ConfigParser ()
cp.readfp(remove_cfg_fp, "remove.cfg")
zp.enhance_platform_versions(cp)
assert_equals ("1.0", cp.get("remove", "alpha"))
assert_equals ("2.0", cp.get("remove", "beta"))
assert_equals ("6.0", cp.get("derived", "gamma"))
assert_false (cp.has_option ("derived", "alpha"))
assert_false (cp.has_option ("derived", "beta"))
assert_false (cp.has_option ("derived", "<<"))
realistic_cfg ='''\
[common]
alpha = 1.0
beta = 2.0
[tes_100]
<<= <common
beta = 5.0
gamma = 6.0
[dev_tes_common]
gamma = 6.0d
[dev_unpin]
alpha = unpin
[dev_tes_100]
<<= <tes_100
+dev_tes_common
-dev_unpin
'''
def test_load_with_realistic ():
import config_enhance as zp
# load up the config file with a base
realistic_cfg_fp = StringIO (realistic_cfg)
cp = ConfigParser ()
cp.readfp(realistic_cfg_fp, "realistic.cfg")
zp.enhance_platform_versions(cp)
assert_equals ("1.0", cp.get("tes_100", "alpha"))
assert_equals ("5.0", cp.get("tes_100", "beta"))
assert_equals ("6.0", cp.get("tes_100", "gamma"))
assert_false (cp.has_option ("tes_100", "<<"))
assert_false (cp.has_option ("dev_tes_100", "alpha"))
assert_equals ("5.0", cp.get("dev_tes_100", "beta"))
assert_equals ("6.0d", cp.get("dev_tes_100", "gamma"))
assert_false (cp.has_option ("dev_tes_100", "<<"))
four_level_cfg ='''\
[one]
alpha = 1.0
[two]
<<= <one
[three]
<<= <two
[four]
<<= <three
'''
def test_load_four_level ():
import config_enhance as zp
# load up the config file with a base
realistic_cfg_fp = StringIO (four_level_cfg)
cp = ConfigParser ()
cp.readfp(realistic_cfg_fp, "four_level.cfg")
zp.enhance_platform_versions(cp)
assert_equals ("1.0", cp.get("one", "alpha"))
assert_equals ("1.0", cp.get("two", "alpha"))
assert_equals ("1.0", cp.get("three", "alpha"))
assert_equals ("1.0", cp.get("four", "alpha"))
| {
"content_hash": "7e142940d04335ee4f6bc9b90379c300",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 78,
"avg_line_length": 22.46268656716418,
"alnum_prop": 0.6002214839424141,
"repo_name": "zillow/config-enhance",
"id": "52e03a4631bbc5951c11edfff1710ca1125ca92f",
"size": "5602",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "config_enhance/tests/test_config_enhance.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "24249"
}
],
"symlink_target": ""
} |
'use strict';
angular.module('realizeChangeApp')
.config(function ($stateProvider) {
$stateProvider
.state('admin', {
url: '/admin',
templateUrl: 'app/admin/admin.html',
controller: 'AdminCtrl'
});
}); | {
"content_hash": "3a41013e1bcb2be4caaf096f67010ede",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 44,
"avg_line_length": 22.363636363636363,
"alnum_prop": 0.5813008130081301,
"repo_name": "gemfarmer/realize-change-revisited",
"id": "8d8c773aa8007752c8ef145cec05d1d698fff430",
"size": "246",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "client/app/admin/admin.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "24139"
},
{
"name": "CSS",
"bytes": "8505"
},
{
"name": "HTML",
"bytes": "32553"
},
{
"name": "JavaScript",
"bytes": "101820"
}
],
"symlink_target": ""
} |
package ucar.nc2.ui.image;
/*
* SourcePictureListener.java: interface for notification
*
* Copyright (C) 2002 Richard Eigenmann.
* 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 any later version. This program is distributed
* in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details. You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* The license is in gpl.txt.
* See http://www.gnu.org/copyleft/gpl.html for the details.
*/
/**
* This interface allows an object to inform another object that the status it is listening on has
* changed.
*/
public interface SourcePictureListener {
/**
* inform the listener that the status has changed
*/
void sourceStatusChange(int statusCode, String statusMessage, SourcePicture sp);
/**
* inform the listener of progress on the loading of the image
*/
void sourceLoadProgressNotification(int statusCode, int percentage);
}
| {
"content_hash": "c21cb2b907635adbd3f20d705315ede2",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 98,
"avg_line_length": 31.477272727272727,
"alnum_prop": 0.7436823104693141,
"repo_name": "Unidata/netcdf-java",
"id": "c52f080c55c71d6bf28b08c717eb3ae25ac26f1a",
"size": "2210",
"binary": false,
"copies": "1",
"ref": "refs/heads/maint-5.x",
"path": "uicdm/src/main/java/ucar/nc2/ui/image/SourcePictureListener.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "AGS Script",
"bytes": "708007"
},
{
"name": "C",
"bytes": "404428"
},
{
"name": "C++",
"bytes": "10772"
},
{
"name": "CSS",
"bytes": "13861"
},
{
"name": "Groovy",
"bytes": "95588"
},
{
"name": "HTML",
"bytes": "3774351"
},
{
"name": "Java",
"bytes": "21758821"
},
{
"name": "Makefile",
"bytes": "2434"
},
{
"name": "Objective-J",
"bytes": "28890"
},
{
"name": "Perl",
"bytes": "7860"
},
{
"name": "PowerShell",
"bytes": "678"
},
{
"name": "Python",
"bytes": "20750"
},
{
"name": "Roff",
"bytes": "34262"
},
{
"name": "Shell",
"bytes": "18859"
},
{
"name": "Tcl",
"bytes": "5307"
},
{
"name": "Vim Script",
"bytes": "88"
},
{
"name": "Visual Basic 6.0",
"bytes": "1269"
},
{
"name": "Yacc",
"bytes": "25086"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//Formulae from: http://en.wikipedia.org/wiki/Normal_distribution
public class NormalDistribution
{
public double Expectation { get; private set; }
public double Variance { get; private set; }
private double multFact = 1;
private double sigma;
/// <summary>
/// return the unit normal distribution
/// </summary>
public NormalDistribution()
{
Expectation = 0;
Variance = 1;
ComputeInternalParameters();
}
public static NormalDistribution ByParams(double expectation, double variance)
{
if (Double.IsInfinity(expectation) || Double.IsNaN(expectation))
throw new ArgumentException("The expectation must be a finite number");
if (variance <= 0 || Double.IsInfinity(expectation) || Double.IsNaN(expectation))
throw new ArgumentException("The variance must be a positive finite number");
NormalDistribution distribution = new NormalDistribution();
distribution.Expectation = expectation;
distribution.Variance = variance;
distribution.ComputeInternalParameters();
return distribution;
}
private void ComputeInternalParameters()
{
//1 / sigma * SQRT(2PI)
sigma = Math.Sqrt(Variance);
double denom = sigma*(Math.Sqrt(2D*Math.PI));
multFact = 1D/denom;
}
public double ProbabilityDensity(double x)
{
double working = x - Expectation;
working = working/sigma;
double fact = (working*working)*-0.5D;
return multFact*Math.Exp(fact);
}
}
| {
"content_hash": "a532aacadb59538eff11bf96ac98ab49",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 93,
"avg_line_length": 28.65671641791045,
"alnum_prop": 0.5697916666666667,
"repo_name": "DynamoDS/designscript-archive",
"id": "f0a52f28e46d2abfba024378459236b348182702",
"size": "1922",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Libraries/Experimental/NormalDistribution.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "2452899"
},
{
"name": "C#",
"bytes": "17936156"
},
{
"name": "C++",
"bytes": "116035"
},
{
"name": "CSS",
"bytes": "3042"
},
{
"name": "Perl",
"bytes": "35814"
},
{
"name": "Shell",
"bytes": "25984"
}
],
"symlink_target": ""
} |
package test.junit;
import org.testng.annotations.Test;
public class SetUpExceptionTest extends test.BaseTest {
@Test
public void setUpFailingShouldCauseMethodsToBeSkipped() {
addClass("test.junit.SetUpExceptionSampleTest");
setJUnit(true);
run();
String[] passed = {};
String[] failed = {"setUp"};
String[] skipped = {"testM1", "tearDown"};
verifyTests("Passed", passed, getPassedTests());
verifyTests("Skipped", skipped, getSkippedTests());
verifyTests("Failed", failed, getFailedTests());
}
}
| {
"content_hash": "4440fa7fb80e54b82709ba74a0f65a0f",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 59,
"avg_line_length": 28.473684210526315,
"alnum_prop": 0.6931608133086876,
"repo_name": "cbeust/testng",
"id": "f9e20e1da2c9d8e678ab6a8af7430b434fe183cc",
"size": "541",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "testng-core/src/test/java/test/junit/SetUpExceptionTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "711"
},
{
"name": "CSS",
"bytes": "12708"
},
{
"name": "Groovy",
"bytes": "3285"
},
{
"name": "HTML",
"bytes": "9063"
},
{
"name": "Java",
"bytes": "3961736"
},
{
"name": "JavaScript",
"bytes": "7230"
},
{
"name": "Kotlin",
"bytes": "75929"
},
{
"name": "Shell",
"bytes": "1458"
}
],
"symlink_target": ""
} |
using System;
using System.Runtime.InteropServices;
namespace SharpVk.Interop.Intel
{
/// <summary>
///
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public unsafe partial struct PhysicalDeviceShaderIntegerFunctions2Features
{
/// <summary>
/// The type of this structure.
/// </summary>
public SharpVk.StructureType SType;
/// <summary>
/// Null or an extension-specific structure.
/// </summary>
public void* Next;
/// <summary>
///
/// </summary>
public Bool32 ShaderIntegerFunctions2;
}
}
| {
"content_hash": "1d0691f04ddea8e1621c3874eb8a084d",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 78,
"avg_line_length": 24,
"alnum_prop": 0.5648148148148148,
"repo_name": "FacticiusVir/SharpVk",
"id": "eecc1a8ef29d2b161f2d8a6855d7e359ab1626b4",
"size": "1885",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/SharpVk/Interop/Intel/PhysicalDeviceShaderIntegerFunctions2Features.gen.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "5249731"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
<module fileurl="file://$PROJECT_DIR$/bluetoothtest2.iml" filepath="$PROJECT_DIR$/bluetoothtest2.iml" />
</modules>
</component>
</project> | {
"content_hash": "027f67925a611a4c3c0dc635e896c481",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 110,
"avg_line_length": 40.55555555555556,
"alnum_prop": 0.6684931506849315,
"repo_name": "lucky-code/Practice",
"id": "bfb98da9f6c8a761aa8ebbaa23e555aea2953030",
"size": "365",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "bluetoothtest2/.idea/modules.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "486756"
}
],
"symlink_target": ""
} |
FROM balenalib/intel-nuc-ubuntu:bionic-run
# remove several traces of debian python
RUN apt-get purge -y python.*
# http://bugs.python.org/issue19846
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
ENV LANG C.UTF-8
# install python dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
netbase \
&& rm -rf /var/lib/apt/lists/*
# key 63C7CC90: public key "Simon McVittie <smcv@pseudorandom.co.uk>" imported
# key 3372DCFA: public key "Donald Stufft (dstufft) <donald@stufft.io>" imported
RUN gpg --keyserver keyring.debian.org --recv-keys 4DE8FF2A63C7CC90 \
&& gpg --keyserver keyserver.ubuntu.com --recv-key 6E3CBCE93372DCFA \
&& gpg --keyserver keyserver.ubuntu.com --recv-keys 0x52a43a1e4b77b059
ENV PYTHON_VERSION 3.8.12
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
ENV PYTHON_PIP_VERSION 21.3.1
ENV SETUPTOOLS_VERSION 60.5.4
RUN set -x \
&& buildDeps=' \
curl \
' \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
&& curl -SLO "http://resin-packages.s3.amazonaws.com/python/v$PYTHON_VERSION/Python-$PYTHON_VERSION.linux-amd64-libffi3.2.tar.gz" \
&& echo "7b3d7645a4cc38baa36f6d1ffbe8f84bbfdeef7ab22436073d61a31aa812424f Python-$PYTHON_VERSION.linux-amd64-libffi3.2.tar.gz" | sha256sum -c - \
&& tar -xzf "Python-$PYTHON_VERSION.linux-amd64-libffi3.2.tar.gz" --strip-components=1 \
&& rm -rf "Python-$PYTHON_VERSION.linux-amd64-libffi3.2.tar.gz" \
&& ldconfig \
&& if [ ! -e /usr/local/bin/pip3 ]; then : \
&& curl -SLO "https://raw.githubusercontent.com/pypa/get-pip/430ba37776ae2ad89f794c7a43b90dc23bac334c/get-pip.py" \
&& echo "19dae841a150c86e2a09d475b5eb0602861f2a5b7761ec268049a662dbd2bd0c get-pip.py" | sha256sum -c - \
&& python3 get-pip.py \
&& rm get-pip.py \
; fi \
&& pip3 install --no-cache-dir --upgrade --force-reinstall pip=="$PYTHON_PIP_VERSION" setuptools=="$SETUPTOOLS_VERSION" \
&& find /usr/local \
\( -type d -a -name test -o -name tests \) \
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
-exec rm -rf '{}' + \
&& cd / \
&& rm -rf /usr/src/python ~/.cache
# make some useful symlinks that are expected to exist
RUN cd /usr/local/bin \
&& ln -sf pip3 pip \
&& { [ -e easy_install ] || ln -s easy_install-* easy_install; } \
&& ln -sf idle3 idle \
&& ln -sf pydoc3 pydoc \
&& ln -sf python3 python \
&& ln -sf python3-config python-config
# set PYTHONPATH to point to dist-packages
ENV PYTHONPATH /usr/lib/python3/dist-packages:$PYTHONPATH
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@python.sh" \
&& echo "Running test-stack@python" \
&& chmod +x test-stack@python.sh \
&& bash test-stack@python.sh \
&& rm -rf test-stack@python.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: Intel 64-bit (x86-64) \nOS: Ubuntu bionic \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nPython v3.8.12, Pip v21.3.1, Setuptools v60.5.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/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \
&& chmod +x /bin/sh-shim \
&& cp /bin/sh /bin/sh.real \
&& mv /bin/sh-shim /bin/sh | {
"content_hash": "b69e9adc0160ef4c0ce40c73d4c1b1cd",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 724,
"avg_line_length": 51.94871794871795,
"alnum_prop": 0.7070582428430404,
"repo_name": "resin-io-library/base-images",
"id": "6fc370d5558a06c66c77a8be2e1ed6721c41196c",
"size": "4073",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "balena-base-images/python/intel-nuc/ubuntu/bionic/3.8.12/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": ""
} |
Gamestorm re-analysis of Superfoods data set
================================================
Script to explore, reanalyze and depict Superfoods data.
Originally shown at [http://www.informationisbeautiful.net/visualizations/snake-oil-superfoods/]
and data available [publically](https://docs.google.com/spreadsheet/ccc?key=0Aqe2P9sYhZ2ndHdORGgxdl9xbzJ1enJJNVc5cDFJWXc#gid=2).
```r
# library(RCurl)
library(knitr)
library(ggplot2)
```
Load data.
Method 1. Download from Google Docs (copy of original file in csv format) following this [guide](http://blog.revolutionanalytics.com/2009/09/how-to-use-a-google-spreadsheet-as-data-in-r.html) from our sponsor.
Method 2. Standard read.csv
For both, skip metadata rows then import row 2 as header.
```r
# read data skip first 3 rows, then import first row as header
superfoods <- read.csv("Superfood.csv", skip = 3, header = FALSE)
superfoods_header <- read.csv("Superfood.csv", skip = 1, nrow = 1, header = FALSE,
stringsAsFactors = FALSE)
colnames(superfoods) <- superfoods_header
# For a challenge, download data from GoogleDocs using RCurl skip first 3
# rows, then import first row as header myCSV <-
# getURL('https://docs.google.com/spreadsheet/pub?key=0Ar5IymziRJ_9dDl1aTdSRlZKakpnNXVjT2ZmVzdaQ1E&single=true&gid=2&output=csv')
# superfoods <- read.csv(textConnection(myCSV), skip = 3, header = FALSE,
# stringsAsFactors = FALSE) dim(superfoods) superfoods_header <-
# read.csv(textConnection(myCSV), nrows = 1, stringsAsFactors = FALSE)
# colnames(superfoods) <- superfoods_header
```
Examine datafile. Subset to relevant colums.
```r
dim(superfoods)
```
```
## [1] 144 38
```
```r
superfoods[1:5, 1:10]
```
```
## Food alternative name EVIDENCE condition
## 1 açaí berry 0 cancer prevention
## 2 açaí berry 0 weight control
## 3 alfalfa 0 general health, cardio
## 4 almonds 5 cholesterol, general health
## 5 amaranth 3 cholesterol
## HEALTH CONDITION TYPE One to watch POPULARITY
## 1 cancer fruit 4382
## 2 general health fruit 4382
## 3 general health, cardio vegetable OTW 3089
## 4 cardio, general health nut / seed 3782
## 5 cardio grain / pulse 1581
## NO OF STUDIES WE EXAMINED SCIENTIFIC INTEREST
## 1 0 28
## 2 0 28
## 3 0 152
## 4 11 131
## 5 0 101
```
```r
superfoods[1:5, 11:20]
```
```
## UNUSED
## 1
## 2
## 3
## 4
## 5
## notes
## 1 No human trials. Cell studies show strong anti-oxidant effects - but that's a long way from being "anti-cancer" in humans.
## 2 Acai berries are widely marketed for weight loss despite no definitive scientific evidence.
## 3 Showing some potential, especially for cardiovascular health. No evidence as yet.
## 4 Almonds consistently lower "bad" (LDL) cholestrol in healthy individuals, and those with high cholesterol and diabetes. (Berryman et al 2011)
## 5 The bulk of the research has been in animal studies. The Amaranth grain does contain potentially beneficial medicinal compound in varying amounts. Results: inconclusive.
## Exclude NA
## 1 NA NA
## 2 NA NA
## 3 NA NA
## 4 NA NA
## 5 NA NA
## notes.1
## 1 No human trials, but in vitro studies suggest acai berries exhibit significantly high antioxidant capacity in vitro, and therefore may have possible health benefits.
## 2
## 3 2011: Medicago sativa (alfalfa) seems to hold great potential for in-depth investigation for various biological activities, especially their effects on central nervous and cardiovascular system.
## 4 Consumption of tree nuts has been shown to reduce low-density lipoprotein cholesterol (LDL-C), a primary target for coronary disease prevention, by 3-19%. Almonds have been found to have a consistent LDL-C-lowering effect in healthy individuals, and in individuals with high cholesterol and diabetes. (Berryman et al 2011)
## 5 2012: Although the great majority of the research about the beneficial functions and actions of amaranth has been conducted in experimental animal models, there are compounds in the grain with potentially beneficial medicinal properties present in the various fractions. 2009: Conclusion: results positive but cannot be attributed to amaranth alone.
## Cochrane systematic review Other International review board or metastudy
## 1
## 2
## 3 http://www.ncbi.nlm.nih.gov/pubmed/20969516
## 4 http://www.ncbi.nlm.nih.gov/pubmed/22153059
## 5
## Link to main individual study
## 1
## 2 http://nccam.nih.gov/health/acai
## 3
## 4 http://www.jacn.org/content/17/3/285.long
## 5 http://www.ncbi.nlm.nih.gov/pubmed/22515252
## no. of studies in Cochrane metastudy % positive studies / trials
## 1 NA
## 2 NA
## 3 NA
## 4 NA 100%
## 5 NA
```
```r
superdata <- superfoods[, c("Food", "alternative name", "EVIDENCE", "condition",
"HEALTH CONDITION", "TYPE", "One to watch", "POPULARITY", "NO OF STUDIES WE EXAMINED",
"SCIENTIFIC INTEREST")]
str(superdata)
```
```
## 'data.frame': 144 obs. of 10 variables:
## $ Food : Factor w/ 111 levels "açaí berry","alfalfa",..: 1 1 2 3 4 5 6 7 8 9 ...
## $ alternative name : Factor w/ 32 levels "","aamla berry, Indian gooseberry, Phyllanthus emblica",..: 1 1 1 1 1 2 30 1 1 1 ...
## $ EVIDENCE : num 0 0 0 5 3 1 1 1 3 1 ...
## $ condition : Factor w/ 82 levels "all conditions",..: 15 79 47 27 26 66 68 82 59 39 ...
## $ HEALTH CONDITION : Factor w/ 33 levels "cancer","cardio",..: 1 12 16 6 3 18 32 31 12 10 ...
## $ TYPE : Factor w/ 10 levels "alga","animal product",..: 3 3 10 8 5 3 6 9 3 10 ...
## $ One to watch : Factor w/ 2 levels "","OTW": 1 1 2 1 1 2 2 1 1 2 ...
## $ POPULARITY : Factor w/ 109 levels "1,304","1010",..: 69 69 52 62 25 97 32 43 64 40 ...
## $ NO OF STUDIES WE EXAMINED: int 0 0 0 11 0 1 1 4 3 1 ...
## $ SCIENTIFIC INTEREST : int 28 28 152 131 101 27 160 79 701 171 ...
```
Plot
```r
# base plot
barplot(superdata$EVIDENCE)
```
<img src="figure/unnamed-chunk-11.png" title="plot of chunk unnamed-chunk-1" alt="plot of chunk unnamed-chunk-1" style="display: block; margin: auto;" />
```r
# point plot
p <- ggplot(superdata, aes(Food, EVIDENCE))
p + geom_point()
```
```
## Warning: conversion failure on 'nattō' in 'mbcsToSbcs': dot substituted for <c5>
## Warning: conversion failure on 'nattō' in 'mbcsToSbcs': dot substituted for <8d>
## Warning: conversion failure on 'nattō' in 'mbcsToSbcs': dot substituted for <c5>
## Warning: conversion failure on 'nattō' in 'mbcsToSbcs': dot substituted for <8d>
## Warning: conversion failure on 'nattō' in 'mbcsToSbcs': dot substituted for <c5>
## Warning: conversion failure on 'nattō' in 'mbcsToSbcs': dot substituted for <8d>
## Warning: conversion failure on 'nattō' in 'mbcsToSbcs': dot substituted for <c5>
## Warning: conversion failure on 'nattō' in 'mbcsToSbcs': dot substituted for <8d>
## Warning: conversion failure on 'nattō' in 'mbcsToSbcs': dot substituted for <c5>
## Warning: conversion failure on 'nattō' in 'mbcsToSbcs': dot substituted for <8d>
```
<img src="figure/unnamed-chunk-12.png" title="plot of chunk unnamed-chunk-1" alt="plot of chunk unnamed-chunk-1" style="display: block; margin: auto;" />
```r
p <- ggplot(superdata, aes(EVIDENCE, Food))
p + geom_point()
```
```
## Warning: conversion failure on 'nattō' in 'mbcsToSbcs': dot substituted for <c5>
## Warning: conversion failure on 'nattō' in 'mbcsToSbcs': dot substituted for <8d>
## Warning: conversion failure on 'nattō' in 'mbcsToSbcs': dot substituted for <c5>
## Warning: conversion failure on 'nattō' in 'mbcsToSbcs': dot substituted for <8d>
## Warning: conversion failure on 'nattō' in 'mbcsToSbcs': dot substituted for <c5>
## Warning: conversion failure on 'nattō' in 'mbcsToSbcs': dot substituted for <8d>
## Warning: conversion failure on 'nattō' in 'mbcsToSbcs': dot substituted for <c5>
## Warning: conversion failure on 'nattō' in 'mbcsToSbcs': dot substituted for <8d>
## Warning: conversion failure on 'nattō' in 'mbcsToSbcs': dot substituted for <c5>
## Warning: conversion failure on 'nattō' in 'mbcsToSbcs': dot substituted for <8d>
## Warning: conversion failure on 'nattō' in 'mbcsToSbcs': dot substituted for <c5>
## Warning: conversion failure on 'nattō' in 'mbcsToSbcs': dot substituted for <8d>
```
<img src="figure/unnamed-chunk-13.png" title="plot of chunk unnamed-chunk-1" alt="plot of chunk unnamed-chunk-1" style="display: block; margin: auto;" />
```r
sessionInfo()
```
```
## R version 3.0.1 (2013-05-16)
## Platform: x86_64-apple-darwin10.8.0 (64-bit)
##
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] ggplot2_0.9.3.1 knitr_1.5
##
## loaded via a namespace (and not attached):
## [1] colorspace_1.2-4 dichromat_2.0-0 digest_0.6.3
## [4] evaluate_0.5.1 formatR_0.10 grid_3.0.1
## [7] gtable_0.1.2 labeling_0.2 MASS_7.3-29
## [10] munsell_0.4.2 plyr_1.8 proto_0.3-10
## [13] RColorBrewer_1.0-5 reshape2_1.2.2 scales_0.2.3
## [16] stringr_0.6.2 tools_3.0.1
```
```r
purl("superfoods_gamestorm.Rmd")
```
```
##
##
## processing file: superfoods_gamestorm.Rmd
```
```
##
|
| | 0%
|
|...... | 9%
|
|............ | 18%
|
|.................. | 27%
|
|........................ | 36%
|
|.............................. | 45%
|
|................................... | 55%
|
|......................................... | 64%
|
|............................................... | 73%
|
|..................................................... | 82%
|
|........................................................... | 91%
|
|.................................................................| 100%
```
```
## output file: superfoods_gamestorm.R
```
```
## [1] "superfoods_gamestorm.R"
```
| {
"content_hash": "c9284d48302c38610cbbfc1bf8f0ed57",
"timestamp": "",
"source": "github",
"line_count": 280,
"max_line_length": 358,
"avg_line_length": 50.15357142857143,
"alnum_prop": 0.4588050986256498,
"repo_name": "UserR-Burlington/Superfoods",
"id": "3e5970e686982d08e27197ff9a160e4aa1f7c687",
"size": "14071",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "superfoods_gamestorm.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "R",
"bytes": "6140"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_112) on Fri Jun 16 09:55:06 MST 2017 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>RandomElectionPolicyConsumer (Public javadocs 2017.6.1 API)</title>
<meta name="date" content="2017-06-16">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="RandomElectionPolicyConsumer (Public javadocs 2017.6.1 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":18};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],16:["t5","Default Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/RandomElectionPolicyConsumer.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">WildFly Swarm API, 2017.6.1</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/wildfly/swarm/config/singleton/singleton_policy/RandomElectionPolicy.html" title="class in org.wildfly.swarm.config.singleton.singleton_policy"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../../../org/wildfly/swarm/config/singleton/singleton_policy/RandomElectionPolicySupplier.html" title="interface in org.wildfly.swarm.config.singleton.singleton_policy"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/wildfly/swarm/config/singleton/singleton_policy/RandomElectionPolicyConsumer.html" target="_top">Frames</a></li>
<li><a href="RandomElectionPolicyConsumer.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.wildfly.swarm.config.singleton.singleton_policy</div>
<h2 title="Interface RandomElectionPolicyConsumer" class="title">Interface RandomElectionPolicyConsumer<T extends <a href="../../../../../../org/wildfly/swarm/config/singleton/singleton_policy/RandomElectionPolicy.html" title="class in org.wildfly.swarm.config.singleton.singleton_policy">RandomElectionPolicy</a><T>></h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Functional Interface:</dt>
<dd>This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.</dd>
</dl>
<hr>
<br>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/FunctionalInterface.html?is-external=true" title="class or interface in java.lang">@FunctionalInterface</a>
public interface <span class="typeNameLabel">RandomElectionPolicyConsumer<T extends <a href="../../../../../../org/wildfly/swarm/config/singleton/singleton_policy/RandomElectionPolicy.html" title="class in org.wildfly.swarm.config.singleton.singleton_policy">RandomElectionPolicy</a><T>></span></pre>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span><span id="t5" class="tableTab"><span><a href="javascript:show(16);">Default Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/config/singleton/singleton_policy/RandomElectionPolicyConsumer.html#accept-T-">accept</a></span>(<a href="../../../../../../org/wildfly/swarm/config/singleton/singleton_policy/RandomElectionPolicyConsumer.html" title="type parameter in RandomElectionPolicyConsumer">T</a> value)</code>
<div class="block">Configure a pre-constructed instance of RandomElectionPolicy resource</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>default <a href="../../../../../../org/wildfly/swarm/config/singleton/singleton_policy/RandomElectionPolicyConsumer.html" title="interface in org.wildfly.swarm.config.singleton.singleton_policy">RandomElectionPolicyConsumer</a><<a href="../../../../../../org/wildfly/swarm/config/singleton/singleton_policy/RandomElectionPolicyConsumer.html" title="type parameter in RandomElectionPolicyConsumer">T</a>></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/config/singleton/singleton_policy/RandomElectionPolicyConsumer.html#andThen-org.wildfly.swarm.config.singleton.singleton_policy.RandomElectionPolicyConsumer-">andThen</a></span>(<a href="../../../../../../org/wildfly/swarm/config/singleton/singleton_policy/RandomElectionPolicyConsumer.html" title="interface in org.wildfly.swarm.config.singleton.singleton_policy">RandomElectionPolicyConsumer</a><<a href="../../../../../../org/wildfly/swarm/config/singleton/singleton_policy/RandomElectionPolicyConsumer.html" title="type parameter in RandomElectionPolicyConsumer">T</a>> after)</code> </td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="accept-org.wildfly.swarm.config.singleton.singleton_policy.RandomElectionPolicy-">
<!-- -->
</a><a name="accept-T-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>accept</h4>
<pre>void accept(<a href="../../../../../../org/wildfly/swarm/config/singleton/singleton_policy/RandomElectionPolicyConsumer.html" title="type parameter in RandomElectionPolicyConsumer">T</a> value)</pre>
<div class="block">Configure a pre-constructed instance of RandomElectionPolicy resource</div>
</li>
</ul>
<a name="andThen-org.wildfly.swarm.config.singleton.singleton_policy.RandomElectionPolicyConsumer-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>andThen</h4>
<pre>default <a href="../../../../../../org/wildfly/swarm/config/singleton/singleton_policy/RandomElectionPolicyConsumer.html" title="interface in org.wildfly.swarm.config.singleton.singleton_policy">RandomElectionPolicyConsumer</a><<a href="../../../../../../org/wildfly/swarm/config/singleton/singleton_policy/RandomElectionPolicyConsumer.html" title="type parameter in RandomElectionPolicyConsumer">T</a>> andThen(<a href="../../../../../../org/wildfly/swarm/config/singleton/singleton_policy/RandomElectionPolicyConsumer.html" title="interface in org.wildfly.swarm.config.singleton.singleton_policy">RandomElectionPolicyConsumer</a><<a href="../../../../../../org/wildfly/swarm/config/singleton/singleton_policy/RandomElectionPolicyConsumer.html" title="type parameter in RandomElectionPolicyConsumer">T</a>> after)</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/RandomElectionPolicyConsumer.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">WildFly Swarm API, 2017.6.1</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/wildfly/swarm/config/singleton/singleton_policy/RandomElectionPolicy.html" title="class in org.wildfly.swarm.config.singleton.singleton_policy"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../../../org/wildfly/swarm/config/singleton/singleton_policy/RandomElectionPolicySupplier.html" title="interface in org.wildfly.swarm.config.singleton.singleton_policy"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/wildfly/swarm/config/singleton/singleton_policy/RandomElectionPolicyConsumer.html" target="_top">Frames</a></li>
<li><a href="RandomElectionPolicyConsumer.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2017 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p>
</body>
</html>
| {
"content_hash": "b88b4e59cc236d4578c6021673110af8",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 852,
"avg_line_length": 49.91129032258065,
"alnum_prop": 0.6749878817256423,
"repo_name": "wildfly-swarm/wildfly-swarm-javadocs",
"id": "8cc91894c74f36fbc5846a34d65754bfde1fb801",
"size": "12378",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "2017.6.1/apidocs/org/wildfly/swarm/config/singleton/singleton_policy/RandomElectionPolicyConsumer.html",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
DOUBTFUL
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "b79eef4addbbd82b0831894f4895ccb6",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.307692307692308,
"alnum_prop": 0.6940298507462687,
"repo_name": "mdoering/backbone",
"id": "b13a3462eebdd1cadb4d628933147b75eb2f2c1d",
"size": "211",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Koanophyllon/Koanophyllon tetranfolium/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package com.cloudhopper.commons.util;
import java.io.IOException;
import java.io.InputStream;
import java.util.Locale;
import java.util.Properties;
import java.util.StringTokenizer;
/**
* A set of String utilities.
*
* @author joelauer (twitter: @jjlauer or <a href="http://twitter.com/jjlauer" target=window>http://twitter.com/jjlauer</a>)
*/
public class StringUtil {
private static final String PRINTABLE = ": ~`!@#$%^&*()-_+=/\\,.[]{}|?<>\"'";
private static final String SAFE = ":~!@#$%^&*()-_+=/\\,.[]{}|?<>";
// (gt, lt, quot, amp, apos) and then newline, carriage return
private static final String[][] XML_CHARS = {
{ "&", "&"},
{ "<", "<"},
{ ">", ">"},
{ "\"", """},
{ "'", "'"},
{ "\n", " "},
{ "\r", " "},
};
/**
* Searches the string for occurrences of the pattern $ENV{key} and
* attempts to replace this pattern with a value from the System environment
* obtained using the 'key'. For example, including "$ENV{USERNAME}" in
* a string and calling this method would then attempt to replace the entire
* pattern with the value of the environment variable "USERNAME". The System
* environment is obtained in Java with a call to System.getenv(). An environment variable is typically
* defined in the Linux shell or Windows property tabs. NOTE: A Java System
* property is not the same as an environment variable.
* @param string0 The string to perform substitution on such as "Hello $ENV{USERNAME}".
* This string may be null, empty, or contain one or more substitutions.
* @return A string with all occurrences of keys substituted with their
* values obtained from the System environment. Can be null if the
* original string was null.
* @throws SubstitutionException Thrown if a starting string was found, but the
* ending string was not. Also, thrown if a key value was empty such
* as using "$ENV{}". Finally, thrown if the property key was not
* found in the properties object (could not be replaced).
* @see #substituteWithProperties(java.lang.String, java.lang.String, java.lang.String, java.util.Properties)
*/
public static String substituteWithEnvironment(String string0) throws SubstitutionException {
// turn environment into properties
Properties envProps = new Properties();
// add all system environment vars to the properties
envProps.putAll(System.getenv());
// delegate to other method using the default syntax $ENV{<key>}
return substituteWithProperties(string0, "$ENV{", "}", envProps);
}
/**
* Searches string for occurrences of a pattern, extracts out a key name
* between the startStr and endStr tokens, then attempts to replace the
* property value into the string. This method is useful for merging
* property values into configuration strings/settings. For examle, the
* system environment Map could be converted into a Properties object then
* have its values merged into a String so that users can access environment
* variables.
* @param string0 The string to perform substitution on such as "Hello $ENV{TEST}".
* This string may be null, empty, or contain one or more substitutions.
* @param startStr The string that marks the start of a replacement key such
* as "$ENV{" if the final search pattern you wanted was "$ENV{<key>}".
* @param endStr The string that marks the end of a replacement key such
* as "}" if the final search pattern you wanted was "$ENV{<key>}".
* @param properties The property keys and associated values to use for
* replacement.
* @return A string with all occurrences of keys substituted with their
* values obtained from the properties object. Can be null if the
* original string was null.
* @throws SubstitutionException Thrown if a starting string was found, but the
* ending string was not. Also, thrown if a key value was empty such
* as using "$ENV{}". Finally, thrown if the property key was not
* found in the properties object (could not be replaced).
* @see #substituteWithEnvironment(java.lang.String)
*/
public static String substituteWithProperties(String string0, String startStr, String endStr, Properties properties) throws SubstitutionException {
// a null source string will always return the same -- a null result
if (string0 == null) {
return null;
}
// create a builder for the resulting string
StringBuilder result = new StringBuilder(string0.length());
// attempt to find the first occurrence of the starting string
int end = -1;
int pos = string0.indexOf(startStr);
// keep looping while we keep finding more occurrences
while (pos >= 0) {
// is there string data before the position that we should append to the result?
if (pos > end+1) {
result.append(string0.substring(end+1, pos));
}
// search for endStr starting from the end of the startStr
end = string0.indexOf(endStr, pos+startStr.length());
// was the end found?
if (end < 0) {
throw new SubstitutionException("End of substitution pattern '" + endStr + "' not found [@position=" + pos + "]");
}
// extract the part in the middle of the start and end strings
String key = string0.substring(pos+startStr.length(), end);
// NOTE: don't trim the key, whitespace technically matters...
// was there anything left?
if (key == null || key.equals("")) {
throw new SubstitutionException("Property key was empty in string with an occurrence of '" + startStr + endStr + "' [@position=" + pos + "]");
}
// attempt to get this property
String value = properties.getProperty(key);
// was the property found
if (value == null) {
throw new SubstitutionException("A property value for '" + startStr + key + endStr + "' was not found (property missing?)");
}
// append this value to our result
result.append(value);
// find next occurrence after last end
pos = string0.indexOf(startStr, end+1);
}
// is there any string data we missed in the loop above?
if (end+1 < string0.length()) {
// append the remaining part of the string
result.append(string0.substring(end+1));
}
return result.toString();
}
/**
* Returns true if the String is considered a "safe" string where only specific
* characters are allowed to be used. Useful for checking passwords or other
* information you don't want a user to be able to type just anything in.
* This method does not allow any whitespace characters, newlines, carriage returns.
* Primarily allows [a-z] [A-Z] [0-9] and a few other useful ASCII characters
* such as ":~!@#$%^*()-_+=/\\,.[]{}|?<>" (but not the quote chars)
*/
public static boolean isSafeString(String string0) {
for (int i = 0; i < string0.length(); i++) {
if (!isSafeChar(string0.charAt(i))) {
return false;
}
}
return true;
}
/**
* Returns true if the char is considered a "safe" char. Please see
* documentation for isSafeString().
* @see #isSafeString(java.lang.String)
*/
public static boolean isSafeChar(char ch) {
if (ch >= 'a' && ch <= 'z')
return true;
if (ch >= 'A' && ch <= 'Z')
return true;
if (ch >= '0' && ch <= '9')
return true;
// loop thru our PRINTABLE string
for (int i = 0; i < SAFE.length(); i++) {
if (ch == SAFE.charAt(i))
return true;
}
return false;
}
/**
* Safely capitalizes a string by converting the first character to upper
* case. Handles null, empty, and strings of length of 1 or greater. For
* example, this will convert "joe" to "Joe". If the string is null, this
* will return null. If the string is empty such as "", then it'll just
* return an empty string such as "".
* @param string0 The string to capitalize
* @return A new string with the first character converted to upper case
*/
static public String capitalize(String string0) {
if (string0 == null) {
return null;
}
int length = string0.length();
// if empty string, just return it
if (length == 0) {
return string0;
} else if (length == 1) {
return string0.toUpperCase();
} else {
StringBuilder buf = new StringBuilder(length);
buf.append(string0.substring(0, 1).toUpperCase());
buf.append(string0.substring(1));
return buf.toString();
}
}
/**
* Safely uncapitalizes a string by converting the first character to lower
* case. Handles null, empty, and strings of length of 1 or greater. For
* example, this will convert "Joe" to "joe". If the string is null, this
* will return null. If the string is empty such as "", then it'll just
* return an empty string such as "".
* @param string0 The string to uncapitalize
* @return A new string with the first character converted to lower case
*/
static public String uncapitalize(String string0) {
if (string0 == null) {
return null;
}
int length = string0.length();
// if empty string, just return it
if (length == 0) {
return string0;
} else if (length == 1) {
return string0.toLowerCase();
} else {
StringBuilder buf = new StringBuilder(length);
buf.append(string0.substring(0, 1).toLowerCase());
buf.append(string0.substring(1));
return buf.toString();
}
}
/**
* Checks if the targetString is contained within the array of strings. This
* method will return true if a "null" is contained in the array and the
* targetString is also null.
* @param strings The array of strings to search.
* @param targetString The string to search for
* @return True if the string is contained within, otherwise false. Also
* returns false if the strings array is null.
*/
static public boolean contains(String[] strings, String targetString) {
return (indexOf(strings, targetString) != -1);
}
/**
* Finds the first occurrence of the targetString in the array of strings.
* Returns -1 if an occurrence wasn't found. This
* method will return true if a "null" is contained in the array and the
* targetString is also null.
* @param strings The array of strings to search.
* @param targetString The string to search for
* @return The index of the first occurrence, or -1 if not found. If strings
* array is null, will return -1;
*/
static public int indexOf(String[] strings, String targetString) {
if (strings == null)
return -1;
for (int i = 0; i < strings.length; i++) {
if (strings[i] == null) {
if (targetString == null) {
return i;
}
} else {
if (targetString != null) {
if (strings[i].equals(targetString)) {
return i;
}
}
}
}
return -1;
}
/**
* If present, this method will strip off the leading and trailing "
* character in the string parameter. For example, "10958" will
* becomes just 10958.
*/
static public String stripQuotes(String string0) {
// if an empty string, return it
if (string0.length() == 0) {
return string0;
}
// if the first and last characters are quotes, just do 1 substring
if (string0.length() > 1 && string0.charAt(0) == '"' && string0.charAt(string0.length() - 1) == '"') {
return string0.substring(1, string0.length() - 1);
} else if (string0.charAt(0) == '"') {
string0 = string0.substring(1);
} else if (string0.charAt(string0.length() - 1) == '"') {
string0 = string0.substring(0, string0.length() - 1);
}
return string0;
}
/**
* Checks if a string contains only digits.
* @return True if the string0 only contains digits, or false otherwise.
*/
static public boolean containsOnlyDigits(String string0) {
// are they all digits?
for (int i = 0; i < string0.length(); i++) {
if (!Character.isDigit(string0.charAt(i))) {
return false;
}
}
return true;
}
/**
* Splits a string around matches of the given delimiter character.
*
* Where applicable, this method can be used as a substitute for
* <code>String.split(String regex)</code>, which is not available
* on a JSR169/Java ME platform.
*
* @param str the string to be split
* @param delim the delimiter
* @throws NullPointerException if str is null
*/
static public String[] split(String str, char delim) {
if (str == null) {
throw new NullPointerException("str can't be null");
}
// Note the javadoc on StringTokenizer:
// StringTokenizer is a legacy class that is retained for
// compatibility reasons although its use is discouraged in
// new code.
// In other words, if StringTokenizer is ever removed from the JDK,
// we need to have a look at String.split() (or java.util.regex)
// if it is supported on a JSR169/Java ME platform by then.
StringTokenizer st = new StringTokenizer(str, String.valueOf(delim));
int n = st.countTokens();
String[] s = new String[n];
for (int i = 0; i < n; i++) {
s[i] = st.nextToken();
}
return s;
}
/**
* Used to print out a string for error messages,
* chops is off at 60 chars for historical reasons.
*/
public final static String formatForPrint(String input) {
if (input.length() > 60) {
StringBuffer tmp = new StringBuffer(input.substring(0, 60));
tmp.append("&");
input = tmp.toString();
}
return input;
}
/**
* A method that receive an array of Objects and return a
* String array representation of that array.
*/
public static String[] toStringArray(Object[] objArray) {
int idx;
int len = objArray.length;
String[] strArray = new String[len];
for (idx = 0; idx < len; idx++) {
strArray[idx] = objArray[idx].toString();
}
return strArray;
}
/**
Get 7-bit ASCII character array from input String.
The lower 7 bits of each character in the input string is assumed to be
the ASCII character value.
Hexadecimal - Character
| 00 NUL| 01 SOH| 02 STX| 03 ETX| 04 EOT| 05 ENQ| 06 ACK| 07 BEL|
| 08 BS | 09 HT | 0A NL | 0B VT | 0C NP | 0D CR | 0E SO | 0F SI |
| 10 DLE| 11 DC1| 12 DC2| 13 DC3| 14 DC4| 15 NAK| 16 SYN| 17 ETB|
| 18 CAN| 19 EM | 1A SUB| 1B ESC| 1C FS | 1D GS | 1E RS | 1F US |
| 20 SP | 21 ! | 22 " | 23 # | 24 $ | 25 % | 26 & | 27 ' |
| 28 ( | 29 ) | 2A * | 2B + | 2C , | 2D - | 2E . | 2F / |
| 30 0 | 31 1 | 32 2 | 33 3 | 34 4 | 35 5 | 36 6 | 37 7 |
| 38 8 | 39 9 | 3A : | 3B ; | 3C < | 3D = | 3E > | 3F ? |
| 40 @ | 41 A | 42 B | 43 C | 44 D | 45 E | 46 F | 47 G |
| 48 H | 49 I | 4A J | 4B K | 4C L | 4D M | 4E N | 4F O |
| 50 P | 51 Q | 52 R | 53 S | 54 T | 55 U | 56 V | 57 W |
| 58 X | 59 Y | 5A Z | 5B [ | 5C \ | 5D ] | 5E ^ | 5F _ |
| 60 ` | 61 a | 62 b | 63 c | 64 d | 65 e | 66 f | 67 g |
| 68 h | 69 i | 6A j | 6B k | 6C l | 6D m | 6E n | 6F o |
| 70 p | 71 q | 72 r | 73 s | 74 t | 75 u | 76 v | 77 w |
| 78 x | 79 y | 7A z | 7B { | 7C | | 7D } | 7E ~ | 7F DEL|
*/
public static byte[] getAsciiBytes(String input) {
char[] c = input.toCharArray();
byte[] b = new byte[c.length];
for (int i = 0; i < c.length; i++) {
b[i] = (byte) (c[i] & 0x007F);
}
return b;
}
public static String getAsciiString(byte[] input) {
StringBuffer buf = new StringBuffer(input.length);
for (byte b : input) {
buf.append((char) b);
}
return buf.toString();
}
/**
* Trim off trailing blanks but not leading blanks
* @param str
* @return The input with trailing blanks stipped off
*/
public static String trimTrailing(String str) {
if (str == null) {
return null;
}
int len = str.length();
for (; len > 0; len--) {
if (!Character.isWhitespace(str.charAt(len - 1))) {
break;
}
}
return str.substring(0, len);
}
/**
Truncate a String to the given length with no warnings
or error raised if it is bigger.
@param value String to be truncated
@param length Maximum length of string
@return Returns value if value is null or value.length() is less or equal to than length, otherwise a String representing
value truncated to length.
*/
public static String truncate(String value, int length) {
if (value != null && value.length() > length) {
value = value.substring(0, length);
}
return value;
}
/**
* Return a slice (substring) of the passed in value, optionally trimmed.
* WARNING - endOffset is inclusive for historical reasons, unlike
* String.substring() which has an exclusive ending offset.
* @param value Value to slice, must be non-null.
* @param beginOffset Inclusive start character
* @param endOffset Inclusive end character
* @param trim To trim or not to trim
* @return Sliceed value.
*/
public static String slice(String value,
int beginOffset, int endOffset,
boolean trim) {
String retval = value.substring(beginOffset, endOffset + 1);
if (trim) {
retval = retval.trim();
}
return retval;
}
public static char[] HEX_TABLE = {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'a', 'b', 'c', 'd', 'e', 'f'
};
/**
* @deprecated Please use new utility class HexUtil
* @see HexUtil#toHexString(byte[])
*/
@Deprecated
public static String toHexString(byte[] bytes) {
return HexUtil.toHexString(bytes);
}
/**
* @deprecated Please use new utility class HexUtil
* @see HexUtil#toHexString(byte[], int, int)
*/
@Deprecated
public static String toHexString(byte[] bytes, int offset, int length) {
return HexUtil.toHexString(bytes, offset, length);
}
/**
* @deprecated Please use new utility class HexUtil
* @see HexUtil#toByteArray(java.lang.CharSequence, int, int)
*/
@Deprecated
public static byte[] toHexByte(String hexString, int offset, int length) {
return HexUtil.toByteArray(hexString, offset, length);
}
/**
* Converts from a hex string like "FF" to a byte[].
* @param string0 The string containing the hex-encoded data.
* @return
* @deprecated Please use new utility class HexUtil
* @see HexUtil#toByteArray(java.lang.CharSequence)
*/
@Deprecated
public static byte[] fromHexString(String hexString) {
return HexUtil.toByteArray(hexString);
}
/**
* Convert a hexidecimal string generated by toHexString() back into a byte array.
* @param s String to convert
* @param offset starting character (zero based) to convert.
* @param length number of characters to convert.
* @return the converted byte array. Returns null if the length is not a multiple of 2.
* @deprecated Please use new utility class HexUtil
* @see HexUtil#toByteArray(java.lang.CharSequence, int, int)
*/
@Deprecated
public static byte[] fromHexString(String hexString, int offset, int length) {
return HexUtil.toByteArray(hexString, offset, length);
}
/**
* Return true if the character is printable in ASCII. Not using
* Character.isLetterOrDigit(); applies to all unicode ranges.
*/
public static boolean isPrintableChar(char ch) {
if (ch >= 'a' && ch <= 'z') {
return true;
}
if (ch >= 'A' && ch <= 'Z') {
return true;
}
if (ch >= '0' && ch <= '9') {
return true;
}
// loop thru our PRINTABLE string
for (int i = 0; i < PRINTABLE.length(); i++) {
if (ch == PRINTABLE.charAt(i)) {
return true;
}
}
return false;
}
/**
Convert a byte array to a human-readable String for debugging purposes.
*/
public static String hexDump(String prefix, byte[] data) {
byte byte_value;
StringBuffer str = new StringBuffer(data.length * 3);
str.append(prefix);
for (int i = 0; i < data.length; i += 16) {
// dump the header: 00000000:
String offset = Integer.toHexString(i);
// "0" left pad offset field so it is always 8 char's long.
str.append(" ");
for (int offlen = offset.length(); offlen < 8; offlen++) {
str.append("0");
}
str.append(offset);
str.append(":");
// dump hex version of 16 bytes per line.
for (int j = 0; (j < 16) && ((i + j) < data.length); j++) {
byte_value = data[i + j];
// add spaces between every 2 bytes.
if ((j % 2) == 0) {
str.append(" ");
}
// dump a single byte.
byte high_nibble = (byte) ((byte_value & 0xf0) >>> 4);
byte low_nibble = (byte) (byte_value & 0x0f);
str.append(HEX_TABLE[high_nibble]);
str.append(HEX_TABLE[low_nibble]);
}
// IF THIS IS THE LAST LINE OF HEX, THEN ADD THIS
if (i + 16 > data.length) {
// for debugging purposes, I want the last bytes always padded
// over so that the ascii portion is correctly positioned
int last_row_byte_count = data.length % 16;
int num_bytes_short = 16 - last_row_byte_count;
// number of spaces to add = (num bytes remaining * 2 spaces per byte) + (7 - (num bytes % 2))
int num_spaces = (num_bytes_short * 2) + (7 - (last_row_byte_count / 2));
for (int v = 0; v < num_spaces; v++) {
str.append(" ");
}
}
// dump ascii version of 16 bytes
str.append(" ");
for (int j = 0; (j < 16) && ((i + j) < data.length); j++) {
char char_value = (char) data[i + j];
// RESOLVE (really want isAscii() or isPrintable())
//if (Character.isLetterOrDigit(char_value))
if (isPrintableChar(char_value)) {
str.append(String.valueOf(char_value));
} else {
str.append(".");
}
}
// new line
str.append("\n");
}
// always trim off the last newline
str.deleteCharAt(str.length() - 1);
return (str.toString());
}
// The functions below are used for uppercasing SQL in a consistent manner.
// Derby will uppercase Turkish to the English locale to avoid i
// uppercasing to an uppercase dotted i. In future versions, all
// casing will be done in English. The result will be that we will get
// only the 1:1 mappings in
// http://www.unicode.org/Public/3.0-Update1/UnicodeData-3.0.1.txt
// and avoid the 1:n mappings in
//http://www.unicode.org/Public/3.0-Update1/SpecialCasing-3.txt
//
// Any SQL casing should use these functions
/** Convert string to uppercase
* Always use the java.util.ENGLISH locale
* @param s string to uppercase
* @return uppercased string
*/
public static String SQLToUpperCase(String s) {
return s.toUpperCase(Locale.ENGLISH);
}
/** Compares two strings
* Strings will be uppercased in english and compared
* equivalent to s1.equalsIgnoreCase(s2)
* throws NPE if s1 is null
*
* @param s1 first string to compare
* @param s2 second string to compare
*
* @return true if the two upppercased ENGLISH values are equal
* return false if s2 is null
*/
public static boolean SQLEqualsIgnoreCase(String s1, String s2) {
if (s2 == null) {
return false;
} else {
return SQLToUpperCase(s1).equals(SQLToUpperCase(s2));
}
}
/**
* Normalize a SQL identifer, up-casing if <regular identifer>,
* and handling of <delimited identifer> (SQL 2003, section 5.2).
* The normal form is used internally in Derby.
*
* @param id syntacically correct SQL identifier
*/
public static String normalizeSQLIdentifier(String id) {
if (id.length() == 0) {
return id;
}
if (id.charAt(0) == '"'
&& id.length() >= 3
&& id.charAt(id.length() - 1) == '"') {
// assume syntax is OK, thats is, any quotes inside are doubled:
return StringUtil.compressQuotes(
id.substring(1, id.length() - 1), "\"\"");
} else {
return StringUtil.SQLToUpperCase(id);
}
}
/**
* Compress 2 adjacent (single or double) quotes into a single (s or d)
* quote when found in the middle of a String.
*
* NOTE: """" or '''' will be compressed into "" or ''.
* This function assumes that the leading and trailing quote from a
* string or delimited identifier have already been removed.
* @param source string to be compressed
* @param quotes string containing two single or double quotes.
* @return String where quotes have been compressed
*/
public static String compressQuotes(String source, String quotes) {
String result = source;
int index;
/* Find the first occurrence of adjacent quotes. */
index = result.indexOf(quotes);
/* Replace each occurrence with a single quote and begin the
* search for the next occurrence from where we left off.
*/
while (index != -1) {
result = result.substring(0, index + 1)
+ result.substring(index + 2);
index = result.indexOf(quotes, index + 1);
}
return result;
}
/**
* Quote a string so that it can be used as an identifier or a string
* literal in SQL statements. Identifiers are surrounded by double quotes
* and string literals are surrounded by single quotes. If the string
* contains quote characters, they are escaped.
*
* @param source the string to quote
* @param quote the character to quote the string with (' or ")
* @return a string quoted with the specified quote character
* @see #quoteStringLiteral(String)
* @see IdUtil#normalToDelimited(String)
*/
static String quoteString(String source, char quote) {
// Normally, the quoted string is two characters longer than the source
// string (because of start quote and end quote).
StringBuffer quoted = new StringBuffer(source.length() + 2);
quoted.append(quote);
for (int i = 0; i < source.length(); i++) {
char c = source.charAt(i);
// if the character is a quote, escape it with an extra quote
if (c == quote) quoted.append(quote);
quoted.append(c);
}
quoted.append(quote);
return quoted.toString();
}
/**
* Quote a string so that it can be used as a string literal in an
* SQL statement.
*
* @param string the string to quote
* @return the string surrounded by single quotes and with proper escaping
* of any single quotes inside the string
*/
public static String quoteStringLiteral(String string) {
return quoteString(string, '\'');
}
/**
* Turn an array of ints into a printable string. Returns what's returned
* in Java 5 by java.util.Arrays.toString(int[]).
*/
public static String stringify(int[] raw) {
if (raw == null) {
return "null";
}
StringBuffer buffer = new StringBuffer();
int count = raw.length;
buffer.append("[ ");
for (int i = 0; i < count; i++) {
if (i > 0) {
buffer.append(", ");
}
buffer.append(raw[i]);
}
buffer.append(" ]");
return buffer.toString();
}
/**
* Checks if the string is an empty value which is true if the string is
* null or if the string represents an empty string of "". Please note that
* a string with just a space " " would not be considered empty.
* @param string0 The string to check
* @return True if null or "", otherwise false.
*/
public static boolean isEmpty(String string0) {
if (string0 == null || string0.length() == 0) {
return true;
} else {
return false;
}
}
public static boolean isEqual(String string0, String string1) {
return isEqual(string0, string1, true);
}
/**
* Returns the value from calling "toString()" on the object, but is a safe
* version that gracefully handles NULL objects by returning a String of "".
* @param obj The object to call toString() on. Safely handles a null object.
* @return The value from obj.toString() or "" if the object is null.
* @see #toStringWithNullAsNull(java.lang.Object)
*/
static public String toStringWithNullAsEmpty(Object obj) {
if (obj == null) {
return "";
} else {
return obj.toString();
}
}
/**
* Returns the value from calling "toString()" on the object, but is a safe
* version that gracefully handles NULL objects by returning a String of "<NULL>".
* @param obj The object to call toString() on. Safely handles a null object.
* @return The value from obj.toString() or "<NULL>" if the object is null.
* @see #toStringWithNullAsEmpty(java.lang.Object)
*/
static public String toStringWithNullAsReplaced(Object obj) {
if (obj == null) {
return "<NULL>";
} else {
return obj.toString();
}
}
/**
* Returns the value from calling "toString()" on the object, but is a safe
* version that gracefully handles NULL objects by returning null (rather
* than causing a NullPointerException).
* @param obj The object to call toString() on. Safely handles a null object.
* @return The value from obj.toString() or null if the object is null.
* @see #toStringWithNullAsEmpty(java.lang.Object)
*/
static public String toStringWithNullAsNull(Object obj) {
if (obj == null) {
return null;
} else {
return obj.toString();
}
}
/**
* Checks if both strings are equal to each other. Safely handles the case
* where either string may be null. The strings are evaluated as equal if
* they are both null or if they actually equal each other. One string
* that is null while the other one isn't (even if its an empty string) will
* be considered as NOT equal. Case sensitive comparisons are optional.
* @param string0 The string to compare
* @param string1 The other string to compare with
* @param caseSensitive If true a case sensitive comparison will be made,
* otherwise equalsIgnoreCase will be used.
* @return True if the strings are both null or equal to each other, otherwise
* false.
*/
public static boolean isEqual(String string0, String string1, boolean caseSensitive) {
if (string0 == null && string1 == null) {
return true;
}
if (string0 == null && string1 != null) {
return false;
}
if (string0 != null && string1 == null) {
return false;
}
if (caseSensitive) {
return string0.equals(string1);
} else {
return string0.equalsIgnoreCase(string1);
}
}
public static String readToString(InputStream in) throws IOException {
StringBuilder out = new StringBuilder();
byte[] b = new byte[4096];
for (int n; (n = in.read(b)) != -1;) {
out.append(new String(b, 0, n));
}
return out.toString();
}
/**
* Escapes the characters in a String using XML entities.
* For example: "bread" & "butter'ed" => "bread" & "butter'ed"
*
* Supports the five basic XML entities (gt, lt, quot, amp, apos) and also
* supports a newline and carriage return character. A newline is escaped
* to and a carriage return to
*
* @param value The string to escape
* @return The escaped String that can be used in an XML document.
*/
public static String escapeXml(String value) {
// null to null
if (value == null)
return null;
// assume the resulting string will be the same
int len = value.length();
StringBuilder buf = new StringBuilder(len);
for (int i = 0; i < len; i++) {
char c = value.charAt(i);
boolean entityFound = false;
// is this a matching entity?
for (int j = 0; j < XML_CHARS.length; j++) {
// is this the matching character?
if (c == XML_CHARS[j][0].charAt(0)) {
// append the entity
buf.append(XML_CHARS[j][1]);
entityFound = true;
}
}
if (!entityFound) {
buf.append(c);
}
}
return buf.toString();
}
/**
* Removes all other characters from a string except digits. A good way
* of cleaing up something like a phone number.
* @param str0 The string to clean up
* @return A new String that has all characters except digits removed
*/
static public String removeAllCharsExceptDigits(String str0) {
if (str0 == null) {
return null;
}
if (str0.length() == 0) {
return str0;
}
StringBuilder buf = new StringBuilder(str0.length());
int length = str0.length();
for (int i = 0; i < length; i++) {
char c = str0.charAt(i);
if (Character.isDigit(c)) {
// append this character to our string
buf.append(c);
}
}
return buf.toString();
}
}
| {
"content_hash": "be9eabf7cdf5cb64c1a0194af6d33421",
"timestamp": "",
"source": "github",
"line_count": 969,
"max_line_length": 158,
"avg_line_length": 37.21362229102167,
"alnum_prop": 0.5712423738214087,
"repo_name": "nkasvosve/beyondj",
"id": "58a9ca04ff3c1b1c0b3b571ded42bf502c3e99a0",
"size": "36714",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "beyondj-third-party/cloudhopper-commons-master/ch-commons-util/src/main/java/com/cloudhopper/commons/util/StringUtil.java",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "3265"
},
{
"name": "CSS",
"bytes": "231601"
},
{
"name": "HTML",
"bytes": "269326"
},
{
"name": "Java",
"bytes": "7169407"
},
{
"name": "JavaScript",
"bytes": "2065748"
},
{
"name": "Makefile",
"bytes": "5769"
},
{
"name": "Python",
"bytes": "19932"
},
{
"name": "Ruby",
"bytes": "186"
},
{
"name": "Shell",
"bytes": "4666"
},
{
"name": "Smarty",
"bytes": "902"
}
],
"symlink_target": ""
} |
<?php
namespace app\models;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use app\models\Empleado;
/**
* EmpleadoSearch represents the model behind the search form about `app\models\Empleado`.
*/
class EmpleadoSearch extends Empleado
{
/**
* @inheritdoc
*/
public function rules()
{
return [
[['id', 'id_certificacion', 'seguro_social', 'fecha_empleado', 'created_at', 'updated_at'], 'integer'],
[['nombre', 'apellido_m', 'apellido_p', 'nombramiento', 'puesto', 'oficina_division', 'razon_cese'], 'safe'],
];
}
/**
* @inheritdoc
*/
public function scenarios()
{
// bypass scenarios() implementation in the parent class
return Model::scenarios();
}
/**
* Creates data provider instance with search query applied
*
* @param array $params
*
* @return ActiveDataProvider
*/
public function search($params)
{
$query = Empleado::find();
// add conditions that should always apply here
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
$this->load($params);
if (!$this->validate()) {
// uncomment the following line if you do not want to return any records when validation fails
// $query->where('0=1');
return $dataProvider;
}
// grid filtering conditions
$query->andFilterWhere([
'id' => $this->id,
'id_certificacion' => $this->id_certificacion,
'seguro_social' => $this->seguro_social,
'fecha_empleado' => $this->fecha_empleado,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
]);
$query->andFilterWhere(['like', 'nombre', $this->nombre])
->andFilterWhere(['like', 'apellido_m', $this->apellido_m])
->andFilterWhere(['like', 'apellido_p', $this->apellido_p])
->andFilterWhere(['like', 'nombramiento', $this->nombramiento])
->andFilterWhere(['like', 'puesto', $this->puesto])
->andFilterWhere(['like', 'oficina_division', $this->oficina_division])
->andFilterWhere(['like', 'razon_cese', $this->razon_cese]);
return $dataProvider;
}
}
| {
"content_hash": "a8c11c97f17fea5122655565503d8d97",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 121,
"avg_line_length": 29.225,
"alnum_prop": 0.5598802395209581,
"repo_name": "kevin2335/liquidacion",
"id": "8ced2c73701fdc20e997372a7290fe2bc042de36",
"size": "2338",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "models/EmpleadoSearch.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "1030"
},
{
"name": "CSS",
"bytes": "1364"
},
{
"name": "PHP",
"bytes": "168724"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0_22) on Wed May 30 16:48:30 EEST 2012 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
org.apache.wicket.datetime (Wicket Parent 1.5.7 API)
</TITLE>
<META NAME="keywords" CONTENT="org.apache.wicket.datetime package">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<FONT size="+1" CLASS="FrameTitleFont">
<A HREF="../../../../org/apache/wicket/datetime/package-summary.html" target="classFrame">org.apache.wicket.datetime</A></FONT>
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
<TR>
<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont">
Classes</FONT>
<FONT CLASS="FrameItemFont">
<BR>
<A HREF="DateConverter.html" title="class in org.apache.wicket.datetime" target="classFrame">DateConverter</A>
<BR>
<A HREF="PatternDateConverter.html" title="class in org.apache.wicket.datetime" target="classFrame">PatternDateConverter</A>
<BR>
<A HREF="StyleDateConverter.html" title="class in org.apache.wicket.datetime" target="classFrame">StyleDateConverter</A></FONT></TD>
</TR>
</TABLE>
</BODY>
</HTML>
| {
"content_hash": "12fc19835de654a58ba56551a2f9cf59",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 132,
"avg_line_length": 34.567567567567565,
"alnum_prop": 0.7044566067240031,
"repo_name": "afiantara/apache-wicket-1.5.7",
"id": "4a3788990c277bf5bdd7985c0da4e6e0ecd5db06",
"size": "1279",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "apidocs/org/apache/wicket/datetime/package-frame.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Groovy",
"bytes": "17122"
},
{
"name": "Java",
"bytes": "10812577"
},
{
"name": "JavaScript",
"bytes": "232484"
}
],
"symlink_target": ""
} |
return require 'lib/couv'
| {
"content_hash": "5d53ebea40ade4811c0be95fba056b79",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 25,
"avg_line_length": 26,
"alnum_prop": 0.7692307692307693,
"repo_name": "hnakamur/couv",
"id": "20d62c46e80301249d38962103247e216311cd1f",
"size": "26",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "init.lua",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "115751"
},
{
"name": "JavaScript",
"bytes": "5739"
},
{
"name": "Lua",
"bytes": "75570"
},
{
"name": "Objective-C",
"bytes": "5200"
}
],
"symlink_target": ""
} |
#ifndef __MATMUL_H__
#define __MATMUL_H__
#include <stdint.h>
#include <pal.h>
#define _Score 16 // side size of per-core sub-submatrix (max 32)
#define _Smtx 512 // side size of operand matrix
#define _Nbanks 4 // Num of SRAM banks on core
#define _BankP 0
#define _BankA 1
#define _BankB 2
#define _BankC 3
#define _PING 0
#define _PONG 1
typedef struct {
p_coords_t coords;
int rank; // My rank in team
int west_rank; // Core west of me
int north_rank; // Core north of me
unsigned schip; // side size of per-chip submatrix
unsigned nside; // # of cores in chip side
void *bank_A[2]; // A Ping Pong Bank local space pointers
void *bank_B[2]; // B Ping Pong Bank local space pointers
void *bank_C; // C Ping Pong Bank local space pointers
void *tgt_A[2]; // A target Bank for matrix rotate in global space
void *tgt_B[2]; // B target Bank for matrix rotate in global space
uint32_t pingpong; // Ping-Pong bank select indicator
} __attribute__((packed)) core_t;
typedef struct {
uint32_t ready; // Core is ready after reset
uint32_t go; // Call for matmul function from host
uint32_t done; // Core has finished calculation
uint32_t clocks; // Cycle count
} __attribute__((packed)) mbox_t;
typedef struct {
float A[_Smtx * _Smtx]; // Global A matrix
float B[_Smtx * _Smtx]; // Global B matrix
float C[_Smtx * _Smtx]; // Global C matrix
mbox_t core;
} __attribute__((packed)) shared_buf_t;
typedef struct {
void *pBase; // ptr to base of shared buffers
float *pA; // ptr to global A matrix
float *pB; // ptr to global B matrix
float *pC; // ptr to global C matrix
mbox_t *pCore; // ptr to cores mailbox
uint32_t __pad;
} shared_buf_ptr_t;
#endif // __MATMUL_H__
| {
"content_hash": "7166b10e26007e921a452647fcb2d6de",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 82,
"avg_line_length": 27.686567164179106,
"alnum_prop": 0.6226415094339622,
"repo_name": "parallella/pal",
"id": "08b84d78b23cccefe78596a223b3ac3ce331b4f5",
"size": "2615",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "examples/math/matmul/matmul.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "2375"
},
{
"name": "C",
"bytes": "1200116"
},
{
"name": "C++",
"bytes": "6753"
},
{
"name": "CSS",
"bytes": "895"
},
{
"name": "Erlang",
"bytes": "75621"
},
{
"name": "HTML",
"bytes": "68079"
},
{
"name": "M4",
"bytes": "35028"
},
{
"name": "Makefile",
"bytes": "7369"
},
{
"name": "Python",
"bytes": "1602"
},
{
"name": "Shell",
"bytes": "5445"
}
],
"symlink_target": ""
} |
namespace Esri
{
namespace ArcGISRuntime
{
class Map;
class MapQuickView;
}
}
#include <QObject>
class ControlTimeExtentTimeSlider : public QObject
{
Q_OBJECT
Q_PROPERTY(Esri::ArcGISRuntime::MapQuickView* mapView READ mapView WRITE setMapView NOTIFY mapViewChanged)
public:
explicit ControlTimeExtentTimeSlider(QObject* parent = nullptr);
~ControlTimeExtentTimeSlider();
static void init();
signals:
void mapViewChanged();
private:
Esri::ArcGISRuntime::MapQuickView* mapView() const;
void setMapView(Esri::ArcGISRuntime::MapQuickView* mapView);
Esri::ArcGISRuntime::Map* m_map = nullptr;
Esri::ArcGISRuntime::MapQuickView* m_mapView = nullptr;
};
#endif // CONTROLTIMEEXTENTTIMESLIDER_H
| {
"content_hash": "3cd080b377a8849a61af57d173f3c59b",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 108,
"avg_line_length": 20.457142857142856,
"alnum_prop": 0.7681564245810056,
"repo_name": "Esri/arcgis-runtime-samples-qt",
"id": "9692e3ae898df88521cedfcd9be1002eaa059f3b",
"size": "1454",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "ArcGISRuntimeSDKQt_CppSamples/Features/ControlTimeExtentTimeSlider/ControlTimeExtentTimeSlider.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "1257"
},
{
"name": "C++",
"bytes": "3016542"
},
{
"name": "Dockerfile",
"bytes": "1654"
},
{
"name": "Python",
"bytes": "21695"
},
{
"name": "QML",
"bytes": "2260363"
},
{
"name": "QMake",
"bytes": "1444609"
},
{
"name": "Ruby",
"bytes": "1047"
}
],
"symlink_target": ""
} |
package com.ait.lienzo.client.core.shape;
import com.ait.lienzo.client.core.Attribute;
import com.ait.lienzo.client.core.Context2D;
import com.ait.lienzo.client.core.shape.json.IFactory;
import com.ait.lienzo.client.core.shape.json.validators.ValidationContext;
import com.ait.lienzo.client.core.shape.json.validators.ValidationException;
import com.ait.lienzo.client.core.types.BoundingBox;
import com.ait.lienzo.shared.core.types.ShapeType;
import com.google.gwt.json.client.JSONObject;
/**
* A Chord is defined by a radius, a start angle and an end angle. Effectively,
* a chord is a circle with a flat side, which is defined by the start and end angles.
* The angles can be specified in clockwise or counter-clockwise order.
*/
public class Chord extends Shape<Chord>
{
/**
* Constructor. Creates an instance of a chord.
*
* @param radius
* @param startAngle in radians
* @param endAngle in radians
* @param counterClockwise
*/
public Chord(final double radius, final double startAngle, final double endAngle, final boolean counterClockwise)
{
super(ShapeType.CHORD);
setRadius(radius).setStartAngle(startAngle).setEndAngle(endAngle).setCounterClockwise(counterClockwise);
}
/**
* Constructor. Creates an instance of a chord, drawn clockwise.
*
* @param radius
* @param startAngle in radians
* @param endAngle in radians
*/
public Chord(final double radius, final double startAngle, final double endAngle)
{
this(radius, startAngle, endAngle, false);
}
protected Chord(final JSONObject node, final ValidationContext ctx) throws ValidationException
{
super(ShapeType.CHORD, node, ctx);
}
@Override
public BoundingBox getBoundingBox()
{
final double radius = getRadius();
return new BoundingBox(0 - radius, 0 - radius, radius, radius);
}
/**
* Draws this chord.
*
* @param context
*/
@Override
protected boolean prepare(final Context2D context, final Attributes attr, final double alpha)
{
final double r = attr.getRadius();
final double beg = attr.getStartAngle();
final double end = attr.getEndAngle();
if (r > 0)
{
context.beginPath();
if (beg == end)
{
context.arc(0, 0, r, 0, Math.PI * 2, true);
}
else
{
context.arc(0, 0, r, beg, end, attr.isCounterClockwise());
}
context.closePath();
return true;
}
return false;
}
/**
* Gets this chord's radius
*
* @return double
*/
public double getRadius()
{
return getAttributes().getRadius();
}
/**
* Sets this chord's radius.
*
* @param radius
* @return this chord.
*/
public Chord setRadius(final double radius)
{
getAttributes().setRadius(radius);
return this;
}
/**
* Gets the starting angle of this chord.
*
* @return double in radians
*/
public double getStartAngle()
{
return getAttributes().getStartAngle();
}
/**
* Sets the starting angle of this chord.
*
* @param angle in radians
* @return this chord.
*/
public Chord setStartAngle(final double angle)
{
getAttributes().setStartAngle(angle);
return this;
}
/**
* Gets the end angle of this chord.
*
* @return double in radians
*/
public double getEndAngle()
{
return getAttributes().getEndAngle();
}
/**
* Gets the end angle of this chord.
*
* @param angle in radians
* @return this chord.
*/
public Chord setEndAngle(final double angle)
{
getAttributes().setEndAngle(angle);
return this;
}
/**
* Returns whether the chord is drawn counter clockwise.
* The default value is true.
*
* @return boolean
*/
public boolean isCounterClockwise()
{
return getAttributes().isCounterClockwise();
}
/**
* Sets whether the drawing direction of this chord is counter clockwise.
* The default value is true.
*
* @param counterclockwise
* @return this chord
*/
public Chord setCounterClockwise(final boolean counterclockwise)
{
getAttributes().setCounterClockwise(counterclockwise);
return this;
}
@Override
public IFactory<Chord> getFactory()
{
return new ChordFactory();
}
public static class ChordFactory extends ShapeFactory<Chord>
{
public ChordFactory()
{
super(ShapeType.CHORD);
addAttribute(Attribute.RADIUS, true);
addAttribute(Attribute.START_ANGLE, true);
addAttribute(Attribute.END_ANGLE, true);
addAttribute(Attribute.COUNTER_CLOCKWISE);
}
@Override
public Chord create(final JSONObject node, final ValidationContext ctx) throws ValidationException
{
return new Chord(node, ctx);
}
}
}
| {
"content_hash": "118f6bd5a4ec0dcfc17f5f7bf8bda54c",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 117,
"avg_line_length": 24.330232558139535,
"alnum_prop": 0.6067673484993309,
"repo_name": "psiroky/dashbuilder",
"id": "320ed8d4cb96b6e7e26b6fdae9ffdb1a3391824a",
"size": "5869",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dashbuilder-client/dashbuilder-lienzo/dashbuilder-lienzo-core/src/main/java/com/ait/lienzo/client/core/shape/Chord.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "117"
},
{
"name": "HTML",
"bytes": "21397"
},
{
"name": "Java",
"bytes": "4535774"
}
],
"symlink_target": ""
} |
<?php
/**
* RockSolid Custom Elements DCA
*
* @author Martin Auswöger <martin@madeyourday.net>
*/
use Contao\Config;
if (!empty($GLOBALS['TL_DCA']['tl_templates']['config']['validFileTypes'])) {
$GLOBALS['TL_DCA']['tl_templates']['config']['validFileTypes'] .= ',php';
}
if (!empty($GLOBALS['TL_DCA']['tl_templates']['config']['editableFileTypes'])) {
$GLOBALS['TL_DCA']['tl_templates']['config']['editableFileTypes'] .= ',php';
}
| {
"content_hash": "1234e9d8c63354579ebf962c76c2aa61",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 80,
"avg_line_length": 25.941176470588236,
"alnum_prop": 0.6394557823129252,
"repo_name": "madeyourday/contao-rocksolid-custom-elements",
"id": "d4c11dcb7e9e95016676efaa7e5547c54e26e1c8",
"size": "631",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Resources/contao/dca/tl_templates.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1741"
},
{
"name": "JavaScript",
"bytes": "21887"
},
{
"name": "PHP",
"bytes": "103627"
}
],
"symlink_target": ""
} |
<composition id="hashtagfinder" app_id="app_hashtagfinder">
<general>
<clock type="wall" />
</general>
<install>
<threadpool id="src_thread" num_threads="1"/>
<threadpool id="finder_thread" num_threads="1"/>
<block id="src" type="TweetReader" invocation="async" threadpool="src_thread">
<params>
<source type="offline" name="tweets.txt" tweettocash="20" tweettosend="100"/>
<gates number="1"/>
</params>
</block>
<block id="finder" type="TweetFinder" invocation="async" threadpool="finder_thread">
<params>
<gates number="1"/>
</params>
</block>
<block id="export1" type="SerExporter" export="yes">
<params>
<export host="127.0.0.1" port="12345"/>
</params>
</block>
<connection src_block="src" src_gate="out_tweet0" dst_block="finder" dst_gate="in_word"/>
<connection src_block="finder" src_gate="out_hash0" dst_block="export1" dst_gate="in_msg"/>
</install>
</composition>
| {
"content_hash": "f0ad16ec2351b49442bba53ff1849ef0",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 96,
"avg_line_length": 33.25806451612903,
"alnum_prop": 0.5965082444228904,
"repo_name": "cnplab/blockmon",
"id": "ef178ff04e03b9fb00dbe8dd2b5dcabee6149d42",
"size": "1031",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "usr/app_twittertrending/source.xml",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "136416"
},
{
"name": "C++",
"bytes": "1147895"
},
{
"name": "CMake",
"bytes": "6197"
},
{
"name": "Makefile",
"bytes": "71"
},
{
"name": "Python",
"bytes": "156101"
},
{
"name": "VHDL",
"bytes": "1593300"
}
],
"symlink_target": ""
} |
echo "Starting video conversion"
for video in static/*.webm; do
mp4_video="$(echo "$video" | sed 's/\.webm$/.mp4/')"
daemonize -c $PWD /usr/bin/ffmpeg -nostats -nostdin -i "$video" "$mp4_video" #</dev/null &>/dev/null
done
| {
"content_hash": "1142fdab49f595ab5d15888a35698e84",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 104,
"avg_line_length": 38.666666666666664,
"alnum_prop": 0.6379310344827587,
"repo_name": "google/it-cert-automation",
"id": "d7896f9ce9411cb18d3d5f87c0a27606e9942a85",
"size": "986",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Course4/04-deploy_videos/deploy.sh",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "2068"
},
{
"name": "Makefile",
"bytes": "47"
},
{
"name": "Python",
"bytes": "138080"
},
{
"name": "Shell",
"bytes": "15795"
},
{
"name": "Smarty",
"bytes": "804"
}
],
"symlink_target": ""
} |
typedef void(^ZLDropDownMenuAnimateCompleteHandler)(void);
@implementation ZLIndexPath
- (instancetype)initWithColumn:(NSInteger)column row:(NSInteger)row {
self = [super init];
if (self) {
_column = column;
_row = row;
}
return self;
}
+ (instancetype)indexPathWithColumn:(NSInteger)col row:(NSInteger)row {
ZLIndexPath *indexPath = [[self alloc] initWithColumn:col row:row];
return indexPath;
}
@end
@interface ZLDropDownMenu () <UICollectionViewDelegate, UICollectionViewDataSource>
@property (nonatomic, assign) NSInteger currentSelectedMenuIndex;
@property (nonatomic, assign) NSInteger numOfMenu;
@property (nonatomic, strong) UIView *backgroundView;
@property (nonatomic, assign, getter=isShow) BOOL show;
@property (nonatomic, strong) UICollectionView *collectionView;
// dataSource
@property (nonatomic, copy) NSArray *array;
@property (nonatomic, strong) NSMutableArray *titleButtons;
@property (nonatomic, weak) ZLDropDownMenuTitleButton *selectedButton;
@property (nonatomic, weak) ZLDropDownMenuCollectionViewCell *defaultSelectedCell;
@end
static NSString * const collectionCellID = @"ZLDropDownMenuCollectionViewCell";
@implementation ZLDropDownMenu
#pragma mark - initialize
- (instancetype)initWithFrame:(CGRect)frame
{
if (self = [super initWithFrame:frame]) {
_currentSelectedMenuIndex = -1;
_show = NO;
UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
flowLayout.sectionInset = dropDownMenuCollectionViewUIValue()->SECTIONINSETS;
flowLayout.itemSize = dropDownMenuCollectionViewUIValue()->ITEMSIZE;
flowLayout.minimumLineSpacing = dropDownMenuCollectionViewUIValue()->LINESPACING;
flowLayout.minimumInteritemSpacing = dropDownMenuCollectionViewUIValue()->INTERITEMSPACING;
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:flowLayout];
_collectionView.collectionViewLayout = flowLayout;
_collectionView.backgroundColor = [UIColor whiteColor];
[_collectionView registerClass:[ZLDropDownMenuCollectionViewCell class] forCellWithReuseIdentifier:collectionCellID];
_collectionView.delegate = self;
_collectionView.dataSource = self;
_collectionView.autoresizesSubviews = NO;
self.autoresizesSubviews = NO;
_backgroundView = [[UIView alloc] init];
_backgroundView.backgroundColor = [UIColor colorWithWhite:0.f alpha:0.f];
_backgroundView.opaque = NO;
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(backgroundViewDidTap:)];
[_backgroundView addGestureRecognizer:tapGesture];
}
return self;
}
#pragma mark - setter
- (void)setFrame:(CGRect)frame
{
frame = CGRectMake(frame.origin.x, frame.origin.y, deviceWidth(), frame.size.height);
[super setFrame:frame];
}
- (void)setDataSource:(id<ZLDropDownMenuDataSource>)dataSource
{
_dataSource = dataSource;
NSAssert([_dataSource respondsToSelector:@selector(numberOfColumnsInMenu:)], @"does not respond 'numberOfColumnsInMenu:' method");
_numOfMenu = [_dataSource numberOfColumnsInMenu:self];
__weak typeof(self) weakSelf = self;
CGFloat width = deviceWidth() / _numOfMenu;
_titleButtons = [NSMutableArray arrayWithCapacity:_numOfMenu];
ZLDropDownMenuTitleButton *lastTitleButton = nil;
for (NSInteger index = 0; index < _numOfMenu; index++) {
NSString *titleString = [_dataSource menu:self titleForRowAtIndexPath:[ZLIndexPath indexPathWithColumn:index row:0]];
ZLDropDownMenuTitleButton *titleButton = [[ZLDropDownMenuTitleButton alloc] initWithMainTitle:[_dataSource menu:self titleForColumn:index] subTitle:titleString];
[self addSubview:titleButton];
[_titleButtons addObject:titleButton];
[titleButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.bottom.equalTo(weakSelf);
make.width.mas_equalTo(width);
make.left.equalTo(lastTitleButton ? lastTitleButton.mas_right : weakSelf);
}];
lastTitleButton = titleButton;
if (index != _numOfMenu - 1) {
UIView *rightSeperator = [[UIView alloc] init];
rightSeperator.backgroundColor = kDropdownMenuSeperatorColor;
[titleButton addSubview:rightSeperator];
[rightSeperator mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.right.bottom.equalTo(titleButton);
make.width.mas_equalTo(dropDownMenuTitleButtonUIValue()->RIGHTSEPERATOR_WIDTH);
}];
}
titleButton.index = index;
[titleButton addTarget:self action:@selector(titleButtonDidClick:) forControlEvents:UIControlEventTouchUpInside];
}
}
#pragma mark - animation method
- (void)animationWithTitleButton:(ZLDropDownMenuTitleButton *)button BackgroundView:(UIView *)backgroundView
collectionView:(UICollectionView *)collectionView
show:(BOOL)isShow
complete:(ZLDropDownMenuAnimateCompleteHandler)complete
{
if (self.selectedButton == button) {
button.selected = isShow;
} else {
button.selected = YES;
self.selectedButton.selected = NO;
self.selectedButton = button;
}
[self animationWithBackgroundView:backgroundView show:isShow complete:^{
[self animationWithCollectionView:collectionView show:isShow complete:nil];
}];
if (complete) {
complete();
}
}
- (void)animationWithBackgroundView:(UIView *)backgroundView
collectionView:(UICollectionView *)collectionView
show:(BOOL)isShow
complete:(ZLDropDownMenuAnimateCompleteHandler)complete
{
[self animationWithBackgroundView:backgroundView show:isShow complete:^{
[self animationWithCollectionView:collectionView show:isShow complete:nil];
}];
if (complete) {
complete();
}
}
- (void)animationWithBackgroundView:(UIView *)backgroundView
show:(BOOL)isShow
complete:(ZLDropDownMenuAnimateCompleteHandler)complete
{
__weak typeof(self) weakSelf = self;
if (isShow) {
if (1 == clickCount) {
[self.superview addSubview:backgroundView];
[_backgroundView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(weakSelf.mas_bottom);
make.left.right.bottom.equalTo(weakSelf.superview);
}];
[backgroundView layoutIfNeeded];
}
[UIView animateWithDuration:dropDownMenuUIValue()->ANIMATION_DURATION animations:^{
backgroundView.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.3];
} completion:^(BOOL finished) {
}];
} else {
[UIView animateWithDuration:dropDownMenuUIValue()->ANIMATION_DURATION animations:^{
backgroundView.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.0];
} completion:^(BOOL finished) {
[backgroundView removeFromSuperview];
clickCount = 0;
}];
}
if (complete) {
complete();
}
}
- (void)animationWithCollectionView:(UICollectionView *)collectionView
show:(BOOL)isShow
complete:(ZLDropDownMenuAnimateCompleteHandler)complete
{
__weak typeof(self) weakSelf = self;
if (isShow) {
CGFloat collectionViewHeight = 0.f;
if (collectionView) {
CGFloat height = 0.f;
NSInteger rowCount = (NSInteger)ceilf((CGFloat)[collectionView numberOfItemsInSection:0] / dropDownMenuCollectionViewUIValue()->VIEW_COLUMNCOUNT);
collectionViewHeight = dropDownMenuCollectionViewUIValue()->VIEW_TOP_BOTTOM_MARGIN * 2 + dropDownMenuCollectionViewUIValue()->CELL_HEIGHT * rowCount + dropDownMenuCollectionViewUIValue()->LINESPACING * (rowCount - 1);
CGFloat maxHeight = deviceHeight() - CGRectGetMaxY(self.frame);
collectionViewHeight = collectionViewHeight > maxHeight ? maxHeight : collectionViewHeight;
if (1 == clickCount) {
[self.superview addSubview:collectionView];
[self.collectionView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(weakSelf.mas_bottom);
make.left.right.equalTo(weakSelf.superview);
make.height.mas_equalTo(height);
}];
[self.collectionView layoutIfNeeded];
[UIView animateWithDuration:dropDownMenuUIValue()->ANIMATION_DURATION animations:^{
[collectionView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(collectionViewHeight);
}];
[collectionView.superview layoutIfNeeded];
}];
} else {[UIView animateWithDuration:dropDownMenuUIValue()->ANIMATION_DURATION animations:^{
[collectionView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(collectionViewHeight);
}];
[collectionView.superview layoutIfNeeded];
}];
}
}
} else {
if (collectionView) {
[UIView animateWithDuration:dropDownMenuUIValue()->ANIMATION_DURATION animations:^{
[collectionView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(0);
}];
[collectionView.superview layoutIfNeeded];
} completion:^(BOOL finished) {
[collectionView removeFromSuperview];
clickCount = 0;
}];
}
}
if (complete) {
complete();
}
}
#pragma mark - action method
static NSInteger clickCount;
- (void)titleButtonDidClick:(ZLDropDownMenuTitleButton *)titleButton
{
clickCount++;
if (titleButton.index == self.currentSelectedMenuIndex && self.isShow) {
[self animationWithTitleButton:titleButton BackgroundView:self.backgroundView collectionView:self.collectionView show:NO complete:^{
self.currentSelectedMenuIndex = titleButton.index;
self.show = NO;
}];
} else {
self.currentSelectedMenuIndex = titleButton.index;
[self.collectionView reloadData];
[self animationWithTitleButton:titleButton BackgroundView:self.backgroundView collectionView:self.collectionView show:YES complete:^{
self.show = YES;
}];
}
}
- (void)backgroundViewDidTap:(UITapGestureRecognizer *)tapGesture
{
ZLDropDownMenuTitleButton *titleButton = self.titleButtons[self.currentSelectedMenuIndex];
[self animationWithTitleButton:titleButton BackgroundView:self.backgroundView collectionView:self.collectionView show:NO complete:^{
self.show = NO;
}];
}
#pragma mark - collectionViewDataSource
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView
{
return 1;
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
NSAssert([self.dataSource respondsToSelector:@selector(menu:numberOfRowsInColumns:)], @"does not respond the 'menu:numberOfRowsInColumns:' method");
return [self.dataSource menu:self numberOfRowsInColumns:self.currentSelectedMenuIndex];
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
ZLDropDownMenuCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:collectionCellID forIndexPath:indexPath];
NSAssert([self.dataSource respondsToSelector:@selector(menu:titleForRowAtIndexPath:)], @"does not respond the 'menu:titleForRowAtIndexPath:' method");
cell.contentString = [self.dataSource menu:self titleForRowAtIndexPath:[ZLIndexPath indexPathWithColumn:self.currentSelectedMenuIndex row:indexPath.row]];
if ([cell.contentString isEqualToString:[self.titleButtons[self.currentSelectedMenuIndex] subTitle]]) {
cell.selected = YES;
self.defaultSelectedCell = cell;
}
return cell;
}
#pragma mark --UICollectionViewDelegate
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
NSAssert(self.delegate && [self.delegate respondsToSelector:@selector(menu:didSelectRowAtIndexPath:)], @"does not set delegate or respond the 'menu:titleForRowAtIndexPath:' method");
[self.delegate menu:self didSelectRowAtIndexPath:[ZLIndexPath indexPathWithColumn:self.currentSelectedMenuIndex row:indexPath.row]];
[self configMenuSubTitleWithSelectRow:indexPath.row];
}
- (void)configMenuSubTitleWithSelectRow:(NSInteger)row
{
ZLDropDownMenuTitleButton *button = _titleButtons[self.currentSelectedMenuIndex];
NSString *currentSelectedTitle = [self.dataSource menu:self titleForRowAtIndexPath:[ZLIndexPath indexPathWithColumn:self.currentSelectedMenuIndex row:row]];
button.subTitle = currentSelectedTitle;
if (![self.defaultSelectedCell.contentString isEqualToString:currentSelectedTitle]) {
self.defaultSelectedCell.selected = NO;
}
[self animationWithTitleButton:button BackgroundView:self.backgroundView collectionView:self.collectionView show:NO complete:^{
self.show = NO;
}];
}
@end
| {
"content_hash": "c7c7008c5148da2d692f0ffb88bfbc25",
"timestamp": "",
"source": "github",
"line_count": 313,
"max_line_length": 229,
"avg_line_length": 43.78913738019169,
"alnum_prop": 0.68787392382898,
"repo_name": "hanweiqi9/ALine0fPurchase",
"id": "405397d44ea4251175072cde853c6f0971801f73",
"size": "14013",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Shoping/Tools/ZLDropDownMenu/ZLDropDownMenu.m",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Objective-C",
"bytes": "990860"
},
{
"name": "Ruby",
"bytes": "136"
}
],
"symlink_target": ""
} |
package net.narusas.tools.deplor.domain.model;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;
import org.eclipse.persistence.annotations.BatchFetch;
import org.eclipse.persistence.annotations.BatchFetchType;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
@Entity
@Table(name = "branches")
@Getter
@Setter
@EqualsAndHashCode(exclude = { "repository", "revisions" })
@ToString(exclude = { "repository", "revisions" })
public class Branch {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
Long id;
@Column
String name;
@Column
Long lastRevision;
@JoinColumn(name = "repository")
Repository repository;
@OneToMany(fetch = FetchType.LAZY, mappedBy = "branch", cascade = { CascadeType.ALL })
@OrderBy("timestamp")
@BatchFetch(BatchFetchType.IN)
List<Revision> revisions;
@OneToMany(fetch = FetchType.LAZY, mappedBy = "branch", cascade = { CascadeType.ALL })
List<Stage> stage;
public void addRevision(Revision revision) {
if (revisions == null) {
revisions = new ArrayList<>();
}
revisions.add(revision);
revision.setBranch(this);
}
public Stage getStage(String name) {
for (Stage s : stage) {
if (name.equals(s.getName())) {
return s;
}
}
Stage addstage = new Stage();
addstage.setName(name);
addstage.setBranch(this);
stage.add(addstage);
return addstage;
}
}
| {
"content_hash": "b91fe57ba0081b65bb75348e40865e0e",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 87,
"avg_line_length": 24.135135135135137,
"alnum_prop": 0.7497200447928332,
"repo_name": "narusas/deplor-ui",
"id": "1d782f20c1cf36188795c98d7b5a2747f28bec80",
"size": "1786",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/net/narusas/tools/deplor/domain/model/Branch.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "197200"
},
{
"name": "Shell",
"bytes": "21586"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="SHORTCUT ICON" href="../../../../../img/clover.ico" />
<link rel="stylesheet" href="../../../../../aui/css/aui.min.css" media="all"/>
<link rel="stylesheet" href="../../../../../aui/css/aui-experimental.min.css" media="all"/>
<!--[if IE 9]><link rel="stylesheet" href="../../../../../aui/css/aui-ie9.min.css" media="all"/><![endif]-->
<style type="text/css" media="all">
@import url('../../../../../style.css');
@import url('../../../../../tree.css');
</style>
<script src="../../../../../jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui-experimental.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui-soy.min.js" type="text/javascript"></script>
<script src="../../../../../package-nodes-tree.js" type="text/javascript"></script>
<script src="../../../../../clover-tree.js" type="text/javascript"></script>
<script src="../../../../../clover.js" type="text/javascript"></script>
<script src="../../../../../clover-descriptions.js" type="text/javascript"></script>
<script src="../../../../../cloud.js" type="text/javascript"></script>
<title>ABA Route Transit Number Validator 1.0.1-SNAPSHOT</title>
</head>
<body>
<div id="page">
<header id="header" role="banner">
<nav class="aui-header aui-dropdown2-trigger-group" role="navigation">
<div class="aui-header-inner">
<div class="aui-header-primary">
<h1 id="logo" class="aui-header-logo aui-header-logo-clover">
<a href="http://openclover.org" title="Visit OpenClover home page"><span class="aui-header-logo-device">OpenClover</span></a>
</h1>
</div>
<div class="aui-header-secondary">
<ul class="aui-nav">
<li id="system-help-menu">
<a class="aui-nav-link" title="Open online documentation" target="_blank"
href="http://openclover.org/documentation">
<span class="aui-icon aui-icon-small aui-iconfont-help"> Help</span>
</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="aui-page-panel">
<div class="aui-page-panel-inner">
<div class="aui-page-panel-nav aui-page-panel-nav-clover">
<div class="aui-page-header-inner" style="margin-bottom: 20px;">
<div class="aui-page-header-image">
<a href="http://cardatechnologies.com" target="_top">
<div class="aui-avatar aui-avatar-large aui-avatar-project">
<div class="aui-avatar-inner">
<img src="../../../../../img/clover_logo_large.png" alt="Clover icon"/>
</div>
</div>
</a>
</div>
<div class="aui-page-header-main" >
<h1>
<a href="http://cardatechnologies.com" target="_top">
ABA Route Transit Number Validator 1.0.1-SNAPSHOT
</a>
</h1>
</div>
</div>
<nav class="aui-navgroup aui-navgroup-vertical">
<div class="aui-navgroup-inner">
<ul class="aui-nav">
<li class="">
<a href="../../../../../dashboard.html">Project overview</a>
</li>
</ul>
<div class="aui-nav-heading packages-nav-heading">
<strong>Packages</strong>
</div>
<div class="aui-nav project-packages">
<form method="get" action="#" class="aui package-filter-container">
<input type="text" autocomplete="off" class="package-filter text"
placeholder="Type to filter packages..." name="package-filter" id="package-filter"
title="Start typing package name (or part of the name) to search through the tree. Use arrow keys and the Enter key to navigate."/>
</form>
<p class="package-filter-no-results-message hidden">
<small>No results found.</small>
</p>
<div class="packages-tree-wrapper" data-root-relative="../../../../../" data-package-name="com.cardatechnologies.utils.validators.abaroutevalidator">
<div class="packages-tree-container"></div>
<div class="clover-packages-lozenges"></div>
</div>
</div>
</div>
</nav> </div>
<section class="aui-page-panel-content">
<div class="aui-page-panel-content-clover">
<div class="aui-page-header-main"><ol class="aui-nav aui-nav-breadcrumbs">
<li><a href="../../../../../dashboard.html"> Project Clover database Sat Aug 7 2021 12:29:33 MDT</a></li>
<li><a href="test-pkg-summary.html">Package com.cardatechnologies.utils.validators.abaroutevalidator</a></li>
<li><a href="test-Test_AbaRouteValidator_12.html">Class Test_AbaRouteValidator_12</a></li>
</ol></div>
<h1 class="aui-h2-clover">
Test testAbaNumberCheck_26047_good
</h1>
<table class="aui">
<thead>
<tr>
<th>Test</th>
<th><label title="The test result. Either a Pass, Fail or Error.">Status</label></th>
<th><label title="When the test execution was started">Start time</label></th>
<th><label title="The total time in seconds taken to run this test.">Time (seconds)</label></th>
<th><label title="A failure or error message if the test is not successful.">Message</label></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_12.html?line=25192#src-25192" >testAbaNumberCheck_26047_good</a>
</td>
<td>
<span class="sortValue">1</span><span class="aui-lozenge aui-lozenge-success">PASS</span>
</td>
<td>
7 Aug 12:41:20
</td>
<td>
0.0 </td>
<td>
<div></div>
<div class="errorMessage"></div>
</td>
</tr>
</tbody>
</table>
<div> </div>
<table class="aui aui-table-sortable">
<thead>
<tr>
<th style="white-space:nowrap;"><label title="A class that was directly hit by this test.">Target Class</label></th>
<th colspan="4"><label title="The percentage of coverage contributed by each single test.">Coverage contributed by</label> testAbaNumberCheck_26047_good</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</span>
  <a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/AbaRouteValidator.html?id=37378#AbaRouteValidator" title="AbaRouteValidator" name="sl-47">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</a>
</td>
<td>
<span class="sortValue">0.7352941</span>73.5%
</td>
<td class="align-middle" style="width: 100%" colspan="3">
<div>
<div title="73.5% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:73.5%"></div></div></div> </td>
</tr>
</tbody>
</table>
</div> <!-- class="aui-page-panel-content-clover" -->
<footer id="footer" role="contentinfo">
<section class="footer-body">
<ul>
<li>
Report generated by <a target="_new" href="http://openclover.org">OpenClover</a> v 4.4.1
on Sat Aug 7 2021 12:49:26 MDT using coverage data from Sat Aug 7 2021 12:47:23 MDT.
</li>
</ul>
<ul>
<li>OpenClover is free and open-source software. </li>
</ul>
</section>
</footer> </section> <!-- class="aui-page-panel-content" -->
</div> <!-- class="aui-page-panel-inner" -->
</div> <!-- class="aui-page-panel" -->
</div> <!-- id="page" -->
</body>
</html> | {
"content_hash": "392ab1c525994027ed5e2b432f29a80b",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 297,
"avg_line_length": 43.92822966507177,
"alnum_prop": 0.5097483934211959,
"repo_name": "dcarda/aba.route.validator",
"id": "1cade8199315fc39d90c3d77ed287d56abc50d3a",
"size": "9181",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "target13/site/clover/com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_12_testAbaNumberCheck_26047_good_sua.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "18715254"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#c4c0be" />
<corners
android:bottomLeftRadius="10dp"
android:bottomRightRadius="10dp"
android:topLeftRadius="10dp"
android:topRightRadius="10dp" />
</shape>
| {
"content_hash": "65e1ea5f93b96a0b7ad1a65c561b5dce",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 66,
"avg_line_length": 34.1,
"alnum_prop": 0.6891495601173021,
"repo_name": "hkh412/OneTwoThree_Deprecated",
"id": "c12fff6e26f17af92690ac7db5953acd0d106b25",
"size": "341",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "res/drawable/round_rect_grey.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "134510"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE mixture PUBLIC "-//ghmm.org//DOCUMENT ghmm V1.0//EN" "http://ghmm.sourceforge.net/xml/1.0/ghmm.dtd">
<mixture version="1.0" noComponents="1">
<HMM name="" type="discrete">
<alphabet id="0">
<symbol code="0">A</symbol>
<symbol code="1">C</symbol>
<symbol code="2">G</symbol>
<symbol code="3">T</symbol>
</alphabet>
<state id="0" initial="0.25000000">
<discrete id="0">1, 0, 0, 0</discrete>
</state>
<state id="1" initial="0.25000000">
<discrete id="0">0, 1, 0, 0</discrete>
</state>
<state id="2" initial="0.25000000">
<discrete id="0">0, 0, 1, 0</discrete>
</state>
<state id="3" initial="0.25000000">
<discrete id="0">0, 0, 0, 1</discrete>
</state>
<state id="4" initial="0.00010580">
<discrete id="0">1, 0, 0, 0</discrete>
</state>
<state id="5" initial="0.00010580">
<discrete id="0">0, 1, 0, 0</discrete>
</state>
<state id="6" initial="0.00010580">
<discrete id="0">0, 0, 1, 0</discrete>
</state>
<state id="7" initial="0.00010580">
<discrete id="0">0, 0, 0, 1</discrete>
</state>
<state id="8" initial="0.00000000">
<discrete id="0">1, 0, 0, 0</discrete>
</state>
<state id="9" initial="0.00000000">
<discrete id="0">0, 1, 0, 0</discrete>
</state>
<state id="10" initial="0.00000000">
<discrete id="0">0, 0, 1, 0</discrete>
</state>
<state id="11" initial="0.00000000">
<discrete id="0">0, 0, 0, 1</discrete>
</state>
<state id="12" initial="0.00000000">
<discrete id="0">1, 0, 0, 0</discrete>
</state>
<state id="13" initial="0.00000000">
<discrete id="0">0, 1, 0, 0</discrete>
</state>
<state id="14" initial="0.00000000">
<discrete id="0">0, 0, 1, 0</discrete>
</state>
<state id="15" initial="0.00000000">
<discrete id="0">0, 0, 0, 1</discrete>
</state>
<state id="16" initial="0.00000000">
<discrete id="0">1, 0, 0, 0</discrete>
</state>
<state id="17" initial="0.00000000">
<discrete id="0">0, 1, 0, 0</discrete>
</state>
<state id="18" initial="0.00000000">
<discrete id="0">0, 0, 1, 0</discrete>
</state>
<state id="19" initial="0.00000000">
<discrete id="0">0, 0, 0, 1</discrete>
</state>
<state id="20" initial="0.00000000">
<discrete id="0">1, 0, 0, 0</discrete>
</state>
<state id="21" initial="0.00000000">
<discrete id="0">0, 1, 0, 0</discrete>
</state>
<state id="22" initial="0.00000000">
<discrete id="0">0, 0, 1, 0</discrete>
</state>
<state id="23" initial="0.00000000">
<discrete id="0">0, 0, 0, 1</discrete>
</state>
<state id="24" initial="0.00000000">
<discrete id="0">1, 0, 0, 0</discrete>
</state>
<state id="25" initial="0.00000000">
<discrete id="0">0, 1, 0, 0</discrete>
</state>
<state id="26" initial="0.00000000">
<discrete id="0">0, 0, 1, 0</discrete>
</state>
<state id="27" initial="0.00000000">
<discrete id="0">0, 0, 0, 1</discrete>
</state>
<state id="28" initial="0.00000000">
<discrete id="0">1, 0, 0, 0</discrete>
</state>
<state id="29" initial="0.00000000">
<discrete id="0">0, 1, 0, 0</discrete>
</state>
<state id="30" initial="0.00000000">
<discrete id="0">0, 0, 1, 0</discrete>
</state>
<state id="31" initial="0.00000000">
<discrete id="0">0, 0, 0, 1</discrete>
</state>
<state id="32" initial="0.00000000">
<discrete id="0">1, 0, 0, 0</discrete>
</state>
<state id="33" initial="0.00000000">
<discrete id="0">0, 1, 0, 0</discrete>
</state>
<state id="34" initial="0.00000000">
<discrete id="0">0, 0, 1, 0</discrete>
</state>
<state id="35" initial="0.00000000">
<discrete id="0">0, 0, 0, 1</discrete>
</state>
<state id="36" initial="0.00000000">
<discrete id="0">1, 0, 0, 0</discrete>
</state>
<state id="37" initial="0.00000000">
<discrete id="0">0, 1, 0, 0</discrete>
</state>
<state id="38" initial="0.00000000">
<discrete id="0">0, 0, 1, 0</discrete>
</state>
<state id="39" initial="0.00000000">
<discrete id="0">0, 0, 0, 1</discrete>
</state>
<state id="40" initial="0.00000000">
<discrete id="0">1, 0, 0, 0</discrete>
</state>
<state id="41" initial="0.00000000">
<discrete id="0">0, 1, 0, 0</discrete>
</state>
<state id="42" initial="0.00000000">
<discrete id="0">0, 0, 1, 0</discrete>
</state>
<state id="43" initial="0.00000000">
<discrete id="0">0, 0, 0, 1</discrete>
</state>
<state id="44" initial="0.00000000">
<discrete id="0">1, 0, 0, 0</discrete>
</state>
<state id="45" initial="0.00000000">
<discrete id="0">0, 1, 0, 0</discrete>
</state>
<state id="46" initial="0.00000000">
<discrete id="0">0, 0, 1, 0</discrete>
</state>
<state id="47" initial="0.00000000">
<discrete id="0">0, 0, 0, 1</discrete>
</state>
<state id="48" initial="0.00000000">
<discrete id="0">1, 0, 0, 0</discrete>
</state>
<state id="49" initial="0.00000000">
<discrete id="0">0, 1, 0, 0</discrete>
</state>
<state id="50" initial="0.00000000">
<discrete id="0">0, 0, 1, 0</discrete>
</state>
<state id="51" initial="0.00000000">
<discrete id="0">0, 0, 0, 1</discrete>
</state>
<state id="52" initial="0.00000000">
<discrete id="0">1, 0, 0, 0</discrete>
</state>
<state id="53" initial="0.00000000">
<discrete id="0">0, 1, 0, 0</discrete>
</state>
<state id="54" initial="0.00000000">
<discrete id="0">0, 0, 1, 0</discrete>
</state>
<state id="55" initial="0.00000000">
<discrete id="0">0, 0, 0, 1</discrete>
</state>
<state id="56" initial="0.00000000">
<discrete id="0">1, 0, 0, 0</discrete>
</state>
<state id="57" initial="0.00000000">
<discrete id="0">0, 1, 0, 0</discrete>
</state>
<state id="58" initial="0.00000000">
<discrete id="0">0, 0, 1, 0</discrete>
</state>
<state id="59" initial="0.00000000">
<discrete id="0">0, 0, 0, 1</discrete>
</state>
<state id="60" initial="0.00000000">
<discrete id="0">1, 0, 0, 0</discrete>
</state>
<state id="61" initial="0.00000000">
<discrete id="0">0, 1, 0, 0</discrete>
</state>
<state id="62" initial="0.00000000">
<discrete id="0">0, 0, 1, 0</discrete>
</state>
<state id="63" initial="0.00000000">
<discrete id="0">0, 0, 0, 1</discrete>
</state>
<transition source="0" target="0">
<probability>0.2475</probability>
</transition>
<transition source="0" target="1">
<probability>0.2475</probability>
</transition>
<transition source="0" target="2">
<probability>0.2475</probability>
</transition>
<transition source="0" target="3">
<probability>0.2475</probability>
</transition>
<transition source="0" target="4">
<probability>0.0037172166</probability>
</transition>
<transition source="0" target="5">
<probability>0.0019722927</probability>
</transition>
<transition source="0" target="6">
<probability>0.0021277496</probability>
</transition>
<transition source="0" target="7">
<probability>0.0021827411</probability>
</transition>
<transition source="1" target="0">
<probability>0.2475</probability>
</transition>
<transition source="1" target="1">
<probability>0.2475</probability>
</transition>
<transition source="1" target="2">
<probability>0.2475</probability>
</transition>
<transition source="1" target="3">
<probability>0.2475</probability>
</transition>
<transition source="1" target="4">
<probability>0.0037172166</probability>
</transition>
<transition source="1" target="5">
<probability>0.0019722927</probability>
</transition>
<transition source="1" target="6">
<probability>0.0021277496</probability>
</transition>
<transition source="1" target="7">
<probability>0.0021827411</probability>
</transition>
<transition source="2" target="0">
<probability>0.2475</probability>
</transition>
<transition source="2" target="1">
<probability>0.2475</probability>
</transition>
<transition source="2" target="2">
<probability>0.2475</probability>
</transition>
<transition source="2" target="3">
<probability>0.2475</probability>
</transition>
<transition source="2" target="4">
<probability>0.0037172166</probability>
</transition>
<transition source="2" target="5">
<probability>0.0019722927</probability>
</transition>
<transition source="2" target="6">
<probability>0.0021277496</probability>
</transition>
<transition source="2" target="7">
<probability>0.0021827411</probability>
</transition>
<transition source="3" target="0">
<probability>0.2475</probability>
</transition>
<transition source="3" target="1">
<probability>0.2475</probability>
</transition>
<transition source="3" target="2">
<probability>0.2475</probability>
</transition>
<transition source="3" target="3">
<probability>0.2475</probability>
</transition>
<transition source="3" target="4">
<probability>0.0037172166</probability>
</transition>
<transition source="3" target="5">
<probability>0.0019722927</probability>
</transition>
<transition source="3" target="6">
<probability>0.0021277496</probability>
</transition>
<transition source="3" target="7">
<probability>0.0021827411</probability>
</transition>
<transition source="4" target="8">
<probability>0.34475465</probability>
</transition>
<transition source="4" target="9">
<probability>0.16201354</probability>
</transition>
<transition source="4" target="10">
<probability>0.40513959</probability>
</transition>
<transition source="4" target="11">
<probability>0.088092217</probability>
</transition>
<transition source="5" target="8">
<probability>0.34475465</probability>
</transition>
<transition source="5" target="9">
<probability>0.16201354</probability>
</transition>
<transition source="5" target="10">
<probability>0.40513959</probability>
</transition>
<transition source="5" target="11">
<probability>0.088092217</probability>
</transition>
<transition source="6" target="8">
<probability>0.34475465</probability>
</transition>
<transition source="6" target="9">
<probability>0.16201354</probability>
</transition>
<transition source="6" target="10">
<probability>0.40513959</probability>
</transition>
<transition source="6" target="11">
<probability>0.088092217</probability>
</transition>
<transition source="7" target="8">
<probability>0.34475465</probability>
</transition>
<transition source="7" target="9">
<probability>0.16201354</probability>
</transition>
<transition source="7" target="10">
<probability>0.40513959</probability>
</transition>
<transition source="7" target="11">
<probability>0.088092217</probability>
</transition>
<transition source="8" target="12">
<probability>0.49672166</probability>
</transition>
<transition source="8" target="13">
<probability>0.010892555</probability>
</transition>
<transition source="8" target="14">
<probability>0.40313029</probability>
</transition>
<transition source="8" target="15">
<probability>0.089255499</probability>
</transition>
<transition source="9" target="12">
<probability>0.49672166</probability>
</transition>
<transition source="9" target="13">
<probability>0.010892555</probability>
</transition>
<transition source="9" target="14">
<probability>0.40313029</probability>
</transition>
<transition source="9" target="15">
<probability>0.089255499</probability>
</transition>
<transition source="10" target="12">
<probability>0.49672166</probability>
</transition>
<transition source="10" target="13">
<probability>0.010892555</probability>
</transition>
<transition source="10" target="14">
<probability>0.40313029</probability>
</transition>
<transition source="10" target="15">
<probability>0.089255499</probability>
</transition>
<transition source="11" target="12">
<probability>0.49672166</probability>
</transition>
<transition source="11" target="13">
<probability>0.010892555</probability>
</transition>
<transition source="11" target="14">
<probability>0.40313029</probability>
</transition>
<transition source="11" target="15">
<probability>0.089255499</probability>
</transition>
<transition source="12" target="16">
<probability>0.11675127</probability>
</transition>
<transition source="12" target="17">
<probability>0.021362098</probability>
</transition>
<transition source="12" target="18">
<probability>0.7911379</probability>
</transition>
<transition source="12" target="19">
<probability>0.070748731</probability>
</transition>
<transition source="13" target="16">
<probability>0.11675127</probability>
</transition>
<transition source="13" target="17">
<probability>0.021362098</probability>
</transition>
<transition source="13" target="18">
<probability>0.7911379</probability>
</transition>
<transition source="13" target="19">
<probability>0.070748731</probability>
</transition>
<transition source="14" target="16">
<probability>0.11675127</probability>
</transition>
<transition source="14" target="17">
<probability>0.021362098</probability>
</transition>
<transition source="14" target="18">
<probability>0.7911379</probability>
</transition>
<transition source="14" target="19">
<probability>0.070748731</probability>
</transition>
<transition source="15" target="16">
<probability>0.11675127</probability>
</transition>
<transition source="15" target="17">
<probability>0.021362098</probability>
</transition>
<transition source="15" target="18">
<probability>0.7911379</probability>
</transition>
<transition source="15" target="19">
<probability>0.070748731</probability>
</transition>
<transition source="16" target="20">
<probability>0.20568951</probability>
</transition>
<transition source="16" target="21">
<probability>0.075507614</probability>
</transition>
<transition source="16" target="22">
<probability>0.34919628</probability>
</transition>
<transition source="16" target="23">
<probability>0.3696066</probability>
</transition>
<transition source="17" target="20">
<probability>0.20568951</probability>
</transition>
<transition source="17" target="21">
<probability>0.075507614</probability>
</transition>
<transition source="17" target="22">
<probability>0.34919628</probability>
</transition>
<transition source="17" target="23">
<probability>0.3696066</probability>
</transition>
<transition source="18" target="20">
<probability>0.20568951</probability>
</transition>
<transition source="18" target="21">
<probability>0.075507614</probability>
</transition>
<transition source="18" target="22">
<probability>0.34919628</probability>
</transition>
<transition source="18" target="23">
<probability>0.3696066</probability>
</transition>
<transition source="19" target="20">
<probability>0.20568951</probability>
</transition>
<transition source="19" target="21">
<probability>0.075507614</probability>
</transition>
<transition source="19" target="22">
<probability>0.34919628</probability>
</transition>
<transition source="19" target="23">
<probability>0.3696066</probability>
</transition>
<transition source="20" target="24">
<probability>0.15989848</probability>
</transition>
<transition source="20" target="25">
<probability>0.30361675</probability>
</transition>
<transition source="20" target="26">
<probability>0.24111675</probability>
</transition>
<transition source="20" target="27">
<probability>0.29536802</probability>
</transition>
<transition source="21" target="24">
<probability>0.15989848</probability>
</transition>
<transition source="21" target="25">
<probability>0.30361675</probability>
</transition>
<transition source="21" target="26">
<probability>0.24111675</probability>
</transition>
<transition source="21" target="27">
<probability>0.29536802</probability>
</transition>
<transition source="22" target="24">
<probability>0.15989848</probability>
</transition>
<transition source="22" target="25">
<probability>0.30361675</probability>
</transition>
<transition source="22" target="26">
<probability>0.24111675</probability>
</transition>
<transition source="22" target="27">
<probability>0.29536802</probability>
</transition>
<transition source="23" target="24">
<probability>0.15989848</probability>
</transition>
<transition source="23" target="25">
<probability>0.30361675</probability>
</transition>
<transition source="23" target="26">
<probability>0.24111675</probability>
</transition>
<transition source="23" target="27">
<probability>0.29536802</probability>
</transition>
<transition source="24" target="28">
<probability>0.00010575296</probability>
</transition>
<transition source="24" target="29">
<probability>0.93358714</probability>
</transition>
<transition source="24" target="30">
<probability>0.023477157</probability>
</transition>
<transition source="24" target="31">
<probability>0.042829949</probability>
</transition>
<transition source="25" target="28">
<probability>0.00010575296</probability>
</transition>
<transition source="25" target="29">
<probability>0.93358714</probability>
</transition>
<transition source="25" target="30">
<probability>0.023477157</probability>
</transition>
<transition source="25" target="31">
<probability>0.042829949</probability>
</transition>
<transition source="26" target="28">
<probability>0.00010575296</probability>
</transition>
<transition source="26" target="29">
<probability>0.93358714</probability>
</transition>
<transition source="26" target="30">
<probability>0.023477157</probability>
</transition>
<transition source="26" target="31">
<probability>0.042829949</probability>
</transition>
<transition source="27" target="28">
<probability>0.00010575296</probability>
</transition>
<transition source="27" target="29">
<probability>0.93358714</probability>
</transition>
<transition source="27" target="30">
<probability>0.023477157</probability>
</transition>
<transition source="27" target="31">
<probability>0.042829949</probability>
</transition>
<transition source="28" target="32">
<probability>0.98815567</probability>
</transition>
<transition source="28" target="33">
<probability>0.0059221658</probability>
</transition>
<transition source="28" target="34">
<probability>0.0058164129</probability>
</transition>
<transition source="28" target="35">
<probability>0.00010575296</probability>
</transition>
<transition source="29" target="32">
<probability>0.98815567</probability>
</transition>
<transition source="29" target="33">
<probability>0.0059221658</probability>
</transition>
<transition source="29" target="34">
<probability>0.0058164129</probability>
</transition>
<transition source="29" target="35">
<probability>0.00010575296</probability>
</transition>
<transition source="30" target="32">
<probability>0.98815567</probability>
</transition>
<transition source="30" target="33">
<probability>0.0059221658</probability>
</transition>
<transition source="30" target="34">
<probability>0.0058164129</probability>
</transition>
<transition source="30" target="35">
<probability>0.00010575296</probability>
</transition>
<transition source="31" target="32">
<probability>0.98815567</probability>
</transition>
<transition source="31" target="33">
<probability>0.0059221658</probability>
</transition>
<transition source="31" target="34">
<probability>0.0058164129</probability>
</transition>
<transition source="31" target="35">
<probability>0.00010575296</probability>
</transition>
<transition source="32" target="36">
<probability>0.83439086</probability>
</transition>
<transition source="32" target="37">
<probability>0.0087774958</probability>
</transition>
<transition source="32" target="38">
<probability>0.15672589</probability>
</transition>
<transition source="32" target="39">
<probability>0.00010575296</probability>
</transition>
<transition source="33" target="36">
<probability>0.83439086</probability>
</transition>
<transition source="33" target="37">
<probability>0.0087774958</probability>
</transition>
<transition source="33" target="38">
<probability>0.15672589</probability>
</transition>
<transition source="33" target="39">
<probability>0.00010575296</probability>
</transition>
<transition source="34" target="36">
<probability>0.83439086</probability>
</transition>
<transition source="34" target="37">
<probability>0.0087774958</probability>
</transition>
<transition source="34" target="38">
<probability>0.15672589</probability>
</transition>
<transition source="34" target="39">
<probability>0.00010575296</probability>
</transition>
<transition source="35" target="36">
<probability>0.83439086</probability>
</transition>
<transition source="35" target="37">
<probability>0.0087774958</probability>
</transition>
<transition source="35" target="38">
<probability>0.15672589</probability>
</transition>
<transition source="35" target="39">
<probability>0.00010575296</probability>
</transition>
<transition source="36" target="40">
<probability>0.89519882</probability>
</transition>
<transition source="36" target="41">
<probability>0.00010575296</probability>
</transition>
<transition source="36" target="42">
<probability>0.09930203</probability>
</transition>
<transition source="36" target="43">
<probability>0.005393401</probability>
</transition>
<transition source="37" target="40">
<probability>0.89519882</probability>
</transition>
<transition source="37" target="41">
<probability>0.00010575296</probability>
</transition>
<transition source="37" target="42">
<probability>0.09930203</probability>
</transition>
<transition source="37" target="43">
<probability>0.005393401</probability>
</transition>
<transition source="38" target="40">
<probability>0.89519882</probability>
</transition>
<transition source="38" target="41">
<probability>0.00010575296</probability>
</transition>
<transition source="38" target="42">
<probability>0.09930203</probability>
</transition>
<transition source="38" target="43">
<probability>0.005393401</probability>
</transition>
<transition source="39" target="40">
<probability>0.89519882</probability>
</transition>
<transition source="39" target="41">
<probability>0.00010575296</probability>
</transition>
<transition source="39" target="42">
<probability>0.09930203</probability>
</transition>
<transition source="39" target="43">
<probability>0.005393401</probability>
</transition>
<transition source="40" target="44">
<probability>0.010575296</probability>
</transition>
<transition source="40" target="45">
<probability>0.00074027073</probability>
</transition>
<transition source="40" target="46">
<probability>0.96224619</probability>
</transition>
<transition source="40" target="47">
<probability>0.02643824</probability>
</transition>
<transition source="41" target="44">
<probability>0.010575296</probability>
</transition>
<transition source="41" target="45">
<probability>0.00074027073</probability>
</transition>
<transition source="41" target="46">
<probability>0.96224619</probability>
</transition>
<transition source="41" target="47">
<probability>0.02643824</probability>
</transition>
<transition source="42" target="44">
<probability>0.010575296</probability>
</transition>
<transition source="42" target="45">
<probability>0.00074027073</probability>
</transition>
<transition source="42" target="46">
<probability>0.96224619</probability>
</transition>
<transition source="42" target="47">
<probability>0.02643824</probability>
</transition>
<transition source="43" target="44">
<probability>0.010575296</probability>
</transition>
<transition source="43" target="45">
<probability>0.00074027073</probability>
</transition>
<transition source="43" target="46">
<probability>0.96224619</probability>
</transition>
<transition source="43" target="47">
<probability>0.02643824</probability>
</transition>
<transition source="44" target="48">
<probability>0.034369712</probability>
</transition>
<transition source="44" target="49">
<probability>0.015228426</probability>
</transition>
<transition source="44" target="50">
<probability>0.38335448</probability>
</transition>
<transition source="44" target="51">
<probability>0.56704738</probability>
</transition>
<transition source="45" target="48">
<probability>0.034369712</probability>
</transition>
<transition source="45" target="49">
<probability>0.015228426</probability>
</transition>
<transition source="45" target="50">
<probability>0.38335448</probability>
</transition>
<transition source="45" target="51">
<probability>0.56704738</probability>
</transition>
<transition source="46" target="48">
<probability>0.034369712</probability>
</transition>
<transition source="46" target="49">
<probability>0.015228426</probability>
</transition>
<transition source="46" target="50">
<probability>0.38335448</probability>
</transition>
<transition source="46" target="51">
<probability>0.56704738</probability>
</transition>
<transition source="47" target="48">
<probability>0.034369712</probability>
</transition>
<transition source="47" target="49">
<probability>0.015228426</probability>
</transition>
<transition source="47" target="50">
<probability>0.38335448</probability>
</transition>
<transition source="47" target="51">
<probability>0.56704738</probability>
</transition>
<transition source="48" target="52">
<probability>0.023900169</probability>
</transition>
<transition source="48" target="53">
<probability>0.4588621</probability>
</transition>
<transition source="48" target="54">
<probability>0.11717428</probability>
</transition>
<transition source="48" target="55">
<probability>0.40006345</probability>
</transition>
<transition source="49" target="52">
<probability>0.023900169</probability>
</transition>
<transition source="49" target="53">
<probability>0.4588621</probability>
</transition>
<transition source="49" target="54">
<probability>0.11717428</probability>
</transition>
<transition source="49" target="55">
<probability>0.40006345</probability>
</transition>
<transition source="50" target="52">
<probability>0.023900169</probability>
</transition>
<transition source="50" target="53">
<probability>0.4588621</probability>
</transition>
<transition source="50" target="54">
<probability>0.11717428</probability>
</transition>
<transition source="50" target="55">
<probability>0.40006345</probability>
</transition>
<transition source="51" target="52">
<probability>0.023900169</probability>
</transition>
<transition source="51" target="53">
<probability>0.4588621</probability>
</transition>
<transition source="51" target="54">
<probability>0.11717428</probability>
</transition>
<transition source="51" target="55">
<probability>0.40006345</probability>
</transition>
<transition source="52" target="56">
<probability>0.016920474</probability>
</transition>
<transition source="52" target="57">
<probability>0.88599831</probability>
</transition>
<transition source="52" target="58">
<probability>0.0090947547</probability>
</transition>
<transition source="52" target="59">
<probability>0.087986464</probability>
</transition>
<transition source="53" target="56">
<probability>0.016920474</probability>
</transition>
<transition source="53" target="57">
<probability>0.88599831</probability>
</transition>
<transition source="53" target="58">
<probability>0.0090947547</probability>
</transition>
<transition source="53" target="59">
<probability>0.087986464</probability>
</transition>
<transition source="54" target="56">
<probability>0.016920474</probability>
</transition>
<transition source="54" target="57">
<probability>0.88599831</probability>
</transition>
<transition source="54" target="58">
<probability>0.0090947547</probability>
</transition>
<transition source="54" target="59">
<probability>0.087986464</probability>
</transition>
<transition source="55" target="56">
<probability>0.016920474</probability>
</transition>
<transition source="55" target="57">
<probability>0.88599831</probability>
</transition>
<transition source="55" target="58">
<probability>0.0090947547</probability>
</transition>
<transition source="55" target="59">
<probability>0.087986464</probability>
</transition>
<transition source="56" target="60">
<probability>0.71763959</probability>
</transition>
<transition source="56" target="61">
<probability>0.084073604</probability>
</transition>
<transition source="56" target="62">
<probability>0.058904399</probability>
</transition>
<transition source="56" target="63">
<probability>0.1393824</probability>
</transition>
<transition source="57" target="60">
<probability>0.71763959</probability>
</transition>
<transition source="57" target="61">
<probability>0.084073604</probability>
</transition>
<transition source="57" target="62">
<probability>0.058904399</probability>
</transition>
<transition source="57" target="63">
<probability>0.1393824</probability>
</transition>
<transition source="58" target="60">
<probability>0.71763959</probability>
</transition>
<transition source="58" target="61">
<probability>0.084073604</probability>
</transition>
<transition source="58" target="62">
<probability>0.058904399</probability>
</transition>
<transition source="58" target="63">
<probability>0.1393824</probability>
</transition>
<transition source="59" target="60">
<probability>0.71763959</probability>
</transition>
<transition source="59" target="61">
<probability>0.084073604</probability>
</transition>
<transition source="59" target="62">
<probability>0.058904399</probability>
</transition>
<transition source="59" target="63">
<probability>0.1393824</probability>
</transition>
<transition source="60" target="0">
<probability>0.25</probability>
</transition>
<transition source="60" target="1">
<probability>0.25</probability>
</transition>
<transition source="60" target="2">
<probability>0.25</probability>
</transition>
<transition source="60" target="3">
<probability>0.25</probability>
</transition>
<transition source="61" target="0">
<probability>0.25</probability>
</transition>
<transition source="61" target="1">
<probability>0.25</probability>
</transition>
<transition source="61" target="2">
<probability>0.25</probability>
</transition>
<transition source="61" target="3">
<probability>0.25</probability>
</transition>
<transition source="62" target="0">
<probability>0.25</probability>
</transition>
<transition source="62" target="1">
<probability>0.25</probability>
</transition>
<transition source="62" target="2">
<probability>0.25</probability>
</transition>
<transition source="62" target="3">
<probability>0.25</probability>
</transition>
<transition source="63" target="0">
<probability>0.25</probability>
</transition>
<transition source="63" target="1">
<probability>0.25</probability>
</transition>
<transition source="63" target="2">
<probability>0.25</probability>
</transition>
<transition source="63" target="3">
<probability>0.25</probability>
</transition>
</HMM>
</mixture>
| {
"content_hash": "f78c65ea9d0d99e52ae3c8107c383f82",
"timestamp": "",
"source": "github",
"line_count": 1020,
"max_line_length": 110,
"avg_line_length": 31.66470588235294,
"alnum_prop": 0.6738807356492662,
"repo_name": "asntech/jaspar",
"id": "672248d43aa3acb7e690aead3f9f0b6a9911516d",
"size": "32298",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "static/TFFM/TFFM0046.1/TFFM_detailed_initialized.xml",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C++",
"bytes": "19329"
},
{
"name": "CSS",
"bytes": "704123"
},
{
"name": "HTML",
"bytes": "2393209"
},
{
"name": "JavaScript",
"bytes": "2918082"
},
{
"name": "PHP",
"bytes": "1684"
},
{
"name": "Python",
"bytes": "139249"
},
{
"name": "Shell",
"bytes": "3392"
}
],
"symlink_target": ""
} |
import os
import sys
import logging
import math
import pandas as pd
import pytz
import bt
import matplotlib.pyplot as plt
from scipy.signal import find_peaks, medfilt, wiener, hilbert
import talib
try:
from . import module_loader
except:
import module_loader
sys.dont_write_bytecode = True
stock_data_provider = module_loader.load_module_from_file('stock_data_provider.cn_a.vip_dataset')
load_data = module_loader.load_module_func(stock_data_provider,
'load_stock_data')
data = load_data('600369')
data2 = load_data('600732')
print(data.data_frame.head())
def __create_pd_panel(all_data, name='close'):
trading_data = {}
for data in all_data:
trading_data[data.stock_id] = data.data_frame[name]
panel = pd.DataFrame(data=trading_data)
return panel
p = __create_pd_panel([data])
print(p.head())
def __generate_data_globals(all_data):
data_globals = {
'C' : __create_pd_panel(all_data, 'close').fillna(method='pad'),
'O' : __create_pd_panel(all_data, 'open').fillna(method='pad'),
'H' : __create_pd_panel(all_data, 'high').fillna(method='pad'),
'L' : __create_pd_panel(all_data, 'low').fillna(method='pad'),
'V' : __create_pd_panel(all_data, 'volume').fillna(method='pad'),
}
return data_globals
data_globals = __generate_data_globals([data, data2])
print(data_globals)
def make_func(func):
def wrapper(data, days):
return data.apply(lambda v: func(v, days))
return wrapper
def ref(data, ref_days):
return data.shift(-ref_days)
data_globals['MA'] = make_func(talib.MA)
data_globals['RSI'] = make_func(talib.RSI)
data_globals['Ref'] = ref
#script = '(C>MA(C,200)) & (C<MA(C,5)) & (H<Ref(H,-1)) & (L<Ref(L,-1)) & (Ref(H,-1)<Ref(H,-2)) & (Ref(L,-1)<Ref(L,-2)) & (Ref(H,-2)<Ref(H,-3)) & (Ref(L,-2)<Ref(L,-3))'
script = '(C>MA(C, 200)) & (RSI(C, 4) < 25)'
v = eval(script, data_globals)
print(v.head())
print(v[(v['600369'] == True) | (v['600732'] == True)].dropna())
| {
"content_hash": "8e29d497e86d9ed1bd63485218a000ac",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 167,
"avg_line_length": 26.789473684210527,
"alnum_prop": 0.6208251473477406,
"repo_name": "stonewell/learn-curve",
"id": "efb8d470e0e95133bed4a7b0f23c1fce37ea1ce3",
"size": "2036",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "test/test_script.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "799918"
}
],
"symlink_target": ""
} |
package org.libgit2.jagged;
import org.libgit2.jagged.core.Lazy;
import org.libgit2.jagged.core.NativeMethods;
public class GlobalSettings {
/* Prevent instantiation */
private GlobalSettings()
{
}
private static final Lazy<BuiltInFeatures> features = new Lazy<BuiltInFeatures>()
{
@Override
protected BuiltInFeatures call()
{
return new BuiltInFeatures(NativeMethods.globalGetFeatures());
}
};
/**
* Gets the set of features supported by this instance of libgit2.
*
* @return The features
*/
public static BuiltInFeatures getFeatures()
{
return features.getValue();
}
}
| {
"content_hash": "ace8970b76a75531643dab21857f7a80",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 85,
"avg_line_length": 22,
"alnum_prop": 0.6510263929618768,
"repo_name": "ethomson/jagged",
"id": "9503db6c82478769208c1b0843d37b6a8cf64603",
"size": "682",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "src/main/java/org/libgit2/jagged/GlobalSettings.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "3459"
},
{
"name": "C",
"bytes": "37514"
},
{
"name": "CMake",
"bytes": "7138"
},
{
"name": "Java",
"bytes": "100868"
},
{
"name": "Makefile",
"bytes": "3813"
},
{
"name": "Shell",
"bytes": "156"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>almost-full: Not compatible</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.5.0~camlp4 / almost-full - 8.12.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
almost-full
<small>
8.12.0
<span class="label label-info">Not compatible</span>
</small>
</h1>
<p><em><script>document.write(moment("2020-09-09 03:51:12 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-09-09 03:51:12 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-threads base
base-unix base
camlp4 4.05+1 Camlp4 is a system for writing extensible parsers for programming languages
conf-findutils 1 Virtual package relying on findutils
coq 8.5.0~camlp4 Formal proof management system.
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.05.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.05.0 Official 4.05.0 release
ocaml-config 1 OCaml Switch Configuration
ocamlbuild 0.14.0 OCamlbuild is a build system with builtin rules to easily build most OCaml projects.
# opam file:
opam-version: "2.0"
maintainer: "palmskog@gmail.com"
homepage: "https://github.com/coq-community/almost-full"
dev-repo: "git+https://github.com/coq-community/almost-full.git"
bug-reports: "https://github.com/coq-community/almost-full/issues"
license: "MIT"
synopsis: "Almost-full relations in Coq for proving termination"
description: """
Coq development of almost-full relations, including the Ramsey
Theorem, useful for proving termination."""
build: [make "-j%{jobs}%"]
install: [make "install"]
depends: [
"coq" {>= "8.10" & < "8.13~"}
]
tags: [
"category:Computer Science/Data Types and Data Structures"
"keyword:Ramsey theorem"
"keyword:termination"
"logpath:AlmostFull"
"date:2020-07-26"
]
authors: [
"Dimitrios Vytiniotis"
"Thierry Coquand"
"David Wahlstedt"
]
url {
src: "https://github.com/coq-community/almost-full/archive/v8.12.0.tar.gz"
checksum: "sha512=17785dafabd90361183d1f6f88a71864bdd019b878e2e83921c4619d348119b35de958d45331d1510548ef103844dc88678ee7cb706182cffb6dbe6c0174a441"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-almost-full.8.12.0 coq.8.5.0~camlp4</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.5.0~camlp4).
The following dependencies couldn't be met:
- coq-almost-full -> coq >= 8.10
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-almost-full.8.12.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
<small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small>
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "7ac01b4726d7607b755cf8c5a619506d",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 159,
"avg_line_length": 41.36046511627907,
"alnum_prop": 0.5565082935057633,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "082313c8092bb5309cb4692dd9a26eee5f7150fa",
"size": "7116",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.05.0-2.0.6/released/8.5.0~camlp4/almost-full/8.12.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
package org.drools.base.accumulators;
import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.io.Serializable;
import org.kie.runtime.rule.AccumulateFunction;
/**
* An implementation of an accumulator capable of calculating average values
*/
public class AverageAccumulateFunction implements AccumulateFunction {
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
}
public void writeExternal(ObjectOutput out) throws IOException {
}
public static class AverageData implements Externalizable {
public int count = 0;
public double total = 0;
public AverageData() {}
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
count = in.readInt();
total = in.readDouble();
}
public void writeExternal(ObjectOutput out) throws IOException {
out.writeInt(count);
out.writeDouble(total);
}
}
/* (non-Javadoc)
* @see org.kie.base.accumulators.AccumulateFunction#createContext()
*/
public Serializable createContext() {
return new AverageData();
}
/* (non-Javadoc)
* @see org.kie.base.accumulators.AccumulateFunction#init(java.lang.Object)
*/
public void init(Serializable context) throws Exception {
AverageData data = (AverageData) context;
data.count = 0;
data.total = 0;
}
/* (non-Javadoc)
* @see org.kie.base.accumulators.AccumulateFunction#accumulate(java.lang.Object, java.lang.Object)
*/
public void accumulate(Serializable context,
Object value) {
AverageData data = (AverageData) context;
data.count++;
data.total += ((Number) value).doubleValue();
}
/* (non-Javadoc)
* @see org.kie.base.accumulators.AccumulateFunction#reverse(java.lang.Object, java.lang.Object)
*/
public void reverse(Serializable context,
Object value) throws Exception {
AverageData data = (AverageData) context;
data.count--;
data.total -= ((Number) value).doubleValue();
}
/* (non-Javadoc)
* @see org.kie.base.accumulators.AccumulateFunction#getResult(java.lang.Object)
*/
public Object getResult(Serializable context) throws Exception {
AverageData data = (AverageData) context;
return new Double( data.count == 0 ? 0 : data.total / data.count );
}
/* (non-Javadoc)
* @see org.kie.base.accumulators.AccumulateFunction#supportsReverse()
*/
public boolean supportsReverse() {
return true;
}
/**
* {@inheritDoc}
*/
public Class< ? > getResultType() {
return Number.class;
}
}
| {
"content_hash": "0e632773e1397a50641c6dd505def74e",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 103,
"avg_line_length": 28.107843137254903,
"alnum_prop": 0.6410882455528427,
"repo_name": "yurloc/drools",
"id": "03fd5b4d4f02eb3a138a8e981d6e185ae240b6fd",
"size": "3460",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "drools-core/src/main/java/org/drools/base/accumulators/AverageAccumulateFunction.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "20184204"
},
{
"name": "Python",
"bytes": "4529"
},
{
"name": "Ruby",
"bytes": "491"
},
{
"name": "Shell",
"bytes": "1162"
}
],
"symlink_target": ""
} |
// Copyright 2012 Traceur Authors.
//
// Licensed under the Apache License, Version 2.0 (the 'License');
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an 'AS IS' BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import {ParseTreeTransformer} from './ParseTreeTransformer.js';
import {
AtNameExpression,
BindingIdentifier,
BreakStatement,
ContinueStatement,
DebuggerStatement,
EmptyStatement,
ExportSpecifier,
ExportStar,
IdentifierExpression,
ImportSpecifier,
LiteralExpression,
ModuleRequire,
PredefinedType,
PropertyNameShorthand,
TemplateLiteralPortion,
RestParameter,
SuperExpression,
ThisExpression
} from '../syntax/trees/ParseTrees.js';
/**
* Duplicates a ParseTree. Simply creates new leaf nodes so the
* ParseTreeTransformer branch methods all see changes values and
* thus create new branch nodes.
*/
export class CloneTreeTransformer extends ParseTreeTransformer {
/**
* @param {AtNameExpression} tree
* @return {ParseTree}
*/
transformAtNameExpression(tree) {
return new AtNameExpression(tree.location, tree.atNameToken);
}
/**
* @param {BindingIdentifier} tree
* @return {ParseTree}
*/
transformBindingIdentifier(tree) {
return new BindingIdentifier(tree.location, tree.identifierToken);
}
/**
* @param {BreakStatement} tree
* @return {ParseTree}
*/
transformBreakStatement(tree) {
return new BreakStatement(tree.location, tree.name);
}
/**
* @param {ContinueStatement} tree
* @return {ParseTree}
*/
transformContinueStatement(tree) {
return new ContinueStatement(tree.location, tree.name);
}
/**
* @param {DebuggerStatement} tree
* @return {ParseTree}
*/
transformDebuggerStatement(tree) {
return new DebuggerStatement(tree.location);
}
/**
* @param {EmptyStatement} tree
* @return {ParseTree}
*/
transformEmptyStatement(tree) {
return new EmptyStatement(tree.location);
}
/**
* @param {ExportSpecifier} tree
* @return {ParseTree}
*/
transformExportSpecifier(tree) {
return new ExportSpecifier(tree.location, tree.lhs, tree.rhs);
}
/**
* @param {ExportStar} tree
* @return {ParseTree}
*/
transformExportStar(tree) {
return new ExportStar(tree.location);
}
/**
* @param {IdentifierExpression} tree
* @return {ParseTree}
*/
transformIdentifierExpression(tree) {
return new IdentifierExpression(tree.location, tree.identifierToken);
}
/**
* @param {ImportSpecifier} tree
* @return {ParseTree}
*/
transformImportSpecifier(tree) {
return new ImportSpecifier(tree.location, tree.lhs, tree.rhs);
}
/**
* @param {Array.<ParseTree>} list
* @return {Array.<ParseTree>}
*/
transformList(list) {
if (!list) {
return null;
} else if (list.length == 0) {
return [];
} else {
return super.transformList(list);
}
}
/**
* @param {LiteralExpression} tree
* @return {ParseTree}
*/
transformLiteralExpression(tree) {
return new LiteralExpression(tree.location, tree.literalToken);
}
/**
* @param {ModuleRequire} tree
* @return {ParseTree}
*/
transformModuleRequire(tree) {
return new ModuleRequire(tree.location, tree.url);
}
/**
* @param {PredefinedType} tree
* @return {ParseTree}
*/
transformPredefinedType(tree) {
return new PredefinedType(tree.location, tree.token);
}
/**
* @param {PropertyNameShorthand} tree
* @return {ParseTree}
*/
transformPropertyNameShorthand(tree) {
return new PropertyNameShorthand(tree.location, tree.name);
}
/**
* @param {TemplateLiteralPortion} tree
* @return {ParseTree}
*/
transformTemplateLiteralPortion(tree) {
return new TemplateLiteralPortion(tree.location, tree.token);
}
/**
* @param {RestParameter} tree
* @return {ParseTree}
*/
transformRestParameter(tree) {
return new RestParameter(tree.location, tree.identifer);
}
/**
* @param {SuperExpression} tree
* @return {ParseTree}
*/
transformSuperExpression(tree) {
return new SuperExpression(tree.location);
}
/**
* @param {ThisExpression} tree
* @return {ParseTree}
*/
transformThisExpression(tree) {
return new ThisExpression(tree.location);
}
}
CloneTreeTransformer.cloneTree = function(tree) {
return new CloneTreeTransformer().transformAny(tree);
};
| {
"content_hash": "71c167c4c15f459d7b1c18f6bebd97cc",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 75,
"avg_line_length": 23.20873786407767,
"alnum_prop": 0.6841664923656139,
"repo_name": "rwaldron/traceur-todomvc",
"id": "42e1016b55f09612b48e767f39761ef7684770a2",
"size": "4781",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "src/codegeneration/CloneTreeTransformer.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "59534"
},
{
"name": "JavaScript",
"bytes": "2613764"
}
],
"symlink_target": ""
} |
Website development
| {
"content_hash": "4679d922767c584a53848c73eecb4508",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 19,
"avg_line_length": 20,
"alnum_prop": 0.9,
"repo_name": "joehbenti/kips",
"id": "e0b605c2fd60b007c5b002fe6f8b683e872807df",
"size": "27",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
import { Component, Optional } from '@angular/core';
import { MdDialog, MdDialogRef, MdSnackBar } from '@angular/material';
import { OverlayContainer } from '@angular/material';
@Component({
selector: 'app-demo',
templateUrl: './demo.component.html',
styleUrls: ['./demo.component.css']
})
export class DemoComponent {
isDarkTheme: boolean = false;
lastDialogResult: string;
foods: any[] = [
{ name: 'Pizza', rating: 'Excellent' },
{ name: 'Burritos', rating: 'Great' },
{ name: 'French fries', rating: 'Pretty good' },
];
progress: number = 0;
constructor(private _dialog: MdDialog, private _snackBar: MdSnackBar, private _overlayContainer: OverlayContainer) {
// Update the value for the progress-bar on an interval.
setInterval(() => {
this.progress = (this.progress + Math.floor(Math.random() * 4) + 1) % 100;
}, 200);
}
toggleTheme(){
this.isDarkTheme = !this.isDarkTheme;
if (this.isDarkTheme){
this._overlayContainer.themeClass = 'app-dark-theme';
} else {
this._overlayContainer.themeClass = 'default';
}
}
openDialog() {
let dialogRef = this._dialog.open(DemoDialogContent);
dialogRef.afterClosed().subscribe(result => {
this.lastDialogResult = result;
})
}
openSnackBar() {
this._snackBar.open('YUM SNACKS', 'CHEW', { duration: 3000 });
}
}
// second Component
@Component({
template: `
<p>This is a dialog</p>
<p>
<label>
This is a text box inside of a dialog.
<input #dialogInput>
</label>
</p>
<p> <button md-button (click)="dialogRef.close(dialogInput.value)">CLOSE</button> </p>
`,
})
export class DemoDialogContent {
constructor( @Optional() public dialogRef: MdDialogRef<DemoDialogContent>) { }
}
| {
"content_hash": "7b8405926d45088a6ef5102df68cacec",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 118,
"avg_line_length": 25.714285714285715,
"alnum_prop": 0.6361111111111111,
"repo_name": "kmui2/Giphy-Flashcards-with-Angular-Materials",
"id": "edfabb981ef6ec45bb9ca00082786d7aea7af67b",
"size": "1800",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/app/components/demo/demo.component.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "6553"
},
{
"name": "HTML",
"bytes": "10847"
},
{
"name": "JavaScript",
"bytes": "1996"
},
{
"name": "TypeScript",
"bytes": "19396"
}
],
"symlink_target": ""
} |
package com.zaren.hometeachinghelper.data;
import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import com.squareup.sqlbrite.SqlBrite;
import com.zaren.hometeachinghelper.model.HomeTeacher;
import java.io.IOException;
import java.sql.SQLDataException;
import java.util.ArrayList;
import java.util.List;
import rx.Observable;
import timber.log.Timber;
/**
* Created by John on 3/21/2015.
*/
public class HomeTeachingSqlBrite
{
public static final String ALL_HOMETEACHERS_QUERY = "SELECT * FROM "
+ HomeTeachingSqlDatabaseHelper.HOME_TEACHERS_TABLE
+ " ORDER BY "
+ HomeTeachingSqlDatabaseHelper.NAME + " ASC";
SqlBrite mSqlBrite;
public HomeTeachingSqlBrite( final SqlBrite aSqlBrite )
{
mSqlBrite = aSqlBrite;
}
public Observable< List< HomeTeacher > > getAllHomeTeachers()
{
return mSqlBrite.createQuery( HomeTeachingSqlDatabaseHelper.HOME_TEACHERS_TABLE, ALL_HOMETEACHERS_QUERY )
.map( t1 -> {
Cursor theCursor = t1.run();
try
{
List< HomeTeacher > theHomeTeachers = new ArrayList<>();
while( theCursor.moveToNext() )
{
try
{
HomeTeacher theHomeTeacher = HomeTeacher.fromCursor( theCursor );
theHomeTeachers.add( theHomeTeacher );
}
catch( SQLDataException e )
{
Timber.e( "Failed to get home teacher from cursor: " + theCursor );
}
}
return theHomeTeachers;
}
finally
{
theCursor.close();
}
} );
}
public void beginTransaction()
{
mSqlBrite.beginTransaction();
}
public void setTransactionSuccessful()
{
mSqlBrite.setTransactionSuccessful();
}
public void endTransaction()
{
mSqlBrite.endTransaction();
}
public void close() throws IOException
{
mSqlBrite.close();
}
public long addOrUpdateHomeTeacher( final String aQuorum,
final String aName,
final String aPhone,
final String aEmail )
{
ContentValues theValues = new ContentValues();
theValues.put( HomeTeachingSqlDatabaseHelper.QUORUM, aQuorum );
theValues.put( HomeTeachingSqlDatabaseHelper.NAME, aName );
theValues.put( HomeTeachingSqlDatabaseHelper.PHONE, aPhone );
theValues.put( HomeTeachingSqlDatabaseHelper.EMAIL, aEmail );
QueryBuilder theBuilder = QueryBuilder.withTable( HomeTeachingSqlDatabaseHelper.HOME_TEACHERS_TABLE );
theBuilder.addContentValues( theValues, true );
QueryBuilder.QueryArgs theResult = theBuilder.build();
Cursor theCursor = mSqlBrite.query( theResult.queryString, theResult.selectionArgs );
try
{
if( theCursor.getCount() > 0 )
{
theCursor.moveToNext();
int theIdIndex = theCursor.getColumnIndex( HomeTeachingSqlDatabaseHelper.ID );
long theId = theCursor.getLong( theIdIndex );
mSqlBrite.update( HomeTeachingSqlDatabaseHelper.HOME_TEACHERS_TABLE, theValues, HomeTeachingSqlDatabaseHelper.ID + "=?", String.valueOf( theId ) );
return theId;
}
else
{
return mSqlBrite.insert( HomeTeachingSqlDatabaseHelper.HOME_TEACHERS_TABLE, theValues );
}
}
finally
{
theCursor.close();
}
}
}
| {
"content_hash": "9c77fa537ffa7e5cf54ed2c45e52b9d6",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 163,
"avg_line_length": 35.13333333333333,
"alnum_prop": 0.5317836812144212,
"repo_name": "zaren678/android-HomeTeachingHelper",
"id": "cd8e96ca66c3790bf25592fe0e9267a993bd940f",
"size": "4216",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/java/com/zaren/hometeachinghelper/data/HomeTeachingSqlBrite.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "58988"
},
{
"name": "Kotlin",
"bytes": "1565"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>nfix: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.13.1 / nfix - 8.9.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
nfix
<small>
8.9.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-05-31 19:42:23 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-05-31 19:42:23 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-gmp 4 Virtual package relying on a GMP lib system installation
coq 8.13.1 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.12.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.12.1 Official release 4.12.1
ocaml-config 2 OCaml Switch Configuration
ocaml-options-vanilla 1 Ensure that OCaml is compiled with no special options enabled
ocamlfind 1.9.3 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
maintainer: "Hugo.Herbelin@inria.fr"
homepage: "https://github.com/coq-contribs/nfix"
license: "Unknown"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/Nfix"]
depends: [
"ocaml"
"coq" {>= "8.9" & < "8.10~"}
]
tags: [
"keyword: mutual fixpoint functions"
"category: Miscellaneous/Coq Extensions"
]
authors: [
"Stéphane Lescuyer"
]
bug-reports: "https://github.com/coq-contribs/nfix/issues"
dev-repo: "git+https://github.com/coq-contribs/nfix.git"
synopsis: "Nfix: a Coq extension for fixpoints on nested inductives"
description: """
This plugin provides a syntactic extension that allows one to write mutual fixpoints over nested inductives."""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/nfix/archive/v8.9.0.tar.gz"
checksum: "md5=91131e1910146b65a1e7035a48d191a1"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-nfix.8.9.0 coq.8.13.1</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.13.1).
The following dependencies couldn't be met:
- coq-nfix -> coq < 8.10~ -> ocaml < 4.10
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-nfix.8.9.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "8631b069704754e6379c4a7a283ec15a",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 159,
"avg_line_length": 41.13609467455621,
"alnum_prop": 0.5395569620253164,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "e4c4c6a4592f6c518695dd549b9afe37d81c76bd",
"size": "6978",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.12.1-2.0.8/released/8.13.1/nfix/8.9.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
import { join } from 'path';
import { SeedConfig } from './seed.config';
// import { ExtendPackages } from './seed.config.interfaces';
/**
* This class extends the basic seed configuration, allowing for project specific overrides. A few examples can be found
* below.
*/
export class ProjectConfig extends SeedConfig {
PROJECT_TASKS_DIR = join(process.cwd(), this.TOOLS_DIR, 'tasks', 'project');
constructor() {
super();
// this.APP_TITLE = 'Put name of your app here';
this.APP_TITLE = 'Wazee UI Platform';
/* Enable typeless compiler runs (faster) between typed compiler runs. */
// this.TYPED_COMPILE_INTERVAL = 5;
// Add `NPM` third-party libraries to be injected/bundled.
this.NPM_DEPENDENCIES = [
...this.NPM_DEPENDENCIES,
// {src: 'jquery/dist/jquery.min.js', inject: 'libs'},
// {src: 'lodash/lodash.min.js', inject: 'libs'},
];
// Add `local` third-party libraries to be injected/bundled.
this.APP_ASSETS = [
...this.APP_ASSETS,
// {src: `${this.APP_SRC}/your-path-to-lib/libs/jquery-ui.js`, inject: true, vendor: false}
// {src: `${this.CSS_SRC}/path-to-lib/test-lib.css`, inject: true, vendor: false},
];
// Add packages (e.g. ng2-translate)
// let additionalPackages: ExtendPackages[] = [{
// name: 'ng2-translate',
// // Path to the package's bundle
// path: 'node_modules/ng2-translate/bundles/ng2-translate.umd.js'
// }];
//
// this.addPackagesBundles(additionalPackages);
this.addPackageBundles({
name:'@angular/material',
path:'node_modules/@angular/material/bundles/material.umd.js',
packageMeta:{
main: 'index.js',
defaultExtension: 'js'
}
});
/* Add to or override NPM module configurations: */
// this.mergeObject(this.PLUGIN_CONFIGS['browser-sync'], { ghostMode: false });
}
}
| {
"content_hash": "d105122299203fe105c4b9992ab4cdf0",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 120,
"avg_line_length": 34.36363636363637,
"alnum_prop": 0.6306878306878307,
"repo_name": "jimmybillings/wazee",
"id": "a1e7d7245e9c21940c6f0115324b2a1ff8ff514b",
"size": "1890",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tools/config/project.config.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "123021"
},
{
"name": "HTML",
"bytes": "138980"
},
{
"name": "JavaScript",
"bytes": "7602"
},
{
"name": "Shell",
"bytes": "4164"
},
{
"name": "TypeScript",
"bytes": "701188"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.