text stringlengths 2 1.04M | meta dict |
|---|---|
<?php
namespace Blanfordia\Visitors\Support\Exceptions;
use Exception;
class Parse extends Exception {
}
| {
"content_hash": "5b55226f2401f9b94992ec8652e27f45",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 49,
"avg_line_length": 12.11111111111111,
"alnum_prop": 0.7798165137614679,
"repo_name": "sadeghnazari/visitors",
"id": "2f235e0133b520ef95ca161d514b5f3aa5052a99",
"size": "109",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Support/Exceptions/Parse.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "16070"
},
{
"name": "PHP",
"bytes": "99076"
}
],
"symlink_target": ""
} |
package com.github.bartekdobija.omniture.metadata;
public class MetadataException extends Exception {
public MetadataException () {}
public MetadataException(Throwable e) {
super(e);
}
public MetadataException(String msg) {
super(msg);
}
}
| {
"content_hash": "dd7a6685ca8ede08927625c32bd43f78",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 50,
"avg_line_length": 18.714285714285715,
"alnum_prop": 0.7251908396946565,
"repo_name": "bartekdobija/omniture-clickstream",
"id": "f82d06937c84096b5c8e77c7b70eb723e4fcdbcb",
"size": "262",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/github/bartekdobija/omniture/metadata/MetadataException.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "78888"
},
{
"name": "Smarty",
"bytes": "88"
}
],
"symlink_target": ""
} |
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.trello.navi2.component;
import android.app.Activity;
import android.app.Fragment;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.trello.navi2.Event;
import com.trello.navi2.Listener;
import com.trello.navi2.NaviComponent;
import com.trello.navi2.internal.NaviEmitter;
import androidx.annotation.CallSuper;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
public abstract class NaviFragment extends Fragment implements NaviComponent {
private final NaviEmitter base = NaviEmitter.createFragmentEmitter();
@Override public final boolean handlesEvents(Event... events) {
return base.handlesEvents(events);
}
@Override public final <T> void addListener(@NonNull Event<T> event, @NonNull Listener<T> listener) {
base.addListener(event, listener);
}
@Override public final <T> void removeListener(@NonNull Listener<T> listener) {
base.removeListener(listener);
}
@Override @CallSuper public void onAttach(Activity activity) {
super.onAttach(activity);
base.onAttach(activity);
}
@Override @CallSuper public void onAttach(Context context) {
super.onAttach(context);
base.onAttach(context);
}
@Override @CallSuper public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
base.onCreate(savedInstanceState);
}
@Nullable @Override @CallSuper public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
base.onCreateView(savedInstanceState);
return super.onCreateView(inflater, container, savedInstanceState);
}
@Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
base.onViewCreated(view, savedInstanceState);
super.onViewCreated(view, savedInstanceState);
}
@Override @CallSuper public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
base.onActivityCreated(savedInstanceState);
}
@Override @CallSuper public void onViewStateRestored(Bundle savedInstanceState) {
super.onViewStateRestored(savedInstanceState);
base.onViewStateRestored(savedInstanceState);
}
@Override @CallSuper public void onStart() {
super.onStart();
base.onStart();
}
@Override @CallSuper public void onResume() {
super.onResume();
base.onResume();
}
@Override @CallSuper public void onPause() {
base.onPause();
super.onPause();
}
@Override @CallSuper public void onStop() {
base.onStop();
super.onStop();
}
@Override @CallSuper public void onDestroyView() {
base.onDestroyView();
super.onDestroyView();
}
@Override @CallSuper public void onDestroy() {
base.onDestroy();
super.onDestroy();
}
@Override @CallSuper public void onDetach() {
base.onDetach();
super.onDetach();
}
@Override @CallSuper public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
base.onSaveInstanceState(outState);
}
@Override @CallSuper public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
base.onConfigurationChanged(newConfig);
}
@Override @CallSuper public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
base.onActivityResult(requestCode, resultCode, data);
}
@Override @CallSuper public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
@NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
base.onRequestPermissionsResult(requestCode, permissions, grantResults);
}
}
| {
"content_hash": "dd4d332047422dbc85473b7a59d935a5",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 109,
"avg_line_length": 31.18881118881119,
"alnum_prop": 0.7533632286995515,
"repo_name": "trello/navi",
"id": "9aa1bfd5565e07b4958b33c27756529739886655",
"size": "4460",
"binary": false,
"copies": "1",
"ref": "refs/heads/2.x",
"path": "navi/src/main/java/com/trello/navi2/component/NaviFragment.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "124452"
}
],
"symlink_target": ""
} |
layout: sgpm-default-display
title:
author:
tags: ["1950s", "1960s", "1970s", "1980s", "1990s", "bhairahawa", "dharan", "gurkhas", "kathmandu", "nepal", "pokhara", "singapore", "singapore gurkha archive", "singapore gurkha old photographs", "singapore gurkha photography museum", "singapore gurkhas"]
credit:
source: -singapore-gurkhas-050116-gcspf-gurkha-contingent-archives-cbg-57
description: "Near Aljunied road, used to be an army camp before took over by the GC. Won an award for walking competition. Date: Early 1980s."
copyright: ChandraBahadurGurung-SingaporeGurkhaPhotographyMuseum
slug: -singapore-gurkhas-050116-gcspf-gurkha-contingent-archives-cbg-57
date: 2014-10-09
img_path: singapore-gurkhas-050116-gcspf-gurkha-contingent-archives-CBG-57.jpg
category: singapore-gurkha-photography-museum
---
<h1></h1>
{{ site.tags }}
| {
"content_hash": "ceb3371a252731c431fa859500fa5944",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 256,
"avg_line_length": 47.666666666666664,
"alnum_prop": 0.752913752913753,
"repo_name": "sgpm-generator/sgpm-generator",
"id": "78328d9a57df0ea79843599ee99e6fdc28303a02",
"size": "862",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_posts/2014-10-09--singapore-gurkhas-050116-gcspf-gurkha-contingent-archives-cbg-57.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "8828"
},
{
"name": "HTML",
"bytes": "4343189"
},
{
"name": "Ruby",
"bytes": "3995"
},
{
"name": "Shell",
"bytes": "329"
}
],
"symlink_target": ""
} |
title: Normal Distribution
---
## Normal Distribution
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/mathematics/statistics/normal-distribution/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->
| {
"content_hash": "65999e30d723d74c1aa6cc740454c791",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 203,
"avg_line_length": 49.214285714285715,
"alnum_prop": 0.7532656023222061,
"repo_name": "otavioarc/freeCodeCamp",
"id": "b926061fdb6ff6ed2e994d58913bf401f949beb9",
"size": "693",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "guide/english/mathematics/statistics/normal-distribution/index.md",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "35491"
},
{
"name": "HTML",
"bytes": "17600"
},
{
"name": "JavaScript",
"bytes": "777274"
}
],
"symlink_target": ""
} |
Ti=Litigation Costs
sec=In any action or proceeding to enforce rights under this {_Agreement}, the prevailing party will be entitled to recover costs and attorneys' fees.
=[G/Z/ol/Base]
| {
"content_hash": "4d466c6a19d93d6ba93d681bcd9a2b9f",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 150,
"avg_line_length": 37.6,
"alnum_prop": 0.776595744680851,
"repo_name": "CommonAccord/Cmacc-Org",
"id": "9ef93c0962b19dadfee0f20345b4db57bfa3be56",
"size": "188",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Doc/G/YCombinator-SaaS/Sec/Dispute/Cost/0.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "4996"
},
{
"name": "HTML",
"bytes": "130299"
},
{
"name": "PHP",
"bytes": "1463"
}
],
"symlink_target": ""
} |
using System;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using starshipxac.Shell.TestTools;
using Xunit;
namespace starshipxac.Shell
{
public class ShellFolderTest : IClassFixture<ShellTestConfig>
{
public ShellFolderTest(ShellTestConfig testConfig)
{
this.TestConfig = testConfig;
}
public ShellTestConfig TestConfig { get; }
[Fact]
public async Task FromFolderPathTest()
{
await STATask.Run(() =>
{
var path = TestConfig.TestDirectory.FullName;
var actual = ShellFactory.FromFolderPath(path);
actual.IsNotNull();
actual.Path.Is(path);
actual.ParsingName.Is(path);
actual.Name.Is(TestConfig.TestDirectoryName);
actual.Parent.ParsingName.Is(TestConfig.TestDirectory.Parent?.FullName);
// Flags
actual.IsFileSystem.IsTrue();
});
}
[Fact]
public async Task FolderPropertyTest()
{
await STATask.Run(() =>
{
var path = TestConfig.TestDirectory.FullName;
var actual = ShellFactory.FromFolderPath(path);
actual.Parent.IsNotNull();
actual.Parent.ParsingName.Is(TestConfig.TestDirectory.Parent?.FullName);
});
}
[Fact]
public async Task GetItemsTest()
{
await STATask.Run(() =>
{
var path = TestConfig.TestDirectory.FullName;
var folder = ShellFactory.FromFolderPath(path);
var actual = folder.EnumerateObjects().ToList();
var folder1 = actual.Find(item => ShellTestConfig.CompareFileName(item.Name, "Pictures"));
folder1.IsNotNull();
var file1 = actual.Find(item => ShellTestConfig.CompareFileName(item.Name, "Test.txt"));
file1.IsNotNull();
file1.IsInstanceOf<ShellFile>();
var file2 = actual.Find(Item => ShellTestConfig.CompareFileName(Item.Name, "Test2.txt"));
file2.IsNotNull();
file2.IsInstanceOf<ShellFile>();
});
}
[Fact]
public async Task GetFolderTest()
{
await STATask.Run(() =>
{
var desktop = ShellKnownFolders.Desktop;
var actual = desktop.GetFolder();
actual.IsNull();
});
}
[Fact]
public async Task EqualsTest1()
{
await STATask.Run(() =>
{
var folder1 = ShellFactory.FromFolderPath(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments));
var folder2 = ShellFactory.FromFolderPath(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments));
folder1.IsNotSameReferenceAs(folder2);
folder1.Equals(folder2).IsTrue();
(folder1 == folder2).IsTrue();
(folder1.Path == folder2.Path).IsTrue();
(folder1.GetHashCode() == folder2.GetHashCode()).IsTrue();
});
}
[Fact]
public async Task EqualsTest2()
{
await STATask.Run(() =>
{
var folder1 = ShellFactory.FromFolderPath(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments));
var folder2 = ShellFactory.FromFolderPath(Environment.GetFolderPath(Environment.SpecialFolder.MyPictures));
folder1.IsNotSameReferenceAs(folder2);
folder1.Equals(folder2).IsFalse();
(folder1 == folder2).IsFalse();
(folder1.Path == folder2.Path).IsFalse();
(folder1.GetHashCode() == folder2.GetHashCode()).IsFalse();
});
}
[Fact]
public async Task NotEqualsTest1()
{
await STATask.Run(() =>
{
var folder1 = ShellFactory.FromFolderPath(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments));
var folder2 = ShellFactory.FromFolderPath(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments));
folder1.IsNotSameReferenceAs(folder2);
folder1.Equals(folder2).IsTrue();
(folder1 == folder2).IsTrue();
(folder1 != folder2).IsFalse();
(folder1.Path == folder2.Path).IsTrue();
(folder1.GetHashCode() == folder2.GetHashCode()).IsTrue();
});
}
[Fact]
public async Task NotEqualsTest2()
{
await STATask.Run(() =>
{
var folder1 = ShellFactory.FromFolderPath(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments));
var folder2 = ShellFactory.FromFolderPath(Environment.GetFolderPath(Environment.SpecialFolder.MyPictures));
folder1.IsNotSameReferenceAs(folder2);
folder1.Equals(folder2).IsFalse();
(folder1 == folder2).IsFalse();
(folder1 != folder2).IsTrue();
(folder1.Path == folder2.Path).IsFalse();
(folder1.GetHashCode() == folder2.GetHashCode()).IsFalse();
});
}
[Fact]
public void EnumerateFoldersTest1()
{
var pictureFolder = ShellLibraries.PicturesLibrary;
var childFolders1 = pictureFolder.EnumerateObjects()
.OfType<ShellFolder>()
.ToList();
foreach (var child in childFolders1)
{
Debug.WriteLine(child);
}
Console.WriteLine();
var folder = childFolders1.FirstOrDefault(x => x.Name == "2ch");
folder.IsNotNull();
var parentFolder = folder.GetFolder();
var childFolders2 = parentFolder.EnumerateObjects()
.OfType<ShellFolder>()
.ToList();
foreach (var child in childFolders2)
{
Debug.WriteLine(child);
}
}
}
} | {
"content_hash": "b8ca1c07c48d8f840581c83ac1285fc0",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 124,
"avg_line_length": 35.49723756906077,
"alnum_prop": 0.5310505836575875,
"repo_name": "starshipxac/starshipxac.ShellLibrary",
"id": "627384e838b22e3a63ea38f63a27d239e6841663",
"size": "6427",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "UnitTest/starshipxac.Shell.UnitTest/ShellFolderTest.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "1254266"
}
],
"symlink_target": ""
} |
name: Leaflet.TileLayer.GLOperations
category: tile-image-display
repo: https://github.com/equinor/leaflet.tilelayer.gloperations
author: Thorbjørn Horgen
author-url: https://github.com/thor85
demo: https://equinor.github.io/leaflet.tilelayer.gloperations/
compatible-v0:
compatible-v1: true
---
WebGL TileLayer: Colorize floating-point pixels, mouse event handlers for pixel values, hillshading, contours, transitions, filter and do calculations on multiple layers.
| {
"content_hash": "703b43e361dbad227d974e164da168f6",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 170,
"avg_line_length": 42.54545454545455,
"alnum_prop": 0.8141025641025641,
"repo_name": "CapeSepias/Leaflet",
"id": "165a07140bb1647e3de0d0ac2830d535cc96a3c6",
"size": "473",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "docs/_plugins/tile-image-display/leaflet-tilelayer-gloperations.md",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "CSS",
"bytes": "150"
},
{
"name": "HTML",
"bytes": "142797"
},
{
"name": "Handlebars",
"bytes": "8753"
},
{
"name": "JavaScript",
"bytes": "831241"
},
{
"name": "Shell",
"bytes": "58"
}
],
"symlink_target": ""
} |
"""Environment variables used by :mod:`google.auth`."""
PROJECT = "GOOGLE_CLOUD_PROJECT"
"""Environment variable defining default project.
This used by :func:`google.auth.default` to explicitly set a project ID. This
environment variable is also used by the Google Cloud Python Library.
"""
LEGACY_PROJECT = "GCLOUD_PROJECT"
"""Previously used environment variable defining the default project.
This environment variable is used instead of the current one in some
situations (such as Google App Engine).
"""
CREDENTIALS = "GOOGLE_APPLICATION_CREDENTIALS"
"""Environment variable defining the location of Google application default
credentials."""
# The environment variable name which can replace ~/.config if set.
CLOUD_SDK_CONFIG_DIR = "CLOUDSDK_CONFIG"
"""Environment variable defines the location of Google Cloud SDK's config
files."""
# These two variables allow for customization of the addresses used when
# contacting the GCE metadata service.
GCE_METADATA_HOST = "GCE_METADATA_HOST"
"""Environment variable providing an alternate hostname or host:port to be
used for GCE metadata requests.
This environment variable was originally named GCE_METADATA_ROOT. The system will
check this environemnt variable first; should there be no value present,
the system will fall back to the old variable.
"""
GCE_METADATA_ROOT = "GCE_METADATA_ROOT"
"""Old environment variable for GCE_METADATA_HOST."""
GCE_METADATA_IP = "GCE_METADATA_IP"
"""Environment variable providing an alternate ip:port to be used for ip-only
GCE metadata requests."""
GOOGLE_API_USE_CLIENT_CERTIFICATE = "GOOGLE_API_USE_CLIENT_CERTIFICATE"
"""Environment variable controlling whether to use client certificate or not.
The default value is false. Users have to explicitly set this value to true
in order to use client certificate to establish a mutual TLS channel."""
LEGACY_APPENGINE_RUNTIME = "APPENGINE_RUNTIME"
"""Gen1 environment variable defining the App Engine Runtime.
Used to distinguish between GAE gen1 and GAE gen2+.
"""
# AWS environment variables used with AWS workload identity pools to retrieve
# AWS security credentials and the AWS region needed to create a serialized
# signed requests to the AWS STS GetCalledIdentity API that can be exchanged
# for a Google access tokens via the GCP STS endpoint.
# When not available the AWS metadata server is used to retrieve these values.
AWS_ACCESS_KEY_ID = "AWS_ACCESS_KEY_ID"
AWS_SECRET_ACCESS_KEY = "AWS_SECRET_ACCESS_KEY"
AWS_SESSION_TOKEN = "AWS_SESSION_TOKEN"
AWS_REGION = "AWS_REGION"
AWS_DEFAULT_REGION = "AWS_DEFAULT_REGION"
| {
"content_hash": "f68817a975d877740780f8396926c6b8",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 81,
"avg_line_length": 39.09090909090909,
"alnum_prop": 0.7813953488372093,
"repo_name": "martbhell/wasthereannhlgamelastnight",
"id": "c076dc59da1c11ea2c68b13c587eb132e53c60ac",
"size": "3156",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/lib/google/auth/environment_vars.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "730"
},
{
"name": "HTML",
"bytes": "8959"
},
{
"name": "JavaScript",
"bytes": "3318"
},
{
"name": "Python",
"bytes": "5989638"
}
],
"symlink_target": ""
} |
#pragma once
/// @cond DEV
/**
* This file only serves to describe sensor groups based on libmraa groups.
* Sensors may belong to multiple groups. This is purely a documentation header
* and is not meant to be installed anywhere.
*/
/// @endcond DEV
////////////////////////////////////////////////////////////////// @cond HEA
/// Main group place holders.
////////////////////////////////////////////////////////////////// @endcond HEA
/**
* @brief Sensors grouped by category
* @defgroup bycat Sensor Categories
*/
/**
* @brief Sensors grouped by connection type
* @defgroup bycon Connection Type
*/
/**
* @brief Sensors grouped by manufacturer
* @defgroup byman Manufacturer
*/
/**
* @brief Sensors grouped into starter kits
* @defgroup bykit Starter Kits
*/
////////////////////////////////////////////////////////////////// @cond CAT
/// Groups for the various Sensor Categories.
////////////////////////////////////////////////////////////////// @endcond CAT
/**
* @brief Measure acceleration & tilt or collision detection
* @defgroup accelerometer Accelerometer
* @ingroup bycat
*/
/**
* @brief Sensors with a variable voltage output
* @defgroup ainput Analog Inputs
* @ingroup bycat
*/
/**
* @brief Measure pressure and atmospheric conditions
* @defgroup pressure Atmospheric Pressure
* @ingroup bycat
*/
/**
* @brief Button, Switch or Toggle
* @defgroup button Button
* @ingroup bycat
*/
/**
* @brief Light sensors with special function: Color recognition
* @defgroup color Color Sensor
* @ingroup bycat
*/
/**
* @brief Measure magnetic field to give rotation or heading
* @defgroup compass Compass/Gyro/Magnometers
* @ingroup bycat
*/
/**
* @brief Resistive digital to analog converters
* @defgroup digipot Digital Potentiometer
* @ingroup bycat
*/
/**
* @brief TFT, LCD, LED display elements
* @defgroup display Displays
* @ingroup bycat
*/
/**
* @brief Measure electric current
* @defgroup electric Electricity
* @ingroup bycat
*/
/**
* @brief Measure bending or detect vibration
* @defgroup flex Flex/Force
* @ingroup bycat
*/
/**
* @brief Measure substance concentrations in gases
* @defgroup gaseous Gas
* @ingroup bycat
*/
/**
* @brief Provide positioning capabilities
* @defgroup gps GPS
* @ingroup bycat
*/
/**
* @brief LEDs, LED strips, LED matrix displays & controllers
* @defgroup led LEDs
* @ingroup bycat
*/
/**
* @brief Measure light intensity or distances
* @defgroup light Light/Proximity/IR
* @ingroup bycat
*/
/**
* @brief Measure liquid flow rates or levels
* @defgroup liquid Liquid Flow
* @ingroup bycat
*/
/**
* @brief Sensors with specific medical application
* @defgroup medical Medical
* @ingroup bycat
*/
/**
* @brief Various motors & controllers to get things moving
* @defgroup motor Motor
* @ingroup bycat
*/
/**
* @brief Other types of supported sensors
* @defgroup other Other
* @ingroup bycat
*/
/**
* @brief Different low and high power relays
* @defgroup relay Relay
* @ingroup bycat
*/
/**
* @brief Wireless sensors using RFID tags
* @defgroup rfid RFID
* @ingroup bycat
*/
/**
* @brief Various servo motors & controllers
* @defgroup servos Servo
* @ingroup bycat
*/
/**
* @brief Provide sound recording or playback
* @defgroup sound Sound
* @ingroup bycat
*/
/**
* @brief Measure temperature & humidity
* @defgroup temp Temperature/Humidity
* @ingroup bycat
*/
/**
* @brief Sensors using serial communication
* @defgroup serial Serial
* @ingroup bycat
*/
/**
* @brief Real time clocks & time measurement
* @defgroup time Time
* @ingroup bycat
*/
/**
* @brief Capacitive touch sensors
* @defgroup touch Touch Sensor
* @ingroup bycat
*/
/**
* @brief Provide WiFi, Bluetooth, RF communication
* @defgroup wifi Wireless Communication
* @ingroup bycat
*/
////////////////////////////////////////////////////////////////// @cond CON
/// Groups for the various Connection Types.
////////////////////////////////////////////////////////////////// @endcond CON
/**
* @brief Sensors requiring an ADC value to be read
* @defgroup analog AIO
* @ingroup bycon
*/
/**
* @brief Modules using the i2c bus
* @defgroup i2c I2C
* @ingroup bycon
*/
/**
* @brief Modules using the SPI bus
* @defgroup spi SPI
* @ingroup bycon
*/
/**
* @brief Modules using GPIOs directly
* @defgroup gpio GPIO
* @ingroup bycon
*/
/**
* @brief Modules using a PWM capable GPIO pin
* @defgroup pwm PWM
* @ingroup bycon
*/
/**
* @brief Modules using a PWM capable GPIO pin
* @defgroup uart UART
* @ingroup bycon
*/
////////////////////////////////////////////////////////////////// @cond MAN
/// Groups for the various Manufacturers.
////////////////////////////////////////////////////////////////// @endcond MAN
/**
* @brief Adafruit Industries
* @defgroup adafruit Adafruit
* @ingroup byman
*/
/**
* @brief Amazon.com
* @defgroup amazon Amazon
* @ingroup byman
*/
/**
* @brief Banggood.com
* @defgroup banggood Banggood
* @ingroup byman
*/
/**
* @brief EpicTinker
* @defgroup epict EpicTinker
* @ingroup byman
*/
/**
* @brief Generic brands
* @defgroup generic Generic
* @ingroup byman
*/
/**
* @brief Honeywell
* @defgroup honeywell Honeywell
* @ingroup byman
*/
/**
* @brief Maxim Integrated
* @defgroup maxim Maxim Integrated
* @ingroup byman
*/
/**
* @brief Newegg.com
* @defgroup newegg Newegg
* @ingroup byman
*/
/**
* @brief SeeedStudio - Grove
* @defgroup seeed SeeedStudio
* @ingroup byman
*/
/**
* @brief Sparkfun
* @defgroup sparkfun Sparkfun
* @ingroup byman
*/
/**
* @brief Texas Instruments
* @defgroup ti Texas Instruments
* @ingroup byman
*/
////////////////////////////////////////////////////////////////// @cond KIT
/// Groups for the various Starter Kits.
////////////////////////////////////////////////////////////////// @endcond KIT
/**
* @brief Grove Starter Kit
* @defgroup gsk Grove Starter Kit
* @ingroup bykit
*/
| {
"content_hash": "b4e0f8bb4d9ed4f6808dbaa0a694768b",
"timestamp": "",
"source": "github",
"line_count": 320,
"max_line_length": 79,
"avg_line_length": 18.753125,
"alnum_prop": 0.6030661556407265,
"repo_name": "izard/upm",
"id": "f196264960c6afbd2653dda552ee8148ef16ed5b",
"size": "7245",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/upm.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "124666"
},
{
"name": "C++",
"bytes": "906667"
},
{
"name": "CMake",
"bytes": "42459"
},
{
"name": "Python",
"bytes": "15324"
}
],
"symlink_target": ""
} |
require File.expand_path('../boot', __FILE__)
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
# require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
require "sprockets/railtie"
require "rails/test_unit/railtie"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module RailsApp
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
end
end
| {
"content_hash": "a7eee1c2d983b9cf0d69848376b5e625",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 99,
"avg_line_length": 40.16129032258065,
"alnum_prop": 0.7325301204819277,
"repo_name": "slate-studio/inverter",
"id": "6d1716a85eccb4ecff58b11c5967aefc84349640",
"size": "1245",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/rails_app/config/application.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "975"
},
{
"name": "CoffeeScript",
"bytes": "10497"
},
{
"name": "HTML",
"bytes": "5278"
},
{
"name": "Ruby",
"bytes": "42929"
}
],
"symlink_target": ""
} |
<?php
require_once '../repository/UserRepository.php';
class RegisterController
{
public function __construct()
{
// Checks if the user hast admin rights, wich are required for this action
if(!Security::isAdmin()){
header('Location: /error/notAuthenticated');
}
}
public function index()
{
$view = new View('register');
$view->title = 'Registrieren';
$view->heading = 'Registrieren';
$view->display();
}
/**
* This Method Validates the Input and call tha Repository to save the new User
*/
public function register()
{
if(!Security::isAdmin()){
header('Location: /error/notAuthenticated');
}
if ($_POST['send']) {
$mistakes = $this->validate($_POST);
if(sizeof($mistakes) == 0){
$firstName = htmlspecialchars($_POST['firstName']);
$lastName = htmlspecialchars($_POST['lastName']);
$email = htmlspecialchars($_POST['email']);
$password = htmlspecialchars($_POST['password']);
$userRepository = new UserRepository();
$userRepository->create($firstName, $lastName, $email, $password);
$successMessages = ["Benutzer wurde erfolgreich erstellt"];
$_SESSION['successAlerts'] = $successMessages;
header('Location: /');
} else {
$this->displayError($mistakes);
}
}
}
public function displayError($mistakes){
$_SESSION['errorAlerts'] = $mistakes;
$_SESSION['registerUserData'] = $_POST;
header('Location: /register');
}
private function validate($data){
$mistakes = [];
if(Validate::isNullOrEmpty($data['firstName'])){
array_push($mistakes,"Vorname nicht eingegeben");
}
if(Validate::isNullOrEmpty($data['lastName'])){
array_push($mistakes,"Nachname nicht eingegeben");
}
if(!Validate::checkEmail($data['email'])){
array_push($mistakes,"E-Mail ungültig");
}
else{
$userRepository = new UserRepository();
$users = $userRepository->getAll();
foreach($users as $user){
if($user->email == $data['email']){
array_push($mistakes,"Ein Benutzer mit der seleben Emailadresse existiert bereits!");
}
}
}
if(!Validate::checkPassword($data['password'])){
array_push($mistakes,"Passwort ungültig");
} elseif ($data['password'] != $data['password-repeat']){
array_push($mistakes,"Passwörter stimmen nicht überein");
}
return $mistakes;
}
}
| {
"content_hash": "fc2e2ec63dcc2397b33d9a4fa8434945",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 105,
"avg_line_length": 31.863636363636363,
"alnum_prop": 0.5374465049928673,
"repo_name": "wityan/SoccerLounge",
"id": "b80a9f58725a68d4937c4c9160ce6119136968b0",
"size": "2808",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "controller/RegisterController.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "761"
},
{
"name": "CSS",
"bytes": "2469"
},
{
"name": "JavaScript",
"bytes": "279"
},
{
"name": "PHP",
"bytes": "73211"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<!--L
Copyright Oracle Inc
Distributed under the OSI-approved BSD 3-Clause License.
See http://ncip.github.com/cadsr-cgmdr-nci-uk/LICENSE.txt for details.
L-->
<cgMDR:Data_Element xmlns:cgMDR="http://www.cancergrid.org/schema/cgMDR" item_registration_authority_identifier="GB-CANCERGRID" data_identifier="D1E231131" version="0.1">
<cgMDR:administered_item_administration_record>
<cgMDR:administrative_note>Auto generated during protege import</cgMDR:administrative_note>
<cgMDR:administrative_status>noPendingChanges</cgMDR:administrative_status>
<cgMDR:change_description/>
<cgMDR:creation_date>2006-08-08</cgMDR:creation_date>
<cgMDR:effective_date>2006-08-08</cgMDR:effective_date>
<cgMDR:explanatory_comment/>
<cgMDR:last_change_date>2006-08-08</cgMDR:last_change_date>
<cgMDR:origin/>
<cgMDR:registration_status>Superseded</cgMDR:registration_status>
<cgMDR:unresolved_issue/>
<cgMDR:until_date>2007-01-11</cgMDR:until_date>
</cgMDR:administered_item_administration_record>
<cgMDR:administered_by>GB-CANCERGRID-000005-1</cgMDR:administered_by>
<cgMDR:registered_by>GB-CANCERGRID-000009-1</cgMDR:registered_by>
<cgMDR:submitted_by>GB-CANCERGRID-000006-1</cgMDR:submitted_by>
<cgMDR:described_by>KNCSJG1HE</cgMDR:described_by>
<cgMDR:classified_by>http://www.cancergrid.org/ontologies/data-element-classification#D1E14389</cgMDR:classified_by>
<cgMDR:classified_by>http://www.cancergrid.org/ontologies/data-element-classification#D1E15182</cgMDR:classified_by>
<cgMDR:having>
<cgMDR:context_identifier>GB-CANCERGRID-000001-1</cgMDR:context_identifier>
<cgMDR:containing>
<cgMDR:language_section_language_identifier>
<cgMDR:country_identifier>GB</cgMDR:country_identifier>
<cgMDR:language_identifier>eng</cgMDR:language_identifier>
</cgMDR:language_section_language_identifier>
<cgMDR:name>Patient has not received previous radiotherapy or chemotherapy data element</cgMDR:name>
<cgMDR:definition_text>By reference to the patient notes</cgMDR:definition_text>
<cgMDR:preferred_designation>true</cgMDR:preferred_designation>
<cgMDR:definition_source_reference/>
</cgMDR:containing>
</cgMDR:having>
<cgMDR:data_element_precision>0</cgMDR:data_element_precision>
<cgMDR:representation_class_qualifier/>
<cgMDR:representing>GB-CANCERGRID-D1E231134-0.1</cgMDR:representing>
<cgMDR:typed_by>GB-CANCERGRID-000021-1</cgMDR:typed_by>
<cgMDR:expressing>GB-CANCERGRID-D1E231132-0.1</cgMDR:expressing>
<cgMDR:input_to deriving="GB-CANCERGRID-D1E231131-0.12">
<cgMDR:derivation_rule_specification>superseded by</cgMDR:derivation_rule_specification>
</cgMDR:input_to>
<cgMDR:field_name preferred=""/>
<cgMDR:question_text preferred=""/>
</cgMDR:Data_Element> | {
"content_hash": "9e3ca6f1eb63b5e78b86154d5d8dbdd6",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 170,
"avg_line_length": 56.509433962264154,
"alnum_prop": 0.7205342237061769,
"repo_name": "NCIP/cadsr-cgmdr-nci-uk",
"id": "75218006104eb4a255654e637db96c15d0111b68",
"size": "2995",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "cancergrid/datasets/cancergrid-dataset/data/data_element/GB-CANCERGRID-D1E231131-0.1.xml",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C#",
"bytes": "291811"
},
{
"name": "CSS",
"bytes": "46374"
},
{
"name": "Emacs Lisp",
"bytes": "1302"
},
{
"name": "Java",
"bytes": "12447025"
},
{
"name": "JavaScript",
"bytes": "659235"
},
{
"name": "Perl",
"bytes": "14339"
},
{
"name": "Python",
"bytes": "8079"
},
{
"name": "Shell",
"bytes": "47723"
},
{
"name": "XQuery",
"bytes": "592174"
},
{
"name": "XSLT",
"bytes": "441742"
}
],
"symlink_target": ""
} |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
lookup: upgrade_chekpoints
short_description: build list of chekpoints be played on upgrade
description:
- This lookup returns the list of upgrade checkpoint names to be played on upgrade.
options:
_root:
description: the root directory containing checkpoint directories with upgrading tasks
required: True
_current_version:
description: current installed version
required: True
notes:
Example
Version 2.27.0 is installed on the target box. Current kctl version is 2.29.0 and we have tasks
tasks/
|
+-- 2.27.0/
| |
| +-- main.yml
|
+-- 2.27.1/
| |
| +-- main.yml
|
+-- 2.29.0/
|
+-- main.yml
This lookup will return ['2.27.1', '2.29.0']
"""
from ansible.plugins.lookup import LookupBase
from ansible.utils.display import Display
from distutils.version import StrictVersion
from ansible.module_utils._text import to_text
import os
import re
display = Display()
# Based on https://github.com/ansible-collections/community.general/blob/main/plugins/lookup/filetree.py
class LookupModule(LookupBase):
def run(self, terms, variables=None, **kwargs):
kctl_tags = variables['kctl_tags']
if ('upgrade' in kctl_tags) or ('full-upgrade' in kctl_tags):
to = variables['kctl_version']
since = '0.9' if ('full-upgrade' in kctl_tags) else variables['kctl_installed_version']
upgrade_checkpoint_to_path_map = self.__upgrade_checkpoint_to_path_map(terms[0], variables, since, to)
return self.__upgrade_checkpoint_paths(upgrade_checkpoint_to_path_map, since, to)
else:
return []
def __upgrade_checkpoint_to_path_map(self, term, variables, since, to):
result = {}
basedir = self.get_basedir(variables)
display.display("Lookup upgrade checkpoints to be played on upgrade %s -> %s in the %s directory" % \
(since, to, term))
term_file = os.path.basename(term)
dwimmed_path = self._loader.path_dwim_relative(basedir, 'files', os.path.dirname(term))
path = os.path.join(dwimmed_path, term_file)
for root, dirs, files in os.walk(path, topdown=True):
for entry in files:
full_path = os.path.join(root, entry)
rel_path = os.path.relpath(full_path, path)
match = re.match(r"^(\d+(\.\d+)+)/main.yml$", rel_path)
if match:
result[match.group(1)] = full_path
return result
def __upgrade_checkpoint_paths(self, upgrade_checkpoint_to_path_map, since, to):
result = []
upgrade_checkpoint_versions = list(upgrade_checkpoint_to_path_map.keys())
upgrade_checkpoint_versions.sort(key=StrictVersion)
display.vvv("Found upgrdade checkpoints: %s" % upgrade_checkpoint_versions)
for upgrade_checkpoint in upgrade_checkpoint_versions:
if self.__playable_on_upgrade(upgrade_checkpoint, since, to):
result.append(upgrade_checkpoint_to_path_map[upgrade_checkpoint])
display.display("Following upgrdade checkpoint will be played: %s" % result)
return result
def __playable_on_upgrade(self, upgrade_checkpoint, since, to):
return (StrictVersion(to_text(upgrade_checkpoint)) > StrictVersion(to_text(since))) and \
(StrictVersion(to_text(upgrade_checkpoint)) <= StrictVersion(to_text(to)))
| {
"content_hash": "c56e490567854b607f3e2db7b33e94d1",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 114,
"avg_line_length": 36.54545454545455,
"alnum_prop": 0.6329463792150359,
"repo_name": "keitarocorp/centos_provision",
"id": "e426049bff3ee1adae2d2a2fc6bb1cf4cd7a3d32",
"size": "3672",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "plugins/lookup/upgrade_checkpoints.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Makefile",
"bytes": "1326"
},
{
"name": "Ruby",
"bytes": "47615"
},
{
"name": "Shell",
"bytes": "147776"
}
],
"symlink_target": ""
} |
package cn.way.wandroid.text;
import android.graphics.Color;
import android.os.Bundle;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.method.LinkMovementMethod;
import android.text.style.BackgroundColorSpan;
import android.text.style.ForegroundColorSpan;
import android.text.style.StrikethroughSpan;
import android.text.style.URLSpan;
import android.widget.TextView;
import cn.way.wandroid.BaseFragmentActivity;
import cn.way.wandroid.R;
public class TextUseage extends BaseFragmentActivity {
// ParcelableSpan
//TODO: using span to set special words with be different in line
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_usage_applation);
TextView tv = (TextView) findViewById(R.id.textVeiw);
tv.setTextColor(Color.WHITE);//默认颜色WHITE
String part1 = "默认";
String part2s = "abc 特 殊 123";
String part3 = "默认\n";
String part4s = "http://www.baidu.com";
// Parcel p = Parcel.obtain();
// p.writeInt(Color.YELLOW);
// p.setDataPosition(0);
// ForegroundColorSpan fcsYellow = new ForegroundColorSpan(p);
// p.recycle();
Spannable spn = SpannableStringBuilder.valueOf(part1+part2s+part3+part4s);
int start = part1.length();
int end = start + part2s.length();
spn.setSpan(new ForegroundColorSpan(Color.RED), start, end, Spannable.SPAN_INCLUSIVE_INCLUSIVE);
spn.setSpan(new BackgroundColorSpan(Color.WHITE), start, end, Spannable.SPAN_INCLUSIVE_INCLUSIVE);
spn.setSpan(new StrikethroughSpan(), start, end, Spannable.SPAN_INCLUSIVE_INCLUSIVE);
start = end + part3.length();
end = start + part4s.length();
URLSpan urlSpan = new URLSpan("http://www.baidu.com");
spn.setSpan(urlSpan, start, end, Spannable.SPAN_EXCLUSIVE_INCLUSIVE);//SPAN_EXCLUSIVE_INCLUSIVE|SPAN_EXCLUSIVE_EXCLUSIVE
tv.setMovementMethod(LinkMovementMethod.getInstance());
tv.setText(spn);
}
}
| {
"content_hash": "25850fa6ceab836674d8c947a90525dd",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 122,
"avg_line_length": 39.61224489795919,
"alnum_prop": 0.7666151468315301,
"repo_name": "wayhap/WASample",
"id": "1f9fcbadd80f00d6b74a3b05b6fba2a710a8a85a",
"size": "1961",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/cn/way/wandroid/text/TextUseage.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "400336"
}
],
"symlink_target": ""
} |
package daemon
import (
"crypto/md5"
"encoding/binary"
"net"
bgp "github.com/gopher-net/gopher-net/third-party/github.com/gobgp/packet"
)
// BgpDbTable contains a map of BgpDbEntry keyed on a hash of Prefix and PrefixLen
type BgpDbTable map[[16]byte]BgpDbEntry
// BgpDbEntry is an entry in the Bgp Database for a specific peer
type BgpDbEntry struct {
Prefix net.IP
PrefixLen int
PathAttributes []bgp.PathAttributeInterface
}
// Hash returns the MD5sum of the Prefix and PrefixLen
func (e *BgpDbEntry) Hash() [16]byte {
p1 := e.Prefix.To4()
p2 := make([]byte, 2)
binary.BigEndian.PutUint16(p2, uint16(e.PrefixLen))
data := append(p1, p2...)
return md5.Sum(data)
}
// BgpDatabase is the database of all learned routes
type BgpDatabase struct {
Table map[string]BgpDbTable
}
func NewBgpDatabase() *BgpDatabase {
return &BgpDatabase{
map[string]BgpDbTable{},
}
}
func (db *BgpDatabase) AddEntry(peer net.IP, entry *BgpDbEntry) {
_, ok := db.Table[peer.String()]
if !ok {
db.Table[peer.String()] = BgpDbTable{}
}
table := db.Table[peer.String()]
table[entry.Hash()] = *entry
}
func (db *BgpDatabase) RemoveEntry(peer net.IP, entry *BgpDbEntry) error {
_, ok := db.Table[peer.String()]
if !ok {
// error
}
table := db.Table[peer.String()]
delete(table, entry.Hash())
return nil
}
| {
"content_hash": "dadf012625105caa04318770010d81d4",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 82,
"avg_line_length": 21.174603174603174,
"alnum_prop": 0.6956521739130435,
"repo_name": "gopher-net/gopher-net",
"id": "c393ad0a1f8863dd030a64e3d38a761c6393db61",
"size": "1334",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "daemon/bgp_table.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "3585"
},
{
"name": "Go",
"bytes": "98750"
},
{
"name": "Makefile",
"bytes": "530"
}
],
"symlink_target": ""
} |
table th.value,
table td.value {
word-break:break-all
}
| {
"content_hash": "c819ea5c842e1688c99b2f03a2eb5336",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 24,
"avg_line_length": 15,
"alnum_prop": 0.6833333333333333,
"repo_name": "nkm/redsys-virtual-pos",
"id": "43b8a1e8c065eaf1d12556416fab3840c08e04a7",
"size": "60",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sample/styles.css",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "PHP",
"bytes": "226324"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<meta charset=utf-8>
<title>Redirecting...</title>
<link rel=canonical href="../惧/index.html">
<meta http-equiv=refresh content="0; url='../惧/index.html'">
<h1>Redirecting...</h1>
<a href="../惧/index.html">Click here if you are not redirected.</a>
<script>location='../惧/index.html'</script>
| {
"content_hash": "0590d0279f122308c9c64ed9ce83c876",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 67,
"avg_line_length": 38.5,
"alnum_prop": 0.6785714285714286,
"repo_name": "hochanh/hochanh.github.io",
"id": "376de3ae6a381ede4577f534fdfbde815077eef5",
"size": "316",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "rtk/v4/3015.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "6969"
},
{
"name": "JavaScript",
"bytes": "5041"
}
],
"symlink_target": ""
} |
namespace app { namespace Fuse { namespace Resources { struct ImageSource; } } }
namespace app {
namespace Uno {
namespace UX {
struct ValueChangedArgs__Fuse_Resources_ImageSource;
struct ValueChangedArgs__Fuse_Resources_ImageSource__uType : ::app::Uno::EventArgs__uType
{
};
ValueChangedArgs__Fuse_Resources_ImageSource__uType* ValueChangedArgs__Fuse_Resources_ImageSource__typeof();
void ValueChangedArgs__Fuse_Resources_ImageSource___ObjInit_1(ValueChangedArgs__Fuse_Resources_ImageSource* __this, ::app::Fuse::Resources::ImageSource* value, ::uObject* origin);
::uObject* ValueChangedArgs__Fuse_Resources_ImageSource__get_Origin(ValueChangedArgs__Fuse_Resources_ImageSource* __this);
::app::Fuse::Resources::ImageSource* ValueChangedArgs__Fuse_Resources_ImageSource__get_Value(ValueChangedArgs__Fuse_Resources_ImageSource* __this);
ValueChangedArgs__Fuse_Resources_ImageSource* ValueChangedArgs__Fuse_Resources_ImageSource__New_2(::uStatic* __this, ::app::Fuse::Resources::ImageSource* value, ::uObject* origin);
void ValueChangedArgs__Fuse_Resources_ImageSource__set_Origin(ValueChangedArgs__Fuse_Resources_ImageSource* __this, ::uObject* value);
void ValueChangedArgs__Fuse_Resources_ImageSource__set_Value(ValueChangedArgs__Fuse_Resources_ImageSource* __this, ::app::Fuse::Resources::ImageSource* value);
struct ValueChangedArgs__Fuse_Resources_ImageSource : ::app::Uno::EventArgs
{
::uStrong< ::app::Fuse::Resources::ImageSource*> _Value;
::uStrong< ::uObject*> _Origin;
void _ObjInit_1(::app::Fuse::Resources::ImageSource* value, ::uObject* origin) { ValueChangedArgs__Fuse_Resources_ImageSource___ObjInit_1(this, value, origin); }
::uObject* Origin() { return ValueChangedArgs__Fuse_Resources_ImageSource__get_Origin(this); }
::app::Fuse::Resources::ImageSource* Value() { return ValueChangedArgs__Fuse_Resources_ImageSource__get_Value(this); }
void Origin(::uObject* value) { ValueChangedArgs__Fuse_Resources_ImageSource__set_Origin(this, value); }
void Value(::app::Fuse::Resources::ImageSource* value) { ValueChangedArgs__Fuse_Resources_ImageSource__set_Value(this, value); }
};
}}}
#endif
| {
"content_hash": "a109259c3c582ae5311b22ba7083b357",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 180,
"avg_line_length": 57.86486486486486,
"alnum_prop": 0.7589911256422233,
"repo_name": "blyk/BlackCode-Fuse",
"id": "0e0ba94cd0233a4280f8c429bbc4f42afbf16fb2",
"size": "2507",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "AndroidUI/.build/Simulator/Android/include/app/Uno.UX.ValueChangedArgs__Fuse_Resources_ImageSource.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "31111"
},
{
"name": "C",
"bytes": "22885804"
},
{
"name": "C++",
"bytes": "197750292"
},
{
"name": "Java",
"bytes": "951083"
},
{
"name": "JavaScript",
"bytes": "578555"
},
{
"name": "Logos",
"bytes": "48297"
},
{
"name": "Makefile",
"bytes": "6592573"
},
{
"name": "Shell",
"bytes": "19985"
}
],
"symlink_target": ""
} |
class GameMainWindow : public QMainWindow
{
Q_OBJECT
public:
GameMainWindow();
MenuWindow *menuWindow;
Markgame *markgame;
ScoreWindow *scoreWindow;
private slots:
void setGameWindow();
void showResult();
protected:
void keyPressEvent(QKeyEvent *);
private:
int keymode;
int topscre;
QMediaPlayer *menuMusic;
QMediaPlayer *gameMusic;
QMediaPlayer *scoreMusic;
QMediaPlaylist *menuplaylist;
QMediaPlaylist *gameplaylist;
QMediaPlaylist *scoreplaylist;
void setMenu();
void setMusic();
};
#endif // GAMEMAINWINDOW_H
| {
"content_hash": "8f9716360e32dcb90c83a1ff1bdd4a13",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 41,
"avg_line_length": 19.06451612903226,
"alnum_prop": 0.6971235194585449,
"repo_name": "sh4869/TankGame",
"id": "ee3350928f72bf29c6253908b56ebdae126115bb",
"size": "872",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "MarkGame/gamemainwindow.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Arduino",
"bytes": "13087"
},
{
"name": "C++",
"bytes": "21694"
},
{
"name": "QMake",
"bytes": "617"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/backrepeat"
android:gravity="center_horizontal"
android:orientation="vertical" >
</LinearLayout> | {
"content_hash": "2f2ebf81801f45b19159c325705df398",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 72,
"avg_line_length": 36.666666666666664,
"alnum_prop": 0.7333333333333333,
"repo_name": "pk-android/android-tile-repeat",
"id": "5d099dc1402c06edd33a9011a39b9fcf5f2e55d8",
"size": "330",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "res/layout/main.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "416"
}
],
"symlink_target": ""
} |
CREATE OR REPLACE VIEW ESI_SHOP_MATERIAL_ALLOC AS
SELECT MAT.order_no order_no,
MAT.release_no release_no,
MAT.sequence_no sequence_no,
MAT.line_item_no line_item_no,
MAT.part_no part_no,
MAT.contract contract,
MAT.issue_to_loc issue_to_loc,
MAT.note_id note_id,
MAT.operation_no operation_no,
MAT.structure_line_no structure_line_no,
MAT.create_date create_date,
MAT.date_required date_required,
MAT.last_activity_date last_activity_date,
MAT.last_issue_date last_issue_date,
MAT.leadtime_offset leadtime_offset,
MAT.priority_no priority_no,
MAT.qty_assigned qty_assigned,
MAT.qty_issued qty_issued,
MAT.qty_on_order qty_on_order,
MAT.qty_per_assembly qty_per_assembly,
MAT.shrinkage_factor shrinkage_factor,
MAT.component_scrap component_scrap,
MAT.qty_required qty_required,
MAT.supply_code supply_code,
MAT.supply_code_db supply_code_db,
MAT.note_text note_text,
MAT.order_code order_code,
MAT.order_code_db order_code_db,
MAT.generate_demand_qty generate_demand_qty,
MAT.qty_short qty_short,
MAT.consumption_item consumption_item,
MAT.consumption_item_db consumption_item_db,
MAT.print_unit print_unit,
MAT.activity_seq activity_seq,
MAT.draw_pos_no draw_pos_no,
MAT.configuration_id configuration_id,
MAT.condition_code condition_code,
MAT.part_ownership part_ownership,
MAT.part_ownership_db part_ownership_db,
MAT.owning_customer_no owning_customer_no,
MAT.owning_vendor_no owning_vendor_no,
MAT.vim_structure_source_db vim_structure_source_db,
MAT.vim_structure_source vim_structure_source,
MAT.partial_part_required partial_part_required,
MAT.project_id project_id,
MAT.catch_qty_issued catch_qty_issued,
MAT.replicate_changes replicate_changes,
MAT.replaced_qty replaced_qty,
MAT.replaces_qpa_factor replaces_qpa_factor,
MAT.replaces_line_item_no replaces_line_item_no,
MAT.qty_scrapped_component qty_scrapped_component,
MAT.position_part_no position_part_no,
-- MAT.std_planned_item std_planned_item,
MAT.objid objid,
MAT.objversion objversion,
MAT.objstate objstate,
MAT.objevents objevents,
MAT.state state,
INV.location_no location_no,
INV.location_group location_group,
INV.warehouse warehouse,
INV.bay_no bay_no,
INV.row_no row_no,
INV.tier_no tier_no,
INV.bin_no bin_no,
INV.location_name location_name,
INV.location_type location_type,
INV.location_type_db location_type_db,
INV.lot_batch_no lot_batch_no,
INV.serial_no serial_no,
INV.eng_chg_level eng_chg_level,
INV.waiv_dev_rej_no waiv_dev_rej_no,
INV.avg_unit_transit_cost avg_unit_transit_cost,
INV.count_variance count_variance,
INV.expiration_date expiration_date,
INV.freeze_flag freeze_flag,
INV.freeze_flag_db freeze_flag_db,
INV.last_count_date last_count_date,
INV.qty_in_transit qty_in_transit,
INV.qty_onhand qty_onhand,
INV.qty_reserved qty_reserved,
INV.receipt_date receipt_date,
INV.source source,
INV.availability_control_id availability_control_id,
INV.objid location_objid,
INV.objversion location_objversion
FROM SHOP_MATERIAL_ALLOC MAT,
ESI_INVENTORY_PART_IN_STOCK INV
WHERE MAT.part_no = INV.part_no
AND MAT.contract = INV.contract
AND MAT.objstate NOT IN ('Closed', 'Parked', 'Planned', 'Cancelled')
AND MAT.qty_required - MAT.qty_issued > 0;
| {
"content_hash": "e2c23bcee22e202f56b7a4c8fd3c4562",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 71,
"avg_line_length": 57.31182795698925,
"alnum_prop": 0.46716697936210133,
"repo_name": "allenbyerly/Conformity",
"id": "921f26e94accf3b9c9a5c7c250c856e2a0a868ad",
"size": "5330",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ConformitySQL/Standard/ESI_SHOP_MATERIAL_ALLOC.sql",
"mode": "33261",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
module RubyPushNotifications
module WNS
# This class is responsible for sending notifications to the WNS service.
#
class WNSPusher
# Initializes the WNSPusher
#
# @param access_token [String]. WNS access token.
# @param options [Hash] optional. Options for GCMPusher. Currently supports:
# * open_timeout [Integer]: Number of seconds to wait for the connection to open. Defaults to 30.
# * read_timeout [Integer]: Number of seconds to wait for one block to be read. Defaults to 30.
# (http://msdn.microsoft.com/pt-br/library/windows/apps/ff941099)
def initialize(access_token, options = {})
@access_token = access_token
@options = options
end
# Actually pushes the given notifications.
# Assigns every notification an array with the result of each
# individual notification.
#
# @param notifications [Array]. Array of WNSNotification to send.
def push(notifications)
notifications.each do |notif|
notif.results = WNSConnection.post notif, @access_token, @options
end
end
end
end
end
| {
"content_hash": "17565c688e65aa9a7ad8c4809386049e",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 105,
"avg_line_length": 35.90625,
"alnum_prop": 0.6623150565709313,
"repo_name": "calonso/ruby-push-notifications",
"id": "926bc1b14834075ab46c08682c05c15b3b592d3f",
"size": "1149",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/ruby-push-notifications/wns/wns_pusher.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "130942"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
Index Fungorum
#### Published in
null
#### Original name
Achlya oblongata var. gigantea E.J. Forbes, 1935
### Remarks
null | {
"content_hash": "248be8fb7326a6a598ea528ab0c56021",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 48,
"avg_line_length": 11.692307692307692,
"alnum_prop": 0.7039473684210527,
"repo_name": "mdoering/backbone",
"id": "5138b63c4f07391c8b7ca449073a603108a279d5",
"size": "237",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Chromista/Oomycota/Oomycetes/Saprolegniales/Saprolegniaceae/Newbya/Newbya oblongata/ Syn. Newbya oblongata gigantica/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<?xml version = "1.0" encoding = "UTF-8"?>
<INPUT>
<MEDALS>
<MEDAL Id="1" MEDAL_THRESHOLD="45000" TYPE="Gold"/>
<MEDAL Id="2" MEDAL_THRESHOLD="70000" TYPE="Silver"/>
<MEDAL Id="3" MEDAL_THRESHOLD="95000" TYPE="Bronze"/>
</MEDALS>
<SpeedSettings Min="0" Max="150" Default="18"/>
<PenaltySettings TimeLost="15" SpeedLost="0.1"/>
<PROBLEM_SET>
<PROBLEM_SUBSET>
<TARGET TYPE="Fraction">
<ContentSettings denominator="4" numerator="21"/>
</TARGET>
<QUESTION INDEX="1">
<Content TYPE="Fraction">
<ContentSettings denominator="4" numerator="9"/>
</Content>
<Answer VALUE="1"/>
</QUESTION>
<QUESTION INDEX="2">
<Content TYPE="Fraction">
<ContentSettings denominator="4" numerator="11"/>
</Content>
<Answer VALUE="1"/>
</QUESTION>
<QUESTION INDEX="3">
<Content TYPE="Fraction">
<ContentSettings denominator="4" numerator="32"/>
</Content>
<Answer VALUE="0"/>
</QUESTION>
<QUESTION INDEX="4">
<Content TYPE="Fraction">
<ContentSettings denominator="4" numerator="6"/>
</Content>
<Answer VALUE="1"/>
</QUESTION>
<QUESTION INDEX="5">
<Content TYPE="Fraction">
<ContentSettings denominator="4" numerator="22"/>
</Content>
<Answer VALUE="0"/>
</QUESTION>
</PROBLEM_SUBSET>
<PROBLEM_SUBSET>
<TARGET TYPE="Fraction">
<ContentSettings denominator="4" numerator="15"/>
</TARGET>
<QUESTION INDEX="6">
<Content TYPE="Fraction">
<ContentSettings denominator="5" numerator="15"/>
</Content>
<Answer VALUE="1"/>
</QUESTION>
<QUESTION INDEX="7">
<Content TYPE="Fraction">
<ContentSettings denominator="8" numerator="15"/>
</Content>
<Answer VALUE="1"/>
</QUESTION>
<QUESTION INDEX="8">
<Content TYPE="Fraction">
<ContentSettings denominator="10" numerator="15"/>
</Content>
<Answer VALUE="1"/>
</QUESTION>
<QUESTION INDEX="9">
<Content TYPE="Fraction">
<ContentSettings denominator="8" numerator="15"/>
</Content>
<Answer VALUE="1"/>
</QUESTION>
<QUESTION INDEX="10">
<Content TYPE="Fraction">
<ContentSettings denominator="3" numerator="15"/>
</Content>
<Answer VALUE="1"/>
</QUESTION>
</PROBLEM_SUBSET>
<PROBLEM_SUBSET>
<TARGET TYPE="Fraction">
<ContentSettings denominator="4" numerator="1"/>
</TARGET>
<QUESTION INDEX="11">
<Content TYPE="Fraction">
<ContentSettings denominator="4" numerator="12"/>
</Content>
<Answer VALUE="0"/>
</QUESTION>
<QUESTION INDEX="12">
<Content TYPE="Fraction">
<ContentSettings denominator="4" numerator="35"/>
</Content>
<Answer VALUE="0"/>
</QUESTION>
<QUESTION INDEX="13">
<Content TYPE="Fraction">
<ContentSettings denominator="4" numerator="25"/>
</Content>
<Answer VALUE="0"/>
</QUESTION>
<QUESTION INDEX="14">
<Content TYPE="Fraction">
<ContentSettings denominator="3" numerator="27"/>
</Content>
<Answer VALUE="0"/>
</QUESTION>
<QUESTION INDEX="15">
<Content TYPE="Fraction">
<ContentSettings denominator="5" numerator="2"/>
</Content>
<Answer VALUE="0"/>
</QUESTION>
</PROBLEM_SUBSET>
<PROBLEM_SUBSET>
<TARGET TYPE="Fraction">
<ContentSettings denominator="8" numerator="17"/>
</TARGET>
<QUESTION INDEX="16">
<Content TYPE="Fraction">
<ContentSettings denominator="4" numerator="12"/>
</Content>
<Answer VALUE="0"/>
</QUESTION>
<QUESTION INDEX="17">
<Content TYPE="Fraction">
<ContentSettings denominator="8" numerator="27"/>
</Content>
<Answer VALUE="0"/>
</QUESTION>
<QUESTION INDEX="18">
<Content TYPE="Fraction">
<ContentSettings denominator="10" numerator="11"/>
</Content>
<Answer VALUE="1"/>
</QUESTION>
<QUESTION INDEX="19">
<Content TYPE="Fraction">
<ContentSettings denominator="12" numerator="14"/>
</Content>
<Answer VALUE="1"/>
</QUESTION>
<QUESTION INDEX="20">
<Content TYPE="Fraction">
<ContentSettings denominator="3" numerator="23"/>
</Content>
<Answer VALUE="0"/>
</QUESTION>
</PROBLEM_SUBSET>
</PROBLEM_SET>
</INPUT> | {
"content_hash": "c4043c5c0a0c114fc559de79cfaf0151",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 57,
"avg_line_length": 27.585526315789473,
"alnum_prop": 0.6117338421178155,
"repo_name": "synaptek/MathFluency",
"id": "93a391ef85fb20651008b0657139f40044271aa2",
"size": "4193",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "data/ft1_racecar_html5/s2w2_fract_2/s2w2f2_set026.xml",
"mode": "33261",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "1908"
},
{
"name": "HTML",
"bytes": "580527"
},
{
"name": "JavaScript",
"bytes": "24985612"
},
{
"name": "Python",
"bytes": "77534"
},
{
"name": "Shell",
"bytes": "162"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Z3Data;
namespace AlertLibrary
{
public class Report
{
string _reportTextHTML = null;
Alerts _alerts = null;
string _linkPage = null;
Dictionary<string, string> _images = new Dictionary<string, string>();
Job _job = null;
public Report(Job j)
{
_job = j;
_linkPage = "http://Z3-1/Nightly/Default.aspx";
_alerts = new Alerts(_job, _linkPage);
_images.Add("ok", "ok.png");
_images.Add("warning", "warning.png");
_images.Add("critical", "critical.png");
}
public bool IsInteresting
{
get
{
return _alerts[""].Count > 0 && _alerts[""].Level != AlertLevel.None;
}
}
public string ReportTextHTML
{
get
{
if (_reportTextHTML == null)
GenerateReportHTML();
return _reportTextHTML;
}
}
protected string MakeHTMLTable(string category)
{
AlertSet alertSet = _alerts[category];
string res = "";
if (alertSet.Count > 0)
{
res += "<table>";
foreach (KeyValuePair<AlertLevel, List<string>> kvp in alertSet.Messages)
{
AlertLevel level = kvp.Key;
List<string> messages = kvp.Value;
res += "<tr>";
switch (level)
{
case AlertLevel.None:
res += "<td align=left valign=top><img src='cid:ok'/></td>";
res += "<td align=left valign=middle><font color=Green>";
break;
case AlertLevel.Warning:
res += "<td align=left valign=top><img src='cid:warning'/></td>";
res += "<td align=left valign=middle><font color=Orange>";
break;
case AlertLevel.Critical:
res += "<td align=left valign=top><img src='cid:critical'/></td>";
res += "<td align=left valign=middle><font color=Red>";
break;
}
foreach (string m in messages)
res += m + "<br/>";
res += "</font></td>";
res += "<tr>";
}
res += "</table>";
}
return res;
}
protected void GenerateReportHTML()
{
uint id = _job.MetaData.Id;
_reportTextHTML = "<body>";
_reportTextHTML += "<h1>Z3 Nightly Alert Report</h1>";
_reportTextHTML += "<p>This are alerts for <a href=" + _linkPage + "?job=" + id + " style='text-decoration:none'>job #" + id + "</a> (submitted " + _job.MetaData.SubmissionTime + ").</p>";
if (_alerts[""].Count == 0)
{
_reportTextHTML += "<p>";
_reportTextHTML += "<img src='cid:ok'/> ";
_reportTextHTML += "<font color=Green>All is well everywhere!</font>";
_reportTextHTML += "</p>";
}
else
{
_reportTextHTML += "<h2>Alert Summary</h2>";
_reportTextHTML += MakeHTMLTable("");
_reportTextHTML += "<h2>Detailed alerts</h2>";
foreach (string cat in _alerts.Categories)
{
if (cat != "" && _alerts[cat].Count > 0)
{
_reportTextHTML += "<h3><a href='" + _linkPage + "?job=" + id + "&cat=" + cat + "' style='text-decoration:none'>" + cat + "</a></h3>";
_reportTextHTML += MakeHTMLTable(cat);
}
}
_reportTextHTML += "<p>For more information please see the <a href='" + _linkPage + "' style='text-decoration:none'>Z3 Nightly Webpage</a>.</p>";
}
_reportTextHTML += "</body>";
}
public void SendTo(List<string> to)
{
foreach (string receipient in to)
Sendmail.Send(receipient, "Z3 Alerts", ReportTextHTML, null, _images, true);
}
}
}
| {
"content_hash": "86b3fdead2b703307130cd3a6997f180",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 200,
"avg_line_length": 34.65384615384615,
"alnum_prop": 0.43573806881243066,
"repo_name": "dstaple/z3test",
"id": "a33f6e2d55b85846bfc70d2b182bd2f0136bbfe2",
"size": "4507",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "ClusterExperiment/AlertLibrary/Report.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "21980"
},
{
"name": "Batchfile",
"bytes": "4009"
},
{
"name": "C#",
"bytes": "758062"
},
{
"name": "C++",
"bytes": "9623"
},
{
"name": "CSS",
"bytes": "3966"
},
{
"name": "Python",
"bytes": "131312"
},
{
"name": "SMT",
"bytes": "6844416"
},
{
"name": "Shell",
"bytes": "2179"
}
],
"symlink_target": ""
} |
from __future__ import absolute_import
import flask
blueprint = flask.Blueprint(__name__, __name__)
| {
"content_hash": "1b90b8fb04b3f09be3d616768fb8bcc4",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 47,
"avg_line_length": 20.4,
"alnum_prop": 0.7058823529411765,
"repo_name": "Deepomatic/DIGITS",
"id": "66d0d3645ec72d087623f67f5192640743ced002",
"size": "171",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "digits/model/images/views.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "4325"
},
{
"name": "HTML",
"bytes": "307884"
},
{
"name": "JavaScript",
"bytes": "52712"
},
{
"name": "Lua",
"bytes": "110641"
},
{
"name": "Makefile",
"bytes": "113"
},
{
"name": "Protocol Buffer",
"bytes": "384"
},
{
"name": "Python",
"bytes": "968806"
},
{
"name": "Shell",
"bytes": "13323"
}
],
"symlink_target": ""
} |
package com.amitcodes.conman.config;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
public class SimpleYamlParser<T>
{
final Class<T> typeParameterClass;
public SimpleYamlParser(Class<T> typeParameterClass)
{
this.typeParameterClass = typeParameterClass;
}
public T parse(InputStream in)
{
T pojo;
try{
ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
pojo = mapper.readValue(in, typeParameterClass);
} catch (Exception e) {
throw new ConfigurationException("YAML parsing failed!", e);
}
return pojo;
}
public T parse(File yamlFile)
{
T pojo;
try(InputStream fileReader = new FileInputStream(yamlFile)){
pojo = parse(fileReader);
} catch (IOException e) {
throw new ConfigurationException("YAML file access failed!", e);
}
return pojo;
}
public T parse(String path)
{
return parse(new File(path));
}
}
| {
"content_hash": "862b8f67226514d6c7391ef7c7010736",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 76,
"avg_line_length": 24.04,
"alnum_prop": 0.6405990016638935,
"repo_name": "sharmaak/conman",
"id": "2e489f51aabd9a8141db9c0a758209a910e85b0f",
"size": "1202",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/amitcodes/conman/config/SimpleYamlParser.java",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "18880"
}
],
"symlink_target": ""
} |
package godo
import (
"context"
"net/http"
)
// AccountService is an interface for interfacing with the Account
// endpoints of the DigitalOcean API
// See: https://docs.digitalocean.com/reference/api/api-reference/#tag/Account
type AccountService interface {
Get(context.Context) (*Account, *Response, error)
}
// AccountServiceOp handles communication with the Account related methods of
// the DigitalOcean API.
type AccountServiceOp struct {
client *Client
}
var _ AccountService = &AccountServiceOp{}
// Account represents a DigitalOcean Account
type Account struct {
DropletLimit int `json:"droplet_limit,omitempty"`
FloatingIPLimit int `json:"floating_ip_limit,omitempty"`
VolumeLimit int `json:"volume_limit,omitempty"`
Email string `json:"email,omitempty"`
UUID string `json:"uuid,omitempty"`
EmailVerified bool `json:"email_verified,omitempty"`
Status string `json:"status,omitempty"`
StatusMessage string `json:"status_message,omitempty"`
}
type accountRoot struct {
Account *Account `json:"account"`
}
func (r Account) String() string {
return Stringify(r)
}
// Get DigitalOcean account info
func (s *AccountServiceOp) Get(ctx context.Context) (*Account, *Response, error) {
path := "v2/account"
req, err := s.client.NewRequest(ctx, http.MethodGet, path, nil)
if err != nil {
return nil, nil, err
}
root := new(accountRoot)
resp, err := s.client.Do(ctx, req, root)
if err != nil {
return nil, resp, err
}
return root.Account, resp, err
}
| {
"content_hash": "e22575a56d3bc510c5e6636f567b802e",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 82,
"avg_line_length": 25.683333333333334,
"alnum_prop": 0.7105775470473719,
"repo_name": "jacksontj/promxy",
"id": "a6691e84aa06e2cc25f24a77eeb28b1e4c361398",
"size": "1541",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "vendor/github.com/digitalocean/godo/account.go",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "840"
},
{
"name": "Go",
"bytes": "278956"
},
{
"name": "Makefile",
"bytes": "1055"
},
{
"name": "Mustache",
"bytes": "2143"
},
{
"name": "Shell",
"bytes": "975"
}
],
"symlink_target": ""
} |
<?php
class BannerController extends AbBackController
{
const UPLOAD_DIR = '/content/upload/banner';
const BANNER_LIMIT = 10;
public function init()
{
$this->attachBehavior('media', new AbMediaBehavior());
parent::init();
}
public function actionIndex()
{
$this->pageTitle = Yii::app()->name . ' - Daftar Banner';
$criteria = new CDbCriteria(array(
'select'=>'*',
'condition'=>'type='.LinkModel::LINK_TYPE_BANNER,
'order'=>'link_id DESC, target'
));
$page = 'LinkModel_page';
$view = $this->generateData('LinkModel', $_GET[$page], self::BANNER_LIMIT, $criteria);
$this->render('list', $view);
}
public function actionAdd()
{
$this->pageTitle = Yii::app()->name . ' - Tambah Banner';
$model = new LinkModel;
if ( isset( $_POST['LinkModel'] ) ) {
$model->type = LinkModel::LINK_TYPE_BANNER;
$model->desc = serialize(array(
'text'=>$_POST['text'],
'width'=>$_POST['width'],
'height'=>$_POST['height']
));
$model->target = $_POST['position'];
$image_url = 'http://'.str_replace('http://', '', $_POST['LinkModel']['image_url']);
$model->image_url = $image_url;
$model->created = new CDbExpression('NOW()');
$banner = CUploadedFile::getInstance($model, 'url');
if ( $banner ) {
$pinfo = pathinfo($banner->name);
$filename = $this->getFileName($_POST['filename'], $pinfo['extension']);
$destination = dirname(dirname(Yii::app()->basePath)) . self::UPLOAD_DIR . "/$filename";
$filepath = self::UPLOAD_DIR . "/$filename";
$model->name = $filename;
$model->content_type = $banner->type;
$model->url = $filepath;
$imgsize = getimagesize($banner->tempName);
$model->width = $imgsize[0];
if ( $model->save() ) {
$banner->saveAs( $destination );
try {
$width = $this->getWidth($_POST['position']);
$dim = $this->getDimensions($destination, $banner->type);
if (is_array($dim)) {
$new_width = (int)$dim['w'];
$new_height = (int)$dim['h'];
$height = ($new_height * $width) / $new_width;
if ($width>50 && $height>50) {
$this->createThumbnail($destination, $width, ceil($height), false);
}
}
} catch (Exception $e) {}
Yii::app()->user->setFlash( 'success', "Banner '$filename' berhasil ditambahkan" );
$this->redirect('index.php');
}
} else {
Yii::app()->user->setFlash( 'error', "Banner belum dipilih" );
}
}
$position = LinkModel::getListPosition();
$this->render('form', array(
'model' => $model,
'title' => 'Tambah',
'positionList' => $position,
));
}
public function actionEdit()
{
$id = $_GET['id'];
$this->pageTitle = Yii::app()->name . ' - Edit Banner';
$model = LinkModel::model()->findByPk( $id );
if ( !( $model instanceof LinkModel ) ) {
Yii::app()->user->setFlash( 'error', "<strong>Error</strong> Banner yang Anda cari tidak ditemukan" );
$this->redirect( 'index.php' );
}
if ( isset($_POST['LinkModel']) ) {
$banner = CUploadedFile::getInstance($model, 'url');
if ( $banner ) {
$pinfo = pathinfo($banner->name);
$filename = $this->getFileName($_POST['filename'], $pinfo['extension']);
$destination = dirname(dirname(Yii::app()->basePath)).self::UPLOAD_DIR."/$filename";
$filepath = self::UPLOAD_DIR . "/$filename";
} else {
$pinfo = pathinfo($model->url);
$filename = $this->getFileName($_POST['filename'], $pinfo['extension']);
}
$old_name = $model->name;
$model->name = $filename;
$model->desc = serialize(array(
'text' => $_POST['text'],
'width'=>$_POST['width'],
'height'=>$_POST['height'],
'modified' => date('Y-m-d H:i:s')
));
$model->target = $_POST['position'];
$image_url = 'http://'.str_replace('http://', '', $_POST['LinkModel']['image_url']);
$model->image_url = $image_url;
if ($banner) {
$old_url = $model->url;
$model->url = $filepath;
$model->content_type = $banner->type;
$imgsize = getimagesize($banner->tempName);
$model->width = $imgsize[0];
}
if ($old_name != $model->name) {
$dirpath = dirname(dirname(Yii::app()->basePath)).self::UPLOAD_DIR.'/';
@rename($dirpath.$old_name, $dirpath.$model->name);
$model->url = self::UPLOAD_DIR . "/$model->name";
}
if ( $model->save() ) {
if ( $banner ) {
$banner->saveAs($destination);
if ($old_url != $model->url) {
$oldfile = dirname(dirname(Yii::app()->basePath)).$old_url;
@unlink($oldfile);
}
}
Yii::app()->user->setFlash('success', "Banner '$filename' berhasil ditambahkan");
$this->redirect('index.php');
}
}
$text = $this->getText($model->desc);
$positionList = LinkModel::getListPosition();
$this->render('form', array(
'model' => $model,
'title' => 'Edit',
'position' => $model->target,
'positionList' => $positionList,
'text' => $text,
));
}
public function actionDelete()
{
$id = $_GET['id'];
$model = LinkModel::model()->findByPk( $id );
if ( !( $model instanceof LinkModel ) ) {
Yii::app()->user->setFlash( 'error', "<strong>Error</strong>. Banner yang ingin Anda delete tidak ada" );
} else {
if( $model->delete() ) {
Yii::app()->user->setFlash( 'success', "Banner $model->name berhasil didelete." );
// Delete Image
$filename = dirname(dirname(Yii::app()->basePath)) . self::UPLOAD_DIR . '/' . $model->name;
if ( file_exists( $filename ) ) {
@unlink( $filename );
}
}
}
$this->redirect( 'index.php' );
}
public function actionActivate()
{
$id = $_GET['id'];
$model = LinkModel::model()->findByPk( $id );
if ( !( $model instanceof LinkModel ) ) {
Yii::app()->user->setFlash( 'error', "<strong>Error</strong> Banner yang Anda cari tidak ditemukan" );
} else {
$statuses = array('Aktif', 'Non-aktif');
$status = $model->status;
$model->status = $status? 0: 1;
$model->save();
Yii::app()->user->setFlash( 'success', "Banner '{$model->name}' berhasil di {$statuses[$status]}kan" );
}
$this->redirect( 'index.php' );
}
public function getText($serial)
{
$array = @unserialize($serial);
if ( is_array($array) ) {
$result = $array["text"];
}
return $result;
}
public function getPosition($target)
{
$positions = LinkModel::getListPosition();
$result = $positions[$target];
return $result;
}
public function getWidth($target)
{
$widths = array(
1 => 655,
2 => 288,
3 => 655,
4 => 288
);
return $widths[$target];
}
}
| {
"content_hash": "1bc4d3532575d28a9d7560883769d829",
"timestamp": "",
"source": "github",
"line_count": 237,
"max_line_length": 108,
"avg_line_length": 27.666666666666668,
"alnum_prop": 0.5738904987036755,
"repo_name": "zmiftah/yiihippo",
"id": "0f732817acaa2be4b21335f1db218f7a3d10c143",
"size": "6557",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "system/protected/admin/controllers/BannerController.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "518861"
},
{
"name": "JavaScript",
"bytes": "313996"
},
{
"name": "PHP",
"bytes": "855204"
},
{
"name": "Ruby",
"bytes": "1384"
},
{
"name": "Shell",
"bytes": "380"
}
],
"symlink_target": ""
} |
Rails.application.config.assets.version = '1.0'
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
Rails.application.config.assets.precompile += %w( admin.js )
| {
"content_hash": "4ddd9cc1b38c3d834bf1f58ca8212b0a",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 93,
"avg_line_length": 47.2,
"alnum_prop": 0.7711864406779662,
"repo_name": "chadlwm/chad_blog",
"id": "3358189eb7e662b6fb496fa25d94110b02330b6c",
"size": "374",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "config/initializers/assets.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "42895"
},
{
"name": "CoffeeScript",
"bytes": "737"
},
{
"name": "HTML",
"bytes": "55065"
},
{
"name": "JavaScript",
"bytes": "427875"
},
{
"name": "Ruby",
"bytes": "79309"
}
],
"symlink_target": ""
} |
"""
WSGI config for passgame project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "passgame.settings")
application = get_wsgi_application()
| {
"content_hash": "e6c86e2494ba32f252b6e4cc10c08879",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 24.5625,
"alnum_prop": 0.7709923664122137,
"repo_name": "risingsunomi/oscruogames",
"id": "ff1c2ff33318fc7e208243e01e2eed43e0c0d9c7",
"size": "393",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "passgame/passgame/wsgi.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "5406"
},
{
"name": "JavaScript",
"bytes": "973"
},
{
"name": "Python",
"bytes": "14763"
}
],
"symlink_target": ""
} |
#pragma checksum "..\..\App.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "4DACA1E6D4E02490CF5BE8C85FA5A8F7"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
namespace Topifier {
/// <summary>
/// App
/// </summary>
public partial class App : System.Windows.Application {
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Uri resourceLocater = new System.Uri("/Topifier;component/app.xaml", System.UriKind.Relative);
#line 1 "..\..\App.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);
#line default
#line hidden
}
/// <summary>
/// Application Entry Point.
/// </summary>
[System.STAThreadAttribute()]
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
public static void Main() {
Topifier.App app = new Topifier.App();
app.InitializeComponent();
app.Run();
}
}
}
| {
"content_hash": "5e3cee9f275a20b47cfb4c28e9a09edc",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 113,
"avg_line_length": 32.5,
"alnum_prop": 0.6040485829959514,
"repo_name": "rictokyo/Topifier",
"id": "f6ec352e5e271dec0336126dd921cfe2ddb4f53e",
"size": "2472",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "WindowTopper/obj/Debug/App.g.i.cs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C#",
"bytes": "44663"
}
],
"symlink_target": ""
} |
FROM edxops/focal-common:latest
RUN apt-get update && apt-get install -y \
gettext \
lib32z1-dev \
libjpeg62-dev \
libxslt1-dev \
zlib1g-dev \
python3 \
python3-dev \
python3-venv \
python3-pip && \
pip3 install --upgrade pip setuptools && \
rm -rf /var/lib/apt/lists/*
COPY . /usr/local/src/xblock-sdk
WORKDIR /usr/local/src/xblock-sdk
ENV VIRTUAL_ENV=/venvs/xblock-sdk
RUN python3.8 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN pip install --upgrade pip && pip install -r /usr/local/src/xblock-sdk/requirements/dev.txt
RUN curl -sL https://deb.nodesource.com/setup_14.x -o /tmp/nodejs-setup && \
/bin/bash /tmp/nodejs-setup && \
rm /tmp/nodejs-setup && \
apt-get -y install nodejs && \
echo $PYTHONPATH && \
make install
EXPOSE 8000
ENTRYPOINT ["python", "manage.py"]
CMD ["runserver", "0.0.0.0:8000"]
| {
"content_hash": "312d1a89732518af27baf5029efed762",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 94,
"avg_line_length": 26.87878787878788,
"alnum_prop": 0.6550169109357384,
"repo_name": "edx/xblock-sdk",
"id": "2043a96c9578247ab0fb92a16bde2858d952c61c",
"size": "887",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Dockerfile",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "14419"
},
{
"name": "Dockerfile",
"bytes": "681"
},
{
"name": "HTML",
"bytes": "8010"
},
{
"name": "JavaScript",
"bytes": "237802"
},
{
"name": "Makefile",
"bytes": "2968"
},
{
"name": "Python",
"bytes": "146967"
}
],
"symlink_target": ""
} |
package com.facebook.buck.cli;
import com.facebook.buck.core.config.BuckConfig;
import com.facebook.buck.core.config.ConfigView;
import com.facebook.buck.core.util.immutables.BuckStyleImmutable;
import com.facebook.buck.util.Ansi;
import com.facebook.buck.util.AnsiEnvironmentChecking;
import java.util.Optional;
import org.immutables.value.Value;
@BuckStyleImmutable
@Value.Immutable(builder = false, copy = false)
public abstract class AbstractCliConfig implements ConfigView<BuckConfig> {
@Override
@Value.Parameter
public abstract BuckConfig getDelegate();
/**
* Create an Ansi object appropriate for the current output. First respect the user's preferences,
* if set. Next, respect any default provided by the caller. (This is used by buckd to tell the
* daemon about the client's terminal.) Finally, allow the Ansi class to autodetect whether the
* current output is a tty.
*
* @param defaultColor Default value provided by the caller (e.g. the client of buckd)
*/
@Value.Derived
public Ansi createAnsi(Optional<String> defaultColor) {
String color =
getDelegate().getValue("color", "ui").map(Optional::of).orElse(defaultColor).orElse("auto");
switch (color) {
case "false":
case "never":
return Ansi.withoutTty();
case "true":
case "always":
return Ansi.forceTty();
case "auto":
default:
return new Ansi(
AnsiEnvironmentChecking.environmentSupportsAnsiEscapes(
getDelegate().getPlatform(), getDelegate().getEnvironment()));
}
}
/** When printing out json representation of targets, what formatting should be applied */
@Value.Derived
public JsonAttributeFormat getJsonAttributeFormat() {
return getDelegate()
.getEnum("ui", "json_attribute_format", JsonAttributeFormat.class)
.orElse(JsonAttributeFormat.DEFAULT);
}
}
| {
"content_hash": "473355c67aed7eb3b736865443634633",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 100,
"avg_line_length": 34.6,
"alnum_prop": 0.7136100893326327,
"repo_name": "brettwooldridge/buck",
"id": "3befc1477c59241621a70c261b4f11bdda5faabf",
"size": "2508",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/com/facebook/buck/cli/AbstractCliConfig.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "1585"
},
{
"name": "Batchfile",
"bytes": "3875"
},
{
"name": "C",
"bytes": "280326"
},
{
"name": "C#",
"bytes": "237"
},
{
"name": "C++",
"bytes": "18771"
},
{
"name": "CSS",
"bytes": "56106"
},
{
"name": "D",
"bytes": "1017"
},
{
"name": "Dockerfile",
"bytes": "2081"
},
{
"name": "Go",
"bytes": "9822"
},
{
"name": "Groovy",
"bytes": "3362"
},
{
"name": "HTML",
"bytes": "10916"
},
{
"name": "Haskell",
"bytes": "1008"
},
{
"name": "IDL",
"bytes": "480"
},
{
"name": "Java",
"bytes": "28622919"
},
{
"name": "JavaScript",
"bytes": "938678"
},
{
"name": "Kotlin",
"bytes": "23444"
},
{
"name": "Lex",
"bytes": "7502"
},
{
"name": "MATLAB",
"bytes": "47"
},
{
"name": "Makefile",
"bytes": "1916"
},
{
"name": "OCaml",
"bytes": "4935"
},
{
"name": "Objective-C",
"bytes": "176943"
},
{
"name": "Objective-C++",
"bytes": "34"
},
{
"name": "PowerShell",
"bytes": "2244"
},
{
"name": "Python",
"bytes": "2069290"
},
{
"name": "Roff",
"bytes": "1207"
},
{
"name": "Rust",
"bytes": "5214"
},
{
"name": "Scala",
"bytes": "5082"
},
{
"name": "Shell",
"bytes": "76854"
},
{
"name": "Smalltalk",
"bytes": "194"
},
{
"name": "Swift",
"bytes": "11393"
},
{
"name": "Thrift",
"bytes": "47828"
},
{
"name": "Yacc",
"bytes": "323"
}
],
"symlink_target": ""
} |
'use strict'
//Modules for users
var modules = {
site: require('./modules/site'),
twitter: require('./modules/twitter')
};
var app = require('koa')();
var koaStatic = require('koa-static');
var koaHandlebars = require('koa-handlebars');
var sys = require('./config/init');
var router = require('./config/router')(modules);
app.use(router.routes());
app.use(koaHandlebars(sys.config.handlebars));
app.use(koaStatic('public', {defer: false}));
var socketio = require('./modules/socketioserver');
var server = socketio.run(app);
module.exports = server;
| {
"content_hash": "743cedc474aeeeb85cc10605633e235d",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 51,
"avg_line_length": 24.608695652173914,
"alnum_prop": 0.6890459363957597,
"repo_name": "wuyuMonogatari/twitterforward",
"id": "b95f697281ceefdfecaacf6bc802bdc062a4b825",
"size": "566",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "app/app.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Handlebars",
"bytes": "752"
},
{
"name": "JavaScript",
"bytes": "2395"
}
],
"symlink_target": ""
} |
cask "podpisuj" do
version "5.6.42"
sha256 "9ee3582502442b2e5da4e0841fa699e596bf946938ca45418aac9e763c882d62"
url "https://www.podpisuj.sk/staticweb/install/podpisuj-#{version}.dmg"
name "Podpisuj"
desc "Application for electronic signing and validation of signatures"
homepage "https://www.podpisuj.sk/"
livecheck do
url "https://www.podpisuj.sk/staticweb/install/"
regex(/href=.*?podpisuj[._-]v?(\d+(?:\.\d+)+)\.dmg/i)
end
app "Podpisuj.app"
zap trash: [
"~/.archimetes/signer",
"~/Library/Preferences/com.archimetes.podpisuj.desktopapp.Podpisuj.plist",
"~/Library/Saved Application State/com.archimetes.podpisuj.desktopapp.Podpisuj.savedState",
]
caveats do
license "https://www.podpisuj.sk/privacy"
end
end
| {
"content_hash": "66bae251d11496b37a0e336980d2a0f4",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 95,
"avg_line_length": 29.46153846153846,
"alnum_prop": 0.7140992167101827,
"repo_name": "tjnycum/homebrew-cask",
"id": "eb7d59907ed729c93755684e5799bbcb696bade4",
"size": "766",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Casks/podpisuj.rb",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Python",
"bytes": "3630"
},
{
"name": "Ruby",
"bytes": "3059535"
},
{
"name": "Shell",
"bytes": "32035"
}
],
"symlink_target": ""
} |
<?php
namespace OPNsense\ARPscanner;
use OPNsense\Base\BaseModel;
class ARPscanner extends BaseModel
{
public function test()
{
$command="/sbin/ifconfig -l -u";
exec($command, $output);
return $output;
}
}
| {
"content_hash": "2959edfdc00a114ba6465a65eeadd33b",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 40,
"avg_line_length": 14.529411764705882,
"alnum_prop": 0.6194331983805668,
"repo_name": "fabianfrz/plugins",
"id": "9448a28d73fa1a0803c73ad6a8470df9223e2609",
"size": "1649",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "net/arp-scan/src/opnsense/mvc/app/models/OPNsense/ARPscanner/ARPscanner.php",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "CSS",
"bytes": "1013615"
},
{
"name": "HTML",
"bytes": "32663"
},
{
"name": "JavaScript",
"bytes": "1104047"
},
{
"name": "Makefile",
"bytes": "29734"
},
{
"name": "Mathematica",
"bytes": "286"
},
{
"name": "PHP",
"bytes": "1523186"
},
{
"name": "Perl",
"bytes": "3686"
},
{
"name": "Python",
"bytes": "33405"
},
{
"name": "Ruby",
"bytes": "61798"
},
{
"name": "Shell",
"bytes": "37807"
},
{
"name": "SourcePawn",
"bytes": "625"
},
{
"name": "Volt",
"bytes": "627790"
}
],
"symlink_target": ""
} |
using System;
using System.Reflection;
namespace Karambit.Web
{
public class Middleware
{
#region Fields
private MethodInfo method;
private MiddlewareAttribute attribute;
#endregion
#region Methods
/// <summary>
/// Gets the attribute.
/// </summary>
/// <value>The attribute.</value>
public MiddlewareAttribute Attribute {
get {
return attribute;
}
}
/// <summary>
/// Gets the method.
/// </summary>
/// <value>The method.</value>
public MethodInfo Function {
get {
return method;
}
}
/// <summary>
/// Gets the assembly which the route resides in.
/// </summary>
/// <value>The assembly.</value>
public Assembly Assembly {
get {
return method.Module.Assembly;
}
}
#endregion
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="Middleware"/> class.
/// </summary>
/// <param name="attribute">The attribute.</param>
/// <param name="method">The method.</param>
public Middleware(MiddlewareAttribute attribute, MethodInfo method) {
this.attribute = attribute;
this.method = method;
}
#endregion
}
}
| {
"content_hash": "5acadc2879bac98f3cb040473e0238ea",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 77,
"avg_line_length": 25.70175438596491,
"alnum_prop": 0.5044368600682594,
"repo_name": "Karambyte/karambit",
"id": "656491f10fbe4e0cbe4eaa4944ffb9d7224fca81",
"size": "1467",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Karambit.Web/Middleware.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "152476"
}
],
"symlink_target": ""
} |
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.42000
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ControlKinectCenter.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.1.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0.5")]
public float CursorSmoothing {
get {
return ((float)(this["CursorSmoothing"]));
}
set {
this["CursorSmoothing"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("3.5")]
public float MouseSensitivity {
get {
return ((float)(this["MouseSensitivity"]));
}
set {
this["MouseSensitivity"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool DoClick {
get {
return ((bool)(this["DoClick"]));
}
set {
this["DoClick"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("1")]
public byte Programm {
get {
return ((byte)(this["Programm"]));
}
set {
this["Programm"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool Steering_Active {
get {
return ((bool)(this["Steering_Active"]));
}
set {
this["Steering_Active"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Color")]
public string ChoosenVisual {
get {
return ((string)(this["ChoosenVisual"]));
}
set {
this["ChoosenVisual"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool showSkeleton {
get {
return ((bool)(this["showSkeleton"]));
}
set {
this["showSkeleton"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool showAngles {
get {
return ((bool)(this["showAngles"]));
}
set {
this["showAngles"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string NotifyError {
get {
return ((string)(this["NotifyError"]));
}
set {
this["NotifyError"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string NotifyWarning {
get {
return ((string)(this["NotifyWarning"]));
}
set {
this["NotifyWarning"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string NotifyInfo {
get {
return ((string)(this["NotifyInfo"]));
}
set {
this["NotifyInfo"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string NotifySuccess {
get {
return ((string)(this["NotifySuccess"]));
}
set {
this["NotifySuccess"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool ShowToast {
get {
return ((bool)(this["ShowToast"]));
}
set {
this["ShowToast"] = value;
}
}
}
}
| {
"content_hash": "b5184a22d82125a086114f1d2a741066",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 151,
"avg_line_length": 37.84615384615385,
"alnum_prop": 0.5362950058072009,
"repo_name": "tobi-the-fraggel/Mousenect---ModularMouse",
"id": "074e1b066f820bfbe29c8b7b315d4530f9723053",
"size": "6892",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/ControlKinectCenter/Properties/Settings.Designer.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "50898"
}
],
"symlink_target": ""
} |
$(function () {
$('.close-alert').click(function (e) {
$(e.target).parents('.alerte').fadeOut('fast', function () {
this.remove();
});
});
function readURL(input) {
}
$(".modifyPicHeader input").change(function(){
if (this.files && this.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('.page-header').fadeTo('slow',0.1, function(){
$(this).css('background-image', 'url(' + e.target.result + ')')
}).delay(500).fadeTo('slow', 1);
console.log(e.target.result);
}
reader.readAsDataURL(this.files[0]);
}
});
$(".galerryAddPic input").change(function(){
if (this.files && this.files[0]) {
$('.galleryPreview').empty()
for (var i = 0; i < this.files.length; i++) {
var reader = new FileReader();
reader.onload = function (e) {
var li=$('<li class="col-xs-6"></li>')
var img=$('<img alt="image de la galerie" src="'+e.target.result+'"/>')
li.append(img);
$('.galleryPreview').append(li)
console.log(e.target.result);
}
reader.readAsDataURL(this.files[i]);
this.files[i]
}
}
});
});
| {
"content_hash": "7f4c79b8fcfe0318b41ba6b3d18a3a98",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 91,
"avg_line_length": 29.9375,
"alnum_prop": 0.44328462073764785,
"repo_name": "TPCISIIE/SportsNet",
"id": "2ae300d23455d71ad4665176a62b0f3e3fa259e5",
"size": "1438",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "public/js/app.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "176"
},
{
"name": "CSS",
"bytes": "88521"
},
{
"name": "HTML",
"bytes": "38149"
},
{
"name": "JavaScript",
"bytes": "1438"
},
{
"name": "PHP",
"bytes": "72409"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.datacommons</groupId>
<artifactId>prep-buddy</artifactId>
<version>0.3.0</version>
<packaging>jar</packaging>
<name>prep-buddy - Data Preparation at Scale</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.7</java.version>
<scala.minor.version>2.10</scala.minor.version>
<scala.complete.version>${scala.minor.version}.4</scala.complete.version>
<spark.version>1.6.0</spark.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.2</version>
<configuration>
<scalaVersion>${scala.complete.version}</scalaVersion>
<scalaCompatVersion>${scala.minor.version}</scalaCompatVersion>
<javacArgs>
<javacArg>-source</javacArg>
<javacArg>${java.version}</javacArg>
<javacArg>-target</javacArg>
<javacArg>${java.version}</javacArg>
</javacArgs>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>scala-test-compile-first</id>
<phase>process-test-resources</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<compilerArgs>
<arg>-Xlint:all,-serial</arg>
</compilerArgs>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<!--enable surefire-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<testSourceDirectory>/src/test/scala/</testSourceDirectory>
<testSourceDirectory>/src/test/functionaltest/</testSourceDirectory>
</configuration>
</plugin>
<!-- enable scalastyle -->
<plugin>
<groupId>org.scalastyle</groupId>
<artifactId>scalastyle-maven-plugin</artifactId>
<version>0.8.0</version>
<configuration>
<verbose>false</verbose>
<failOnWarning>false</failOnWarning>
<failOnViolation>true</failOnViolation>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<sourceDirectory>${basedir}/src/main/scala</sourceDirectory>
<testSourceDirectory>${basedir}/src/test/scala</testSourceDirectory>
<configLocation>${basedir}/scalastyle-config.xml</configLocation>
<outputFile>${project.basedir}/scalastyle-output.xml</outputFile>
<outputEncoding>UTF-8</outputEncoding>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- enable scalatest -->
<plugin>
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
<version>1.0</version>
<configuration>
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
<junitxml>.</junitxml>
<filereports>WDF TestSuite.txt</filereports>
<argLine>-XX:MaxPermSize=256m -Xmx2g</argLine>
</configuration>
<executions>
<execution>
<id>test</id>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<skipIfEmpty>true</skipIfEmpty>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.9.1</version>
<executions>
<execution>
<id>add-scala-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/scala</source>
</sources>
</configuration>
</execution>
<execution>
<id>add-scala-test-sources</id>
<phase>generate-test-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>src/test/scala</source>
</sources>
</configuration>
</execution>
<execution>
<id>add-java-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/java</source>
</sources>
</configuration>
</execution>
<execution>
<id>add-java-test-sources</id>
<phase>generate-test-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>src/test/java</source>
</sources>
</configuration>
</execution>
<execution>
<id>add-functional-test-sources</id>
<phase>generate-test-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>src/test/functionaltest</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<id>functional-test</id>
<phase>test</phase>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<systemProperties>
<systemProperty>
<key>spark.master</key>
<value>local</value>
</systemProperty>
</systemProperties>
<mainClass>org.apache.datacommons.prepbuddy.functional.tests.specs.FunctionalTests</mainClass>
<classpathScope>test</classpathScope>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.4</version>
<inherited>false</inherited>
<dependencies>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-module-markdown</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>lt.velykis.maven.skins</groupId>
<artifactId>reflow-velocity-tools</artifactId>
<version>1.1.1</version>
</dependency>
<!-- Reflow skin requires Velocity >= 1.7 -->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.7</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-gitexe</artifactId>
<version>1.9.4</version>
</dependency>
</dependencies>
<configuration>
<mavenExecutorId>forked-path</mavenExecutorId>
<tagNameFormat>prep-buddy-@{project.version}</tagNameFormat>
<goals>deploy</goals>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<configuration>
<javadocVersion>${java.version}</javadocVersion>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.9.4</version>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
<version>3.4.1</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scalap</artifactId>
<version>${scala.complete.version}</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-compiler</artifactId>
<version>${scala.complete.version}</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_${scala.minor.version}</artifactId>
<version>${spark.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_${scala.minor.version}</artifactId>
<version>${spark.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-catalyst_${scala.minor.version}</artifactId>
<version>${spark.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-mllib_${scala.minor.version}</artifactId>
<version>${spark.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_${scala.minor.version}</artifactId>
<version>2.2.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
| {
"content_hash": "17439d9297a94355eb039f96d7d11fd0",
"timestamp": "",
"source": "github",
"line_count": 377,
"max_line_length": 114,
"avg_line_length": 41.856763925729446,
"alnum_prop": 0.44131812420785804,
"repo_name": "blpabhishek/prep-buddy",
"id": "3dadf3a4330bbd7932d3c74a3a80141dc0537ab5",
"size": "15780",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "45946"
},
{
"name": "Python",
"bytes": "50544"
},
{
"name": "Scala",
"bytes": "150377"
},
{
"name": "Shell",
"bytes": "556"
}
],
"symlink_target": ""
} |
"""
Extracting features from VTK input files.
Authors:
- Forrest Sheng Bao (forrest.bao@gmail.com) http://fsbao.net
Copyright 2012, Mindboggle team (http://mindboggle.info), Apache v2.0 License
For algorithmic details, please check:
Forrest S. Bao, et al., Automated extraction of nested sulcus features from human brain MRI data,
IEEE EMBC 2012, San Diego, CA
Dependencies:
python-vtk: vtk's official Python binding
numpy
Last updated on 2012-09-30:
1. Disable secondary surface input and the ability to output features onto a secondary surface.
2. If users want to visualize features on a secondary surface, check maps_to_second_surface.py in utils folder.
"""
import sys, getopt # this line imports pulic libraries
def print_help():
print "\n Usage: python vtk_extract.py [OPTIONS] InputVTK\n"
print " InputVTK"
print " The VTK file that contains a map on which features will be extracted (by default, a depth map)\n"
print " Options: "
print " --thick ThicknessFile"
print " the thickness file provided by FreeSurfer"
# print " --second SecondSurfaceFile"
# print " the 2nd surface to save feature(s) extracted, in FreeSurfer surface format"
print " --convex ConvexityFile"
print " the convexity file provided by FreeSurfer"
print " --fundi FundiVTK"
print " the VTK output file to save fundi, onto the same surface as VTKFile"
# print " --fundi2 Fundi2VTK"
# print " the VTK output file to save fundi, onto the second surface in SecondSurfaceFile"
print " --pits PitsVTK"
print " the VTK output file to save pits, onto the same surface as VTKFile"
# print " --pits2 Pits2VTK"
# print " the VTK output file to save pits, onto the second surface in SecondSurfaceFile"
print " --sulci SulciVTK"
print " the VTK output file to save sulci, onto the same surface as VTKFile"
# print " --sulci2 Sulci2VTK"
# print " the VTK output file to save sulci, onto the second surface in SecondSurfaceFile"
print " --sulciThld SulciThld"
print " SulciThld: the value to threshold the surface to get sulci (default = 0.2)"
print " --clouchoux [followed by no argument]"
print " whether extract pits using Clouchoux's definition"
print " --meancurv MeanCurvVTK"
print " the VTK input that contains a mean curvature map"
print " --gausscurv GaussCurvVTK"
print " the VTK input that contains a Gaussian curvature map"
print " Examples: "
print " python vtk_extract.py --thick lh.thickness --convex lh.sulc\
--fundi lh.pial.fundi.vtk --pits lh.pial.pits.vtk --sulci lh.pial.sulci.vtk\
--sulciThld 0.15 --clouchoux --meancurv lh.mean.curv.vtk --gausscurv lh.gauss.curv.vtk lh.depth.vtk\n"
def check_opt(opts, args):
'''Check whether opts and args satisfy constraints
'''
for o, p in opts:
if o in ('-h', "--help"):
print_help()
sys.exit()
## Check whether mandatory input is provided
if len(args)!=1:
print " [ERROR]Please give at least one input VTK file containing a per-vertex map"
print " Since we use getopt module to process options, please provide options ahead of arguments\n"
print " Please run [python vtk_extract.py -h] or [python vtk_extract.py --help] to get the usage."
sys.exit()
## Check whether second surface is provided
# Need2nd, Given2nd = False, False # A second surface is needed if options to save features into second surface are on.
Clouchoux, MeanCurvVTK, GaussCurvVTK = False, False, False
for o,p in opts:
if p == "" and not o in ['--clouchoux', '--help', '-h']:
print "[ERROR] The option",o, "is missing argument."
print " Please run [python vtk_extract.py -h] or [python vtk_extract.py --help] to get the usage."
sys.exit()
# elif o in ["--fundi2","--pits2","--sulci2"]:
# Need2nd = True # we will need the option --second and its parameter
# elif o=="--second":
# Given2nd = True
elif o == "--clouchoux":
Clouchoux = True
elif o == "--meancurv":
MeanCurvVTK = True
elif o == "gausscurv":
GaussCurvvTK = True
# if Need2nd and not Given2nd: # second surface is needed but not provided
# print "[ERROR] Second surface is needed but not provided. Please check usage and provide a second surface using --second option."
# sys.exit()
if Clouchoux and not (MeanCurvVTK or GaussCurvVTK):
print "[ERROR] Clouchoux type pits will be extracted but mean curvature map and/or Gaussian curvature map is not given."
sys.exit()
def process_opt(opts,args):
'''Give option parameters to variables that represent I/O file names.
Do this AFTER check_opt.
'''
InputColor = "\033[32m"
OutputColor = "\033[36m"
EndColor = "\033[0m"
ThickFile, ConvexFile = '', ''
FundiVTK, PitsVTK, SulciVTK = '','',''
# Fundi2VTK, Pits2VTK, Sulci2VTK = '','',''
SulciThld = 0.2
Clouchoux = False
MeanCurvVTK, GaussCurvVTK = "", ""
[VTKFile] = args
print " [Input] VTK mesh:" + InputColor + VTKFile + EndColor
for o,p in opts:
# if o=='--second':
# SurfFile2 = p
# print " [Input] second surface:" + InputColor + SurfFile2 + EndColor
if o=='--convex':
ConvexFile = p
print " [Input] convexity file:" + InputColor + ConvexFile + EndColor
elif o=='--thick':
ThickFile = p
print " [Input] thickness file:" + InputColor + ThickFile + EndColor
elif o == '--clouchoux':
print " [Settings] Will extract pits using Clouchoux's definition "
Clouchoux = True
elif o == "--meancurv":
MeanCurvVTK = p
print " [Input] mean curvature file:" + InputColor + MeanCurvVTK + EndColor
elif o == "--gausscurv":
GaussCurvVTK = p
print " [Input] Gaussian curvature file:" + InputColor + GaussCurvVTK + EndColor
elif o =='--sulciThld':
if p == '':
print " [ERROR] Please provide a threshold value for option --", o
print "To check usage, run: python extract.py"
sys.exit()
SulciThld = float(p)
print " [Settings] Threshold the surface using value:", SulciThld
elif o=='--fundi':
FundiVTK = p
print " [Output] Fundi in:" + OutputColor + FundiVTK + EndColor
elif o=='--pits':
PitsVTK = p
print " [Output] Pits in:" + OutputColor + PitsVTK + EndColor
elif o=='--sulci':
SulciVTK = p
print " [Output] Sulci in:" + OutputColor + SulciVTK + EndColor
# elif o=='--fundi2':
# Fundi2VTK = p
# print " [Output] Fundi on 2nd surface in:" + OutputColor + Fundi2VTK + EndColor
# elif o=='--pits2':
# Pits2VTK = p
# print " [Output] Pits on 2nd surface in:" + OutputColor + Pits2VTK + EndColor
# elif o=='--sulci2':
# Sulci2VTK = p
# print " [Output] Sulci on 2nd surface in:" + OutputColor + Sulci2VTK + EndColor
return VTKFile, ThickFile, ConvexFile, MeanCurvVTK, GaussCurvVTK,\
FundiVTK, PitsVTK, SulciVTK,\
SulciThld, Clouchoux
if __name__ == "__main__":
# this script extracts fundi/pits/sulci from a VTK file from the output from Joachim's code
import libfundi # this line imports my own library
try:
opts, args = getopt.getopt(sys.argv[1:],"h",
["clouchoux", "help","thick=", "convex=","fundi=","pits=","sulci=","sulciThld=","meancurv=", "gausscurv="])
except getopt.GetoptError, err:
print str(err) # will print something like "option -a not recognized"
print " Please run [python vtk_extract.py -h] or [python vtk_extract.py --help] to get the usage."
print "If you use options like --second, --pits2, --fundi2, --sulci2,",
"please note that we have disabled mapping features onto secondary surface.",
"Please check maps_to_second_surface.py under utils directory to do so."
sys.exit(2)
check_opt(opts, args)
InputArguments = process_opt(opts, args)
libfundi.getFeatures(InputArguments, 'vtk','') | {
"content_hash": "855494fac37635476adc02d9cd7661e7",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 142,
"avg_line_length": 43.34517766497462,
"alnum_prop": 0.6130694460709685,
"repo_name": "binarybottle/mindboggle_sidelined",
"id": "8088ed76c5e1244cf1ea6c8adf169183c9eb5952",
"size": "8557",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "fundi_from_pits/vtk_extract.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "7610"
},
{
"name": "C++",
"bytes": "541776"
},
{
"name": "Erlang",
"bytes": "5696"
},
{
"name": "M",
"bytes": "1044"
},
{
"name": "Makefile",
"bytes": "2217"
},
{
"name": "Matlab",
"bytes": "34378"
},
{
"name": "Python",
"bytes": "256195"
},
{
"name": "Ruby",
"bytes": "793"
},
{
"name": "Shell",
"bytes": "1736"
},
{
"name": "SuperCollider",
"bytes": "1038086"
},
{
"name": "TeX",
"bytes": "248899"
}
],
"symlink_target": ""
} |
package org.ajoberstar.gradle.defaults;
import java.net.URI;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.plugins.JavaPluginExtension;
import org.gradle.api.publish.PublishingExtension;
import org.gradle.api.publish.VariantVersionMappingStrategy;
import org.gradle.api.publish.maven.MavenPublication;
import org.gradle.plugins.signing.SigningExtension;
public class MavenCentralConventionPlugin implements Plugin<Project> {
@Override
public void apply(Project project) {
var extension = project.getExtensions().create("mavenCentral", MavenCentralExtension.class);
// publishing
project.getPluginManager().apply("maven-publish");
var publishing = project.getExtensions().getByType(PublishingExtension.class);
configureRepositories(project, publishing);
configurePom(project, publishing, extension);
// signing
project.getPluginManager().apply("signing");
var signing = project.getExtensions().getByType(SigningExtension.class);
enableSigning(project, signing, publishing);
// sources/javadoc
project.getPluginManager().withPlugin("java", plugin -> {
var java = project.getExtensions().getByType(JavaPluginExtension.class);
java.withJavadocJar();
java.withSourcesJar();
});
}
private void configureRepositories(Project project, PublishingExtension publishing) {
publishing.repositories(repos -> {
repos.maven(repo -> {
repo.setName("CentralReleases");
repo.setUrl(URI.create("https://oss.sonatype.org/service/local/staging/deploy/maven2/"));
repo.credentials(creds -> {
var username = project.getProviders().environmentVariable("OSSRH_USERNAME")
.forUseAtConfigurationTime();
var password = project.getProviders().environmentVariable("OSSRH_PASSWORD")
.forUseAtConfigurationTime();
creds.setUsername(username.getOrNull());
creds.setPassword(password.getOrNull());
});
});
});
}
private void configurePom(Project project, PublishingExtension publishing, MavenCentralExtension extension) {
publishing.getPublications().withType(MavenPublication.class, publication -> {
project.getPluginManager().withPlugin("java-base", plugin -> {
publication.versionMapping(mapping -> {
mapping.usage("java-api", variant -> {
variant.fromResolutionOf("runtimeClasspath");
});
mapping.usage("java-runtime", VariantVersionMappingStrategy::fromResolutionResult);
});
});
publication.pom(pom -> {
pom.getName().set(project.provider(project::getName));
pom.getDescription().set(project.provider(project::getDescription));
pom.getUrl().set(extension.mapGitHubUrl("https://github.com/%s/%s"));
pom.developers(devs -> {
devs.developer(dev -> {
dev.getName().set(extension.getDeveloperName());
dev.getEmail().set(extension.getDeveloperEmail());
});
});
pom.licenses(licenses -> {
licenses.license(license -> {
license.getName().set("The Apache Software License, Version 2.0");
license.getUrl().set("http://www.apache.org/licenses/LICENSE-2.0");
});
});
pom.scm(scm -> {
scm.getUrl().set(extension.mapGitHubUrl("https://github.com/%s/%s"));
scm.getConnection().set(extension.mapGitHubUrl("scm:git:git@github.com:%s/%s.git"));
scm.getDeveloperConnection().set(extension.mapGitHubUrl("scm:git:ssh:git@github.com:%s/%s.git"));
});
});
});
}
private void enableSigning(Project project, SigningExtension signing, PublishingExtension publishing) {
var isCi = project.getProviders().environmentVariable("CI")
.forUseAtConfigurationTime();
var signingKey = project.getProviders().gradleProperty("signingKey")
.forUseAtConfigurationTime();
var signingPassphrase = project.getProviders().gradleProperty("signingPassphrase")
.forUseAtConfigurationTime();
signing.setRequired(isCi.getOrNull());
signing.useInMemoryPgpKeys(signingKey.getOrNull(), signingPassphrase.getOrNull());
signing.sign(publishing.getPublications());
}
}
| {
"content_hash": "9e440fe5d396f3131aeaba099ce98807",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 111,
"avg_line_length": 40.320754716981135,
"alnum_prop": 0.684370613008891,
"repo_name": "ajoberstar/gradle-defaults",
"id": "f290d2a1cb7c305d769d75d369ea310c92d89070",
"size": "4274",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "src/main/java/org/ajoberstar/gradle/defaults/MavenCentralConventionPlugin.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "9098"
},
{
"name": "Kotlin",
"bytes": "4726"
}
],
"symlink_target": ""
} |
import logging
import os
import re
import subprocess
import zlib
from optparse import OptionParser
from urllib2 import HTTPError
from urllib2 import urlopen
from urlparse import urlparse
from xml.dom.minidom import parseString
logger = logging.getLogger(__name__)
class Settings(object):
supported_distros = ('centos', 'ubuntu')
supported_releases = ('2014.2-6.1')
updates_destinations = {
'centos': r'/var/www/nailgun/{0}/centos/updates',
'ubuntu': r'/var/www/nailgun/{0}/ubuntu/updates'
}
class UpdatePackagesException(Exception):
pass
def exec_cmd(cmd):
logger.debug('Execute command "%s"', cmd)
child = subprocess.Popen(
cmd, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
shell=True)
logger.debug('Stdout and stderr of command "%s":', cmd)
for line in child.stdout:
logger.debug(line.rstrip())
return _wait_and_check_exit_code(cmd, child)
def _wait_and_check_exit_code(cmd, child):
child.wait()
exit_code = child.returncode
logger.debug('Command "%s" was executed', cmd)
return exit_code
def get_repository_packages(remote_repo_url, distro):
repo_url = urlparse(remote_repo_url)
packages = []
if distro in ('ubuntu',):
packages_url = '{0}/Packages'.format(repo_url.geturl())
pkgs_raw = urlopen(packages_url).read()
for pkg in pkgs_raw.split('\n'):
match = re.search(r'^Package: (\S+)\s*$', pkg)
if match:
packages.append(match.group(1))
elif distro in ('centos',):
packages_url = '{0}/repodata/primary.xml.gz'.format(repo_url.geturl())
pkgs_xml = parseString(zlib.decompressobj(zlib.MAX_WBITS | 32).
decompress(urlopen(packages_url).read()))
for pkg in pkgs_xml.getElementsByTagName('package'):
packages.append(
pkg.getElementsByTagName('name')[0].firstChild.nodeValue)
return packages
def mirror_remote_repository(remote_repo_url, local_repo_path):
repo_url = urlparse(remote_repo_url)
cut_dirs = len(repo_url.path.strip('/').split('/'))
download_cmd = ('wget --recursive --no-parent --no-verbose --reject "index'
'.html*,*.gif,*.key,*.gpg" --exclude-directories "{pwd}/re'
'pocache" --directory-prefix {path} -nH --cut-dirs={cutd} '
'{url}').format(pwd=repo_url.path.rstrip('/'),
path=local_repo_path,
cutd=cut_dirs,
url=repo_url.geturl())
if exec_cmd(download_cmd) != 0:
raise UpdatePackagesException('Mirroring of remote packages'
' repository failed!')
def main():
settings = Settings()
sh = logging.StreamHandler()
formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
sh.setFormatter(formatter)
logger.addHandler(sh)
logger.setLevel(logging.INFO)
parser = OptionParser(
description="Pull updates for a given release of Fuel based on "
"the provided URL."
)
parser.add_option('-d', '--distro', dest='distro', default=None,
help='Linux distribution name (required)')
parser.add_option('-r', '--release', dest='release', default=None,
help='Fuel release name (required)')
parser.add_option("-u", "--url", dest="url", default="",
help="Remote repository URL (required)")
parser.add_option("-v", "--verbose",
action="store_true", dest="verbose", default=False,
help="Enable debug output")
(options, args) = parser.parse_args()
if options.verbose:
logger.setLevel(logging.DEBUG)
if options.distro not in settings.supported_distros:
raise UpdatePackagesException(
'Linux distro "{0}" is not supported. Please specify one of the '
'following: "{1}". See help (--help) for details.'.format(
options.distro, ', '.join(settings.supported_distros)))
if options.release not in settings.supported_releases:
raise UpdatePackagesException(
'Fuel release "{0}" is not supported. Please specify one of the '
'following: "{1}". See help (--help) for details.'.format(
options.release, ', '.join(settings.supported_releases)))
if 'http' not in urlparse(options.url):
raise UpdatePackagesException(
'Repository url "{0}" does not look like valid URL. '
'See help (--help) for details.'.format(options.url))
updates_path = settings.updates_destinations[options.distro].format(
options.release)
if not os.path.exists(updates_path):
os.makedirs(updates_path)
logger.info('Checking remote repository...')
try:
pkgs = get_repository_packages(options.url, options.distro)
except HTTPError as e:
if e.code == 404:
raise UpdatePackagesException(
'Remote repository does not contain packages'
' metadata ({0})!'.format(options.distro))
else:
raise
if len(pkgs) < 1:
raise UpdatePackagesException('Remote "{0}" repository does not '
'contain any packages.')
logger.debug('Remote repository contains next packages: {0}'.format(pkgs))
logger.info('Started mirroring remote repository...')
mirror_remote_repository(options.url, updates_path)
logger.info('Remote repository "{url}" for "{release}" ({distro}) was '
'successfuly mirrored to {path} folder.'.format(
url=options.url,
release=options.release,
distro=options.distro,
path=updates_path))
if __name__ == '__main__':
main()
| {
"content_hash": "dc217ca5b40a54753d5a32b046ffc0cb",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 79,
"avg_line_length": 37.1125,
"alnum_prop": 0.5946446615021893,
"repo_name": "artem-panchenko/fuel-updates",
"id": "6bbb09399af12973f203e06cfe0dab224ca66d09",
"size": "6549",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "fuel-package-updates.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "6549"
}
],
"symlink_target": ""
} |
package org.bndtools.api;
public interface IBndProject {
String getProjectName();
void addResource(String fullPath, BndProjectResource bndProjectResource);
}
| {
"content_hash": "fa608455e506358f7cd198cac36b4eb8",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 74,
"avg_line_length": 23.142857142857142,
"alnum_prop": 0.8148148148148148,
"repo_name": "psoreide/bnd",
"id": "7e06f7e1581d3c0bdb993853cf4c4d11b9758626",
"size": "162",
"binary": false,
"copies": "8",
"ref": "refs/heads/master",
"path": "bndtools.api/src/org/bndtools/api/IBndProject.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "5971"
},
{
"name": "Groovy",
"bytes": "137212"
},
{
"name": "HTML",
"bytes": "20589"
},
{
"name": "Java",
"bytes": "4890082"
},
{
"name": "Shell",
"bytes": "13535"
},
{
"name": "XSLT",
"bytes": "24433"
}
],
"symlink_target": ""
} |
(function () {
var INT_MAX = Number.MAX_VALUE;
var GROUP_JSON_PATH = "group.json";
cc.LoaderLayer = cc.Layer.extend({
_backgroundSprite: null,
_progressBackgroundSprite: null,
_progressBarSprite: null,
_logoSprite: null,
_titleSprite: null,
_groupname: null,
_callback: null,
_selector: null,
_preloadCount: 0,
_isPreloadFromFailed: false,
_progressOriginalWidth: 0,
_isLandScape: false,
_scaleFactor: null,
ctor: function (config) {
this._super();
if (config) {
cc.LoaderLayer.setConfig(config);
}
},
onEnter: function () {
this._super();
this.initView();
var config = cc.LoaderLayer._finalConfig;
if (config.onEnter) {
config.onEnter(this);
}
},
onExit: function () {
this._super();
var config = cc.LoaderLayer._finalConfig;
if (config.logo.action) {
config.logo.action.release();
}
if(config.title.action){
config.title.action.release();
}
if (config.onExit) {
config.onExit(this);
}
},
initView: function () {
var config = cc.LoaderLayer._finalConfig;
this._contentLayer = new cc.Layer();
this._isLandScape = cc.winSize.width > cc.winSize.height;
this._scaleFactor = !cc.LoaderLayer._useDefaultSource ? 1 : cc.winSize.width > cc.winSize.height ? cc.winSize.width / 720 : cc.winSize.width / 480;
//background
this.backgroundSprite = new cc.Sprite(config.background.res);
this.addChild(this.backgroundSprite);
this.backgroundSprite.x = 0, this.backgroundSprite.y = 0, this.backgroundSprite.anchorX = 0, this.backgroundSprite.anchorY = 0;
if (cc.LoaderLayer._useDefaultSource) {
this.backgroundSprite.scaleX = cc.winSize.width / this.backgroundSprite.width;
this.backgroundSprite.scaleY = cc.winSize.height / this.backgroundSprite.height;
}
//title
if (config.title.show) {
this.titleSprite = new cc.Sprite(config.title.res);
var defaultTitlePosition = cc.pAdd(cc.visibleRect.center, cc.p(0, this._scaleFactor < 1 ? 0 : this._isLandScape ? -80 : 30));
this.titleSprite.setPosition(config.title.position ? config.title.position : defaultTitlePosition);
this._contentLayer.addChild(this.titleSprite);
if (config.title.action) {
this.titleSprite.runAction(config.title.action);
}
}
//logo
if (config.logo.show) {
this.logoSprite = new cc.Sprite(config.logo.res);
var defaultLogoPosition = cc.pAdd(cc.visibleRect.top, cc.p(0, this._scaleFactor < 1 ? 0 : -this.logoSprite.height / 2 - (this._isLandScape ? 56 : 76)));
this.logoSprite.setPosition(config.logo.position ? config.logo.position : defaultLogoPosition);
this._contentLayer.addChild(this.logoSprite);
if (config.logo.action) {
this.logoSprite.runAction(config.logo.action);
}
}
//progressbar
if (config.progressBar.show) {
this.progressBarSprite = new cc.Sprite(config.progressBar.res);
this._progressOriginalWidth = this.progressBarSprite.width;
this.progressBackgroundSprite = new cc.Sprite(config.progressBar.barBackgroundRes);
this.progressBarSprite.anchorX = 0;
this.progressBarSprite.anchorY = 0;
if (cc.LoaderLayer._isDefaultProgress) {
this._barPoint = new cc.Sprite(config.progressBar.barPoint);
this.progressBarSprite.addChild(this._barPoint);
}
if (config.progressBar.barBackgroundRes == null) {
this.progressBackgroundSprite.setTextureRect(cc.rect(0, 0, this.progressBarSprite.width, this.progressBarSprite.height));
}
if (config.progressBar.offset == null) {
var deltaProgressWithX = (this.progressBackgroundSprite.width - this.progressBarSprite.width) / 2;
var deltaProgressWithY = (this.progressBackgroundSprite.height - this.progressBarSprite.height) / 2;
config.progressBar.offset = cc.p(deltaProgressWithX, deltaProgressWithY);
}
this.progressBarSprite.setPosition(config.progressBar.offset);
this.progressBackgroundSprite.addChild(this.progressBarSprite);
var defaultProgressPosition = cc.pAdd(cc.visibleRect.bottom, cc.p(0, this.progressBarSprite.height / 2 + this._isLandScape ? 60 : 80));
this.progressBackgroundSprite.setPosition(config.progressBar.position ? config.progressBar.position : defaultProgressPosition);
this._contentLayer.addChild(this.progressBackgroundSprite);
this._setProgress(0);
}
//tips
if (config.tips.show) {
this.tipsLabel = new cc.LabelTTF("100%", "Arial", config.tips.fontSize);
this.tipsLabel.setColor(config.tips.color ? config.tips.color : cc.color(255, 255, 255));
this.tipsLabel.setPosition(config.tips.position ? config.tips.position : this.progressBackgroundSprite ? cc.p(this.progressBackgroundSprite.x, this.progressBackgroundSprite.y + this.progressBackgroundSprite.height / 2 + 20) : cc.pAdd(cc.visibleRect.bottom, cc.p(0, 100)));
this._contentLayer.addChild(this.tipsLabel);
}
this.addChild(this._contentLayer);
if (this._scaleFactor < 1) {
this._contentLayer.setScale(this._scaleFactor);
this._contentLayer.setPosition(cc.pAdd(this._contentLayer.getPosition(), cc.p(0, -50)));
}
},
_setProgress: function (percent) {
if (this.progressBarSprite) {
percent < 1 ? percent : 1;
var width = percent * this._progressOriginalWidth;
this.progressBarSprite.setTextureRect(cc.rect(0, 0, width, this.progressBarSprite.height));
if (cc.LoaderLayer._isDefaultProgress) {
this._barPoint.setPosition(cc.p(this.progressBarSprite.width, this.progressBarSprite.height / 2));
}
}
},
setTipsString: function (str) {
if (this.tipsLabel != null) {
this.tipsLabel.setString(str);
}
},
getProgressBar: function () {
return this.progressBarSprite;
},
getTipsLabel: function () {
return this.tipsLabel;
},
getLogoSprite: function () {
return this.logoSprite;
},
getTitleSprite: function () {
return this.titleSprite;
},
updateGroup: function (groupname, callback, target) {
this._groupname = groupname;
this._callback = callback;
this._selector = target;
},
_resetLoadingLabel: function () {
this.setTipsString("");
this._setProgress(0);
},
_preloadSource: function () {
cc.log("cc.LoaderLayer is preloading resource group: " + this._groupname);
this._resetLoadingLabel();
if (cc.sys.isNative) {
cc.Loader.preload(this._groupname, this._preload_native, this);
} else {
this._preload_html5();
}
},
_preload_html5: function () {
var res = "";
var groupIndex = [];
var config = cc.LoaderLayer._finalConfig;
var groups = cc.LoaderLayer.groups;
if (cc.isString(this._groupname)) {
if (this._groupname.indexOf(".") != -1) {
res = [this._groupname];
} else {
res = groups[this._groupname];
}
} else if (cc.isArray(this._groupname)) {
res = [];
for (var i = 0; i < this._groupname.length; i++) {
var group = groups[this._groupname[i]];
var files = group && group.files;
var preCount = i > 0 ? groupIndex[i - 1] : 0;
groupIndex.push(preCount + files ? files.length : 0);
res = res.concat(files);
}
}
var self = this;
//var progressFunction = self.config.progressCallback ? self.config.progressCallback : null;
cc.loader.load(res, function (result, count, loadedCount) {
var checkGroupName = function (loadedCount) {
for (var i = 0; i < groupIndex.length; i++) {
if (groupIndex[i] >= loadedCount) {
return self._groupname[i];
}
}
};
var groupName = checkGroupName(loadedCount);
var status = {
groupName: groupName,
isCompleted: false,
percent: (loadedCount / count * 100) | 0,//(float),
stage: 1, //(1 download,2 unzip)
isFailed: false
}
if (status.percent != 0) {
self._setProgress(status.percent / 100);
}
config.tips.tipsProgress(status, self);
}, function () {
self.removeFromParent();
self._preloadCount--;
if (self._callback) {
if (self._selector) {
self._callback(self._selector, true);
} else {
self._callback(true);
}
}
self._callback.call(this._target, !status.isFailed);
});
},
_preload_native: function (status) {
cc.log(JSON.stringify(status));
var config = cc.LoaderLayer._finalConfig;
if (status.percent) {
this._setProgress(status.percent / 100);
}
if (config.tips.tipsProgress) {
config.tips.tipsProgress(status, this);
}
if (status.isCompleted || status.isFailed) {
this._preloadCount--;
if (status.isCompleted) {
cc.log("preload finish!");
this._isPreloadFromFailed = false;
}
if (status.isFailed) {
cc.log("preload failed!");
this._isPreloadFromFailed = true;
}
// Remove loading layer from scene after loading was done.
if (this._preloadCount == 0 && !this._isPreloadFromFailed) {
this.removeFromParent();
if (cc.LoaderLayer._useDefaultSource) {
var _config = cc.runtime.config.design_resolution || {width: 480, height: 720, policy: "SHOW_ALL"};
cc.view.setDesignResolutionSize(_config.width, _config.height, cc.ResolutionPolicy[_config.policy]);
}
}
// Callback must be invoked after removeFromParent.
this._callback.call(this._target, status);
}
},
_addToScene: function () {
if (this._preloadCount == 0 && !this._isPreloadFromFailed) {
if (cc.sys.isNative && cc.LoaderLayer._useDefaultSource) {
var config = cc.runtime.config.design_resolution;
var isLandscape = false;
var isLargeThanResource = false;
if (config) {
var orientation = cc.runtime.config.orientation;
cc.log("_addToScene orientation is " + orientation);
if (orientation == "landscape") {
isLandscape = true;
isLargeThanResource = config.width > 720 || config.height > 480;
} else {
isLargeThanResource = config.width > 480 || config.height > 720;
}
}
cc.log("isLargeThanResource is " + isLargeThanResource);
cc.view.setDesignResolutionSize(isLargeThanResource ? config.width : isLandscape ? 720 : 480, isLargeThanResource ? config.height : isLandscape ? 480 : 720, cc.ResolutionPolicy["FIXED_HEIGHT"]);
}
cc.director.getRunningScene().addChild(this, INT_MAX - 1);
}
this._preloadCount++;
}
});
cc.LoaderLayer._config = {//default setting for loaderlayer
background: {
res: "res_engine/preload_bg.jpg"
},
title: {
show: true,
res: "res_engine/preload_title.png",
position: null,
action: null
},
logo: {
res: "res_engine/preload_logo.png",
show: true,
position: null
},
progressBar: {
show: true,
res: "res_engine/progress_bar.png",
offset: null,
position: null,
barBackgroundRes: "res_engine/progress_bg.png",
barPoint: "res_engine/progress_light.png",
barShadow: "res_engine/shadow.png"
},
tips: {
show: true,
fontSize: 22,
position: null,
color: null,
tipsProgress: function (status, loaderlayer) {
if(loaderlayer.getTipsLabel()){
var statusStr = "正在";
if (status.stage == cc.network.preloadstatus.DOWNLOAD) {
statusStr += "下载";
} else if (status.stage == cc.network.preloadstatus.UNZIP) {
statusStr += "解压";
}
if (status.groupName) {
statusStr += status.groupName;
}
statusStr += "进度:" + status.percent.toFixed(2) + "%";
loaderlayer.getTipsLabel().setString(statusStr);
}
}
},
progressCallback: function (progress) {
},
onEnter: function (layer) {
cc.log("LoaderLayer onEnter");
},
onExit: function (layer) {
cc.log("LoaderLayer onExit");
}
}
var res_engine_loaded = false;
cc.LoaderLayer.preload = function (groupname, callback, target) {
var loaderLayer = new cc.LoaderLayer();
var preloadCb = function (status) {
if (status.isFailed) {
var tips, conirmfunc, cancelfunc;
switch (status.errorCode) {
case "err_no_space":
{
tips = "空间不足,请清理磁盘空间";
conirmfunc = function () {
callPreload();
};
cancelfunc = function () {
cc.director.end();
};
break;
}
case "err_verify":
{
tips = "校验失败,是否重新下载?";
conirmfunc = function () {
callPreload();
}
cancelfunc = function () {
cc.director.end();
}
break;
}
case "err_network":
{
tips = "网络异常是否重新下载";
conirmfunc = function () {
callPreload();
}
cancelfunc = function () {
cc.director.end();
}
break;
}
default :
{
conirmfunc = cancelfunc = function () {
}
}
}
cc._NetworkErrorDialog._show(status.errorCode, tips, conirmfunc, cancelfunc);
} else {
if (callback) {
if (target) {
callback.call(target, !status.isFailed);
} else {
callback(!status.isFailed)
}
}
}
}
var callPreload = function () {
loaderLayer.updateGroup(groupname, preloadCb, target);
loaderLayer._addToScene();
loaderLayer._preloadSource();
};
if (res_engine_loaded) {
callPreload();
return;
}
if (!cc.director.getRunningScene()) {
cc.director.runScene(new cc.Scene());
}
// Res engine not loaded, load them
cc.loader.load([
GROUP_JSON_PATH,
cc.LoaderLayer._finalConfig.background.res,
cc.LoaderLayer._finalConfig.title.res,
cc.LoaderLayer._finalConfig.logo.res,
cc.LoaderLayer._finalConfig.progressBar.res,
cc.LoaderLayer._finalConfig.progressBar.barBackgroundRes,
cc.LoaderLayer._finalConfig.progressBar.barPoint,
cc.LoaderLayer._finalConfig.progressBar.barShadow,
cc.Dialog._finalConfig.background.res,
cc.Dialog._finalConfig.confirmBtn.normalRes,
cc.Dialog._finalConfig.confirmBtn.pressRes,
cc.Dialog._finalConfig.cancelBtn.normalRes,
cc.Dialog._finalConfig.cancelBtn.pressRes
],
function (result, count, loadedCount) {
var percent = (loadedCount / count * 100) | 0;
percent = Math.min(percent, 100);
cc.log("Preloading engine resources... " + percent + "%");
}, function () {
var groups = cc.loader.getRes(GROUP_JSON_PATH);
if (groups) {
cc.LoaderLayer.groups = groups;
}
else {
cc.warn("Group versions haven't been loaded, you can also set group data with 'cc.LoaderLayer.groups'");
}
res_engine_loaded = true;
callPreload();
});
};
cc.LoaderLayer._useDefaultSource = true;
cc.LoaderLayer._isDefaultProgress = true;
cc.LoaderLayer._finalConfig = cc.LoaderLayer._config;
cc.LoaderLayer.groups = {};
cc.LoaderLayer.setUseDefaultSource = function (status) {
cc.LoaderLayer._useDefaultSource = status;
};
cc.LoaderLayer.setConfig = function (config) {
if(config.title && config.title.action){
config.title.action.retain();
}
if(config.logo && config.logo.action){
config.logo.action.retain();
}
this._initData(config);
};
cc.LoaderLayer._initData = function (uConfig) {
this._finalConfig = cc.clone(this._config);
var config = this._finalConfig;
if (uConfig != null) {
if (uConfig.background && uConfig.background.res) {
config.background.res = uConfig.background.res;
}
if (uConfig.title) {
var uTitle = uConfig.title;
var title = config.title;
title.show = typeof uTitle.show != "undefined" ? uTitle.show : title.show;
title.res = uTitle.res ? uTitle.res : title.res;
title.position = uTitle.position ? uTitle.position : title.position;
title.action = uTitle.action ? uTitle.action : title.action;
if (title.action) {
title.action = uTitle.action;
title.action.retain();
}
}
if (uConfig.logo) {
var uLogo = uConfig.logo;
var logo = config.logo;
logo.show = typeof uLogo.show != "undefined" ? uLogo.show : logo.show;
logo.res = uLogo.res ? uLogo.res : logo.res;
logo.position = uLogo.position ? uLogo.position : logo.position;
if (typeof uLogo.action != "undefined") {
logo.action = uLogo.action;
if (logo.action) {
logo.action.retain();
}
}
}
if (uConfig.progressBar) {
var uProgress = uConfig.progressBar;
var progress = config.progressBar;
progress.show = typeof uProgress.show != "undefined" ? uProgress.show : progress.show;
if (uProgress.res) {
progress.res = uProgress.res;
this._isDefaultProgress = false;
}
progress.offset = uProgress.offset ? uProgress.offset : progress.offset;
progress.position = uProgress.position ? uProgress.position : progress.position;
progress.barBackgroundRes = uProgress.barBackgroundRes ? uProgress.barBackgroundRes : progress.barBackgroundRes;
}
if (uConfig.tips) {
var uTips = uConfig.tips;
var tips = config.tips;
tips.show = typeof uTips.show != "undefined" ? uTips.show : tips.show;
tips.res = uTips.res ? uTips.res : tips.res;
tips.offset = uTips.offset ? uTips.offset : tips.offset;
tips.fontSize = uTips.fontSize ? uTips.fontSize : tips.fontSize;
tips.position = uTips.position ? uTips.position : tips.position;
tips.color = uTips.color ? uTips.color : tips.color;
if (uConfig.tips.tipsProgress && typeof uConfig.tips.tipsProgress == "function") {
tips.tipsProgress = uConfig.tips.tipsProgress;
}
}
if (typeof uConfig.onEnter == "function") {
config.onEnter = uConfig.onEnter;
}
if (typeof uConfig.onExit == "function") {
config.onExit = uConfig.onExit;
}
}
if (typeof config.logo.action == "undefined" && this._useDefaultSource) {
config.logo.action = cc.sequence(
cc.spawn(cc.moveBy(0.4, cc.p(0, 40)).easing(cc.easeIn(0.5)), cc.scaleTo(0.4, 0.95, 1.05).easing(cc.easeIn(0.5))),
cc.delayTime(0.08),
cc.spawn(cc.moveBy(0.4, cc.p(0, -40)).easing(cc.easeOut(0.5)), cc.scaleTo(0.4, 1.05, 0.95).easing(cc.easeOut(0.5)))
).repeatForever();
config.logo.action.retain();
}
if (!config.tips.color) {
config.tips.color = cc.color(255, 255, 255);
}
};
cc.Dialog = cc.Layer.extend({
_defaultConfig: null,
backgroundSprite: null,
_menuItemConfirm: null,
_menuItemCancel: null,
_messageLabel: null,
_eventListener: null,
_scaleFactor: null,
ctor: function (config) {
this._super();
this.setConfig(config);
},
setConfig: function (config) {
this.removeAllChildren();
if (config) {
cc.Dialog.setConfig(config);
}
},
initView: function () {
var useDefaultSource = cc.Dialog._useDefaultSource;
var winSize = cc.director.getWinSize();
this._scaleFactor = !useDefaultSource ? 1 : winSize.width > winSize.height ? winSize.width / 720 : winSize.width / 480;
var config = cc.Dialog._finalConfig;
//bg
this.backgroundSprite = new cc.Scale9Sprite(config.background.res);
this._setScale(this.backgroundSprite);
if (this._scaleFactor < 1) {
this.backgroundSprite.setScale(this._scaleFactor);
}
this.backgroundSprite.setPosition(config.position ? config.position : cc.p(winSize.width / 2, winSize.height / 2));
//menu
this.menuItemConfirm = this._createMenuItemSprite(config.confirmBtn, this._confirmCallback);
this.menuItemCancel = this._createMenuItemSprite(config.cancelBtn, this._cancelCallback);
this.menuItemCancel.setPosition(config.cancelBtn.position ? config.cancelBtn.position : cc.p(this.backgroundSprite.width / 2 - this.menuItemCancel.width / 2 - 20, this.menuItemCancel.height + 20));
this.menuItemConfirm.setPosition(config.confirmBtn.position ? config.confirmBtn.position : cc.p(this.backgroundSprite.width / 2 + this.menuItemConfirm.width / 2 + 20, this.menuItemConfirm.height + 20));
var menu = new cc.Menu(this.menuItemConfirm, this.menuItemCancel);
menu.setPosition(cc.p(0, 0));
this.backgroundSprite.addChild(menu);
//message
var fontSize = config.messageLabel.fontSize ? config.messageLabel.fontSize : this._scaleFactor > 1 ? 16 * this._scaleFactor : 16;
this.messageLabel = new cc.LabelTTF(config.messageLabel.text, "Arial", fontSize);
this.messageLabel.setDimensions(config.messageLabel.dimensions ? config.messageLabel.dimensions : cc.size(this.backgroundSprite.width - 30, this.backgroundSprite.height - this.menuItemConfirm.y - 10));
this.messageLabel.setColor(config.messageLabel.color ? config.messageLabel.color : cc.color(255, 255, 255));
this.messageLabel.setPosition(config.messageLabel.position ? config.messageLabel.position : cc.p(this.backgroundSprite.width / 2, this.backgroundSprite.height - this.messageLabel.height / 2 - 20));
this.backgroundSprite.addChild(this.messageLabel);
if (!config.action) {
var action = cc.sequence(cc.EaseIn.create(cc.scaleTo(0.1, this.backgroundSprite.scale + 0.02), 0.4), cc.EaseOut.create(cc.scaleTo(0.1, this.backgroundSprite.scale), 0.3));
this.backgroundSprite.runAction(action);
} else {
this.backgroundSprite.runAction(config.action);
}
this.addChild(this.backgroundSprite);
},
_createMenuItemSprite: function (res, callback) {
var spriteNormal = new cc.Scale9Sprite(res.normalRes);
var spritePress = new cc.Scale9Sprite(res.pressRes);
this._setScale(spriteNormal);
this._setScale(spritePress);
var fontSize = res.fontSize ? res.fontSize : this._scaleFactor > 1 ? 16 * this._scaleFactor : 16;
var menuLabel = new cc.LabelTTF(res.text, "Arial", fontSize);
menuLabel.setColor(res.textColor);
var menuItem = new cc.MenuItemSprite(spriteNormal, spritePress, callback, this);
menuLabel.setPosition(cc.p(menuItem.width / 2, menuItem.height / 2));
menuItem.addChild(menuLabel);
return menuItem;
},
_setScale: function (s9Sprite) {
if (this._scaleFactor > 1) {
s9Sprite.setContentSize(cc.size(this._scaleFactor * s9Sprite.width, this._scaleFactor * s9Sprite.height));
}
},
_confirmCallback: function () {
var config = cc.Dialog._finalConfig;
if (config.confirmBtn.callback) {
if (config.target) {
config.confirmBtn.callback.call(config.target, this);
} else {
config.confirmBtn.callback(this);
}
}
this.removeFromParent();
},
_cancelCallback: function () {
var config = cc.Dialog._finalConfig;
if (config.cancelBtn.callback) {
if (config.target) {
config.cancelBtn.callback.call(config.target, this);
} else {
config.cancelBtn.callback(this);
}
}
this.removeFromParent();
},
onEnter: function () {
this._super();
var config = cc.Dialog._finalConfig;
this.initView();
config.onEnter(this);
var self = this;
self._eventListener = cc.EventListener.create({
event: cc.EventListener.TOUCH_ONE_BY_ONE,
swallowTouches: true,
onTouchBegan: function (touch, event) {
return true;
}
});
cc.eventManager.addListener(self._eventListener, self);
},
onExit: function () {
this._super();
var config = cc.Dialog._finalConfig;
config.onExit(this);
this.removeAllChildren();
cc.Dialog._dialog = null;
cc.eventManager.removeListener(this._eventListener);
}
});
cc.Dialog._dialog = null;
cc.Dialog._clearDialog = function () {
if (cc.Dialog._dialog != null) {
cc.Dialog._dialog.removeFromParent();
cc.Dialog._dialog = null;
}
}
cc.Dialog.show = function (tips, confirmCb, cancelCb) {
if (cc.Dialog._dialog != null) {
cc.log("other dialog is on the screen,this dialog can't show now");
return;
}
var conf;
if (typeof tips == "string") {
conf = {
messageLabel: {
text: tips
},
confirmBtn: {
callback: confirmCb
},
cancelBtn: {
callback: cancelCb
}
}
} else if (typeof tips == "object") {
conf = tips;
} else {
cc.log("tips is invalid");
return;
}
cc.Dialog._dialog = new cc.Dialog(conf);
if (cc.director.getRunningScene()) {
cc.director.getRunningScene().addChild(cc.Dialog._dialog, INT_MAX);
} else {
cc.log("Current scene is null we can't show dialog");
}
};
cc.Dialog._useDefaultSource = true;
cc.Dialog.setUseDefaultSource = function (status) {
cc.Dialog._useDefaultSource = status;
}
cc.Dialog._defaultConfig = {
position: null,
target: null,
action: null,
background: {
res: "res_engine/dialog_bg.png"
},
confirmBtn: {
normalRes: "res_engine/dialog_confirm_normal.png",
pressRes: "res_engine/dialog_confirm_press.png",
text: "确定",
textColor: null,
fontSize: null,
position: null,
callback: function () {
cc.log("this is confirm callback");
}
},
cancelBtn: {
normalRes: "res_engine/dialog_cancel_normal.png",
pressRes: "res_engine/dialog_cancel_press.png",
text: "取消",
textColor: null,
position: null,
fontSize: null,
callback: function () {
cc.log("this is cancel callback");
}
},
messageLabel: {
text: "",
color: null,
dimensions: null,
fontSize: null,
position: null
},
onEnter: function (dialog) {
cc.log("dialog call onEnter");
},
onExit: function (dialog) {
cc.log("dialog call onExit");
}
};
cc.Dialog._finalConfig = cc.Dialog._defaultConfig;
cc.Dialog.setConfig = function (config) {
this._initData(config);
};
cc.Dialog._initData = function (uConfig) {
this._finalConfig = cc.clone(this._defaultConfig);
var config = this._finalConfig;
if (uConfig != null) {
if (uConfig.position) {
config.position = uConfig.position;
}
if (uConfig.action) {
config.action = uConfig.action;
}
if (uConfig.background && uConfig.background.res) {
config.background = uConfig.background;
}
if (uConfig.confirmBtn) {
var uConfirmBtn = uConfig.confirmBtn;
var confirmBtn = config.confirmBtn;
confirmBtn.normalRes = uConfirmBtn.normalRes ? uConfirmBtn.normalRes : confirmBtn.normalRes;
confirmBtn.pressRes = uConfirmBtn.pressRes ? uConfirmBtn.pressRes : confirmBtn.pressRes;
confirmBtn.text = typeof uConfirmBtn.text != "undefined" ? uConfirmBtn.text : confirmBtn.text;
confirmBtn.textColor = uConfirmBtn.textColor ? uConfirmBtn.textColor : confirmBtn.textColor;
confirmBtn.fontSize = uConfirmBtn.fontSize ? uConfirmBtn.fontSize : confirmBtn.fontSize;
confirmBtn.position = uConfirmBtn.position ? uConfirmBtn.position : confirmBtn.position;
confirmBtn.callback = uConfirmBtn.callback ? uConfirmBtn.callback : confirmBtn.callback;
}
if (uConfig.cancelBtn) {
var uCancelBtn = uConfig.cancelBtn;
var cancelBtn = config.cancelBtn;
cancelBtn.normalRes = uCancelBtn.normalRes ? uCancelBtn.normalRes : cancelBtn.normalRes;
cancelBtn.pressRes = uCancelBtn.pressRes ? uCancelBtn.pressRes : cancelBtn.pressRes;
cancelBtn.text = typeof uCancelBtn.text != "undefined" ? uCancelBtn.text : cancelBtn.text;
cancelBtn.textColor = uCancelBtn.textColor ? uCancelBtn.textColor : cancelBtn.textColor;
cancelBtn.fontSize = uCancelBtn.fontSize ? uCancelBtn.fontSize : cancelBtn.fontSize;
cancelBtn.position = uCancelBtn.position ? uCancelBtn.position : cancelBtn.position;
cancelBtn.callback = uCancelBtn.callback ? uCancelBtn.callback : cancelBtn.callback;
}
if (uConfig.messageLabel) {
var uMessageLabel = uConfig.messageLabel;
var messageLabel = config.messageLabel;
messageLabel.text = typeof uMessageLabel.text != "undefined" ? uMessageLabel.text : messageLabel.text;
messageLabel.color = uMessageLabel.color ? uMessageLabel.color : messageLabel.color;
messageLabel.fontSize = uMessageLabel.fontSize ? uMessageLabel.fontSize : messageLabel.fontSize;
messageLabel.position = uMessageLabel.position ? uMessageLabel.position : messageLabel.position;
messageLabel.dimensions = uMessageLabel.dimensions ? uMessageLabel.dimensions : messageLabel.dimensions;
}
if (uConfig.target) {
config.target = uConfig.target;
}
if (typeof uConfig.onEnter == "function") {
config.onEnter = uConfig.onEnter;
}
if (typeof uConfig.onExit == "function") {
config.onExit = uConfig.onExit;
}
}
if (!config.cancelBtn.textColor) {
config.cancelBtn.textColor = cc.color(255, 255, 255);
}
if (!config.confirmBtn.textColor) {
config.confirmBtn.textColor = cc.color(255, 255, 255);
}
};
cc._NetworkErrorDialog = function () {
cc.Dialog._clearDialog();
cc.Dialog._dialog = new cc.Dialog(cc._NetworkErrorDialog._config);
return cc.Dialog._dialog;
}
cc._NetworkErrorDialog._config = {
networkError: {},
spaceError: {},
verifyError: {}
};
cc._NetworkErrorDialog._show = function (type, tips, confirmCb, cancelCb) {
var networkDialog = cc._NetworkErrorDialog();
var config;
switch (type) {
case "err_network":
{
config = cc._NetworkErrorDialog._config.networkError;
break;
}
case "err_no_space":
{
config = cc._NetworkErrorDialog._config.spaceError;
break;
}
case "err_verify":
{
config = cc._NetworkErrorDialog._config.verifyError;
break;
}
default:
{
cc.log("type is not found");
return;
}
}
if (!networkDialog.getParent()) {
config.confirmBtn = config.confirmBtn || {};
config.confirmBtn.callback = function () {
if (confirmCb)
confirmCb();
}
config.cancelBtn = config.cancelBtn || {};
config.cancelBtn.callback = function () {
if (cancelCb)
cancelCb();
}
config.messageLabel = config.messageLabel || {};
if (typeof config.messageLabel.text == "undefined") {
config.messageLabel.text = tips;
}
networkDialog.setConfig(config);
if (cc.director.getRunningScene()) {
cc.director.getRunningScene().addChild(networkDialog, INT_MAX);
} else {
cc.log("Current scene is null we can't show dialog");
}
}
}
cc._NetworkErrorDialog._setConfig = function (key, config) {
if (key && config) {
switch (key) {
case "err_network":
{
cc._NetworkErrorDialog._config.networkError = config;
break;
}
case "err_no_space":
{
cc._NetworkErrorDialog._config.spaceError = config;
break;
}
case "err_verify":
{
cc._NetworkErrorDialog._config.verifyError = config;
break;
}
}
}
}
cc.runtime = cc.runtime || {};
cc.runtime.setOption = function (promptype, config) {
if (config) {
switch (promptype) {
case "network_error_dialog":
{
cc._NetworkErrorDialog._setConfig("err_network", config);
break;
}
case "no_space_error_dialog":
{
cc._NetworkErrorDialog._setConfig("err_no_space", config);
break;
}
case "verify_error_dialog":
{
cc._NetworkErrorDialog._setConfig("err_verify", config);
break;
}
default :
{
cc.log("promptype not found please check your promptype");
}
}
} else {
cc.log("config is null please check your config");
}
}
/**
* only use in JSB get network type
* @type {{}|*|cc.network}
*/
cc.network = cc.network || {};
cc.network.type = {
NO_NETWORK: -1,
MOBILE: 0,
WIFI: 1
}
cc.network.preloadstatus = {
DOWNLOAD: 1,
UNZIP: 2
}
cc.runtime.network = cc.network;
})();
cc.LoaderScene._preload = cc.LoaderScene.preload;
cc.LoaderScene.preload = function (arr, cb, target) {
// No extension
var isGroups = (arr[0] && arr[0].indexOf('.') === -1);
if (isGroups) {
if (arr.indexOf('boot') === -1) {
arr.splice(0, 0, 'boot');
}
cc.LoaderLayer.preload(arr, cb, target);
}
else {
cc.LoaderScene._preload(arr, cb, target);
}
}
| {
"content_hash": "edfebe69cd7334d780c04e0d9be6f0c1",
"timestamp": "",
"source": "github",
"line_count": 967,
"max_line_length": 284,
"avg_line_length": 38.91933815925543,
"alnum_prop": 0.5523847482396705,
"repo_name": "babestvl/FoodClash",
"id": "2d3532ba459985aff3aafb199e87270babbb93bb",
"size": "39024",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "frameworks/cocos2d-html5/extensions/runtime/CCLoaderLayer.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CMake",
"bytes": "11529"
},
{
"name": "HTML",
"bytes": "4292"
},
{
"name": "JavaScript",
"bytes": "4636509"
}
],
"symlink_target": ""
} |
Navigation
==========
APIs:
* [Authorizations](authorizations.md)
* [Commits](commits.md)
* [Enterprise](enterprise.md)
* [Gists](gists.md)
* [Issues](issues.md)
* [Comments](issue/comments.md)
* [Labels](issue/labels.md)
* [Organization](organization.md)
* [Members](organization/members.md)
* [Teams](organization/teams.md)
* [Pull Requests](pull_requests.md)
* [Comments](pull_request/comments.md)
* [Repositories](repos.md)
* [Contents](repo/contents.md)
* [Releases](repo/releases.md)
* [Assets](repo/assets.md)
* [Users](users.md)
* [Meta](meta.md)
* [Activity](activity.md)
Additional features:
* [Pagination support](result_pager.md)
* [Authentication & Security](security.md)
* [Request any Route](request_any_route.md)
* [Customize `php-github-api` and testing](customize.md)
| {
"content_hash": "38db0aa7d0eebcad0953bf5aa6583610",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 56,
"avg_line_length": 26.9,
"alnum_prop": 0.6914498141263941,
"repo_name": "mAAdhaTTah/php-github-api",
"id": "176e5a2b51ddc3e6aeda389260aa8eda287295b6",
"size": "807",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "doc/index.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "406547"
}
],
"symlink_target": ""
} |
using System.Threading.Tasks;
using LeagueRecorder.Abstractions.Data;
namespace LeagueRecorder.Abstractions.League
{
public interface ISpectatorService
{
/// <summary>
/// Downloads the spectate-file and starts the League of Legends client to spectate the specified <paramref name="match"/>.
/// </summary>
/// <param name="match">The match.</param>
Task<bool> SpectateMatchAsync(MatchInfo match);
}
} | {
"content_hash": "7ecb3715ad8df7c9c1138e71d15b7e17",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 131,
"avg_line_length": 32.5,
"alnum_prop": 0.6813186813186813,
"repo_name": "haefele/LeagueRecorderOPGG",
"id": "081428c8732090e59609d3efd87246d525851acc",
"size": "457",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Application/LeagueRecorder.Abstractions/League/ISpectatorService.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "77493"
}
],
"symlink_target": ""
} |
<?php
use Cmfcmf\OpenWeatherMap;
use Cmfcmf\OpenWeatherMap\Exception as OWMException;
require_once __DIR__ . '/bootstrap.php';
$cli = false;
$lf = '<br>';
if (php_sapi_name() === 'cli') {
$lf = "\n";
$cli = true;
}
// Language of data (try your own language here!):
$lang = 'de';
// Units (can be 'metric' or 'imperial' [default]):
$units = 'metric';
// Get OpenWeatherMap object. Don't use caching (take a look into Example_Cache.php to see how it works).
$owm = new OpenWeatherMap();
$owm->setApiKey($myApiKey);
// Example 1: Get current temperature in Berlin.
$weather = $owm->getWeather('Berlin', $units, $lang);
echo "EXAMPLE 1$lf";
// $weather contains all available weather information for Berlin.
// Let's get the temperature:
// Returns it as formatted string (using __toString()):
echo $weather->temperature;
echo $lf;
// Returns it as formatted string (using a method):
echo $weather->temperature->getFormatted();
echo $lf;
// Returns the value only:
echo $weather->temperature->getValue();
echo $lf;
// Returns the unit only:
echo $weather->temperature->getUnit();
echo $lf;
/*
* In the example above we're using a "shortcut". OpenWeatherMap returns the minimum temperature of a day,
* the maximum temperature and the temperature right now. If you don't specify which temperature you want, it will default
* to the current temperature. See below how to access the other values. Notice that each of them has implemented the methods
* "getFormatted()", "getValue()", "getUnit()".
*/
// Returns the current temperature:
echo 'Current: '.$weather->temperature->now;
echo $lf;
// Returns the minimum temperature:
echo 'Minimum: '.$weather->temperature->min;
echo $lf;
// Returns the maximum temperature:
echo 'Maximum: '.$weather->temperature->max;
echo $lf;
/*
* When speaking about "current" and "now", this means when the weather data was last updated. You can get this
* via a DateTime object:
*/
echo 'Last update: '.$weather->lastUpdate->format('r');
echo $lf;
// Example 2: Get current pressure and humidity in Hongkong.
$weather = $owm->getWeather('Hongkong', $units, $lang);
echo "$lf$lf EXAMPLE 2$lf";
/*
* You can use the methods above to only get the value or the unit.
*/
echo 'Pressure: '.$weather->pressure;
echo $lf;
echo 'Humidity: '.$weather->humidity;
echo $lf;
// Example 3: Get today's sunrise and sunset times.
echo "$lf$lf EXAMPLE 3$lf";
/*
* These functions return a DateTime object.
*/
echo 'Sunrise: '.$weather->sun->rise->format('r');
echo $lf;
echo 'Sunset: '.$weather->sun->set->format('r');
echo $lf;
// Example 4: Get current temperature from coordinates (Greenland :-) ).
$weather = $owm->getWeather(array('lat' => 77.73038, 'lon' => 41.89604), $units, $lang);
echo "$lf$lf EXAMPLE 4$lf";
echo 'Temperature: '.$weather->temperature;
echo $lf;
// Example 5: Get current temperature from city id. The city is an internal id used by OpenWeatherMap. See example 6 too.
$weather = $owm->getWeather(2172797, $units, $lang);
echo "$lf$lf EXAMPLE 5$lf";
echo 'City: '.$weather->city->name;
echo $lf;
echo 'Temperature: '.$weather->temperature;
echo $lf;
// Example 5.1: Get current temperature from zip code (Hyderabad, India).
$weather = $owm->getWeather('zip:500001,IN', $units, $lang);
echo "$lf$lf EXAMPLE 5.1$lf";
echo 'City: '.$weather->city->name;
echo $lf;
echo 'Temperature: '.$weather->temperature;
echo $lf;
// Example 6: Get information about a city.
$weather = $owm->getWeather('Paris', $units, $lang);
echo "$lf$lf EXAMPLE 6$lf";
echo 'Id: '.$weather->city->id;
echo $lf;
echo 'Name: '.$weather->city->name;
echo $lf;
echo 'Lon: '.$weather->city->lon;
echo $lf;
echo 'Lat: '.$weather->city->lat;
echo $lf;
echo 'Country: '.$weather->city->country;
echo $lf;
// Example 7: Get wind information.
echo "$lf$lf EXAMPLE 7$lf";
echo 'Speed: '.$weather->wind->speed;
echo $lf;
echo 'Direction: '.$weather->wind->direction;
echo $lf;
/*
* For speed and direction there is a description available, which isn't always translated.
*/
echo 'Speed: '.$weather->wind->speed->getDescription();
echo $lf;
echo 'Direction: '.$weather->wind->direction->getDescription();
echo $lf;
// Example 8: Get information about the clouds.
echo "$lf$lf EXAMPLE 8$lf";
// The number in braces seems to be an indicator how cloudy the sky is.
echo 'Clouds: '.$weather->clouds->getDescription().' ('.$weather->clouds.')';
echo $lf;
// Example 9: Get information about precipitation.
echo "$lf$lf EXAMPLE 9$lf";
echo 'Precipation: '.$weather->precipitation->getDescription().' ('.$weather->precipitation.')';
echo $lf;
// Example 10: Show copyright notice. WARNING: This is no official text. This hint was created by looking at http://www.http://openweathermap.org/copyright .
echo "$lf$lf EXAMPLE 10$lf";
echo $owm::COPYRIGHT;
echo $lf;
// Example 11: Retrieve weather icons.
echo "$lf$lf EXAMPLE 11$lf";
$weather = $owm->getWeather('Berlin');
echo $weather->weather->icon;
echo $lf;
echo $weather->weather->getIconUrl();
// Example 12: Get raw xml data.
echo "$lf$lf EXAMPLE 12$lf";
$xml = $owm->getRawWeatherData('Berlin', $units, $lang, null, 'xml');
if ($cli) {
echo $xml;
} else {
echo '<pre><code>'.htmlspecialchars($xml).'</code></pre>';
}
echo $lf;
// Example 13: Get raw json data.
echo "$lf$lf EXAMPLE 13$lf";
$json = $owm->getRawWeatherData('Berlin', $units, $lang, null, 'json');
if ($cli) {
echo $json;
} else {
echo '<pre><code>'.htmlspecialchars($json).'</code></pre>';
}
echo $lf;
// Example 14: Get raw html data.
echo "$lf$lf EXAMPLE 14$lf";
echo $owm->getRawWeatherData('Berlin', $units, $lang, null, 'html');
echo $lf;
// Example 15: Error handling.
echo "$lf$lf EXAMPLE 15$lf";
// Try wrong city name.
try {
$weather = $owm->getWeather('ThisCityNameIsNotValidAndDoesNotExist', $units, $lang);
} catch (OWMException $e) {
echo $e->getMessage().' (Code '.$e->getCode().').';
echo $lf;
}
// Try invalid $query.
try {
$weather = $owm->getWeather(new \DateTime('now'), $units, $lang);
} catch (\Exception $e) {
echo $e->getMessage().' (Code '.$e->getCode().').';
echo $lf;
}
// Full error handling would look like this:
try {
$weather = $owm->getWeather(-1, $units, $lang);
} catch (OWMException $e) {
echo 'OpenWeatherMap exception: '.$e->getMessage().' (Code '.$e->getCode().').';
echo $lf;
} catch (\Exception $e) {
echo 'General exception: '.$e->getMessage().' (Code '.$e->getCode().').';
echo $lf;
}
| {
"content_hash": "67d21fd32646c4ab4c5e2fa827d9df7d",
"timestamp": "",
"source": "github",
"line_count": 246,
"max_line_length": 157,
"avg_line_length": 26.321138211382113,
"alnum_prop": 0.6694980694980694,
"repo_name": "cmfcmf/OpenWeatherMap-PHP-Api",
"id": "7193326699e658d06a382f3bbb45863c7e610193",
"size": "6989",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Examples/CurrentWeather.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "120656"
}
],
"symlink_target": ""
} |
package de.lemona.android.guice;
import android.content.Context;
import com.google.inject.Binding;
import com.google.inject.Injector;
import com.google.inject.Key;
import com.google.inject.MembersInjector;
import com.google.inject.Module;
import com.google.inject.Provider;
import com.google.inject.Scope;
import com.google.inject.TypeLiteral;
import com.google.inject.spi.TypeConverterBinding;
import java.lang.annotation.Annotation;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class ContextInjector implements Injector {
private final ContextScope scope;
private final Injector injector;
private final Context context;
ContextInjector(Injector injector, Context context) {
this.scope = injector.getInstance(ContextScope.class);
this.injector = injector;
this.context = context;
}
public Injector getGuiceInjector() {
return injector;
}
@Override
public void injectMembers(Object instance) {
scope.pushContext(context);
try {
injector.injectMembers(instance);
} finally {
scope.popContext();
}
}
@Override
public <T> MembersInjector<T> getMembersInjector(TypeLiteral<T> typeLiteral) {
return new ContextMembersInjector<>(injector.getMembersInjector(typeLiteral));
}
@Override
public <T> MembersInjector<T> getMembersInjector(Class<T> type) {
return new ContextMembersInjector<>(injector.getMembersInjector(type));
}
@Override
public <T> Provider<T> getProvider(Key<T> key) {
return new ContextProvider<>(injector.getProvider(key));
}
@Override
public <T> Provider<T> getProvider(Class<T> type) {
return new ContextProvider<>(injector.getProvider(type));
}
@Override
public <T> T getInstance(Key<T> key) {
scope.pushContext(context);
try {
return injector.getInstance(key);
} finally {
scope.popContext();
}
}
@Override
public <T> T getInstance(Class<T> type) {
scope.pushContext(context);
try {
return injector.getInstance(type);
} finally {
scope.popContext();
}
}
@Override
public ContextInjector getParent() {
return new ContextInjector(injector.getParent(), context);
}
@Override
public Injector createChildInjector(Iterable<? extends Module> modules) {
return new ContextInjector(injector.createChildInjector(modules), context);
}
@Override
public Injector createChildInjector(Module... modules) {
return new ContextInjector(injector.createChildInjector(modules), context);
}
/* ====================================================================== */
@Override
public Map<Key<?>, Binding<?>> getBindings() {
throw new UnsupportedOperationException("Use getGuiceInjector(...)");
}
@Override
public Map<Key<?>, Binding<?>> getAllBindings() {
throw new UnsupportedOperationException("Use getGuiceInjector(...)");
}
@Override
public <T> Binding<T> getBinding(Key<T> key) {
throw new UnsupportedOperationException("Use getGuiceInjector(...)");
}
@Override
public <T> Binding<T> getBinding(Class<T> type) {
throw new UnsupportedOperationException("Use getGuiceInjector(...)");
}
@Override
public <T> Binding<T> getExistingBinding(Key<T> key) {
throw new UnsupportedOperationException("Use getGuiceInjector(...)");
}
@Override
public <T> List<Binding<T>> findBindingsByType(TypeLiteral<T> type) {
throw new UnsupportedOperationException("Use getGuiceInjector(...)");
}
@Override
public Map<Class<? extends Annotation>, Scope> getScopeBindings() {
throw new UnsupportedOperationException("Use getGuiceInjector(...)");
}
@Override
public Set<TypeConverterBinding> getTypeConverterBindings() {
throw new UnsupportedOperationException("Use getGuiceInjector(...)");
}
/* ====================================================================== */
private class ContextMembersInjector<T> implements MembersInjector<T> {
private final MembersInjector<T> membersInjector;
private ContextMembersInjector(MembersInjector<T> membersInjector) {
this.membersInjector = membersInjector;
}
@Override
public void injectMembers(T instance) {
scope.pushContext(context);
try {
membersInjector.injectMembers(instance);
} finally {
scope.popContext();
}
}
}
/* ====================================================================== */
private class ContextProvider<T> implements Provider<T> {
private final Provider<T> provider;
private ContextProvider(Provider<T> provider) {
this.provider = provider;
}
@Override
public T get() {
scope.pushContext(context);
try {
return provider.get();
} finally {
scope.popContext();
}
}
}
}
| {
"content_hash": "70e48e6cc15b6d1c7f0bca390b3fe7ea",
"timestamp": "",
"source": "github",
"line_count": 184,
"max_line_length": 86,
"avg_line_length": 28.51086956521739,
"alnum_prop": 0.6136103698055662,
"repo_name": "LemonadeLabInc/android-guice",
"id": "54dd18b2a120cf322ca8a18556608ce944f7780f",
"size": "5246",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "android-guice/src/main/java/de/lemona/android/guice/ContextInjector.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "94712"
}
],
"symlink_target": ""
} |
@charset "utf-8";
/* CSS Document */
.lft{float:left; display:inline;}
.rgt{float:right; display:inline;}
.clr{clear:both;}
.brdr{border:solid 1px #000;}
h1,p,h2,h3,h4,h5,h6,form,div,ul,li{margin:0px; padding:0px;}
a img{border:none; float:left; font-weight:normal;}
.map{padding:0px; margin:0px;}
.input{ margin:0px; padding:0px; display:inline;}
.main_table1{ background-color:#f5f5f5; -moz-border-radius: 5px; -webkit-border-radius: 5px; border: 1px solid #dddddd; }
.padding001{ padding-left:10px;}
.mainboxdiv{ width:700px; height:auto; float:left;}
.clenderbox{ width:372px; height:334px; float:left;}
.clenderbox img{ width:372px; height:334px; float:left;}
.text_project{ color:#000000; font-size:14px; font-weight:normal;}
.text_project h1{ color:#000000; font-size:14px; font-weight:bold; padding-top:6px;}
.text_project select{ width:200px; height:25px; color:#000000; font-size:14px; font-weight:normal;}
.text_project input{ width:auto; height:25px; color:#000000; font-size:14px; font-weight:normal;}
.text_project textarea{ width:200px; height:60px; color:#000000; font-size:14px; font-weight:normal;}
.text_project a img{ color:#000000; font-size:14px; font-weight:bold; margin-top:3px; display:inline;}
| {
"content_hash": "36c5d282473c443ef6e866da1a1462ad",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 121,
"avg_line_length": 45.407407407407405,
"alnum_prop": 0.7357259380097879,
"repo_name": "defusiondev/whmcs-time-tracking",
"id": "514dd60eff500f6eec9943e7c3808937e3f758bd",
"size": "1226",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "css/form2.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "18801"
},
{
"name": "JavaScript",
"bytes": "9221"
},
{
"name": "PHP",
"bytes": "83960"
}
],
"symlink_target": ""
} |
<html>
<head lang="en">
<meta charset="UTF-8" />
<link rel="stylesheet" href="../../css/app.css">
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js"></script>
<script type="text/javascript" src="{{ asset('js/deps.bundle.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('js/main.bundle.js') }}"></script>
<script src='https://code.responsivevoice.org/responsivevoice.js'></script>
<title>EcoLearnia (v0.0.2) Test</title>
</head>
<body>
<h1>Hello, <?php echo $name; ?></h1>
<div clss="container">
<div>
<div style="float:left">Content </br>
<textarea id="content" cols="50" rows="8"></textarea>
</div>
<div>Log</br>
<textarea id="log" cols="50" rows="8"></textarea>
</div>
</div>
ID: <input type="text" id="id"></input><br/>
<div> Content
<button id="btnGet">Get</button>
<button id="btnSave">Save</button>
<button id="btnDelete">Delete</button>
</div>
<div >
Assignment
<button id="btnStartAssignment">Start Assignment</button>
<button id="btnNextActivity">Next Activity</button>
</div>
</div>
<script type="text/javascript">
var main = require('main');
var contenResource = new main.ContentResource({baseUrl: '/api/contents'});
var assignmentService = new main.AssignmentService({baseUrl: '/api/assignments'});
$("#btnGet").click(function(event) {
var id = $("#id").val();
contenResource.get({_id: id})
.then(function(data){
appendLog('Content ' + id + ' retireved. ' + data);
})
.catch(function(error){
appendLog(error);
});
});
$("#btnSave").click(function(event) {
var id = $("#id").val();
var content = $("#content").val();
var params = {_id: id};
contenResource.save(params, content)
.then(function(data){
appendLog('Content ' + id + ' saved. ');
})
.catch(function(error){
appendLog(error);
});
});
$("#btnDelete").click(function(event) {
var id = $("#id").val();
contenResource.delete({_id: id})
.then(function(data){
appendLog('Content ' + id + ' deleted. ');
})
.catch(function(error){
appendLog(error);
});
});
$("#btnStartAssignment").click(function(event) {
var outsetUuid = $("#id").val();
assignmentService.startAssignment(outsetUuid)
.then(function(data){
appendLog('Assignment ' + data.uuid + ' started. ');
});
});
$("#btnNextActivity").click(function(event) {
var assignmentUuid = $("#id").val();
assignmentService.createNextActivity(assignmentUuid)
.then(function(data){
appendLog('Next Activity ' + data.uuid + ' created. ');
});
});
function appendLog(message)
{
var log = $("#log").val();
log += message + "\n";
$("#log").val(log);
}
</script>
</body>
</html>
| {
"content_hash": "645979c47913aaf1e578218f31a37faf",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 103,
"avg_line_length": 31.62962962962963,
"alnum_prop": 0.5055620608899297,
"repo_name": "ecolearnia/ecolearnia-server-php",
"id": "589d989e8176d91e494ed18b87d6d9c2b43573ee",
"size": "3416",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "laravel/resources/views/test.blade.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "553"
},
{
"name": "CSS",
"bytes": "19516"
},
{
"name": "HTML",
"bytes": "60729"
},
{
"name": "JavaScript",
"bytes": "3545308"
},
{
"name": "PHP",
"bytes": "328931"
}
],
"symlink_target": ""
} |
package org.apache.tinkerpop.gremlin.process.traversal.lambda;
import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalUtil;
import org.apache.tinkerpop.gremlin.structure.Element;
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
*/
public final class ElementValueTraversal<V> extends AbstractLambdaTraversal<Element, V> {
private final String propertyKey;
private V value;
public ElementValueTraversal(final String propertyKey) {
this.propertyKey = propertyKey;
}
@Override
public V next() {
return this.value;
}
@Override
public boolean hasNext() {
return true;
}
@Override
public void addStart(final Traverser.Admin<Element> start) {
this.value = null == this.bypassTraversal ? start.get().value(this.propertyKey) : TraversalUtil.apply(start, this.bypassTraversal);
}
public String getPropertyKey() {
return this.propertyKey;
}
@Override
public String toString() {
return "value(" + (null == this.bypassTraversal ? this.propertyKey : this.bypassTraversal) + ')';
}
@Override
public int hashCode() {
return super.hashCode() ^ this.propertyKey.hashCode();
}
}
| {
"content_hash": "c8b74c6b754a9a2af78614f47404b4da",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 139,
"avg_line_length": 27.125,
"alnum_prop": 0.6889400921658986,
"repo_name": "artem-aliev/tinkerpop",
"id": "2e9b26c72f7be323c71c3aa1173f22ad3f170650",
"size": "2107",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/lambda/ElementValueTraversal.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Awk",
"bytes": "2335"
},
{
"name": "Batchfile",
"bytes": "4116"
},
{
"name": "C#",
"bytes": "684240"
},
{
"name": "Gherkin",
"bytes": "273479"
},
{
"name": "Groovy",
"bytes": "301513"
},
{
"name": "Java",
"bytes": "9000729"
},
{
"name": "JavaScript",
"bytes": "105669"
},
{
"name": "Python",
"bytes": "456044"
},
{
"name": "Shell",
"bytes": "45354"
},
{
"name": "XSLT",
"bytes": "2205"
}
],
"symlink_target": ""
} |
class CreateBadges < ActiveRecord::Migration
def change
create_table :badges do |t|
t.belongs_to :achievement_unlock, index: true
t.belongs_to :player, index: true
t.float :multiplier
t.integer :status
t.timestamps null: false
end
add_foreign_key :badges, :achievements
add_foreign_key :badges, :players
end
end
| {
"content_hash": "08a0ac14207969a3fc75e9e8d03bf558",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 51,
"avg_line_length": 25.928571428571427,
"alnum_prop": 0.6721763085399449,
"repo_name": "SufficientlyAdvancedTechnologies/LeaderBored",
"id": "96047df3d0de3984f231292fdd9574300e3ce80f",
"size": "363",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "lib/Achievemintz/db/migrate/20150201041152_create_badges.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "12414"
},
{
"name": "CoffeeScript",
"bytes": "1324"
},
{
"name": "JavaScript",
"bytes": "9186"
},
{
"name": "Ruby",
"bytes": "271028"
},
{
"name": "Shell",
"bytes": "741"
}
],
"symlink_target": ""
} |
package net.javacrumbs.jsonunit.test.jackson2;
import net.javacrumbs.jsonunit.test.base.AbstractJsonMatchersTest;
import net.javacrumbs.jsonunit.test.base.JsonTestUtils;
public class GsonJsonMatchersTest extends AbstractJsonMatchersTest {
protected Object readValue(String value) {
return JsonTestUtils.readByGson(value);
}
}
| {
"content_hash": "f0e7802bc7aa6fcea267a6d62b1ca7e9",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 68,
"avg_line_length": 31.363636363636363,
"alnum_prop": 0.8057971014492754,
"repo_name": "michalbcz/JsonUnit",
"id": "18d3ad9e488cbd897ccd73de453b34fcdb2c15f3",
"size": "966",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "tests/test-gson/src/test/java/net/javacrumbs/jsonunit/test/jackson2/GsonJsonMatchersTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "170053"
}
],
"symlink_target": ""
} |
package com.mychaelstyle.commons.file;
import static org.junit.Assert.*;
import java.io.File;
import java.net.URL;
import java.util.List;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
public class CSVParserTest {
@BeforeClass
public static void setUpBeforeClass() throws Exception {
}
@AfterClass
public static void tearDownAfterClass() throws Exception {
}
@Before
public void setUp() throws Exception {
}
@After
public void tearDown() throws Exception {
}
@Test
public void test() {
URL base = this.getClass().getClassLoader().getResource("csvs");
String path = base.getPath();
System.out.println(path);
File root = new File(path);
File[] dirs = root.listFiles();
for(int num=0; num<dirs.length; num++){
File dir = dirs[num];
if(!dir.isDirectory()){
continue;
}
File[] files = dir.listFiles();
for(int i=0; i< files.length; i++){
String fileName = files[i].toString();
if(fileName.endsWith(".csv")/* && fileName.contains("08") && fileName.contains("31")*/){
System.out.println(fileName);
File csvFile = new File(fileName);
CSVParser parser = new CSVParser(csvFile,"MS932");
try {
try {
parser.open();
} catch(Throwable e){
fail(e.getMessage());
}
int lastColumnCount = -1;
int lineNumber = 1;
while(parser.hasNext()){
try {
List<String> record = parser.next();
System.out.println((i+1)+"/"+files.length+"ファイル :"
+lineNumber+"行目, "+fileName+" "+record);
if(-1!=lastColumnCount){
if(lastColumnCount != record.size()){
System.out.println(fileName+" row "+lineNumber
+". Column count is expected "+lastColumnCount
+" but "+record.size()+" "+record);
}
assertEquals(lastColumnCount,record.size());
}
lastColumnCount = record.size();
} catch(Throwable e){
fail(e.getMessage());
}
lineNumber++;
}
} finally {
try {
parser.close();
} catch(Throwable e){
fail(e.getMessage());
}
}
}
}
}
}
}
| {
"content_hash": "b1467a29d762aa3711240fc4415a7f11",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 104,
"avg_line_length": 35.07692307692308,
"alnum_prop": 0.41729323308270677,
"repo_name": "mychaelstyle/commons",
"id": "ede79fafd3e6c6578f909d9ad07ef71b2263e4a4",
"size": "3204",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "file/src/test/java/com/mychaelstyle/commons/file/CSVParserTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "29354"
}
],
"symlink_target": ""
} |
AerialAssistRobotCode
=====================
| {
"content_hash": "88424c57494453c308e7694224143b01",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 21,
"avg_line_length": 22,
"alnum_prop": 0.4772727272727273,
"repo_name": "Team-4153/AerialAssistRobotCode",
"id": "f9069821fa0a5793d5c82fc1b17a56f5b32d1b0f",
"size": "44",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Java",
"bytes": "10165"
}
],
"symlink_target": ""
} |
#include "xenia/memory.h"
#include <gflags/gflags.h>
#include <algorithm>
#include <cstring>
#include "xenia/base/clock.h"
#include "xenia/base/logging.h"
#include "xenia/base/math.h"
#include "xenia/base/threading.h"
#include "xenia/cpu/mmio_handler.h"
// TODO(benvanik): move xbox.h out
#include "xenia/xbox.h"
DEFINE_bool(protect_zero, false,
"Protect the zero page from reads and writes.");
DEFINE_bool(scribble_heap, false,
"Scribble 0xCD into all allocated heap memory.");
namespace xe {
uint32_t get_page_count(uint32_t value, uint32_t page_size) {
return xe::round_up(value, page_size) / page_size;
}
/**
* Memory map:
* 0x00000000 - 0x3FFFFFFF (1024mb) - virtual 4k pages
* 0x40000000 - 0x7FFFFFFF (1024mb) - virtual 64k pages
* 0x80000000 - 0x8BFFFFFF ( 192mb) - xex 64k pages
* 0x8C000000 - 0x8FFFFFFF ( 64mb) - xex 64k pages (encrypted)
* 0x90000000 - 0x9FFFFFFF ( 256mb) - xex 4k pages
* 0xA0000000 - 0xBFFFFFFF ( 512mb) - physical 64k pages
* 0xC0000000 - 0xDFFFFFFF - physical 16mb pages
* 0xE0000000 - 0xFFFFFFFF - physical 4k pages
*
* We use the host OS to create an entire addressable range for this. That way
* we don't have to emulate a TLB. It'd be really cool to pass through page
* sizes or use madvice to let the OS know what to expect.
*
* We create our own heap of committed memory that lives at
* memory_HEAP_LOW to memory_HEAP_HIGH - all normal user allocations
* come from there. Since the Xbox has no paging, we know that the size of this
* heap will never need to be larger than ~512MB (realistically, smaller than
* that). We place it far away from the XEX data and keep the memory around it
* uncommitted so that we have some warning if things go astray.
*
* For XEX/GPU/etc data we allow placement allocations (base_address != 0) and
* commit the requested memory as needed. This bypasses the standard heap, but
* XEXs should never be overwriting anything so that's fine. We can also query
* for previous commits and assert that we really isn't committing twice.
*
* GPU memory is mapped onto the lower 512mb of the virtual 4k range (0).
* So 0xA0000000 = 0x00000000. A more sophisticated allocator could handle
* this.
*/
static Memory* active_memory_ = nullptr;
void CrashDump() {
static std::atomic<int> in_crash_dump(0);
if (in_crash_dump.fetch_add(1)) {
xe::FatalError(
"Hard crash: the memory system crashed while dumping a crash dump.");
return;
}
active_memory_->DumpMap();
--in_crash_dump;
}
Memory::Memory() {
system_page_size_ = uint32_t(xe::memory::page_size());
assert_zero(active_memory_);
active_memory_ = this;
}
Memory::~Memory() {
assert_true(active_memory_ == this);
active_memory_ = nullptr;
// Uninstall the MMIO handler, as we won't be able to service more
// requests.
mmio_handler_.reset();
heaps_.v00000000.Dispose();
heaps_.v40000000.Dispose();
heaps_.v80000000.Dispose();
heaps_.v90000000.Dispose();
heaps_.vA0000000.Dispose();
heaps_.vC0000000.Dispose();
heaps_.vE0000000.Dispose();
heaps_.physical.Dispose();
// Unmap all views and close mapping.
if (mapping_) {
UnmapViews();
xe::memory::CloseFileMappingHandle(mapping_);
mapping_base_ = nullptr;
mapping_ = nullptr;
}
virtual_membase_ = nullptr;
physical_membase_ = nullptr;
}
int Memory::Initialize() {
file_name_ = std::wstring(L"Local\\xenia_memory_") +
std::to_wstring(Clock::QueryHostTickCount());
// Create main page file-backed mapping. This is all reserved but
// uncommitted (so it shouldn't expand page file).
mapping_ = xe::memory::CreateFileMappingHandle(
file_name_,
// entire 4gb space + 512mb physical:
0x11FFFFFFF, xe::memory::PageAccess::kReadWrite, false);
if (!mapping_) {
XELOGE("Unable to reserve the 4gb guest address space.");
assert_not_null(mapping_);
return 1;
}
// Attempt to create our views. This may fail at the first address
// we pick, so try a few times.
mapping_base_ = 0;
for (size_t n = 32; n < 64; n++) {
auto mapping_base = reinterpret_cast<uint8_t*>(1ull << n);
if (!MapViews(mapping_base)) {
mapping_base_ = mapping_base;
break;
}
}
if (!mapping_base_) {
XELOGE("Unable to find a continuous block in the 64bit address space.");
assert_always();
return 1;
}
virtual_membase_ = mapping_base_;
physical_membase_ = mapping_base_ + 0x100000000ull;
// Prepare virtual heaps.
heaps_.v00000000.Initialize(virtual_membase_, 0x00000000, 0x40000000, 4096);
heaps_.v40000000.Initialize(virtual_membase_, 0x40000000,
0x40000000 - 0x01000000, 64 * 1024);
heaps_.v80000000.Initialize(virtual_membase_, 0x80000000, 0x10000000,
64 * 1024);
heaps_.v90000000.Initialize(virtual_membase_, 0x90000000, 0x10000000, 4096);
// Prepare physical heaps.
heaps_.physical.Initialize(physical_membase_, 0x00000000, 0x20000000, 4096);
// HACK: should be 64k, but with us overlaying A and E it needs to be 4.
/*heaps_.vA0000000.Initialize(virtual_membase_, 0xA0000000, 0x20000000,
64 * 1024, &heaps_.physical);*/
heaps_.vA0000000.Initialize(virtual_membase_, 0xA0000000, 0x20000000,
4 * 1024, &heaps_.physical);
heaps_.vC0000000.Initialize(virtual_membase_, 0xC0000000, 0x20000000,
16 * 1024 * 1024, &heaps_.physical);
heaps_.vE0000000.Initialize(virtual_membase_, 0xE0000000, 0x1FD00000, 4096,
&heaps_.physical);
// Take the first page at 0 so we can check for writes.
heaps_.v00000000.AllocFixed(
0x00000000, 64 * 1024, 64 * 1024,
kMemoryAllocationReserve | kMemoryAllocationCommit,
!FLAGS_protect_zero ? kMemoryProtectRead | kMemoryProtectWrite
: kMemoryProtectNoAccess);
// GPU writeback.
// 0xC... is physical, 0x7F... is virtual. We may need to overlay these.
heaps_.vC0000000.AllocFixed(
0xC0000000, 0x01000000, 32,
kMemoryAllocationReserve | kMemoryAllocationCommit,
kMemoryProtectRead | kMemoryProtectWrite);
// Add handlers for MMIO.
mmio_handler_ =
cpu::MMIOHandler::Install(virtual_membase_, physical_membase_);
if (!mmio_handler_) {
XELOGE("Unable to install MMIO handlers");
assert_always();
return 1;
}
// ?
uint32_t unk_phys_alloc;
heaps_.vA0000000.Alloc(0x340000, 64 * 1024, kMemoryAllocationReserve,
kMemoryProtectNoAccess, true, &unk_phys_alloc);
return 0;
}
static const struct {
uint64_t virtual_address_start;
uint64_t virtual_address_end;
uint64_t target_address;
} map_info[] = {
// (1024mb) - virtual 4k pages
{
0x00000000, 0x3FFFFFFF, 0x0000000000000000ull,
},
// (1024mb) - virtual 64k pages (cont)
{
0x40000000, 0x7EFFFFFF, 0x0000000040000000ull,
},
// (16mb) - GPU writeback + 15mb of XPS?
{
0x7F000000, 0x7FFFFFFF, 0x0000000100000000ull,
},
// (256mb) - xex 64k pages
{
0x80000000, 0x8FFFFFFF, 0x0000000080000000ull,
},
// (256mb) - xex 4k pages
{
0x90000000, 0x9FFFFFFF, 0x0000000080000000ull,
},
// (512mb) - physical 64k pages
{
0xA0000000, 0xBFFFFFFF, 0x0000000100000000ull,
},
// - physical 16mb pages
{
0xC0000000, 0xDFFFFFFF, 0x0000000100000000ull,
},
// - physical 4k pages
{
0xE0000000, 0xFFFFFFFF, 0x0000000100000000ull,
},
// - physical raw
{
0x100000000, 0x11FFFFFFF, 0x0000000100000000ull,
},
};
int Memory::MapViews(uint8_t* mapping_base) {
assert_true(xe::countof(map_info) == xe::countof(views_.all_views));
for (size_t n = 0; n < xe::countof(map_info); n++) {
views_.all_views[n] = reinterpret_cast<uint8_t*>(xe::memory::MapFileView(
mapping_, mapping_base + map_info[n].virtual_address_start,
map_info[n].virtual_address_end - map_info[n].virtual_address_start + 1,
xe::memory::PageAccess::kReadWrite, map_info[n].target_address));
if (!views_.all_views[n]) {
// Failed, so bail and try again.
UnmapViews();
return 1;
}
}
return 0;
}
void Memory::UnmapViews() {
for (size_t n = 0; n < xe::countof(views_.all_views); n++) {
if (views_.all_views[n]) {
size_t length = map_info[n].virtual_address_end -
map_info[n].virtual_address_start + 1;
xe::memory::UnmapFileView(mapping_, views_.all_views[n], length);
}
}
}
BaseHeap* Memory::LookupHeap(uint32_t address) {
if (address < 0x40000000) {
return &heaps_.v00000000;
} else if (address < 0x7F000000) {
return &heaps_.v40000000;
} else if (address < 0x80000000) {
return nullptr;
} else if (address < 0x90000000) {
return &heaps_.v80000000;
} else if (address < 0xA0000000) {
return &heaps_.v90000000;
} else if (address < 0xC0000000) {
return &heaps_.vA0000000;
} else if (address < 0xE0000000) {
return &heaps_.vC0000000;
} else if (address < 0xFFD00000) {
return &heaps_.vE0000000;
} else {
return nullptr;
}
}
BaseHeap* Memory::LookupHeapByType(bool physical, uint32_t page_size) {
if (physical) {
if (page_size <= 4096) {
// HACK: should be vE0000000
return &heaps_.vA0000000;
} else if (page_size <= 64 * 1024) {
return &heaps_.vA0000000;
} else {
return &heaps_.vC0000000;
}
} else {
if (page_size <= 4096) {
return &heaps_.v00000000;
} else {
return &heaps_.v40000000;
}
}
}
void Memory::Zero(uint32_t address, uint32_t size) {
std::memset(TranslateVirtual(address), 0, size);
}
void Memory::Fill(uint32_t address, uint32_t size, uint8_t value) {
std::memset(TranslateVirtual(address), value, size);
}
void Memory::Copy(uint32_t dest, uint32_t src, uint32_t size) {
uint8_t* pdest = TranslateVirtual(dest);
const uint8_t* psrc = TranslateVirtual(src);
std::memcpy(pdest, psrc, size);
}
uint32_t Memory::SearchAligned(uint32_t start, uint32_t end,
const uint32_t* values, size_t value_count) {
assert_true(start <= end);
auto p = TranslateVirtual<const uint32_t*>(start);
auto pe = TranslateVirtual<const uint32_t*>(end);
while (p != pe) {
if (*p == values[0]) {
const uint32_t* pc = p + 1;
size_t matched = 1;
for (size_t n = 1; n < value_count; n++, pc++) {
if (*pc != values[n]) {
break;
}
matched++;
}
if (matched == value_count) {
return uint32_t(reinterpret_cast<const uint8_t*>(p) - virtual_membase_);
}
}
p++;
}
return 0;
}
bool Memory::AddVirtualMappedRange(uint32_t virtual_address, uint32_t mask,
uint32_t size, void* context,
cpu::MMIOReadCallback read_callback,
cpu::MMIOWriteCallback write_callback) {
if (!xe::memory::AllocFixed(TranslateVirtual(virtual_address), size,
xe::memory::AllocationType::kCommit,
xe::memory::PageAccess::kNoAccess)) {
XELOGE("Unable to map range; commit/protect failed");
return false;
}
return mmio_handler_->RegisterRange(virtual_address, mask, size, context,
read_callback, write_callback);
}
cpu::MMIORange* Memory::LookupVirtualMappedRange(uint32_t virtual_address) {
return mmio_handler_->LookupRange(virtual_address);
}
uintptr_t Memory::AddPhysicalWriteWatch(uint32_t physical_address,
uint32_t length,
cpu::WriteWatchCallback callback,
void* callback_context,
void* callback_data) {
return mmio_handler_->AddPhysicalWriteWatch(
physical_address, length, callback, callback_context, callback_data);
}
void Memory::CancelWriteWatch(uintptr_t watch_handle) {
mmio_handler_->CancelWriteWatch(watch_handle);
}
uint32_t Memory::SystemHeapAlloc(uint32_t size, uint32_t alignment,
uint32_t system_heap_flags) {
// TODO(benvanik): lightweight pool.
bool is_physical = !!(system_heap_flags & kSystemHeapPhysical);
auto heap = LookupHeapByType(is_physical, 4096);
uint32_t address;
if (!heap->Alloc(size, alignment,
kMemoryAllocationReserve | kMemoryAllocationCommit,
kMemoryProtectRead | kMemoryProtectWrite, false, &address)) {
return 0;
}
Zero(address, size);
return address;
}
void Memory::SystemHeapFree(uint32_t address) {
if (!address) {
return;
}
// TODO(benvanik): lightweight pool.
auto heap = LookupHeap(address);
heap->Release(address);
}
void Memory::DumpMap() {
XELOGE("==================================================================");
XELOGE("Memory Dump");
XELOGE("==================================================================");
XELOGE(" System Page Size: %d (%.8X)", system_page_size_, system_page_size_);
XELOGE(" Virtual Membase: %.16llX", virtual_membase_);
XELOGE(" Physical Membase: %.16llX", physical_membase_);
XELOGE("");
XELOGE("------------------------------------------------------------------");
XELOGE("Virtual Heaps");
XELOGE("------------------------------------------------------------------");
XELOGE("");
heaps_.v00000000.DumpMap();
heaps_.v40000000.DumpMap();
heaps_.v80000000.DumpMap();
heaps_.v90000000.DumpMap();
XELOGE("");
XELOGE("------------------------------------------------------------------");
XELOGE("Physical Heaps");
XELOGE("------------------------------------------------------------------");
XELOGE("");
heaps_.physical.DumpMap();
heaps_.vA0000000.DumpMap();
heaps_.vC0000000.DumpMap();
heaps_.vE0000000.DumpMap();
XELOGE("");
}
xe::memory::PageAccess ToPageAccess(uint32_t protect) {
if ((protect & kMemoryProtectRead) && !(protect & kMemoryProtectWrite)) {
return xe::memory::PageAccess::kReadOnly;
} else if ((protect & kMemoryProtectRead) &&
(protect & kMemoryProtectWrite)) {
return xe::memory::PageAccess::kReadWrite;
} else {
return xe::memory::PageAccess::kNoAccess;
}
}
BaseHeap::BaseHeap()
: membase_(nullptr), heap_base_(0), heap_size_(0), page_size_(0) {}
BaseHeap::~BaseHeap() = default;
void BaseHeap::Initialize(uint8_t* membase, uint32_t heap_base,
uint32_t heap_size, uint32_t page_size) {
membase_ = membase;
heap_base_ = heap_base;
heap_size_ = heap_size - 1;
page_size_ = page_size;
page_table_.resize(heap_size / page_size);
}
void BaseHeap::Dispose() {
// Walk table and release all regions.
for (uint32_t page_number = 0; page_number < page_table_.size();
++page_number) {
auto& page_entry = page_table_[page_number];
if (page_entry.state) {
xe::memory::DeallocFixed(membase_ + heap_base_ + page_number * page_size_,
0, xe::memory::DeallocationType::kRelease);
page_number += page_entry.region_page_count;
}
}
}
void BaseHeap::DumpMap() {
auto global_lock = global_critical_region_.Acquire();
XELOGE("------------------------------------------------------------------");
XELOGE("Heap: %.8X-%.8X", heap_base_, heap_base_ + heap_size_);
XELOGE("------------------------------------------------------------------");
XELOGE(" Heap Base: %.8X", heap_base_);
XELOGE(" Heap Size: %d (%.8X)", heap_size_, heap_size_);
XELOGE(" Page Size: %d (%.8X)", page_size_, page_size_);
XELOGE(" Page Count: %lld", page_table_.size());
bool is_empty_span = false;
uint32_t empty_span_start = 0;
for (uint32_t i = 0; i < uint32_t(page_table_.size()); ++i) {
auto& page = page_table_[i];
if (!page.state) {
if (!is_empty_span) {
is_empty_span = true;
empty_span_start = i;
}
continue;
}
if (is_empty_span) {
XELOGE(" %.8X-%.8X %6dp %10db unreserved",
heap_base_ + empty_span_start * page_size_,
heap_base_ + i * page_size_, i - empty_span_start,
(i - empty_span_start) * page_size_);
is_empty_span = false;
}
const char* state_name = " ";
if (page.state & kMemoryAllocationCommit) {
state_name = "COM";
} else if (page.state & kMemoryAllocationReserve) {
state_name = "RES";
}
char access_r = (page.current_protect & kMemoryProtectRead) ? 'R' : ' ';
char access_w = (page.current_protect & kMemoryProtectWrite) ? 'W' : ' ';
XELOGE(" %.8X-%.8X %6dp %10db %s %c%c", heap_base_ + i * page_size_,
heap_base_ + (i + page.region_page_count) * page_size_,
page.region_page_count, page.region_page_count * page_size_,
state_name, access_r, access_w);
i += page.region_page_count - 1;
}
if (is_empty_span) {
XELOGE(" %.8X-%.8X - %d unreserved pages)",
heap_base_ + empty_span_start * page_size_, heap_base_ + heap_size_,
page_table_.size() - empty_span_start);
}
}
bool BaseHeap::Alloc(uint32_t size, uint32_t alignment,
uint32_t allocation_type, uint32_t protect, bool top_down,
uint32_t* out_address) {
*out_address = 0;
size = xe::round_up(size, page_size_);
alignment = xe::round_up(alignment, page_size_);
uint32_t low_address = heap_base_;
uint32_t high_address = heap_base_ + heap_size_;
return AllocRange(low_address, high_address, size, alignment, allocation_type,
protect, top_down, out_address);
}
bool BaseHeap::AllocFixed(uint32_t base_address, uint32_t size,
uint32_t alignment, uint32_t allocation_type,
uint32_t protect) {
alignment = xe::round_up(alignment, page_size_);
size = xe::align(size, alignment);
assert_true(base_address % alignment == 0);
uint32_t page_count = get_page_count(size, page_size_);
uint32_t start_page_number = (base_address - heap_base_) / page_size_;
uint32_t end_page_number = start_page_number + page_count - 1;
if (start_page_number >= page_table_.size() ||
end_page_number > page_table_.size()) {
XELOGE("BaseHeap::AllocFixed passed out of range address range");
return false;
}
auto global_lock = global_critical_region_.Acquire();
// - If we are reserving the entire range requested must not be already
// reserved.
// - If we are committing it's ok for pages within the range to already be
// committed.
for (uint32_t page_number = start_page_number; page_number <= end_page_number;
++page_number) {
uint32_t state = page_table_[page_number].state;
if ((allocation_type == kMemoryAllocationReserve) && state) {
// Already reserved.
XELOGE(
"BaseHeap::AllocFixed attempting to reserve an already reserved "
"range");
return false;
}
if ((allocation_type == kMemoryAllocationCommit) &&
!(state & kMemoryAllocationReserve)) {
// Attempting a commit-only op on an unreserved page.
// This may be OK.
XELOGW("BaseHeap::AllocFixed attempting commit on unreserved page");
allocation_type |= kMemoryAllocationReserve;
break;
}
}
// Allocate from host.
if (allocation_type == kMemoryAllocationReserve) {
// Reserve is not needed, as we are mapped already.
} else {
auto alloc_type = (allocation_type & kMemoryAllocationCommit)
? xe::memory::AllocationType::kCommit
: xe::memory::AllocationType::kReserve;
void* result = xe::memory::AllocFixed(
membase_ + heap_base_ + start_page_number * page_size_,
page_count * page_size_, alloc_type, ToPageAccess(protect));
if (!result) {
XELOGE("BaseHeap::AllocFixed failed to alloc range from host");
return false;
}
if (FLAGS_scribble_heap && protect & kMemoryProtectWrite) {
std::memset(result, 0xCD, page_count * page_size_);
}
}
// Set page state.
for (uint32_t page_number = start_page_number; page_number <= end_page_number;
++page_number) {
auto& page_entry = page_table_[page_number];
if (allocation_type & kMemoryAllocationReserve) {
// Region is based on reservation.
page_entry.base_address = start_page_number;
page_entry.region_page_count = page_count;
}
page_entry.allocation_protect = protect;
page_entry.current_protect = protect;
page_entry.state = kMemoryAllocationReserve | allocation_type;
}
return true;
}
bool BaseHeap::AllocRange(uint32_t low_address, uint32_t high_address,
uint32_t size, uint32_t alignment,
uint32_t allocation_type, uint32_t protect,
bool top_down, uint32_t* out_address) {
*out_address = 0;
alignment = xe::round_up(alignment, page_size_);
uint32_t page_count = get_page_count(size, page_size_);
low_address = std::max(heap_base_, xe::align(low_address, alignment));
high_address =
std::min(heap_base_ + heap_size_, xe::align(high_address, alignment));
uint32_t low_page_number = (low_address - heap_base_) / page_size_;
uint32_t high_page_number = (high_address - heap_base_) / page_size_;
low_page_number = std::min(uint32_t(page_table_.size()) - 1, low_page_number);
high_page_number =
std::min(uint32_t(page_table_.size()) - 1, high_page_number);
if (page_count > (high_page_number - low_page_number)) {
XELOGE("BaseHeap::Alloc page count too big for requested range");
return false;
}
auto global_lock = global_critical_region_.Acquire();
// Find a free page range.
// The base page must match the requested alignment, so we first scan for
// a free aligned page and only then check for continuous free pages.
// TODO(benvanik): optimized searching (free list buckets, bitmap, etc).
uint32_t start_page_number = UINT_MAX;
uint32_t end_page_number = UINT_MAX;
uint32_t page_scan_stride = alignment / page_size_;
high_page_number = high_page_number - (high_page_number % page_scan_stride);
if (top_down) {
for (int64_t base_page_number = high_page_number - page_count;
base_page_number >= low_page_number;
base_page_number -= page_scan_stride) {
if (page_table_[base_page_number].state != 0) {
// Base page not free, skip to next usable page.
continue;
}
// Check requested range to ensure free.
start_page_number = uint32_t(base_page_number);
end_page_number = uint32_t(base_page_number) + page_count - 1;
assert_true(end_page_number < page_table_.size());
bool any_taken = false;
for (uint32_t page_number = uint32_t(base_page_number);
!any_taken && page_number <= end_page_number; ++page_number) {
bool is_free = page_table_[page_number].state == 0;
if (!is_free) {
// At least one page in the range is used, skip to next.
// We know we'll be starting at least before this page.
any_taken = true;
if (page_count > page_number) {
// Not enough space left to fit entire page range. Breaks outer
// loop.
base_page_number = -1;
} else {
base_page_number = page_number - page_count;
base_page_number -= base_page_number % page_scan_stride;
base_page_number += page_scan_stride; // cancel out loop logic
}
break;
}
}
if (!any_taken) {
// Found our place.
break;
}
// Retry.
start_page_number = end_page_number = UINT_MAX;
}
} else {
for (uint32_t base_page_number = low_page_number;
base_page_number <= high_page_number - page_count;
base_page_number += page_scan_stride) {
if (page_table_[base_page_number].state != 0) {
// Base page not free, skip to next usable page.
continue;
}
// Check requested range to ensure free.
start_page_number = base_page_number;
end_page_number = base_page_number + page_count - 1;
bool any_taken = false;
for (uint32_t page_number = base_page_number;
!any_taken && page_number <= end_page_number; ++page_number) {
bool is_free = page_table_[page_number].state == 0;
if (!is_free) {
// At least one page in the range is used, skip to next.
// We know we'll be starting at least after this page.
any_taken = true;
base_page_number = xe::round_up(page_number + 1, page_scan_stride);
base_page_number -= page_scan_stride; // cancel out loop logic
break;
}
}
if (!any_taken) {
// Found our place.
break;
}
// Retry.
start_page_number = end_page_number = UINT_MAX;
}
}
if (start_page_number == UINT_MAX || end_page_number == UINT_MAX) {
// Out of memory.
XELOGE("BaseHeap::Alloc failed to find contiguous range");
assert_always("Heap exhausted!");
return false;
}
// Allocate from host.
if (allocation_type == kMemoryAllocationReserve) {
// Reserve is not needed, as we are mapped already.
} else {
auto alloc_type = (allocation_type & kMemoryAllocationCommit)
? xe::memory::AllocationType::kCommit
: xe::memory::AllocationType::kReserve;
void* result = xe::memory::AllocFixed(
membase_ + heap_base_ + start_page_number * page_size_,
page_count * page_size_, alloc_type, ToPageAccess(protect));
if (!result) {
XELOGE("BaseHeap::Alloc failed to alloc range from host");
return false;
}
if (FLAGS_scribble_heap && (protect & kMemoryProtectWrite)) {
std::memset(result, 0xCD, page_count * page_size_);
}
}
// Set page state.
for (uint32_t page_number = start_page_number; page_number <= end_page_number;
++page_number) {
auto& page_entry = page_table_[page_number];
page_entry.base_address = start_page_number;
page_entry.region_page_count = page_count;
page_entry.allocation_protect = protect;
page_entry.current_protect = protect;
page_entry.state = kMemoryAllocationReserve | allocation_type;
}
*out_address = heap_base_ + (start_page_number * page_size_);
return true;
}
bool BaseHeap::Decommit(uint32_t address, uint32_t size) {
uint32_t page_count = get_page_count(size, page_size_);
uint32_t start_page_number = (address - heap_base_) / page_size_;
uint32_t end_page_number = start_page_number + page_count - 1;
start_page_number =
std::min(uint32_t(page_table_.size()) - 1, start_page_number);
end_page_number = std::min(uint32_t(page_table_.size()) - 1, end_page_number);
auto global_lock = global_critical_region_.Acquire();
// Release from host.
// TODO(benvanik): find a way to actually decommit memory;
// mapped memory cannot be decommitted.
/*BOOL result =
VirtualFree(membase_ + heap_base_ + start_page_number * page_size_,
page_count * page_size_, MEM_DECOMMIT);
if (!result) {
PLOGW("BaseHeap::Decommit failed due to host VirtualFree failure");
return false;
}*/
// Perform table change.
for (uint32_t page_number = start_page_number; page_number <= end_page_number;
++page_number) {
auto& page_entry = page_table_[page_number];
page_entry.state &= ~kMemoryAllocationCommit;
}
return true;
}
bool BaseHeap::Release(uint32_t base_address, uint32_t* out_region_size) {
auto global_lock = global_critical_region_.Acquire();
// Given address must be a region base address.
uint32_t base_page_number = (base_address - heap_base_) / page_size_;
auto base_page_entry = page_table_[base_page_number];
if (base_page_entry.base_address != base_page_number) {
XELOGE("BaseHeap::Release failed because address is not a region start");
// return false;
}
if (out_region_size) {
*out_region_size = (base_page_entry.region_page_count * page_size_);
}
// Release from host not needed as mapping reserves the range for us.
// TODO(benvanik): protect with NOACCESS?
/*BOOL result = VirtualFree(
membase_ + heap_base_ + base_page_number * page_size_, 0, MEM_RELEASE);
if (!result) {
PLOGE("BaseHeap::Release failed due to host VirtualFree failure");
return false;
}*/
// Instead, we just protect it, if we can.
if (page_size_ == xe::memory::page_size() ||
((base_page_entry.region_page_count * page_size_) %
xe::memory::page_size() ==
0 &&
((base_page_number * page_size_) % xe::memory::page_size() == 0))) {
if (!xe::memory::Protect(
membase_ + heap_base_ + base_page_number * page_size_,
base_page_entry.region_page_count * page_size_,
xe::memory::PageAccess::kNoAccess, nullptr)) {
XELOGW("BaseHeap::Release failed due to host VirtualProtect failure");
}
}
// Perform table change.
uint32_t end_page_number =
base_page_number + base_page_entry.region_page_count - 1;
for (uint32_t page_number = base_page_number; page_number <= end_page_number;
++page_number) {
auto& page_entry = page_table_[page_number];
page_entry.qword = 0;
}
return true;
}
bool BaseHeap::Protect(uint32_t address, uint32_t size, uint32_t protect) {
uint32_t page_count = xe::round_up(size, page_size_) / page_size_;
uint32_t start_page_number = (address - heap_base_) / page_size_;
uint32_t end_page_number = start_page_number + page_count - 1;
start_page_number =
std::min(uint32_t(page_table_.size()) - 1, start_page_number);
end_page_number = std::min(uint32_t(page_table_.size()) - 1, end_page_number);
auto global_lock = global_critical_region_.Acquire();
// Ensure all pages are in the same reserved region and all are committed.
uint32_t first_base_address = UINT_MAX;
for (uint32_t page_number = start_page_number; page_number <= end_page_number;
++page_number) {
auto page_entry = page_table_[page_number];
if (first_base_address == UINT_MAX) {
first_base_address = page_entry.base_address;
} else if (first_base_address != page_entry.base_address) {
XELOGE("BaseHeap::Protect failed due to request spanning regions");
return false;
}
if (!(page_entry.state & kMemoryAllocationCommit)) {
XELOGE("BaseHeap::Protect failed due to uncommitted page");
return false;
}
}
// Attempt host change (hopefully won't fail).
// We can only do this if our size matches system page granularity.
if (page_size_ == xe::memory::page_size() ||
(((page_count * page_size_) % xe::memory::page_size() == 0) &&
((start_page_number * page_size_) % xe::memory::page_size() == 0))) {
if (!xe::memory::Protect(
membase_ + heap_base_ + start_page_number * page_size_,
page_count * page_size_, ToPageAccess(protect), nullptr)) {
XELOGE("BaseHeap::Protect failed due to host VirtualProtect failure");
return false;
}
} else {
XELOGW("BaseHeap::Protect: ignoring request as not 64k page aligned");
}
// Perform table change.
for (uint32_t page_number = start_page_number; page_number <= end_page_number;
++page_number) {
auto& page_entry = page_table_[page_number];
page_entry.current_protect = protect;
}
return true;
}
bool BaseHeap::QueryRegionInfo(uint32_t base_address,
HeapAllocationInfo* out_info) {
uint32_t start_page_number = (base_address - heap_base_) / page_size_;
if (start_page_number > page_table_.size()) {
XELOGE("BaseHeap::QueryRegionInfo base page out of range");
return false;
}
auto global_lock = global_critical_region_.Acquire();
auto start_page_entry = page_table_[start_page_number];
out_info->base_address = base_address;
out_info->allocation_base = 0;
out_info->allocation_protect = 0;
out_info->region_size = 0;
out_info->state = 0;
out_info->protect = 0;
out_info->type = 0;
if (start_page_entry.state) {
// Committed/reserved region.
out_info->allocation_base = start_page_entry.base_address * page_size_;
out_info->allocation_protect = start_page_entry.allocation_protect;
out_info->state = start_page_entry.state;
out_info->protect = start_page_entry.current_protect;
out_info->type = 0x20000;
for (uint32_t page_number = start_page_number;
page_number < start_page_number + start_page_entry.region_page_count;
++page_number) {
auto page_entry = page_table_[page_number];
if (page_entry.base_address != start_page_entry.base_address ||
page_entry.state != start_page_entry.state ||
page_entry.current_protect != start_page_entry.current_protect) {
// Different region or different properties within the region; done.
break;
}
out_info->region_size += page_size_;
}
} else {
// Free region.
for (uint32_t page_number = start_page_number;
page_number < page_table_.size(); ++page_number) {
auto page_entry = page_table_[page_number];
if (page_entry.state) {
// First non-free page; done with region.
break;
}
out_info->region_size += page_size_;
}
}
return true;
}
bool BaseHeap::QuerySize(uint32_t address, uint32_t* out_size) {
uint32_t page_number = (address - heap_base_) / page_size_;
if (page_number > page_table_.size()) {
XELOGE("BaseHeap::QuerySize base page out of range");
*out_size = 0;
return false;
}
auto global_lock = global_critical_region_.Acquire();
auto page_entry = page_table_[page_number];
*out_size = (page_entry.region_page_count * page_size_);
return true;
}
bool BaseHeap::QueryProtect(uint32_t address, uint32_t* out_protect) {
uint32_t page_number = (address - heap_base_) / page_size_;
if (page_number > page_table_.size()) {
XELOGE("BaseHeap::QueryProtect base page out of range");
*out_protect = 0;
return false;
}
auto global_lock = global_critical_region_.Acquire();
auto page_entry = page_table_[page_number];
*out_protect = page_entry.current_protect;
return true;
}
uint32_t BaseHeap::GetPhysicalAddress(uint32_t address) {
// Only valid for memory in this range - will be bogus if the origin was
// outside of it.
uint32_t physical_address = address & 0x1FFFFFFF;
if (address >= 0xE0000000) {
physical_address += 0x1000;
}
return physical_address;
}
VirtualHeap::VirtualHeap() = default;
VirtualHeap::~VirtualHeap() = default;
void VirtualHeap::Initialize(uint8_t* membase, uint32_t heap_base,
uint32_t heap_size, uint32_t page_size) {
BaseHeap::Initialize(membase, heap_base, heap_size, page_size);
}
PhysicalHeap::PhysicalHeap() : parent_heap_(nullptr) {}
PhysicalHeap::~PhysicalHeap() = default;
void PhysicalHeap::Initialize(uint8_t* membase, uint32_t heap_base,
uint32_t heap_size, uint32_t page_size,
VirtualHeap* parent_heap) {
BaseHeap::Initialize(membase, heap_base, heap_size, page_size);
parent_heap_ = parent_heap;
}
bool PhysicalHeap::Alloc(uint32_t size, uint32_t alignment,
uint32_t allocation_type, uint32_t protect,
bool top_down, uint32_t* out_address) {
*out_address = 0;
// Default top-down. Since parent heap is bottom-up this prevents collisions.
top_down = true;
// Adjust alignment size our page size differs from the parent.
size = xe::round_up(size, page_size_);
alignment = xe::round_up(alignment, page_size_);
auto global_lock = global_critical_region_.Acquire();
// Allocate from parent heap (gets our physical address in 0-512mb).
uint32_t parent_low_address = GetPhysicalAddress(heap_base_);
uint32_t parent_high_address = GetPhysicalAddress(heap_base_ + heap_size_);
uint32_t parent_address;
if (!parent_heap_->AllocRange(parent_low_address, parent_high_address, size,
alignment, allocation_type, protect, top_down,
&parent_address)) {
XELOGE(
"PhysicalHeap::Alloc unable to alloc physical memory in parent heap");
return false;
}
if (heap_base_ >= 0xE0000000) {
parent_address -= 0x1000;
}
// Given the address we've reserved in the parent heap, pin that here.
// Shouldn't be possible for it to be allocated already.
uint32_t address = heap_base_ + parent_address;
if (!BaseHeap::AllocFixed(address, size, alignment, allocation_type,
protect)) {
XELOGE(
"PhysicalHeap::Alloc unable to pin physical memory in physical heap");
// TODO(benvanik): don't leak parent memory.
return false;
}
*out_address = address;
return true;
}
bool PhysicalHeap::AllocFixed(uint32_t base_address, uint32_t size,
uint32_t alignment, uint32_t allocation_type,
uint32_t protect) {
// Adjust alignment size our page size differs from the parent.
size = xe::round_up(size, page_size_);
alignment = xe::round_up(alignment, page_size_);
auto global_lock = global_critical_region_.Acquire();
// Allocate from parent heap (gets our physical address in 0-512mb).
// NOTE: this can potentially overwrite heap contents if there are already
// committed pages in the requested physical range.
// TODO(benvanik): flag for ensure-not-committed?
uint32_t parent_base_address = GetPhysicalAddress(base_address);
if (!parent_heap_->AllocFixed(parent_base_address, size, alignment,
allocation_type, protect)) {
XELOGE(
"PhysicalHeap::Alloc unable to alloc physical memory in parent heap");
return false;
}
if (heap_base_ >= 0xE0000000) {
parent_base_address -= 0x1000;
}
// Given the address we've reserved in the parent heap, pin that here.
// Shouldn't be possible for it to be allocated already.
uint32_t address = heap_base_ + parent_base_address;
if (!BaseHeap::AllocFixed(address, size, alignment, allocation_type,
protect)) {
XELOGE(
"PhysicalHeap::Alloc unable to pin physical memory in physical heap");
// TODO(benvanik): don't leak parent memory.
return false;
}
return true;
}
bool PhysicalHeap::AllocRange(uint32_t low_address, uint32_t high_address,
uint32_t size, uint32_t alignment,
uint32_t allocation_type, uint32_t protect,
bool top_down, uint32_t* out_address) {
*out_address = 0;
// Adjust alignment size our page size differs from the parent.
size = xe::round_up(size, page_size_);
alignment = xe::round_up(alignment, page_size_);
auto global_lock = global_critical_region_.Acquire();
// Allocate from parent heap (gets our physical address in 0-512mb).
low_address = std::max(heap_base_, low_address);
high_address = std::min(heap_base_ + heap_size_, high_address);
uint32_t parent_low_address = GetPhysicalAddress(low_address);
uint32_t parent_high_address = GetPhysicalAddress(high_address);
uint32_t parent_address;
if (!parent_heap_->AllocRange(parent_low_address, parent_high_address, size,
alignment, allocation_type, protect, top_down,
&parent_address)) {
XELOGE(
"PhysicalHeap::Alloc unable to alloc physical memory in parent heap");
return false;
}
if (heap_base_ >= 0xE0000000) {
parent_address -= 0x1000;
}
// Given the address we've reserved in the parent heap, pin that here.
// Shouldn't be possible for it to be allocated already.
uint32_t address = heap_base_ + parent_address;
if (!BaseHeap::AllocFixed(address, size, alignment, allocation_type,
protect)) {
XELOGE(
"PhysicalHeap::Alloc unable to pin physical memory in physical heap");
// TODO(benvanik): don't leak parent memory.
return false;
}
*out_address = address;
return true;
}
bool PhysicalHeap::Decommit(uint32_t address, uint32_t size) {
auto global_lock = global_critical_region_.Acquire();
uint32_t parent_address = GetPhysicalAddress(address);
if (!parent_heap_->Decommit(parent_address, size)) {
XELOGE("PhysicalHeap::Decommit failed due to parent heap failure");
return false;
}
return BaseHeap::Decommit(address, size);
}
bool PhysicalHeap::Release(uint32_t base_address, uint32_t* out_region_size) {
auto global_lock = global_critical_region_.Acquire();
uint32_t parent_base_address = GetPhysicalAddress(base_address);
if (!parent_heap_->Release(parent_base_address, out_region_size)) {
XELOGE("PhysicalHeap::Release failed due to parent heap failure");
return false;
}
return BaseHeap::Release(base_address, out_region_size);
}
bool PhysicalHeap::Protect(uint32_t address, uint32_t size, uint32_t protect) {
auto global_lock = global_critical_region_.Acquire();
uint32_t parent_address = GetPhysicalAddress(address);
bool parent_result = parent_heap_->Protect(parent_address, size, protect);
if (!parent_result) {
XELOGE("PhysicalHeap::Protect failed due to parent heap failure");
return false;
}
return BaseHeap::Protect(address, size, protect);
}
} // namespace xe
| {
"content_hash": "fdce2bb55235f324ce3a48c9181fb7bf",
"timestamp": "",
"source": "github",
"line_count": 1142,
"max_line_length": 80,
"avg_line_length": 36.464098073555164,
"alnum_prop": 0.6241294846549157,
"repo_name": "herman-rogers/xenia",
"id": "7904a61ca44a3d449a83077cbcb3679bcb54574d",
"size": "42129",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/xenia/memory.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "284930"
},
{
"name": "Batchfile",
"bytes": "1182"
},
{
"name": "C",
"bytes": "8726"
},
{
"name": "C++",
"bytes": "3131147"
},
{
"name": "Lua",
"bytes": "17475"
},
{
"name": "PHP",
"bytes": "372385"
},
{
"name": "Python",
"bytes": "27913"
}
],
"symlink_target": ""
} |
class Point < ActiveRecord::Base
# Relations
belongs_to :layer
# Validations
validates :name, :presence => true
validates :longitude, :numericality => true, :inclusion => { :in => -180..180 }
validates :latitude, :numericality => true, :inclusion => { :in => -90..90}
include Geometry
end
| {
"content_hash": "ac7d828d6ff623c33736245cc36f763e",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 81,
"avg_line_length": 27.90909090909091,
"alnum_prop": 0.6579804560260586,
"repo_name": "bamnet/flagship_geo",
"id": "59f8166ffdb3777958ce44ca1bf33a4a0a3818c9",
"size": "307",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/models/point.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "3743"
},
{
"name": "Ruby",
"bytes": "40654"
}
],
"symlink_target": ""
} |
cask :v1 => 'apptivate' do
version :latest
sha256 :no_check
url 'http://www.apptivateapp.com/resources/Apptivate.app.zip'
homepage 'http://www.apptivateapp.com'
license :unknown # todo: improve this machine-generated value
app 'Apptivate.app'
end
| {
"content_hash": "42071d40058c01f32b6a68eff8ef759d",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 66,
"avg_line_length": 26.4,
"alnum_prop": 0.7196969696969697,
"repo_name": "andyshinn/homebrew-cask",
"id": "d8e0bc6b7dd7573b402624b17a7bf4930dc700a5",
"size": "264",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "Casks/apptivate.rb",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Ruby",
"bytes": "1255107"
},
{
"name": "Shell",
"bytes": "53964"
}
],
"symlink_target": ""
} |
package com.amazonaws.services.alexaforbusiness.model.transform;
import java.math.*;
import javax.annotation.Generated;
import com.amazonaws.services.alexaforbusiness.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* SkillGroupData JSON Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class SkillGroupDataJsonUnmarshaller implements Unmarshaller<SkillGroupData, JsonUnmarshallerContext> {
public SkillGroupData unmarshall(JsonUnmarshallerContext context) throws Exception {
SkillGroupData skillGroupData = new SkillGroupData();
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null)
token = context.nextToken();
if (token == VALUE_NULL) {
return null;
}
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
if (context.testExpression("SkillGroupArn", targetDepth)) {
context.nextToken();
skillGroupData.setSkillGroupArn(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("SkillGroupName", targetDepth)) {
context.nextToken();
skillGroupData.setSkillGroupName(context.getUnmarshaller(String.class).unmarshall(context));
}
if (context.testExpression("Description", targetDepth)) {
context.nextToken();
skillGroupData.setDescription(context.getUnmarshaller(String.class).unmarshall(context));
}
} else if (token == END_ARRAY || token == END_OBJECT) {
if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
if (context.getCurrentDepth() <= originalDepth)
break;
}
}
token = context.nextToken();
}
return skillGroupData;
}
private static SkillGroupDataJsonUnmarshaller instance;
public static SkillGroupDataJsonUnmarshaller getInstance() {
if (instance == null)
instance = new SkillGroupDataJsonUnmarshaller();
return instance;
}
}
| {
"content_hash": "bf127b3dfb5864b6a5e40b657baab544",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 136,
"avg_line_length": 37.521126760563384,
"alnum_prop": 0.6351351351351351,
"repo_name": "jentfoo/aws-sdk-java",
"id": "d67eee34efdb429da48de21659524484df7f5a6c",
"size": "3244",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-java-sdk-alexaforbusiness/src/main/java/com/amazonaws/services/alexaforbusiness/model/transform/SkillGroupDataJsonUnmarshaller.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "270"
},
{
"name": "FreeMarker",
"bytes": "173637"
},
{
"name": "Gherkin",
"bytes": "25063"
},
{
"name": "Java",
"bytes": "356214839"
},
{
"name": "Scilab",
"bytes": "3924"
},
{
"name": "Shell",
"bytes": "295"
}
],
"symlink_target": ""
} |
package com.planet_ink.coffee_mud.Abilities.Skills;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Libraries.interfaces.TimeManager;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;
import java.util.*;
@SuppressWarnings("rawtypes")
public class Skill_Convert extends StdSkill
{
@Override public String ID() { return "Skill_Convert"; }
private final static String localizedName = CMLib.lang().L("Convert");
@Override public String name() { return localizedName; }
@Override protected int canAffectCode(){return CAN_MOBS;}
@Override protected int canTargetCode(){return CAN_MOBS;}
@Override public int abstractQuality(){return Ability.QUALITY_INDIFFERENT;}
private static final String[] triggerStrings =I(new String[] {"CONVERT"});
@Override public String[] triggerStrings(){return triggerStrings;}
@Override public int classificationCode(){return Ability.ACODE_SKILL|Ability.DOMAIN_EVANGELISM;}
protected static PairVector<MOB,Long> convertStack=new PairVector<MOB,Long>();
@Override public int overrideMana(){return 50;}
@Override public String displayText(){return "";}
protected String priorFaith="";
@Override
public void unInvoke()
{
// undo the affects of this spell
if(!(affected instanceof MOB))
return;
final MOB mob=(MOB)affected;
super.unInvoke();
if(canBeUninvoked())
{
if(text().length()>0)
mob.tell(L("You start to have doubts about @x1.",text()));
mob.setWorshipCharID(priorFaith);
}
}
@Override
public boolean tick(Tickable ticking, int tickID)
{
if((text().length()>0)&&(affected instanceof MOB)&&(!text().equals(((MOB)affected).getWorshipCharID())))
((MOB)affected).setWorshipCharID(text());
return super.tick(ticking,tickID);
}
@Override
public boolean invoke(MOB mob, Vector commands, Physical givenTarget, boolean auto, int asLevel)
{
if(commands.size()==0)
{
mob.tell(L("You must specify either a deity to convert yourself to, or a player to convert to your religion."));
if(mob.isMonster())
CMLib.commands().postSay(mob,null,L("I am unable to convert."),false,false);
return false;
}
MOB target=mob;
Deity D=CMLib.map().getDeity(CMParms.combine(commands,0));
if(D==null)
{
D=mob.getMyDeity();
target=getTarget(mob,commands,givenTarget,false,true);
if(target==null)
{
mob.tell(L("You've also never heard of a deity called '@x1'.",CMParms.combine(commands,0)));
if(mob.isMonster())
CMLib.commands().postSay(mob,target,L("I've never heard of '@x1'.",CMParms.combine(commands,0)),false,false);
return false;
}
if(D==null)
{
mob.tell(L("A faithless one cannot convert @x1.",target.name(mob)));
if(mob.isMonster())
CMLib.commands().postSay(mob,target,L("I am faithless, and can not convert you."),false,false);
return false;
}
}
if((CMLib.flags().isAnimalIntelligence(target))
||((target.isMonster())&&(target.phyStats().level()>mob.phyStats().level())))
{
mob.tell(L("You can't convert @x1.",target.name(mob)));
if(mob.isMonster())
CMLib.commands().postSay(mob,target,L("I can not convert you."),false,false);
return false;
}
if(target.getMyDeity()==D)
{
mob.tell(L("@x1 already worships @x2.",target.name(mob),D.name()));
if(mob.isMonster())
CMLib.commands().postSay(mob,target,L("You already worship @x1.",D.Name()),false,false);
return false;
}
if(!auto)
{
if(convertStack.containsFirst(target))
{
final Long L=convertStack.getSecond(convertStack.indexOfFirst(target));
if((System.currentTimeMillis()-L.longValue())>CMProps.getMillisPerMudHour()*5)
convertStack.removeElementFirst(target);
}
if(convertStack.containsFirst(target))
{
mob.tell(L("@x1 must wait to be converted again.",target.name(mob)));
if(mob.isMonster())
CMLib.commands().postSay(mob,target,L("You must wait to be converted again."),false,false);
return false;
}
}
final boolean success=proficiencyCheck(mob,0,auto);
boolean targetMadeSave=CMLib.dice().roll(1,100,0)>(target.charStats().getSave(CharStats.STAT_FAITH));
if(CMSecurity.isASysOp(mob))
targetMadeSave=false;
if((!target.isMonster())&&(success)&&(targetMadeSave)&&(target.getMyDeity()!=null))
{
mob.tell(L("@x1 is worshipping @x2. @x3 must REBUKE @x4 first.",target.name(mob),target.getMyDeity().name(),target.charStats().HeShe(),target.getMyDeity().charStats().himher()));
if(mob.isMonster())
CMLib.commands().postSay(mob,target,L("You already worship @x1.",target.getMyDeity().Name()),false,false);
return false;
}
if((success)&&(targetMadeSave)&&(!target.isMonster())&&(target!=mob))
{
try
{
if(!target.session().confirm(L("\n\r@x1 is trying to convert you to the worship of @x2. Is this what you want (N/y)?",mob.name(target),D.name()),L("N")))
{
mob.location().show(mob,target,CMMsg.MSG_SPEAK,L("<S-YOUPOSS> attempt to convert <T-NAME> to the worship of @x1 is rejected.",D.name()));
return false;
}
targetMadeSave=!success;
}
catch(final Exception e)
{
return false;
}
}
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return false;
if((success)&&((!targetMadeSave)||(target==mob)))
{
Room dRoom=D.location();
if(dRoom==mob.location())
dRoom=null;
if(target.getMyDeity()!=null)
{
final Ability A=target.fetchEffect(ID());
if(A!=null){ A.unInvoke(); target.delEffect(A);}
final CMMsg msg2=CMClass.getMsg(target,D,this,CMMsg.MSG_REBUKE,null);
if((mob.location().okMessage(mob,msg2))&&((dRoom==null)||(dRoom.okMessage(mob,msg2))))
{
mob.location().send(target,msg2);
if(dRoom!=null)
dRoom.send(target,msg2);
}
}
final CMMsg msg=CMClass.getMsg(mob,target,this,CMMsg.MSG_SPEAK,auto?L("<T-NAME> <T-IS-ARE> converted!"):L("<S-NAME> convert(s) <T-NAMESELF> to the worship of @x1.",D.name()));
final CMMsg msg2=CMClass.getMsg(target,D,this,CMMsg.MSG_SERVE,null);
if((mob.location().okMessage(mob,msg))
&&(mob.location().okMessage(mob,msg2))
&&((dRoom==null)||(dRoom.okMessage(mob,msg2))))
{
mob.location().send(mob,msg);
mob.location().send(target,msg2);
if(dRoom!=null)
dRoom.send(target,msg2);
convertStack.addElement(target,Long.valueOf(System.currentTimeMillis()));
if(mob!=target)
if(target.isMonster())
CMLib.leveler().postExperience(mob,null,null,1,false);
else
CMLib.leveler().postExperience(mob,null,null,200,false);
if(target.isMonster())
{
beneficialAffect(mob,target,asLevel,(int)(TimeManager.MILI_HOUR/CMProps.getTickMillis()));
final Skill_Convert A=(Skill_Convert)target.fetchEffect(ID());
if(A!=null)
A.priorFaith=target.getWorshipCharID();
}
}
}
else
{
if((target.isMonster())&&(target.fetchEffect("Prayer_ReligiousDoubt")==null))
{
final Ability A=CMClass.getAbility("Prayer_ReligiousDoubt");
if(A!=null)
A.invoke(mob,target,true,asLevel);
}
else
beneficialWordsFizzle(mob,target,L("<S-NAME> attempt(s) to convert <T-NAMESELF>, but <S-IS-ARE> unconvincing."));
}
// return whether it worked
return success;
}
@Override
public void makeLongLasting()
{
tickDown=(int)(CMProps.getTicksPerMinute()*60*24*7);
}
}
| {
"content_hash": "c7878a9635fb959e8d0202e8a52c4d7b",
"timestamp": "",
"source": "github",
"line_count": 222,
"max_line_length": 182,
"avg_line_length": 36.7027027027027,
"alnum_prop": 0.6705940108001963,
"repo_name": "Tycheo/coffeemud",
"id": "201a98c5f9a1544746a4f2a7e8ae313751d9e47c",
"size": "8752",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "com/planet_ink/coffee_mud/Abilities/Skills/Skill_Convert.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "5783"
},
{
"name": "CSS",
"bytes": "1515"
},
{
"name": "HTML",
"bytes": "9650029"
},
{
"name": "Java",
"bytes": "26062781"
},
{
"name": "JavaScript",
"bytes": "24025"
},
{
"name": "Makefile",
"bytes": "23191"
},
{
"name": "Shell",
"bytes": "8525"
}
],
"symlink_target": ""
} |
#region Usings
using System;
#endregion
namespace NoSQL.GraphDB.Index.Fulltext
{
/// <summary>
/// Fallen8 fulltext index interface.
/// </summary>
public interface IFulltextIndex : IIndex
{
/// <summary>
/// Tries to query the fulltext index.
/// </summary>
/// <returns>
/// <c>true</c> if something was found; otherwise, <c>false</c>.
/// </returns>
/// <param name='result'>
/// Result.
/// </param>
/// <param name='query'>
/// Query.
/// </param>
Boolean TryQuery (out FulltextSearchResult result, string query);
}
}
| {
"content_hash": "fac5b959f164aa256e1d47a30621eca9",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 67,
"avg_line_length": 19.766666666666666,
"alnum_prop": 0.5834738617200674,
"repo_name": "cosh/fallen-8",
"id": "0c8e1f499420ebf311e44a765694d6067f56da0e",
"size": "1836",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Fallen-8/Index/Fulltext/IFulltextIndex.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "643655"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8" ?>
<XML>
<Content>UPDATE</Content>
<Clip>
<ClipName>INGAWT0013</ClipName>
<TipoContenido>INGLES</TipoContenido>
<Contenido><![CDATA[ GLOBAL AFRICAN 16OCT14]]></Contenido>
<OriginalTitle></OriginalTitle>
<Description> </Description>
<Notes>a</Notes>
<DurPrev></DurPrev>
<Chapter></Chapter>
<EndDate></EndDate>
<EPG></EPG>
<EPG_Content> </EPG_Content>
<Segments>
<Segment>
<SegTitle>1-1 GLOBAL AFRICAN (BILL FLECHERT Jr) - GLOBAL AFRICAN 16OCT14</SegTitle>
<MediaID>INGAWT001301</MediaID>
<Duration>00:30:00.00</Duration>
<SegNumber>1</SegNumber>
<ClipGroup>PROGRAMA</ClipGroup>
<Description> </Description>
</Segment>
</Segments></Clip></XML> | {
"content_hash": "c1e4dbc229b432b4cec2780b1d07feb4",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 103,
"avg_line_length": 41.80769230769231,
"alnum_prop": 0.45814167433302666,
"repo_name": "valeraovalles/sait",
"id": "5ee9ca36758c5999f5c182bf490af94212f3625a",
"size": "1087",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "web/uploads/creatv/xml/INGAWT0013.xml",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "270692"
},
{
"name": "Erlang",
"bytes": "4333"
},
{
"name": "Java",
"bytes": "65391"
},
{
"name": "JavaScript",
"bytes": "1449856"
},
{
"name": "PHP",
"bytes": "6514811"
},
{
"name": "Perl",
"bytes": "41836"
},
{
"name": "Shell",
"bytes": "5701"
}
],
"symlink_target": ""
} |
// Provides enumeration sap.ui.model.FilterOperator
sap.ui.define(function() {
"use strict";
/**
* Binding type definitions.
*
* @namespace
* @public
* @alias sap.ui.model.BindingMode
*/
var BindingMode = /** @lends sap.ui.model.BindingMode */ {
/**
* BindingMode default means that the binding mode of the model is used
* @public
*/
Default: "Default",
/**
* BindingMode one time means value is only read from the model once
* @public
*/
OneTime: "OneTime",
/**
* BindingMode one way means from model to view
* @public
*/
OneWay: "OneWay",
/**
* BindingMode two way means from model to view and vice versa
* @public
*/
TwoWay: "TwoWay"
};
return BindingMode;
}, /* bExport= */ true);
| {
"content_hash": "e54d09700c3204983911876fecf36604",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 74,
"avg_line_length": 17.42222222222222,
"alnum_prop": 0.6058673469387755,
"repo_name": "pensoffsky/OpenUI5-AppCache",
"id": "fd81162295b717165c7ab6c73c59eb457e371d53",
"size": "969",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "resources/sap/ui/model/BindingMode-dbg.js",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "802093"
},
{
"name": "HTML",
"bytes": "5331"
},
{
"name": "JavaScript",
"bytes": "21281396"
}
],
"symlink_target": ""
} |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| AUTO-LOADER
| -------------------------------------------------------------------
| This file specifies which systems should be loaded by default.
|
| In order to keep the framework as light-weight as possible only the
| absolute minimal resources are loaded by default. For example,
| the database is not connected to automatically since no assumption
| is made regarding whether you intend to use it. This file lets
| you globally define which systems you would like loaded with every
| request.
|
| -------------------------------------------------------------------
| Instructions
| -------------------------------------------------------------------
|
| These are the things you can load automatically:
|
| 1. Packages
| 2. Libraries
| 3. Helper files
| 4. Custom config files
| 5. Language files
| 6. Models
|
*/
/*
| -------------------------------------------------------------------
| Auto-load Packges
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['packages'] = array(APPPATH.'third_party', '/usr/local/shared');
|
*/
$autoload['packages'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Libraries
| -------------------------------------------------------------------
| These are the classes located in the system/libraries folder
| or in your application/libraries folder.
|
| Prototype:
|
| $autoload['libraries'] = array('database', 'session', 'xmlrpc');
*/
$autoload['libraries'] = array('database', 'session','encrypt', 'form_validation');
/*
| -------------------------------------------------------------------
| Auto-load Helper Files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['helper'] = array('url', 'file');
*/
$autoload['helper'] = array('url', 'form');
/*
| -------------------------------------------------------------------
| Auto-load Config files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['config'] = array('config1', 'config2');
|
| NOTE: This item is intended for use ONLY if you have created custom
| config files. Otherwise, leave it blank.
|
*/
$autoload['config'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Language files
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['language'] = array('lang1', 'lang2');
|
| NOTE: Do not include the "_lang" part of your file. For example
| "codeigniter_lang.php" would be referenced as array('codeigniter');
|
*/
$autoload['language'] = array();
/*
| -------------------------------------------------------------------
| Auto-load Models
| -------------------------------------------------------------------
| Prototype:
|
| $autoload['model'] = array('model1', 'model2');
|
*/
$autoload['model'] = array();
/* End of file autoload.php */
/* Location: ./application/config/autoload.php */
| {
"content_hash": "3607623c8e185458db28b6a89c67d7e5",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 83,
"avg_line_length": 27.17241379310345,
"alnum_prop": 0.4365482233502538,
"repo_name": "luispipe/roap",
"id": "e069751259ecb151d7beadbc1bf36330f36bb7c4",
"size": "3152",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "application/config/autoload.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "648"
},
{
"name": "CSS",
"bytes": "152491"
},
{
"name": "HTML",
"bytes": "1321132"
},
{
"name": "JavaScript",
"bytes": "147341"
},
{
"name": "PHP",
"bytes": "1671007"
}
],
"symlink_target": ""
} |
using Newtonsoft.Json.Serialization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Formatting;
using System.Web.Http;
namespace Project1.API
{
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
// Web API configuration and services
var jsonFormatter = config.Formatters.OfType<JsonMediaTypeFormatter>().First();
jsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
// Web API routes
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
}
}
}
| {
"content_hash": "a584f80a11e8fd1b23deb323b42337ba",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 109,
"avg_line_length": 30.714285714285715,
"alnum_prop": 0.6430232558139535,
"repo_name": "sumeet-shah-90/SDN.Project1",
"id": "7f87562a3666c1424d926c9f3f7bcb07dd3025b1",
"size": "862",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Project1.API/Project1.API/App_Start/WebApiConfig.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "106"
},
{
"name": "C#",
"bytes": "134702"
},
{
"name": "CSS",
"bytes": "2198"
},
{
"name": "HTML",
"bytes": "5067"
},
{
"name": "JavaScript",
"bytes": "21032"
},
{
"name": "Pascal",
"bytes": "81971"
},
{
"name": "PowerShell",
"bytes": "10128"
},
{
"name": "Puppet",
"bytes": "2111"
}
],
"symlink_target": ""
} |
PEGASUS_NAMESPACE_BEGIN
extern CMPIInstanceFT *CMPI_Instance_Ftab;
extern CMPIInstanceFT *CMPI_InstanceOnStack_Ftab;
extern CMPIObjectPathFT *CMPI_ObjectPath_Ftab;
extern CMPIObjectPathFT *CMPI_ObjectPathOnStack_Ftab;
extern CMPIArgsFT *CMPI_Args_Ftab;
extern CMPIArgsFT *CMPI_ArgsOnStack_Ftab;
extern CMPIContextFT *CMPI_Context_Ftab;
extern CMPIContextFT *CMPI_ContextOnStack_Ftab;
extern CMPIResultFT *CMPI_ResultRefOnStack_Ftab;
extern CMPIResultFT *CMPI_ResultInstOnStack_Ftab;
extern CMPIResultFT *CMPI_ResultData_Ftab;
extern CMPIResultFT *CMPI_ResultMethOnStack_Ftab;
extern CMPIResultFT *CMPI_ResultResponseOnStack_Ftab;
extern CMPIResultFT *CMPI_ResultExecQueryOnStack_Ftab;
extern CMPIDateTimeFT *CMPI_DateTime_Ftab;
extern CMPIArrayFT *CMPI_Array_Ftab;
extern CMPIStringFT *CMPI_String_Ftab;
extern CMPISelectExpFT *CMPI_SelectExp_Ftab;
extern CMPISelectCondFT *CMPI_SelectCond_Ftab;
extern CMPISubCondFT *CMPI_SubCond_Ftab;
extern CMPIPredicateFT *CMPI_Predicate_Ftab;
extern CMPIBrokerFT *CMPI_Broker_Ftab;
extern CMPIBrokerEncFT *CMPI_BrokerEnc_Ftab;
extern CMPIBrokerExtFT *CMPI_BrokerExt_Ftab;
extern CMPIEnumerationFT *CMPI_ObjEnumeration_Ftab;
extern CMPIEnumerationFT *CMPI_InstEnumeration_Ftab;
extern CMPIEnumerationFT *CMPI_OpEnumeration_Ftab;
PEGASUS_NAMESPACE_END
#endif
| {
"content_hash": "d48e57d2434391380855a5761b549732",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 54,
"avg_line_length": 31.878048780487806,
"alnum_prop": 0.8408569242540168,
"repo_name": "ncultra/Pegasus-2.5",
"id": "fdd525d2d413acdcbce71ff81ec662c62680b9b8",
"size": "3472",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Pegasus/ProviderManager2/CMPI/CMPI_Ftabs.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Awk",
"bytes": "8389"
},
{
"name": "C",
"bytes": "2094310"
},
{
"name": "C++",
"bytes": "16778278"
},
{
"name": "Erlang",
"bytes": "59698"
},
{
"name": "Java",
"bytes": "477479"
},
{
"name": "Objective-C",
"bytes": "165760"
},
{
"name": "Perl",
"bytes": "16616"
},
{
"name": "Scala",
"bytes": "255"
},
{
"name": "Shell",
"bytes": "61767"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
Index Fungorum
#### Published in
in Bon, Migliozzi & Cherubini, Docums Mycol. 19(no. 76): 74 (1989)
#### Original name
Nyctalis agaricoides f. agaricoides
### Remarks
null | {
"content_hash": "b6c4f9db33a75ad5b2d6121a3585e03e",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 66,
"avg_line_length": 15.538461538461538,
"alnum_prop": 0.7079207920792079,
"repo_name": "mdoering/backbone",
"id": "63cbc60801e8c2fcb2becd4f7b7f728077273e65",
"size": "258",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Fungi/Basidiomycota/Agaricomycetes/Agaricales/Lyophyllaceae/Asterophora/Asterophora lycoperdoides/Nyctalis agaricoides agaricoides/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<?php
namespace source\modules\i18n\models;
use Yii;
use yii\db\ActiveRecord;
/**
* This is the model class for table "{{%source_message}}".
*
* @property integer $id
* @property string $category
* @property string $message
*
* @property Message[] $translation
*/
class SourceMessage extends ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%source_message}}';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['message'], 'string'],
[['category'], 'string', 'max' => 255],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => Yii::t('app', 'ID'),
'category' => Yii::t('app', 'Category'),
'message' => Yii::t('app', 'Message'),
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getTranslation()
{
return $this->hasMany(Message::className(), ['id' => 'id']);
}
}
| {
"content_hash": "3d16d9717471556d4cb8f0966c48eadf",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 68,
"avg_line_length": 18.70175438596491,
"alnum_prop": 0.5037523452157598,
"repo_name": "Brandon-Xu/LemonCMS",
"id": "1352b5f5955a53effddb9cc2a2187b78c7cc05bd",
"size": "1066",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "source/modules/i18n/models/SourceMessage.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "41943"
},
{
"name": "CSS",
"bytes": "229948"
},
{
"name": "HTML",
"bytes": "113771"
},
{
"name": "Java",
"bytes": "10698"
},
{
"name": "JavaScript",
"bytes": "1394360"
},
{
"name": "PHP",
"bytes": "711781"
}
],
"symlink_target": ""
} |
import './mentor-home-page.html';
import './mentor-mentorspace-page.html';
import './mentor-mentorspace-page.js';
import './mentor-mentorspace-page.css';
| {
"content_hash": "818a126c62c9d02b6ff0e17bbf5b64ef",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 40,
"avg_line_length": 38.5,
"alnum_prop": 0.7402597402597403,
"repo_name": "radgrad/radgrad",
"id": "59de0e55559a683967ef53ddbcbe93b69775a4cd",
"size": "154",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/imports/ui/pages/mentor/index.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "7218"
},
{
"name": "HTML",
"bytes": "518789"
},
{
"name": "JavaScript",
"bytes": "1643515"
},
{
"name": "Shell",
"bytes": "9949"
}
],
"symlink_target": ""
} |
<div class="sidebar">
<div class="container sidebar-sticky">
<img id="avatar" src="{{ site.baseurl }}img/avatar.png" alt="Me" width="200px">
<div class="sidebar-about">
<h1>
<a href="{{ site.baseurl }}">
{{ site.title }}
</a>
</h1>
<p class="lead">{{ site.description }}</p>
</div>
<nav class="sidebar-nav">
<a class="sidebar-nav-item{% if page.url == site.baseurl %} active{% endif %}" href="{{ site.baseurl }}">Home</a>
{% comment %}
The code below dynamically generates a sidebar nav of pages with
`layout: page` in the front-matter. See readme for usage.
{% endcomment %}
{% assign pages_list = site.pages %}
{% for node in pages_list %}
{% if node.title != null %}
{% if node.layout == "page" %}
<a class="sidebar-nav-item{% if page.url == node.url %} active{% endif %}" href="{{ node.url }}">{{ node.title }}</a>
{% endif %}
{% endif %}
{% endfor %}
<a class="sidebar-nav-item" href="{{ site.github.repo }}/resume.pdf">Resume</a>
<a class="sidebar-nav-item" href="http://github.com/yarbroughw">GitHub</a>
</nav>
<p>Currently v{{ site.version }}.</p>
<p>© {{ site.time | date: '%Y' }}. All rights reserved.</p>
</div>
</div>
| {
"content_hash": "7ca8ac9041c7d6eac82a478eefaa39f4",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 129,
"avg_line_length": 35.945945945945944,
"alnum_prop": 0.5353383458646617,
"repo_name": "yarbroughw/yarbroughw.github.io",
"id": "ec7808a77a37910e89a4af55578333afd14913c3",
"size": "1330",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_includes/sidebar.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "14797"
},
{
"name": "HTML",
"bytes": "3705"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="Sample" default="run" basedir=".">
<property file="../build.properties"/>
<description>Sample build file</description>
<property name="dist.dir" location="../../../dist"/>
<property name="bin.dir" location="../bin"/>
<property name="lib.dir" location="../../../lib"/>
<path id="class.path">
<pathelement path="${java.class.path}/"/>
<fileset dir="${lib.dir}" includes="**/*.jar"/>
<pathelement location="${dist.dir}/jserver.jar"/>
</path>
<path id="class.path.run">
<path refid="class.path"/>
<pathelement path="${bin.dir}/"/>
</path>
<!-- RUN TARGET-->
<target name="run" description="Runs the sample">
<java classpathref="class.path.run" classname="ProxyServer" fork="true"/>
</target>
</project>
| {
"content_hash": "51461258a24e1a36a28611ecbf9c1f86",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 75,
"avg_line_length": 27.129032258064516,
"alnum_prop": 0.5957193816884662,
"repo_name": "tolo/JServer",
"id": "500de2c92e4ff5cdab2ec7c5736040be4db0c064",
"size": "841",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "samples/proxy/proxy/build.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C++",
"bytes": "1831"
},
{
"name": "CSS",
"bytes": "3105"
},
{
"name": "Java",
"bytes": "4663098"
},
{
"name": "Objective-C",
"bytes": "825"
},
{
"name": "Shell",
"bytes": "95"
}
],
"symlink_target": ""
} |
/**
* ContentMetadataKeyHierarchyServiceSoapBindingStub.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter.
*/
package com.google.api.ads.dfp.axis.v201602;
public class ContentMetadataKeyHierarchyServiceSoapBindingStub extends org.apache.axis.client.Stub implements com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchyServiceInterface {
private java.util.Vector cachedSerClasses = new java.util.Vector();
private java.util.Vector cachedSerQNames = new java.util.Vector();
private java.util.Vector cachedSerFactories = new java.util.Vector();
private java.util.Vector cachedDeserFactories = new java.util.Vector();
static org.apache.axis.description.OperationDesc [] _operations;
static {
_operations = new org.apache.axis.description.OperationDesc[4];
_initOperationDesc1();
}
private static void _initOperationDesc1(){
org.apache.axis.description.OperationDesc oper;
org.apache.axis.description.ParameterDesc param;
oper = new org.apache.axis.description.OperationDesc();
oper.setName("createContentMetadataKeyHierarchies");
param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "contentMetadataKeyHierarchies"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ContentMetadataKeyHierarchy"), com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchy[].class, false, false);
param.setOmittable(true);
oper.addParameter(param);
oper.setReturnType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ContentMetadataKeyHierarchy"));
oper.setReturnClass(com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchy[].class);
oper.setReturnQName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "rval"));
oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
oper.setUse(org.apache.axis.constants.Use.LITERAL);
oper.addFault(new org.apache.axis.description.FaultDesc(
new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ApiExceptionFault"),
"com.google.api.ads.dfp.axis.v201602.ApiException",
new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ApiException"),
true
));
_operations[0] = oper;
oper = new org.apache.axis.description.OperationDesc();
oper.setName("getContentMetadataKeyHierarchiesByStatement");
param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "filterStatement"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "Statement"), com.google.api.ads.dfp.axis.v201602.Statement.class, false, false);
param.setOmittable(true);
oper.addParameter(param);
oper.setReturnType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ContentMetadataKeyHierarchyPage"));
oper.setReturnClass(com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchyPage.class);
oper.setReturnQName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "rval"));
oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
oper.setUse(org.apache.axis.constants.Use.LITERAL);
oper.addFault(new org.apache.axis.description.FaultDesc(
new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ApiExceptionFault"),
"com.google.api.ads.dfp.axis.v201602.ApiException",
new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ApiException"),
true
));
_operations[1] = oper;
oper = new org.apache.axis.description.OperationDesc();
oper.setName("performContentMetadataKeyHierarchyAction");
param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "contentMetadataKeyHierarchyAction"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ContentMetadataKeyHierarchyAction"), com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchyAction.class, false, false);
param.setOmittable(true);
oper.addParameter(param);
param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "filterStatement"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "Statement"), com.google.api.ads.dfp.axis.v201602.Statement.class, false, false);
param.setOmittable(true);
oper.addParameter(param);
oper.setReturnType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "UpdateResult"));
oper.setReturnClass(com.google.api.ads.dfp.axis.v201602.UpdateResult.class);
oper.setReturnQName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "rval"));
oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
oper.setUse(org.apache.axis.constants.Use.LITERAL);
oper.addFault(new org.apache.axis.description.FaultDesc(
new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ApiExceptionFault"),
"com.google.api.ads.dfp.axis.v201602.ApiException",
new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ApiException"),
true
));
_operations[2] = oper;
oper = new org.apache.axis.description.OperationDesc();
oper.setName("updateContentMetadataKeyHierarchies");
param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "contentMetadataKeyHierarchies"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ContentMetadataKeyHierarchy"), com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchy[].class, false, false);
param.setOmittable(true);
oper.addParameter(param);
oper.setReturnType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ContentMetadataKeyHierarchy"));
oper.setReturnClass(com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchy[].class);
oper.setReturnQName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "rval"));
oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
oper.setUse(org.apache.axis.constants.Use.LITERAL);
oper.addFault(new org.apache.axis.description.FaultDesc(
new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ApiExceptionFault"),
"com.google.api.ads.dfp.axis.v201602.ApiException",
new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ApiException"),
true
));
_operations[3] = oper;
}
public ContentMetadataKeyHierarchyServiceSoapBindingStub() throws org.apache.axis.AxisFault {
this(null);
}
public ContentMetadataKeyHierarchyServiceSoapBindingStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
this(service);
super.cachedEndpoint = endpointURL;
}
public ContentMetadataKeyHierarchyServiceSoapBindingStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
if (service == null) {
super.service = new org.apache.axis.client.Service();
} else {
super.service = service;
}
((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2");
java.lang.Class cls;
javax.xml.namespace.QName qName;
javax.xml.namespace.QName qName2;
java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class;
java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class;
java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class;
java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class;
java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class;
java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class;
java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class;
java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class;
java.lang.Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class;
java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class;
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ApiError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.ApiError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ApiException");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.ApiException.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ApiVersionError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.ApiVersionError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ApiVersionError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.ApiVersionErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ApplicationException");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.ApplicationException.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "AuthenticationError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.AuthenticationError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "AuthenticationError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.AuthenticationErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "BooleanValue");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.BooleanValue.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "CollectionSizeError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.CollectionSizeError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "CollectionSizeError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.CollectionSizeErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "CommonError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.CommonError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "CommonError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.CommonErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ContentMetadataKeyHierarchy");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchy.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ContentMetadataKeyHierarchyAction");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchyAction.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ContentMetadataKeyHierarchyError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchyError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ContentMetadataKeyHierarchyError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchyErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ContentMetadataKeyHierarchyLevel");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchyLevel.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ContentMetadataKeyHierarchyPage");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchyPage.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ContentMetadataKeyHierarchyStatus");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchyStatus.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "Date");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.Date.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "DateTime");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.DateTime.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "DateTimeValue");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.DateTimeValue.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "DateValue");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.DateValue.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "DeleteContentMetadataKeyHierarchies");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.DeleteContentMetadataKeyHierarchies.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "FeatureError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.FeatureError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "FeatureError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.FeatureErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "InternalApiError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.InternalApiError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "InternalApiError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.InternalApiErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "NotNullError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.NotNullError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "NotNullError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.NotNullErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "NumberValue");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.NumberValue.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ObjectValue");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.ObjectValue.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ParseError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.ParseError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ParseError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.ParseErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "PermissionError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.PermissionError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "PermissionError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.PermissionErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "PublisherQueryLanguageContextError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.PublisherQueryLanguageContextError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "PublisherQueryLanguageContextError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.PublisherQueryLanguageContextErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "PublisherQueryLanguageSyntaxError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.PublisherQueryLanguageSyntaxError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "PublisherQueryLanguageSyntaxError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.PublisherQueryLanguageSyntaxErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "QuotaError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.QuotaError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "QuotaError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.QuotaErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "RequiredCollectionError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.RequiredCollectionError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "RequiredCollectionError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.RequiredCollectionErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "RequiredError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.RequiredError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "RequiredError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.RequiredErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "RequiredNumberError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.RequiredNumberError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "RequiredNumberError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.RequiredNumberErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ServerError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.ServerError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "ServerError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.ServerErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "SetValue");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.SetValue.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "SoapRequestHeader");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.SoapRequestHeader.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "SoapResponseHeader");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.SoapResponseHeader.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "Statement");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.Statement.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "StatementError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.StatementError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "StatementError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.StatementErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "String_ValueMapEntry");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.String_ValueMapEntry.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "StringLengthError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.StringLengthError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "StringLengthError.Reason");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.StringLengthErrorReason.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(enumsf);
cachedDeserFactories.add(enumdf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "TextValue");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.TextValue.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "UniqueError");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.UniqueError.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "UpdateResult");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.UpdateResult.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
qName = new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "Value");
cachedSerQNames.add(qName);
cls = com.google.api.ads.dfp.axis.v201602.Value.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
}
protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException {
try {
org.apache.axis.client.Call _call = super._createCall();
if (super.maintainSessionSet) {
_call.setMaintainSession(super.maintainSession);
}
if (super.cachedUsername != null) {
_call.setUsername(super.cachedUsername);
}
if (super.cachedPassword != null) {
_call.setPassword(super.cachedPassword);
}
if (super.cachedEndpoint != null) {
_call.setTargetEndpointAddress(super.cachedEndpoint);
}
if (super.cachedTimeout != null) {
_call.setTimeout(super.cachedTimeout);
}
if (super.cachedPortName != null) {
_call.setPortName(super.cachedPortName);
}
java.util.Enumeration keys = super.cachedProperties.keys();
while (keys.hasMoreElements()) {
java.lang.String key = (java.lang.String) keys.nextElement();
_call.setProperty(key, super.cachedProperties.get(key));
}
// All the type mapping information is registered
// when the first call is made.
// The type mapping information is actually registered in
// the TypeMappingRegistry of the service, which
// is the reason why registration is only needed for the first call.
synchronized (this) {
if (firstCall()) {
// must set encoding style before registering serializers
_call.setEncodingStyle(null);
for (int i = 0; i < cachedSerFactories.size(); ++i) {
java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i);
javax.xml.namespace.QName qName =
(javax.xml.namespace.QName) cachedSerQNames.get(i);
java.lang.Object x = cachedSerFactories.get(i);
if (x instanceof Class) {
java.lang.Class sf = (java.lang.Class)
cachedSerFactories.get(i);
java.lang.Class df = (java.lang.Class)
cachedDeserFactories.get(i);
_call.registerTypeMapping(cls, qName, sf, df, false);
}
else if (x instanceof javax.xml.rpc.encoding.SerializerFactory) {
org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory)
cachedSerFactories.get(i);
org.apache.axis.encoding.DeserializerFactory df = (org.apache.axis.encoding.DeserializerFactory)
cachedDeserFactories.get(i);
_call.registerTypeMapping(cls, qName, sf, df, false);
}
}
}
}
return _call;
}
catch (java.lang.Throwable _t) {
throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t);
}
}
public com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchy[] createContentMetadataKeyHierarchies(com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchy[] contentMetadataKeyHierarchies) throws java.rmi.RemoteException, com.google.api.ads.dfp.axis.v201602.ApiException {
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[0]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setEncodingStyle(null);
_call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
_call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "createContentMetadataKeyHierarchies"));
setRequestHeaders(_call);
setAttachments(_call);
try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {contentMetadataKeyHierarchies});
if (_resp instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException)_resp;
}
else {
extractAttachments(_call);
try {
return (com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchy[]) _resp;
} catch (java.lang.Exception _exception) {
return (com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchy[]) org.apache.axis.utils.JavaUtils.convert(_resp, com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchy[].class);
}
}
} catch (org.apache.axis.AxisFault axisFaultException) {
if (axisFaultException.detail != null) {
if (axisFaultException.detail instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException) axisFaultException.detail;
}
if (axisFaultException.detail instanceof com.google.api.ads.dfp.axis.v201602.ApiException) {
throw (com.google.api.ads.dfp.axis.v201602.ApiException) axisFaultException.detail;
}
}
throw axisFaultException;
}
}
public com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchyPage getContentMetadataKeyHierarchiesByStatement(com.google.api.ads.dfp.axis.v201602.Statement filterStatement) throws java.rmi.RemoteException, com.google.api.ads.dfp.axis.v201602.ApiException {
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[1]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setEncodingStyle(null);
_call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
_call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "getContentMetadataKeyHierarchiesByStatement"));
setRequestHeaders(_call);
setAttachments(_call);
try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {filterStatement});
if (_resp instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException)_resp;
}
else {
extractAttachments(_call);
try {
return (com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchyPage) _resp;
} catch (java.lang.Exception _exception) {
return (com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchyPage) org.apache.axis.utils.JavaUtils.convert(_resp, com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchyPage.class);
}
}
} catch (org.apache.axis.AxisFault axisFaultException) {
if (axisFaultException.detail != null) {
if (axisFaultException.detail instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException) axisFaultException.detail;
}
if (axisFaultException.detail instanceof com.google.api.ads.dfp.axis.v201602.ApiException) {
throw (com.google.api.ads.dfp.axis.v201602.ApiException) axisFaultException.detail;
}
}
throw axisFaultException;
}
}
public com.google.api.ads.dfp.axis.v201602.UpdateResult performContentMetadataKeyHierarchyAction(com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchyAction contentMetadataKeyHierarchyAction, com.google.api.ads.dfp.axis.v201602.Statement filterStatement) throws java.rmi.RemoteException, com.google.api.ads.dfp.axis.v201602.ApiException {
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[2]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setEncodingStyle(null);
_call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
_call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "performContentMetadataKeyHierarchyAction"));
setRequestHeaders(_call);
setAttachments(_call);
try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {contentMetadataKeyHierarchyAction, filterStatement});
if (_resp instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException)_resp;
}
else {
extractAttachments(_call);
try {
return (com.google.api.ads.dfp.axis.v201602.UpdateResult) _resp;
} catch (java.lang.Exception _exception) {
return (com.google.api.ads.dfp.axis.v201602.UpdateResult) org.apache.axis.utils.JavaUtils.convert(_resp, com.google.api.ads.dfp.axis.v201602.UpdateResult.class);
}
}
} catch (org.apache.axis.AxisFault axisFaultException) {
if (axisFaultException.detail != null) {
if (axisFaultException.detail instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException) axisFaultException.detail;
}
if (axisFaultException.detail instanceof com.google.api.ads.dfp.axis.v201602.ApiException) {
throw (com.google.api.ads.dfp.axis.v201602.ApiException) axisFaultException.detail;
}
}
throw axisFaultException;
}
}
public com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchy[] updateContentMetadataKeyHierarchies(com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchy[] contentMetadataKeyHierarchies) throws java.rmi.RemoteException, com.google.api.ads.dfp.axis.v201602.ApiException {
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[3]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setEncodingStyle(null);
_call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
_call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201602", "updateContentMetadataKeyHierarchies"));
setRequestHeaders(_call);
setAttachments(_call);
try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {contentMetadataKeyHierarchies});
if (_resp instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException)_resp;
}
else {
extractAttachments(_call);
try {
return (com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchy[]) _resp;
} catch (java.lang.Exception _exception) {
return (com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchy[]) org.apache.axis.utils.JavaUtils.convert(_resp, com.google.api.ads.dfp.axis.v201602.ContentMetadataKeyHierarchy[].class);
}
}
} catch (org.apache.axis.AxisFault axisFaultException) {
if (axisFaultException.detail != null) {
if (axisFaultException.detail instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException) axisFaultException.detail;
}
if (axisFaultException.detail instanceof com.google.api.ads.dfp.axis.v201602.ApiException) {
throw (com.google.api.ads.dfp.axis.v201602.ApiException) axisFaultException.detail;
}
}
throw axisFaultException;
}
}
}
| {
"content_hash": "a8092934fbb408a9f33523f01c80ba35",
"timestamp": "",
"source": "github",
"line_count": 807,
"max_line_length": 441,
"avg_line_length": 57.0272614622057,
"alnum_prop": 0.6596336455096586,
"repo_name": "gawkermedia/googleads-java-lib",
"id": "1e249ecf059b96de22b62305a42d0eb4cd9af932",
"size": "46021",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "modules/dfp_axis/src/main/java/com/google/api/ads/dfp/axis/v201602/ContentMetadataKeyHierarchyServiceSoapBindingStub.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "107468648"
}
],
"symlink_target": ""
} |
Finite State Building Blocks is a C++ library for quickly building finite-state machines, geared toward game development.
## States and Finite-state Machines
The [State pattern](http://gameprogrammingpatterns.com/state.html) is useful for defining state-dependent behaviour of a program.
It can be use in many places, from general state of application (in game, that could Main Menu, Level, Pause etc.) to animation state of an actor.
However, while the general pattern holds, details of implementation of a state machine vary from case to case.
This make it impossible to provide a single universal state machine, or even a limited set of machines that cover all common use cases.
The aim of this library is to provide simple building blocks to assemble varied finite-state machines.
## Overview of other libraries
There already exist several general-purpose libraries for defining finite-state machines. Howeve, I found that none of them fit my needs.
* [Boost.Statechart](http://www.boost.org/doc/libs/1_61_0/libs/statechart/doc/index.html) is geared toward translating UML charts into C++ code and back. The users need to define their state machines statically, which is often too limiting, as in game development you often need to define states and transitions in resources, for example, when defining animation states. It's also very verbose and hard to use quickly.
* [Boost.Meta State Machine](http://www.boost.org/doc/libs/1_61_0/libs/msm/doc/HTML/index.html) is pretty much the same ideologically.
* [TinyFSM](http://digint.ch/tinyfsm/index.html) is much simplier (and limited) library, however, it too favors statically-defined machines.
* [Libero](http://www.cs.vu.nl/~eliens/mt/@archive/online/archive/documents/libero/lrintr.htm) is an old-school FSM generator which operates on a textual description of a FSM to create C code.
* [GFSM](http://kaskade.dwds.de/~moocow/mirror/projects/gfsm/) is a monstroity of a FSM C library, of which functions I'm not sure, because documentation is mostly "here, take a look at our header files".
As you can see, none of these libraries provide dynamically configurable finite-state machines (despite Boost.Statechart's insistence that "However, fully-featured dynamic FSM libraries do exist").
## Examples
1) Pre-fabricated FSM.
For added simplicty, FSBB also contains a "fsbb_prefab.hpp" header, which has some pre-defined state-machines.
```c++
// A single-state FSM with immediate interface
// States are identified by int
// State itself is a string
fsm_single_immediate<int, std::string> fsm;
fsm.register_state( STATE_ID_1, "state1" );
fsm.register_state( STATE_ID_2, "state1" );
fsm.change_state_immediate( STATE_ID_1 );
const std::string& current_state = fsm.get_current_state();
```
However, you might want to mix-and-match building blocks for your unique use cases without much troubles, too:
```c++
// A pushdown automata with combined immediate/queued interface
// States are identified using a custome class 'state_id'
// State itself is a shared pointer to 'base_state' class, presumbly, with virtual functions that provide state's functionality
// When a state is placed or removed from stack, on_enter and on_exit functions are called on state object, per enter_exit_policy_notify policy
// on_enter/on_exit functions are provided with a non-const reference to 'my_context' class for additional interface to outside world
class my_own_customzed_fsm
: public fsm
<
state_id,
std::shared_ptr<base_state>,
state_container_stacked_interface<state_id, std::shared_ptr<base_state> >,
state_manipulator_stacked_combined_interface<state_id, std::shared_ptr<base_state>, enter_exit_policy_notify, my_context&>
>
{
};
my_own_customzed_fsm fsm;
my_context ctx;
fsm.register_state( state_id_provider.get_id( STATE1 ), std::make_shared<state1>() ); // state1 is a public descendant of base_state
fsm.register_state( state_id_provider.get_id( STATE2 ), std::make_shared<state2>() ); // state2 is a public descendant of base_state
fsm.push_state( state_id_provider.get_id( STATE1 ), ctx ); // Enter the first state immediately
fsm.queue_push_state( state_id_provider.get_id( STATE2 ) ); // Queue entering to state 2
fsm.queue_remove_state( state_id_provider.get_id( STATE1 ) ); // Queue removing of state 1
fsm.update( ctx ); // Process queued actions
```
Constructing your own FSMs might seem a little daunting from this example, but it's really not that hard, and most of the time, you will only need to use pre-fabricated types or define just a few of your own custom types.
## Documentation
Further documentation could be found at: [docs/manual.md](docs/manual.md)
| {
"content_hash": "ef9f7b1ff65b481b8ef22703dc571f14",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 418,
"avg_line_length": 58.08641975308642,
"alnum_prop": 0.7583421891604676,
"repo_name": "MaxSavenkov/fsbb",
"id": "b9d2f717d852fe75c0421f7cad415b32f8beb2e7",
"size": "4736",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "42752"
},
{
"name": "CMake",
"bytes": "404"
}
],
"symlink_target": ""
} |
package org.apache.tez.runtime.library.common.sort.impl.dflt;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.IntBuffer;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.Lists;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.tez.runtime.library.api.IOInterruptedException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.DataInputBuffer;
import org.apache.hadoop.io.RawComparator;
import org.apache.hadoop.util.IndexedSortable;
import org.apache.hadoop.util.Progress;
import org.apache.tez.common.TezUtilsInternal;
import org.apache.tez.runtime.api.Event;
import org.apache.tez.runtime.api.OutputContext;
import org.apache.tez.runtime.library.api.TezRuntimeConfiguration;
import org.apache.tez.runtime.library.common.ConfigUtils;
import org.apache.tez.runtime.library.common.shuffle.ShuffleUtils;
import org.apache.tez.runtime.library.common.sort.impl.ExternalSorter;
import org.apache.tez.runtime.library.common.sort.impl.IFile;
import org.apache.tez.runtime.library.common.sort.impl.TezIndexRecord;
import org.apache.tez.runtime.library.common.sort.impl.TezMerger;
import org.apache.tez.runtime.library.common.sort.impl.TezRawKeyValueIterator;
import org.apache.tez.runtime.library.common.sort.impl.TezSpillRecord;
import org.apache.tez.runtime.library.common.sort.impl.IFile.Writer;
import org.apache.tez.runtime.library.common.sort.impl.TezMerger.Segment;
import com.google.common.base.Preconditions;
@SuppressWarnings({"unchecked", "rawtypes"})
public class DefaultSorter extends ExternalSorter implements IndexedSortable {
private static final Logger LOG = LoggerFactory.getLogger(DefaultSorter.class);
// TODO NEWTEZ Progress reporting to Tez framework. (making progress vs %complete)
/**
* The size of each record in the index file for the map-outputs.
*/
public static final int MAP_OUTPUT_INDEX_RECORD_LENGTH = 24;
private final static int APPROX_HEADER_LENGTH = 150;
// k/v accounting
private final IntBuffer kvmeta; // metadata overlay on backing store
int kvstart; // marks origin of spill metadata
int kvend; // marks end of spill metadata
int kvindex; // marks end of fully serialized records
int equator; // marks origin of meta/serialization
int bufstart; // marks beginning of spill
int bufend; // marks beginning of collectable
int bufmark; // marks end of record
int bufindex; // marks end of collected
int bufvoid; // marks the point where we should stop
// reading at the end of the buffer
private final byte[] kvbuffer; // main output buffer
private final byte[] b0 = new byte[0];
protected static final int VALSTART = 0; // val offset in acct
protected static final int KEYSTART = 1; // key offset in acct
protected static final int PARTITION = 2; // partition offset in acct
protected static final int VALLEN = 3; // length of value
protected static final int NMETA = 4; // num meta ints
protected static final int METASIZE = NMETA * 4; // size in bytes
// spill accounting
final int maxRec;
final int softLimit;
boolean spillInProgress;
int bufferRemaining;
volatile Throwable sortSpillException = null;
final int minSpillsForCombine;
final ReentrantLock spillLock = new ReentrantLock();
final Condition spillDone = spillLock.newCondition();
final Condition spillReady = spillLock.newCondition();
final BlockingBuffer bb = new BlockingBuffer();
volatile boolean spillThreadRunning = false;
final SpillThread spillThread = new SpillThread();
final ArrayList<TezSpillRecord> indexCacheList =
new ArrayList<TezSpillRecord>();
private final int indexCacheMemoryLimit;
private int totalIndexCacheMemory;
private long totalKeys = 0;
private long sameKey = 0;
public static final int MAX_IO_SORT_MB = 1800;
public DefaultSorter(OutputContext outputContext, Configuration conf, int numOutputs,
long initialMemoryAvailable) throws IOException {
super(outputContext, conf, numOutputs, initialMemoryAvailable);
// sanity checks
final float spillper = this.conf.getFloat(
TezRuntimeConfiguration.TEZ_RUNTIME_SORT_SPILL_PERCENT,
TezRuntimeConfiguration.TEZ_RUNTIME_SORT_SPILL_PERCENT_DEFAULT);
final int sortmb = computeSortBufferSize((int) availableMemoryMb);
Preconditions.checkArgument(spillper <= (float) 1.0 && spillper > (float) 0.0,
TezRuntimeConfiguration.TEZ_RUNTIME_SORT_SPILL_PERCENT
+ " should be greater than 0 and less than or equal to 1");
indexCacheMemoryLimit = this.conf.getInt(TezRuntimeConfiguration.TEZ_RUNTIME_INDEX_CACHE_MEMORY_LIMIT_BYTES,
TezRuntimeConfiguration.TEZ_RUNTIME_INDEX_CACHE_MEMORY_LIMIT_BYTES_DEFAULT);
boolean confPipelinedShuffle = this.conf.getBoolean(TezRuntimeConfiguration
.TEZ_RUNTIME_PIPELINED_SHUFFLE_ENABLED, TezRuntimeConfiguration
.TEZ_RUNTIME_PIPELINED_SHUFFLE_ENABLED_DEFAULT);
if (confPipelinedShuffle) {
LOG.warn(TezRuntimeConfiguration.TEZ_RUNTIME_PIPELINED_SHUFFLE_ENABLED + " does not work "
+ "with DefaultSorter. It is supported only with PipelinedSorter.");
}
// buffers and accounting
int maxMemUsage = sortmb << 20;
maxMemUsage -= maxMemUsage % METASIZE;
kvbuffer = new byte[maxMemUsage];
bufvoid = kvbuffer.length;
kvmeta = ByteBuffer.wrap(kvbuffer)
.order(ByteOrder.nativeOrder())
.asIntBuffer();
setEquator(0);
bufstart = bufend = bufindex = equator;
kvstart = kvend = kvindex;
maxRec = kvmeta.capacity() / NMETA;
softLimit = (int)(kvbuffer.length * spillper);
bufferRemaining = softLimit;
if (LOG.isInfoEnabled()) {
LOG.info(TezRuntimeConfiguration.TEZ_RUNTIME_IO_SORT_MB + ": " + sortmb);
LOG.info("soft limit at " + softLimit);
LOG.info("bufstart = " + bufstart + "; bufvoid = " + bufvoid);
LOG.info("kvstart = " + kvstart + "; length = " + maxRec + "; finalMergeEnabled = " + isFinalMergeEnabled());
}
// k/v serialization
valSerializer.open(bb);
keySerializer.open(bb);
spillInProgress = false;
minSpillsForCombine = this.conf.getInt(TezRuntimeConfiguration.TEZ_RUNTIME_COMBINE_MIN_SPILLS, 3);
spillThread.setDaemon(true);
spillThread.setName("SpillThread ["
+ TezUtilsInternal.cleanVertexName(outputContext.getDestinationVertexName() + "]"));
spillLock.lock();
try {
spillThread.start();
while (!spillThreadRunning) {
spillDone.await();
}
} catch (InterruptedException e) {
//interrupt spill thread
spillThread.interrupt();
Thread.currentThread().interrupt();
throw new IOException("Spill thread failed to initialize", e);
} finally {
spillLock.unlock();
}
if (sortSpillException != null) {
throw new IOException("Spill thread failed to initialize",
sortSpillException);
}
}
@VisibleForTesting
static int computeSortBufferSize(int availableMemoryMB) {
if (availableMemoryMB <= 0) {
throw new RuntimeException(TezRuntimeConfiguration.TEZ_RUNTIME_IO_SORT_MB +
"=" + availableMemoryMB + ". It should be > 0");
}
if (availableMemoryMB > MAX_IO_SORT_MB) {
LOG.warn("Scaling down " + TezRuntimeConfiguration.TEZ_RUNTIME_IO_SORT_MB +
"=" + availableMemoryMB + " to " + MAX_IO_SORT_MB
+ " (max sort buffer size supported forDefaultSorter)");
}
// cap sort buffer to MAX_IO_SORT_MB for DefaultSorter.
// Not using 2047 to avoid any ArrayIndexOutofBounds in collect() phase.
return Math.min(MAX_IO_SORT_MB, availableMemoryMB);
}
@Override
public void write(Object key, Object value)
throws IOException {
collect(
key, value, partitioner.getPartition(key, value, partitions));
}
/**
* Serialize the key, value to intermediate storage.
* When this method returns, kvindex must refer to sufficient unused
* storage to store one METADATA.
*/
synchronized void collect(Object key, Object value, final int partition
) throws IOException {
if (key.getClass() != keyClass) {
throw new IOException("Type mismatch in key from map: expected "
+ keyClass.getName() + ", received "
+ key.getClass().getName());
}
if (value.getClass() != valClass) {
throw new IOException("Type mismatch in value from map: expected "
+ valClass.getName() + ", received "
+ value.getClass().getName());
}
if (partition < 0 || partition >= partitions) {
throw new IOException("Illegal partition for " + key + " (" +
partition + ")" + ", TotalPartitions: " + partitions);
}
checkSpillException();
bufferRemaining -= METASIZE;
if (bufferRemaining <= 0) {
// start spill if the thread is not running and the soft limit has been
// reached
spillLock.lock();
try {
do {
if (!spillInProgress) {
final int kvbidx = 4 * kvindex;
final int kvbend = 4 * kvend;
// serialized, unspilled bytes always lie between kvindex and
// bufindex, crossing the equator. Note that any void space
// created by a reset must be included in "used" bytes
final int bUsed = distanceTo(kvbidx, bufindex);
final boolean bufsoftlimit = bUsed >= softLimit;
if ((kvbend + METASIZE) % kvbuffer.length !=
equator - (equator % METASIZE)) {
// spill finished, reclaim space
resetSpill();
bufferRemaining = Math.min(
distanceTo(bufindex, kvbidx) - 2 * METASIZE,
softLimit - bUsed) - METASIZE;
continue;
} else if (bufsoftlimit && kvindex != kvend) {
// spill records, if any collected; check latter, as it may
// be possible for metadata alignment to hit spill pcnt
startSpill();
final int avgRec = (int)
(mapOutputByteCounter.getValue() /
mapOutputRecordCounter.getValue());
// leave at least half the split buffer for serialization data
// ensure that kvindex >= bufindex
final int distkvi = distanceTo(bufindex, kvbidx);
/**
* Reason for capping sort buffer to MAX_IO_SORT_MB
* E.g
* kvbuffer.length = 2146435072 (2047 MB)
* Corner case: bufIndex=2026133899, kvbidx=523629312.
* distkvi = mod - i + j = 2146435072 - 2026133899 + 523629312 = 643930485
* newPos = (2026133899 + (max(.., min(643930485/2, 271128624))) (This would
* overflow)
*/
final int newPos = (bufindex +
Math.max(2 * METASIZE - 1,
Math.min(distkvi / 2,
distkvi / (METASIZE + avgRec) * METASIZE)))
% kvbuffer.length;
setEquator(newPos);
bufmark = bufindex = newPos;
final int serBound = 4 * kvend;
// bytes remaining before the lock must be held and limits
// checked is the minimum of three arcs: the metadata space, the
// serialization space, and the soft limit
bufferRemaining = Math.min(
// metadata max
distanceTo(bufend, newPos),
Math.min(
// serialization max
distanceTo(newPos, serBound),
// soft limit
softLimit)) - 2 * METASIZE;
}
}
} while (false);
} finally {
spillLock.unlock();
}
}
try {
// serialize key bytes into buffer
int keystart = bufindex;
keySerializer.serialize(key);
if (bufindex < keystart) {
// wrapped the key; must make contiguous
bb.shiftBufferedKey();
keystart = 0;
}
// serialize value bytes into buffer
final int valstart = bufindex;
valSerializer.serialize(value);
// It's possible for records to have zero length, i.e. the serializer
// will perform no writes. To ensure that the boundary conditions are
// checked and that the kvindex invariant is maintained, perform a
// zero-length write into the buffer. The logic monitoring this could be
// moved into collect, but this is cleaner and inexpensive. For now, it
// is acceptable.
bb.write(b0, 0, 0);
// the record must be marked after the preceding write, as the metadata
// for this record are not yet written
int valend = bb.markRecord();
mapOutputRecordCounter.increment(1);
mapOutputByteCounter.increment(
distanceTo(keystart, valend, bufvoid));
// write accounting info
kvmeta.put(kvindex + PARTITION, partition);
kvmeta.put(kvindex + KEYSTART, keystart);
kvmeta.put(kvindex + VALSTART, valstart);
kvmeta.put(kvindex + VALLEN, distanceTo(valstart, valend));
// advance kvindex
kvindex = (int)(((long)kvindex - NMETA + kvmeta.capacity()) % kvmeta.capacity());
totalKeys++;
} catch (MapBufferTooSmallException e) {
LOG.info("Record too large for in-memory buffer: " + e.getMessage());
spillSingleRecord(key, value, partition);
mapOutputRecordCounter.increment(1);
return;
}
}
/**
* Set the point from which meta and serialization data expand. The meta
* indices are aligned with the buffer, so metadata never spans the ends of
* the circular buffer.
*/
private void setEquator(int pos) {
equator = pos;
// set index prior to first entry, aligned at meta boundary
final int aligned = pos - (pos % METASIZE);
// Cast one of the operands to long to avoid integer overflow
kvindex = (int) (((long) aligned - METASIZE + kvbuffer.length) % kvbuffer.length) / 4;
if (LOG.isInfoEnabled()) {
LOG.info("(EQUATOR) " + pos + " kvi " + kvindex +
"(" + (kvindex * 4) + ")");
}
}
/**
* The spill is complete, so set the buffer and meta indices to be equal to
* the new equator to free space for continuing collection. Note that when
* kvindex == kvend == kvstart, the buffer is empty.
*/
private void resetSpill() {
final int e = equator;
bufstart = bufend = e;
final int aligned = e - (e % METASIZE);
// set start/end to point to first meta record
// Cast one of the operands to long to avoid integer overflow
kvstart = kvend = (int) (((long) aligned - METASIZE + kvbuffer.length) % kvbuffer.length) / 4;
if (LOG.isInfoEnabled()) {
LOG.info("(RESET) equator " + e + " kv " + kvstart + "(" +
(kvstart * 4) + ")" + " kvi " + kvindex + "(" + (kvindex * 4) + ")");
}
}
/**
* Compute the distance in bytes between two indices in the serialization
* buffer.
* @see #distanceTo(int,int,int)
*/
final int distanceTo(final int i, final int j) {
return distanceTo(i, j, kvbuffer.length);
}
/**
* Compute the distance between two indices in the circular buffer given the
* max distance.
*/
int distanceTo(final int i, final int j, final int mod) {
return i <= j
? j - i
: mod - i + j;
}
/**
* For the given meta position, return the offset into the int-sized
* kvmeta buffer.
*/
int offsetFor(int metapos) {
return (metapos % maxRec) * NMETA;
}
/**
* Compare logical range, st i, j MOD offset capacity.
* Compare by partition, then by key.
* @see IndexedSortable#compare
*/
public int compare(final int mi, final int mj) {
final int kvi = offsetFor(mi);
final int kvj = offsetFor(mj);
final int kvip = kvmeta.get(kvi + PARTITION);
final int kvjp = kvmeta.get(kvj + PARTITION);
// sort by partition
if (kvip != kvjp) {
return kvip - kvjp;
}
// sort by key
int result = comparator.compare(kvbuffer,
kvmeta.get(kvi + KEYSTART),
kvmeta.get(kvi + VALSTART) - kvmeta.get(kvi + KEYSTART),
kvbuffer,
kvmeta.get(kvj + KEYSTART),
kvmeta.get(kvj + VALSTART) - kvmeta.get(kvj + KEYSTART));
if (result == 0) {
sameKey++;
}
return result;
}
final byte META_BUFFER_TMP[] = new byte[METASIZE];
/**
* Swap metadata for items i,j
* @see IndexedSortable#swap
*/
public void swap(final int mi, final int mj) {
int iOff = (mi % maxRec) * METASIZE;
int jOff = (mj % maxRec) * METASIZE;
System.arraycopy(kvbuffer, iOff, META_BUFFER_TMP, 0, METASIZE);
System.arraycopy(kvbuffer, jOff, kvbuffer, iOff, METASIZE);
System.arraycopy(META_BUFFER_TMP, 0, kvbuffer, jOff, METASIZE);
}
/**
* Inner class managing the spill of serialized records to disk.
*/
protected class BlockingBuffer extends DataOutputStream {
public BlockingBuffer() {
super(new Buffer());
}
/**
* Mark end of record. Note that this is required if the buffer is to
* cut the spill in the proper place.
*/
public int markRecord() {
bufmark = bufindex;
return bufindex;
}
/**
* Set position from last mark to end of writable buffer, then rewrite
* the data between last mark and kvindex.
* This handles a special case where the key wraps around the buffer.
* If the key is to be passed to a RawComparator, then it must be
* contiguous in the buffer. This recopies the data in the buffer back
* into itself, but starting at the beginning of the buffer. Note that
* this method should <b>only</b> be called immediately after detecting
* this condition. To call it at any other time is undefined and would
* likely result in data loss or corruption.
* @see #markRecord()
*/
protected void shiftBufferedKey() throws IOException {
// spillLock unnecessary; both kvend and kvindex are current
int headbytelen = bufvoid - bufmark;
bufvoid = bufmark;
final int kvbidx = 4 * kvindex;
final int kvbend = 4 * kvend;
final int avail =
Math.min(distanceTo(0, kvbidx), distanceTo(0, kvbend));
if (bufindex + headbytelen < avail) {
System.arraycopy(kvbuffer, 0, kvbuffer, headbytelen, bufindex);
System.arraycopy(kvbuffer, bufvoid, kvbuffer, 0, headbytelen);
bufindex += headbytelen;
bufferRemaining -= kvbuffer.length - bufvoid;
} else {
byte[] keytmp = new byte[bufindex];
System.arraycopy(kvbuffer, 0, keytmp, 0, bufindex);
bufindex = 0;
out.write(kvbuffer, bufmark, headbytelen);
out.write(keytmp);
}
}
}
public class Buffer extends OutputStream {
private final byte[] scratch = new byte[1];
@Override
public void write(int v)
throws IOException {
scratch[0] = (byte)v;
write(scratch, 0, 1);
}
/**
* Attempt to write a sequence of bytes to the collection buffer.
* This method will block if the spill thread is running and it
* cannot write.
* @throws MapBufferTooSmallException if record is too large to
* deserialize into the collection buffer.
*/
@Override
public void write(byte b[], int off, int len)
throws IOException {
// must always verify the invariant that at least METASIZE bytes are
// available beyond kvindex, even when len == 0
bufferRemaining -= len;
if (bufferRemaining <= 0) {
// writing these bytes could exhaust available buffer space or fill
// the buffer to soft limit. check if spill or blocking are necessary
boolean blockwrite = false;
spillLock.lock();
try {
do {
checkSpillException();
final int kvbidx = 4 * kvindex;
final int kvbend = 4 * kvend;
// ser distance to key index
final int distkvi = distanceTo(bufindex, kvbidx);
// ser distance to spill end index
final int distkve = distanceTo(bufindex, kvbend);
// if kvindex is closer than kvend, then a spill is neither in
// progress nor complete and reset since the lock was held. The
// write should block only if there is insufficient space to
// complete the current write, write the metadata for this record,
// and write the metadata for the next record. If kvend is closer,
// then the write should block if there is too little space for
// either the metadata or the current write. Note that collect
// ensures its metadata requirement with a zero-length write
blockwrite = distkvi <= distkve
? distkvi <= len + 2 * METASIZE
: distkve <= len || distanceTo(bufend, kvbidx) < 2 * METASIZE;
if (!spillInProgress) {
if (blockwrite) {
if ((kvbend + METASIZE) % kvbuffer.length !=
equator - (equator % METASIZE)) {
// spill finished, reclaim space
// need to use meta exclusively; zero-len rec & 100% spill
// pcnt would fail
resetSpill(); // resetSpill doesn't move bufindex, kvindex
bufferRemaining = Math.min(
distkvi - 2 * METASIZE,
softLimit - distanceTo(kvbidx, bufindex)) - len;
continue;
}
// we have records we can spill; only spill if blocked
if (kvindex != kvend) {
startSpill();
// Blocked on this write, waiting for the spill just
// initiated to finish. Instead of repositioning the marker
// and copying the partial record, we set the record start
// to be the new equator
setEquator(bufmark);
} else {
// We have no buffered records, and this record is too large
// to write into kvbuffer. We must spill it directly from
// collect
final int size = distanceTo(bufstart, bufindex) + len;
setEquator(0);
bufstart = bufend = bufindex = equator;
kvstart = kvend = kvindex;
bufvoid = kvbuffer.length;
throw new MapBufferTooSmallException(size + " bytes");
}
}
}
if (blockwrite) {
// wait for spill
try {
while (spillInProgress) {
spillDone.await();
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new IOInterruptedException(
"Buffer interrupted while waiting for the writer", e);
}
}
} while (blockwrite);
} finally {
spillLock.unlock();
}
}
// here, we know that we have sufficient space to write
// int overflow possible with (bufindex + len)
long futureBufIndex = (long) bufindex + len;
if (futureBufIndex > bufvoid) {
final int gaplen = bufvoid - bufindex;
System.arraycopy(b, off, kvbuffer, bufindex, gaplen);
len -= gaplen;
off += gaplen;
bufindex = 0;
}
System.arraycopy(b, off, kvbuffer, bufindex, len);
bufindex += len;
}
}
void interruptSpillThread() throws IOException {
assert !spillLock.isHeldByCurrentThread();
// shut down spill thread and wait for it to exit. Since the preceding
// ensures that it is finished with its work (and sortAndSpill did not
// throw), we elect to use an interrupt instead of setting a flag.
// Spilling simultaneously from this thread while the spill thread
// finishes its work might be both a useful way to extend this and also
// sufficient motivation for the latter approach.
try {
spillThread.interrupt();
spillThread.join();
} catch (InterruptedException e) {
LOG.info("Spill thread interrupted");
//Reset status
Thread.currentThread().interrupt();
throw new IOInterruptedException("Spill failed", e);
}
}
@Override
public void flush() throws IOException {
LOG.info("Starting flush of map output");
if (Thread.currentThread().isInterrupted()) {
/**
* Possible that the thread got interrupted when flush was happening or when the flush was
* never invoked. As a part of cleanup activity in TezTaskRunner, it would invoke close()
* on all I/O. At that time, this is safe to cleanup
*/
if (cleanup) {
cleanup();
}
try {
interruptSpillThread();
} catch(IOException e) {
//safe to ignore
}
return;
}
spillLock.lock();
try {
while (spillInProgress) {
spillDone.await();
}
checkSpillException();
final int kvbend = 4 * kvend;
if ((kvbend + METASIZE) % kvbuffer.length !=
equator - (equator % METASIZE)) {
// spill finished
resetSpill();
}
if (kvindex != kvend) {
kvend = (kvindex + NMETA) % kvmeta.capacity();
bufend = bufmark;
if (LOG.isInfoEnabled()) {
LOG.info("Sorting & Spilling map output");
LOG.info("bufstart = " + bufstart + "; bufend = " + bufmark +
"; bufvoid = " + bufvoid);
LOG.info("kvstart = " + kvstart + "(" + (kvstart * 4) +
"); kvend = " + kvend + "(" + (kvend * 4) +
"); length = " + (distanceTo(kvend, kvstart,
kvmeta.capacity()) + 1) + "/" + maxRec);
}
sortAndSpill();
}
} catch (InterruptedException e) {
//Reset status
Thread.currentThread().interrupt();
interruptSpillThread();
throw new IOException("Interrupted while waiting for the writer", e);
} finally {
spillLock.unlock();
}
interruptSpillThread();
// release sort buffer before the mergecl
//FIXME
//kvbuffer = null;
try {
mergeParts();
} catch (InterruptedException e) {
cleanup();
Thread.currentThread().interrupt();
}
if (isFinalMergeEnabled()) {
fileOutputByteCounter.increment(rfs.getFileStatus(finalOutputFile).getLen());
}
}
protected class SpillThread extends Thread {
@Override
public void run() {
spillLock.lock();
try {
spillThreadRunning = true;
while (true) {
spillDone.signal();
while (!spillInProgress) {
spillReady.await();
}
try {
spillLock.unlock();
sortAndSpill();
} catch (Throwable t) {
LOG.warn("Got an exception in sortAndSpill", t);
sortSpillException = t;
} finally {
spillLock.lock();
if (bufend < bufstart) {
bufvoid = kvbuffer.length;
}
kvstart = kvend;
bufstart = bufend;
spillInProgress = false;
}
}
} catch (InterruptedException e) {
LOG.info("Spill thread interrupted");
Thread.currentThread().interrupt();
} finally {
spillLock.unlock();
spillThreadRunning = false;
}
}
}
private void checkSpillException() throws IOException {
final Throwable lspillException = sortSpillException;
if (lspillException != null) {
if (lspillException instanceof Error) {
final String logMsg = "Task " + outputContext.getUniqueIdentifier()
+ " failed : " + ExceptionUtils.getStackTrace(lspillException);
outputContext.fatalError(lspillException, logMsg);
}
if (lspillException instanceof InterruptedException) {
throw new IOInterruptedException("Spill failed", lspillException);
} else {
throw new IOException("Spill failed", lspillException);
}
}
}
private void startSpill() {
assert !spillInProgress;
kvend = (kvindex + NMETA) % kvmeta.capacity();
bufend = bufmark;
spillInProgress = true;
if (LOG.isInfoEnabled()) {
LOG.info("Spilling map output");
LOG.info("bufstart = " + bufstart + "; bufend = " + bufmark +
"; bufvoid = " + bufvoid);
LOG.info("kvstart = " + kvstart + "(" + (kvstart * 4) +
"); kvend = " + kvend + "(" + (kvend * 4) +
"); length = " + (distanceTo(kvend, kvstart,
kvmeta.capacity()) + 1) + "/" + maxRec);
}
spillReady.signal();
}
int getMetaStart() {
return kvend / NMETA;
}
int getMetaEnd() {
return 1 + // kvend is a valid record
(kvstart >= kvend
? kvstart
: kvmeta.capacity() + kvstart) / NMETA;
}
private boolean isRLENeeded() {
return (sameKey > (0.1 * totalKeys)) || (sameKey < 0);
}
protected void sortAndSpill()
throws IOException, InterruptedException {
final int mstart = getMetaStart();
final int mend = getMetaEnd();
sorter.sort(this, mstart, mend, nullProgressable);
spill(mstart, mend);
}
private void adjustSpillCounters(long rawLen, long compLength) {
if (!isFinalMergeEnabled()) {
outputBytesWithOverheadCounter.increment(rawLen);
} else {
if (numSpills > 0) {
additionalSpillBytesWritten.increment(compLength);
// Reset the value will be set during the final merge.
outputBytesWithOverheadCounter.setValue(0);
} else {
// Set this up for the first write only. Subsequent ones will be handled in the final merge.
outputBytesWithOverheadCounter.increment(rawLen);
}
}
}
protected void spill(int mstart, int mend)
throws IOException, InterruptedException {
//approximate the length of the output file to be the length of the
//buffer + header lengths for the partitions
final long size = (bufend >= bufstart
? bufend - bufstart
: (bufvoid - bufend) + bufstart) +
partitions * APPROX_HEADER_LENGTH;
FSDataOutputStream out = null;
try {
// create spill file
final TezSpillRecord spillRec = new TezSpillRecord(partitions);
final Path filename =
mapOutputFile.getSpillFileForWrite(numSpills, size);
spillFilePaths.put(numSpills, filename);
out = rfs.create(filename);
int spindex = mstart;
final InMemValBytes value = createInMemValBytes();
boolean rle = isRLENeeded();
for (int i = 0; i < partitions; ++i) {
IFile.Writer writer = null;
try {
long segmentStart = out.getPos();
writer = new Writer(conf, out, keyClass, valClass, codec,
spilledRecordsCounter, null, rle);
if (combiner == null) {
// spill directly
DataInputBuffer key = new DataInputBuffer();
while (spindex < mend &&
kvmeta.get(offsetFor(spindex) + PARTITION) == i) {
final int kvoff = offsetFor(spindex);
int keystart = kvmeta.get(kvoff + KEYSTART);
int valstart = kvmeta.get(kvoff + VALSTART);
key.reset(kvbuffer, keystart, valstart - keystart);
getVBytesForOffset(kvoff, value);
writer.append(key, value);
++spindex;
}
} else {
int spstart = spindex;
while (spindex < mend &&
kvmeta.get(offsetFor(spindex)
+ PARTITION) == i) {
++spindex;
}
// Note: we would like to avoid the combiner if we've fewer
// than some threshold of records for a partition
if (spstart != spindex) {
TezRawKeyValueIterator kvIter =
new MRResultIterator(spstart, spindex);
if (LOG.isDebugEnabled()) {
LOG.debug("Running combine processor");
}
runCombineProcessor(kvIter, writer);
}
}
// close the writer
writer.close();
adjustSpillCounters(writer.getRawLength(), writer.getCompressedLength());
// record offsets
final TezIndexRecord rec =
new TezIndexRecord(
segmentStart,
writer.getRawLength(),
writer.getCompressedLength());
spillRec.putIndex(rec, i);
if (!isFinalMergeEnabled() && reportPartitionStats()) {
partitionStats[i] += writer.getCompressedLength();
}
writer = null;
} finally {
if (null != writer) writer.close();
}
}
if (totalIndexCacheMemory >= indexCacheMemoryLimit) {
// create spill index file
Path indexFilename =
mapOutputFile.getSpillIndexFileForWrite(numSpills, partitions
* MAP_OUTPUT_INDEX_RECORD_LENGTH);
spillFileIndexPaths.put(numSpills, indexFilename);
spillRec.writeToFile(indexFilename, conf);
} else {
indexCacheList.add(spillRec);
totalIndexCacheMemory +=
spillRec.size() * MAP_OUTPUT_INDEX_RECORD_LENGTH;
}
LOG.info("Finished spill " + numSpills);
++numSpills;
if (!isFinalMergeEnabled()) {
numShuffleChunks.setValue(numSpills);
} else if (numSpills > 1) {
//Increment only when there was atleast one previous spill
numAdditionalSpills.increment(1);
}
} finally {
if (out != null) out.close();
}
}
/**
* Handles the degenerate case where serialization fails to fit in
* the in-memory buffer, so we must spill the record from collect
* directly to a spill file. Consider this "losing".
*/
private void spillSingleRecord(final Object key, final Object value,
int partition) throws IOException {
long size = kvbuffer.length + partitions * APPROX_HEADER_LENGTH;
FSDataOutputStream out = null;
try {
// create spill file
final TezSpillRecord spillRec = new TezSpillRecord(partitions);
final Path filename =
mapOutputFile.getSpillFileForWrite(numSpills, size);
spillFilePaths.put(numSpills, filename);
out = rfs.create(filename);
// we don't run the combiner for a single record
for (int i = 0; i < partitions; ++i) {
IFile.Writer writer = null;
try {
long segmentStart = out.getPos();
// Create a new codec, don't care!
writer = new IFile.Writer(conf, out, keyClass, valClass, codec,
spilledRecordsCounter, null);
if (i == partition) {
final long recordStart = out.getPos();
writer.append(key, value);
// Note that our map byte count will not be accurate with
// compression
mapOutputByteCounter.increment(out.getPos() - recordStart);
}
writer.close();
adjustSpillCounters(writer.getRawLength(), writer.getCompressedLength());
// record offsets
TezIndexRecord rec =
new TezIndexRecord(
segmentStart,
writer.getRawLength(),
writer.getCompressedLength());
spillRec.putIndex(rec, i);
writer = null;
} catch (IOException e) {
if (null != writer) writer.close();
throw e;
}
}
if (totalIndexCacheMemory >= indexCacheMemoryLimit) {
// create spill index file
Path indexFilename =
mapOutputFile.getSpillIndexFileForWrite(numSpills, partitions
* MAP_OUTPUT_INDEX_RECORD_LENGTH);
spillFileIndexPaths.put(numSpills, indexFilename);
spillRec.writeToFile(indexFilename, conf);
} else {
indexCacheList.add(spillRec);
totalIndexCacheMemory +=
spillRec.size() * MAP_OUTPUT_INDEX_RECORD_LENGTH;
}
++numSpills;
if (!isFinalMergeEnabled()) {
numShuffleChunks.setValue(numSpills);
} else if (numSpills > 1) {
//Increment only when there is atleast one previous spill
numAdditionalSpills.increment(1);
}
} finally {
if (out != null) out.close();
}
}
protected int getInMemVBytesLength(int kvoff) {
// get the keystart for the next serialized value to be the end
// of this value. If this is the last value in the buffer, use bufend
final int vallen = kvmeta.get(kvoff + VALLEN);
assert vallen >= 0;
return vallen;
}
/**
* Given an offset, populate vbytes with the associated set of
* deserialized value bytes. Should only be called during a spill.
*/
int getVBytesForOffset(int kvoff, InMemValBytes vbytes) {
int vallen = getInMemVBytesLength(kvoff);
vbytes.reset(kvbuffer, kvmeta.get(kvoff + VALSTART), vallen);
return vallen;
}
/**
* Inner class wrapping valuebytes, used for appendRaw.
*/
static class InMemValBytes extends DataInputBuffer {
private byte[] buffer;
private int start;
private int length;
private final int bufvoid;
public InMemValBytes(int bufvoid) {
this.bufvoid = bufvoid;
}
public void reset(byte[] buffer, int start, int length) {
this.buffer = buffer;
this.start = start;
this.length = length;
if (start + length > bufvoid) {
this.buffer = new byte[this.length];
final int taillen = bufvoid - start;
System.arraycopy(buffer, start, this.buffer, 0, taillen);
System.arraycopy(buffer, 0, this.buffer, taillen, length-taillen);
this.start = 0;
}
super.reset(this.buffer, this.start, this.length);
}
}
InMemValBytes createInMemValBytes() {
return new InMemValBytes(bufvoid);
}
protected class MRResultIterator implements TezRawKeyValueIterator {
private final DataInputBuffer keybuf = new DataInputBuffer();
private final InMemValBytes vbytes = createInMemValBytes();
private final int end;
private int current;
public MRResultIterator(int start, int end) {
this.end = end;
current = start - 1;
}
public boolean next() throws IOException {
return ++current < end;
}
public DataInputBuffer getKey() throws IOException {
final int kvoff = offsetFor(current);
keybuf.reset(kvbuffer, kvmeta.get(kvoff + KEYSTART),
kvmeta.get(kvoff + VALSTART) - kvmeta.get(kvoff + KEYSTART));
return keybuf;
}
public DataInputBuffer getValue() throws IOException {
getVBytesForOffset(offsetFor(current), vbytes);
return vbytes;
}
public Progress getProgress() {
return null;
}
@Override
public boolean isSameKey() throws IOException {
return false;
}
public void close() { }
}
private void maybeSendEventForSpill(List<Event> events, boolean isLastEvent,
TezSpillRecord spillRecord, int index, boolean sendEvent) throws IOException {
if (isFinalMergeEnabled()) {
return;
}
Preconditions.checkArgument(spillRecord != null, "Spill record can not be null");
String pathComponent = (outputContext.getUniqueIdentifier() + "_" + index);
ShuffleUtils.generateEventOnSpill(events, isFinalMergeEnabled(), isLastEvent,
outputContext, index, spillRecord, partitions, sendEmptyPartitionDetails, pathComponent,
partitionStats);
LOG.info("Adding spill event for spill (final update=" + isLastEvent + "), spillId=" + index);
if (sendEvent) {
outputContext.sendEvents(events);
}
}
private void maybeAddEventsForSpills() throws IOException {
if (isFinalMergeEnabled()) {
return;
}
List<Event> events = Lists.newLinkedList();
for(int i=0; i<numSpills; i++) {
TezSpillRecord spillRecord = indexCacheList.get(i);
if (spillRecord == null) {
//File was already written and location is stored in spillFileIndexPaths
spillRecord = new TezSpillRecord(spillFileIndexPaths.get(i), conf);
} else {
//Double check if this file has to be written
if (spillFileIndexPaths.get(i) == null) {
Path indexPath = mapOutputFile.getSpillIndexFileForWrite(i, partitions *
MAP_OUTPUT_INDEX_RECORD_LENGTH);
spillRecord.writeToFile(indexPath, conf);
}
}
maybeSendEventForSpill(events, (i == numSpills - 1), spillRecord, i, false);
fileOutputByteCounter.increment(rfs.getFileStatus(spillFilePaths.get(i)).getLen());
}
outputContext.sendEvents(events);
}
private void mergeParts() throws IOException, InterruptedException {
// get the approximate size of the final output/index files
long finalOutFileSize = 0;
long finalIndexFileSize = 0;
final Path[] filename = new Path[numSpills];
final String taskIdentifier = outputContext.getUniqueIdentifier();
for(int i = 0; i < numSpills; i++) {
filename[i] = spillFilePaths.get(i);
finalOutFileSize += rfs.getFileStatus(filename[i]).getLen();
}
if (numSpills == 1) { //the spill is the final output
TezSpillRecord spillRecord = null;
if (isFinalMergeEnabled()) {
finalOutputFile = mapOutputFile.getOutputFileForWriteInVolume(filename[0]);
finalIndexFile = mapOutputFile.getOutputIndexFileForWriteInVolume(filename[0]);
sameVolRename(filename[0], finalOutputFile);
if (indexCacheList.size() == 0) {
sameVolRename(spillFileIndexPaths.get(0), finalIndexFile);
spillRecord = new TezSpillRecord(finalIndexFile, conf);
} else {
spillRecord = indexCacheList.get(0);
spillRecord.writeToFile(finalIndexFile, conf);
}
} else {
List<Event> events = Lists.newLinkedList();
//Since there is only one spill, spill record would be present in cache.
spillRecord = indexCacheList.get(0);
Path indexPath = mapOutputFile.getSpillIndexFileForWrite(numSpills-1, partitions *
MAP_OUTPUT_INDEX_RECORD_LENGTH);
spillRecord.writeToFile(indexPath, conf);
maybeSendEventForSpill(events, true, spillRecord, 0, true);
fileOutputByteCounter.increment(rfs.getFileStatus(spillFilePaths.get(0)).getLen());
//No need to populate finalIndexFile, finalOutputFile etc when finalMerge is disabled
}
if (spillRecord != null && reportPartitionStats()) {
for(int i=0; i < spillRecord.size(); i++) {
partitionStats[i] += spillRecord.getIndex(i).getPartLength();
}
}
numShuffleChunks.setValue(numSpills);
return;
}
// read in paged indices
for (int i = indexCacheList.size(); i < numSpills; ++i) {
Path indexFileName = spillFileIndexPaths.get(i);
indexCacheList.add(new TezSpillRecord(indexFileName, conf));
}
//Check if it is needed to do final merge. Or else, exit early.
if (numSpills > 0 && !isFinalMergeEnabled()) {
maybeAddEventsForSpills();
//No need to do final merge.
return;
}
//make correction in the length to include the sequence file header
//lengths for each partition
finalOutFileSize += partitions * APPROX_HEADER_LENGTH;
finalIndexFileSize = partitions * MAP_OUTPUT_INDEX_RECORD_LENGTH;
if (isFinalMergeEnabled()) {
finalOutputFile = mapOutputFile.getOutputFileForWrite(finalOutFileSize);
finalIndexFile = mapOutputFile.getOutputIndexFileForWrite(finalIndexFileSize);
} else if (numSpills == 0) {
//e.g attempt_1424502260528_0119_1_07_000058_0_10012_0/file.out when final merge is
// disabled
finalOutputFile = mapOutputFile.getSpillFileForWrite(numSpills, finalOutFileSize);
finalIndexFile = mapOutputFile.getSpillIndexFileForWrite(numSpills, finalIndexFileSize);
}
//The output stream for the final single output file
FSDataOutputStream finalOut = rfs.create(finalOutputFile, true, 4096);
if (numSpills == 0) {
// TODO Change event generation to say there is no data rather than generating a dummy file
//create dummy files
TezSpillRecord sr = new TezSpillRecord(partitions);
try {
for (int i = 0; i < partitions; i++) {
long segmentStart = finalOut.getPos();
Writer writer =
new Writer(conf, finalOut, keyClass, valClass, codec, null, null);
writer.close();
TezIndexRecord rec =
new TezIndexRecord(
segmentStart,
writer.getRawLength(),
writer.getCompressedLength());
// Covers the case of multiple spills.
outputBytesWithOverheadCounter.increment(writer.getRawLength());
sr.putIndex(rec, i);
}
sr.writeToFile(finalIndexFile, conf);
} finally {
finalOut.close();
}
++numSpills;
if (!isFinalMergeEnabled()) {
List<Event> events = Lists.newLinkedList();
maybeSendEventForSpill(events, true, sr, 0, true);
fileOutputByteCounter.increment(rfs.getFileStatus(finalOutputFile).getLen());
}
numShuffleChunks.setValue(numSpills);
return;
}
else {
final TezSpillRecord spillRec = new TezSpillRecord(partitions);
for (int parts = 0; parts < partitions; parts++) {
//create the segments to be merged
List<Segment> segmentList =
new ArrayList<Segment>(numSpills);
for(int i = 0; i < numSpills; i++) {
TezIndexRecord indexRecord = indexCacheList.get(i).getIndex(parts);
Segment s =
new Segment(rfs, filename[i], indexRecord.getStartOffset(),
indexRecord.getPartLength(), codec, ifileReadAhead,
ifileReadAheadLength, ifileBufferSize, true);
segmentList.add(i, s);
if (LOG.isDebugEnabled()) {
LOG.debug("TaskIdentifier=" + taskIdentifier + " Partition=" + parts +
"Spill =" + i + "(" + indexRecord.getStartOffset() + "," +
indexRecord.getRawLength() + ", " +
indexRecord.getPartLength() + ")");
}
}
int mergeFactor =
this.conf.getInt(TezRuntimeConfiguration.TEZ_RUNTIME_IO_SORT_FACTOR,
TezRuntimeConfiguration.TEZ_RUNTIME_IO_SORT_FACTOR_DEFAULT);
// sort the segments only if there are intermediate merges
boolean sortSegments = segmentList.size() > mergeFactor;
//merge
TezRawKeyValueIterator kvIter = TezMerger.merge(conf, rfs,
keyClass, valClass, codec,
segmentList, mergeFactor,
new Path(taskIdentifier),
(RawComparator)ConfigUtils.getIntermediateOutputKeyComparator(conf),
nullProgressable, sortSegments, true,
null, spilledRecordsCounter, additionalSpillBytesRead,
null); // Not using any Progress in TezMerger. Should just work.
//write merged output to disk
long segmentStart = finalOut.getPos();
Writer writer =
new Writer(conf, finalOut, keyClass, valClass, codec,
spilledRecordsCounter, null);
if (combiner == null || numSpills < minSpillsForCombine) {
TezMerger.writeFile(kvIter, writer,
nullProgressable, TezRuntimeConfiguration.TEZ_RUNTIME_RECORDS_BEFORE_PROGRESS_DEFAULT);
} else {
runCombineProcessor(kvIter, writer);
}
writer.close();
outputBytesWithOverheadCounter.increment(writer.getRawLength());
// record offsets
final TezIndexRecord rec =
new TezIndexRecord(
segmentStart,
writer.getRawLength(),
writer.getCompressedLength());
spillRec.putIndex(rec, parts);
if (reportPartitionStats()) {
partitionStats[parts] += writer.getCompressedLength();
}
}
numShuffleChunks.setValue(1); //final merge has happened
spillRec.writeToFile(finalIndexFile, conf);
finalOut.close();
for(int i = 0; i < numSpills; i++) {
rfs.delete(filename[i],true);
}
}
}
}
| {
"content_hash": "021ce2d6197240a3cecd2a1126aec3f9",
"timestamp": "",
"source": "github",
"line_count": 1313,
"max_line_length": 115,
"avg_line_length": 37.56054836252856,
"alnum_prop": 0.6161567005292292,
"repo_name": "Parth-Brahmbhatt/tez",
"id": "edc02f32b1ad16af3f82a7c426f6d3de27dd5908",
"size": "50107",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/sort/impl/dflt/DefaultSorter.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "29294"
},
{
"name": "HTML",
"bytes": "4652"
},
{
"name": "Handlebars",
"bytes": "84216"
},
{
"name": "Java",
"bytes": "8070230"
},
{
"name": "JavaScript",
"bytes": "382146"
},
{
"name": "Protocol Buffer",
"bytes": "26742"
},
{
"name": "Python",
"bytes": "17082"
},
{
"name": "Shell",
"bytes": "34578"
}
],
"symlink_target": ""
} |
/**
* @depends {nrs.js}
*/
var NRS = (function(NRS, $, undefined) {
NRS.automaticallyCheckRecipient = function() {
var $recipientFields = $("#send_money_recipient, #transfer_asset_recipient, #transfer_currency_recipient, #send_message_recipient, #add_contact_account_id, #update_contact_account_id, #lease_balance_recipient, #transfer_alias_recipient, #sell_alias_recipient");
$recipientFields.on("blur", function() {
$(this).trigger("checkRecipient");
});
$recipientFields.on("checkRecipient", function() {
var value = $(this).val();
var modal = $(this).closest(".modal");
if (value && value != "NXT-____-____-____-_____") {
NRS.checkRecipient(value, modal);
} else {
modal.find(".account_info").hide();
}
});
$recipientFields.on("oldRecipientPaste", function() {
var modal = $(this).closest(".modal");
var callout = modal.find(".account_info").first();
callout.removeClass("callout-info callout-danger callout-warning").addClass("callout-danger").html($.t("error_numeric_ids_not_allowed")).show();
});
}
$("#send_message_modal, #send_money_modal, #transfer_currency_modal, #add_contact_modal").on("show.bs.modal", function(e) {
var $invoker = $(e.relatedTarget);
var account = $invoker.data("account");
if (!account) {
account = $invoker.data("contact");
}
if (account) {
var $inputField = $(this).find("input[name=recipient], input[name=account_id]").not("[type=hidden]");
if (!/NXT\-/i.test(account)) {
$inputField.addClass("noMask");
}
$inputField.val(account).trigger("checkRecipient");
}
});
/* Removed variable fee, keeping fees at their minimal
$("#send_money_amount").on("input", function(e) {
var amount = parseInt($(this).val(), 10);
var fee = isNaN(amount) ? 1 : (amount < 500 ? 1 : Math.round(amount / 1000));
$("#send_money_fee").val(fee);
$(this).closest(".modal").find(".advanced_fee").html(NRS.formatAmount(NRS.convertToNQT(fee)) + " NXT");
});
*/
//todo later: http://twitter.github.io/typeahead.js/
$(".modal").on("click", "span.recipient_selector button, span.plain_adress_selector button", function(e) {
if (!Object.keys(NRS.contacts).length) {
e.preventDefault();
e.stopPropagation();
return;
}
var $list = $(this).parent().find("ul");
$list.empty();
for (var accountId in NRS.contacts) {
$list.append("<li><a href='#' data-contact-id='" + accountId + "' data-contact='" + String(NRS.contacts[accountId].name).escapeHTML() + "'>" + String(NRS.contacts[accountId].name).escapeHTML() + "</a></li>");
}
});
$(".modal").on("click", "span.recipient_selector ul li a", function(e) {
e.preventDefault();
$(this).closest("form").find("input[name=converted_account_id]").val("");
$(this).closest("form").find("input[name=recipient],input[name=account_id]").not("[type=hidden]").trigger("unmask").val($(this).data("contact")).trigger("blur");
});
$(".modal").on("click", "span.plain_adress_selector ul li a", function(e) {
e.preventDefault();
$(this).closest(".input-group").find("input.plain_adress_selector_input").not("[type=hidden]").trigger("unmask").val($(this).data("contact-id")).trigger("blur");
});
$(".modal").on("keyup blur show", ".plain_adress_selector_input", function(e) {
var currentValue = $(this).val();
if (NRS.contacts[currentValue]) {
var contactInfo = NRS.contacts[currentValue]['name'];
} else {
var contactInfo = " ";
}
$(this).closest(".input-group").find(".pas_contact_info").text(contactInfo);
});
NRS.forms.sendMoneyComplete = function(response, data) {
if (!(data["_extra"] && data["_extra"].convertedAccount) && !(data.recipient in NRS.contacts)) {
$.growl($.t("success_send_money") + " <a href='#' data-account='" + NRS.getAccountFormatted(data, "recipient") + "' data-toggle='modal' data-target='#add_contact_modal' style='text-decoration:underline'>" + $.t("add_recipient_to_contacts_q") + "</a>", {
"type": "success"
});
} else {
$.growl($.t("success_send_money"), {
"type": "success"
});
}
}
NRS.sendMoneyShowAccountInformation = function(accountId) {
NRS.getAccountError(accountId, function(response) {
if (response.type == "success") {
$("#send_money_account_info").hide();
} else {
$("#send_money_account_info").html(response.message).show();
}
});
}
NRS.getAccountError = function(accountId, callback) {
NRS.sendRequest("getAccount", {
"account": accountId
}, function(response) {
if (response.publicKey) {
if (response.name){
callback({
"type": "info",
"message": $.t("recipient_info_with_name", {
"name" : response.name,
"nxt": NRS.formatAmount(response.unconfirmedBalanceNQT, false, true)
}),
"account": response
});
}
else{
callback({
"type": "info",
"message": $.t("recipient_info", {
"nxt": NRS.formatAmount(response.unconfirmedBalanceNQT, false, true)
}),
"account": response
});
}
} else {
if (response.errorCode) {
if (response.errorCode == 4) {
callback({
"type": "danger",
"message": $.t("recipient_malformed") + (!/^(NXT\-)/i.test(accountId) ? " " + $.t("recipient_alias_suggestion") : ""),
"account": null
});
} else if (response.errorCode == 5) {
callback({
"type": "warning",
"message": $.t("recipient_unknown_pka"),
"account": null,
"noPublicKey": true
});
} else {
callback({
"type": "danger",
"message": $.t("recipient_problem") + " " + String(response.errorDescription).escapeHTML(),
"account": null
});
}
} else {
callback({
"type": "warning",
"message": $.t("recipient_no_public_key_pka", {
"nxt": NRS.formatAmount(response.unconfirmedBalanceNQT, false, true)
}),
"account": response,
"noPublicKey": true
});
}
}
});
}
NRS.correctAddressMistake = function(el) {
$(el).closest(".modal-body").find("input[name=recipient],input[name=account_id]").val($(el).data("address")).trigger("blur");
}
NRS.checkRecipient = function(account, modal) {
var classes = "callout-info callout-danger callout-warning";
var callout = modal.find(".account_info").first();
var accountInputField = modal.find("input[name=converted_account_id]");
var merchantInfoField = modal.find("input[name=merchant_info]");
var recipientPublicKeyField = modal.find("input[name=recipientPublicKey]");
accountInputField.val("");
merchantInfoField.val("");
account = $.trim(account);
//solomon reed. Btw, this regex can be shortened..
if (/^(NXT\-)?[A-Z0-9]+\-[A-Z0-9]+\-[A-Z0-9]+\-[A-Z0-9]+/i.test(account)) {
var address = new NxtAddress();
if (address.set(account)) {
NRS.getAccountError(account, function(response) {
if (response.noPublicKey && account!=NRS.accountRS) {
modal.find(".recipient_public_key").show();
} else {
modal.find("input[name=recipientPublicKey]").val("");
modal.find(".recipient_public_key").hide();
}
if (response.account && response.account.description) {
checkForMerchant(response.account.description, modal);
}
if (account==NRS.accountRS)
callout.removeClass(classes).addClass("callout-" + response.type).html("This is your account").show();
else{
var message = response.message.escapeHTML();
callout.removeClass(classes).addClass("callout-" + response.type).html(message).show();
}
});
} else {
if (address.guess.length == 1) {
callout.removeClass(classes).addClass("callout-danger").html($.t("recipient_malformed_suggestion", {
"recipient": "<span class='malformed_address' data-address='" + String(address.guess[0]).escapeHTML() + "' onclick='NRS.correctAddressMistake(this);'>" + address.format_guess(address.guess[0], account) + "</span>"
})).show();
} else if (address.guess.length > 1) {
var html = $.t("recipient_malformed_suggestion", {
"count": address.guess.length
}) + "<ul>";
for (var i = 0; i < address.guess.length; i++) {
html += "<li><span clas='malformed_address' data-address='" + String(address.guess[i]).escapeHTML() + "' onclick='NRS.correctAddressMistake(this);'>" + address.format_guess(address.guess[i], account) + "</span></li>";
}
callout.removeClass(classes).addClass("callout-danger").html(html).show();
} else {
callout.removeClass(classes).addClass("callout-danger").html($.t("recipient_malformed")).show();
}
}
} else if (!(/^\d+$/.test(account))) {
if (NRS.databaseSupport && account.charAt(0) != '@') {
NRS.database.select("contacts", [{
"name": account
}], function(error, contact) {
if (!error && contact.length) {
contact = contact[0];
NRS.getAccountError(contact.accountRS, function(response) {
if (response.noPublicKey && account!=NRS.account) {
modal.find(".recipient_public_key").show();
} else {
modal.find("input[name=recipientPublicKey]").val("");
modal.find(".recipient_public_key").hide();
}
if (response.account && response.account.description) {
checkForMerchant(response.account.description, modal);
}
callout.removeClass(classes).addClass("callout-" + response.type).html($.t("contact_account_link", {
"account_id": NRS.getAccountFormatted(contact, "account")
}) + " " + response.message.escapeHTML()).show();
if (response.type == "info" || response.type == "warning") {
accountInputField.val(contact.accountRS);
}
});
} else if (/^[a-z0-9]+$/i.test(account)) {
NRS.checkRecipientAlias(account, modal);
} else {
callout.removeClass(classes).addClass("callout-danger").html($.t("recipient_malformed")).show();
}
});
} else if (/^[a-z0-9@]+$/i.test(account)) {
if (account.charAt(0) == '@') {
account = account.substring(1);
NRS.checkRecipientAlias(account, modal);
}
} else {
callout.removeClass(classes).addClass("callout-danger").html($.t("recipient_malformed")).show();
}
} else {
callout.removeClass(classes).addClass("callout-danger").html($.t("error_numeric_ids_not_allowed")).show();
}
}
NRS.checkRecipientAlias = function(account, modal) {
var classes = "callout-info callout-danger callout-warning";
var callout = modal.find(".account_info").first();
var accountInputField = modal.find("input[name=converted_account_id]");
accountInputField.val("");
NRS.sendRequest("getAlias", {
"aliasName": account
}, function(response) {
if (response.errorCode) {
callout.removeClass(classes).addClass("callout-danger").html($.t("error_invalid_account_id")).show();
} else {
if (response.aliasURI) {
var alias = String(response.aliasURI);
var timestamp = response.timestamp;
var regex_1 = /acct:(.*)@nxt/;
var regex_2 = /nacc:(.*)/;
var match = alias.match(regex_1);
if (!match) {
match = alias.match(regex_2);
}
if (match && match[1]) {
match[1] = String(match[1]).toUpperCase();
if (/^\d+$/.test(match[1])) {
var address = new NxtAddress();
if (address.set(match[1])) {
match[1] = address.toString();
} else {
accountInputField.val("");
callout.removeClass(classes).addClass("callout-danger").html($.t("error_invalid_account_id")).show();
return;
}
}
NRS.getAccountError(match[1], function(response) {
if (response.noPublicKey) {
modal.find(".recipient_public_key").show();
} else {
modal.find("input[name=recipientPublicKey]").val("");
modal.find(".recipient_public_key").hide();
}
if (response.account && response.account.description) {
checkForMerchant(response.account.description, modal);
}
callout.removeClass(classes).addClass("callout-" + response.type).html($.t("alias_account_link", {
"account_id": String(match[1]).escapeHTML()
}) + " " + response.message.escapeHTML() + " " + $.t("alias_last_adjusted", {
"timestamp": NRS.formatTimestamp(timestamp)
})).show();
if (response.type == "info" || response.type == "warning") {
accountInputField.val(String(match[1]).escapeHTML());
}
});
} else {
callout.removeClass(classes).addClass("callout-danger").html($.t("alias_account_no_link") + (!alias ? $.t("error_uri_empty") : $.t("uri_is", {
"uri": String(alias).escapeHTML()
}))).show();
}
} else if (response.aliasName) {
callout.removeClass(classes).addClass("callout-danger").html($.t("error_alias_empty_uri")).show();
} else {
callout.removeClass(classes).addClass("callout-danger").html(response.errorDescription ? $.t("error") + ": " + String(response.errorDescription).escapeHTML() : $.t("error_alias")).show();
}
}
});
}
function checkForMerchant(accountInfo, modal) {
var requestType = modal.find("input[name=request_type]").val();
if (requestType == "sendMoney" || requestType == "transferAsset") {
if (accountInfo.match(/merchant/i)) {
modal.find("input[name=merchant_info]").val(accountInfo);
var checkbox = modal.find("input[name=add_message]");
if (!checkbox.is(":checked")) {
checkbox.prop("checked", true).trigger("change");
}
}
}
}
return NRS;
}(NRS || {}, jQuery)); | {
"content_hash": "0636af418dcd0ba5a388084c236850ac",
"timestamp": "",
"source": "github",
"line_count": 380,
"max_line_length": 263,
"avg_line_length": 35.492105263157896,
"alnum_prop": 0.6147401201156669,
"repo_name": "jonesnxt/Jay-NRS",
"id": "42cf5b556ab77da668cb65e22168326b67bc92a8",
"size": "14689",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "js/nrs.recipient.js",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "230311"
},
{
"name": "HTML",
"bytes": "520991"
},
{
"name": "JavaScript",
"bytes": "1309241"
}
],
"symlink_target": ""
} |
package sun.io;
import sun.nio.cs.ext.IBM863;
/**
* Tables and data to convert Unicode to Cp863
*
* @author ConverterGenerator tool
*/
public class CharToByteCp863 extends CharToByteSingleByte {
private final static IBM863 nioCoder = new IBM863();
public String getCharacterEncoding() {
return "Cp863";
}
public CharToByteCp863() {
super.mask1 = 0xFF00;
super.mask2 = 0x00FF;
super.shift = 8;
super.index1 = nioCoder.getEncoderIndex1();
super.index2 = nioCoder.getEncoderIndex2();
}
}
| {
"content_hash": "3ab55096ece1708834b22ba9db0d7f36",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 59,
"avg_line_length": 20.214285714285715,
"alnum_prop": 0.6537102473498233,
"repo_name": "rokn/Count_Words_2015",
"id": "1786e8c9217b0dadc42ef41476619ddfc3664759",
"size": "1778",
"binary": false,
"copies": "35",
"ref": "refs/heads/master",
"path": "testing/openjdk/jdk/src/share/classes/sun/io/CharToByteCp863.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "61802"
},
{
"name": "Ruby",
"bytes": "18888605"
}
],
"symlink_target": ""
} |
title: SharePoint-online-plan-1
inshort: Udefinert
translator: Microsoft Cognitive Services
---
| {
"content_hash": "7e57c1bf27bc0d7aad059c82b59a6929",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 40,
"avg_line_length": 14.142857142857142,
"alnum_prop": 0.7878787878787878,
"repo_name": "Hexatown/docs",
"id": "c03f916a818a98e6e0f81131f813fc8d58627640",
"size": "103",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "microsoft/office365/sharepoint-online-plan-1/no.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "58"
},
{
"name": "CSS",
"bytes": "62970"
},
{
"name": "HTML",
"bytes": "50886"
},
{
"name": "PowerShell",
"bytes": "104690"
},
{
"name": "Ruby",
"bytes": "72"
}
],
"symlink_target": ""
} |
**view**
Description: create a list view
Multiple: Add
Example
builder.view 'test' do
job 'test-.*'
end
| {
"content_hash": "6d9cb54d35ee9b2d8b6a4603699d585f",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 31,
"avg_line_length": 11.090909090909092,
"alnum_prop": 0.6147540983606558,
"repo_name": "wongatech/rubyjobbuilderdsl",
"id": "a1b75c7136220b01b9eb7f923407f87e3959e7b0",
"size": "138",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/view.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "121322"
},
{
"name": "Shell",
"bytes": "66"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using Mozu.Api.Contracts.CommerceRuntime.Discounts;
using Mozu.Api.Contracts.Core;
namespace Mozu.Api.Contracts.CommerceRuntime.Checkouts
{
///
/// Mozu.CommerceRuntime.Contracts.Checkouts.CheckoutGrouping ApiType DOCUMENT_HERE
///
public class CheckoutGrouping
{
///
///The unique identifier of the destination.
///
public string DestinationId { get; set; }
///
///Grouping-level duty or tariff amount.
///
public decimal? DutyAmount { get; set; }
///
///Duties or tariff totals for the grouping.
///
public decimal DutyTotal { get; set; }
///
///The method used to fulfill this cart or order item. The method includes direct ship or in-store pickup. The available methods depend on the supported fulfillment types for the product.
///
public string FulfillmentMethod { get; set; }
///
///The combined price for all handling costs calculated together for shipped orders, not for digital or in-store pickup. This includes all handling costs per the product line items and options, excluding taxes and discounts.
///
public decimal? HandlingAmount { get; set; }
///
///The list of historically-applied handling discounts for the grouping. The active one will have IsExcluded == false.
///
public List<AppliedDiscount> HandlingDiscounts { get; set; }
///
///Handling fees for the grouping.
///
public decimal HandlingSubTotal { get; set; }
///
///Calculated total tax amount for handling costs of the grouping if the cart/order is subject to sales tax.
///
public decimal? HandlingTax { get; set; }
///
///Calculated total tax amount for handling costs if the cart/order is subject to sales tax.
///
public decimal HandlingTaxTotal { get; set; }
///
///The total handling cost for the grouping.
///
public decimal HandlingTotal { get; set; }
///
///Unique identifier of the source property, such as a catalog, discount, order, or email template.For a product field it will be the name of the field.For a category ID, must be a positive integer not greater than 2000000. By default, auto-generates a category ID when categories are created. If you want to specify an ID during creation (which preserves category link relationships when migrating tenant data from one sandbox to another), you must also include the query string in the endpoint. For example, . Then, use the property to specify the desired category ID.For a product attribute it will be the Attribute FQN.For a document, the ID must be specified as a 32 character, case-insensitive, alphanumeric string. You can specify the ID as 32 sequential characters or as groups separated by dashes in the format 8-4-4-4-12. For example, or.For email templates, the ID must be one of the following values:///
///
public string Id { get; set; }
///
///The handling discount total for the grouping item.
///
public decimal ItemLevelHandlingDiscountTotal { get; set; }
///
///The applicable shipping discount for the grouping item.
///
public decimal ItemLevelShippingDiscountTotal { get; set; }
///
///The list of order item IDs that belong to the grouping.
///
public List<string> OrderItemIds { get; set; }
///
///The handling discount total at the order level.
///
public decimal OrderLevelHandlingDiscountTotal { get; set; }
///
///The shipping level discount at the order level.
///
public decimal OrderLevelShippingDiscountTotal { get; set; }
///
///The calculated monetary amount of shipping for a line items within and an entire order.
///
public decimal? ShippingAmount { get; set; }
///
///List of shipping discounts projected to apply to carts, orders, and wish lists and items at checkout.
///
public List<ShippingDiscount> ShippingDiscounts { get; set; }
///
///The code associated with a carrier's shipping method service type, used during fulfillment of packages and shipments. Service type codes include a prefix that indicates the carrier. For example: FEDEX_INTERNATIONAL_STANDARD and UPS_GROUND.If using a custom rate, this property corresponds to the field in when you navigate to > > , and then click on an existing rate or on .
///
public string ShippingMethodCode { get; set; }
///
///The carrier-supplied name for the shipping service type, such as "UPS Ground" or "2nd Day Air".If using a custom rate, this property corresponds to the field in when you navigate to > > , and then click on an existing rate or on .
///
public string ShippingMethodName { get; set; }
///
///The shipping subtotal amount calculated without any applied discounts for line item and entire amounts of carts and orders. This property is not calculated for wish lists at this time.
///
public decimal ShippingSubTotal { get; set; }
///
///Amount of tax applied to shipping costs for line items in and entire orders.
///
public decimal? ShippingTax { get; set; }
///
///The total amount of tax incurred on the shipping charges in the cart and order. This property is not calculated at this time for wish lists.
///
public decimal ShippingTaxTotal { get; set; }
///
///The calculated total shipping amount estimated for carts or orders, including tax. This amount is not calculated for wish lists at this time.
///
public decimal ShippingTotal { get; set; }
///
///standaloneGroup ApiType DOCUMENT_HERE
///
public bool StandaloneGroup { get; set; }
///
///Leverage this property within a [tax Arc.js action](https://www.mozu.com/docs/arcjs/commerce-catalog-storefront-tax/commerce-catalog-storefront-tax.htm) to supplement the tax information for this item or object with custom JSON data.
///
public JObject TaxData { get; set; }
}
} | {
"content_hash": "617b0e951b5a33bf4bbabc029ae1b26e",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 921,
"avg_line_length": 40.374149659863946,
"alnum_prop": 0.7080033698399326,
"repo_name": "Mozu/mozu-dotnet",
"id": "0d7d6d5143c3025fdf83bf510a7d5eb85fe469f3",
"size": "6299",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Mozu.Api/Contracts/CommerceRuntime/Checkouts/CheckoutGrouping.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "279"
},
{
"name": "C#",
"bytes": "8160653"
},
{
"name": "F#",
"bytes": "1750"
},
{
"name": "PowerShell",
"bytes": "3311"
}
],
"symlink_target": ""
} |
class Persist : public QObject
{
Q_OBJECT
public:
Persist();
virtual ~Persist();
// Singleton
static Persist *instance();
// Repository access
ShareRepository share;
private:
Persist(Persist const&); // hide copy constructor
void operator=(Persist const&); // hide assign op
void open_database();
void init_database();
QString db_type_;
};
#endif // PERSIST_H
| {
"content_hash": "0c3040283a1cf45bf0038c2561193ec1",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 60,
"avg_line_length": 17.541666666666668,
"alnum_prop": 0.6270783847980997,
"repo_name": "jfacchini/Arbore-qt",
"id": "bf1c63829f053a7175229ce87a518c7ecd62a5bd",
"size": "551",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/persist/persist.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "82274"
},
{
"name": "Makefile",
"bytes": "466"
},
{
"name": "QML",
"bytes": "18191"
},
{
"name": "QMake",
"bytes": "1637"
}
],
"symlink_target": ""
} |
package com.google.inject;
import com.google.inject.internal.Annotations;
import com.google.inject.internal.Errors;
import static com.google.inject.internal.Preconditions.checkNotNull;
import com.google.inject.spi.ScopeBinding;
import java.lang.annotation.Annotation;
/**
* Handles {@link Binder#bindScope} commands.
*
* @author crazybob@google.com (Bob Lee)
* @author jessewilson@google.com (Jesse Wilson)
*/
class ScopeBindingProcessor extends AbstractProcessor {
ScopeBindingProcessor(Errors errors) {
super(errors);
}
@Override public Boolean visit(ScopeBinding command) {
Scope scope = command.getScope();
Class<? extends Annotation> annotationType = command.getAnnotationType();
if (!Annotations.isScopeAnnotation(annotationType)) {
errors.withSource(annotationType).missingScopeAnnotation();
// Go ahead and bind anyway so we don't get collateral errors.
}
if (!Annotations.isRetainedAtRuntime(annotationType)) {
errors.withSource(annotationType)
.missingRuntimeRetention(command.getSource());
// Go ahead and bind anyway so we don't get collateral errors.
}
Scope existing = injector.state.getScope(checkNotNull(annotationType, "annotation type"));
if (existing != null) {
errors.duplicateScopes(existing, annotationType, scope);
} else {
injector.state.putAnnotation(annotationType, checkNotNull(scope, "scope"));
}
return true;
}
} | {
"content_hash": "cca0aad605cad89c55290e66e6fa30e3",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 94,
"avg_line_length": 31.02127659574468,
"alnum_prop": 0.7325102880658436,
"repo_name": "jstrachan/guicey",
"id": "79bce81971b2e67aa898e04545127228caea0e54",
"size": "2053",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/com/google/inject/ScopeBindingProcessor.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "1841934"
},
{
"name": "Shell",
"bytes": "3680"
}
],
"symlink_target": ""
} |
// .NAME vtkImageWrapPad - Makes an image larger by wrapping existing data.
// .SECTION Description
// vtkImageWrapPad performs a modulo operation on the output pixel index
// to determine the source input index. The new image extent of the
// output has to be specified. Input has to be the same scalar type as
// output.
#ifndef vtkImageWrapPad_h
#define vtkImageWrapPad_h
#include "vtkImagingCoreModule.h" // For export macro
#include "vtkImagePadFilter.h"
class vtkInformation;
class vtkInformationVector;
class VTKIMAGINGCORE_EXPORT vtkImageWrapPad : public vtkImagePadFilter
{
public:
static vtkImageWrapPad *New();
vtkTypeMacro(vtkImageWrapPad,vtkImagePadFilter);
protected:
vtkImageWrapPad() {}
~vtkImageWrapPad() {}
void ComputeInputUpdateExtent (int inExt[6], int outExt[6], int wExt[6]);
void ThreadedRequestData (vtkInformation* request,
vtkInformationVector** inputVector,
vtkInformationVector* outputVector,
vtkImageData ***inData, vtkImageData **outData,
int ext[6], int id);
private:
vtkImageWrapPad(const vtkImageWrapPad&) VTK_DELETE_FUNCTION;
void operator=(const vtkImageWrapPad&) VTK_DELETE_FUNCTION;
};
#endif
// VTK-HeaderTest-Exclude: vtkImageWrapPad.h
| {
"content_hash": "6f9afd4af4f458b1ac67c79b500d252a",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 75,
"avg_line_length": 29.31111111111111,
"alnum_prop": 0.7119029567854435,
"repo_name": "keithroe/vtkoptix",
"id": "fc4fadbbbff54bfa3faf7a9572dda97d774e67af",
"size": "1904",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Imaging/Core/vtkImageWrapPad.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "37444"
},
{
"name": "Batchfile",
"bytes": "106"
},
{
"name": "C",
"bytes": "46217717"
},
{
"name": "C++",
"bytes": "73779038"
},
{
"name": "CMake",
"bytes": "1786055"
},
{
"name": "CSS",
"bytes": "7532"
},
{
"name": "Cuda",
"bytes": "37418"
},
{
"name": "D",
"bytes": "2081"
},
{
"name": "GAP",
"bytes": "14120"
},
{
"name": "GLSL",
"bytes": "222494"
},
{
"name": "Groff",
"bytes": "65394"
},
{
"name": "HTML",
"bytes": "193016"
},
{
"name": "Java",
"bytes": "148789"
},
{
"name": "JavaScript",
"bytes": "54139"
},
{
"name": "Lex",
"bytes": "50109"
},
{
"name": "M4",
"bytes": "159710"
},
{
"name": "Makefile",
"bytes": "275672"
},
{
"name": "Objective-C",
"bytes": "22779"
},
{
"name": "Objective-C++",
"bytes": "191216"
},
{
"name": "Perl",
"bytes": "173168"
},
{
"name": "Prolog",
"bytes": "4406"
},
{
"name": "Python",
"bytes": "15765617"
},
{
"name": "Shell",
"bytes": "88087"
},
{
"name": "Slash",
"bytes": "1476"
},
{
"name": "Smarty",
"bytes": "393"
},
{
"name": "Tcl",
"bytes": "1404085"
},
{
"name": "Yacc",
"bytes": "191144"
}
],
"symlink_target": ""
} |
class SquareGraphNode : public Node
{
public:
SquareGraphNode()
{
theType = GeomSquareType;
}
};
#endif // SQUAREGRAPHNODE_H
| {
"content_hash": "e1d28a55280a690240ab3c51dd05e764",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 35,
"avg_line_length": 14.6,
"alnum_prop": 0.636986301369863,
"repo_name": "amrith92/concerto",
"id": "327c64fd448561866ca5fe6a5c417d52869f06c5",
"size": "221",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Nodes/SquareGraphNode.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "4112"
},
{
"name": "C++",
"bytes": "263591"
}
],
"symlink_target": ""
} |
describe('languageModule without lang in local storage', function() {
var $mod_lang;
var supportedLangs = ['en', 'ru'];
beforeEach(function() {
localStorage.removeItem('lang');
module('languageModule');
inject(function($injector) {
$mod_lang = $injector.get('$mod_lang');
})
});
it('should contain [en] lang', function() {
expect($mod_lang.langs).toHaveObject('en');
});
it('should contain [ru] lang', function() {
expect($mod_lang.langs).toHaveObject('ru');
});
it('should contain currentLangName = [en]', function() {
expect($mod_lang.currentLangName).toBe('en');
});
it('should contain english as currentLang', function() {
expect($mod_lang.currentLang).toEqual($mod_lang.langs['en']);
});
it('should contain language name for all langs', function() {
for (lang in supportedLangs) {
lang = supportedLangs[lang];
expect($mod_lang.langs[lang]).toHaveNonEmptyString('languageName');
}
});
});
describe('languageModule with [ru] lang in local storage', function() {
var $mod_lang;
beforeEach(function() {
localStorage.setItem('lang', 'ru');
module('languageModule');
inject(function($injector) {
$mod_lang = $injector.get('$mod_lang');
})
});
it('should contain currentLangName = [ru]', function() {
expect($mod_lang.currentLangName).toBe('ru');
});
it('should contain russian as currentLang', function() {
expect($mod_lang.currentLang).toEqual($mod_lang.langs['ru']);
});
});
| {
"content_hash": "ea7eead6c9f522457d7a141d9bf664b3",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 79,
"avg_line_length": 28.912280701754387,
"alnum_prop": 0.5837378640776699,
"repo_name": "vadim-shb/blanky",
"id": "a835c25caec9d54625d971dee8eac370985b3c1a",
"size": "1648",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "client/test/modules/language-module-spec.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "316"
},
{
"name": "HTML",
"bytes": "5314"
},
{
"name": "JavaScript",
"bytes": "31208"
},
{
"name": "Scala",
"bytes": "17268"
},
{
"name": "Shell",
"bytes": "383"
}
],
"symlink_target": ""
} |
import subprocess
fh = open("/etc/hosts", "r")
out_fh = open("/etc/new_hosts", "w")
line = fh.readline()
tokens = line.strip("\n").split()
skip = False
for token in tokens:
if token == "control":
skip = True
break
if not skip:
line = line.strip("\n")
line = "%s control\n" % line
out_fh.write(line)
out_fh.write(fh.read())
fh.close()
out_fh.close()
subprocess.call(["cp", "/etc/hosts", "/etc/old_hosts"])
subprocess.call(["cp", "/etc/new_hosts", "/etc/hosts"])
| {
"content_hash": "f40ded1659d074e78abe0e5fc5b706b3",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 55,
"avg_line_length": 19.076923076923077,
"alnum_prop": 0.5967741935483871,
"repo_name": "ISIEdgeLab/exp_scripts",
"id": "9db680a41ee14c421ef6ec5dcbefb9dd35023104",
"size": "510",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "fixHosts.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "30200"
},
{
"name": "Shell",
"bytes": "17100"
}
],
"symlink_target": ""
} |
package com.spring.core.event.salesuser;
import com.spring.core.event.CreateEvent;
/**
* @author vahid hosseinzadeh
* @version 1.0
* @since 1.0
*/
public class CreateSalesUserEvent extends CreateEvent {
private SalesUserDetails salesUserDetails;
public CreateSalesUserEvent(SalesUserDetails salesUserDetails) {
this.salesUserDetails = salesUserDetails;
}
public SalesUserDetails getSalesUserDetails() {
return salesUserDetails;
}
}
| {
"content_hash": "439ea6505f551cfa307f516e6c858233",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 68,
"avg_line_length": 22.714285714285715,
"alnum_prop": 0.740041928721174,
"repo_name": "garlos/ORFO",
"id": "1830fc969cc68ab59bd8560426d920e9ad241951",
"size": "477",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/spring/core/event/salesuser/CreateSalesUserEvent.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "366848"
},
{
"name": "Java",
"bytes": "410594"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<!--
*** GENERATED FROM project.xml - DO NOT EDIT ***
*** EDIT ../build.xml INSTEAD ***
For the purpose of easier reading the script
is divided into following sections:
- initialization
- compilation
- jar
- execution
- debugging
- javadoc
- test compilation
- test execution
- test debugging
- applet
- cleanup
-->
<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="Decomisims-impl">
<fail message="Please build using Ant 1.8.0 or higher.">
<condition>
<not>
<antversion atleast="1.8.0"/>
</not>
</condition>
</fail>
<target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
<!--
======================
INITIALIZATION SECTION
======================
-->
<target name="-pre-init">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="-pre-init" name="-init-private">
<property file="nbproject/private/config.properties"/>
<property file="nbproject/private/configs/${config}.properties"/>
<property file="nbproject/private/private.properties"/>
</target>
<target name="-pre-init-libraries">
<property location="./lib/nblibraries.properties" name="libraries.path"/>
<dirname file="${libraries.path}" property="libraries.dir.nativedirsep"/>
<pathconvert dirsep="/" property="libraries.dir">
<path path="${libraries.dir.nativedirsep}"/>
</pathconvert>
<basename file="${libraries.path}" property="libraries.basename" suffix=".properties"/>
<available file="${libraries.dir}/${libraries.basename}-private.properties" property="private.properties.available"/>
</target>
<target depends="-pre-init-libraries" if="private.properties.available" name="-init-private-libraries">
<loadproperties encoding="ISO-8859-1" srcfile="${libraries.dir}/${libraries.basename}-private.properties">
<filterchain>
<replacestring from="$${base}" to="${libraries.dir}"/>
<escapeunicode/>
</filterchain>
</loadproperties>
</target>
<target depends="-pre-init,-init-private,-init-private-libraries" name="-init-libraries">
<loadproperties encoding="ISO-8859-1" srcfile="${libraries.path}">
<filterchain>
<replacestring from="$${base}" to="${libraries.dir}"/>
<escapeunicode/>
</filterchain>
</loadproperties>
</target>
<target depends="-pre-init,-init-private,-init-libraries" name="-init-user">
<property file="${user.properties.file}"/>
<!-- The two properties below are usually overridden -->
<!-- by the active platform. Just a fallback. -->
<property name="default.javac.source" value="1.4"/>
<property name="default.javac.target" value="1.4"/>
</target>
<target depends="-pre-init,-init-private,-init-libraries,-init-user" name="-init-project">
<property file="nbproject/configs/${config}.properties"/>
<property file="nbproject/project.properties"/>
</target>
<target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init">
<j2seproject1:property name="platform.home" value="platforms.${platform.active}.home"/>
<j2seproject1:property name="platform.bootcp" value="platforms.${platform.active}.bootclasspath"/>
<j2seproject1:property name="platform.compiler" value="platforms.${platform.active}.compile"/>
<j2seproject1:property name="platform.javac.tmp" value="platforms.${platform.active}.javac"/>
<condition property="platform.javac" value="${platform.home}/bin/javac">
<equals arg1="${platform.javac.tmp}" arg2="$${platforms.${platform.active}.javac}"/>
</condition>
<property name="platform.javac" value="${platform.javac.tmp}"/>
<j2seproject1:property name="platform.java.tmp" value="platforms.${platform.active}.java"/>
<condition property="platform.java" value="${platform.home}/bin/java">
<equals arg1="${platform.java.tmp}" arg2="$${platforms.${platform.active}.java}"/>
</condition>
<property name="platform.java" value="${platform.java.tmp}"/>
<j2seproject1:property name="platform.javadoc.tmp" value="platforms.${platform.active}.javadoc"/>
<condition property="platform.javadoc" value="${platform.home}/bin/javadoc">
<equals arg1="${platform.javadoc.tmp}" arg2="$${platforms.${platform.active}.javadoc}"/>
</condition>
<property name="platform.javadoc" value="${platform.javadoc.tmp}"/>
<condition property="platform.invalid" value="true">
<or>
<contains string="${platform.javac}" substring="$${platforms."/>
<contains string="${platform.java}" substring="$${platforms."/>
<contains string="${platform.javadoc}" substring="$${platforms."/>
</or>
</condition>
<fail unless="platform.home">Must set platform.home</fail>
<fail unless="platform.bootcp">Must set platform.bootcp</fail>
<fail unless="platform.java">Must set platform.java</fail>
<fail unless="platform.javac">Must set platform.javac</fail>
<fail if="platform.invalid">
The J2SE Platform is not correctly set up.
Your active platform is: ${platform.active}, but the corresponding property "platforms.${platform.active}.home" is not found in the project's properties files.
Either open the project in the IDE and setup the Platform with the same name or add it manually.
For example like this:
ant -Duser.properties.file=<path_to_property_file> jar (where you put the property "platforms.${platform.active}.home" in a .properties file)
or ant -Dplatforms.${platform.active}.home=<path_to_JDK_home> jar (where no properties file is used)
</fail>
<available file="${manifest.file}" property="manifest.available"/>
<condition property="splashscreen.available">
<and>
<not>
<equals arg1="${application.splash}" arg2="" trim="true"/>
</not>
<available file="${application.splash}"/>
</and>
</condition>
<condition property="main.class.available">
<and>
<isset property="main.class"/>
<not>
<equals arg1="${main.class}" arg2="" trim="true"/>
</not>
</and>
</condition>
<condition property="profile.available">
<and>
<isset property="javac.profile"/>
<length length="0" string="${javac.profile}" when="greater"/>
<matches pattern="1\.[89](\..*)?" string="${javac.source}"/>
</and>
</condition>
<condition property="do.archive">
<not>
<istrue value="${jar.archive.disabled}"/>
</not>
</condition>
<condition property="do.mkdist">
<and>
<isset property="do.archive"/>
<isset property="libs.CopyLibs.classpath"/>
<not>
<istrue value="${mkdist.disabled}"/>
</not>
</and>
</condition>
<condition property="do.archive+manifest.available">
<and>
<isset property="manifest.available"/>
<istrue value="${do.archive}"/>
</and>
</condition>
<condition property="do.archive+main.class.available">
<and>
<isset property="main.class.available"/>
<istrue value="${do.archive}"/>
</and>
</condition>
<condition property="do.archive+splashscreen.available">
<and>
<isset property="splashscreen.available"/>
<istrue value="${do.archive}"/>
</and>
</condition>
<condition property="do.archive+profile.available">
<and>
<isset property="profile.available"/>
<istrue value="${do.archive}"/>
</and>
</condition>
<condition property="have.tests">
<or>
<available file="${test.src.dir}"/>
</or>
</condition>
<condition property="have.sources">
<or>
<available file="${src.dir}"/>
<available file="${src.reports.dir}"/>
</or>
</condition>
<condition property="netbeans.home+have.tests">
<and>
<isset property="netbeans.home"/>
<isset property="have.tests"/>
</and>
</condition>
<condition property="no.javadoc.preview">
<and>
<isset property="javadoc.preview"/>
<isfalse value="${javadoc.preview}"/>
</and>
</condition>
<property name="run.jvmargs" value=""/>
<property name="run.jvmargs.ide" value=""/>
<property name="javac.compilerargs" value=""/>
<property name="work.dir" value="${basedir}"/>
<condition property="no.deps">
<and>
<istrue value="${no.dependencies}"/>
</and>
</condition>
<property name="javac.debug" value="true"/>
<property name="javadoc.preview" value="true"/>
<property name="application.args" value=""/>
<property name="source.encoding" value="${file.encoding}"/>
<property name="runtime.encoding" value="${source.encoding}"/>
<condition property="javadoc.encoding.used" value="${javadoc.encoding}">
<and>
<isset property="javadoc.encoding"/>
<not>
<equals arg1="${javadoc.encoding}" arg2=""/>
</not>
</and>
</condition>
<property name="javadoc.encoding.used" value="${source.encoding}"/>
<property name="includes" value="**"/>
<property name="excludes" value=""/>
<property name="do.depend" value="false"/>
<condition property="do.depend.true">
<istrue value="${do.depend}"/>
</condition>
<path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
<condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
<and>
<isset property="endorsed.classpath"/>
<not>
<equals arg1="${endorsed.classpath}" arg2="" trim="true"/>
</not>
</and>
</condition>
<condition else="" property="javac.profile.cmd.line.arg" value="-profile ${javac.profile}">
<isset property="profile.available"/>
</condition>
<property name="jar.index" value="false"/>
<property name="jar.index.metainf" value="${jar.index}"/>
<property name="copylibs.rebase" value="true"/>
<available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
<condition property="junit.available">
<or>
<available classname="org.junit.Test" classpath="${run.test.classpath}"/>
<available classname="junit.framework.Test" classpath="${run.test.classpath}"/>
</or>
</condition>
<condition property="testng.available">
<available classname="org.testng.annotations.Test" classpath="${run.test.classpath}"/>
</condition>
<condition property="junit+testng.available">
<and>
<istrue value="${junit.available}"/>
<istrue value="${testng.available}"/>
</and>
</condition>
<condition else="testng" property="testng.mode" value="mixed">
<istrue value="${junit+testng.available}"/>
</condition>
<condition else="" property="testng.debug.mode" value="-mixed">
<istrue value="${junit+testng.available}"/>
</condition>
</target>
<target name="-post-init">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init" name="-init-check">
<fail unless="src.dir">Must set src.dir</fail>
<fail unless="src.reports.dir">Must set src.reports.dir</fail>
<fail unless="test.src.dir">Must set test.src.dir</fail>
<fail unless="build.dir">Must set build.dir</fail>
<fail unless="dist.dir">Must set dist.dir</fail>
<fail unless="build.classes.dir">Must set build.classes.dir</fail>
<fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
<fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
<fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
<fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
<fail unless="dist.jar">Must set dist.jar</fail>
</target>
<target name="-init-macrodef-property">
<macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
<attribute name="name"/>
<attribute name="value"/>
<sequential>
<property name="@{name}" value="${@{value}}"/>
</sequential>
</macrodef>
</target>
<target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
<macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${src.dir}:${src.reports.dir}" name="srcdir"/>
<attribute default="${build.classes.dir}" name="destdir"/>
<attribute default="${javac.classpath}" name="classpath"/>
<attribute default="${javac.processorpath}" name="processorpath"/>
<attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="${javac.debug}" name="debug"/>
<attribute default="${empty.dir}" name="sourcepath"/>
<attribute default="${empty.dir}" name="gensrcdir"/>
<element name="customize" optional="true"/>
<sequential>
<property location="${build.dir}/empty" name="empty.dir"/>
<mkdir dir="${empty.dir}"/>
<mkdir dir="@{apgeneratedsrcdir}"/>
<javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" executable="${platform.javac}" fork="yes" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
<src>
<dirset dir="@{gensrcdir}" erroronmissingdir="false">
<include name="*"/>
</dirset>
</src>
<classpath>
<path path="@{classpath}"/>
</classpath>
<compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
<compilerarg line="${javac.profile.cmd.line.arg}"/>
<compilerarg line="${javac.compilerargs}"/>
<compilerarg value="-processorpath"/>
<compilerarg path="@{processorpath}:${empty.dir}"/>
<compilerarg line="${ap.processors.internal}"/>
<compilerarg line="${annotation.processing.processor.options}"/>
<compilerarg value="-s"/>
<compilerarg path="@{apgeneratedsrcdir}"/>
<compilerarg line="${ap.proc.none.internal}"/>
<customize/>
</javac>
</sequential>
</macrodef>
</target>
<target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
<macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${src.dir}:${src.reports.dir}" name="srcdir"/>
<attribute default="${build.classes.dir}" name="destdir"/>
<attribute default="${javac.classpath}" name="classpath"/>
<attribute default="${javac.processorpath}" name="processorpath"/>
<attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="${javac.debug}" name="debug"/>
<attribute default="${empty.dir}" name="sourcepath"/>
<attribute default="${empty.dir}" name="gensrcdir"/>
<element name="customize" optional="true"/>
<sequential>
<property location="${build.dir}/empty" name="empty.dir"/>
<mkdir dir="${empty.dir}"/>
<javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" executable="${platform.javac}" fork="yes" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
<src>
<dirset dir="@{gensrcdir}" erroronmissingdir="false">
<include name="*"/>
</dirset>
</src>
<classpath>
<path path="@{classpath}"/>
</classpath>
<compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
<compilerarg line="${javac.profile.cmd.line.arg}"/>
<compilerarg line="${javac.compilerargs}"/>
<customize/>
</javac>
</sequential>
</macrodef>
</target>
<target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
<macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${src.dir}:${src.reports.dir}" name="srcdir"/>
<attribute default="${build.classes.dir}" name="destdir"/>
<attribute default="${javac.classpath}" name="classpath"/>
<sequential>
<depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
<classpath>
<path path="@{classpath}"/>
</classpath>
</depend>
</sequential>
</macrodef>
<macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${build.classes.dir}" name="destdir"/>
<sequential>
<fail unless="javac.includes">Must set javac.includes</fail>
<pathconvert pathsep="${line.separator}" property="javac.includes.binary">
<path>
<filelist dir="@{destdir}" files="${javac.includes}"/>
</path>
<globmapper from="*.java" to="*.class"/>
</pathconvert>
<tempfile deleteonexit="true" property="javac.includesfile.binary"/>
<echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
<delete>
<files includesfile="${javac.includesfile.binary}"/>
</delete>
<delete>
<fileset file="${javac.includesfile.binary}"/>
</delete>
</sequential>
</macrodef>
</target>
<target if="${junit.available}" name="-init-macrodef-junit-init">
<condition else="false" property="nb.junit.batch" value="true">
<and>
<istrue value="${junit.available}"/>
<not>
<isset property="test.method"/>
</not>
</and>
</condition>
<condition else="false" property="nb.junit.single" value="true">
<and>
<istrue value="${junit.available}"/>
<isset property="test.method"/>
</and>
</condition>
</target>
<target name="-init-test-properties">
<property name="test.binaryincludes" value="<nothing>"/>
<property name="test.binarytestincludes" value=""/>
<property name="test.binaryexcludes" value=""/>
</target>
<target if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
<macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="**" name="testincludes"/>
<attribute default="" name="testmethods"/>
<element name="customize" optional="true"/>
<sequential>
<property name="junit.forkmode" value="perTest"/>
<junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" jvm="${platform.java}" showoutput="true" tempdir="${build.dir}">
<test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
<syspropertyset>
<propertyref prefix="test-sys-prop."/>
<mapper from="test-sys-prop.*" to="*" type="glob"/>
</syspropertyset>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
<jvmarg value="-ea"/>
<customize/>
</junit>
</sequential>
</macrodef>
</target>
<target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
<macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="**" name="testincludes"/>
<attribute default="" name="testmethods"/>
<element name="customize" optional="true"/>
<sequential>
<property name="junit.forkmode" value="perTest"/>
<junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" jvm="${platform.java}" showoutput="true" tempdir="${build.dir}">
<batchtest todir="${build.test.results.dir}">
<fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
<filename name="@{testincludes}"/>
</fileset>
<fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
<filename name="${test.binarytestincludes}"/>
</fileset>
</batchtest>
<syspropertyset>
<propertyref prefix="test-sys-prop."/>
<mapper from="test-sys-prop.*" to="*" type="glob"/>
</syspropertyset>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
<jvmarg value="-ea"/>
<customize/>
</junit>
</sequential>
</macrodef>
</target>
<target depends="-init-macrodef-junit-init,-init-macrodef-junit-single, -init-macrodef-junit-batch" if="${junit.available}" name="-init-macrodef-junit"/>
<target if="${testng.available}" name="-init-macrodef-testng">
<macrodef name="testng" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="**" name="testincludes"/>
<attribute default="" name="testmethods"/>
<element name="customize" optional="true"/>
<sequential>
<condition else="" property="testng.methods.arg" value="@{testincludes}.@{testmethods}">
<isset property="test.method"/>
</condition>
<union id="test.set">
<fileset dir="${test.src.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}">
<filename name="@{testincludes}"/>
</fileset>
</union>
<taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
<testng classfilesetref="test.set" failureProperty="tests.failed" jvm="${platform.java}" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="Decomisims" testname="TestNG tests" workingDir="${work.dir}">
<xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
<propertyset>
<propertyref prefix="test-sys-prop."/>
<mapper from="test-sys-prop.*" to="*" type="glob"/>
</propertyset>
<customize/>
</testng>
</sequential>
</macrodef>
</target>
<target name="-init-macrodef-test-impl">
<macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="**" name="testincludes"/>
<attribute default="" name="testmethods"/>
<element implicit="true" name="customize" optional="true"/>
<sequential>
<echo>No tests executed.</echo>
</sequential>
</macrodef>
</target>
<target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl">
<macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="**" name="testincludes"/>
<attribute default="" name="testmethods"/>
<element implicit="true" name="customize" optional="true"/>
<sequential>
<j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
<customize/>
</j2seproject3:junit>
</sequential>
</macrodef>
</target>
<target depends="-init-macrodef-testng" if="${testng.available}" name="-init-macrodef-testng-impl">
<macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="**" name="testincludes"/>
<attribute default="" name="testmethods"/>
<element implicit="true" name="customize" optional="true"/>
<sequential>
<j2seproject3:testng excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
<customize/>
</j2seproject3:testng>
</sequential>
</macrodef>
</target>
<target depends="-init-macrodef-test-impl,-init-macrodef-junit-impl,-init-macrodef-testng-impl" name="-init-macrodef-test">
<macrodef name="test" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="**" name="testincludes"/>
<attribute default="" name="testmethods"/>
<sequential>
<j2seproject3:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
<customize>
<classpath>
<path path="${run.test.classpath}"/>
</classpath>
<jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
<jvmarg line="${run.jvmargs}"/>
<jvmarg line="${run.jvmargs.ide}"/>
</customize>
</j2seproject3:test-impl>
</sequential>
</macrodef>
</target>
<target if="${junit.available}" name="-init-macrodef-junit-debug" unless="${nb.junit.batch}">
<macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="**" name="testincludes"/>
<attribute default="" name="testmethods"/>
<element name="customize" optional="true"/>
<sequential>
<property name="junit.forkmode" value="perTest"/>
<junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" jvm="${platform.java}" showoutput="true" tempdir="${build.dir}">
<test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
<syspropertyset>
<propertyref prefix="test-sys-prop."/>
<mapper from="test-sys-prop.*" to="*" type="glob"/>
</syspropertyset>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
<jvmarg value="-ea"/>
<jvmarg line="${debug-args-line}"/>
<jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
<customize/>
</junit>
</sequential>
</macrodef>
</target>
<target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-debug-batch">
<macrodef name="junit-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="**" name="testincludes"/>
<attribute default="" name="testmethods"/>
<element name="customize" optional="true"/>
<sequential>
<property name="junit.forkmode" value="perTest"/>
<junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" jvm="${platform.java}" showoutput="true" tempdir="${build.dir}">
<batchtest todir="${build.test.results.dir}">
<fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
<filename name="@{testincludes}"/>
</fileset>
<fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
<filename name="${test.binarytestincludes}"/>
</fileset>
</batchtest>
<syspropertyset>
<propertyref prefix="test-sys-prop."/>
<mapper from="test-sys-prop.*" to="*" type="glob"/>
</syspropertyset>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
<jvmarg value="-ea"/>
<jvmarg line="${debug-args-line}"/>
<jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
<customize/>
</junit>
</sequential>
</macrodef>
</target>
<target depends="-init-macrodef-junit-debug,-init-macrodef-junit-debug-batch" if="${junit.available}" name="-init-macrodef-junit-debug-impl">
<macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="**" name="testincludes"/>
<attribute default="" name="testmethods"/>
<element implicit="true" name="customize" optional="true"/>
<sequential>
<j2seproject3:junit-debug excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
<customize/>
</j2seproject3:junit-debug>
</sequential>
</macrodef>
</target>
<target if="${testng.available}" name="-init-macrodef-testng-debug">
<macrodef name="testng-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${main.class}" name="testClass"/>
<attribute default="" name="testMethod"/>
<element name="customize2" optional="true"/>
<sequential>
<condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}">
<isset property="test.method"/>
</condition>
<condition else="-suitename Decomisims -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
<matches pattern=".*\.xml" string="@{testClass}"/>
</condition>
<delete dir="${build.test.results.dir}" quiet="true"/>
<mkdir dir="${build.test.results.dir}"/>
<j2seproject3:debug classname="org.testng.TestNG" classpath="${debug.test.classpath}">
<customize>
<customize2/>
<jvmarg value="-ea"/>
<arg line="${testng.debug.mode}"/>
<arg line="-d ${build.test.results.dir}"/>
<arg line="-listener org.testng.reporters.VerboseReporter"/>
<arg line="${testng.cmd.args}"/>
</customize>
</j2seproject3:debug>
</sequential>
</macrodef>
</target>
<target depends="-init-macrodef-testng-debug" if="${testng.available}" name="-init-macrodef-testng-debug-impl">
<macrodef name="testng-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${main.class}" name="testClass"/>
<attribute default="" name="testMethod"/>
<element implicit="true" name="customize2" optional="true"/>
<sequential>
<j2seproject3:testng-debug testClass="@{testClass}" testMethod="@{testMethod}">
<customize2/>
</j2seproject3:testng-debug>
</sequential>
</macrodef>
</target>
<target depends="-init-macrodef-junit-debug-impl" if="${junit.available}" name="-init-macrodef-test-debug-junit">
<macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="**" name="testincludes"/>
<attribute default="" name="testmethods"/>
<attribute default="${main.class}" name="testClass"/>
<attribute default="" name="testMethod"/>
<sequential>
<j2seproject3:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
<customize>
<classpath>
<path path="${run.test.classpath}"/>
</classpath>
<jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
<jvmarg line="${run.jvmargs}"/>
<jvmarg line="${run.jvmargs.ide}"/>
</customize>
</j2seproject3:test-debug-impl>
</sequential>
</macrodef>
</target>
<target depends="-init-macrodef-testng-debug-impl" if="${testng.available}" name="-init-macrodef-test-debug-testng">
<macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="**" name="testincludes"/>
<attribute default="" name="testmethods"/>
<attribute default="${main.class}" name="testClass"/>
<attribute default="" name="testMethod"/>
<sequential>
<j2seproject3:testng-debug-impl testClass="@{testClass}" testMethod="@{testMethod}">
<customize2>
<syspropertyset>
<propertyref prefix="test-sys-prop."/>
<mapper from="test-sys-prop.*" to="*" type="glob"/>
</syspropertyset>
</customize2>
</j2seproject3:testng-debug-impl>
</sequential>
</macrodef>
</target>
<target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/>
<!--
pre NB7.2 profiling section; consider it deprecated
-->
<target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/>
<target if="profiler.info.jvmargs.agent" name="-profile-pre-init">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target if="profiler.info.jvmargs.agent" name="-profile-post-init">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target if="profiler.info.jvmargs.agent" name="-profile-init-macrodef-profile">
<macrodef name="resolve">
<attribute name="name"/>
<attribute name="value"/>
<sequential>
<property name="@{name}" value="${env.@{value}}"/>
</sequential>
</macrodef>
<macrodef name="profile">
<attribute default="${main.class}" name="classname"/>
<element name="customize" optional="true"/>
<sequential>
<property environment="env"/>
<resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
<java classname="@{classname}" dir="${profiler.info.dir}" fork="true" jvm="${profiler.info.jvm}">
<jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
<jvmarg value="${profiler.info.jvmargs.agent}"/>
<jvmarg line="${profiler.info.jvmargs}"/>
<env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
<arg line="${application.args}"/>
<classpath>
<path path="${run.classpath}"/>
</classpath>
<syspropertyset>
<propertyref prefix="run-sys-prop."/>
<mapper from="run-sys-prop.*" to="*" type="glob"/>
</syspropertyset>
<customize/>
</java>
</sequential>
</macrodef>
</target>
<target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" if="profiler.info.jvmargs.agent" name="-profile-init-check">
<fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
<fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
</target>
<!--
end of pre NB7.2 profiling section
-->
<target depends="-init-debug-args" name="-init-macrodef-nbjpda">
<macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
<attribute default="${main.class}" name="name"/>
<attribute default="${debug.classpath}" name="classpath"/>
<attribute default="" name="stopclassname"/>
<sequential>
<nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
<classpath>
<path path="@{classpath}"/>
</classpath>
<bootclasspath>
<path path="${platform.bootcp}"/>
</bootclasspath>
</nbjpdastart>
</sequential>
</macrodef>
<macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
<attribute default="${build.classes.dir}" name="dir"/>
<sequential>
<nbjpdareload>
<fileset dir="@{dir}" includes="${fix.classes}">
<include name="${fix.includes}*.class"/>
</fileset>
</nbjpdareload>
</sequential>
</macrodef>
</target>
<target name="-init-debug-args">
<exec executable="${platform.java}" outputproperty="version-output">
<arg value="-version"/>
</exec>
<condition property="have-jdk-older-than-1.4">
<or>
<contains string="${version-output}" substring="java version "1.0"/>
<contains string="${version-output}" substring="java version "1.1"/>
<contains string="${version-output}" substring="java version "1.2"/>
<contains string="${version-output}" substring="java version "1.3"/>
</or>
</condition>
<condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
<istrue value="${have-jdk-older-than-1.4}"/>
</condition>
<condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
<os family="windows"/>
</condition>
<condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
<isset property="debug.transport"/>
</condition>
</target>
<target depends="-init-debug-args" name="-init-macrodef-debug">
<macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${main.class}" name="classname"/>
<attribute default="${debug.classpath}" name="classpath"/>
<element name="customize" optional="true"/>
<sequential>
<java classname="@{classname}" dir="${work.dir}" fork="true" jvm="${platform.java}">
<jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
<jvmarg line="${debug-args-line}"/>
<jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
<jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
<redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
<jvmarg line="${run.jvmargs}"/>
<jvmarg line="${run.jvmargs.ide}"/>
<classpath>
<path path="@{classpath}"/>
</classpath>
<syspropertyset>
<propertyref prefix="run-sys-prop."/>
<mapper from="run-sys-prop.*" to="*" type="glob"/>
</syspropertyset>
<customize/>
</java>
</sequential>
</macrodef>
</target>
<target name="-init-macrodef-java">
<macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
<attribute default="${main.class}" name="classname"/>
<attribute default="${run.classpath}" name="classpath"/>
<attribute default="jvm" name="jvm"/>
<element name="customize" optional="true"/>
<sequential>
<java classname="@{classname}" dir="${work.dir}" fork="true" jvm="${platform.java}">
<jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
<jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
<redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
<jvmarg line="${run.jvmargs}"/>
<jvmarg line="${run.jvmargs.ide}"/>
<classpath>
<path path="@{classpath}"/>
</classpath>
<syspropertyset>
<propertyref prefix="run-sys-prop."/>
<mapper from="run-sys-prop.*" to="*" type="glob"/>
</syspropertyset>
<customize/>
</java>
</sequential>
</macrodef>
</target>
<target name="-init-macrodef-copylibs">
<macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${manifest.file}" name="manifest"/>
<element name="customize" optional="true"/>
<sequential>
<property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
<pathconvert property="run.classpath.without.build.classes.dir">
<path path="${run.classpath}"/>
<map from="${build.classes.dir.resolved}" to=""/>
</pathconvert>
<pathconvert pathsep=" " property="jar.classpath">
<path path="${run.classpath.without.build.classes.dir}"/>
<chainedmapper>
<flattenmapper/>
<filtermapper>
<replacestring from=" " to="%20"/>
</filtermapper>
<globmapper from="*" to="lib/*"/>
</chainedmapper>
</pathconvert>
<taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
<copylibs compress="${jar.compress}" excludeFromCopy="${copylibs.excludes}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
<fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
<manifest>
<attribute name="Class-Path" value="${jar.classpath}"/>
<customize/>
</manifest>
</copylibs>
</sequential>
</macrodef>
</target>
<target name="-init-presetdef-jar">
<presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
<jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
<j2seproject1:fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
</jar>
</presetdef>
</target>
<target name="-init-ap-cmdline-properties">
<property name="annotation.processing.enabled" value="true"/>
<property name="annotation.processing.processors.list" value=""/>
<property name="annotation.processing.processor.options" value=""/>
<property name="annotation.processing.run.all.processors" value="true"/>
<property name="javac.processorpath" value="${javac.classpath}"/>
<property name="javac.test.processorpath" value="${javac.test.classpath}"/>
<condition property="ap.supported.internal" value="true">
<not>
<matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
</not>
</condition>
</target>
<target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
<condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
<isfalse value="${annotation.processing.run.all.processors}"/>
</condition>
<condition else="" property="ap.proc.none.internal" value="-proc:none">
<isfalse value="${annotation.processing.enabled}"/>
</condition>
</target>
<target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
<property name="ap.cmd.line.internal" value=""/>
</target>
<target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-test,-init-macrodef-test-debug,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
<!--
===================
COMPILATION SECTION
===================
-->
<target name="-deps-jar-init" unless="built-jar.properties">
<property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
<delete file="${built-jar.properties}" quiet="true"/>
</target>
<target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
<echo level="warn" message="Cycle detected: Decomisims was already built"/>
</target>
<target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
<mkdir dir="${build.dir}"/>
<touch file="${built-jar.properties}" verbose="false"/>
<property file="${built-jar.properties}" prefix="already.built.jar."/>
<antcall target="-warn-already-built-jar"/>
<propertyfile file="${built-jar.properties}">
<entry key="${basedir}" value=""/>
</propertyfile>
</target>
<target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
<target depends="init" name="-check-automatic-build">
<available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
</target>
<target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
<antcall target="clean"/>
</target>
<target depends="init,deps-jar" name="-pre-pre-compile">
<mkdir dir="${build.classes.dir}"/>
</target>
<target name="-pre-compile">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target if="do.depend.true" name="-compile-depend">
<pathconvert property="build.generated.subdirs">
<dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
<include name="*"/>
</dirset>
</pathconvert>
<j2seproject3:depend srcdir="${src.dir}:${src.reports.dir}:${build.generated.subdirs}"/>
</target>
<target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
<j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
<copy todir="${build.classes.dir}">
<fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
<fileset dir="${src.reports.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
</copy>
</target>
<target if="has.persistence.xml" name="-copy-persistence-xml">
<mkdir dir="${build.classes.dir}/META-INF"/>
<copy todir="${build.classes.dir}/META-INF">
<fileset dir="${meta.inf.dir}" includes="persistence.xml orm.xml"/>
</copy>
</target>
<target name="-post-compile">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
<target name="-pre-compile-single">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
<fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
<j2seproject3:force-recompile/>
<j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}:${src.reports.dir}"/>
</target>
<target name="-post-compile-single">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
<!--
====================
JAR BUILDING SECTION
====================
-->
<target depends="init" name="-pre-pre-jar">
<dirname file="${dist.jar}" property="dist.jar.dir"/>
<mkdir dir="${dist.jar.dir}"/>
</target>
<target name="-pre-jar">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="init" if="do.archive" name="-do-jar-create-manifest" unless="manifest.available">
<tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
<touch file="${tmp.manifest.file}" verbose="false"/>
</target>
<target depends="init" if="do.archive+manifest.available" name="-do-jar-copy-manifest">
<tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
<copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
</target>
<target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+main.class.available" name="-do-jar-set-mainclass">
<manifest file="${tmp.manifest.file}" mode="update">
<attribute name="Main-Class" value="${main.class}"/>
</manifest>
</target>
<target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+profile.available" name="-do-jar-set-profile">
<manifest file="${tmp.manifest.file}" mode="update">
<attribute name="Profile" value="${javac.profile}"/>
</manifest>
</target>
<target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-set-splashscreen">
<basename file="${application.splash}" property="splashscreen.basename"/>
<mkdir dir="${build.classes.dir}/META-INF"/>
<copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
<manifest file="${tmp.manifest.file}" mode="update">
<attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
</manifest>
</target>
<target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.mkdist" name="-do-jar-copylibs">
<j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
<echo level="info">To run this application from the command line without Ant, try:</echo>
<property location="${dist.jar}" name="dist.jar.resolved"/>
<echo level="info">${platform.java} -jar "${dist.jar.resolved}"</echo>
</target>
<target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.archive" name="-do-jar-jar" unless="do.mkdist">
<j2seproject1:jar manifest="${tmp.manifest.file}"/>
<property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
<property location="${dist.jar}" name="dist.jar.resolved"/>
<pathconvert property="run.classpath.with.dist.jar">
<path path="${run.classpath}"/>
<map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
</pathconvert>
<condition else="" property="jar.usage.message" value="To run this application from the command line without Ant, try:${line.separator}${platform.java} -cp ${run.classpath.with.dist.jar} ${main.class}">
<isset property="main.class.available"/>
</condition>
<condition else="debug" property="jar.usage.level" value="info">
<isset property="main.class.available"/>
</condition>
<echo level="${jar.usage.level}" message="${jar.usage.message}"/>
</target>
<target depends="-do-jar-copylibs" if="do.archive" name="-do-jar-delete-manifest">
<delete>
<fileset file="${tmp.manifest.file}"/>
</delete>
</target>
<target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-jar,-do-jar-delete-manifest" name="-do-jar-without-libraries"/>
<target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-copylibs,-do-jar-delete-manifest" name="-do-jar-with-libraries"/>
<target name="-post-jar">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="init,compile,-pre-jar,-do-jar-without-libraries,-do-jar-with-libraries,-post-jar" name="-do-jar"/>
<target depends="init,compile,-pre-jar,-do-jar,-post-jar" description="Build JAR." name="jar"/>
<!--
=================
EXECUTION SECTION
=================
-->
<target depends="init,compile" description="Run a main class." name="run">
<j2seproject1:java>
<customize>
<arg line="${application.args}"/>
</customize>
</j2seproject1:java>
</target>
<target name="-do-not-recompile">
<property name="javac.includes.binary" value=""/>
</target>
<target depends="init,compile-single" name="run-single">
<fail unless="run.class">Must select one file in the IDE or set run.class</fail>
<j2seproject1:java classname="${run.class}"/>
</target>
<target depends="init,compile-test-single" name="run-test-with-main">
<fail unless="run.class">Must select one file in the IDE or set run.class</fail>
<j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
</target>
<!--
=================
DEBUGGING SECTION
=================
-->
<target depends="init" if="netbeans.home" name="-debug-start-debugger">
<j2seproject1:nbjpdastart name="${debug.class}"/>
</target>
<target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
<j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
</target>
<target depends="init,compile" name="-debug-start-debuggee">
<j2seproject3:debug>
<customize>
<arg line="${application.args}"/>
</customize>
</j2seproject3:debug>
</target>
<target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
<target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
<j2seproject1:nbjpdastart stopclassname="${main.class}"/>
</target>
<target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
<target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
<fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
<j2seproject3:debug classname="${debug.class}"/>
</target>
<target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
<target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
<fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
<j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
</target>
<target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
<target depends="init" name="-pre-debug-fix">
<fail unless="fix.includes">Must set fix.includes</fail>
<property name="javac.includes" value="${fix.includes}.java"/>
</target>
<target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
<j2seproject1:nbjpdareload/>
</target>
<target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
<!--
=================
PROFILING SECTION
=================
-->
<!--
pre NB7.2 profiler integration
-->
<target depends="profile-init,compile" description="Profile a project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
<fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
<nbprofiledirect>
<classpath>
<path path="${run.classpath}"/>
</classpath>
</nbprofiledirect>
<profile/>
</target>
<target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="profiler.info.jvmargs.agent" name="-profile-single-pre72">
<fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
<fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
<nbprofiledirect>
<classpath>
<path path="${run.classpath}"/>
</classpath>
</nbprofiledirect>
<profile classname="${profile.class}"/>
</target>
<target depends="profile-init,compile-single" if="profiler.info.jvmargs.agent" name="-profile-applet-pre72">
<fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
<nbprofiledirect>
<classpath>
<path path="${run.classpath}"/>
</classpath>
</nbprofiledirect>
<profile classname="sun.applet.AppletViewer">
<customize>
<arg value="${applet.url}"/>
</customize>
</profile>
</target>
<target depends="profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
<fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
<nbprofiledirect>
<classpath>
<path path="${run.test.classpath}"/>
</classpath>
</nbprofiledirect>
<junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
<env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
<jvmarg value="${profiler.info.jvmargs.agent}"/>
<jvmarg line="${profiler.info.jvmargs}"/>
<test name="${profile.class}"/>
<classpath>
<path path="${run.test.classpath}"/>
</classpath>
<syspropertyset>
<propertyref prefix="test-sys-prop."/>
<mapper from="test-sys-prop.*" to="*" type="glob"/>
</syspropertyset>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
</junit>
</target>
<!--
end of pre NB72 profiling section
-->
<target if="netbeans.home" name="-profile-check">
<condition property="profiler.configured">
<or>
<contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
<contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
</or>
</condition>
</target>
<target depends="-profile-check,-profile-pre72" description="Profile a project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent">
<startprofiler/>
<antcall target="run"/>
</target>
<target depends="-profile-check,-profile-single-pre72" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-single" unless="profiler.info.jvmargs.agent">
<fail unless="run.class">Must select one file in the IDE or set run.class</fail>
<startprofiler/>
<antcall target="run-single"/>
</target>
<target depends="-profile-test-single-pre72" description="Profile a selected test in the IDE." name="profile-test-single"/>
<target depends="-profile-check" description="Profile a selected test in the IDE." if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs">
<fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
<startprofiler/>
<antcall target="test-single"/>
</target>
<target depends="-profile-check" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-test-with-main">
<fail unless="run.class">Must select one file in the IDE or set run.class</fail>
<startprofiler/>
<antcal target="run-test-with-main"/>
</target>
<target depends="-profile-check,-profile-applet-pre72" if="profiler.configured" name="profile-applet" unless="profiler.info.jvmargs.agent">
<fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
<startprofiler/>
<antcall target="run-applet"/>
</target>
<!--
===============
JAVADOC SECTION
===============
-->
<target depends="init" if="have.sources" name="-javadoc-build">
<mkdir dir="${dist.javadoc.dir}"/>
<condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
<and>
<isset property="endorsed.classpath.cmd.line.arg"/>
<not>
<equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
</not>
</and>
</condition>
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" executable="${platform.javadoc}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
<classpath>
<path path="${javac.classpath}"/>
</classpath>
<fileset dir="${src.dir}" excludes="*.java,${excludes}" includes="${includes}">
<filename name="**/*.java"/>
</fileset>
<fileset dir="${src.reports.dir}" excludes="*.java,${excludes}" includes="${includes}">
<filename name="**/*.java"/>
</fileset>
<fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
<include name="**/*.java"/>
<exclude name="*.java"/>
</fileset>
<arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
</javadoc>
<copy todir="${dist.javadoc.dir}">
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
<filename name="**/doc-files/**"/>
</fileset>
<fileset dir="${src.reports.dir}" excludes="${excludes}" includes="${includes}">
<filename name="**/doc-files/**"/>
</fileset>
<fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
<include name="**/doc-files/**"/>
</fileset>
</copy>
</target>
<target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
<nbbrowse file="${dist.javadoc.dir}/index.html"/>
</target>
<target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
<!--
=========================
TEST COMPILATION SECTION
=========================
-->
<target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
<mkdir dir="${build.test.classes.dir}"/>
</target>
<target name="-pre-compile-test">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target if="do.depend.true" name="-compile-test-depend">
<j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
</target>
<target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
<j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.src.dir}"/>
<copy todir="${build.test.classes.dir}">
<fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
</copy>
</target>
<target name="-post-compile-test">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
<target name="-pre-compile-test-single">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
<fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
<j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
<j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
<copy todir="${build.test.classes.dir}">
<fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
</copy>
</target>
<target name="-post-compile-test-single">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
<!--
=======================
TEST EXECUTION SECTION
=======================
-->
<target depends="init" if="have.tests" name="-pre-test-run">
<mkdir dir="${build.test.results.dir}"/>
</target>
<target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
<j2seproject3:test testincludes="**/*Test.java"/>
</target>
<target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
<fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
</target>
<target depends="init" if="have.tests" name="test-report"/>
<target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
<target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
<target depends="init" if="have.tests" name="-pre-test-run-single">
<mkdir dir="${build.test.results.dir}"/>
</target>
<target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
<fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
<j2seproject3:test excludes="" includes="${test.includes}" testincludes="${test.includes}"/>
</target>
<target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
<fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
</target>
<target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
<target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method">
<fail unless="test.class">Must select some files in the IDE or set test.class</fail>
<fail unless="test.method">Must select some method in the IDE or set test.method</fail>
<j2seproject3:test excludes="" includes="${javac.includes}" testincludes="${test.class}" testmethods="${test.method}"/>
</target>
<target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method" if="have.tests" name="-post-test-run-single-method">
<fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
</target>
<target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/>
<!--
=======================
TEST DEBUGGING SECTION
=======================
-->
<target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test">
<fail unless="test.class">Must select one file in the IDE or set test.class</fail>
<j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/>
</target>
<target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test-method">
<fail unless="test.class">Must select one file in the IDE or set test.class</fail>
<fail unless="test.method">Must select some method in the IDE or set test.method</fail>
<j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testMethod="${test.method}" testincludes="${test.class}" testmethods="${test.method}"/>
</target>
<target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
<j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
</target>
<target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
<target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/>
<target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
<j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
</target>
<target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
<!--
=========================
APPLET EXECUTION SECTION
=========================
-->
<target depends="init,compile-single" name="run-applet">
<fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
<j2seproject1:java classname="sun.applet.AppletViewer">
<customize>
<arg value="${applet.url}"/>
</customize>
</j2seproject1:java>
</target>
<!--
=========================
APPLET DEBUGGING SECTION
=========================
-->
<target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
<fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
<j2seproject3:debug classname="sun.applet.AppletViewer">
<customize>
<arg value="${applet.url}"/>
</customize>
</j2seproject3:debug>
</target>
<target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
<!--
===============
CLEANUP SECTION
===============
-->
<target name="-deps-clean-init" unless="built-clean.properties">
<property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
<delete file="${built-clean.properties}" quiet="true"/>
</target>
<target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
<echo level="warn" message="Cycle detected: Decomisims was already built"/>
</target>
<target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
<mkdir dir="${build.dir}"/>
<touch file="${built-clean.properties}" verbose="false"/>
<property file="${built-clean.properties}" prefix="already.built.clean."/>
<antcall target="-warn-already-built-clean"/>
<propertyfile file="${built-clean.properties}">
<entry key="${basedir}" value=""/>
</propertyfile>
</target>
<target depends="init" name="-do-clean">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
</target>
<target name="-post-clean">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
<target name="-check-call-dep">
<property file="${call.built.properties}" prefix="already.built."/>
<condition property="should.call.dep">
<and>
<not>
<isset property="already.built.${call.subproject}"/>
</not>
<available file="${call.script}"/>
</and>
</condition>
</target>
<target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
<ant antfile="${call.script}" inheritall="false" target="${call.target}">
<propertyset>
<propertyref prefix="transfer."/>
<mapper from="transfer.*" to="*" type="glob"/>
</propertyset>
</ant>
</target>
</project>
| {
"content_hash": "fc75fd07e59f78331b5e094a414a07bb",
"timestamp": "",
"source": "github",
"line_count": 1473,
"max_line_length": 529,
"avg_line_length": 55.93618465716225,
"alnum_prop": 0.5730999830084715,
"repo_name": "jimmyberny/decomisims-dev",
"id": "ea042aa35039c5899249ecdac6ab325a5efb4fb7",
"size": "82394",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "nbproject/build-impl.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "9073"
},
{
"name": "Java",
"bytes": "160217"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.googlecode.playn</groupId>
<artifactId>playn-cute</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>playn-cute-android</artifactId>
<name>PlayN Cute Android</name>
<packaging>apk</packaging>
<dependencies>
<dependency>
<groupId>com.googlecode.playn</groupId>
<artifactId>playn-cute-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.googlecode.playn</groupId>
<artifactId>playn-android</artifactId>
<version>${playn.version}</version>
</dependency>
<dependency>
<groupId>com.googlecode.playn</groupId>
<artifactId>playn-android-nativelib</artifactId>
<version>1.0</version>
<scope>runtime</scope>
<type>so</type>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>${android.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.pyx4j</groupId>
<artifactId>maven-junction-plugin</artifactId>
<version>1.0.3</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>link</goal>
</goals>
</execution>
</executions>
<!-- generate a symlink to our assets directory in the proper location -->
<configuration>
<links>
<link>
<src>${basedir}/../assets/src/main/resources/assets</src>
<dst>${basedir}/assets</dst>
</link>
</links>
</configuration>
</plugin>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>${android.maven.version}</version>
<configuration>
<androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile>
<assetsDirectory>${project.basedir}/assets</assetsDirectory>
<resourceDirectory>${project.basedir}/res</resourceDirectory>
<sdk>
<platform>11</platform>
</sdk>
<deleteConflictingFiles>true</deleteConflictingFiles>
<undeployBeforeDeploy>true</undeployBeforeDeploy>
<jvmArguments>
<jvmArgument>-Xmx1024m</jvmArgument>
</jvmArguments>
<dex>
<jvmArguments>
<jvmArgument>-Xmx1024m</jvmArgument>
</jvmArguments>
</dex>
</configuration>
<extensions>true</extensions>
<executions>
<execution>
<id>deploy-on-install</id>
<phase>install</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
| {
"content_hash": "2adf9baaed11e8f958eba8c12a5db982",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 98,
"avg_line_length": 31.423076923076923,
"alnum_prop": 0.5914932680538556,
"repo_name": "fredsa/playn-samples",
"id": "81fc1f99e55fd8aa08d78b0d7cd90aee9bcb1bd8",
"size": "3268",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "cute/android/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "4918"
},
{
"name": "CSS",
"bytes": "3693"
},
{
"name": "Emacs Lisp",
"bytes": "105"
},
{
"name": "HTML",
"bytes": "1706004"
},
{
"name": "Java",
"bytes": "824385"
},
{
"name": "Scala",
"bytes": "784"
},
{
"name": "Shell",
"bytes": "3186"
}
],
"symlink_target": ""
} |
<?xml version="1.0" ?><!DOCTYPE TS><TS language="bg" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About ArtBoomerang</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+39"/>
<source><b>ArtBoomerang</b> version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+41"/>
<source>Copyright © 2009-2014 The Bitcoin developers
Copyright © 2011-2014 The PeerCoin developers
Copyright © 2012-2014 The NovaCoin developers
Copyright © 2014 The ArtBoomerang developers</source>
<translation>Copyright © 2009-2014 The Bitcoin developers
Copyright © 2011-2014 The PeerCoin developers
Copyright © 2012-2014 The NovaCoin developers
Copyright © 2014 The ArtBoomerang developers</translation>
</message>
<message>
<location line="+15"/>
<source>
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source>
<translation>
Това е експериментален софтуер.
Разпространява се под MIT/X11 софтуерен лиценз, виж COPYING или http://www.opensource.org/licenses/mit-license.php.
Използван е софтуер, разработен от OpenSSL Project за употреба в OpenSSL Toolkit (http://www.openssl.org/), криптографски софтуер разработен от Eric Young (eay@cryptsoft.com) и UPnP софтуер разработен от Thomas Bernard.</translation>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>Double-click to edit address or label</source>
<translation>Двоен клик за редакция на адрес или име</translation>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation>Създаване на нов адрес</translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Копирай избрания адрес</translation>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-46"/>
<source>These are your ArtBoomerang addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+60"/>
<source>&Copy Address</source>
<translation>&Копирай</translation>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a ArtBoomerang address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Delete the currently selected address from the list</source>
<translation>Изтрий избрания адрес от списъка</translation>
</message>
<message>
<location line="-14"/>
<source>Verify a message to ensure it was signed with a specified ArtBoomerang address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>&Delete</source>
<translation>&Изтрий</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+65"/>
<source>Copy &Label</source>
<translation>Копирай &име</translation>
</message>
<message>
<location line="+2"/>
<source>&Edit</source>
<translation>&Редактирай</translation>
</message>
<message>
<location line="+250"/>
<source>Export Address Book Data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>CSV файл (*.csv)</translation>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+144"/>
<source>Label</source>
<translation>Име</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Адрес</translation>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation>(без име)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="+26"/>
<source>Passphrase Dialog</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>Enter passphrase</source>
<translation>Въведи парола</translation>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation>Нова парола</translation>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation>Още веднъж</translation>
</message>
<message>
<location line="+33"/>
<source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>For staking only</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+35"/>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>
<translation>Въведете нова парола за портфейла.<br/>Моля използвайте <b>поне 10 случайни символа</b> или <b>8 или повече думи</b>.</translation>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation>Криптиране на портфейла</translation>
</message>
<message>
<location line="+7"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Тази операция изисква Вашата парола за отключване на портфейла.</translation>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation>Отключване на портфейла</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Тази операция изисква Вашата парола за декриптиране на портфейла.</translation>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation>Декриптиране на портфейла</translation>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation>Смяна на паролата</translation>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>Въведете текущата и новата парола за портфейла.</translation>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation>Потвърждаване на криптирането</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR COINS</b>!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+103"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-133"/>
<location line="+60"/>
<source>Wallet encrypted</source>
<translation>Портфейлът е криптиран</translation>
</message>
<message>
<location line="-58"/>
<source>ArtBoomerang will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+44"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation>Криптирането беше неуспешно</translation>
</message>
<message>
<location line="-56"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>Криптирането на портфейла беше неуспешно поради неизвестен проблем. Портфейлът не е криптиран.</translation>
</message>
<message>
<location line="+7"/>
<location line="+50"/>
<source>The supplied passphrases do not match.</source>
<translation>Паролите не съвпадат</translation>
</message>
<message>
<location line="-38"/>
<source>Wallet unlock failed</source>
<translation>Отключването беше неуспешно</translation>
</message>
<message>
<location line="+1"/>
<location line="+12"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>Паролата въведена за декриптиране на портфейла е грешна.</translation>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation>Декриптирането беше неуспешно</translation>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation>Паролата на портфейла беше променена успешно.</translation>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="+280"/>
<source>Sign &message...</source>
<translation>Подписване на &съобщение...</translation>
</message>
<message>
<location line="+242"/>
<source>Synchronizing with network...</source>
<translation>Синхронизиране с мрежата...</translation>
</message>
<message>
<location line="-308"/>
<source>&Overview</source>
<translation>&Баланс</translation>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation>Обобщена информация за портфейла</translation>
</message>
<message>
<location line="+17"/>
<source>&Transactions</source>
<translation>&Транзакции</translation>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation>История на транзакциите</translation>
</message>
<message>
<location line="+5"/>
<source>&Address Book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Edit the list of stored addresses and labels</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-13"/>
<source>&Receive coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show the list of addresses for receiving payments</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-7"/>
<source>&Send coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>E&xit</source>
<translation>Из&ход</translation>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation>Изход от приложението</translation>
</message>
<message>
<location line="+4"/>
<source>Show information about ArtBoomerang</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation>За &Qt</translation>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation>Покажи информация за Qt</translation>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation>&Опции...</translation>
</message>
<message>
<location line="+4"/>
<source>&Encrypt Wallet...</source>
<translation>&Криптиране на портфейла...</translation>
</message>
<message>
<location line="+3"/>
<source>&Backup Wallet...</source>
<translation>&Запазване на портфейла...</translation>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation>&Смяна на паролата...</translation>
</message>
<message numerus="yes">
<location line="+250"/>
<source>~%n block(s) remaining</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-247"/>
<source>&Export...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-62"/>
<source>Send coins to a ArtBoomerang address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+45"/>
<source>Modify configuration options for ArtBoomerang</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>Export the data in the current tab to a file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-14"/>
<source>Encrypt or decrypt wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Backup wallet to another location</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Change the passphrase used for wallet encryption</source>
<translation>Променя паролата за портфейла</translation>
</message>
<message>
<location line="+10"/>
<source>&Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>&Verify message...</source>
<translation>&Проверка на съобщение...</translation>
</message>
<message>
<location line="-200"/>
<source>ArtBoomerang</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Wallet</source>
<translation>Портфейл</translation>
</message>
<message>
<location line="+178"/>
<source>&About ArtBoomerang</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Unlock wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>&Lock Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Lock wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+34"/>
<source>&File</source>
<translation>&Файл</translation>
</message>
<message>
<location line="+8"/>
<source>&Settings</source>
<translation>&Настройки</translation>
</message>
<message>
<location line="+8"/>
<source>&Help</source>
<translation>&Помощ</translation>
</message>
<message>
<location line="+9"/>
<source>Tabs toolbar</source>
<translation>Раздели</translation>
</message>
<message>
<location line="+8"/>
<source>Actions toolbar</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+9"/>
<source>[testnet]</source>
<translation>[testnet]</translation>
</message>
<message>
<location line="+0"/>
<location line="+60"/>
<source>ArtBoomerang client</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+70"/>
<source>%n active connection(s) to ArtBoomerang network</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+40"/>
<source>Downloaded %1 blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+413"/>
<source>Staking.<br>Your weight is %1<br>Network weight is %2<br>Expected time to earn reward is %3</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Not staking because wallet is locked</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because wallet is offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because wallet is syncing</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because you don't have mature coins</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-403"/>
<source>%n second(s) ago</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="-284"/>
<source>&Unlock Wallet...</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+288"/>
<source>%n minute(s) ago</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n hour(s) ago</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s) ago</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Up to date</source>
<translation>Синхронизиран</translation>
</message>
<message>
<location line="+7"/>
<source>Catching up...</source>
<translation>Зарежда блокове...</translation>
</message>
<message>
<location line="+10"/>
<source>Last received block was generated %1.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Confirm transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Sent transaction</source>
<translation>Изходяща транзакция</translation>
</message>
<message>
<location line="+1"/>
<source>Incoming transaction</source>
<translation>Входяща транзакция</translation>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+100"/>
<location line="+15"/>
<source>URI handling</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-15"/>
<location line="+15"/>
<source>URI can not be parsed! This can be caused by an invalid ArtBoomerang address or malformed URI parameters.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>Портфейлът е <b>криптиран</b> и <b>отключен</b></translation>
</message>
<message>
<location line="+10"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>Портфейлът е <b>криптиран</b> и <b>заключен</b></translation>
</message>
<message>
<location line="+25"/>
<source>Backup Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Wallet Data (*.dat)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Backup Failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+76"/>
<source>%n second(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n minute(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n hour(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+18"/>
<source>Not staking</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoin.cpp" line="+109"/>
<source>A fatal error occurred. ArtBoomerang can no longer continue safely and will quit.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+90"/>
<source>Network Alert</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>CoinControlDialog</name>
<message>
<location filename="../forms/coincontroldialog.ui" line="+14"/>
<source>Coin Control</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Quantity:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>Bytes:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+48"/>
<source>Amount:</source>
<translation>Сума:</translation>
</message>
<message>
<location line="+32"/>
<source>Priority:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+48"/>
<source>Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Low Output:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="+551"/>
<source>no</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="+51"/>
<source>After Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Change:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+69"/>
<source>(un)select all</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Tree mode</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>List mode</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+45"/>
<source>Amount</source>
<translation>Сума</translation>
</message>
<message>
<location line="+5"/>
<source>Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Address</source>
<translation>Адрес</translation>
</message>
<message>
<location line="+5"/>
<source>Date</source>
<translation>Дата</translation>
</message>
<message>
<location line="+5"/>
<source>Confirmations</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Confirmed</source>
<translation>Потвърдени</translation>
</message>
<message>
<location line="+5"/>
<source>Priority</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="-515"/>
<source>Copy address</source>
<translation>Копирай адрес</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>Копирай име</translation>
</message>
<message>
<location line="+1"/>
<location line="+26"/>
<source>Copy amount</source>
<translation>Копирай сума</translation>
</message>
<message>
<location line="-25"/>
<source>Copy transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>Copy quantity</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Copy fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+317"/>
<source>highest</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>high</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>medium-high</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>medium</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>low-medium</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>low</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>lowest</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+155"/>
<source>DUST</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>yes</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>This label turns red, if the transaction size is bigger than 10000 bytes.
This means a fee of at least %1 per kb is required.
Can vary +/- 1 Byte per input.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Transactions with higher priority get more likely into a block.
This label turns red, if the priority is smaller than "medium".
This means a fee of at least %1 per kb is required.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This label turns red, if any recipient receives an amount smaller than %1.
This means a fee of at least %2 is required.
Amounts below 0.546 times the minimum relay fee are shown as DUST.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This label turns red, if the change is smaller than %1.
This means a fee of at least %2 is required.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<location line="+66"/>
<source>(no label)</source>
<translation>(без име)</translation>
</message>
<message>
<location line="-9"/>
<source>change from %1 (%2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>(change)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation>Редактиране на адрес</translation>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation>&Име</translation>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation>&Адрес</translation>
</message>
<message>
<location line="+10"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+20"/>
<source>New receiving address</source>
<translation>Нов адрес за получаване</translation>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation>Нов адрес за изпращане</translation>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation>Редактиране на входящ адрес</translation>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation>Редактиране на изходящ адрес</translation>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation>Вече има адрес "%1" в списъка с адреси.</translation>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid ArtBoomerang address.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation>Отключването на портфейла беше неуспешно.</translation>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation>Създаването на ключ беше неуспешно.</translation>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+420"/>
<location line="+12"/>
<source>ArtBoomerang-Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-12"/>
<source>version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../forms/optionsdialog.ui" line="+14"/>
<source>Options</source>
<translation>Опции</translation>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation>&Основни</translation>
</message>
<message>
<location line="+6"/>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation>&Такса за изходяща транзакция</translation>
</message>
<message>
<location line="+31"/>
<source>Reserved amount does not participate in staking and is therefore spendable at any time.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Reserve</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Automatically start ArtBoomerang after logging in to the system.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Start ArtBoomerang on system login</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Detach databases at shutdown</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>&Network</source>
<translation>&Мрежа</translation>
</message>
<message>
<location line="+6"/>
<source>Automatically open the ArtBoomerang client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation>Отваряне на входящия порт чрез &UPnP</translation>
</message>
<message>
<location line="+7"/>
<source>Connect to the ArtBoomerang network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation>&Прозорец</translation>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation>След минимизиране ще е видима само иконата в системния трей.</translation>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation>&Минимизиране в системния трей</translation>
</message>
<message>
<location line="+7"/>
<source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>
<translation>При затваряне на прозореца приложението остава минимизирано. Ако изберете тази опция, приложението може да се затвори само чрез Изход в менюто.</translation>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation>М&инимизиране при затваряне</translation>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation>&Интерфейс</translation>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation>Език:</translation>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting ArtBoomerang.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation>Мерни единици:</translation>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation>Изберете единиците, показвани по подразбиране в интерфейса.</translation>
</message>
<message>
<location line="+9"/>
<source>Whether to show ArtBoomerang addresses in the transaction list or not.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation>Показвай и адресите в списъка с транзакции</translation>
</message>
<message>
<location line="+7"/>
<source>Whether to show coin control features or not.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Display coin &control features (experts only!)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+55"/>
<source>default</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+149"/>
<location line="+9"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting ArtBoomerang.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation>Прокси адресът е невалиден.</translation>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation>Форма</translation>
</message>
<message>
<location line="+33"/>
<location line="+231"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the ArtBoomerang network after a connection is established, but this process has not completed yet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-160"/>
<source>Stake:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Unconfirmed:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-107"/>
<source>Wallet</source>
<translation>Портфейл</translation>
</message>
<message>
<location line="+49"/>
<source>Spendable:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Your current spendable balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>Immature:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>Total:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Your current total balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+46"/>
<source><b>Recent transactions</b></source>
<translation><b>Последни транзакции</b></translation>
</message>
<message>
<location line="-108"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-29"/>
<source>Total of coins that was staked, and do not yet count toward the current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../overviewpage.cpp" line="+113"/>
<location line="+1"/>
<source>out of sync</source>
<translation>несинхронизиран</translation>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="+14"/>
<source>QR Code Dialog</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>Request Payment</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+62"/>
<source>Error encoding URI into QR Code.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<location line="+23"/>
<location line="+26"/>
<location line="+23"/>
<location line="+23"/>
<location line="+36"/>
<location line="+53"/>
<location line="+23"/>
<location line="+23"/>
<location filename="../rpcconsole.cpp" line="+348"/>
<source>N/A</source>
<translation>N/A</translation>
</message>
<message>
<location line="-217"/>
<source>Client version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Network</source>
<translation>Мрежа</translation>
</message>
<message>
<location line="+7"/>
<source>Number of connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>On testnet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Block chain</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Current number of blocks</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Estimated total blocks</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Last block time</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Show the ArtBoomerang-Qt help message to get a list with possible ArtBoomerang command-line options.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Show</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>&Console</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-104"/>
<source>ArtBoomerang - Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>ArtBoomerang Core</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+279"/>
<source>Debug log file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Open the ArtBoomerang debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+102"/>
<source>Clear console</source>
<translation>Изчисти конзолата</translation>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-33"/>
<source>Welcome to the ArtBoomerang RPC console.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation>Използвайте стрелки надолу и нагореза разглеждане на историятаот команди и <b>Ctrl-L</b> за изчистване на конзолата.</translation>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="+14"/>
<location filename="../sendcoinsdialog.cpp" line="+182"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation>Изпращане</translation>
</message>
<message>
<location line="+76"/>
<source>Coin Control Features</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>Inputs...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>automatically selected</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Insufficient funds!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+77"/>
<source>Quantity:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<location line="+35"/>
<source>0</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-19"/>
<source>Bytes:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+51"/>
<source>Amount:</source>
<translation>Сума:</translation>
</message>
<message>
<location line="+22"/>
<location line="+86"/>
<location line="+86"/>
<location line="+32"/>
<source>0.00 ABM</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-191"/>
<source>Priority:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>medium</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Low Output:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>no</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>After Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Change</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+50"/>
<source>custom change address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+106"/>
<source>Send to multiple recipients at once</source>
<translation>Изпращане към повече от един получател</translation>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation>Добави &получател</translation>
</message>
<message>
<location line="+20"/>
<source>Remove all transaction fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation>&Изчисти</translation>
</message>
<message>
<location line="+28"/>
<source>Balance:</source>
<translation>Баланс:</translation>
</message>
<message>
<location line="+16"/>
<source>123.456 ABM</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Confirm the send action</source>
<translation>Потвърдете изпращането</translation>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation>И&зпрати</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-173"/>
<source>Enter a ArtBoomerang address (e.g. FfCDhekqN2ngKCfKLyxQodtAUfCQVPqFFt)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Copy quantity</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>Копирай сума</translation>
</message>
<message>
<location line="+1"/>
<source>Copy fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+86"/>
<source><b>%1</b> to %2 (%3)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Confirm send coins</source>
<translation>Потвърждаване</translation>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>The recipient address is not valid, please recheck.</source>
<translation>Невалиден адрес на получателя.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation>Сумата трябва да е по-голяма от 0.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+251"/>
<source>WARNING: Invalid ArtBoomerang address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>(no label)</source>
<translation>(без име)</translation>
</message>
<message>
<location line="+4"/>
<source>WARNING: unknown change address</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation>С&ума:</translation>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation>Плати &На:</translation>
</message>
<message>
<location line="+24"/>
<location filename="../sendcoinsentry.cpp" line="+25"/>
<source>Enter a label for this address to add it to your address book</source>
<translation>Въведете име за този адрес, за да го добавите в списъка с адреси</translation>
</message>
<message>
<location line="+9"/>
<source>&Label:</source>
<translation>&Име:</translation>
</message>
<message>
<location line="+18"/>
<source>The address to send the payment to (e.g. FfCDhekqN2ngKCfKLyxQodtAUfCQVPqFFt)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Choose address from address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="+7"/>
<source>Paste address from clipboard</source>
<translation>Вмъкни от клипборда</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+7"/>
<source>Remove this recipient</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a ArtBoomerang address (e.g. FfCDhekqN2ngKCfKLyxQodtAUfCQVPqFFt)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="+14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation>Подпиши / Провери съобщение</translation>
</message>
<message>
<location line="+13"/>
<location line="+124"/>
<source>&Sign Message</source>
<translation>&Подпиши</translation>
</message>
<message>
<location line="-118"/>
<source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>
<translation>Можете да подпишете съобщение като доказателство, че притежавате определен адрес. Бъдете внимателни и не подписвайте съобщения, които биха разкрили лична информация без вашето съгласие.</translation>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. FfCDhekqN2ngKCfKLyxQodtAUfCQVPqFFt)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<location line="+203"/>
<source>Choose an address from the address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-193"/>
<location line="+203"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="-193"/>
<source>Paste address from clipboard</source>
<translation>Вмъкни от клипборда</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+12"/>
<source>Enter the message you want to sign here</source>
<translation>Въведете съобщението тук</translation>
</message>
<message>
<location line="+24"/>
<source>Copy the current signature to the system clipboard</source>
<translation>Копиране на текущия подпис</translation>
</message>
<message>
<location line="+21"/>
<source>Sign the message to prove you own this ArtBoomerang address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Reset all sign message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation>&Изчисти</translation>
</message>
<message>
<location line="-87"/>
<location line="+70"/>
<source>&Verify Message</source>
<translation>&Провери</translation>
</message>
<message>
<location line="-64"/>
<source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>The address the message was signed with (e.g. FfCDhekqN2ngKCfKLyxQodtAUfCQVPqFFt)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified ArtBoomerang address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Reset all verify message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+27"/>
<location line="+3"/>
<source>Enter a ArtBoomerang address (e.g. FfCDhekqN2ngKCfKLyxQodtAUfCQVPqFFt)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation>Натиснете "Подписване на съобщение" за да създадете подпис</translation>
</message>
<message>
<location line="+3"/>
<source>Enter ArtBoomerang signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+82"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation>Въведеният адрес е невалиден.</translation>
</message>
<message>
<location line="-81"/>
<location line="+8"/>
<location line="+73"/>
<location line="+8"/>
<source>Please check the address and try again.</source>
<translation>Моля проверете адреса и опитайте отново.</translation>
</message>
<message>
<location line="-81"/>
<location line="+81"/>
<source>The entered address does not refer to a key.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-73"/>
<source>Wallet unlock was cancelled.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Private key for the entered address is not available.</source>
<translation>Не е наличен частният ключ за въведеният адрес.</translation>
</message>
<message>
<location line="+12"/>
<source>Message signing failed.</source>
<translation>Подписването на съобщение бе неуспешно.</translation>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation>Съобщението е подписано.</translation>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation>Подписът не може да бъде декодиран.</translation>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation>Проверете подписа и опитайте отново.</translation>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation>Подписът не отговаря на комбинацията от съобщение и адрес.</translation>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation>Проверката на съобщението беше неуспешна.</translation>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation>Съобщението е потвърдено.</translation>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+19"/>
<source>Open until %1</source>
<translation>Подлежи на промяна до %1</translation>
</message>
<message numerus="yes">
<location line="-2"/>
<source>Open for %n block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+8"/>
<source>conflicted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>%1/offline</source>
<translation>%1/офлайн</translation>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation>%1/непотвърдени</translation>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation>включена в %1 блока</translation>
</message>
<message>
<location line="+18"/>
<source>Status</source>
<translation>Статус</translation>
</message>
<message numerus="yes">
<location line="+7"/>
<source>, broadcast through %n node(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation>Дата</translation>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation>Източник</translation>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation>Издадени</translation>
</message>
<message>
<location line="+5"/>
<location line="+17"/>
<source>From</source>
<translation>От</translation>
</message>
<message>
<location line="+1"/>
<location line="+22"/>
<location line="+58"/>
<source>To</source>
<translation>За</translation>
</message>
<message>
<location line="-77"/>
<location line="+2"/>
<source>own address</source>
<translation>собствен адрес</translation>
</message>
<message>
<location line="-2"/>
<source>label</source>
<translation>име</translation>
</message>
<message>
<location line="+37"/>
<location line="+12"/>
<location line="+45"/>
<location line="+17"/>
<location line="+30"/>
<source>Credit</source>
<translation>Кредит</translation>
</message>
<message numerus="yes">
<location line="-102"/>
<source>matures in %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+2"/>
<source>not accepted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
<location line="+30"/>
<source>Debit</source>
<translation>Дебит</translation>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation>Такса</translation>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation>Сума нето</translation>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation>Съобщение</translation>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation>Коментар</translation>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation>ID</translation>
</message>
<message>
<location line="+3"/>
<source>Generated coins must mature 100 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Debug information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation>Транзакция</translation>
</message>
<message>
<location line="+5"/>
<source>Inputs</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Amount</source>
<translation>Сума</translation>
</message>
<message>
<location line="+1"/>
<source>true</source>
<translation>true</translation>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation>false</translation>
</message>
<message>
<location line="-211"/>
<source>, has not been successfully broadcast yet</source>
<translation>, все още не е изпратено</translation>
</message>
<message>
<location line="+35"/>
<source>unknown</source>
<translation>неизвестен</translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="+14"/>
<source>Transaction details</source>
<translation>Транзакция</translation>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation>Описание на транзакцията</translation>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="+226"/>
<source>Date</source>
<translation>Дата</translation>
</message>
<message>
<location line="+0"/>
<source>Type</source>
<translation>Тип</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Адрес</translation>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation>Сума</translation>
</message>
<message>
<location line="+60"/>
<source>Open until %1</source>
<translation>Подлежи на промяна до %1</translation>
</message>
<message>
<location line="+12"/>
<source>Confirmed (%1 confirmations)</source>
<translation>Потвърдени (%1 потвърждения)</translation>
</message>
<message numerus="yes">
<location line="-15"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Confirming (%1 of %2 recommended confirmations)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Conflicted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Immature (%1 confirmations, will be available after %2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation>Блокът не е получен от останалите участници и най-вероятно няма да бъде одобрен.</translation>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation>Генерирана, но отхвърлена от мрежата</translation>
</message>
<message>
<location line="+42"/>
<source>Received with</source>
<translation>Получени с</translation>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation>Получен от</translation>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation>Изпратени на</translation>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation>Емитирани</translation>
</message>
<message>
<location line="+38"/>
<source>(n/a)</source>
<translation>(n/a)</translation>
</message>
<message>
<location line="+190"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>Състояние на транзакцията. Задръжте върху това поле за брой потвърждения.</translation>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation>Дата и час на получаване.</translation>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation>Тип на транзакцията.</translation>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation>Получател на транзакцията.</translation>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation>Сума извадена или добавена към баланса.</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+55"/>
<location line="+16"/>
<source>All</source>
<translation>Всички</translation>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation>Днес</translation>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation>Тази седмица</translation>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation>Този месец</translation>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation>Предния месец</translation>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation>Тази година</translation>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation>От - до...</translation>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation>Получени</translation>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation>Изпратени на</translation>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation>Собствени</translation>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation>Емитирани</translation>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation>Други</translation>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation>Търсене по адрес или име</translation>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation>Минимална сума</translation>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation>Копирай адрес</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>Копирай име</translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>Копирай сума</translation>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation>Редактирай име</translation>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+144"/>
<source>Export Transaction Data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>CSV файл (*.csv)</translation>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation>Потвърдени</translation>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation>Дата</translation>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation>Тип</translation>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation>Име</translation>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation>Адрес</translation>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation>Сума</translation>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation>ИД</translation>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+100"/>
<source>Range:</source>
<translation>От:</translation>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation>до</translation>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+206"/>
<source>Sending...</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+33"/>
<source>ArtBoomerang version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Usage:</source>
<translation>Използване:</translation>
</message>
<message>
<location line="+1"/>
<source>Send command to -server or artboomerangd</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>List commands</source>
<translation>Вписване на команди</translation>
</message>
<message>
<location line="+1"/>
<source>Get help for a command</source>
<translation>Получете помощ за команда</translation>
</message>
<message>
<location line="+2"/>
<source>Options:</source>
<translation>Опции:</translation>
</message>
<message>
<location line="+2"/>
<source>Specify configuration file (default: artboomerang.conf)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Specify pid file (default: artboomerangd.pid)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Specify wallet file (within data directory)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation>Определете директория за данните</translation>
</message>
<message>
<location line="+2"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set database disk log size in megabytes (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Listen for connections on <port> (default: 28361 or testnet: 28363)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Specify your own public address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Bind to given address. Use [host]:port notation for IPv6</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Stake your coins to support network and gain reward (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation>Праг на прекъсване на връзката при непорядъчно държащи се пиъри (по подразбиране:100)</translation>
</message>
<message>
<location line="+1"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation>Брой секунди до възтановяване на връзката за зле държащите се пиъри (по подразбиране:86400)</translation>
</message>
<message>
<location line="-44"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+51"/>
<source>Detach block and address databases. Increases shutdown time (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+109"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds </source>
<translation type="unfinished"/>
</message>
<message>
<location line="-87"/>
<source>Listen for JSON-RPC connections on <port> (default: 28362 or testnet: 28364)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-11"/>
<source>Accept command line and JSON-RPC commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+101"/>
<source>Error: Transaction creation failed </source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>Error: Wallet locked, unable to create transaction </source>
<translation type="unfinished"/>
</message>
<message>
<location line="-8"/>
<source>Importing blockchain data file.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Importing bootstrap blockchain data file.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-88"/>
<source>Run in the background as a daemon and accept commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use the test network</source>
<translation>Използвайте тестовата мрежа</translation>
</message>
<message>
<location line="-24"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-38"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+117"/>
<source>Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-20"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+61"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong ArtBoomerang will not work properly.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-31"/>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-18"/>
<source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-30"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Block creation options:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-62"/>
<source>Connect only to the specified node(s)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+94"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-90"/>
<source>Find peers using DNS lookup (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Sync checkpoints policy (default: strict)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+83"/>
<source>Invalid -tor address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Invalid amount for -reservebalance=<amount></source>
<translation type="unfinished"/>
</message>
<message>
<location line="-82"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-16"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>Output extra debugging information. Implies all other -debug* options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Output extra network debugging information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Prepend debug output with timestamp</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-74"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+41"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation>Изпрати локализиращата или дебъг информацията към конзолата, вместо файлът debug.log</translation>
</message>
<message>
<location line="+1"/>
<source>Send trace/debug info to debugger</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>Set maximum block size in bytes (default: 250000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Set minimum block size in bytes (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-29"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-42"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+109"/>
<source>Unable to sign checkpoint, wrong checkpointkey?
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-80"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-25"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+42"/>
<source>Username for JSON-RPC connections</source>
<translation>Потребителско име за JSON-RPC връзките</translation>
</message>
<message>
<location line="+47"/>
<source>Verifying database integrity...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+57"/>
<source>WARNING: syncronized checkpoint violation detected, but skipped!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Warning: Disk space is low!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-48"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-54"/>
<source>Password for JSON-RPC connections</source>
<translation>Парола за JSON-RPC връзките</translation>
</message>
<message>
<location line="-84"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=artboomerangrpc
rpcpassword=%s
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %%s | mail -s "ArtBoomerang Alert" admin@foo.com
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+51"/>
<source>Find peers using internet relay chat (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation>Разреши JSON-RPC връзките от отучнен IP адрес</translation>
</message>
<message>
<location line="+1"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation>Изпрати команди до възел функциониращ на <ip> (По подразбиране: 127.0.0.1)</translation>
</message>
<message>
<location line="+1"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Require a confirmations for change (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Enforce transaction scripts to use canonical PUSH operators (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Upgrade wallet to latest format</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation>Повторно сканиране на блок-връзка за липсващи портефейлни транзакции</translation>
</message>
<message>
<location line="+2"/>
<source>How many blocks to check at startup (default: 2500, 0 = all)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-6, default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Imports blocks from external blk000?.dat file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>Използвайте OpenSSL (https) за JSON-RPC връзките</translation>
</message>
<message>
<location line="+1"/>
<source>Server certificate file (default: server.cert)</source>
<translation>Сертификатен файл на сървъра (По подразбиране:server.cert)</translation>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation>Поверителен ключ за сървъра (default: server.pem)</translation>
</message>
<message>
<location line="+1"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+53"/>
<source>Error: Wallet unlocked for staking only, unable to create transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-158"/>
<source>This help message</source>
<translation>Това помощно съобщение</translation>
</message>
<message>
<location line="+95"/>
<source>Wallet %s resides outside data directory %s.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot obtain a lock on data directory %s. ArtBoomerang is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-98"/>
<source>ArtBoomerang</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+140"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-130"/>
<source>Connect through socks proxy</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+122"/>
<source>Loading addresses...</source>
<translation>Зареждане на адресите...</translation>
</message>
<message>
<location line="-15"/>
<source>Error loading blkindex.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error loading wallet.dat: Wallet requires newer version of ArtBoomerang</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Wallet needed to be rewritten: restart ArtBoomerang to complete</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-16"/>
<source>Invalid -proxy address: '%s'</source>
<translation>Невалиден -proxy address: '%s'</translation>
</message>
<message>
<location line="-1"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-24"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+44"/>
<source>Error: could not start node</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Sending...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Invalid amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Insufficient funds</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-34"/>
<source>Loading block index...</source>
<translation>Зареждане на блок индекса...</translation>
</message>
<message>
<location line="-103"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+122"/>
<source>Unable to bind to %s on this computer. ArtBoomerang is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-97"/>
<source>Fee per KB to add to transactions you send</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+55"/>
<source>Invalid amount for -mininput=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Loading wallet...</source>
<translation>Зареждане на портфейла...</translation>
</message>
<message>
<location line="+8"/>
<source>Cannot downgrade wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot initialize keypool</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot write default address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Rescanning...</source>
<translation>Преразглеждане на последовтелността от блокове...</translation>
</message>
<message>
<location line="+5"/>
<source>Done loading</source>
<translation>Зареждането е завършено</translation>
</message>
<message>
<location line="-167"/>
<source>To use the %s option</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Error</source>
<translation>Грешка</translation>
</message>
<message>
<location line="+6"/>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation type="unfinished"/>
</message>
</context>
</TS>
| {
"content_hash": "bb54ba833badfe12da57d17cba5ca586",
"timestamp": "",
"source": "github",
"line_count": 3284,
"max_line_length": 395,
"avg_line_length": 34.28197320341047,
"alnum_prop": 0.5982306230125597,
"repo_name": "artboomerangwin/artboomerang",
"id": "7f6d18b8d6d9bf30bc5bb54ce9189a8b98aa6336",
"size": "117226",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/qt/locale/bitcoin_bg.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "51312"
},
{
"name": "C",
"bytes": "102751"
},
{
"name": "C++",
"bytes": "3161108"
},
{
"name": "CSS",
"bytes": "1127"
},
{
"name": "HTML",
"bytes": "50620"
},
{
"name": "Makefile",
"bytes": "40717"
},
{
"name": "NSIS",
"bytes": "6804"
},
{
"name": "Objective-C",
"bytes": "1052"
},
{
"name": "Objective-C++",
"bytes": "6310"
},
{
"name": "Prolog",
"bytes": "2146"
},
{
"name": "Python",
"bytes": "11646"
},
{
"name": "QMake",
"bytes": "24700"
},
{
"name": "Shell",
"bytes": "8525"
}
],
"symlink_target": ""
} |
package com.nhekfqn.seed.jerseyangular.protocol.login;
import com.nhekfqn.seed.jerseyangular.protocol.base.Request;
public class UsernameLoginRequest extends Request {
private String username;
private String password;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
| {
"content_hash": "5f48df85419076c8872ac99e26245160",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 60,
"avg_line_length": 20.76923076923077,
"alnum_prop": 0.6851851851851852,
"repo_name": "nhekfqn/jersey-guice-jetty-angular-seed",
"id": "5ec6194896e6a58791f488a933fd68ed87c3e18d",
"size": "540",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/nhekfqn/seed/jerseyangular/protocol/login/UsernameLoginRequest.java",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "878"
},
{
"name": "HTML",
"bytes": "2872"
},
{
"name": "Java",
"bytes": "17983"
},
{
"name": "JavaScript",
"bytes": "7290"
}
],
"symlink_target": ""
} |
@interface DiscoveryManager() <DiscoveryProviderDelegate, ServiceConfigDelegate>
@end
@implementation DiscoveryManager
{
NSMutableDictionary *_allDevices;
NSMutableDictionary *_compatibleDevices;
NSArray *_discoveryProviders;
NSDictionary *_deviceClasses;
BOOL _shouldResumeSearch;
BOOL _searching;
DevicePicker *_currentPicker;
NSTimer *_ssidTimer;
NSString *_currentSSID;
}
@synthesize pairingLevel = _pairingLevel;
@synthesize useDeviceStore = _useDeviceStore;
+ (DiscoveryManager *) _sharedManager
{
static dispatch_once_t predicate = 0;
__strong static id _sharedManager = nil;
dispatch_once(&predicate, ^{
_sharedManager = [[self alloc] init];
});
return _sharedManager;
}
+ (DiscoveryManager *) sharedManager
{
DiscoveryManager *manager = [self _sharedManager];
if (!manager.deviceStore && manager.useDeviceStore)
[manager setDeviceStore:[DefaultConnectableDeviceStore new]];
return manager;
}
+ (DiscoveryManager *) sharedManagerWithDeviceStore:(id <ConnectableDeviceStore>)deviceStore
{
DiscoveryManager *manager = [self _sharedManager];
if (deviceStore == nil || manager.deviceStore != deviceStore)
[manager setDeviceStore:deviceStore];
return manager;
}
- (void) setDeviceStore:(id <ConnectableDeviceStore>)deviceStore
{
_deviceStore = deviceStore;
_useDeviceStore = (_deviceStore != nil);
}
- (instancetype) init
{
self = [super init];
if (self)
{
_shouldResumeSearch = NO;
_searching = NO;
_useDeviceStore = YES;
_discoveryProviders = [[NSMutableArray alloc] init];
_deviceClasses = [[NSMutableDictionary alloc] init];
_allDevices = [[NSMutableDictionary alloc] init];
_compatibleDevices = [[NSMutableDictionary alloc] init];
[self startSSIDTimer];
}
return self;
}
#pragma mark - Setup & Registration
- (void) registerDefaultServices
{
[self registerDeviceService:[AirPlayService class] withDiscovery:[ZeroConfDiscoveryProvider class]];
[self registerDeviceService:[CastService class] withDiscovery:[CastDiscoveryProvider class]];
[self registerDeviceService:[DIALService class] withDiscovery:[SSDPDiscoveryProvider class]];
[self registerDeviceService:[RokuService class] withDiscovery:[SSDPDiscoveryProvider class]];
[self registerDeviceService:[DLNAService class] withDiscovery:[SSDPDiscoveryProvider class]]; // includes Netcast
[self registerDeviceService:[WebOSTVService class] withDiscovery:[SSDPDiscoveryProvider class]];
}
- (void) registerDeviceService:(Class)deviceClass withDiscovery:(Class)discoveryClass
{
if (![discoveryClass isSubclassOfClass:[DiscoveryProvider class]])
return;
if (![deviceClass isSubclassOfClass:[DeviceService class]])
return;
__block DiscoveryProvider *discoveryProvider;
[_discoveryProviders enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
if ([[obj class] isSubclassOfClass:discoveryClass])
{
discoveryProvider = obj;
*stop = YES;
}
}];
if (discoveryProvider == nil)
{
discoveryProvider = [[discoveryClass alloc] init];
discoveryProvider.delegate = self;
_discoveryProviders = [_discoveryProviders arrayByAddingObject:discoveryProvider];
}
NSDictionary *discoveryParameters = [deviceClass discoveryParameters];
NSString *serviceId = [discoveryParameters objectForKey:@"serviceId"];
NSMutableDictionary *mutableClasses = [NSMutableDictionary dictionaryWithDictionary:_deviceClasses];
[mutableClasses setObject:deviceClass forKey:serviceId];
_deviceClasses = [NSDictionary dictionaryWithDictionary:mutableClasses];
[discoveryProvider addDeviceFilter:discoveryParameters];
}
- (void) unregisterDeviceService:(Class)deviceClass withDiscovery:(Class)discoveryClass
{
if (![discoveryClass isSubclassOfClass:[DiscoveryProvider class]])
return;
if (![deviceClass isSubclassOfClass:[DeviceService class]])
return;
__block DiscoveryProvider *discoveryProvider;
[_discoveryProviders enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
if ([[obj class] isSubclassOfClass:discoveryClass])
{
discoveryProvider = obj;
*stop = YES;
}
}];
if (discoveryProvider == nil)
return;
NSDictionary *discoveryParameters = [discoveryClass discoveryParameters];
NSString *serviceId = [discoveryParameters objectForKey:@"serviceId"];
NSMutableDictionary *mutableClasses = [NSMutableDictionary dictionaryWithDictionary:_deviceClasses];
[mutableClasses removeObjectForKey:serviceId];
_deviceClasses = [NSDictionary dictionaryWithDictionary:mutableClasses];
[discoveryProvider removeDeviceFilter:discoveryParameters];
if ([discoveryProvider isEmpty])
{
[discoveryProvider stopDiscovery];
discoveryProvider.delegate = nil;
NSMutableArray *mutableProviders = [NSMutableArray arrayWithArray:_discoveryProviders];
[mutableProviders removeObject:discoveryProvider];
_discoveryProviders = [NSArray arrayWithArray:mutableProviders];
}
}
#pragma mark - Wireless SSID Change Detection
- (void) startSSIDTimer
{
_ssidTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(detectSSIDChange) userInfo:nil repeats:YES];
[_ssidTimer fire];
}
- (void) stopSSIDTimer
{
[_ssidTimer invalidate];
_ssidTimer = nil;
}
- (void) detectSSIDChange
{
NSArray *interfaces = (__bridge_transfer id) CNCopySupportedInterfaces();
__block NSString *ssidName;
[interfaces enumerateObjectsUsingBlock:^(NSString *interface, NSUInteger idx, BOOL *stop)
{
if ([interface caseInsensitiveCompare:@"en0"] != NSOrderedSame)
return;
NSDictionary *info = (__bridge_transfer id) CNCopyCurrentNetworkInfo ((__bridge CFStringRef) interface);
if (info && [info objectForKey:@"SSID"])
{
ssidName = [info objectForKey:@"SSID"];
*stop = YES;
}
}];
if (ssidName == nil)
ssidName = @"";
if ([ssidName caseInsensitiveCompare:_currentSSID] != NSOrderedSame)
{
if (_currentSSID != nil)
{
[self purgeDeviceList];
[[NSNotificationCenter defaultCenter] postNotificationName:kConnectSDKWirelessSSIDChanged object:nil];
}
_currentSSID = ssidName;
}
}
- (void) purgeDeviceList
{
[self.compatibleDevices enumerateKeysAndObjectsUsingBlock:^(id key, ConnectableDevice *device, BOOL *stop)
{
[device disconnect];
if (self.delegate)
[self.delegate discoveryManager:self didLoseDevice:device];
if (self.devicePicker)
[self.devicePicker discoveryManager:self didLoseDevice:device];
}];
[_discoveryProviders enumerateObjectsUsingBlock:^(DiscoveryProvider *provider, NSUInteger idx, BOOL *stop) {
[provider stopDiscovery];
[provider startDiscovery];
}];
_allDevices = [NSMutableDictionary new];
_compatibleDevices = [NSMutableDictionary new];
}
#pragma mark - Capability Filtering
- (void)setCapabilityFilters:(NSArray *)capabilityFilters
{
_capabilityFilters = capabilityFilters;
@synchronized (_compatibleDevices)
{
[_compatibleDevices enumerateKeysAndObjectsUsingBlock:^(NSString *address, ConnectableDevice *device, BOOL *stop)
{
if (self.delegate)
[self.delegate discoveryManager:self didLoseDevice:device];
}];
}
_compatibleDevices = [[NSMutableDictionary alloc] init];
NSArray *allDevices;
@synchronized (_allDevices) { allDevices = [_allDevices allValues]; }
[allDevices enumerateObjectsUsingBlock:^(ConnectableDevice *device, NSUInteger idx, BOOL *stop)
{
if ([self deviceIsCompatible:device])
{
@synchronized (_compatibleDevices) { [_compatibleDevices setValue:device forKey:device.address]; }
if (self.delegate)
[self.delegate discoveryManager:self didFindDevice:device];
}
}];
}
- (BOOL) descriptionIsNetcastTV:(ServiceDescription *)description
{
BOOL isNetcast = NO;
if ([description.modelName.uppercaseString isEqualToString:@"LG TV"])
{
if ([description.modelDescription.uppercaseString rangeOfString:@"WEBOS"].location == NSNotFound)
{
isNetcast = YES;
}
}
return isNetcast;
}
#pragma mark - Device lists
- (NSDictionary *) allDevices
{
return [NSDictionary dictionaryWithDictionary:_allDevices];
}
- (NSDictionary *)compatibleDevices
{
return [NSDictionary dictionaryWithDictionary:_compatibleDevices];
}
- (BOOL) deviceIsCompatible:(ConnectableDevice *)device
{
if (!_capabilityFilters || _capabilityFilters.count == 0)
return YES;
__block BOOL isCompatible = NO;
[self.capabilityFilters enumerateObjectsUsingBlock:^(CapabilityFilter *filter, NSUInteger idx, BOOL *stop)
{
if ([device hasCapabilities:filter.capabilities])
{
isCompatible = YES;
*stop = YES;
}
}];
return isCompatible;
}
- (void) handleDeviceAdd:(ConnectableDevice *)device
{
if (![self deviceIsCompatible:device])
return;
@synchronized (_compatibleDevices) { [_compatibleDevices setValue:device forKey:device.address]; }
if (self.delegate)
[self.delegate discoveryManager:self didFindDevice:device];
if (_currentPicker)
[_currentPicker discoveryManager:self didFindDevice:device];
}
- (void) handleDeviceUpdate:(ConnectableDevice *)device
{
[self.deviceStore updateDevice:device];
if ([self deviceIsCompatible:device])
{
@synchronized (_compatibleDevices) {
if ([_compatibleDevices objectForKey:device.address])
{
if (self.delegate)
[self.delegate discoveryManager:self didUpdateDevice:device];
if (_currentPicker)
[_currentPicker discoveryManager:self didUpdateDevice:device];
} else
{
[self handleDeviceAdd:device];
}
}
} else
{
@synchronized (_compatibleDevices) { [_compatibleDevices removeObjectForKey:device.address]; }
[self handleDeviceLoss:device];
}
}
- (void) handleDeviceLoss:(ConnectableDevice *)device
{
if (self.delegate)
[self.delegate discoveryManager:self didLoseDevice:device];
if (_currentPicker)
[_currentPicker discoveryManager:self didLoseDevice:device];
}
- (void)setPairingLevel:(ConnectableDevicePairingLevel)pairingLevel
{
NSAssert(!_searching, @"Cannot change pairing level while DiscoveryManager is running.");
_pairingLevel = pairingLevel;
}
#pragma mark - Control
- (void) startDiscovery
{
if (_searching)
return;
if (_deviceClasses.count == 0)
[self registerDefaultServices];
_searching = YES;
[_discoveryProviders enumerateObjectsUsingBlock:^(DiscoveryProvider *service, NSUInteger idx, BOOL *stop) {
[service startDiscovery];
}];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(hAppDidEnterBackground:) name:UIApplicationDidEnterBackgroundNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(hAppDidBecomeActive:) name:UIApplicationDidBecomeActiveNotification object:nil];
}
- (void) stopDiscovery
{
if (!_searching)
return;
_searching = NO;
[_discoveryProviders enumerateObjectsUsingBlock:^(DiscoveryProvider *service, NSUInteger idx, BOOL *stop) {
[service stopDiscovery];
}];
if (!_shouldResumeSearch)
{
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidEnterBackgroundNotification object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidBecomeActiveNotification object:nil];
}
}
#pragma mark - DiscoveryProviderDelegate methods
- (void)discoveryProvider:(DiscoveryProvider *)provider didFindService:(ServiceDescription *)description
{
DLog(@"%@ (%@)", description.friendlyName, description.serviceId);
if ([description.friendlyName isEqualToString:@"A SDK webOS TV"] && [description.serviceId isEqualToString:@"DLNA"])
NSLog(@"break");
BOOL deviceIsNew = [_allDevices objectForKey:description.address] == nil;
ConnectableDevice *device;
if (deviceIsNew)
{
if (self.useDeviceStore)
{
device = [self.deviceStore deviceForId:description.UUID];
if (device)
@synchronized (_allDevices) { [_allDevices setObject:device forKey:description.address]; }
}
} else
{
@synchronized (_allDevices) { device = [_allDevices objectForKey:description.address]; }
}
if (!device)
{
device = [ConnectableDevice connectableDeviceWithDescription:description];
@synchronized (_allDevices) { [_allDevices setObject:device forKey:description.address]; }
deviceIsNew = YES;
}
device.lastDetection = [[NSDate date] timeIntervalSince1970];
device.lastKnownIPAddress = description.address;
device.lastSeenOnWifi = _currentSSID;
[self addServiceDescription:description toDevice:device];
if (device.services.count == 0)
{
// we get here when a non-LG DLNA TV is found
[_allDevices removeObjectForKey:description.address];
device = nil;
return;
}
if (deviceIsNew)
[self handleDeviceAdd:device];
else
[self handleDeviceUpdate:device];
}
- (void)discoveryProvider:(DiscoveryProvider *)provider didLoseService:(ServiceDescription *)description
{
DLog(@"%@ (%@)", description.friendlyName, description.serviceId);
ConnectableDevice *device;
@synchronized (_allDevices) { device = [_allDevices objectForKey:description.address]; }
if (device)
{
[device removeServiceWithId:description.serviceId];
DLog(@"Removed service from device at address %@. Device has %d services left", description.address, device.services.count);
if (![device hasServices])
{
DLog(@"Device at address %@ has been orphaned (has no services)", description.address);
@synchronized (_allDevices) { [_allDevices removeObjectForKey:description.address]; }
@synchronized (_compatibleDevices) { [_compatibleDevices removeObjectForKey:description.address]; }
[self handleDeviceLoss:device];
} else
{
[self handleDeviceUpdate:device];
}
}
}
- (void)discoveryProvider:(DiscoveryProvider *)provider didFailWithError:(NSError *)error
{
DLog(@"%@", error.localizedDescription);
}
#pragma mark - Helper methods
- (void) addServiceDescription:(ServiceDescription *)description toDevice:(ConnectableDevice *)device
{
Class deviceServiceClass;
if ([self descriptionIsNetcastTV:description])
{
deviceServiceClass = [NetcastTVService class];
description.serviceId = [[NetcastTVService discoveryParameters] objectForKey:@"serviceId"];
} else
{
deviceServiceClass = [_deviceClasses objectForKey:description.serviceId];
}
// Prevent non-LG TV DLNA devices from being picked up
if (deviceServiceClass == [DLNAService class])
{
NSRange rangeOfNetcast = [description.locationXML.lowercaseString rangeOfString:@"netcast"];
NSRange rangeOfWebOS = [description.locationXML.lowercaseString rangeOfString:@"webos"];
if (rangeOfNetcast.location == NSNotFound && rangeOfWebOS.location == NSNotFound)
return;
}
ServiceConfig *serviceConfig;
if (self.useDeviceStore)
serviceConfig = [self.deviceStore serviceConfigForUUID:description.UUID];
if (!serviceConfig)
serviceConfig = [[ServiceConfig alloc] initWithServiceDescription:description];
serviceConfig.delegate = self;
__block BOOL deviceAlreadyHasServiceType = NO;
__block BOOL deviceAlreadyHasService = NO;
// A MOD
__block DeviceService *existingService;
[device.services enumerateObjectsUsingBlock:^(DeviceService *obj, NSUInteger idx, BOOL *stop) {
if ([obj.serviceDescription.serviceId isEqualToString:description.serviceId])
{
deviceAlreadyHasServiceType = YES;
// A MOD
existingService = obj;
if ([obj.serviceDescription.UUID isEqualToString:description.UUID])
deviceAlreadyHasService = YES;
*stop = YES;
}
}];
if (deviceAlreadyHasServiceType)
{
if (deviceAlreadyHasService)
{
device.serviceDescription = description;
DeviceService *alreadyAddedService = [device serviceWithName:description.serviceId];
if (alreadyAddedService)
alreadyAddedService.serviceDescription = description;
return;
}
// A_ MOD
if( [existingService.serviceDescription.manufacturer.lowercaseString containsString:@"screencloud"]){
return;
}
[device removeServiceWithId:description.serviceId];
}
// [device.services enumerateObjectsUsingBlock:^(DeviceService *obj, NSUInteger idx, BOOL *stop) {
// if ([obj.serviceDescription.serviceId isEqualToString:description.serviceId])
// {
// deviceAlreadyHasServiceType = YES;
// if ([obj.serviceDescription.UUID isEqualToString:description.UUID])
// deviceAlreadyHasService = YES;
// *stop = YES;
// }
// }];
// if (deviceAlreadyHasServiceType)
// {
// if (deviceAlreadyHasService)
// {
// device.serviceDescription = description;
// DeviceService *alreadyAddedService = [device serviceWithName:description.serviceId];
// if (alreadyAddedService)
// alreadyAddedService.serviceDescription = description;
// return;
// }
// [device removeServiceWithId:description.serviceId];
// }
DeviceService *deviceService = [DeviceService deviceServiceWithClass:deviceServiceClass serviceConfig:serviceConfig];
deviceService.serviceDescription = description;
[device addService:deviceService];
}
#pragma mark - ConnectableDeviceDelegate methods
- (void) connectableDevice:(ConnectableDevice *)device capabilitiesAdded:(NSArray *)added removed:(NSArray *)removed
{
[self handleDeviceUpdate:device];
}
- (void)connectableDeviceReady:(ConnectableDevice *)device { }
- (void)connectableDeviceDisconnected:(ConnectableDevice *)device withError:(NSError *)error { }
#pragma mark - Device Store
- (ConnectableDevice *) lookupMatchingDeviceForDeviceStore:(ServiceConfig *)serviceConfig
{
__block ConnectableDevice *foundDevice;
@synchronized (_allDevices) {
[_allDevices enumerateKeysAndObjectsUsingBlock:^(id key, ConnectableDevice *device, BOOL *deviceStop)
{
[device.services enumerateObjectsUsingBlock:^(DeviceService *service, NSUInteger serviceIdx, BOOL *serviceStop)
{
if ([service.serviceConfig.UUID isEqualToString:serviceConfig.UUID])
{
foundDevice = device;
*serviceStop = YES;
*deviceStop = YES;
}
}];
}];
}
return foundDevice;
}
#pragma mark - Handle background state
- (void) hAppDidEnterBackground:(NSNotification *)notification
{
[self stopSSIDTimer];
if (_searching)
{
_shouldResumeSearch = YES;
[self stopDiscovery];
}
}
- (void) hAppDidBecomeActive:(NSNotification *)notification
{
[self startSSIDTimer];
if (_shouldResumeSearch)
{
_shouldResumeSearch = NO;
[self startDiscovery];
}
}
- (void) dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidBecomeActiveNotification object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidEnterBackgroundNotification object:nil];
}
#pragma mark - Device Picker creation
- (DevicePicker *) devicePicker
{
if (_currentPicker == nil)
{
_currentPicker = [[DevicePicker alloc] init];
[self.compatibleDevices enumerateKeysAndObjectsUsingBlock:^(NSString *address, ConnectableDevice *device, BOOL *stop)
{
[_currentPicker discoveryManager:self didFindDevice:device];
}];
}
return _currentPicker;
}
#pragma mark - ServiceConfigDelegate
- (void)serviceConfigUpdate:(ServiceConfig *)serviceConfig
{
if (_useDeviceStore && self.deviceStore)
{
ConnectableDevice *device = [self lookupMatchingDeviceForDeviceStore:serviceConfig];
if (device)
[self.deviceStore updateDevice:device];
}
}
@end
| {
"content_hash": "5518449229efe9a87be54d4bc1aea662",
"timestamp": "",
"source": "github",
"line_count": 718,
"max_line_length": 164,
"avg_line_length": 29.823119777158773,
"alnum_prop": 0.6719749684770934,
"repo_name": "screencloud/Connect-SDK-iOS",
"id": "28ec476fe8ebca271e52f80b08ece0a0023ed4c6",
"size": "22735",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ConnectSDK/Discovery/DiscoveryManager.m",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "27210"
},
{
"name": "Objective-C",
"bytes": "1306589"
},
{
"name": "Ruby",
"bytes": "4059"
}
],
"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>GrPPI: grppi::thread_registry Class 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="projectlogo"><img alt="Logo" src="logo.svg"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">GrPPI
 <span id="projectnumber">0.3.1</span>
</div>
<div id="projectbrief">Generic and Reusable Parallel Pattern Interface</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="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</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="namespacegrppi.html">grppi</a></li><li class="navelem"><a class="el" href="classgrppi_1_1thread__registry.html">thread_registry</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="classgrppi_1_1thread__registry-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">grppi::thread_registry Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Thread index table to provide portable natural thread indices.
<a href="classgrppi_1_1thread__registry.html#details">More...</a></p>
<p><code>#include <<a class="el" href="parallel__execution__native_8h_source.html">parallel_execution_native.h</a>></code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a3a6b9476b404f594df2d540dd2fad4b2"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classgrppi_1_1thread__registry.html#a3a6b9476b404f594df2d540dd2fad4b2">thread_registry</a> () noexcept=default</td></tr>
<tr class="separator:a3a6b9476b404f594df2d540dd2fad4b2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3c61f318e381df30a3d1bcd5a5f83f69"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgrppi_1_1thread__registry.html#a3c61f318e381df30a3d1bcd5a5f83f69">register_thread</a> () noexcept</td></tr>
<tr class="memdesc:a3c61f318e381df30a3d1bcd5a5f83f69"><td class="mdescLeft"> </td><td class="mdescRight">Adds the current thread id in the registry. <a href="#a3c61f318e381df30a3d1bcd5a5f83f69">More...</a><br /></td></tr>
<tr class="separator:a3c61f318e381df30a3d1bcd5a5f83f69"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6998752c4b6f918c36e808a8a8d60112"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgrppi_1_1thread__registry.html#a6998752c4b6f918c36e808a8a8d60112">deregister_thread</a> () noexcept</td></tr>
<tr class="memdesc:a6998752c4b6f918c36e808a8a8d60112"><td class="mdescLeft"> </td><td class="mdescRight">Removes current thread id from the registry. <a href="#a6998752c4b6f918c36e808a8a8d60112">More...</a><br /></td></tr>
<tr class="separator:a6998752c4b6f918c36e808a8a8d60112"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4fe2639e9ddc939d6ecfa9d2db99dfee"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classgrppi_1_1thread__registry.html#a4fe2639e9ddc939d6ecfa9d2db99dfee">current_index</a> () const noexcept</td></tr>
<tr class="memdesc:a4fe2639e9ddc939d6ecfa9d2db99dfee"><td class="mdescLeft"> </td><td class="mdescRight">Integer index for current thread. <a href="#a4fe2639e9ddc939d6ecfa9d2db99dfee">More...</a><br /></td></tr>
<tr class="separator:a4fe2639e9ddc939d6ecfa9d2db99dfee"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Thread index table to provide portable natural thread indices. </p>
<p>A thread table provides a simple way to offer thread indices (starting from 0).</p>
<p>When a thread registers itself in the registry, its id is added to the vector of identifiers. When a thread deregisters itself from the registry its entry is modified to contain the empty thread id.</p>
<p>To get an integer index, users may call <code>current_index</code>, which provides the order number of the calling thread in the registry.</p>
<dl class="section note"><dt>Note</dt><dd>This class is thread safe by means of using a spin-lock. </dd></dl>
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a class="anchor" id="a3a6b9476b404f594df2d540dd2fad4b2"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">grppi::thread_registry::thread_registry </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">default</span><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a4fe2639e9ddc939d6ecfa9d2db99dfee"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">int grppi::thread_registry::current_index </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Integer index for current thread. </p>
<dl class="section return"><dt>Returns</dt><dd>Integer value with the registration order of current thread. </dd></dl>
<dl class="section pre"><dt>Precondition</dt><dd>Current thread is registered. </dd></dl>
</div>
</div>
<a class="anchor" id="a6998752c4b6f918c36e808a8a8d60112"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void grppi::thread_registry::deregister_thread </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Removes current thread id from the registry. </p>
</div>
</div>
<a class="anchor" id="a3c61f318e381df30a3d1bcd5a5f83f69"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void grppi::thread_registry::register_thread </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Adds the current thread id in the registry. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="parallel__execution__native_8h_source.html">parallel_execution_native.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": "be76c8dd729df528411daad1d0472915",
"timestamp": "",
"source": "github",
"line_count": 241,
"max_line_length": 297,
"avg_line_length": 46.531120331950206,
"alnum_prop": 0.6669341894060995,
"repo_name": "arcosuc3m/grppi",
"id": "4e9aec9bc547c73f9897f2771e2d0ad63e83c400",
"size": "11214",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/0.3.1/classgrppi_1_1thread__registry.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "1463"
},
{
"name": "C++",
"bytes": "474323"
},
{
"name": "CMake",
"bytes": "10167"
}
],
"symlink_target": ""
} |
#ifndef CPPDEVTK_QTSOLUTIONS_QTCOPYDIALOG_QTOVERWRITEDIALOG_H_INCLUDED_
#define CPPDEVTK_QTSOLUTIONS_QTCOPYDIALOG_QTOVERWRITEDIALOG_H_INCLUDED_
#include <cppdevtk/QtSolutions/QtCopyDialog/config.hpp>
#include "ui_qtoverwritedialog.h"
#include <QtCore/QtGlobal>
#include <QtCore/QString>
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
#include <QtWidgets/QDialog>
#else
#include <QtGui/QDialog>
#endif
namespace cppdevtk {
namespace qtsol {
class QtOverwriteDialog : public QDialog
{
Q_OBJECT
public:
QtOverwriteDialog(QWidget *parent = 0);
enum ResultButton {
Cancel,
Skip,
SkipAll,
Overwrite,
OverwriteAll
};
ResultButton execute(const QString &sourceFile, const QString &destinationFile);
private Q_SLOTS:
void cancel() { done(Cancel); }
void skip() { done(Skip); }
void skipAll() { done(SkipAll); }
void overwrite() { done(Overwrite); }
void overwriteAll() { done(OverwriteAll); }
private:
Ui::QtOverwriteDialog ui;
};
} // namespace qtsol
} // namespace cppdevtk
#endif // CPPDEVTK_QTSOLUTIONS_QTCOPYDIALOG_QTOVERWRITEDIALOG_H_INCLUDED_
| {
"content_hash": "5756bec9e60182a4c4306d530b44edb3",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 84,
"avg_line_length": 22.145454545454545,
"alnum_prop": 0.6584564860426929,
"repo_name": "CoSoSys/cppdevtk",
"id": "dd0dc6ec1f2a850d30ff3a45406d31080d3786ad",
"size": "3503",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/QtCopyDialog/qtoverwritedialog.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1117"
},
{
"name": "C",
"bytes": "52984"
},
{
"name": "C++",
"bytes": "3219284"
},
{
"name": "Makefile",
"bytes": "2522"
},
{
"name": "Objective-C++",
"bytes": "7574"
},
{
"name": "QMake",
"bytes": "304258"
},
{
"name": "Shell",
"bytes": "799"
}
],
"symlink_target": ""
} |
/**
* TODO: Add unicode support!
* TODO: Change char** to string*
*/
#include "TextObject.h"
#include <ncurses.h>
//#include <stdlib.h>
#include <iostream>
#include <string>
using std::cout;
using std::endl;
using std::string;
//using namespace std;
// Constructor.
TextObject::TextObject() {
alpha = ' ';
w = h = x = y = z = 0;
content = vector<string>();
frames = vector<string>();
frameRanges = vector< vector<int> >();
//animStack = vector< vector<int> >();
attrMask = A_NORMAL;
lastSavedFrame = 0;
defAnim = 0;
curAnim = 0;
maxLoop = 0;
curLoop = 0;
curFrame = 0;
}
// Destructor
TextObject::~TextObject() {
this->clear();
}
// Clear the object of non-alpha chars. Does NOT clear animations.
void TextObject::wipe() {
this->fill( this->w, this->h );
}
// Clears contents and resets width/height. Does NOT reset alpha character.
void TextObject::clear() {
this->content.clear();
this->frames.clear();
this->frameRanges.clear();
//this->animStack.clear();
this->w = 0;
this->h = 0;
}
// Returns object validity.
bool TextObject::isValid() {
return ( this->w != 0 ) && ( this->h != 0 ) && ( this->content.size() > 0 );
}
// Returns a printable string of the text object
string TextObject::toString() {
string str = "";
if( !this->isValid() ) {
return str;
}
for( int row = 0; row < this->h; row++ ) {
for( int col = 0; col < this->w; col++ )
str += this->content[row][col];
str += '\n';
}
return str;
}
// Fill using string.
bool TextObject::fill( string str ) {
int width = 0;
int height = 0;
// Empty strings are bad, mkay?
if( str.length() == 0 )
return false;
// Step 1: Find width and height
int curWidth = 0;
int curHeight = 1;
for( unsigned i = 0; i < str.length(); ++i ) {
char c = str.at( i );
if( c == '\n' ) {
if( curWidth > 0 )
curHeight++;
curWidth = 0;
} else {
curWidth++;
}
if( curWidth > width )
width = curWidth;
}
height = curHeight;
// Sanity check.
if( width < 1 || height < 1 )
return false;
// Step 2: Fill an empty TextObject
if( !this->fill( width, height ) )
return false;
// Step 3: Insert chars from str.
int row = 0, col = 0;
for( unsigned i = 0; i < str.length(); ++i ) {
char c = str.at( i );
if( c == '\n' ) {
row++;
col = 0;
continue;
}
this->content[row][col++] = str[i];
}
return true;
}
// Fill using character buffer.
bool TextObject::fill( char *str ) {
return this->fill( string( str ) );
}
// Fills with current alpha char.
bool TextObject::fill( int width, int height ) {
return this->fill( width, height, this->alpha );
}
// Fill a text object to the required dimensions with char c.
bool TextObject::fill( int width, int height, char c ) {
// Clear this object if it's different in dimensions.
if( this->w != width || this->h != height )
this->clear();
// Add new contents.
for( int row = 0; row < height; row++ ) {
this->content.push_back( string( width, c ) );
}
// Set width and height
this->w = width;
this->h = height;
return true;
}
// Overlay a TextObject on this one starting at the specified row/col offset.
bool TextObject::overlay( TextObject obj, int row, int col ) {
// No overlapping with, or on invalid text objects!
if( !this->isValid() || !obj.isValid() )
return false;
// Make sure it's even possible for an overlap to occur.
if( row >= this->h || -row >= obj.h || col >= this->w || -col >= obj.w )
return false;
// Perform the overlap!
int myRow, myCol, obRow, obCol;
// Don't start iterating on a negative row!
if( row < 0 )
myRow = 0;
else
myRow = row;
// Loop from row offset to my height
for( ; myRow < this->h; myRow++ ) {
// Apply offsets on obj for this row.
if( row < 0 )
obRow = -row + myRow;
else
obRow = myRow - row;
// Don't write more rows than there are in obj!
if( obRow >= obj.h )
break;
// Don't start iterating on a negative column!
if( col < 0 )
myCol = 0;
else
myCol = col;
// Loop from col offset to my width
for( ; myCol < this->w; myCol++ ) {
// Apply offsets on obj for this col.
if( col < 0 )
obCol = -col + myCol;
else
obCol = myCol - col;
// Don't write more cols per-row than there are in obj!
if( obCol >= obj.w )
continue;
// Only overlay non-alpha chars
if( obj.content[obRow][obCol] != obj.alpha )
this->content[myRow][myCol] = obj.content[obRow][obCol];
}
}
return true;
}
// Getters!
// Return char in specified row/column.
char TextObject::getCharAt( int row, int col ) {
if( row < 0 || row > this->h || col < 0 || col > this->w )
return '\0';
return this->content[row][col];
}
// Return the string representation of the specified row.
string TextObject::getRow( int row ) {
std::string str = "";
if( row < 0 || row > this->h )
return str;
for( int col = 0; col < this->w; col++ ) {
str += this->content[row][col];
}
return str;
}
// These should speak for themselves.
int TextObject::getX() {
return this->x;
}
int TextObject::getY() {
return this->y;
}
int TextObject::getZ() {
return this->z;
}
int TextObject::getW() {
return this->w;
}
int TextObject::getH() {
return this->h;
}
char TextObject::getAlpha() {
return this->alpha;
}
int TextObject::getAttrMask() {
return this->attrMask;
}
// Now for the setters!
void TextObject::setCharAt( int row, int col, char c ) {
if( row < 0 || row > this->h || col < 0 || col > this->w || c > 255 )
return;
this->content[row][col] = c;
}
void TextObject::setX( int x ) {
this->x = x;
}
void TextObject::setY( int y ) {
this->y = y;
}
void TextObject::setZ( int z ) {
this->z = z;
}
void TextObject::setAlpha( char alpha ) {
this->alpha = alpha;
}
void TextObject::setAttrMask( int mask ) {
this->attrMask = mask;
}
// Animation stuff
void TextObject::addFrame( string str ) {
frames.push_back( str );
}
void TextObject::saveAnim() {
vector<int> v = vector<int>();
v.push_back( this->lastSavedFrame );
this->lastSavedFrame = frames.size();
v.push_back( this->lastSavedFrame );
this->frameRanges.push_back( v );
}
void TextObject::setDefaultAnim( int anim ) {
if( anim < 0 || anim > (int)this->frameRanges.size() )
return;
this->defAnim = anim;
}
void TextObject::setAnim( int anim ) {
this->setAnim( anim, 0 );
}
int TextObject::getAnim() {
return this->curAnim;
}
void TextObject::setAnim( int anim, int loop ) {
if( anim < 0 || anim > (int)this->frameRanges.size() || loop < 0 )
return;
this->curLoop = 1;
this->maxLoop = loop;
this->curAnim = anim;
this->curFrame = 0;
}
void TextObject::nextFrame() {
// If we have reached the end of one animation cycle.
if( this->curFrame >= this->getFrameCount() ) {
this->curFrame = 0; // Set current frame to zero.
if( this->maxLoop > 0 ) {
// If the current loop count has exceeded the max loop count
if( this->curLoop >= this->maxLoop )
this->setAnim( this->defAnim );
this->curLoop++;
}
}
int frame = this->frameRanges[this->curAnim][0] + this->curFrame;
this->fill( this->frames[ frame ] );
this->curFrame++;
}
int TextObject::getFrame() {
return this->curFrame;
}
int TextObject::getFrameCount() {
return this->getFrameCount( this->curAnim );
}
int TextObject::getFrameCount( int anim ) {
if( anim > (int)this->frameRanges.size() )
return 0;
return this->frameRanges[anim][1] - this->frameRanges[anim][0];
}
/*
void TextObject::() {
}
void TextObject::() {
}
void TextObject::() {
}
*/
| {
"content_hash": "11f1c6276a8dcd5a39f422108a6a3324",
"timestamp": "",
"source": "github",
"line_count": 351,
"max_line_length": 78,
"avg_line_length": 22.14814814814815,
"alnum_prop": 0.5919732441471572,
"repo_name": "GeekWithALife/TextEngine",
"id": "8b7bfe1335d2fe04727f381fcb3ad8906b226082",
"size": "7774",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/TextObject.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "90348"
},
{
"name": "CMake",
"bytes": "5806"
},
{
"name": "GLSL",
"bytes": "311"
},
{
"name": "Shell",
"bytes": "968"
}
],
"symlink_target": ""
} |
import {
NullModel,
ControlBaseOptions,
DynamicFormControlComponentBase,
DynamicFormControlComponent,
} from '@angular-dynaform/core';
import { Component } from '@angular/core';
@Component({
selector: 'adf-material-button-component',
template: `
<div [formGroup]="model.ngGroup" [hidden]="model.hidden">
<button
mat-raised-button
[formControlName]="model.key"
[id]="model.id"
[ngClass]="model.css.control"
[type]="buttonType"
adfHTMLDomElement
ngDefaultControl
>
<span [ngClass]="model.css.control" [innerHTML]="model.local.label"></span>
</button>
</div>
`,
inputs: ['model'],
providers: [{ provide: DynamicFormControlComponentBase, useExisting: MaterialButtonComponent }],
})
export class MaterialButtonComponent extends DynamicFormControlComponent<NullModel> {
model!: NullModel;
options!: ControlBaseOptions;
ngAfterViewInit(): void {
super.ngAfterViewInit();
setTimeout(() => {
if (this.model.ngControl.disabled) {
this.model.ngControl.enable({ emitEvent: false });
this.model.ngControl.disable();
} else {
this.model.ngControl.disable({ emitEvent: false });
this.model.ngControl.enable();
}
});
}
}
| {
"content_hash": "32214a8f3339def36b3a6f988eb582ab",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 98,
"avg_line_length": 28.555555555555557,
"alnum_prop": 0.6505836575875487,
"repo_name": "gms1/angular-dynaform",
"id": "f3d6685ffa6be7a2ec210107650ab9a29159ba4c",
"size": "1387",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "projects/angular-dynaform/material/src/lib/components/material-button.component.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "4310"
},
{
"name": "HTML",
"bytes": "7100"
},
{
"name": "Makefile",
"bytes": "1905"
},
{
"name": "Shell",
"bytes": "4654"
},
{
"name": "TypeScript",
"bytes": "624163"
}
],
"symlink_target": ""
} |
from sklearn import datasets
from sklearn.feature_extraction.text import CountVectorizer
from sklearn import naive_bayes
from sklearn import metrics
from matplotlib import pyplot
from matplotlib import gridspec
import numpy
def load_stop_words(filename):
with open(filename, 'rt') as stopWordsFile:
stopWords = list()
for line in stopWordsFile:
word = line.strip()
stopWords.append(word)
return stopWords
if __name__ == '__main__':
trainData = datasets.load_files('./Problem1/train')
testData = datasets.load_files('./Problem1/test')
vectorizer = CountVectorizer(stop_words=load_stop_words('./Problem1/stopwords.txt'), analyzer='word', token_pattern=u'(?u)\\b\\w+\\b')
#vectorizer = CountVectorizer(analyzer='word', token_pattern=u'(?u)\\b\\w+\\b')
vectorizer.fit(trainData.data)
trainVector = vectorizer.transform(trainData.data)
trainLabel = trainData.target
testVector = vectorizer.transform(testData.data)
testLabel = testData.target
clf = naive_bayes.MultinomialNB()
clf.fit(trainVector,trainLabel)
coefrange = clf.feature_log_prob_ .shape[1]
sortedcoefids_pos = sorted(range(coefrange), key=lambda i: clf.feature_log_prob_[0][i])[-5:]
print('Top five most frequent words of neg (L=0) class:')
for id in sortedcoefids_pos:
print(vectorizer.get_feature_names()[id])
sortedcoefids_neg = sorted(range(coefrange), key=lambda i: clf.feature_log_prob_[1][i])[-5:]
print('Top five most frequent words of pos (L=0) class:')
for id in sortedcoefids_neg:
print(vectorizer.get_feature_names()[id])
pred = clf.predict(testVector)
print(metrics.confusion_matrix(testLabel,pred)) | {
"content_hash": "76f61e2772b065ae8ae77bebb847c9bf",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 138,
"avg_line_length": 34.62,
"alnum_prop": 0.6932409012131716,
"repo_name": "MengwenHe-CMU/17S_10701_MachineLearning",
"id": "88ea6ad20c8aeacd30d447d2f96c3820929bc169",
"size": "1731",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Homeworks/HW2/Python/hw2_A.py",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
<?php
include_once '../include/config.php';
function copy_photo($filename, $new_filename)
{
$s3 = new AmazonS3();
$response_photo = $s3->copy_object(
array(
'bucket' => 'divvycam',
'filename' => $filename . '.jpg'
),
array(
'bucket' => 'divvycam',
'filename' => $new_filename . '.jpg'
),
array(
'storage' => AmazonS3::STORAGE_REDUCED
)
);
$response_thumbnail = $s3->copy_object(
array(
'bucket' => 'divvycam',
'filename' => $filename . '-thumbnail.jpg'
),
array(
'bucket' => 'divvycam',
'filename' => $new_filename . '-thumbnail.jpg'
),
array(
'storage' => AmazonS3::STORAGE_REDUCED
)
);
if ($response_thumbnail->isOK() && $response_photo->isOK())
return true;
else
return false;
}
function grab_photo_info($photo_id)
{
$query = db_query('SELECT filename FROM photos WHERE id="%s"', $photo_id);
if (count($query) > 1 && count($query) < 1)
return false;
return $query[0]['filename'];
}
if (!isset($_POST['duid']) || !isset($_POST['bucket_id']) || !isset($_POST['photo_id']))
{
echo '{"status":"error", "error":"invalid_request"}';
die();
}
$filename = grab_photo_info($_POST['photo_id']);
if ($info == false)
{
echo '{"status":"error", "error":"no_such_photo"}';
die();
}
$new_filename = $_POST['bucket_id'] . "-" . md5($filename . time() . $_POST['duid']);
if (!copy_photo($filename, $new_filename))
{
echo '{"status":"error", "error":"could_not_copy"}';
die();
}
if (add_image_to_db($_POST['bucket_id'], $new_filename, $_POST['duid']))
{
echo '{"status":"success"}';
}
else
{
echo '{"status":"error", "error":"db_error"}';
}
?> | {
"content_hash": "7f53192cfd7eb77e5844853c1737ba37",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 88,
"avg_line_length": 20.074074074074073,
"alnum_prop": 0.5793357933579336,
"repo_name": "sjlu/divvycam",
"id": "35ae513fb5534e9d84315172acacde03aa742c2c",
"size": "1626",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "web/api/copy_photo.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Erlang",
"bytes": "406"
},
{
"name": "JavaScript",
"bytes": "134874"
},
{
"name": "PHP",
"bytes": "1299936"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.