text stringlengths 2 1.04M | meta dict |
|---|---|
using System;
// 8. Create a Windows Console application that demonstrates value types vs reference types
namespace Csharp_102908
{
class Csharp_102908
{
static void Main(string[] args)
{
Console.WriteLine("\n\n8. Value types vs reference types\n------------------------------------");
ValOrRef.CopyByType();
}
public class ValOrRef
{
public static void CopyByType()
{
Console.WriteLine("\nCOPY VALUE TYPE - copy creates new memory location");
int anInt = 4;
Console.WriteLine("anInt = " + anInt);
int anotherInt = anInt;
Console.WriteLine("anotherInt = " + anotherInt);
Console.WriteLine("> modify the copy, original does not change:");
anotherInt = anotherInt * 2;
Console.WriteLine("anotherInt = " + anotherInt);
Console.WriteLine("anInt = " + anInt);
Console.WriteLine("\nCOPY REFERENCE TYPE - copy creates pointer to original memory location");
int[] anArray = new int[1];
anArray[0] = 6;
Console.WriteLine("anArray[0] = " + anArray[0]);
int[] anotherArray = anArray;
Console.WriteLine("anotherArray[0] = " + anotherArray[0]);
Console.WriteLine("> modify the copy and the original changes too:");
anotherArray[0] = 7;
Console.WriteLine("anotherArray[0] = " + anotherArray[0]);
Console.WriteLine("anArray[0] = " + anArray[0] + "\n");
}
}
}
}
| {
"content_hash": "f0a9b8e2eed1757b1e826779f47a1929",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 110,
"avg_line_length": 40.92857142857143,
"alnum_prop": 0.5101803374054683,
"repo_name": "michaeltharper/eduware",
"id": "8b5513f6fd9253b5128c695e70fe7241db573a29",
"size": "1721",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "The-Tech-Academy-coursework/C-Sharp/ConsoleApps1029/Csharp-102908.Value-vs-Reference.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "102"
},
{
"name": "C#",
"bytes": "47144"
},
{
"name": "CSS",
"bytes": "259369"
},
{
"name": "HTML",
"bytes": "70459"
},
{
"name": "Java",
"bytes": "3754"
},
{
"name": "JavaScript",
"bytes": "46700"
},
{
"name": "PHP",
"bytes": "4074"
},
{
"name": "Python",
"bytes": "19213"
},
{
"name": "Shell",
"bytes": "8062"
}
],
"symlink_target": ""
} |
require "codeclimate-test-reporter"
CodeClimate::TestReporter.start
require 'simplecov'
SimpleCov.start if ENV["COVERAGE"]
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
# Prevent database truncation if the environment is production
abort("The Rails environment is running in production mode!") if Rails.env.production?
require 'spec_helper'
require 'rspec/rails'
require 'shoulda/matchers'
require 'database_cleaner'
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
ActiveRecord::Migration.maintain_test_schema!
RSpec.configure do |config|
config.use_transactional_fixtures = true
config.infer_base_class_for_anonymous_controllers = false
config.order = "random"
config.filter_run focus: true
config.run_all_when_everything_filtered = true
config.filter_run_excluding :slow unless ENV["SLOW_SPECS"]
#Config for databasecleaner
config.before(:suite) do
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.clean_with(:truncation)
end
config.around(:each) do |example|
DatabaseCleaner.cleaning do
example.run
end
end
config.infer_spec_type_from_file_location!
end
Shoulda::Matchers.configure do |config|
config.integrate do |with|
# Choose a test framework:
with.test_framework :rspec
with.library :rails
end
end | {
"content_hash": "caf4406d00d1ae96ea34e9bbeaeb4a54",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 86,
"avg_line_length": 29.040816326530614,
"alnum_prop": 0.7449051300070274,
"repo_name": "shivashankar-ror/googlesmtp",
"id": "35f3ac3ec1ccb2bea3e8f8617d5d0598798f2f80",
"size": "1423",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/rails_helper.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1893"
},
{
"name": "CoffeeScript",
"bytes": "211"
},
{
"name": "HTML",
"bytes": "5650"
},
{
"name": "JavaScript",
"bytes": "638"
},
{
"name": "Ruby",
"bytes": "37017"
}
],
"symlink_target": ""
} |
*Topic automatically generated on: 2015-04-02*
Removes a JavaScript link or block from a web or sitecollection
##Syntax
```powershell
Remove-SPOJavaScriptLink [-Force [<SwitchParameter>]] [-Scope [<CustomActionScope>]] [-Web [<WebPipeBind>]] -Name [<String>]
```
##Parameters
Parameter|Type|Required|Description
---------|----|--------|-----------
Force|SwitchParameter|False|
Name|String|True|Name of the Javascript link. Omit this parameter to retrieve all script links
Scope|CustomActionScope|False|
Web|WebPipeBind|False|The web to apply the command to. Leave empty to use the current web.
| {
"content_hash": "80f0a0be26fca90f344e3b8d9f204659",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 124,
"avg_line_length": 37.6875,
"alnum_prop": 0.7346600331674958,
"repo_name": "kendomen/PnP",
"id": "b3ed536bad85c52a675a197923c326ed52d56b9f",
"size": "629",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Solutions/PowerShell.Commands/Documentation/RemoveSPOJavaScriptLink.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "247960"
},
{
"name": "C#",
"bytes": "6393962"
},
{
"name": "CSS",
"bytes": "133533"
},
{
"name": "Cucumber",
"bytes": "11742"
},
{
"name": "HTML",
"bytes": "40130"
},
{
"name": "JavaScript",
"bytes": "1493059"
},
{
"name": "PowerShell",
"bytes": "8226"
},
{
"name": "Shell",
"bytes": "565"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "de1154f9a5db3a2a530a720fd1705bd2",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.307692307692308,
"alnum_prop": 0.6940298507462687,
"repo_name": "mdoering/backbone",
"id": "f0b3e1acd32c7dc4984d79fc9727c70e08012e87",
"size": "206",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Rhodophyta/Florideophyceae/Gracilariales/Gracilariaceae/Gracilaria/Gracilaria comosa/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
/* Author: Acorn Pooley, Ioan Sucan */
#include <moveit/collision_detection/world_diff.h>
#include <functional>
namespace collision_detection
{
WorldDiff::~WorldDiff()
{
WorldPtr old_world = world_.lock();
if (old_world)
old_world->removeObserver(observer_handle_);
}
WorldDiff::WorldDiff()
{
}
WorldDiff::WorldDiff(const WorldPtr& world) : world_(world)
{
observer_handle_ =
world->addObserver([this](const World::ObjectConstPtr& object, World::Action action) { notify(object, action); });
}
WorldDiff::WorldDiff(WorldDiff& other)
{
WorldPtr world = other.world_.lock();
if (world)
{
changes_ = other.changes_;
WorldWeakPtr(world).swap(world_);
observer_handle_ = world->addObserver(
[this](const World::ObjectConstPtr& object, World::Action action) { notify(object, action); });
}
}
void WorldDiff::reset()
{
clearChanges();
WorldPtr old_world = world_.lock();
if (old_world)
old_world->removeObserver(observer_handle_);
world_.reset();
}
void WorldDiff::reset(const WorldPtr& world)
{
clearChanges();
WorldPtr old_world = world_.lock();
if (old_world)
old_world->removeObserver(observer_handle_);
WorldWeakPtr(world).swap(world_);
observer_handle_ =
world->addObserver([this](const World::ObjectConstPtr& object, World::Action action) { notify(object, action); });
}
void WorldDiff::setWorld(const WorldPtr& world)
{
WorldPtr old_world = world_.lock();
if (old_world)
{
old_world->notifyObserverAllObjects(observer_handle_, World::DESTROY);
old_world->removeObserver(observer_handle_);
}
WorldWeakPtr(world).swap(world_);
observer_handle_ =
world->addObserver([this](const World::ObjectConstPtr& object, World::Action action) { notify(object, action); });
world->notifyObserverAllObjects(observer_handle_, World::CREATE | World::ADD_SHAPE);
}
void WorldDiff::clearChanges()
{
changes_.clear();
}
void WorldDiff::notify(const World::ObjectConstPtr& obj, World::Action action)
{
World::Action& a = changes_[obj->id_];
if (action == World::DESTROY)
a = World::DESTROY;
else
a = a | action;
}
} // end of namespace collision_detection
| {
"content_hash": "cc026a33c37277a065cb163bb974941e",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 120,
"avg_line_length": 23.138297872340427,
"alnum_prop": 0.6845977011494253,
"repo_name": "ros-planning/moveit",
"id": "1b705dced1a9b54c72c536a1edd27d6513971c5b",
"size": "3972",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "moveit_core/collision_detection/src/world_diff.cpp",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "2268"
},
{
"name": "C++",
"bytes": "7614097"
},
{
"name": "CMake",
"bytes": "157245"
},
{
"name": "Dockerfile",
"bytes": "5483"
},
{
"name": "GDB",
"bytes": "376"
},
{
"name": "HTML",
"bytes": "1171"
},
{
"name": "Makefile",
"bytes": "252"
},
{
"name": "NASL",
"bytes": "2404"
},
{
"name": "Python",
"bytes": "276327"
},
{
"name": "Shell",
"bytes": "15782"
},
{
"name": "TeX",
"bytes": "7222"
}
],
"symlink_target": ""
} |
<?php
namespace Enhavo\Bundle\WorkflowBundle\Entity;
use Enhavo\Bundle\WorkflowBundle\Model\NodeInterface;
use Enhavo\Bundle\WorkflowBundle\Model\WorkflowStatusInterface;
/**
* WorkflowStatus
*/
class WorkflowStatus implements WorkflowStatusInterface
{
/**
* @var integer
*/
private $id;
/**
* @var NodeInterface
*/
private $node;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set node
*
* @param NodeInterface $node
*
* @return WorkflowStatus
*/
public function setNode(NodeInterface $node = null)
{
if($node != null){
$this->node = $node;
return $this;
}
}
/**
* Get node
*
* @return NodeInterface
*/
public function getNode()
{
return $this->node;
}
}
| {
"content_hash": "1b92b41ccedfb3856b8bef86d98db1c9",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 63,
"avg_line_length": 15.810344827586206,
"alnum_prop": 0.5376226826608506,
"repo_name": "jennyhelbing/enhavo",
"id": "000517ae32d094184be902384e84c60986c20910",
"size": "917",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Enhavo/Bundle/WorkflowBundle/Entity/WorkflowStatus.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "1239"
},
{
"name": "CSS",
"bytes": "191535"
},
{
"name": "Cucumber",
"bytes": "6293"
},
{
"name": "HTML",
"bytes": "382180"
},
{
"name": "JavaScript",
"bytes": "113319"
},
{
"name": "PHP",
"bytes": "1177069"
},
{
"name": "Ruby",
"bytes": "1494"
},
{
"name": "Shell",
"bytes": "80"
}
],
"symlink_target": ""
} |
namespace crashpad {
//! \brief Inserts a mapping from \a key to \a value into \a map, or replaces
//! an existing mapping so that \a key maps to \a value.
//!
//! This behaves similarly to `std::map<>::%insert_or_assign()` proposed for
//! C++17, except that the \a old_value parameter is added.
//!
//! \param[in,out] map The map to operate on.
//! \param[in] key The key that should be mapped to \a value.
//! \param[in] value The value that \a key should map to.
//! \param[out] old_value If \a key was previously present in \a map, this will
//! be set to its previous value. This parameter is optional and may be
//! `nullptr` if this information is not required.
//!
//! \return `false` if \a key was previously present in \a map. If \a old_value
//! is not `nullptr`, it will be set to the previous value. `true` if \a
//! key was not present in the map and was inserted.
template <typename T>
bool MapInsertOrReplace(T* map,
const typename T::key_type& key,
const typename T::mapped_type& value,
typename T::mapped_type* old_value) {
const auto result = map->insert(std::make_pair(key, value));
if (!result.second) {
if (old_value) {
*old_value = result.first->second;
}
result.first->second = value;
}
return result.second;
}
template <typename T>
bool MapInsertOrReplace(T* map,
const typename T::key_type& key,
const typename T::mapped_type& value,
std::nullptr_t) {
const auto result = map->insert(std::make_pair(key, value));
if (!result.second) {
result.first->second = value;
}
return result.second;
}
} // namespace crashpad
#endif // CRASHPAD_UTIL_STDLIB_MAP_INSERT_H_
| {
"content_hash": "45eec9cf80a6e0fe4a6c58f5cd0103df",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 79,
"avg_line_length": 37.395833333333336,
"alnum_prop": 0.618941504178273,
"repo_name": "youtube/cobalt_sandbox",
"id": "ea8fc03210265f3c9f4cf34bc15e85b44b08d7a6",
"size": "2537",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "third_party/crashpad/util/stdlib/map_insert.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
using UnityEngine;
using System.Collections;
using ParticlePlayground;
/// <summary>
/// This example shows how to set a certain particle as sticky. Having a particle sticky means that it will follow a transform in the scene during its lifetime.
/// </summary>
public class SetStickyParticleExample : MonoBehaviour {
public int stickyParticle = 0; // The sticky particle to start with (set to negative value if you don't want to start with a sticky particle)
public Transform stickyTransform; // The transform to stick onto
public Vector3 stickyOffset; // The offset from the transform
PlaygroundParticlesC particles; // Cached reference to the particle system
IEnumerator Start () {
// Cache a reference to the particle system
particles = GetComponent<PlaygroundParticlesC>();
// Set a particle as sticky if a negative value isn't set
if (stickyParticle>-1) {
while (!particles.IsReady())
yield return null;
particles.SetSticky (stickyParticle, stickyTransform.position+stickyOffset, stickyTransform.up, particles.stickyCollisionsSurfaceOffset, stickyTransform);
}
}
void Update () {
// Update the sticky position
particles.UpdateSticky(stickyParticle);
}
/// <summary>
/// Use this function to turn any of your particles sticky during runtime.
/// </summary>
public void SetSticky (int index, Vector3 position, Vector3 normal, float offset, Transform parent) {
particles.SetSticky (index, position, normal, offset, parent);
}
/// <summary>
/// Make all particles non-sticky.
/// </summary>
public void ClearAllSticky () {
particles.ClearCollisions();
}
/// <summary>
/// Make specified particle non-sticky.
/// </summary>
public void ClearSticky (int index) {
particles.ClearCollisions(index);
}
}
| {
"content_hash": "d791a96b2bf3e24565c87f57eaf162ac",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 160,
"avg_line_length": 33.35849056603774,
"alnum_prop": 0.7398190045248869,
"repo_name": "dylan92/seriousGames1",
"id": "1f54e36147a619d89b620f9b1dec5ed825049c75",
"size": "1770",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Assets/Particle Playground/Examples/Example Scripts/Simple Scripts/SetStickyParticleExample.cs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ASP",
"bytes": "830543"
},
{
"name": "C#",
"bytes": "1468187"
},
{
"name": "CSS",
"bytes": "3910"
},
{
"name": "GLSL",
"bytes": "19784"
},
{
"name": "HTML",
"bytes": "742"
},
{
"name": "JavaScript",
"bytes": "27408"
}
],
"symlink_target": ""
} |
<?php
class ControllerExtensionPaymentGingerCc extends Controller {
const GINGER_MODULE = 'ginger_cc';
public function index()
{
$this->load->controller('extension/payment/ginger_ideal', static::getGingerModuleName());
}
static function getGingerModuleName()
{
return static::GINGER_MODULE;
}
}
| {
"content_hash": "72b432e9a82a4dbe462bb2218392ea37",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 97,
"avg_line_length": 21.4375,
"alnum_prop": 0.6705539358600583,
"repo_name": "gingerpayments/ginger-opencart",
"id": "a2a9c1388a05db1814e5890ce1586624f6655c85",
"size": "343",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "upload/admin/controller/extension/payment/ginger_cc.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "255318"
},
{
"name": "Smarty",
"bytes": "16566"
}
],
"symlink_target": ""
} |
all: FORCE
cd comm && make && make install
cd packet && make && make install
reinstall: FORCE
cd comm && make install
cd packet && make install
uninstall: FORCE
cd comm && make uninstall
cd packet && make uninstall
clean: FORCE
cd comm && make clean
cd packet && make clean
.PHONY: FORCE
| {
"content_hash": "4844756ae70f543eeef89d1a0322b184",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 34,
"avg_line_length": 16.77777777777778,
"alnum_prop": 0.6887417218543046,
"repo_name": "fresskarma/tinyos-1.x",
"id": "608a55f12ab045312b58d9b1a0d37dad80788d64",
"size": "446",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "contrib/boomerang/tinyos-1.x/beta/TOSComm/Makefile",
"mode": "33261",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "137296"
},
{
"name": "Awk",
"bytes": "2286"
},
{
"name": "C",
"bytes": "10268716"
},
{
"name": "C#",
"bytes": "140791"
},
{
"name": "C++",
"bytes": "2931461"
},
{
"name": "CSS",
"bytes": "19694"
},
{
"name": "Forth",
"bytes": "101"
},
{
"name": "Groff",
"bytes": "3149"
},
{
"name": "HTML",
"bytes": "1387492"
},
{
"name": "Inno Setup",
"bytes": "16361"
},
{
"name": "Java",
"bytes": "7496416"
},
{
"name": "Lex",
"bytes": "16806"
},
{
"name": "Logos",
"bytes": "10058"
},
{
"name": "M",
"bytes": "2148"
},
{
"name": "Makefile",
"bytes": "871469"
},
{
"name": "Mathematica",
"bytes": "164375"
},
{
"name": "Matlab",
"bytes": "760094"
},
{
"name": "OCaml",
"bytes": "34306"
},
{
"name": "Objective-C",
"bytes": "1149978"
},
{
"name": "PHP",
"bytes": "79339"
},
{
"name": "Perl",
"bytes": "649566"
},
{
"name": "Perl6",
"bytes": "13417"
},
{
"name": "PostScript",
"bytes": "476077"
},
{
"name": "Python",
"bytes": "884036"
},
{
"name": "Shell",
"bytes": "91087"
},
{
"name": "Smarty",
"bytes": "1515"
},
{
"name": "SourcePawn",
"bytes": "29314"
},
{
"name": "Standard ML",
"bytes": "2129"
},
{
"name": "Tcl",
"bytes": "168362"
},
{
"name": "TeX",
"bytes": "213012"
},
{
"name": "TypeScript",
"bytes": "3834"
},
{
"name": "Visual Basic",
"bytes": "274161"
},
{
"name": "Yacc",
"bytes": "43956"
},
{
"name": "nesC",
"bytes": "46659836"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_92) on Sun Oct 18 21:01:41 EDT 2020 -->
<title>RuleBookBean (rulebook API)</title>
<meta name="date" content="2020-10-18">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="RuleBookBean (rulebook API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":42,"i1":42};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/deliveredtechnologies/rulebook/spring/RuleBean.html" title="annotation in com.deliveredtechnologies.rulebook.spring"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../com/deliveredtechnologies/rulebook/spring/RuleBookFactoryBean.html" title="class in com.deliveredtechnologies.rulebook.spring"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/deliveredtechnologies/rulebook/spring/RuleBookBean.html" target="_top">Frames</a></li>
<li><a href="RuleBookBean.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#fields.inherited.from.class.com.deliveredtechnologies.rulebook.RuleBook">Field</a> | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.deliveredtechnologies.rulebook.spring</div>
<h2 title="Class RuleBookBean" class="title">Class RuleBookBean</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li><a href="../../../../com/deliveredtechnologies/rulebook/RuleBook.html" title="class in com.deliveredtechnologies.rulebook">com.deliveredtechnologies.rulebook.RuleBook</a><T></li>
<li>
<ul class="inheritance">
<li><a href="../../../../com/deliveredtechnologies/rulebook/DecisionBook.html" title="class in com.deliveredtechnologies.rulebook">com.deliveredtechnologies.rulebook.DecisionBook</a></li>
<li>
<ul class="inheritance">
<li>com.deliveredtechnologies.rulebook.spring.RuleBookBean</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<div class="block"><span class="deprecatedLabel">Deprecated.</span></div>
<br>
<pre>@Deprecated
public class <span class="typeNameLabel">RuleBookBean</span>
extends <a href="../../../../com/deliveredtechnologies/rulebook/DecisionBook.html" title="class in com.deliveredtechnologies.rulebook">DecisionBook</a></pre>
<div class="block">A convenience DecisionBook for POJO Rules that may be created by Spring.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.com.deliveredtechnologies.rulebook.RuleBook">
<!-- -->
</a>
<h3>Fields inherited from class com.deliveredtechnologies.rulebook.<a href="../../../../com/deliveredtechnologies/rulebook/RuleBook.html" title="class in com.deliveredtechnologies.rulebook">RuleBook</a></h3>
<code><a href="../../../../com/deliveredtechnologies/rulebook/RuleBook.html#Z:Z_facts">_facts</a>, <a href="../../../../com/deliveredtechnologies/rulebook/RuleBook.html#Z:Z_headRule">_headRule</a>, <a href="../../../../com/deliveredtechnologies/rulebook/RuleBook.html#Z:Z_tailRule">_tailRule</a></code></li>
</ul>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../com/deliveredtechnologies/rulebook/spring/RuleBookBean.html#RuleBookBean--">RuleBookBean</a></span>()</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span> </div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/deliveredtechnologies/rulebook/spring/RuleBookBean.html#addRule-java.lang.Object-">addRule</a></span>(java.lang.Object rule)</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span> </div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/deliveredtechnologies/rulebook/spring/RuleBookBean.html#defineRules--">defineRules</a></span>()</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span> </div>
<div class="block">this is where the rules can be specified in the subclass; it will be executed by run().</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.com.deliveredtechnologies.rulebook.DecisionBook">
<!-- -->
</a>
<h3>Methods inherited from class com.deliveredtechnologies.rulebook.<a href="../../../../com/deliveredtechnologies/rulebook/DecisionBook.html" title="class in com.deliveredtechnologies.rulebook">DecisionBook</a></h3>
<code><a href="../../../../com/deliveredtechnologies/rulebook/DecisionBook.html#addRule-com.deliveredtechnologies.rulebook.Decision-">addRule</a>, <a href="../../../../com/deliveredtechnologies/rulebook/DecisionBook.html#getResult--">getResult</a>, <a href="../../../../com/deliveredtechnologies/rulebook/DecisionBook.html#withDefaultResult-U-">withDefaultResult</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.com.deliveredtechnologies.rulebook.RuleBook">
<!-- -->
</a>
<h3>Methods inherited from class com.deliveredtechnologies.rulebook.<a href="../../../../com/deliveredtechnologies/rulebook/RuleBook.html" title="class in com.deliveredtechnologies.rulebook">RuleBook</a></h3>
<code><a href="../../../../com/deliveredtechnologies/rulebook/RuleBook.html#addRule-com.deliveredtechnologies.rulebook.Rule-">addRule</a>, <a href="../../../../com/deliveredtechnologies/rulebook/RuleBook.html#given-com.deliveredtechnologies.rulebook.Fact...-">given</a>, <a href="../../../../com/deliveredtechnologies/rulebook/RuleBook.html#given-java.lang.String-T-">given</a>, <a href="../../../../com/deliveredtechnologies/rulebook/RuleBook.html#run--">run</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="RuleBookBean--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>RuleBookBean</h4>
<pre>public RuleBookBean()</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span> </div>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="defineRules--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>defineRules</h4>
<pre>protected void defineRules()</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span> </div>
<div class="block"><span class="descfrmTypeLabel">Description copied from class: <code><a href="../../../../com/deliveredtechnologies/rulebook/RuleBook.html#defineRules--">RuleBook</a></code></span></div>
<div class="block">this is where the rules can be specified in the subclass; it will be executed by run().</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../com/deliveredtechnologies/rulebook/RuleBook.html#defineRules--">defineRules</a></code> in class <code><a href="../../../../com/deliveredtechnologies/rulebook/RuleBook.html" title="class in com.deliveredtechnologies.rulebook">RuleBook</a></code></dd>
</dl>
</li>
</ul>
<a name="addRule-java.lang.Object-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>addRule</h4>
<pre>public void addRule(java.lang.Object rule)
throws java.io.InvalidClassException</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span> </div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.io.InvalidClassException</code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/deliveredtechnologies/rulebook/spring/RuleBean.html" title="annotation in com.deliveredtechnologies.rulebook.spring"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../com/deliveredtechnologies/rulebook/spring/RuleBookFactoryBean.html" title="class in com.deliveredtechnologies.rulebook.spring"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/deliveredtechnologies/rulebook/spring/RuleBookBean.html" target="_top">Frames</a></li>
<li><a href="RuleBookBean.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#fields.inherited.from.class.com.deliveredtechnologies.rulebook.RuleBook">Field</a> | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| {
"content_hash": "7c26172f8d256056da7f9321df2afa12",
"timestamp": "",
"source": "github",
"line_count": 345,
"max_line_length": 529,
"avg_line_length": 42.881159420289855,
"alnum_prop": 0.6681762876841963,
"repo_name": "rulebook-rules/rulebook",
"id": "ef820a2d11e3b554ae3e7c4f702c486181e6c027",
"size": "14794",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "docs/javadocs/com/deliveredtechnologies/rulebook/spring/RuleBookBean.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "364144"
},
{
"name": "XSLT",
"bytes": "7350"
}
],
"symlink_target": ""
} |
import javax.xml.stream.XMLEventReader;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.events.XMLEvent;
import java.io.FileInputStream;
import java.util.Iterator;
import java.util.NoSuchElementException;
public class Pages implements Iterable<Page> {
private final int maxPages;
private final String fileName;
public Pages(int maxPages, String fileName) {
this.maxPages = maxPages;
this.fileName = fileName;
}
private class PageIterator implements Iterator<Page> {
private XMLEventReader reader;
private int remainingPages;
public PageIterator() throws Exception {
remainingPages = maxPages;
reader = XMLInputFactory.newInstance().createXMLEventReader(new FileInputStream
(fileName));
}
public boolean hasNext() {
return remainingPages > 0;
}
public Page next() {
try {
XMLEvent event;
String title = "";
String text = "";
while (true) {
event = reader.nextEvent();
if (event.isStartElement()) {
if (event.asStartElement().getName().getLocalPart().equals("page")) {
while (true) {
event = reader.nextEvent();
if (event.isStartElement()) {
String name = event.asStartElement().getName().getLocalPart();
if (name.equals("title")) {
title = reader.getElementText();
} else if (name.equals("text")) {
text = reader.getElementText();
}
} else if (event.isEndElement()) {
if (event.asEndElement().getName().getLocalPart().equals("page")) {
--remainingPages;
return new Page(title, text);
}
}
}
}
}
}
} catch (XMLStreamException e) {
throw new NoSuchElementException();
}
}
public void remove() {
throw new UnsupportedOperationException();
}
}
public Iterator<Page> iterator() {
try {
return new PageIterator();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
| {
"content_hash": "c2d1caa9736bef9af75e7c08442270f7",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 103,
"avg_line_length": 33.566265060240966,
"alnum_prop": 0.4662598707824838,
"repo_name": "syndbg-archive/SevenConcurrencyModelsInSevenWeeks",
"id": "56cd026391c736703063830d5e3576953ebf7945",
"size": "2786",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "java/src/Pages.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Clojure",
"bytes": "1180"
},
{
"name": "Elixir",
"bytes": "1612"
},
{
"name": "HTML",
"bytes": "97"
},
{
"name": "Java",
"bytes": "22924"
}
],
"symlink_target": ""
} |
<?php
use Bernard\Consumer;
use Bernard\Message;
use Bernard\Producer;
use Bernard\QueueFactory\PersistentFactory;
use Bernard\Serializer\NaiveSerializer;
use Bernard\ServiceResolver\ObjectResolver;
use Bernard\Middleware;
/**
* This file contains helper methods for the examples. See example/$driver.php
* for how to initiate the driver. Also the helper methods can be used as
* guidance if you are using Bernard outside a framework or you are developing
* a plugin to a framework.
*/
if (file_exists($autoloadFile = __DIR__ . '/../vendor/autoload.php') || file_exists($autoloadFile = __DIR__ . '/../../../autoload.php')) {
require $autoloadFile;
}
require __DIR__ . '/EchoTimeService.php';
ini_set('display_errors', 1);
error_reporting(E_ALL);
function get_serializer() {
return new NaiveSerializer;
}
function get_producer_middleware() {
return new Middleware\MiddlewareBuilder;
}
function get_consumer_middleware() {
$chain = new Middleware\MiddlewareBuilder;
$chain->push(new Middleware\ErrorLogFactory);
$chain->push(new Middleware\FailuresFactory(get_queue_factory()));
return $chain;
}
function get_queue_factory() {
return new PersistentFactory(get_driver(), get_serializer());
}
function get_producer() {
return new Producer(get_queue_factory(), get_producer_middleware());
}
function get_services() {
$resolver = new ObjectResolver();
$resolver->register('EchoTime', new EchoTimeService);
return $resolver;
}
function get_consumer() {
return new Consumer(get_services(), get_consumer_middleware());
}
function produce() {
$producer = get_producer();
while (true) {
$producer->produce(new Message\DefaultMessage('EchoTime', array(
'time' => time(),
)));
usleep(rand(100, 1000));
}
}
function consume() {
$queues = get_queue_factory();
$consumer = get_consumer();
$consumer->consume($queues->create('echo-time'));
}
function main() {
if (!isset($_SERVER['argv'][1])) {
die('You must provide an argument of either "consume" or "produce"');
}
if ($_SERVER['argv'][1] == 'produce') {
produce();
}
if ($_SERVER['argv'][1] == 'consume') {
consume();
}
}
// Run this diddy
main();
| {
"content_hash": "a7b095dc380b31496d54e146b2f37a9d",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 138,
"avg_line_length": 23.936842105263157,
"alnum_prop": 0.6596306068601583,
"repo_name": "ruudk/bernard",
"id": "99f00d1b89f63d2d5354acbe963e6b37192a54e2",
"size": "2274",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "example/bootstrap.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "131571"
}
],
"symlink_target": ""
} |
FROM balenalib/zc702-zynq7-ubuntu:cosmic-run
ENV GO_VERSION 1.16
# gcc for cgo
RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
gcc \
libc6-dev \
make \
pkg-config \
git \
&& rm -rf /var/lib/apt/lists/*
RUN set -x \
&& fetchDeps=' \
curl \
' \
&& apt-get update && apt-get install -y $fetchDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
&& mkdir -p /usr/local/go \
&& curl -SLO "http://resin-packages.s3.amazonaws.com/golang/v$GO_VERSION/go$GO_VERSION.linux-armv7hf.tar.gz" \
&& echo "5d2c637632fc23139c992e7f5adce1e46bccebd5a43fc90f797050ae71f46ab9 go$GO_VERSION.linux-armv7hf.tar.gz" | sha256sum -c - \
&& tar -xzf "go$GO_VERSION.linux-armv7hf.tar.gz" -C /usr/local/go --strip-components=1 \
&& rm -f go$GO_VERSION.linux-armv7hf.tar.gz
ENV GOROOT /usr/local/go
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
WORKDIR $GOPATH
CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"]
RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@golang.sh" \
&& echo "Running test-stack@golang" \
&& chmod +x test-stack@golang.sh \
&& bash test-stack@golang.sh \
&& rm -rf test-stack@golang.sh
RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v7 \nOS: Ubuntu cosmic \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nGo v1.16 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info
RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \
&& chmod +x /bin/sh-shim \
&& cp /bin/sh /bin/sh.real \
&& mv /bin/sh-shim /bin/sh | {
"content_hash": "aaa43f6f296d9e0647b63ef91a71fe58",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 670,
"avg_line_length": 50.65217391304348,
"alnum_prop": 0.7068669527896996,
"repo_name": "nghiant2710/base-images",
"id": "265e1587c5bf084746448fb82c87364ed5d5a424",
"size": "2351",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "balena-base-images/golang/zc702-zynq7/ubuntu/cosmic/1.16/run/Dockerfile",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "144558581"
},
{
"name": "JavaScript",
"bytes": "16316"
},
{
"name": "Shell",
"bytes": "368690"
}
],
"symlink_target": ""
} |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
function ModuleDependencyTemplateAsId() {}
module.exports = ModuleDependencyTemplateAsId;
ModuleDependencyTemplateAsId.prototype.apply = function(dep, source, outputOptions, requestShortener) {
if(!dep.range) return;
var comment = "";
if(outputOptions.pathinfo) comment = "/*! " + requestShortener.shorten(dep.request) + " */ ";
if(dep.module)
var content = comment + dep.module.id;
else
var content = require("./WebpackMissingModule").module(dep.request);
source.replace(dep.range[0], dep.range[1] - 1, content);
};
ModuleDependencyTemplateAsId.prototype.applyAsTemplateArgument = function(name, dep, source) {
if(!dep.range) return;
source.replace(dep.range[0], dep.range[1] - 1, name);
};
| {
"content_hash": "7774f35cff1d678b05cfb364792c096e",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 103,
"avg_line_length": 36.63636363636363,
"alnum_prop": 0.7406947890818859,
"repo_name": "Dashed/webpack",
"id": "6ecde76b937ecba0653ce40acf3655da6f967fc1",
"size": "806",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/dependencies/ModuleDependencyTemplateAsId.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "4023"
},
{
"name": "CoffeeScript",
"bytes": "1198"
},
{
"name": "HTML",
"bytes": "2613"
},
{
"name": "JavaScript",
"bytes": "720324"
}
],
"symlink_target": ""
} |
import logging
from logging.handlers import WatchedFileHandler
from time import gmtime
ISOFMT='%Y-%m-%dT%H:%M:%S.%sZ'
class LogLevel(object):
def __init__(self,name):
try:
self.ll_num = logging._nameToLevel[name]
except KeyError:
raise KeyError("{} is not a valid loglevel".format(name))
def level_numeric(self):
return self.ll_num
class NoSyncDataFilter(logging.Filter):
def filter(self, record):
if record.name == 'etd.sync.data':
return False
return True
class AddSyncIdFilter(logging.Filter):
def __init__(self, *args, **kwargs):
self.sync_id = kwargs.pop('sync_id')
super().__init__(*args, **kwargs)
def filter(self, record):
record.sync_id = self.sync_id
return True
STARTUP_CONSOLE_LOG_FORMAT_WITHOUT_TIMESTAMP='%(name)s pid=%(process)d %(levelname)s: %(message)s'
STARTUP_CONSOLE_LOG_FORMAT_WITH_TIMESTAMP = '%(asctime)s ' + STARTUP_CONSOLE_LOG_FORMAT_WITHOUT_TIMESTAMP
CONSOLE_LOG_FORMAT_WITHOUT_TIMESTAMP='%(sync_id)s %(name)s %(levelname)s: %(message)s'
CONSOLE_LOG_FORMAT_WITH_TIMESTAMP='%(asctime)s ' + CONSOLE_LOG_FORMAT_WITHOUT_TIMESTAMP
class RootLoggerBuilder(object):
def __init__(self, no_timestamps=False):
self.logger = logging.getLogger('')
self.logger.setLevel(logging.INFO)
self.console_handler = logging.StreamHandler()
self.no_timestamps = no_timestamps
if self.no_timestamps:
fmt = STARTUP_CONSOLE_LOG_FORMAT_WITHOUT_TIMESTAMP
else:
fmt = STARTUP_CONSOLE_LOG_FORMAT_WITH_TIMESTAMP
formatter = logging.Formatter(fmt)
formatter.converter = gmtime
self.console_handler.setFormatter(formatter)
#self.console_handler.setLevel(logging.INFO)
self.logger.addHandler(self.console_handler)
return
def extended_console_handler(self,sync_id, no_timestamps=False):
self.no_timestamps = no_timestamps
if self.no_timestamps:
fmt = CONSOLE_LOG_FORMAT_WITHOUT_TIMESTAMP
else:
fmt = CONSOLE_LOG_FORMAT_WITH_TIMESTAMP
formatter = logging.Formatter(fmt)
formatter.converter = gmtime
self.console_handler.setFormatter(formatter)
self.console_handler.addFilter(AddSyncIdFilter(sync_id=sync_id))
return
def set_loglevel(self,loglevel_num):
self.logger.setLevel(loglevel_num)
return
class LastLineFileHandler(WatchedFileHandler):
def emit(self,record):
f = open(self.baseFilename,'w')
f.close()
super().emit(record)
lastline_handler = LastLineFileHandler('/tmp/etdalive.log')
lastline_formatter = logging.Formatter('%(asctime)s %(name)s pid=%(process)d %(levelname)s: %(message)s')
lastline_handler.setFormatter(lastline_formatter)
lastline_handler.setLevel(logging.INFO)
lastline_handler.addFilter(NoSyncDataFilter())
"""
No sync data messages on the console handler
"""
#console_handler.addFilter(NoSyncDataFilter())
def add_sync_data_file_handler(filename, logger, sync_id):
log_file_handler = logging.FileHandler(filename, encoding='utf-8', delay=True)
std_sync_data_formatter = logging.Formatter(
'%(asctime)s %(process)d %(name)s %(sync_id)s %(levelname)s: %(message)s',
datefmt=ISOFMT)
std_sync_data_formatter.converter = gmtime
log_file_handler.setFormatter(std_sync_data_formatter)
log_file_handler.addFilter(AddSyncIdFilter(sync_id=sync_id))
log_file_handler.setLevel(logging.DEBUG)
logger.addHandler(log_file_handler)
| {
"content_hash": "4555573dfd50005d5fbc068100100265",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 105,
"avg_line_length": 33.886792452830186,
"alnum_prop": 0.6773385300668151,
"repo_name": "edushare-at/py-etd",
"id": "d1225ae3929721b72edcd1a1b3e06f38760cf780",
"size": "3592",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "packages/mylogger/__init__.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "133969"
},
{
"name": "Shell",
"bytes": "143"
}
],
"symlink_target": ""
} |
using base::Value;
using base::DictionaryValue;
using base::ListValue;
namespace gdata {
namespace {
// Term values for kSchemeKind category:
const char kSchemeKind[] = "http://schemas.google.com/g/2005#kind";
const char kTermPrefix[] = "http://schemas.google.com/docs/2007#";
const char kFileTerm[] = "file";
const char kFolderTerm[] = "folder";
const char kItemTerm[] = "item";
const char kPdfTerm[] = "pdf";
const char kDocumentTerm[] = "document";
const char kSpreadSheetTerm[] = "spreadsheet";
const char kPresentationTerm[] = "presentation";
const char kSchemeLabels[] = "http://schemas.google.com/g/2005/labels";
// Node names.
const char kAuthorNode[] = "author";
const char kCategoryNode[] = "category";
const char kContentNode[] = "content";
const char kEditedNode[] = "edited";
const char kEmailNode[] = "email";
const char kEntryNode[] = "entry";
const char kFeedLinkNode[] = "feedLink";
const char kFilenameNode[] = "filename";
const char kIDNode[] = "id";
const char kLastModifiedByNode[] = "lastModifiedBy";
const char kLinkNode[] = "link";
const char kMd5ChecksumNode[] = "md5Checksum";
const char kModifiedByMeDateNode[] = "modifiedByMeDate";
const char kNameNode[] = "name";
const char kPublishedNode[] = "published";
const char kQuotaBytesUsedNode[] = "quotaBytesUsed";
const char kResourceIdNode[] = "resourceId";
const char kSizeNode[] = "size";
const char kSuggestedFilenameNode[] = "suggestedFilename";
const char kTitleNode[] = "title";
const char kUpdatedNode[] = "updated";
const char kWritersCanInviteNode[] = "writersCanInvite";
// Field names.
const char kAuthorField[] = "author";
const char kCategoryField[] = "category";
const char kContentField[] = "content";
const char kDeletedField[] = "gd$deleted";
const char kETagField[] = "gd$etag";
const char kEmailField[] = "email.$t";
const char kEntryField[] = "entry";
const char kFeedField[] = "feed";
const char kFeedLinkField[] = "gd$feedLink";
const char kFileNameField[] = "docs$filename.$t";
const char kHrefField[] = "href";
const char kIDField[] = "id.$t";
const char kInstalledAppField[] = "docs$installedApp";
const char kInstalledAppNameField[] = "docs$installedAppName";
const char kInstalledAppObjectTypeField[] = "docs$installedAppObjectType";
const char kInstalledAppPrimaryFileExtensionField[] =
"docs$installedAppPrimaryFileExtension";
const char kInstalledAppPrimaryMimeTypeField[] =
"docs$installedAppPrimaryMimeType";
const char kInstalledAppSecondaryFileExtensionField[] =
"docs$installedAppSecondaryFileExtension";
const char kInstalledAppSecondaryMimeTypeField[] =
"docs$installedAppSecondaryMimeType";
const char kInstalledAppSupportsCreateField[] =
"docs$installedAppSupportsCreate";
const char kItemsPerPageField[] = "openSearch$itemsPerPage.$t";
const char kLabelField[] = "label";
const char kLargestChangestampField[] = "docs$largestChangestamp.value";
const char kLinkField[] = "link";
const char kMD5Field[] = "docs$md5Checksum.$t";
const char kNameField[] = "name.$t";
const char kPublishedField[] = "published.$t";
const char kQuotaBytesTotalField[] = "gd$quotaBytesTotal.$t";
const char kQuotaBytesUsedField[] = "gd$quotaBytesUsed.$t";
const char kRelField[] = "rel";
const char kRemovedField[] = "gd$removed";
const char kResourceIdField[] = "gd$resourceId.$t";
const char kSchemeField[] = "scheme";
const char kSizeField[] = "docs$size.$t";
const char kSrcField[] = "src";
const char kStartIndexField[] = "openSearch$startIndex.$t";
const char kSuggestedFileNameField[] = "docs$suggestedFilename.$t";
const char kTField[] = "$t";
const char kTermField[] = "term";
const char kTitleField[] = "title";
const char kTitleTField[] = "title.$t";
const char kTypeField[] = "type";
const char kUpdatedField[] = "updated.$t";
// Attribute names.
// Attributes are not namespace-blind as node names in XmlReader.
const char kETagAttr[] = "gd:etag";
const char kEmailAttr[] = "email";
const char kHrefAttr[] = "href";
const char kLabelAttr[] = "label";
const char kNameAttr[] = "name";
const char kRelAttr[] = "rel";
const char kSchemeAttr[] = "scheme";
const char kSrcAttr[] = "src";
const char kTermAttr[] = "term";
const char kTypeAttr[] = "type";
const char kValueAttr[] = "value";
struct EntryKindMap {
DocumentEntry::EntryKind kind;
const char* entry;
const char* extension;
};
const EntryKindMap kEntryKindMap[] = {
{ DocumentEntry::ITEM, "item", NULL},
{ DocumentEntry::DOCUMENT, "document", ".gdoc"},
{ DocumentEntry::SPREADSHEET, "spreadsheet", ".gsheet"},
{ DocumentEntry::PRESENTATION, "presentation", ".gslides" },
{ DocumentEntry::DRAWING, "drawing", ".gdraw"},
{ DocumentEntry::TABLE, "table", ".gtable"},
{ DocumentEntry::SITE, "site", NULL},
{ DocumentEntry::FOLDER, "folder", NULL},
{ DocumentEntry::FILE, "file", NULL},
{ DocumentEntry::PDF, "pdf", NULL},
};
struct LinkTypeMap {
Link::LinkType type;
const char* rel;
};
const LinkTypeMap kLinkTypeMap[] = {
{ Link::SELF,
"self" },
{ Link::NEXT,
"next" },
{ Link::PARENT,
"http://schemas.google.com/docs/2007#parent" },
{ Link::ALTERNATE,
"alternate"},
{ Link::EDIT,
"edit" },
{ Link::EDIT_MEDIA,
"edit-media" },
{ Link::ALT_EDIT_MEDIA,
"http://schemas.google.com/docs/2007#alt-edit-media" },
{ Link::ALT_POST,
"http://schemas.google.com/docs/2007#alt-post" },
{ Link::FEED,
"http://schemas.google.com/g/2005#feed"},
{ Link::POST,
"http://schemas.google.com/g/2005#post"},
{ Link::BATCH,
"http://schemas.google.com/g/2005#batch"},
{ Link::THUMBNAIL,
"http://schemas.google.com/docs/2007/thumbnail"},
{ Link::RESUMABLE_EDIT_MEDIA,
"http://schemas.google.com/g/2005#resumable-edit-media"},
{ Link::RESUMABLE_CREATE_MEDIA,
"http://schemas.google.com/g/2005#resumable-create-media"},
{ Link::TABLES_FEED,
"http://schemas.google.com/spreadsheets/2006#tablesfeed"},
{ Link::WORKSHEET_FEED,
"http://schemas.google.com/spreadsheets/2006#worksheetsfeed"},
{ Link::EMBED,
"http://schemas.google.com/docs/2007#embed"},
{ Link::PRODUCT,
"http://schemas.google.com/docs/2007#product"},
{ Link::ICON,
"http://schemas.google.com/docs/2007#icon"},
};
struct FeedLinkTypeMap {
FeedLink::FeedLinkType type;
const char* rel;
};
const FeedLinkTypeMap kFeedLinkTypeMap[] = {
{ FeedLink::ACL,
"http://schemas.google.com/acl/2007#accessControlList" },
{ FeedLink::REVISIONS,
"http://schemas.google.com/docs/2007/revisions" },
};
struct CategoryTypeMap {
Category::CategoryType type;
const char* scheme;
};
const CategoryTypeMap kCategoryTypeMap[] = {
{ Category::KIND,
"http://schemas.google.com/g/2005#kind" },
{ Category::LABEL,
"http://schemas.google.com/g/2005/labels" },
};
// Converts |url_string| to |result|. Always returns true to be used
// for JSONValueConverter::RegisterCustomField method.
// TODO(mukai): make it return false in case of invalid |url_string|.
bool GetGURLFromString(const base::StringPiece& url_string, GURL* result) {
*result = GURL(url_string.as_string());
return true;
}
// Converts boolean string values like "true" into bool.
bool GetBoolFromString(const base::StringPiece& value, bool* result) {
*result = (value == "true");
return true;
}
} // namespace
////////////////////////////////////////////////////////////////////////////////
// Author implementation
Author::Author() {
}
// static
void Author::RegisterJSONConverter(
base::JSONValueConverter<Author>* converter) {
converter->RegisterStringField(kNameField, &Author::name_);
converter->RegisterStringField(kEmailField, &Author::email_);
}
Author* Author::CreateFromXml(XmlReader* xml_reader) {
if (xml_reader->NodeName() != kAuthorNode)
return NULL;
if (!xml_reader->Read())
return NULL;
const int depth = xml_reader->Depth();
Author* author = new Author();
bool skip_read = false;
do {
skip_read = false;
DVLOG(1) << "Parsing author node " << xml_reader->NodeName()
<< ", depth = " << depth;
if (xml_reader->NodeName() == kNameNode) {
std::string name;
if (xml_reader->ReadElementContent(&name))
author->name_ = UTF8ToUTF16(name);
skip_read = true;
} else if (xml_reader->NodeName() == kEmailNode) {
xml_reader->ReadElementContent(&author->email_);
skip_read = true;
}
} while (depth == xml_reader->Depth() && (skip_read || xml_reader->Next()));
return author;
}
////////////////////////////////////////////////////////////////////////////////
// Link implementation
Link::Link() : type_(Link::UNKNOWN) {
}
// static.
bool Link::GetLinkType(const base::StringPiece& rel, Link::LinkType* result) {
for (size_t i = 0; i < arraysize(kLinkTypeMap); i++) {
if (rel == kLinkTypeMap[i].rel) {
*result = kLinkTypeMap[i].type;
return true;
}
}
// Let unknown link types through, just report it; if the link type is needed
// in the future, add it into LinkType and kLinkTypeMap.
DVLOG(1) << "Ignoring unknown link type for rel " << rel;
*result = UNKNOWN;
return true;
}
// static
void Link::RegisterJSONConverter(base::JSONValueConverter<Link>* converter) {
converter->RegisterCustomField<Link::LinkType>(
kRelField, &Link::type_, &Link::GetLinkType);
converter->RegisterCustomField(kHrefField, &Link::href_, &GetGURLFromString);
converter->RegisterStringField(kTitleField, &Link::title_);
converter->RegisterStringField(kTypeField, &Link::mime_type_);
}
// static.
Link* Link::CreateFromXml(XmlReader* xml_reader) {
if (xml_reader->NodeName() != kLinkNode)
return NULL;
Link* link = new Link();
xml_reader->NodeAttribute(kTypeAttr, &link->mime_type_);
std::string href;
if (xml_reader->NodeAttribute(kHrefAttr, &href))
link->href_ = GURL(href);
std::string rel;
if (xml_reader->NodeAttribute(kRelAttr, &rel))
GetLinkType(rel, &link->type_);
return link;
}
////////////////////////////////////////////////////////////////////////////////
// FeedLink implementation
FeedLink::FeedLink() : type_(FeedLink::UNKNOWN) {
}
// static.
bool FeedLink::GetFeedLinkType(
const base::StringPiece& rel, FeedLink::FeedLinkType* result) {
for (size_t i = 0; i < arraysize(kFeedLinkTypeMap); i++) {
if (rel == kFeedLinkTypeMap[i].rel) {
*result = kFeedLinkTypeMap[i].type;
return true;
}
}
DVLOG(1) << "Unknown feed link type for rel " << rel;
return false;
}
// static
void FeedLink::RegisterJSONConverter(
base::JSONValueConverter<FeedLink>* converter) {
converter->RegisterCustomField<FeedLink::FeedLinkType>(
kRelField, &FeedLink::type_, &FeedLink::GetFeedLinkType);
converter->RegisterCustomField(
kHrefField, &FeedLink::href_, &GetGURLFromString);
}
// static
FeedLink* FeedLink::CreateFromXml(XmlReader* xml_reader) {
if (xml_reader->NodeName() != kFeedLinkNode)
return NULL;
FeedLink* link = new FeedLink();
std::string href;
if (xml_reader->NodeAttribute(kHrefAttr, &href))
link->href_ = GURL(href);
std::string rel;
if (xml_reader->NodeAttribute(kRelAttr, &rel))
GetFeedLinkType(rel, &link->type_);
return link;
}
////////////////////////////////////////////////////////////////////////////////
// Category implementation
Category::Category() : type_(UNKNOWN) {
}
// Converts category.scheme into CategoryType enum.
bool Category::GetCategoryTypeFromScheme(
const base::StringPiece& scheme, Category::CategoryType* result) {
for (size_t i = 0; i < arraysize(kCategoryTypeMap); i++) {
if (scheme == kCategoryTypeMap[i].scheme) {
*result = kCategoryTypeMap[i].type;
return true;
}
}
DVLOG(1) << "Unknown feed link type for scheme " << scheme;
return false;
}
// static
void Category::RegisterJSONConverter(
base::JSONValueConverter<Category>* converter) {
converter->RegisterStringField(kLabelField, &Category::label_);
converter->RegisterCustomField<Category::CategoryType>(
kSchemeField, &Category::type_, &Category::GetCategoryTypeFromScheme);
converter->RegisterStringField(kTermField, &Category::term_);
}
// static
Category* Category::CreateFromXml(XmlReader* xml_reader) {
if (xml_reader->NodeName() != kCategoryNode)
return NULL;
Category* category = new Category();
xml_reader->NodeAttribute(kTermAttr, &category->term_);
std::string scheme;
if (xml_reader->NodeAttribute(kSchemeAttr, &scheme))
GetCategoryTypeFromScheme(scheme, &category->type_);
std::string label;
if (xml_reader->NodeAttribute(kLabelAttr, &label))
category->label_ = UTF8ToUTF16(label);
return category;
}
const Link* FeedEntry::GetLinkByType(Link::LinkType type) const {
for (size_t i = 0; i < links_.size(); ++i) {
if (links_[i]->type() == type)
return links_[i];
}
return NULL;
}
////////////////////////////////////////////////////////////////////////////////
// Content implementation
Content::Content() {
}
// static
void Content::RegisterJSONConverter(
base::JSONValueConverter<Content>* converter) {
converter->RegisterCustomField(kSrcField, &Content::url_, &GetGURLFromString);
converter->RegisterStringField(kTypeField, &Content::mime_type_);
}
Content* Content::CreateFromXml(XmlReader* xml_reader) {
if (xml_reader->NodeName() != kContentNode)
return NULL;
Content* content = new Content();
std::string src;
if (xml_reader->NodeAttribute(kSrcAttr, &src))
content->url_ = GURL(src);
xml_reader->NodeAttribute(kTypeAttr, &content->mime_type_);
return content;
}
////////////////////////////////////////////////////////////////////////////////
// FeedEntry implementation
FeedEntry::FeedEntry() {
}
FeedEntry::~FeedEntry() {
}
// static
void FeedEntry::RegisterJSONConverter(
base::JSONValueConverter<FeedEntry>* converter) {
converter->RegisterStringField(kETagField, &FeedEntry::etag_);
converter->RegisterRepeatedMessage(kAuthorField, &FeedEntry::authors_);
converter->RegisterRepeatedMessage(kLinkField, &FeedEntry::links_);
converter->RegisterRepeatedMessage(kCategoryField, &FeedEntry::categories_);
converter->RegisterCustomField<base::Time>(
kUpdatedField,
&FeedEntry::updated_time_,
&FeedEntry::GetTimeFromString);
}
// static
bool FeedEntry::GetTimeFromString(const base::StringPiece& raw_value,
base::Time* time) {
const char kTimeParsingDelimiters[] = "-:.TZ";
std::vector<base::StringPiece> parts;
if (Tokenize(raw_value, kTimeParsingDelimiters, &parts) != 7)
return false;
base::Time::Exploded exploded;
if (!base::StringToInt(parts[0], &exploded.year) ||
!base::StringToInt(parts[1], &exploded.month) ||
!base::StringToInt(parts[2], &exploded.day_of_month) ||
!base::StringToInt(parts[3], &exploded.hour) ||
!base::StringToInt(parts[4], &exploded.minute) ||
!base::StringToInt(parts[5], &exploded.second) ||
!base::StringToInt(parts[6], &exploded.millisecond)) {
return false;
}
exploded.day_of_week = 0;
if (!exploded.HasValidValues())
return false;
*time = base::Time::FromLocalExploded(exploded);
return true;
}
////////////////////////////////////////////////////////////////////////////////
// DocumentEntry implementation
DocumentEntry::DocumentEntry()
: kind_(DocumentEntry::UNKNOWN),
file_size_(0),
deleted_(false),
removed_(false) {
}
DocumentEntry::~DocumentEntry() {
}
bool DocumentEntry::HasFieldPresent(const base::Value* value,
bool* result) {
*result = (value != NULL);
return true;
}
// static
void DocumentEntry::RegisterJSONConverter(
base::JSONValueConverter<DocumentEntry>* converter) {
// inheritant the parent registrations.
FeedEntry::RegisterJSONConverter(
reinterpret_cast<base::JSONValueConverter<FeedEntry>*>(converter));
converter->RegisterStringField(
kResourceIdField, &DocumentEntry::resource_id_);
converter->RegisterStringField(kIDField, &DocumentEntry::id_);
converter->RegisterStringField(kTitleTField, &DocumentEntry::title_);
converter->RegisterCustomField<base::Time>(
kPublishedField, &DocumentEntry::published_time_,
&FeedEntry::GetTimeFromString);
converter->RegisterRepeatedMessage(
kFeedLinkField, &DocumentEntry::feed_links_);
converter->RegisterNestedField(kContentField, &DocumentEntry::content_);
// File properties. If the document type is not a normal file, then
// that's no problem because those feed must not have these fields
// themselves, which does not report errors.
converter->RegisterStringField(kFileNameField, &DocumentEntry::filename_);
converter->RegisterStringField(kMD5Field, &DocumentEntry::file_md5_);
converter->RegisterCustomField<int64>(
kSizeField, &DocumentEntry::file_size_, &base::StringToInt64);
converter->RegisterStringField(
kSuggestedFileNameField, &DocumentEntry::suggested_filename_);
// Deleted are treated as 'trashed' items on web client side. Removed files
// are gone for good. We treat both cases as 'deleted' for this client.
converter->RegisterCustomValueField<bool>(
kDeletedField, &DocumentEntry::deleted_, &DocumentEntry::HasFieldPresent);
converter->RegisterCustomValueField<bool>(
kRemovedField, &DocumentEntry::removed_, &DocumentEntry::HasFieldPresent);
}
std::string DocumentEntry::GetHostedDocumentExtension() const {
for (size_t i = 0; i < arraysize(kEntryKindMap); i++) {
if (kEntryKindMap[i].kind == kind_) {
if (kEntryKindMap[i].extension)
return std::string(kEntryKindMap[i].extension);
else
return std::string();
}
}
return std::string();
}
// static
bool DocumentEntry::HasHostedDocumentExtension(const FilePath& file) {
FilePath::StringType file_extension = file.Extension();
for (size_t i = 0; i < arraysize(kEntryKindMap); ++i) {
const char* document_extension = kEntryKindMap[i].extension;
if (document_extension && file_extension == document_extension)
return true;
}
return false;
}
// static
DocumentEntry::EntryKind DocumentEntry::GetEntryKindFromTerm(
const std::string& term) {
if (!StartsWithASCII(term, kTermPrefix, false)) {
DVLOG(1) << "Unexpected term prefix term " << term;
return DocumentEntry::UNKNOWN;
}
std::string type = term.substr(strlen(kTermPrefix));
for (size_t i = 0; i < arraysize(kEntryKindMap); i++) {
if (type == kEntryKindMap[i].entry)
return kEntryKindMap[i].kind;
}
DVLOG(1) << "Unknown entry type for term " << term << ", type " << type;
return DocumentEntry::UNKNOWN;
}
void DocumentEntry::FillRemainingFields() {
// Set |kind_| and |labels_| based on the |categories_| in the class.
// JSONValueConverter does not have the ability to catch an element in a list
// based on a predicate. Thus we need to iterate over |categories_| and
// find the elements to set these fields as a post-process.
for (size_t i = 0; i < categories_.size(); ++i) {
const Category* category = categories_[i];
if (category->type() == Category::KIND)
kind_ = GetEntryKindFromTerm(category->term());
else if (category->type() == Category::LABEL)
labels_.push_back(category->label());
}
}
// static
DocumentEntry* DocumentEntry::CreateFrom(const base::Value* value) {
base::JSONValueConverter<DocumentEntry> converter;
scoped_ptr<DocumentEntry> entry(new DocumentEntry());
if (!converter.Convert(*value, entry.get())) {
DVLOG(1) << "Invalid document entry!";
return NULL;
}
entry->FillRemainingFields();
return entry.release();
}
// static.
DocumentEntry* DocumentEntry::CreateFromXml(XmlReader* xml_reader) {
if (xml_reader->NodeName() != kEntryNode)
return NULL;
DocumentEntry* entry = new DocumentEntry();
xml_reader->NodeAttribute(kETagAttr, &entry->etag_);
if (!xml_reader->Read())
return entry;
bool skip_read = false;
do {
DVLOG(1) << "Parsing node " << xml_reader->NodeName();
skip_read = false;
if (xml_reader->NodeName() == kAuthorNode) {
scoped_ptr<Author> author(Author::CreateFromXml(xml_reader));
if (author.get())
entry->authors_.push_back(author.release());
}
if (xml_reader->NodeName() == kContentNode) {
scoped_ptr<Content> content(Content::CreateFromXml(xml_reader));
if (content.get())
entry->content_ = *content.get();
} else if (xml_reader->NodeName() == kLinkNode) {
scoped_ptr<Link> link(Link::CreateFromXml(xml_reader));
if (link.get())
entry->links_.push_back(link.release());
} else if (xml_reader->NodeName() == kFeedLinkNode) {
scoped_ptr<FeedLink> link(FeedLink::CreateFromXml(xml_reader));
if (link.get())
entry->feed_links_.push_back(link.release());
} else if (xml_reader->NodeName() == kCategoryNode) {
scoped_ptr<Category> category(Category::CreateFromXml(xml_reader));
if (category.get())
entry->categories_.push_back(category.release());
} else if (xml_reader->NodeName() == kUpdatedNode) {
std::string time;
if (xml_reader->ReadElementContent(&time))
GetTimeFromString(time, &entry->updated_time_);
skip_read = true;
} else if (xml_reader->NodeName() == kPublishedNode) {
std::string time;
if (xml_reader->ReadElementContent(&time))
GetTimeFromString(time, &entry->published_time_);
skip_read = true;
} else if (xml_reader->NodeName() == kIDNode) {
xml_reader->ReadElementContent(&entry->id_);
skip_read = true;
} else if (xml_reader->NodeName() == kResourceIdNode) {
xml_reader->ReadElementContent(&entry->resource_id_);
skip_read = true;
} else if (xml_reader->NodeName() == kTitleNode) {
std::string title;
if (xml_reader->ReadElementContent(&title))
entry->title_ = UTF8ToUTF16(title);
skip_read = true;
} else if (xml_reader->NodeName() == kFilenameNode) {
std::string file_name;
if (xml_reader->ReadElementContent(&file_name))
entry->filename_ = UTF8ToUTF16(file_name);
skip_read = true;
} else if (xml_reader->NodeName() == kSuggestedFilenameNode) {
std::string suggested_filename;
if (xml_reader->ReadElementContent(&suggested_filename))
entry->suggested_filename_ = UTF8ToUTF16(suggested_filename);
skip_read = true;
} else if (xml_reader->NodeName() == kMd5ChecksumNode) {
xml_reader->ReadElementContent(&entry->file_md5_);
skip_read = true;
} else if (xml_reader->NodeName() == kSizeNode) {
std::string size;
if (xml_reader->ReadElementContent(&size))
base::StringToInt64(size, &entry->file_size_);
skip_read = true;
} else {
DVLOG(1) << "Unknown node " << xml_reader->NodeName();
}
} while (skip_read || xml_reader->Next());
entry->FillRemainingFields();
return entry;
}
// static
std::string DocumentEntry::GetEntryNodeName() {
return kEntryNode;
}
////////////////////////////////////////////////////////////////////////////////
// DocumentFeed implementation
DocumentFeed::DocumentFeed()
: start_index_(0),
items_per_page_(0),
largest_changestamp_(0) {
}
DocumentFeed::~DocumentFeed() {
}
// static
void DocumentFeed::RegisterJSONConverter(
base::JSONValueConverter<DocumentFeed>* converter) {
// inheritance
FeedEntry::RegisterJSONConverter(
reinterpret_cast<base::JSONValueConverter<FeedEntry>*>(converter));
// TODO(zelidrag): Once we figure out where these will be used, we should
// check for valid start_index_ and items_per_page_ values.
converter->RegisterCustomField<int>(
kStartIndexField, &DocumentFeed::start_index_, &base::StringToInt);
converter->RegisterCustomField<int>(
kItemsPerPageField, &DocumentFeed::items_per_page_, &base::StringToInt);
converter->RegisterStringField(kTitleTField, &DocumentFeed::title_);
converter->RegisterRepeatedMessage(kEntryField, &DocumentFeed::entries_);
converter->RegisterCustomField<int>(
kLargestChangestampField, &DocumentFeed::largest_changestamp_,
&base::StringToInt);
}
bool DocumentFeed::Parse(const base::Value& value) {
base::JSONValueConverter<DocumentFeed> converter;
if (!converter.Convert(value, this)) {
DVLOG(1) << "Invalid document feed!";
return false;
}
ScopedVector<DocumentEntry>::iterator iter = entries_.begin();
while (iter != entries_.end()) {
DocumentEntry* entry = (*iter);
entry->FillRemainingFields();
++iter;
}
return true;
}
// static
scoped_ptr<DocumentFeed> DocumentFeed::ExtractAndParse(
const base::Value& value) {
const base::DictionaryValue* as_dict = NULL;
base::DictionaryValue* feed_dict = NULL;
if (value.GetAsDictionary(&as_dict) &&
as_dict->GetDictionary(kFeedField, &feed_dict)) {
return DocumentFeed::CreateFrom(*feed_dict);
}
return scoped_ptr<DocumentFeed>(NULL);
}
// static
scoped_ptr<DocumentFeed> DocumentFeed::CreateFrom(const base::Value& value) {
scoped_ptr<DocumentFeed> feed(new DocumentFeed());
if (!feed->Parse(value)) {
DVLOG(1) << "Invalid document feed!";
return scoped_ptr<DocumentFeed>(NULL);
}
return feed.Pass();
}
bool DocumentFeed::GetNextFeedURL(GURL* url) {
DCHECK(url);
for (size_t i = 0; i < links_.size(); ++i) {
if (links_[i]->type() == Link::NEXT) {
*url = links_[i]->href();
return true;
}
}
return false;
}
////////////////////////////////////////////////////////////////////////////////
// InstalledApp implementation
InstalledApp::InstalledApp() : supports_create_(false) {
}
InstalledApp::~InstalledApp() {
}
GURL InstalledApp::GetProductUrl() const {
for (ScopedVector<Link>::const_iterator it = links_->begin();
it != links_.end(); ++it) {
const Link* link = *it;
if (link->type() == Link::PRODUCT)
return link->href();
}
return GURL();
}
// static
bool InstalledApp::GetValueString(const base::Value* value,
std::string* result) {
const base::DictionaryValue* dict = NULL;
if (!value->GetAsDictionary(&dict))
return false;
if (!dict->GetString(kTField, result))
return false;
return true;
}
// static
void InstalledApp::RegisterJSONConverter(
base::JSONValueConverter<InstalledApp>* converter) {
converter->RegisterStringField(kInstalledAppNameField,
&InstalledApp::app_name_);
converter->RegisterStringField(kInstalledAppObjectTypeField,
&InstalledApp::object_type_);
converter->RegisterCustomField<bool>(kInstalledAppSupportsCreateField,
&InstalledApp::supports_create_,
&GetBoolFromString);
converter->RegisterRepeatedCustomValue(kInstalledAppPrimaryMimeTypeField,
&InstalledApp::primary_mimetypes_,
&GetValueString);
converter->RegisterRepeatedCustomValue(kInstalledAppSecondaryMimeTypeField,
&InstalledApp::secondary_mimetypes_,
&GetValueString);
converter->RegisterRepeatedCustomValue(kInstalledAppPrimaryFileExtensionField,
&InstalledApp::primary_extensions_,
&GetValueString);
converter->RegisterRepeatedCustomValue(
kInstalledAppSecondaryFileExtensionField,
&InstalledApp::secondary_extensions_,
&GetValueString);
converter->RegisterRepeatedMessage(kLinkField, &InstalledApp::links_);
}
////////////////////////////////////////////////////////////////////////////////
// AccountMetadataFeed implementation
AccountMetadataFeed::AccountMetadataFeed()
: quota_bytes_total_(0),
quota_bytes_used_(0),
largest_changestamp_(0) {
}
AccountMetadataFeed::~AccountMetadataFeed() {
}
// static
void AccountMetadataFeed::RegisterJSONConverter(
base::JSONValueConverter<AccountMetadataFeed>* converter) {
converter->RegisterCustomField<int64>(
kQuotaBytesTotalField,
&AccountMetadataFeed::quota_bytes_total_,
&base::StringToInt64);
converter->RegisterCustomField<int64>(
kQuotaBytesUsedField,
&AccountMetadataFeed::quota_bytes_used_,
&base::StringToInt64);
converter->RegisterCustomField<int>(
kLargestChangestampField,
&AccountMetadataFeed::largest_changestamp_,
&base::StringToInt);
converter->RegisterRepeatedMessage(kInstalledAppField,
&AccountMetadataFeed::installed_apps_);
}
// static
scoped_ptr<AccountMetadataFeed> AccountMetadataFeed::CreateFrom(
const base::Value& value) {
scoped_ptr<AccountMetadataFeed> feed(new AccountMetadataFeed());
const base::DictionaryValue* dictionary = NULL;
base::Value* entry = NULL;
if (!value.GetAsDictionary(&dictionary) ||
!dictionary->Get(kEntryField, &entry) ||
!feed->Parse(*entry)) {
LOG(ERROR) << "Unable to create: Invalid account metadata feed!";
return scoped_ptr<AccountMetadataFeed>(NULL);
}
return feed.Pass();
}
bool AccountMetadataFeed::Parse(const base::Value& value) {
base::JSONValueConverter<AccountMetadataFeed> converter;
if (!converter.Convert(value, this)) {
LOG(ERROR) << "Unable to parse: Invalid account metadata feed!";
return false;
}
return true;
}
} // namespace gdata
| {
"content_hash": "8d068faaa03bcc6e27cfc5670f7d3221",
"timestamp": "",
"source": "github",
"line_count": 885,
"max_line_length": 80,
"avg_line_length": 33.538983050847456,
"alnum_prop": 0.6577723873054376,
"repo_name": "robclark/chromium",
"id": "4ee0e3ade671f1d8bf72d329add897af483ab75e",
"size": "30258",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "chrome/browser/chromeos/gdata/gdata_parser.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "1178292"
},
{
"name": "C",
"bytes": "74631766"
},
{
"name": "C++",
"bytes": "120828826"
},
{
"name": "F#",
"bytes": "381"
},
{
"name": "Go",
"bytes": "18556"
},
{
"name": "Java",
"bytes": "120805"
},
{
"name": "JavaScript",
"bytes": "16170722"
},
{
"name": "Objective-C",
"bytes": "5449644"
},
{
"name": "PHP",
"bytes": "97796"
},
{
"name": "Perl",
"bytes": "918516"
},
{
"name": "Python",
"bytes": "5989396"
},
{
"name": "R",
"bytes": "524"
},
{
"name": "Shell",
"bytes": "4169796"
},
{
"name": "Tcl",
"bytes": "277077"
}
],
"symlink_target": ""
} |
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2015 Couchbase, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <libgreenstack/memcached/DeleteBucket.h>
#include <flatbuffers/flatbuffers.h>
#include <Greenstack/payload/DeleteBucketRequest_generated.h>
Greenstack::DeleteBucketRequest::DeleteBucketRequest(const std::string& name,
bool force)
: Request(Greenstack::Opcode::DeleteBucket) {
if (name.empty()) {
throw std::runtime_error("Bucket name can't be empty");
}
flatbuffers::FlatBufferBuilder fbb;
auto bucketName = fbb.CreateString(name);
Greenstack::Payload::DeleteBucketRequestBuilder builder(fbb);
builder.add_BucketName(bucketName);
builder.add_Force(force);
auto stuff = builder.Finish();
Greenstack::Payload::FinishDeleteBucketRequestBuffer(fbb, stuff);
payload.resize(fbb.GetSize());
memcpy(payload.data(), fbb.GetBufferPointer(), fbb.GetSize());
}
const std::string Greenstack::DeleteBucketRequest::getName() const {
auto request = Greenstack::Payload::GetDeleteBucketRequest(payload.data());
std::string ret(request->BucketName()->c_str());
return ret;
}
bool Greenstack::DeleteBucketRequest::isForce() const {
auto request = Greenstack::Payload::GetDeleteBucketRequest(payload.data());
return request->Force();
}
Greenstack::DeleteBucketRequest::DeleteBucketRequest()
: Request(Greenstack::Opcode::DeleteBucket) {
}
void Greenstack::DeleteBucketRequest::validate() {
Message::validate();
using namespace Greenstack::Payload;
using namespace flatbuffers;
Verifier verifier(payload.data(), payload.size());
if (!VerifyDeleteBucketRequestBuffer(verifier)) {
throw std::runtime_error("Incorrect payload for DeleteBucket");
}
}
Greenstack::DeleteBucketResponse::DeleteBucketResponse()
: Response(Greenstack::Opcode::DeleteBucket, Greenstack::Status::Success) {
}
Greenstack::DeleteBucketResponse::DeleteBucketResponse(
const Greenstack::Status& status)
: Response(Greenstack::Opcode::DeleteBucket, status) {
}
| {
"content_hash": "5e389f942e2d7085034ebccf51530fa4",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 79,
"avg_line_length": 35.15584415584416,
"alnum_prop": 0.7096416697451052,
"repo_name": "owendCB/memcached",
"id": "9fcca84018f0db485bc4a8f2846949bfbc1cc977",
"size": "2707",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "protocol/Greenstack/libgreenstack/memcached/DeleteBucket.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "505542"
},
{
"name": "C++",
"bytes": "2480779"
},
{
"name": "CMake",
"bytes": "54502"
},
{
"name": "DTrace",
"bytes": "10631"
},
{
"name": "Python",
"bytes": "27016"
},
{
"name": "Shell",
"bytes": "448"
}
],
"symlink_target": ""
} |
@implementation NSString (URLEncoding)
-(NSString *)urlEncodeUsingEncoding:(NSStringEncoding)encoding {
return [(NSString *)CFURLCreateStringByAddingPercentEscapes(NULL,
(CFStringRef)self,
NULL,
(CFStringRef)@"!*'\"();:@&=+$,/?%#[]% ",
CFStringConvertNSStringEncodingToEncoding(encoding)) autorelease];
}
@end | {
"content_hash": "c60c918f44d5c943c0ab19de58dc827a",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 129,
"avg_line_length": 51.27272727272727,
"alnum_prop": 0.42021276595744683,
"repo_name": "MyMalcom/malcom-lib-ios",
"id": "77a762e0854bf454ff30f47d4b4917e9d8a5ab87",
"size": "598",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Libraries/external/madvertise_5_0_3/madvertise/NSString+URLEncoding.m",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "29311"
},
{
"name": "C++",
"bytes": "202"
},
{
"name": "JavaScript",
"bytes": "27528"
},
{
"name": "Objective-C",
"bytes": "1931406"
},
{
"name": "Ruby",
"bytes": "1299"
}
],
"symlink_target": ""
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Type definition managed_xsi_shared_memory</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../interprocess/indexes_reference.html#header.boost.interprocess.managed_xsi_shared_memory_hpp" title="Header <boost/interprocess/managed_xsi_shared_memory.hpp>">
<link rel="prev" href="basic_managed__idp67227616.html" title="Class template basic_managed_xsi_shared_memory">
<link rel="next" href="wmanaged_xsi_shared_memory.html" title="Type definition wmanaged_xsi_shared_memory">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="basic_managed__idp67227616.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../interprocess/indexes_reference.html#header.boost.interprocess.managed_xsi_shared_memory_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="wmanaged_xsi_shared_memory.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.interprocess.managed_xsi_shared_memory"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Type definition managed_xsi_shared_memory</span></h2>
<p>managed_xsi_shared_memory</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: <<a class="link" href="../../interprocess/indexes_reference.html#header.boost.interprocess.managed_xsi_shared_memory_hpp" title="Header <boost/interprocess/managed_xsi_shared_memory.hpp>">boost/interprocess/managed_xsi_shared_memory.hpp</a>>
</span>
<span class="keyword">typedef</span> <a class="link" href="basic_managed__idp67227616.html" title="Class template basic_managed_xsi_shared_memory">basic_managed_xsi_shared_memory</a><span class="special"><</span> <span class="keyword">char</span><span class="special">,</span><a class="link" href="rbtree_best_fit.html" title="Class template rbtree_best_fit">rbtree_best_fit</a><span class="special"><</span> <a class="link" href="mutex_family.html" title="Struct mutex_family">mutex_family</a> <span class="special">></span><span class="special">,</span><a class="link" href="iset_index.html" title="Class template iset_index">iset_index</a> <span class="special">></span> <span class="identifier">managed_xsi_shared_memory</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.19.17.3.40.4.4"></a><h2>Description</h2>
<p>Typedef for a default <a class="link" href="basic_managed__idp67227616.html" title="Class template basic_managed_xsi_shared_memory">basic_managed_xsi_shared_memory</a> of narrow characters </p>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2005-2015 Ion Gaztanaga<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="basic_managed__idp67227616.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../interprocess/indexes_reference.html#header.boost.interprocess.managed_xsi_shared_memory_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="wmanaged_xsi_shared_memory.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
| {
"content_hash": "44790819e02d4747f66a1582f50e01d1",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 785,
"avg_line_length": 91.10909090909091,
"alnum_prop": 0.6886848932348832,
"repo_name": "vslavik/poedit",
"id": "fd7192c6acb2338268be3f06fb87e17830b46675",
"size": "5011",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "deps/boost/doc/html/boost/interprocess/managed_xsi_shared_memory.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "48113"
},
{
"name": "C++",
"bytes": "1294527"
},
{
"name": "Inno Setup",
"bytes": "11180"
},
{
"name": "M4",
"bytes": "104017"
},
{
"name": "Makefile",
"bytes": "9507"
},
{
"name": "Objective-C",
"bytes": "16519"
},
{
"name": "Objective-C++",
"bytes": "14681"
},
{
"name": "Python",
"bytes": "6594"
},
{
"name": "Ruby",
"bytes": "292"
},
{
"name": "Shell",
"bytes": "12042"
}
],
"symlink_target": ""
} |
package com.suscipio_solutions.consecro_web.util;
/**
* A basic thread for all request management. It's main purpose
* is simply to carry the configuration for the server around
*
*/
public class CWThread extends Thread
{
private final CWConfig config;
public CWThread(CWConfig config, Runnable r, String name)
{
super(r, name);
this.config=config;
}
public CWThread(CWConfig config, String name)
{
super(name);
this.config=config;
}
public CWConfig getConfig()
{
return config;
}
public String toString()
{
final StringBuilder dump = new StringBuilder("");
final java.lang.StackTraceElement[] s=getStackTrace();
for (final StackTraceElement element : s)
dump.append(element.getClassName()+": "+element.getMethodName()+"("+element.getFileName()+": "+element.getLineNumber()+") | ");
return dump.toString();
}
}
| {
"content_hash": "b645896a2f941def1e26cc8fb7dc6c15",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 130,
"avg_line_length": 21.575,
"alnum_prop": 0.7056778679026651,
"repo_name": "ConsecroMUD/ConsecroMUD",
"id": "6290a907a60af0d6510d750f6f75b9d6cc0c3c3d",
"size": "863",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "com/suscipio_solutions/consecro_web/util/CWThread.java",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1413"
},
{
"name": "Java",
"bytes": "21670655"
},
{
"name": "JavaScript",
"bytes": "23366"
},
{
"name": "Perl",
"bytes": "732"
},
{
"name": "Shell",
"bytes": "6214"
}
],
"symlink_target": ""
} |
module ActiveRecord::Associations::Builder
class CollectionAssociation < Association #:nodoc:
CALLBACKS = [:before_add, :after_add, :before_remove, :after_remove]
self.valid_options += [
:table_name, :order, :group, :having, :limit, :offset, :uniq, :finder_sql,
:counter_sql, :before_add, :after_add, :before_remove, :after_remove
]
attr_reader :block_extension
def self.build(model, name, options, &extension)
new(model, name, options, &extension).build
end
def initialize(model, name, options, &extension)
super(model, name, options)
@block_extension = extension
end
def build
wrap_block_extension
reflection = super
CALLBACKS.each { |callback_name| define_callback(callback_name) }
reflection
end
def writable?
true
end
private
def wrap_block_extension
options[:extend] = Array.wrap(options[:extend])
if block_extension
silence_warnings do
model.parent.const_set(extension_module_name, Module.new(&block_extension))
end
options[:extend].push("#{model.parent}::#{extension_module_name}".constantize)
end
end
def extension_module_name
@extension_module_name ||= "#{model.to_s.demodulize}#{name.to_s.camelize}AssociationExtension"
end
def define_callback(callback_name)
full_callback_name = "#{callback_name}_for_#{name}"
# TODO : why do i need method_defined? I think its because of the inheritance chain
model.class_attribute full_callback_name.to_sym unless model.method_defined?(full_callback_name)
model.send("#{full_callback_name}=", Array.wrap(options[callback_name.to_sym]))
end
def define_readers
super
name = self.name
model.redefine_method("#{name.to_s.singularize}_ids") do
association(name).ids_reader
end
end
def define_writers
super
name = self.name
model.redefine_method("#{name.to_s.singularize}_ids=") do |ids|
association(name).ids_writer(ids)
end
end
end
end
| {
"content_hash": "56a00663b93ab0d50e8f3ce474dca336",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 104,
"avg_line_length": 28.813333333333333,
"alnum_prop": 0.6293382693197593,
"repo_name": "jasonamyers/ccsnetvis",
"id": "f62209a226f8db0efaa8b9659e51a94a98001e70",
"size": "2161",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "execjs/ruby/1.9.1/gems/activerecord-3.1.3/lib/active_record/associations/builder/collection_association.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "152387"
},
{
"name": "C++",
"bytes": "236474"
},
{
"name": "CSS",
"bytes": "567314"
},
{
"name": "CoffeeScript",
"bytes": "2310"
},
{
"name": "Erlang",
"bytes": "1223"
},
{
"name": "Java",
"bytes": "138892"
},
{
"name": "JavaScript",
"bytes": "209052"
},
{
"name": "Logos",
"bytes": "264"
},
{
"name": "PHP",
"bytes": "857"
},
{
"name": "Perl",
"bytes": "3082"
},
{
"name": "Racket",
"bytes": "54"
},
{
"name": "Ragel in Ruby Host",
"bytes": "58257"
},
{
"name": "Ruby",
"bytes": "10611179"
},
{
"name": "Shell",
"bytes": "175"
},
{
"name": "eC",
"bytes": "2009"
}
],
"symlink_target": ""
} |
<?php
namespace tests\codeception\common\fixtures;
use yii\test\ActiveFixture;
/**
* User fixture
*/
class ComercioFixture extends ActiveFixture
{
public $modelClass = 'common\models\Comercio';
}
| {
"content_hash": "475ed6c90153042bf77a2293e88cb04e",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 50,
"avg_line_length": 15.76923076923077,
"alnum_prop": 0.7414634146341463,
"repo_name": "mgrg84/grupo3php",
"id": "3de4f75193acc7e283d26e1f152242a0d15a84f6",
"size": "205",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/codeception/common/fixtures/ComercioFixture.php",
"mode": "33261",
"license": "bsd-3-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "842"
},
{
"name": "Batchfile",
"bytes": "1579"
},
{
"name": "CSS",
"bytes": "39389"
},
{
"name": "JavaScript",
"bytes": "26302"
},
{
"name": "PHP",
"bytes": "823709"
}
],
"symlink_target": ""
} |
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="tests in shelf" type="DartTestRunConfigurationType" factoryName="Dart Test" singleton="true" nameIsGenerated="true">
<option name="filePath" value="$PROJECT_DIR$" />
<option name="scope" value="FOLDER" />
<option name="testRunnerOptions" value="-j 4" />
<method />
</configuration>
</component> | {
"content_hash": "c0ddf2ee0814427ca9f22450dffb57ef",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 155,
"avg_line_length": 50.125,
"alnum_prop": 0.7182044887780549,
"repo_name": "angel-dart/angel",
"id": "a6105b273def9e216b8daef457303cb2a159291a",
"size": "401",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "packages/shelf/.idea/runConfigurations/tests_in_shelf.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "1088"
},
{
"name": "C++",
"bytes": "21704"
},
{
"name": "CMake",
"bytes": "566"
},
{
"name": "CSS",
"bytes": "283"
},
{
"name": "Dart",
"bytes": "1838061"
},
{
"name": "HTML",
"bytes": "5500"
},
{
"name": "JavaScript",
"bytes": "947"
},
{
"name": "Julia",
"bytes": "101"
},
{
"name": "Lua",
"bytes": "219"
},
{
"name": "Python",
"bytes": "3329"
},
{
"name": "Ruby",
"bytes": "168"
},
{
"name": "Shell",
"bytes": "2103"
}
],
"symlink_target": ""
} |
/*global describe, beforeEach, it*/
'use strict';
var path = require('path');
var helpers = require('yeoman-generator').test;
describe('hubot-script generator', function () {
beforeEach(function (done) {
helpers.testDirectory(path.join(__dirname, 'temp'), function (err) {
if (err) {
return done(err);
}
this.app = helpers.createGenerator('hubot-script:app', [
'../../app'
]);
done();
}.bind(this));
});
it('creates expected files', function (done) {
var expected = [
// add files you expect to exist here.
'script/bootstrap',
'script/test',
'src/testscript.coffee',
'test/testscript-test.coffee',
'.gitignore',
'.travis.yml',
'Gruntfile.js',
'index.coffee',
'package.json',
'README.md'
];
helpers.mockPrompt(this.app, {
'scriptName': 'testScript',
'scriptDescription': 'testDescription',
'scriptKeywords': 'hubot, hubot-script'
});
this.app.options['skip-install'] = true;
this.app.run({}, function () {
helpers.assertFiles(expected);
done();
});
});
});
| {
"content_hash": "b3a97d71abf5ef8d77deb20c906970ac",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 72,
"avg_line_length": 23.510204081632654,
"alnum_prop": 0.5694444444444444,
"repo_name": "desmondmorris/generator-hubot-script",
"id": "7a972488355ea102cc169b54d6bb09e45f716938",
"size": "1152",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/test-creation.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CoffeeScript",
"bytes": "1276"
},
{
"name": "JavaScript",
"bytes": "5748"
},
{
"name": "Shell",
"bytes": "438"
}
],
"symlink_target": ""
} |
package com.minelittlepony.client.mixin;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.util.SpriteIdentifier;
import net.minecraft.util.Identifier;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import com.minelittlepony.client.render.LevitatingItemRenderer;
import java.util.function.Function;
@Mixin(SpriteIdentifier.class)
abstract class MixinSpriteIdentifier {
@Inject(method = "getVertexConsumer("
+ "Lnet/minecraft/client/render/VertexConsumerProvider;"
+ "Ljava/util/function/Function;"
+ ")"
+ "Lnet/minecraft/client/render/VertexConsumer;",
at = @At("HEAD"),
cancellable = true
)
public void onGetBuffer(VertexConsumerProvider provider, Function<Identifier, RenderLayer> layerFunction, CallbackInfoReturnable<VertexConsumer> info) {
if (LevitatingItemRenderer.isEnabled()) {
SpriteIdentifier self = (SpriteIdentifier)(Object)this;
info.setReturnValue(self.getSprite().getTextureSpecificVertexConsumer(provider.getBuffer(LevitatingItemRenderer.getRenderLayer(self.getAtlasId()))));
}
}
}
| {
"content_hash": "3493a969d1d59cf26da412a96202f23a",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 161,
"avg_line_length": 40.388888888888886,
"alnum_prop": 0.749656121045392,
"repo_name": "MineLittlePony/MineLittlePony",
"id": "b3b54167055de9002eb15c2ea3137fef8edfb5ab",
"size": "1454",
"binary": false,
"copies": "1",
"ref": "refs/heads/1.19",
"path": "src/main/java/com/minelittlepony/client/mixin/MixinSpriteIdentifier.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "448585"
},
{
"name": "PHP",
"bytes": "745"
}
],
"symlink_target": ""
} |
from flask import Flask, request, jsonify
from prediction import transform_to_image, predict
import urllib
def load_image_from_url(url):
# import os
# data_dir = '../data/real-world/'
# file = os.path.join(data_dir, url)
# load
file = urllib.request.urlopen(url)
return transform_to_image(file)
def load_image_from_file(name):
import os
data_dir = '../data/real-world/'
file = os.path.join(data_dir, name)
return transform_to_image(file)
app = Flask(__name__)
@app.route('/')
def predict_url():
json = request.json
url = json['url']
print ('url:', url)
if 'model' in json:
model = json['model']
else:
model = 'default'
print ('model:', model)
image = load_image_from_url(url)
# image = load_image_from_file('1000/70-house-detail.jpg')
predicted_category, prediction = predict(image, model)
response = {
'category': predicted_category.tolist(),
'prediction': prediction.tolist(),
'model': model
}
return jsonify(response)
# Can not use Debug, lets Flask mess with tensorflow as it seems
# http://stackoverflow.com/questions/41991756/valueerror-tensor-is-not-an-element-of-this-graph
if __name__ == '__main__':
app.run(debug=False, host='0.0.0.0', port=8888)
# app.run(debug=False)
| {
"content_hash": "d3d020d0a46f6ae3e669a8a003ef2d2a",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 95,
"avg_line_length": 27.583333333333332,
"alnum_prop": 0.6359516616314199,
"repo_name": "DJCordhose/speed-limit-signs",
"id": "68c54c92c39552e6b84813f101870c4cf7a4862e",
"size": "1347",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "server/sync.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "197676"
},
{
"name": "HTML",
"bytes": "129148"
},
{
"name": "JavaScript",
"bytes": "271095"
},
{
"name": "Jupyter Notebook",
"bytes": "652032"
},
{
"name": "Python",
"bytes": "9990"
},
{
"name": "Shell",
"bytes": "174"
}
],
"symlink_target": ""
} |
/*
Navicat MySQL Data Transfer
Source Server : LOCAL
Source Server Version : 50522
Source Host : localhost:3306
Source Database : sonicbot_collector
Target Server Type : MYSQL
Target Server Version : 50522
File Encoding : 65001
Date: 2017-04-07 00:52:53
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for competition
-- ----------------------------
DROP TABLE IF EXISTS `competition`;
CREATE TABLE `competition` (
`COMP_CD_ID_PK` bigint(20) NOT NULL,
`COMP_DS_NAME` varchar(100) NOT NULL,
`COMP_DS_URL` varchar(255) DEFAULT NULL,
`FLAG_CD_ID_FK` bigint(20) NOT NULL,
`COUN_CD_ID_FK` bigint(20) NOT NULL,
PRIMARY KEY (`COMP_CD_ID_PK`),
KEY `FLAG_CD_ID_FK` (`FLAG_CD_ID_FK`),
KEY `FKqa5skmjjre6g9r73axwoe4l8p` (`COUN_CD_ID_FK`),
CONSTRAINT `FKkb261to0pyyny1t0xeenvgy22` FOREIGN KEY (`FLAG_CD_ID_FK`) REFERENCES `flag` (`FLAG_CD_ID_PK`),
CONSTRAINT `FKqa5skmjjre6g9r73axwoe4l8p` FOREIGN KEY (`COUN_CD_ID_FK`) REFERENCES `country` (`COUN_CD_ID_PK`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of competition
-- ----------------------------
INSERT INTO `competition` VALUES ('1', 'Holanda - Eredivisie', '', '19', '13');
INSERT INTO `competition` VALUES ('5', 'Holanda - Eerste Divisie', '', '20', '13');
INSERT INTO `competition` VALUES ('7', 'Espanha - Primera División', '', '12', '9');
INSERT INTO `competition` VALUES ('8', 'Inglaterra - Championship', '', '22', '15');
INSERT INTO `competition` VALUES ('9', 'Alemanha - 2. Bundesliga', '', '1', '1');
INSERT INTO `competition` VALUES ('11', 'Alemanha - Bundesliga', '', '2', '1');
INSERT INTO `competition` VALUES ('12', 'Espanha - Segunda División', '', '13', '9');
INSERT INTO `competition` VALUES ('13', 'Itália - Série A', '', '26', '17');
INSERT INTO `competition` VALUES ('14', 'Itália - Série B', '', '27', '17');
INSERT INTO `competition` VALUES ('15', 'Inglaterra - Premier League', '', '24', '15');
INSERT INTO `competition` VALUES ('16', 'França - Ligue 1', '', '15', '11');
INSERT INTO `competition` VALUES ('17', 'França - Ligue 2', '', '16', '11');
INSERT INTO `competition` VALUES ('19', 'Turquia - Super Liga', '', '39', '26');
INSERT INTO `competition` VALUES ('24', 'Bélgica - Pro League', '', '7', '4');
INSERT INTO `competition` VALUES ('26', 'Brasil - Série A', '', '5', '3');
INSERT INTO `competition` VALUES ('27', 'Suíça - Super League', '', '38', '25');
INSERT INTO `competition` VALUES ('28', 'Suécia - Allsvenskan', '', '37', '24');
INSERT INTO `competition` VALUES ('29', 'Noruega - Eliteserien', '', '30', '19');
INSERT INTO `competition` VALUES ('30', 'Dinamarca - Super Liga', '', '10', '7');
INSERT INTO `competition` VALUES ('33', 'Estados Unidos da América - MLS', '', '14', '10');
INSERT INTO `competition` VALUES ('34', 'Irlanda - Premier Division', '', '25', '16');
INSERT INTO `competition` VALUES ('43', 'Escócia - Premiership', '', '11', '8');
INSERT INTO `competition` VALUES ('51', 'China - CSL Super Liga', '', '8', '5');
INSERT INTO `competition` VALUES ('59', 'Bulgária - A PFG', '', '41', '28');
INSERT INTO `competition` VALUES ('61', 'Croácia - 1. HNL Primeira Liga', '', '42', '29');
INSERT INTO `competition` VALUES ('63', 'Portugal - Primeira Liga', '', '32', '21');
INSERT INTO `competition` VALUES ('67', 'Hungria - NB I', '', '21', '14');
INSERT INTO `competition` VALUES ('70', 'Inglaterra - League One', '', '23', '15');
INSERT INTO `competition` VALUES ('82', 'República Checa - Czech Liga', '', '34', '22');
INSERT INTO `competition` VALUES ('87', 'Argentina - Prim B Nacional', '', '3', '2');
INSERT INTO `competition` VALUES ('88', 'Argentina - Primera División', '', '4', '2');
INSERT INTO `competition` VALUES ('89', 'Brasil - Série B', '', '6', '3');
INSERT INTO `competition` VALUES ('100', 'Portugal - Segunda Liga', '', '33', '21');
INSERT INTO `competition` VALUES ('107', 'Grécia - Football League', '', '17', '12');
INSERT INTO `competition` VALUES ('108', 'Grécia - Super League', '', '18', '12');
INSERT INTO `competition` VALUES ('109', 'Japão - J1 League', '', '28', '18');
INSERT INTO `competition` VALUES ('110', 'Japão - J2 League', '', '29', '18');
INSERT INTO `competition` VALUES ('119', 'Polónia - Ekstraklasa', '', '31', '20');
INSERT INTO `competition` VALUES ('121', 'Rússia - FNL', '', '35', '23');
INSERT INTO `competition` VALUES ('122', 'Rússia - Premier League', '', '36', '23');
INSERT INTO `competition` VALUES ('125', 'Ucrânia - Premier League', '', '40', '27');
INSERT INTO `competition` VALUES ('136', 'Coreia do Sul - Primeira Liga', '', '9', '6');
INSERT INTO `competition` VALUES ('155', 'México - Liga MX', '', '43', '30');
-- ----------------------------
-- Table structure for country
-- ----------------------------
DROP TABLE IF EXISTS `country`;
CREATE TABLE `country` (
`COUN_CD_ID_PK` bigint(20) NOT NULL AUTO_INCREMENT,
`COUN_DS_NAME` varchar(100) NOT NULL,
PRIMARY KEY (`COUN_CD_ID_PK`),
KEY `FLAG_CD_ID_FK` (`COUN_CD_ID_PK`)
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of country
-- ----------------------------
INSERT INTO `country` VALUES ('1', 'Alemanha');
INSERT INTO `country` VALUES ('2', 'Argentina');
INSERT INTO `country` VALUES ('3', 'Brasil');
INSERT INTO `country` VALUES ('4', 'Bélgica');
INSERT INTO `country` VALUES ('5', 'China');
INSERT INTO `country` VALUES ('6', 'Coreia do Sul');
INSERT INTO `country` VALUES ('7', 'Dinamarca');
INSERT INTO `country` VALUES ('8', 'Escócia');
INSERT INTO `country` VALUES ('9', 'Espanha');
INSERT INTO `country` VALUES ('10', 'Estados Unidos da América');
INSERT INTO `country` VALUES ('11', 'França');
INSERT INTO `country` VALUES ('12', 'Grécia');
INSERT INTO `country` VALUES ('13', 'Holanda');
INSERT INTO `country` VALUES ('14', 'Hungria');
INSERT INTO `country` VALUES ('15', 'Inglaterra');
INSERT INTO `country` VALUES ('16', 'Irlanda');
INSERT INTO `country` VALUES ('17', 'Itália');
INSERT INTO `country` VALUES ('18', 'Japão');
INSERT INTO `country` VALUES ('19', 'Noruega');
INSERT INTO `country` VALUES ('20', 'Polónia');
INSERT INTO `country` VALUES ('21', 'Portugal');
INSERT INTO `country` VALUES ('22', 'República Checa');
INSERT INTO `country` VALUES ('23', 'Rússia');
INSERT INTO `country` VALUES ('24', 'Suécia');
INSERT INTO `country` VALUES ('25', 'Suíça');
INSERT INTO `country` VALUES ('26', 'Turquia');
INSERT INTO `country` VALUES ('27', 'Ucrânia');
INSERT INTO `country` VALUES ('28', 'Bulgária');
INSERT INTO `country` VALUES ('29', 'Croácia');
INSERT INTO `country` VALUES ('30', 'México');
-- ----------------------------
-- Table structure for flag
-- ----------------------------
DROP TABLE IF EXISTS `flag`;
CREATE TABLE `flag` (
`FLAG_CD_ID_PK` bigint(20) NOT NULL AUTO_INCREMENT,
`FLAG_DS_NAME` varchar(255) DEFAULT NULL,
`FLAG_DS_URL` varchar(255) DEFAULT NULL,
PRIMARY KEY (`FLAG_CD_ID_PK`)
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of flag
-- ----------------------------
INSERT INTO `flag` VALUES ('1', 'Alemanha - 2. Bundesliga.gif', '/resources/images/flags/174.gif');
INSERT INTO `flag` VALUES ('2', 'Alemanha - Bundesliga.gif', '/resources/images/flags/175.gif');
INSERT INTO `flag` VALUES ('3', 'Argentina - Primeira B Nacional.gif', '/resources/images/flags/176.gif');
INSERT INTO `flag` VALUES ('4', 'Argentina - Primeira Divisão.gif', '/resources/images/flags/177.gif');
INSERT INTO `flag` VALUES ('5', 'Brasil - Série A.gif', '/resources/images/flags/178.gif');
INSERT INTO `flag` VALUES ('6', 'Brasil - Série B.gif', '/resources/images/flags/179.gif');
INSERT INTO `flag` VALUES ('7', 'Bélgica - Primeira Liga.gif', '/resources/images/flags/180.gif');
INSERT INTO `flag` VALUES ('8', 'China - CSL Super Liga.gif', '/resources/images/flags/181.gif');
INSERT INTO `flag` VALUES ('9', 'Coreia do Sul - Primeira Liga.gif', '/resources/images/flags/183.gif');
INSERT INTO `flag` VALUES ('10', 'Dinamarca - Super Liga.gif', '/resources/images/flags/184.gif');
INSERT INTO `flag` VALUES ('11', 'Escócia - Primeira Liga.gif', '/resources/images/flags/185.gif');
INSERT INTO `flag` VALUES ('12', 'Espanha - Primeira Divisão.gif', '/resources/images/flags/186.gif');
INSERT INTO `flag` VALUES ('13', 'Espanha - Segunda Divisão.gif', '/resources/images/flags/187.gif');
INSERT INTO `flag` VALUES ('14', 'Estados Unidos da América - MLS.gif', '/resources/images/flags/188.gif');
INSERT INTO `flag` VALUES ('15', 'França - Ligue 1.gif', '/resources/images/flags/189.gif');
INSERT INTO `flag` VALUES ('16', 'França - Ligue 2.gif', '/resources/images/flags/190.gif');
INSERT INTO `flag` VALUES ('17', 'Grécia - Segunda Liga.gif', '/resources/images/flags/191.gif');
INSERT INTO `flag` VALUES ('18', 'Grécia - Super Liga.gif', '/resources/images/flags/192.gif');
INSERT INTO `flag` VALUES ('19', 'Holanda - Eredivisie.gif', '/resources/images/flags/193.gif');
INSERT INTO `flag` VALUES ('20', 'Holanda - Segunda Liga.gif', '/resources/images/flags/194.gif');
INSERT INTO `flag` VALUES ('21', 'Hungria - NB I Primeira Liga.gif', '/resources/images/flags/195.gif');
INSERT INTO `flag` VALUES ('22', 'Inglaterra - 2. Championship.gif', '/resources/images/flags/196.gif');
INSERT INTO `flag` VALUES ('23', 'Inglaterra - 3. League One.gif', '/resources/images/flags/197.gif');
INSERT INTO `flag` VALUES ('24', 'Inglaterra - Premier League.gif', '/resources/images/flags/198.gif');
INSERT INTO `flag` VALUES ('25', 'Irlanda - Primeira Divisão.gif', '/resources/images/flags/199.gif');
INSERT INTO `flag` VALUES ('26', 'Itália - Série A.gif', '/resources/images/flags/200.gif');
INSERT INTO `flag` VALUES ('27', 'Itália - Série B.gif', '/resources/images/flags/201.gif');
INSERT INTO `flag` VALUES ('28', 'Japão - J1 Primeira Liga.gif', '/resources/images/flags/202.gif');
INSERT INTO `flag` VALUES ('29', 'Japão - J2 Segunda Liga.gif', '/resources/images/flags/203.gif');
INSERT INTO `flag` VALUES ('30', 'Noruega - Primeira Liga.gif', '/resources/images/flags/204.gif');
INSERT INTO `flag` VALUES ('31', 'Polónia - Primeira Liga.gif', '/resources/images/flags/205.gif');
INSERT INTO `flag` VALUES ('32', 'Portugal - Primeira Liga.gif', '/resources/images/flags/206.gif');
INSERT INTO `flag` VALUES ('33', 'Portugal - Segunda Liga.gif', '/resources/images/flags/207.gif');
INSERT INTO `flag` VALUES ('34', 'República Checa - Primeira Liga.gif', '/resources/images/flags/208.gif');
INSERT INTO `flag` VALUES ('35', 'Rússia - FNL Segunda Liga.gif', '/resources/images/flags/210.gif');
INSERT INTO `flag` VALUES ('36', 'Rússia - Primeira Liga.gif', '/resources/images/flags/211.gif');
INSERT INTO `flag` VALUES ('37', 'Suécia - Primeira Liga.gif', '/resources/images/flags/212.gif');
INSERT INTO `flag` VALUES ('38', 'Suíça - Super Liga.gif', '/resources/images/flags/213.gif');
INSERT INTO `flag` VALUES ('39', 'Turquia - Super Liga.gif', '/resources/images/flags/214.gif');
INSERT INTO `flag` VALUES ('40', 'Ucrânia - Primeira Liga.gif', '/resources/images/flags/215.gif');
INSERT INTO `flag` VALUES ('41', 'Bulgária - A PFG Primeira Liga.gif', '/resources/images/flags/218.gif');
INSERT INTO `flag` VALUES ('42', 'Croácia - 1. HNL Primeira Liga.gif', '/resources/images/flags/220.gif');
INSERT INTO `flag` VALUES ('43', 'México - Primeira Liga.gif', '/resources/images/flags/129.gif');
-- ----------------------------
-- Table structure for goal_type
-- ----------------------------
DROP TABLE IF EXISTS `goal_type`;
CREATE TABLE `goal_type` (
`goty_cd_id_pk` bigint(20) NOT NULL AUTO_INCREMENT,
`goty_ds_name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`goty_cd_id_pk`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of goal_type
-- ----------------------------
INSERT INTO `goal_type` VALUES ('1', 'SCORED');
INSERT INTO `goal_type` VALUES ('2', 'CONCEDED');
-- ----------------------------
-- Table structure for market_bet
-- ----------------------------
DROP TABLE IF EXISTS `market_bet`;
CREATE TABLE `market_bet` (
`MABE_CD_ID_PK` bigint(20) NOT NULL AUTO_INCREMENT,
`MABE_DS_NAME` varchar(255) DEFAULT NULL,
PRIMARY KEY (`MABE_CD_ID_PK`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of market_bet
-- ----------------------------
INSERT INTO `market_bet` VALUES ('1', 'Fulltime Result');
INSERT INTO `market_bet` VALUES ('2', 'Gols');
INSERT INTO `market_bet` VALUES ('3', 'Double Chance');
-- ----------------------------
-- Table structure for selection_market_bet
-- ----------------------------
DROP TABLE IF EXISTS `selection_market_bet`;
CREATE TABLE `selection_market_bet` (
`SEMB_CD_ID_PK` bigint(20) NOT NULL AUTO_INCREMENT,
`SEMB_DS_NAME` varchar(255) DEFAULT NULL,
`MABE_CD_ID_FK` bigint(20) NOT NULL,
PRIMARY KEY (`SEMB_CD_ID_PK`),
KEY `FKhia181560p6uelanglivwg4w8` (`MABE_CD_ID_FK`),
CONSTRAINT `FKhia181560p6uelanglivwg4w8` FOREIGN KEY (`MABE_CD_ID_FK`) REFERENCES `market_bet` (`MABE_CD_ID_PK`),
CONSTRAINT `MABE_CD_ID_FK_SEMB` FOREIGN KEY (`MABE_CD_ID_FK`) REFERENCES `market_bet` (`MABE_CD_ID_PK`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of selection_market_bet
-- ----------------------------
INSERT INTO `selection_market_bet` VALUES ('1', 'Home Team', '1');
INSERT INTO `selection_market_bet` VALUES ('2', 'Draw', '1');
INSERT INTO `selection_market_bet` VALUES ('3', 'Away Team', '1');
INSERT INTO `selection_market_bet` VALUES ('5', 'Over 0.5', '3');
INSERT INTO `selection_market_bet` VALUES ('6', 'Under 0.5', '3');
INSERT INTO `selection_market_bet` VALUES ('7', 'Over 1.5', '3');
INSERT INTO `selection_market_bet` VALUES ('8', 'Under 1.5', '3');
INSERT INTO `selection_market_bet` VALUES ('9', 'Over 2.5', '3');
INSERT INTO `selection_market_bet` VALUES ('10', 'Under 2.5', '3');
INSERT INTO `selection_market_bet` VALUES ('11', 'Over 3.5', '3');
INSERT INTO `selection_market_bet` VALUES ('12', 'Under 3.5', '3');
INSERT INTO `selection_market_bet` VALUES ('13', 'Over 4.5', '3');
INSERT INTO `selection_market_bet` VALUES ('14', 'Under 4.5', '3');
INSERT INTO `selection_market_bet` VALUES ('15', 'Over 5.5', '3');
INSERT INTO `selection_market_bet` VALUES ('16', 'Under 5.5', '3');
INSERT INTO `selection_market_bet` VALUES ('17', 'Over 6.5', '3');
INSERT INTO `selection_market_bet` VALUES ('18', 'Under 6.5', '3');
INSERT INTO `selection_market_bet` VALUES ('19', 'Over 7.5', '3');
INSERT INTO `selection_market_bet` VALUES ('20', 'Under 7.5', '3');
INSERT INTO `selection_market_bet` VALUES ('21', 'Home Team or Draw', '2');
INSERT INTO `selection_market_bet` VALUES ('22', 'Home Team or Away Team', '2');
INSERT INTO `selection_market_bet` VALUES ('23', 'Away Team or Draw', '2');
-- ----------------------------
-- Table structure for team
-- ----------------------------
DROP TABLE IF EXISTS `team`;
CREATE TABLE `team` (
`TEAM_CD_ID_PK` bigint(20) NOT NULL,
`TEAM_DS_NAME` varchar(255) DEFAULT NULL,
`COUN_CD_ID_FK` bigint(20) NOT NULL,
PRIMARY KEY (`TEAM_CD_ID_PK`),
KEY `FK1qeh9cs0d2jx3h5w5i39m636y` (`COUN_CD_ID_FK`),
CONSTRAINT `COUN_CD_ID_FK_TEAM` FOREIGN KEY (`COUN_CD_ID_FK`) REFERENCES `country` (`COUN_CD_ID_PK`),
CONSTRAINT `FK1qeh9cs0d2jx3h5w5i39m636y` FOREIGN KEY (`COUN_CD_ID_FK`) REFERENCES `country` (`COUN_CD_ID_PK`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of team
-- ----------------------------
INSERT INTO `team` VALUES ('92', 'Arsenal', '2');
INSERT INTO `team` VALUES ('93', 'Rafaela', '2');
INSERT INTO `team` VALUES ('94', 'Banfield', '2');
INSERT INTO `team` VALUES ('95', 'Boca', '2');
INSERT INTO `team` VALUES ('96', 'Chacarita', '2');
INSERT INTO `team` VALUES ('97', 'Colón', '2');
INSERT INTO `team` VALUES ('98', 'Estudiantes', '2');
INSERT INTO `team` VALUES ('99', 'Gimn La Plata', '2');
INSERT INTO `team` VALUES ('100', 'Independiente', '2');
INSERT INTO `team` VALUES ('101', 'Lanús', '2');
INSERT INTO `team` VALUES ('102', 'NOB', '2');
INSERT INTO `team` VALUES ('103', 'Nueva Chicago', '2');
INSERT INTO `team` VALUES ('104', 'Olimpo', '2');
INSERT INTO `team` VALUES ('105', 'Quilmes', '2');
INSERT INTO `team` VALUES ('106', 'Racing', '2');
INSERT INTO `team` VALUES ('107', 'River Plate', '2');
INSERT INTO `team` VALUES ('108', 'Rosario', '2');
INSERT INTO `team` VALUES ('109', 'San Lorenzo', '2');
INSERT INTO `team` VALUES ('110', 'Talleres', '2');
INSERT INTO `team` VALUES ('111', 'Vélez', '2');
INSERT INTO `team` VALUES ('112', 'Almagro', '2');
INSERT INTO `team` VALUES ('113', 'Arg Juniors', '2');
INSERT INTO `team` VALUES ('114', 'Belgrano', '2');
INSERT INTO `team` VALUES ('117', 'Def y Justicia', '2');
INSERT INTO `team` VALUES ('119', 'Ferro', '2');
INSERT INTO `team` VALUES ('121', 'Gimnasia', '2');
INSERT INTO `team` VALUES ('122', 'Godoy Cruz', '2');
INSERT INTO `team` VALUES ('123', 'Huracán', '2');
INSERT INTO `team` VALUES ('127', 'Los Andes', '2');
INSERT INTO `team` VALUES ('129', 'San Martín SJ', '2');
INSERT INTO `team` VALUES ('131', 'Santa Fe', '2');
INSERT INTO `team` VALUES ('214', 'Gent', '4');
INSERT INTO `team` VALUES ('215', 'Anderlecht', '4');
INSERT INTO `team` VALUES ('218', 'Charleroi', '4');
INSERT INTO `team` VALUES ('219', 'Club Brugge', '4');
INSERT INTO `team` VALUES ('227', 'Oostende', '4');
INSERT INTO `team` VALUES ('236', 'ZW', '4');
INSERT INTO `team` VALUES ('301', 'Ponte Preta', '3');
INSERT INTO `team` VALUES ('302', 'São Paulo', '3');
INSERT INTO `team` VALUES ('303', 'Figueirense', '3');
INSERT INTO `team` VALUES ('304', 'Cruzeiro', '3');
INSERT INTO `team` VALUES ('305', 'Criciúma', '3');
INSERT INTO `team` VALUES ('306', 'Vitória', '3');
INSERT INTO `team` VALUES ('307', 'Goiás', '3');
INSERT INTO `team` VALUES ('308', 'Internacional', '3');
INSERT INTO `team` VALUES ('309', 'Paraná', '3');
INSERT INTO `team` VALUES ('310', 'Palmeiras', '3');
INSERT INTO `team` VALUES ('312', 'Fluminense', '3');
INSERT INTO `team` VALUES ('313', 'Grêmio', '3');
INSERT INTO `team` VALUES ('314', 'Juventude', '3');
INSERT INTO `team` VALUES ('315', 'Atlético-PR', '3');
INSERT INTO `team` VALUES ('316', 'Guarani', '3');
INSERT INTO `team` VALUES ('317', 'Atlético MG', '3');
INSERT INTO `team` VALUES ('318', 'Flamengo', '3');
INSERT INTO `team` VALUES ('319', 'Santos', '3');
INSERT INTO `team` VALUES ('320', 'Corinthians', '3');
INSERT INTO `team` VALUES ('321', 'Vasco', '3');
INSERT INTO `team` VALUES ('322', 'Paysandu', '3');
INSERT INTO `team` VALUES ('323', 'Botafogo', '3');
INSERT INTO `team` VALUES ('324', 'Coritiba', '3');
INSERT INTO `team` VALUES ('325', 'Santa Cruz', '3');
INSERT INTO `team` VALUES ('326', 'Náutico', '3');
INSERT INTO `team` VALUES ('329', 'Vila Nova', '3');
INSERT INTO `team` VALUES ('330', 'Avaí', '3');
INSERT INTO `team` VALUES ('333', 'Ceará', '3');
INSERT INTO `team` VALUES ('337', 'América MG', '3');
INSERT INTO `team` VALUES ('338', 'Sport', '3');
INSERT INTO `team` VALUES ('341', 'Bahia', '3');
INSERT INTO `team` VALUES ('344', 'CRB', '3');
INSERT INTO `team` VALUES ('346', 'Londrina', '3');
INSERT INTO `team` VALUES ('352', 'Lok Plovdiv', '28');
INSERT INTO `team` VALUES ('353', 'Levski', '28');
INSERT INTO `team` VALUES ('354', 'CSKA Sofia', '28');
INSERT INTO `team` VALUES ('356', 'Slavia Sofia', '28');
INSERT INTO `team` VALUES ('360', 'Cherno More', '28');
INSERT INTO `team` VALUES ('368', 'Beroe', '28');
INSERT INTO `team` VALUES ('369', 'Pirin', '28');
INSERT INTO `team` VALUES ('425', 'Guangzhou R&F', '5');
INSERT INTO `team` VALUES ('429', 'Guoan', '5');
INSERT INTO `team` VALUES ('431', 'Tianjin', '5');
INSERT INTO `team` VALUES ('432', 'Lifan', '5');
INSERT INTO `team` VALUES ('433', 'Shenhua', '5');
INSERT INTO `team` VALUES ('434', 'Shandong', '5');
INSERT INTO `team` VALUES ('437', 'Changchun', '5');
INSERT INTO `team` VALUES ('441', 'Jiangsu', '5');
INSERT INTO `team` VALUES ('442', 'Henan Jianye', '5');
INSERT INTO `team` VALUES ('478', 'Hajduk Split', '29');
INSERT INTO `team` VALUES ('479', 'Dinamo Zagreb', '29');
INSERT INTO `team` VALUES ('480', 'Rijeka', '29');
INSERT INTO `team` VALUES ('481', 'Osijek', '29');
INSERT INTO `team` VALUES ('485', 'Int Zapresic', '29');
INSERT INTO `team` VALUES ('486', 'Slaven', '29');
INSERT INTO `team` VALUES ('487', 'Cibalia', '29');
INSERT INTO `team` VALUES ('532', 'Sparta Praga', '22');
INSERT INTO `team` VALUES ('533', 'Slavia Praga', '22');
INSERT INTO `team` VALUES ('536', 'Zlín', '22');
INSERT INTO `team` VALUES ('537', 'Slov Liberec', '22');
INSERT INTO `team` VALUES ('539', 'Teplice', '22');
INSERT INTO `team` VALUES ('540', 'Jablonec', '22');
INSERT INTO `team` VALUES ('541', 'Příbram', '22');
INSERT INTO `team` VALUES ('543', 'FCZ Brno', '22');
INSERT INTO `team` VALUES ('546', 'Viktoria Plzeň', '22');
INSERT INTO `team` VALUES ('548', 'Mladá Boleslav', '22');
INSERT INTO `team` VALUES ('550', 'Bohemians \'05', '22');
INSERT INTO `team` VALUES ('552', 'Vysočina', '22');
INSERT INTO `team` VALUES ('556', 'Králové', '22');
INSERT INTO `team` VALUES ('599', 'Esbjerg', '7');
INSERT INTO `team` VALUES ('600', 'Copenhaga', '7');
INSERT INTO `team` VALUES ('601', 'Brondby', '7');
INSERT INTO `team` VALUES ('602', 'AaB', '7');
INSERT INTO `team` VALUES ('603', 'Midtjylland', '7');
INSERT INTO `team` VALUES ('604', 'Viborg', '7');
INSERT INTO `team` VALUES ('605', 'Aarhus', '7');
INSERT INTO `team` VALUES ('606', 'Nordsjælland', '7');
INSERT INTO `team` VALUES ('608', 'Odense', '7');
INSERT INTO `team` VALUES ('609', 'Silkeborg', '7');
INSERT INTO `team` VALUES ('610', 'Randers', '7');
INSERT INTO `team` VALUES ('613', 'Horsens', '7');
INSERT INTO `team` VALUES ('635', 'Lyngby', '7');
INSERT INTO `team` VALUES ('660', 'Arsenal', '15');
INSERT INTO `team` VALUES ('661', 'Chelsea', '15');
INSERT INTO `team` VALUES ('662', 'Man Utd', '15');
INSERT INTO `team` VALUES ('663', 'Liverpool', '15');
INSERT INTO `team` VALUES ('664', 'Newcastle', '15');
INSERT INTO `team` VALUES ('665', 'Aston Villa', '15');
INSERT INTO `team` VALUES ('666', 'Bolton', '15');
INSERT INTO `team` VALUES ('667', 'Fulham', '15');
INSERT INTO `team` VALUES ('668', 'Charlton', '15');
INSERT INTO `team` VALUES ('669', 'Birmingham', '15');
INSERT INTO `team` VALUES ('670', 'Southampton', '15');
INSERT INTO `team` VALUES ('671', 'Middlesbrough', '15');
INSERT INTO `team` VALUES ('672', 'Blackburn', '15');
INSERT INTO `team` VALUES ('674', 'Everton', '15');
INSERT INTO `team` VALUES ('675', 'Tottenham', '15');
INSERT INTO `team` VALUES ('676', 'Man City', '15');
INSERT INTO `team` VALUES ('677', 'Norwich', '15');
INSERT INTO `team` VALUES ('678', 'West Bromwich', '15');
INSERT INTO `team` VALUES ('679', 'Crystal Palace', '15');
INSERT INTO `team` VALUES ('680', 'Wolverhampton', '15');
INSERT INTO `team` VALUES ('681', 'Leeds', '15');
INSERT INTO `team` VALUES ('682', 'Leicester', '15');
INSERT INTO `team` VALUES ('683', 'Sunderland', '15');
INSERT INTO `team` VALUES ('684', 'West Ham', '15');
INSERT INTO `team` VALUES ('685', 'Ipswich', '15');
INSERT INTO `team` VALUES ('686', 'Wigan', '15');
INSERT INTO `team` VALUES ('687', 'Sheff Utd', '15');
INSERT INTO `team` VALUES ('688', 'Reading', '15');
INSERT INTO `team` VALUES ('689', 'Millwall', '15');
INSERT INTO `team` VALUES ('690', 'Stoke', '15');
INSERT INTO `team` VALUES ('691', 'Cardiff', '15');
INSERT INTO `team` VALUES ('692', 'Coventry', '15');
INSERT INTO `team` VALUES ('693', 'Preston', '15');
INSERT INTO `team` VALUES ('694', 'Nottm Forest', '15');
INSERT INTO `team` VALUES ('695', 'Rotherham', '15');
INSERT INTO `team` VALUES ('696', 'Watford', '15');
INSERT INTO `team` VALUES ('698', 'Burnley', '15');
INSERT INTO `team` VALUES ('699', 'Derby', '15');
INSERT INTO `team` VALUES ('700', 'Gillingham', '15');
INSERT INTO `team` VALUES ('702', 'QPR', '15');
INSERT INTO `team` VALUES ('703', 'Brighton', '15');
INSERT INTO `team` VALUES ('704', 'Walsall', '15');
INSERT INTO `team` VALUES ('705', 'Bradford', '15');
INSERT INTO `team` VALUES ('706', 'MK Dons', '15');
INSERT INTO `team` VALUES ('707', 'Bristol City', '15');
INSERT INTO `team` VALUES ('708', 'Swindon', '15');
INSERT INTO `team` VALUES ('710', 'Port Vale', '15');
INSERT INTO `team` VALUES ('711', 'Bournemouth', '15');
INSERT INTO `team` VALUES ('716', 'Barnsley', '15');
INSERT INTO `team` VALUES ('718', 'Oldham', '15');
INSERT INTO `team` VALUES ('719', 'Sheff Wed', '15');
INSERT INTO `team` VALUES ('721', 'Peterborough', '15');
INSERT INTO `team` VALUES ('722', 'Brentford', '15');
INSERT INTO `team` VALUES ('723', 'Chesterfield', '15');
INSERT INTO `team` VALUES ('725', 'Hull', '15');
INSERT INTO `team` VALUES ('726', 'Huddersfield', '15');
INSERT INTO `team` VALUES ('734', 'Northampton', '15');
INSERT INTO `team` VALUES ('736', 'Oxford', '15');
INSERT INTO `team` VALUES ('738', 'Swansea', '15');
INSERT INTO `team` VALUES ('739', 'Bristol Rovers', '15');
INSERT INTO `team` VALUES ('741', 'Southend', '15');
INSERT INTO `team` VALUES ('742', 'Bury', '15');
INSERT INTO `team` VALUES ('747', 'Rochdale', '15');
INSERT INTO `team` VALUES ('749', 'Scunthorpe', '15');
INSERT INTO `team` VALUES ('751', 'Shrewsbury', '15');
INSERT INTO `team` VALUES ('764', 'Burton Albion', '15');
INSERT INTO `team` VALUES ('884', 'Lyon', '11');
INSERT INTO `team` VALUES ('885', 'Mónaco', '11');
INSERT INTO `team` VALUES ('886', 'PSG', '11');
INSERT INTO `team` VALUES ('887', 'Sochaux', '11');
INSERT INTO `team` VALUES ('888', 'Auxerre', '11');
INSERT INTO `team` VALUES ('889', 'Nantes', '11');
INSERT INTO `team` VALUES ('890', 'Marselha', '11');
INSERT INTO `team` VALUES ('891', 'Bordeaux', '11');
INSERT INTO `team` VALUES ('892', 'Lens', '11');
INSERT INTO `team` VALUES ('893', 'Rennes', '11');
INSERT INTO `team` VALUES ('894', 'Nice', '11');
INSERT INTO `team` VALUES ('895', 'Lille', '11');
INSERT INTO `team` VALUES ('896', 'Metz', '11');
INSERT INTO `team` VALUES ('897', 'Bastia', '11');
INSERT INTO `team` VALUES ('898', 'Strasbourg', '11');
INSERT INTO `team` VALUES ('899', 'Toulouse', '11');
INSERT INTO `team` VALUES ('900', 'Ajaccio', '11');
INSERT INTO `team` VALUES ('901', 'Saint-Étienne', '11');
INSERT INTO `team` VALUES ('902', 'Caen', '11');
INSERT INTO `team` VALUES ('904', 'Guingamp', '11');
INSERT INTO `team` VALUES ('906', 'Montpellier', '11');
INSERT INTO `team` VALUES ('907', 'Lorient', '11');
INSERT INTO `team` VALUES ('908', 'Amiens', '11');
INSERT INTO `team` VALUES ('909', 'Niort', '11');
INSERT INTO `team` VALUES ('911', 'Nancy', '11');
INSERT INTO `team` VALUES ('912', 'Le Havre', '11');
INSERT INTO `team` VALUES ('914', 'Troyes', '11');
INSERT INTO `team` VALUES ('916', 'Clermont Foot', '11');
INSERT INTO `team` VALUES ('918', 'Angers', '11');
INSERT INTO `team` VALUES ('920', 'Stade Lavall', '11');
INSERT INTO `team` VALUES ('921', 'Stade Reims', '11');
INSERT INTO `team` VALUES ('922', 'Stade Brest', '11');
INSERT INTO `team` VALUES ('923', 'Dijon', '11');
INSERT INTO `team` VALUES ('931', 'GFC Ajaccio', '11');
INSERT INTO `team` VALUES ('932', 'Nîmes', '11');
INSERT INTO `team` VALUES ('933', 'Valenciennes', '11');
INSERT INTO `team` VALUES ('935', 'Tours', '11');
INSERT INTO `team` VALUES ('943', 'Bourg', '11');
INSERT INTO `team` VALUES ('960', 'Bremen', '1');
INSERT INTO `team` VALUES ('961', 'Bayern Munique', '1');
INSERT INTO `team` VALUES ('962', 'Stuttgart', '1');
INSERT INTO `team` VALUES ('963', 'Leverkusen', '1');
INSERT INTO `team` VALUES ('964', 'Dortmund', '1');
INSERT INTO `team` VALUES ('965', 'Bochum', '1');
INSERT INTO `team` VALUES ('966', 'Schalke 04', '1');
INSERT INTO `team` VALUES ('967', 'Hamburgo', '1');
INSERT INTO `team` VALUES ('968', 'Wolfsburg', '1');
INSERT INTO `team` VALUES ('970', 'Freiburg', '1');
INSERT INTO `team` VALUES ('971', 'M\'gladbach', '1');
INSERT INTO `team` VALUES ('972', 'Hannover', '1');
INSERT INTO `team` VALUES ('973', 'Kaiserslautern', '1');
INSERT INTO `team` VALUES ('974', 'Hertha', '1');
INSERT INTO `team` VALUES ('975', 'Nuremberga', '1');
INSERT INTO `team` VALUES ('976', 'Bielefeld', '1');
INSERT INTO `team` VALUES ('977', 'Mainz 05', '1');
INSERT INTO `team` VALUES ('978', '1860 Munique', '1');
INSERT INTO `team` VALUES ('979', 'Frankfurt', '1');
INSERT INTO `team` VALUES ('980', 'Colonia', '1');
INSERT INTO `team` VALUES ('985', 'Aue', '1');
INSERT INTO `team` VALUES ('986', 'Greuther Fürth', '1');
INSERT INTO `team` VALUES ('989', 'Karlsruhe', '1');
INSERT INTO `team` VALUES ('995', 'Dresden', '1');
INSERT INTO `team` VALUES ('1000', 'Augsburg', '1');
INSERT INTO `team` VALUES ('1001', 'Hoffenheim', '1');
INSERT INTO `team` VALUES ('1015', 'Braunschweig', '1');
INSERT INTO `team` VALUES ('1018', 'St. Pauli', '1');
INSERT INTO `team` VALUES ('1026', 'Union Berlin', '1');
INSERT INTO `team` VALUES ('1029', 'Düsseldorf', '1');
INSERT INTO `team` VALUES ('1039', 'Panathinaikos', '12');
INSERT INTO `team` VALUES ('1040', 'Olympiakos', '12');
INSERT INTO `team` VALUES ('1041', 'PAOK', '12');
INSERT INTO `team` VALUES ('1042', 'AEK Atenas', '12');
INSERT INTO `team` VALUES ('1044', 'Panionios', '12');
INSERT INTO `team` VALUES ('1046', 'Iraklis', '12');
INSERT INTO `team` VALUES ('1047', 'Xanthi', '12');
INSERT INTO `team` VALUES ('1048', 'OFI Creta', '12');
INSERT INTO `team` VALUES ('1050', 'Kallithea', '12');
INSERT INTO `team` VALUES ('1051', 'Aris Salónica', '12');
INSERT INTO `team` VALUES ('1055', 'Kerkyra', '12');
INSERT INTO `team` VALUES ('1062', 'Levadiakos', '12');
INSERT INTO `team` VALUES ('1063', 'Apollon', '12');
INSERT INTO `team` VALUES ('1065', 'Panserraikos', '12');
INSERT INTO `team` VALUES ('1067', 'Atromitos', '12');
INSERT INTO `team` VALUES ('1068', 'Giannina', '12');
INSERT INTO `team` VALUES ('1071', 'Larissa', '12');
INSERT INTO `team` VALUES ('1081', 'Veria', '12');
INSERT INTO `team` VALUES ('1084', 'Agrotikos', '12');
INSERT INTO `team` VALUES ('1101', 'Ferencvaros', '14');
INSERT INTO `team` VALUES ('1103', 'Debrecen', '14');
INSERT INTO `team` VALUES ('1104', 'MTK Budapeste', '14');
INSERT INTO `team` VALUES ('1105', 'Újpest', '14');
INSERT INTO `team` VALUES ('1112', 'Szombathelyi', '14');
INSERT INTO `team` VALUES ('1113', 'Honved', '14');
INSERT INTO `team` VALUES ('1115', 'Vasas', '14');
INSERT INTO `team` VALUES ('1116', 'DVTK', '14');
INSERT INTO `team` VALUES ('1182', 'Drogheda', '16');
INSERT INTO `team` VALUES ('1184', 'Shamrock', '16');
INSERT INTO `team` VALUES ('1185', 'Cork', '16');
INSERT INTO `team` VALUES ('1186', 'Bohemians', '16');
INSERT INTO `team` VALUES ('1187', 'Derry', '16');
INSERT INTO `team` VALUES ('1188', 'St Patrick\'s', '16');
INSERT INTO `team` VALUES ('1192', 'Bray', '16');
INSERT INTO `team` VALUES ('1193', 'Sligo', '16');
INSERT INTO `team` VALUES ('1194', 'Finn Harps', '16');
INSERT INTO `team` VALUES ('1196', 'Dundalk', '16');
INSERT INTO `team` VALUES ('1240', 'Milan', '17');
INSERT INTO `team` VALUES ('1241', 'Roma', '17');
INSERT INTO `team` VALUES ('1242', 'Juventus', '17');
INSERT INTO `team` VALUES ('1244', 'Inter', '17');
INSERT INTO `team` VALUES ('1245', 'Lazio', '17');
INSERT INTO `team` VALUES ('1246', 'Udinese', '17');
INSERT INTO `team` VALUES ('1247', 'Sampdoria', '17');
INSERT INTO `team` VALUES ('1248', 'Chievo', '17');
INSERT INTO `team` VALUES ('1249', 'Bologna', '17');
INSERT INTO `team` VALUES ('1250', 'Brescia', '17');
INSERT INTO `team` VALUES ('1254', 'Palermo', '17');
INSERT INTO `team` VALUES ('1255', 'Atalanta', '17');
INSERT INTO `team` VALUES ('1256', 'Cagliari', '17');
INSERT INTO `team` VALUES ('1259', 'Fiorentina', '17');
INSERT INTO `team` VALUES ('1261', 'Empoli', '17');
INSERT INTO `team` VALUES ('1262', 'Perugia', '17');
INSERT INTO `team` VALUES ('1265', 'Ternana', '17');
INSERT INTO `team` VALUES ('1268', 'Torino', '17');
INSERT INTO `team` VALUES ('1269', 'Vicenza', '17');
INSERT INTO `team` VALUES ('1270', 'Nápoles', '17');
INSERT INTO `team` VALUES ('1271', 'Ascoli', '17');
INSERT INTO `team` VALUES ('1275', 'Salernitana', '17');
INSERT INTO `team` VALUES ('1276', 'Génova', '17');
INSERT INTO `team` VALUES ('1277', 'Verona', '17');
INSERT INTO `team` VALUES ('1279', 'Cesena', '17');
INSERT INTO `team` VALUES ('1280', 'Crotone', '17');
INSERT INTO `team` VALUES ('1282', 'Pescara', '17');
INSERT INTO `team` VALUES ('1287', 'SPAL', '17');
INSERT INTO `team` VALUES ('1288', 'Spezia', '17');
INSERT INTO `team` VALUES ('1290', 'Pisa', '17');
INSERT INTO `team` VALUES ('1291', 'Cittadella', '17');
INSERT INTO `team` VALUES ('1293', 'Novara', '17');
INSERT INTO `team` VALUES ('1300', 'Avellino', '17');
INSERT INTO `team` VALUES ('1301', 'Bari 1908', '17');
INSERT INTO `team` VALUES ('1302', 'Benevento', '17');
INSERT INTO `team` VALUES ('1320', 'Júbilo', '18');
INSERT INTO `team` VALUES ('1321', 'JEF Utd', '18');
INSERT INTO `team` VALUES ('1322', 'F Marinos', '18');
INSERT INTO `team` VALUES ('1323', 'Urawa', '18');
INSERT INTO `team` VALUES ('1324', 'Kashima', '18');
INSERT INTO `team` VALUES ('1325', 'Nagoya', '18');
INSERT INTO `team` VALUES ('1326', 'Oita', '18');
INSERT INTO `team` VALUES ('1327', 'Gamba', '18');
INSERT INTO `team` VALUES ('1328', 'Vissel Kobe', '18');
INSERT INTO `team` VALUES ('1329', 'Shimizu', '18');
INSERT INTO `team` VALUES ('1330', 'Tokyo', '18');
INSERT INTO `team` VALUES ('1331', 'Kashiwa', '18');
INSERT INTO `team` VALUES ('1332', 'Tokyo Verdy', '18');
INSERT INTO `team` VALUES ('1333', 'Albirex', '18');
INSERT INTO `team` VALUES ('1334', 'Sanfrecce', '18');
INSERT INTO `team` VALUES ('1335', 'Cerezo', '18');
INSERT INTO `team` VALUES ('1336', 'Kawasaki', '18');
INSERT INTO `team` VALUES ('1337', 'Montedio', '18');
INSERT INTO `team` VALUES ('1338', 'Avispa', '18');
INSERT INTO `team` VALUES ('1339', 'Omiya', '18');
INSERT INTO `team` VALUES ('1340', 'Kyoto', '18');
INSERT INTO `team` VALUES ('1341', 'Yokohama', '18');
INSERT INTO `team` VALUES ('1342', 'Ventforet', '18');
INSERT INTO `team` VALUES ('1343', 'Sagan', '18');
INSERT INTO `team` VALUES ('1344', 'Vegalta', '18');
INSERT INTO `team` VALUES ('1345', 'Mito', '18');
INSERT INTO `team` VALUES ('1346', 'Shonan', '18');
INSERT INTO `team` VALUES ('1347', 'Consadole', '18');
INSERT INTO `team` VALUES ('1372', 'Pohang', '6');
INSERT INTO `team` VALUES ('1373', 'Daegu', '6');
INSERT INTO `team` VALUES ('1374', 'Ulsan', '6');
INSERT INTO `team` VALUES ('1376', 'Dragons', '6');
INSERT INTO `team` VALUES ('1377', 'Jeonbuk Motors', '6');
INSERT INTO `team` VALUES ('1378', 'Sangju', '6');
INSERT INTO `team` VALUES ('1380', 'Incheon Utd', '6');
INSERT INTO `team` VALUES ('1381', 'Seoul', '6');
INSERT INTO `team` VALUES ('1382', 'Suwon BWings', '6');
INSERT INTO `team` VALUES ('1458', 'América', '30');
INSERT INTO `team` VALUES ('1460', 'Atlas', '30');
INSERT INTO `team` VALUES ('1461', 'Cruz Azul', '30');
INSERT INTO `team` VALUES ('1462', 'Guadalajara', '30');
INSERT INTO `team` VALUES ('1463', 'Jaguares', '30');
INSERT INTO `team` VALUES ('1464', 'Morelia', '30');
INSERT INTO `team` VALUES ('1465', 'Necaxa', '30');
INSERT INTO `team` VALUES ('1466', 'Pachuca', '30');
INSERT INTO `team` VALUES ('1467', 'Puebla', '30');
INSERT INTO `team` VALUES ('1468', 'Santos Laguna', '30');
INSERT INTO `team` VALUES ('1469', 'Veracruz', '30');
INSERT INTO `team` VALUES ('1470', 'Tigres', '30');
INSERT INTO `team` VALUES ('1471', 'Toluca', '30');
INSERT INTO `team` VALUES ('1473', 'Pumas', '30');
INSERT INTO `team` VALUES ('1474', 'Querétaro', '30');
INSERT INTO `team` VALUES ('1477', 'León', '30');
INSERT INTO `team` VALUES ('1514', 'ADO', '13');
INSERT INTO `team` VALUES ('1515', 'Ajax', '13');
INSERT INTO `team` VALUES ('1516', 'AZ', '13');
INSERT INTO `team` VALUES ('1517', 'PSV', '13');
INSERT INTO `team` VALUES ('1518', 'Feyenoord', '13');
INSERT INTO `team` VALUES ('1519', 'Heerenveen', '13');
INSERT INTO `team` VALUES ('1520', 'Roda', '13');
INSERT INTO `team` VALUES ('1521', 'Willem B', '13');
INSERT INTO `team` VALUES ('1522', 'Twente', '13');
INSERT INTO `team` VALUES ('1523', 'Utrecht', '13');
INSERT INTO `team` VALUES ('1524', 'NAC', '13');
INSERT INTO `team` VALUES ('1526', 'Waalwijk', '13');
INSERT INTO `team` VALUES ('1527', 'Groningen', '13');
INSERT INTO `team` VALUES ('1528', 'NEC', '13');
INSERT INTO `team` VALUES ('1529', 'Zwolle', '13');
INSERT INTO `team` VALUES ('1530', 'Vitesse', '13');
INSERT INTO `team` VALUES ('1531', 'Volendam', '13');
INSERT INTO `team` VALUES ('1532', 'Excelsior', '13');
INSERT INTO `team` VALUES ('1533', 'Den Bosch', '13');
INSERT INTO `team` VALUES ('1534', 'Helmond', '13');
INSERT INTO `team` VALUES ('1535', 'Roterdão', '13');
INSERT INTO `team` VALUES ('1536', 'Heracles', '13');
INSERT INTO `team` VALUES ('1537', 'De Graafschap', '13');
INSERT INTO `team` VALUES ('1538', 'VVV', '13');
INSERT INTO `team` VALUES ('1539', 'Emmen', '13');
INSERT INTO `team` VALUES ('1540', 'Go Ahead', '13');
INSERT INTO `team` VALUES ('1542', 'Oss', '13');
INSERT INTO `team` VALUES ('1544', 'Telstar', '13');
INSERT INTO `team` VALUES ('1547', 'Cambuur', '13');
INSERT INTO `team` VALUES ('1548', 'Dordrecht', '13');
INSERT INTO `team` VALUES ('1549', 'FC Eindoven', '13');
INSERT INTO `team` VALUES ('1550', 'MVV', '13');
INSERT INTO `team` VALUES ('1551', 'Sittard', '13');
INSERT INTO `team` VALUES ('1585', 'Tromso', '19');
INSERT INTO `team` VALUES ('1586', 'Odd', '19');
INSERT INTO `team` VALUES ('1587', 'Rosenborg', '19');
INSERT INTO `team` VALUES ('1588', 'Vålerenga', '19');
INSERT INTO `team` VALUES ('1591', 'Brann', '19');
INSERT INTO `team` VALUES ('1592', 'Lillestrøm', '19');
INSERT INTO `team` VALUES ('1593', 'Stabæk', '19');
INSERT INTO `team` VALUES ('1594', 'Molde', '19');
INSERT INTO `team` VALUES ('1596', 'Viking', '19');
INSERT INTO `team` VALUES ('1597', 'Sogndal', '19');
INSERT INTO `team` VALUES ('1601', 'Sandefjord', '19');
INSERT INTO `team` VALUES ('1602', 'Aalesund', '19');
INSERT INTO `team` VALUES ('1607', 'Stromsgodset', '19');
INSERT INTO `team` VALUES ('1610', 'Haugesund', '19');
INSERT INTO `team` VALUES ('1647', 'Wisla', '20');
INSERT INTO `team` VALUES ('1648', 'Legia', '20');
INSERT INTO `team` VALUES ('1651', 'Wisła Plock', '20');
INSERT INTO `team` VALUES ('1653', 'Lech', '20');
INSERT INTO `team` VALUES ('1654', 'Górnik Leczna', '20');
INSERT INTO `team` VALUES ('1661', 'Pogoń', '20');
INSERT INTO `team` VALUES ('1663', 'Zaglebie', '20');
INSERT INTO `team` VALUES ('1664', 'Cracovia', '20');
INSERT INTO `team` VALUES ('1668', 'Ruch', '20');
INSERT INTO `team` VALUES ('1670', 'Jagiellonia', '20');
INSERT INTO `team` VALUES ('1672', 'Arka', '20');
INSERT INTO `team` VALUES ('1673', 'Piast', '20');
INSERT INTO `team` VALUES ('1678', 'Porto', '21');
INSERT INTO `team` VALUES ('1679', 'Benfica', '21');
INSERT INTO `team` VALUES ('1680', 'Sporting CP', '21');
INSERT INTO `team` VALUES ('1681', 'Nacional', '21');
INSERT INTO `team` VALUES ('1682', 'Braga', '21');
INSERT INTO `team` VALUES ('1683', 'Rio Ave', '21');
INSERT INTO `team` VALUES ('1684', 'Marítimo', '21');
INSERT INTO `team` VALUES ('1685', 'Boavista', '21');
INSERT INTO `team` VALUES ('1687', 'Moreirense', '21');
INSERT INTO `team` VALUES ('1689', 'Guimarães', '21');
INSERT INTO `team` VALUES ('1690', 'Académica', '21');
INSERT INTO `team` VALUES ('1692', 'Belenenses', '21');
INSERT INTO `team` VALUES ('1693', 'Paços Ferreira', '21');
INSERT INTO `team` VALUES ('1695', 'Estoril', '21');
INSERT INTO `team` VALUES ('1696', 'Setúbal', '21');
INSERT INTO `team` VALUES ('1697', 'Penafiel', '21');
INSERT INTO `team` VALUES ('1698', 'Varzim', '21');
INSERT INTO `team` VALUES ('1702', 'Aves', '21');
INSERT INTO `team` VALUES ('1704', 'Chaves', '21');
INSERT INTO `team` VALUES ('1705', 'Feirense', '21');
INSERT INTO `team` VALUES ('1706', 'Santa Clara', '21');
INSERT INTO `team` VALUES ('1707', 'Leixões', '21');
INSERT INTO `team` VALUES ('1710', 'Portimonense', '21');
INSERT INTO `team` VALUES ('1711', 'União Madeira', '21');
INSERT INTO `team` VALUES ('1712', 'Covilhã', '21');
INSERT INTO `team` VALUES ('1713', 'Olhanense', '21');
INSERT INTO `team` VALUES ('1728', 'Sporting CP B', '21');
INSERT INTO `team` VALUES ('1737', 'Viseu', '21');
INSERT INTO `team` VALUES ('1755', 'Vizela', '21');
INSERT INTO `team` VALUES ('1756', 'Porto B', '21');
INSERT INTO `team` VALUES ('1758', 'Braga B', '21');
INSERT INTO `team` VALUES ('1761', 'Freamunde', '21');
INSERT INTO `team` VALUES ('1765', 'Fafe', '21');
INSERT INTO `team` VALUES ('1841', 'Zenit', '23');
INSERT INTO `team` VALUES ('1842', 'CSKA', '23');
INSERT INTO `team` VALUES ('1843', 'Lokomotiv M', '23');
INSERT INTO `team` VALUES ('1844', 'Spartak M', '23');
INSERT INTO `team` VALUES ('1845', 'Dinamo M', '23');
INSERT INTO `team` VALUES ('1848', 'Krylya', '23');
INSERT INTO `team` VALUES ('1850', 'Shinnik', '23');
INSERT INTO `team` VALUES ('1851', 'Amkar', '23');
INSERT INTO `team` VALUES ('1852', 'Rubin', '23');
INSERT INTO `team` VALUES ('1853', 'Kuban\'', '23');
INSERT INTO `team` VALUES ('1854', 'Rostov', '23');
INSERT INTO `team` VALUES ('1856', 'Terek', '23');
INSERT INTO `team` VALUES ('1857', 'Spartak', '23');
INSERT INTO `team` VALUES ('1858', 'Sokol', '23');
INSERT INTO `team` VALUES ('1860', 'Luch Energiya', '23');
INSERT INTO `team` VALUES ('1863', 'Arsenal', '23');
INSERT INTO `team` VALUES ('1867', 'Khimki', '23');
INSERT INTO `team` VALUES ('1868', 'Anzhi', '23');
INSERT INTO `team` VALUES ('1870', 'Tom\'', '23');
INSERT INTO `team` VALUES ('1872', 'Energiya', '23');
INSERT INTO `team` VALUES ('1875', 'Baltika', '23');
INSERT INTO `team` VALUES ('1877', 'Neftekhimik', '23');
INSERT INTO `team` VALUES ('1898', 'Celtic', '8');
INSERT INTO `team` VALUES ('1899', 'Rangers', '8');
INSERT INTO `team` VALUES ('1900', 'Midlothian', '8');
INSERT INTO `team` VALUES ('1902', 'Motherwell', '8');
INSERT INTO `team` VALUES ('1906', 'Kilmarnock', '8');
INSERT INTO `team` VALUES ('1907', 'Dundee', '8');
INSERT INTO `team` VALUES ('1908', 'Aberdeen', '8');
INSERT INTO `team` VALUES ('1909', 'Partick', '8');
INSERT INTO `team` VALUES ('1911', 'Inverness', '8');
INSERT INTO `team` VALUES ('1912', 'St. Johnstone', '8');
INSERT INTO `team` VALUES ('1914', 'Ross', '8');
INSERT INTO `team` VALUES ('1922', 'Hamilton', '8');
INSERT INTO `team` VALUES ('2015', 'Valencia', '9');
INSERT INTO `team` VALUES ('2016', 'Real Madrid', '9');
INSERT INTO `team` VALUES ('2017', 'Barcelona', '9');
INSERT INTO `team` VALUES ('2018', 'La Coruña', '9');
INSERT INTO `team` VALUES ('2019', 'Ath Bilbao', '9');
INSERT INTO `team` VALUES ('2020', 'Atl. Madrid', '9');
INSERT INTO `team` VALUES ('2021', 'Sevilla', '9');
INSERT INTO `team` VALUES ('2022', 'Osasuna', '9');
INSERT INTO `team` VALUES ('2023', 'Villarreal', '9');
INSERT INTO `team` VALUES ('2024', 'Málaga', '9');
INSERT INTO `team` VALUES ('2025', 'Betis', '9');
INSERT INTO `team` VALUES ('2027', 'Maiorca', '9');
INSERT INTO `team` VALUES ('2028', 'Real Sociedad', '9');
INSERT INTO `team` VALUES ('2030', 'Zaragoza', '9');
INSERT INTO `team` VALUES ('2031', 'Valladolid', '9');
INSERT INTO `team` VALUES ('2032', 'Espanyol', '9');
INSERT INTO `team` VALUES ('2033', 'Celta de Vigo', '9');
INSERT INTO `team` VALUES ('2035', 'Numancia', '9');
INSERT INTO `team` VALUES ('2036', 'Levante', '9');
INSERT INTO `team` VALUES ('2037', 'Alavés', '9');
INSERT INTO `team` VALUES ('2038', 'Gijón', '9');
INSERT INTO `team` VALUES ('2039', 'Getafe', '9');
INSERT INTO `team` VALUES ('2041', 'Cádiz', '9');
INSERT INTO `team` VALUES ('2042', 'Eibar', '9');
INSERT INTO `team` VALUES ('2043', 'Elche', '9');
INSERT INTO `team` VALUES ('2048', 'Tenerife', '9');
INSERT INTO `team` VALUES ('2049', 'Almería', '9');
INSERT INTO `team` VALUES ('2050', 'Córdoba', '9');
INSERT INTO `team` VALUES ('2053', 'Leganés', '9');
INSERT INTO `team` VALUES ('2054', 'Vallecano', '9');
INSERT INTO `team` VALUES ('2055', 'Las Palmas', '9');
INSERT INTO `team` VALUES ('2085', 'Alcorcón', '9');
INSERT INTO `team` VALUES ('2099', 'Tarragona', '9');
INSERT INTO `team` VALUES ('2101', 'Girona', '9');
INSERT INTO `team` VALUES ('2118', 'Sevilla B', '9');
INSERT INTO `team` VALUES ('2145', 'Halmstad', '24');
INSERT INTO `team` VALUES ('2146', 'Malmo', '24');
INSERT INTO `team` VALUES ('2147', 'Hammarby', '24');
INSERT INTO `team` VALUES ('2148', 'Kalmar', '24');
INSERT INTO `team` VALUES ('2149', 'IFK Gotemburgo', '24');
INSERT INTO `team` VALUES ('2150', 'Djurgården', '24');
INSERT INTO `team` VALUES ('2153', 'AIK Solna', '24');
INSERT INTO `team` VALUES ('2156', 'Orebro SK', '24');
INSERT INTO `team` VALUES ('2157', 'Sundsvall', '24');
INSERT INTO `team` VALUES ('2158', 'Elfsborg', '24');
INSERT INTO `team` VALUES ('2163', 'IFK Norrkoping', '24');
INSERT INTO `team` VALUES ('2174', 'Basileia', '25');
INSERT INTO `team` VALUES ('2175', 'Young Boys', '25');
INSERT INTO `team` VALUES ('2177', 'São Gallen', '25');
INSERT INTO `team` VALUES ('2178', 'Grasshopper', '25');
INSERT INTO `team` VALUES ('2180', 'Thun', '25');
INSERT INTO `team` VALUES ('2189', 'Sion', '25');
INSERT INTO `team` VALUES ('2193', 'Luzern', '25');
INSERT INTO `team` VALUES ('2212', 'Fenerbahçe', '26');
INSERT INTO `team` VALUES ('2213', 'Trabzon', '26');
INSERT INTO `team` VALUES ('2214', 'Besiktas', '26');
INSERT INTO `team` VALUES ('2216', 'Gaziantepspor', '26');
INSERT INTO `team` VALUES ('2217', 'Galatasaray', '26');
INSERT INTO `team` VALUES ('2219', 'Gençlerbirliği', '26');
INSERT INTO `team` VALUES ('2223', 'Konya', '26');
INSERT INTO `team` VALUES ('2224', 'Rize', '26');
INSERT INTO `team` VALUES ('2227', 'Bursa', '26');
INSERT INTO `team` VALUES ('2229', 'Adanaspor', '26');
INSERT INTO `team` VALUES ('2232', 'Osmanlispor', '26');
INSERT INTO `team` VALUES ('2235', 'Kayserispor', '26');
INSERT INTO `team` VALUES ('2236', 'Antalyaspor', '26');
INSERT INTO `team` VALUES ('2253', 'Dínamo Kiev', '27');
INSERT INTO `team` VALUES ('2254', 'Shakhtar D', '27');
INSERT INTO `team` VALUES ('2255', 'Dnipro', '27');
INSERT INTO `team` VALUES ('2257', 'Chornomorets', '27');
INSERT INTO `team` VALUES ('2261', 'Volyn', '27');
INSERT INTO `team` VALUES ('2265', 'Vorskla', '27');
INSERT INTO `team` VALUES ('2267', 'Karpaty', '27');
INSERT INTO `team` VALUES ('2272', 'LA Galaxy', '10');
INSERT INTO `team` VALUES ('2273', 'Chicago', '10');
INSERT INTO `team` VALUES ('2274', 'Kansas', '10');
INSERT INTO `team` VALUES ('2276', 'Earthquakes', '10');
INSERT INTO `team` VALUES ('2277', 'DC United', '10');
INSERT INTO `team` VALUES ('2278', 'Colorado', '10');
INSERT INTO `team` VALUES ('2279', 'New England', '10');
INSERT INTO `team` VALUES ('2280', 'Columbus Crew', '10');
INSERT INTO `team` VALUES ('2336', 'Real Oviedo', '9');
INSERT INTO `team` VALUES ('2351', 'Karabukspor', '26');
INSERT INTO `team` VALUES ('2378', 'Red Star', '11');
INSERT INTO `team` VALUES ('2398', 'Häcken', '24');
INSERT INTO `team` VALUES ('2478', 'Sirius', '24');
INSERT INTO `team` VALUES ('2496', 'Sarpsburgo', '19');
INSERT INTO `team` VALUES ('2549', 'Darmstadt 98', '1');
INSERT INTO `team` VALUES ('2572', 'Gil Vicente', '21');
INSERT INTO `team` VALUES ('2574', 'Neftohimik', '28');
INSERT INTO `team` VALUES ('2581', 'Montana', '28');
INSERT INTO `team` VALUES ('2619', 'Split', '29');
INSERT INTO `team` VALUES ('2752', 'Famalicão', '21');
INSERT INTO `team` VALUES ('2782', 'Dukla', '22');
INSERT INTO `team` VALUES ('2784', 'Karviná', '22');
INSERT INTO `team` VALUES ('2884', 'Basaksehir', '26');
INSERT INTO `team` VALUES ('2891', 'Benfica B', '21');
INSERT INTO `team` VALUES ('2936', 'Panelefsiniakos', '12');
INSERT INTO `team` VALUES ('2937', 'Trikala', '12');
INSERT INTO `team` VALUES ('2939', 'Panaitolikos', '12');
INSERT INTO `team` VALUES ('2943', 'Anagennisi K', '12');
INSERT INTO `team` VALUES ('2948', 'Panegialios', '12');
INSERT INTO `team` VALUES ('2951', 'Lugano', '25');
INSERT INTO `team` VALUES ('2952', 'Lausanne', '25');
INSERT INTO `team` VALUES ('2981', 'Frosinone', '17');
INSERT INTO `team` VALUES ('2986', 'Slovácko', '22');
INSERT INTO `team` VALUES ('2990', 'Sonderjysk', '7');
INSERT INTO `team` VALUES ('3003', 'Huesca', '9');
INSERT INTO `team` VALUES ('3019', 'Sarmiento', '2');
INSERT INTO `team` VALUES ('3030', 'Lamia', '12');
INSERT INTO `team` VALUES ('3087', 'Monterrey', '30');
INSERT INTO `team` VALUES ('3109', 'Slask Wroclaw', '20');
INSERT INTO `team` VALUES ('3121', 'Kielce', '20');
INSERT INTO `team` VALUES ('3133', 'Lechia', '20');
INSERT INTO `team` VALUES ('3139', 'Liaoning', '5');
INSERT INTO `team` VALUES ('3163', 'Oryahovitsa', '28');
INSERT INTO `team` VALUES ('3613', 'ThespaKusatsu', '18');
INSERT INTO `team` VALUES ('3614', 'Tokushima', '18');
INSERT INTO `team` VALUES ('3703', 'Stal Dn', '27');
INSERT INTO `team` VALUES ('3704', 'Zorya', '27');
INSERT INTO `team` VALUES ('3744', 'Volgar', '23');
INSERT INTO `team` VALUES ('3748', 'Fakel', '23');
INSERT INTO `team` VALUES ('3750', 'Ural', '23');
INSERT INTO `team` VALUES ('3826', 'Yanbian Funde', '5');
INSERT INTO `team` VALUES ('3841', 'Dallas', '10');
INSERT INTO `team` VALUES ('3843', 'Salt Lake', '10');
INSERT INTO `team` VALUES ('3864', 'AFC Utd', '24');
INSERT INTO `team` VALUES ('3970', 'Mordovia', '23');
INSERT INTO `team` VALUES ('4034', 'Östersunds FK', '24');
INSERT INTO `team` VALUES ('4049', 'Gazovik', '23');
INSERT INTO `team` VALUES ('4094', 'Yenisey', '23');
INSERT INTO `team` VALUES ('4513', 'Istra', '29');
INSERT INTO `team` VALUES ('4529', 'Almere City', '13');
INSERT INTO `team` VALUES ('4593', 'Wimbledon', '15');
INSERT INTO `team` VALUES ('4717', 'Achilles \'29', '13');
INSERT INTO `team` VALUES ('4781', 'Ajax B', '13');
INSERT INTO `team` VALUES ('4789', 'PSV B', '13');
INSERT INTO `team` VALUES ('4799', 'Reus', '9');
INSERT INTO `team` VALUES ('4908', 'Fleetwood', '15');
INSERT INTO `team` VALUES ('5030', 'Aldosivi', '2');
INSERT INTO `team` VALUES ('5032', 'Tigre', '2');
INSERT INTO `team` VALUES ('5096', 'Gyirmót', '14');
INSERT INTO `team` VALUES ('5101', 'Paksi', '14');
INSERT INTO `team` VALUES ('5110', 'Tijuana', '30');
INSERT INTO `team` VALUES ('5112', 'ABC', '3');
INSERT INTO `team` VALUES ('5127', 'Boa', '3');
INSERT INTO `team` VALUES ('5130', 'Luverdense', '3');
INSERT INTO `team` VALUES ('5476', 'Ingolstadt', '1');
INSERT INTO `team` VALUES ('5604', 'Orléans', '11');
INSERT INTO `team` VALUES ('5665', 'Latina', '17');
INSERT INTO `team` VALUES ('5675', 'Pro Vercelli', '17');
INSERT INTO `team` VALUES ('5681', 'Sassuolo', '17');
INSERT INTO `team` VALUES ('5693', 'Asteras', '12');
INSERT INTO `team` VALUES ('5697', 'Panthrakikos', '12');
INSERT INTO `team` VALUES ('5862', 'Heidenheim', '1');
INSERT INTO `team` VALUES ('5898', 'Sandhausen', '1');
INSERT INTO `team` VALUES ('5966', 'Videoton', '14');
INSERT INTO `team` VALUES ('6205', 'Brasil Pelotas', '3');
INSERT INTO `team` VALUES ('6216', 'Atlético GO', '3');
INSERT INTO `team` VALUES ('6223', 'Chapecoense', '3');
INSERT INTO `team` VALUES ('6378', 'Jönköpings S', '24');
INSERT INTO `team` VALUES ('6422', 'Houston', '10');
INSERT INTO `team` VALUES ('6521', 'Ehime', '18');
INSERT INTO `team` VALUES ('6559', 'Sibir', '23');
INSERT INTO `team` VALUES ('6564', 'Jeju Utd', '6');
INSERT INTO `team` VALUES ('6571', 'NY Red Bulls', '10');
INSERT INTO `team` VALUES ('6637', 'Tyumen', '23');
INSERT INTO `team` VALUES ('6648', 'Guangzhou', '5');
INSERT INTO `team` VALUES ('6900', 'Kasımpaşa', '26');
INSERT INTO `team` VALUES ('6957', 'Oleksandria', '27');
INSERT INTO `team` VALUES ('6961', 'SM Tucumán', '2');
INSERT INTO `team` VALUES ('7026', 'All Boys', '2');
INSERT INTO `team` VALUES ('7029', 'Brown Adrogué', '2');
INSERT INTO `team` VALUES ('7036', 'Flandria', '2');
INSERT INTO `team` VALUES ('7043', 'Temperley', '2');
INSERT INTO `team` VALUES ('7044', 'Douglas Haig', '2');
INSERT INTO `team` VALUES ('7053', 'Santamarina', '2');
INSERT INTO `team` VALUES ('7054', 'Guillermo Br', '2');
INSERT INTO `team` VALUES ('7060', 'Independiente', '2');
INSERT INTO `team` VALUES ('7064', 'Tucumán', '2');
INSERT INTO `team` VALUES ('7072', 'Granada', '9');
INSERT INTO `team` VALUES ('7073', 'Lugo', '9');
INSERT INTO `team` VALUES ('7122', 'Olimpik D', '27');
INSERT INTO `team` VALUES ('7285', 'Alanyaspor', '26');
INSERT INTO `team` VALUES ('7458', 'Villa Dálmine', '2');
INSERT INTO `team` VALUES ('7787', 'Córdoba SdE', '2');
INSERT INTO `team` VALUES ('7788', 'Crucero', '2');
INSERT INTO `team` VALUES ('7853', 'Kristiansund', '19');
INSERT INTO `team` VALUES ('7903', 'Vaduz', '25');
INSERT INTO `team` VALUES ('7977', 'Toronto', '10');
INSERT INTO `team` VALUES ('8009', 'Juventud UG', '2');
INSERT INTO `team` VALUES ('8010', 'Patronato', '2');
INSERT INTO `team` VALUES ('8018', 'Boca Unidos', '2');
INSERT INTO `team` VALUES ('8200', 'Limerick', '16');
INSERT INTO `team` VALUES ('8333', 'Kumamoto', '18');
INSERT INTO `team` VALUES ('8347', 'Gifu', '18');
INSERT INTO `team` VALUES ('9063', 'Zirka', '27');
INSERT INTO `team` VALUES ('9113', 'MZSE', '14');
INSERT INTO `team` VALUES ('9670', 'Mirandés', '9');
INSERT INTO `team` VALUES ('10123', 'Cova Piedade', '21');
INSERT INTO `team` VALUES ('10309', 'Oeste', '3');
INSERT INTO `team` VALUES ('10610', 'Krasnodar', '23');
INSERT INTO `team` VALUES ('10655', 'Shanghai SIPG', '5');
INSERT INTO `team` VALUES ('10765', 'Fagiano', '18');
INSERT INTO `team` VALUES ('11060', 'Würzburg', '1');
INSERT INTO `team` VALUES ('11414', 'Nieciecza', '20');
INSERT INTO `team` VALUES ('11601', 'Lok Zagreb', '29');
INSERT INTO `team` VALUES ('11611', 'Arouca', '21');
INSERT INTO `team` VALUES ('11703', 'Akhisar', '26');
INSERT INTO `team` VALUES ('11833', 'Tondela', '21');
INSERT INTO `team` VALUES ('12109', 'Virtus', '17');
INSERT INTO `team` VALUES ('12140', 'Carpi', '17');
INSERT INTO `team` VALUES ('12229', 'Trapani', '17');
INSERT INTO `team` VALUES ('12387', 'Ludogorets', '28');
INSERT INTO `team` VALUES ('12592', 'Matsumoto', '18');
INSERT INTO `team` VALUES ('12595', 'Zweigen', '18');
INSERT INTO `team` VALUES ('12907', 'Gangwon', '6');
INSERT INTO `team` VALUES ('13024', 'Seattle', '10');
INSERT INTO `team` VALUES ('13025', 'Orlando', '10');
INSERT INTO `team` VALUES ('13133', 'V-Varen', '18');
INSERT INTO `team` VALUES ('13135', 'Machida', '18');
INSERT INTO `team` VALUES ('13204', 'Ufa', '23');
INSERT INTO `team` VALUES ('13410', 'Leipzig', '1');
INSERT INTO `team` VALUES ('13920', 'UCAM', '9');
INSERT INTO `team` VALUES ('14447', 'Platanias', '12');
INSERT INTO `team` VALUES ('14575', 'Philadelphia', '10');
INSERT INTO `team` VALUES ('14860', 'Minnesota', '10');
INSERT INTO `team` VALUES ('15156', 'Spartak M B', '23');
INSERT INTO `team` VALUES ('15342', 'Tosno', '23');
INSERT INTO `team` VALUES ('16355', 'Botev Plovdiv', '28');
INSERT INTO `team` VALUES ('16676', 'Paraná', '2');
INSERT INTO `team` VALUES ('16848', 'Kamatamare', '18');
INSERT INTO `team` VALUES ('16852', 'Renofa', '18');
INSERT INTO `team` VALUES ('16855', 'Chania', '12');
INSERT INTO `team` VALUES ('16860', 'Kalloni', '12');
INSERT INTO `team` VALUES ('17500', 'Whitecaps', '10');
INSERT INTO `team` VALUES ('17501', 'Portland', '10');
INSERT INTO `team` VALUES ('18351', 'Gwangju', '6');
INSERT INTO `team` VALUES ('18583', 'Tianjin', '5');
INSERT INTO `team` VALUES ('18584', 'Guizhou Zhicheng', '5');
INSERT INTO `team` VALUES ('18838', 'Zenit SPb B', '23');
INSERT INTO `team` VALUES ('19828', 'Dunav', '28');
INSERT INTO `team` VALUES ('20235', 'Vereya', '28');
INSERT INTO `team` VALUES ('20515', 'Aiginiakos', '12');
INSERT INTO `team` VALUES ('20584', 'Acharnaikos', '12');
INSERT INTO `team` VALUES ('20933', 'Montreal', '10');
INSERT INTO `team` VALUES ('21563', 'Hebei CFFC', '5');
INSERT INTO `team` VALUES ('21775', 'Guimarães B', '21');
INSERT INTO `team` VALUES ('21812', 'Estudiantes SL', '2');
INSERT INTO `team` VALUES ('22879', 'Utrecht', '13');
INSERT INTO `team` VALUES ('23444', 'Kissamikos', '12');
INSERT INTO `team` VALUES ('24539', 'Tambov', '23');
INSERT INTO `team` VALUES ('26455', 'Galway', '16');
INSERT INTO `team` VALUES ('27696', 'NYCFC', '10');
INSERT INTO `team` VALUES ('34937', 'Sparta', '12');
INSERT INTO `team` VALUES ('38167', 'Atlanta United', '10');
-- ----------------------------
-- Table structure for type_criteria_analisys_match
-- ----------------------------
DROP TABLE IF EXISTS `type_criteria_analisys_match`;
CREATE TABLE `type_criteria_analisys_match` (
`tcam_cd_id_pk` bigint(20) NOT NULL AUTO_INCREMENT,
`tcam_ds_name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`tcam_cd_id_pk`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of type_criteria_analisys_match
-- ----------------------------
INSERT INTO `type_criteria_analisys_match` VALUES ('1', 'ALL_GAMES');
INSERT INTO `type_criteria_analisys_match` VALUES ('3', 'LAST3_MATCHES');
-- ----------------------------
-- Table structure for type_general_condition
-- ----------------------------
DROP TABLE IF EXISTS `type_general_condition`;
CREATE TABLE `type_general_condition` (
`tygc_cd_id_pk` bigint(20) NOT NULL AUTO_INCREMENT,
`tygc_ds_name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`tygc_cd_id_pk`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
-- ----------------------------
-- Records of type_general_condition
-- ----------------------------
INSERT INTO `type_general_condition` VALUES ('1', 'GENERAL');
INSERT INTO `type_general_condition` VALUES ('2', 'CONDITION');
| {
"content_hash": "40c0deab5ba9ec937e18420b0a4a9623",
"timestamp": "",
"source": "github",
"line_count": 1066,
"max_line_length": 115,
"avg_line_length": 53.84615384615385,
"alnum_prop": 0.623397212543554,
"repo_name": "christopherscotini/sonicbot-collector",
"id": "e774d4e6a7800e1d508e146e429daf3bae927803",
"size": "57566",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/resources/db/sonicbot_collector_script_db.sql",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "177700"
}
],
"symlink_target": ""
} |
package org.anarres.cpp;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.PushbackReader;
import java.io.Reader;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Iterator;
import static org.anarres.cpp.Token.*;
@Deprecated
/* pp */ class TokenSnifferSource extends Source {
private List<Token> target;
/* pp */ TokenSnifferSource(List<Token> target) {
this.target = target;
}
public Token token()
throws IOException,
LexerException {
Token tok = getParent().token();
if (tok.getType() != EOF)
target.add(tok);
return tok;
}
public String toString() {
return getParent().toString();
}
}
| {
"content_hash": "2c0ed6bbaab3d4b4db295caf92008baa",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 50,
"avg_line_length": 19.23076923076923,
"alnum_prop": 0.716,
"repo_name": "manu-silicon/CppNet",
"id": "1512b2e4788dfd91246591cd262701337b976563",
"size": "1376",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "TokenSnifferSource.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "159807"
}
],
"symlink_target": ""
} |
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Dissecting Underscore, Underscore Explained</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
<!-- Place favicon.ico in the root directory -->
</head>
<body>
<!-- @@@@@@@@@ THIS CODE IS FOR DISPLAY PURPOSE, UPDATE ONLY WHEN REAL CODE IS UPDATES ==== -->
<pre>
_.sortBy(list, iteratee, [context])
</pre>
<pre class="">
_.sortBy([1, 2, 3, 4, 5, 6], function(num){ return Math.sin(num); });
=> [5, 4, 6, 3, 1, 2]
var stooges = [{name: 'moe', age: 40}, {name: 'larry', age: 50}, {name: 'curly', age: 60}];
_.sortBy(stooges, 'name');
=> [{name: 'curly', age: 60}, {name: 'larry', age: 50}, {name: 'moe', age: 40}];
</pre>
<div class="my_solution">
My Solution:
</div>
<div class="note">
<b>NOTE: My Solution Only works if numbers are used for sorting, Feel free to take this code as sample and modify to achieve string sorting as well</b>
</div>
<pre class="js">
var array = [4, 5, 6];
var stooges = [
{name: 'moe', age: 40, test : [{name : 'sam'}]},
{name: 'larry', age: 50},
{name: 'curly', age: 60}
];
//passing array/array of objects , function, and Context
function sortBy(list, func, context){
var result;
var resultArray = [];
//Javascript Sort method to sort numbers
//Rememeber we are going to sort list based on values which functionCallback will return,
// SO we do simple number sort on list , but instead of comparing list values , we will be comparing function Values returned by callback method
resultArray = list.sort(function(a, b){
var _a, _b;
if(context === void 0){
if(func.constructor === Function){
_a = func(a);
_b = func(b);
}else if(func.constructor === String){
_a = a[func];
_b = b[func];
}
}else{
if(func.constructor === Function){
//passing context
_a = func.call(context, a);
_b = func.call(context, b);
}else if(func.constructor === String){
//passing context
_a = context[a][func];
_b = context[b][func];
}
}
return _a - _b; //if negetive pick a , if positive pick b, this will sort list using function Values
});
return resultArray;
}
function callbackFunc(num){
return Math.sin(num);
}
//Calling Method and show output by passing Array
$(".outputArray output").append(sortBy(array, callbackFunc).toString());
//Calling Method and Show Output by passing Object
$(".outputObject output").append(JSON.stringify(sortBy(stooges, "age")));
</pre>
<!-- @@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@ -->
<section class="outputArray">
<strong>Output for Array:</strong>
<output>
</output>
</section>
<br><br>
<section class="outputObject">
<strong>Output for Array of Objects :</strong>
<output>
</output>
</section>
<br><br>
<div class="row">
<div class="span9 columns">
<h2>Comments Section</h2>
<p>Feel free to comment on the post but keep it clean and on topic.</p>
<div id="disqus_thread"></div>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
</div>
</div>
<script>
var array = [4, 5, 6];
var stooges = [
{name: 'moe', age: 40, test : [{name : 'sam'}]},
{name: 'larry', age: 50},
{name: 'curly', age: 60}
];
//passing array/array of objects , function, and Context
function sortBy(list, func, context){
var result;
var resultArray = [];
//Javascript Sort method to sort numbers
//Rememeber we are going to sort list based on values which functionCallback will return,
// SO we do simple number sort on list , but instead of comparing list values , we will be comparing function Values returned by callback method
resultArray = list.sort(function(a, b){
var _a, _b;
if(context === void 0){
if(func.constructor === Function){
_a = func(a);
_b = func(b);
}else if(func.constructor === String){
_a = a[func];
_b = b[func];
}
}else{
if(func.constructor === Function){
//passing context
_a = func.call(context, a);
_b = func.call(context, b);
}else if(func.constructor === String){
//passing context
_a = context[a][func];
_b = context[b][func];
}
}
return _a - _b; //if negetive pick a , if positive pick b, this will sort list using function Values
});
return resultArray;
}
function callbackFunc(num){
return Math.sin(num);
}
//Calling Method and show output by passing Array
$(".outputArray output").append(sortBy(array, callbackFunc).toString());
//Calling Method and Show Output by passing Object
$(".outputObject output").append(JSON.stringify(sortBy(stooges, "age")));
</script>
<script>
$( "body" ).scrollTop( 0 );
/* * * CONFIGURATION VARIABLES * * */
var disqus_shortname = 'harshpandya';
/* * * DON'T EDIT BELOW THIS LINE * * */
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
DISQUS.reset({
reload: true,
config: function () {
this.page.identifier = window.location.hash.replace("#", "");
this.page.url = window.location.href.replace("#", "#!");
}
});
//CODE HIGHLIGHTER
//http://steamdev.com/snippet/ for themes
$("pre.js").snippet("javascript",appConfig.jsConfig);
$("pre.htmlCode").snippet("html",appConfig.htmlConfig);
$("pre.styles").snippet("css",appConfig.styleConfig);
</script>
</body>
</html>
| {
"content_hash": "59cd9979a53b53ee7d3cf138050523a5",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 155,
"avg_line_length": 29.36322869955157,
"alnum_prop": 0.5583384239462431,
"repo_name": "hrspandya/Dissecting_Underscore",
"id": "d6d832b5dc4f800f37384db3cdb75c0f26a88533",
"size": "6548",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "src/collections/sortBy.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "4072"
},
{
"name": "HTML",
"bytes": "347943"
},
{
"name": "JavaScript",
"bytes": "81262"
}
],
"symlink_target": ""
} |
/**
* @class angular
* @method help
*/
var help = module.exports = function() {
console.log([
'\nNODE-ANGULAR'.green.inverse,
'\nUsage: angular <command> <arguments>'.green,
'Commands:'.gray,
' -v, --version'.green + ' current node-angular version',
' -n, --new'.green + ' generate new node-angular project',
' -g --generate'.green + ' generate a new code template',
' -h, --help'.green + ' display available commands',
''
].join('\n'));
};
/* EOF */ | {
"content_hash": "5eb522c8656dfb5ce3e11a8a14254b1d",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 69,
"avg_line_length": 25.55,
"alnum_prop": 0.5596868884540117,
"repo_name": "robertg/nodejs-boilerplate-appfog",
"id": "32056cc847d65fa61478fcc5095bfda14477f7c4",
"size": "511",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "node_modules/angular/lib/node-angular/help.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "JavaScript",
"bytes": "737"
}
],
"symlink_target": ""
} |
Frame::Frame(LCDDevice *dev) : GuiObject() {
this->device = dev;
this->base_sizer = 0;
// Clear screen + set background color
Surface *s = this->device->getSurface();
s->setColor(Color::BACKGROUND);
s->rect(0, 0, s->w, s->h);
delete s;
}
Frame::~Frame() {
if(this->base_sizer) {
delete this->base_sizer;
}
this->device->clearScreen();
}
void Frame::run() {
// Draw if necessary & possible
if(this->base_sizer && this->base_sizer->refresh) {
Surface *s = this->device->getSurface();
this->base_sizer->draw(s);
delete s;
}
// Check events
GuiEvent ev;
if(this->device->getEvent(&ev) && this->base_sizer) {
this->base_sizer->handle_event(&ev);
}
}
void Frame::setBaseSizer(Sizer *sizer) {
this->base_sizer = sizer;
this->base_sizer->setParent(this);
}
void Frame::update() {}
void Frame::layout() {
if(this->base_sizer) {
Surface *s = this->device->getSurface();
this->base_sizer->setSize(s->w, s->h);
this->base_sizer->precalc_layout(0, 0);
delete s;
}
}
| {
"content_hash": "d968a4da360197b31b6fed10bd7891e7",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 57,
"avg_line_length": 23.25,
"alnum_prop": 0.568100358422939,
"repo_name": "katajakasa/libulcdgui",
"id": "239e492965a758a9df70372a1ccc1455d8c499c8",
"size": "1144",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/frame.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "27099"
}
],
"symlink_target": ""
} |
feature_name: Web Bluetooth / Manufacturer Data Filter (Async Await)
chrome_version: 92
check_min_version: true
feature_id: 5684530360877056
icon_url: icon.png
index: index.html
---
{% include_relative _includes/intro.html %}
<p>This sample illustrates the use of the Web Bluetooth API to retrieve basic
device information from a nearby Bluetooth Low Energy Device that matches
manufacturer specific data. You may want to check out the
<a href="manufacturer-data-filter.html">Manufacturer Data Filter
(Promises)</a> sample.</p>
<form>
Manufacturer Data:
<input id="companyIdentifier" type="text" size=18 list="companyIdentifiers" placeholder="Company Identifier">
<input id="dataPrefix" type="text" size=17 placeholder="Data Prefix (HEX)">
<input id="mask" type="text" size=17 placeholder="Mask (HEX)">
<button>Get Bluetooth Device Info</button>
</form>
{% include_relative _includes/datalist-company-identifiers.html %}
{% include output_helper.html %}
{% include js_snippet.html filename='manufacturer-data-filter-async-await.js' %}
<script>
document.querySelector('form').addEventListener('submit', function(event) {
event.stopPropagation();
event.preventDefault();
if (isWebBluetoothEnabled()) {
ChromeSamples.clearLog();
onButtonClick();
}
});
</script>
{% include_relative _includes/utils.html %}
| {
"content_hash": "2d0dbc29bc07d0c2f0cd39cc0d9aff7f",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 111,
"avg_line_length": 31.488372093023255,
"alnum_prop": 0.7370753323485968,
"repo_name": "beaufortfrancois/samples",
"id": "88f7b96b95a92861c03491a82ad957d58d164dcc",
"size": "1358",
"binary": false,
"copies": "2",
"ref": "refs/heads/gh-pages",
"path": "web-bluetooth/manufacturer-data-filter-async-await.html",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "996"
},
{
"name": "CSS",
"bytes": "24195"
},
{
"name": "HTML",
"bytes": "562755"
},
{
"name": "JavaScript",
"bytes": "340623"
},
{
"name": "Ruby",
"bytes": "78"
}
],
"symlink_target": ""
} |
Paper (2010) describing essentially my method with simlar results.
https://www.isprs.org/proceedings/xxxviii/1-W17/8_Mattyus.pdf | {
"content_hash": "7772f16d2201108c4d41577f39a60696",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 66,
"avg_line_length": 43,
"alnum_prop": 0.8062015503875969,
"repo_name": "UASLab/ImageAnalysis",
"id": "d24ddc37b54360c3f8a285a03ce4c2de22eab746",
"size": "129",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "motion/README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "GLSL",
"bytes": "2077"
},
{
"name": "Python",
"bytes": "1805747"
}
],
"symlink_target": ""
} |
package com.feedhenry.armark;
import android.content.pm.PackageManager;
import android.location.Location;
import android.location.LocationListener;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.location.LocationServices;
import com.wikitude.architect.ArchitectStartupConfiguration;
import com.wikitude.architect.ArchitectView;
import com.wikitude.architect.services.camera.CameraLifecycleListener;
import com.wikitude.common.camera.CameraSettings;
import java.io.IOException;
import android.Manifest;
import android.util.Log;
import android.widget.Toast;
import static com.feedhenry.armark.R.id.architectView;
import static com.google.ads.AdRequest.LOGTAG;
public class ArAlmacenActivity extends AppCompatActivity implements ArchitectViewHolderInterface, GoogleApiClient.OnConnectionFailedListener,
GoogleApiClient.ConnectionCallbacks {
private ArchitectView av;
protected ArchitectView.SensorAccuracyChangeListener sensorAccuracyListener;
protected ArchitectViewHolderInterface.ILocationProvider locationProvider;
private static final int PETICION_PERMISO_LOCALIZACION = 101;
private GoogleApiClient apiClient;
protected ArchitectView.ArchitectWorldLoadedListener worldLoadedListener;
protected boolean hasGeo;
protected boolean hasIR;
protected boolean hasInstant;
private double Latitud;
private double Longitud;
private double Altura;
private float Exactitud;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ar_almacen);
av = (ArchitectView) this.findViewById(R.id.architectView);
final ArchitectStartupConfiguration config = new ArchitectStartupConfiguration();
config.setLicenseKey(Constantes.KEY_APP);
config.setFeatures(this.getFeatures());
config.setCameraResolution(this.getCameraResolution());
config.setCamera2Enabled(this.getCamera2Enabled());
this.av.setCameraLifecycleListener(getCameraLifecycleListener());
try {
/* first mandatory life-cycle notification */
this.av.onCreate(config);
} catch (RuntimeException rex) {
this.av = null;
Toast.makeText(getApplicationContext(), "can't create Architect View", Toast.LENGTH_SHORT).show();
Log.e(this.getClass().getName(), "Exception in ArchitectView.onCreate()", rex);
}
// register valid world loaded listener in av, ensure this is set before content is loaded to not miss any event
if (this.worldLoadedListener != null && this.av != null) {
this.av.registerWorldLoadedListener(worldLoadedListener);
}
apiClient = new GoogleApiClient.Builder(this)
.enableAutoManage(this, this)
.addConnectionCallbacks(this)
.addApi(LocationServices.API)
.build();
}
private int getFeatures() {
int features = (hasGeo ? ArchitectStartupConfiguration.Features.Geo : 0) |
(hasIR ? ArchitectStartupConfiguration.Features.ImageTracking : 0) |
(hasInstant ? ArchitectStartupConfiguration.Features.InstantTracking : 0);
return features;
}
protected CameraSettings.CameraResolution getCameraResolution() {
return CameraSettings.CameraResolution.SD_640x480;
}
protected boolean getCamera2Enabled() {
return false;
}
protected CameraLifecycleListener getCameraLifecycleListener() {
return null;
}
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
if (this.av != null) {
this.av.onPostCreate();
try {
Log.e("ArAlmacenActivity", "PostCreate");
this.av.load("file:///android_asset/Radar/index.html");
if (this.getInitialCullingDistanceMeters() != ArchitectViewHolderInterface.CULLING_DISTANCE_DEFAULT_METERS) {
this.av.setCullingDistance(this.getInitialCullingDistanceMeters());
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
@Override
protected void onPostResume() {
super.onPostResume();
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
PETICION_PERMISO_LOCALIZACION);
} else {
Location lastLocation =
LocationServices.FusedLocationApi.getLastLocation(apiClient);
updateUI(lastLocation);
}
}
@Override
protected void onResume() {
super.onResume();
if (this.av != null) {
this.av.onResume();
// register accuracy listener in architectView, if set
if (this.sensorAccuracyListener != null) {
this.av.registerSensorAccuracyChangeListener(this.sensorAccuracyListener);
}
}
// tell locationProvider to resume, usually location is then (again) fetched, so the GPS indicator appears in status bar
if (this.av != null) {
this.av.onResume();
}
}
@Override
protected void onStop() {
super.onStop();
}
@Override
protected void onDestroy() {
super.onDestroy();
// call mandatory live-cycle method of architectView
if (this.av != null) {
this.av.clearCache();
this.av.onDestroy();
}
}
@Override
public void onLowMemory() {
super.onLowMemory();
if (this.av != null) {
this.av.onLowMemory();
}
}
@Override
protected void onPause() {
super.onPause();
// call mandatory live-cycle method of architectView
if (this.av != null) {
this.av.onPause();
// unregister accuracy listener in architectView, if set
if (this.sensorAccuracyListener != null) {
this.av.unregisterSensorAccuracyChangeListener(this.sensorAccuracyListener);
}
}
// tell locationProvider to pause, usually location is then no longer fetched, so the GPS indicator disappears in status bar
if (this.locationProvider != null) {
this.locationProvider.onPause();
}
}
@Override
public void onConnected(@Nullable Bundle bundle) {
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
PETICION_PERMISO_LOCALIZACION);
} else {
Location lastLocation =
LocationServices.FusedLocationApi.getLastLocation(apiClient);
updateUI(lastLocation);
}
}
private void updateUI(Location loc) {
if (loc != null) {
Latitud = loc.getLatitude();
Longitud = loc.getLongitude();
Exactitud = loc.getAccuracy();
Altura = loc.getAltitude();
try {
av.setLocation(Latitud, Longitud, Altura, Exactitud);
} catch (Exception e) {
Log.e(LOGTAG, e.getMessage());
}
} else {
Latitud = 0;
Longitud = 0;
}
}
@Override
public void onConnectionSuspended(int i) {
}
@Override
public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
}
@Override
public String getARchitectWorldPath() {
return null;
}
@Override
public ArchitectView.ArchitectUrlListener getUrlListener() {
return null;
}
@Override
public int getContentViewId() {
return 0;
}
@Override
public String getWikitudeSDKLicenseKey() {
return null;
}
@Override
public int getArchitectViewId() {
return 0;
}
@Override
public ILocationProvider getLocationProvider(LocationListener locationListener) {
return null;
}
@Override
public ArchitectView.SensorAccuracyChangeListener getSensorAccuracyListener() {
return null;
}
@Override
public float getInitialCullingDistanceMeters() {
return 0;
}
@Override
public ArchitectView.ArchitectWorldLoadedListener getWorldLoadedListener() {
return null;
}
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
if (requestCode == PETICION_PERMISO_LOCALIZACION) {
if (grantResults.length == 1
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) {
//Permiso concedido
@SuppressWarnings("MissingPermission")
Location lastLocation =
LocationServices.FusedLocationApi.getLastLocation(apiClient);
updateUI(lastLocation);
} else {
//Permiso denegado:
Log.e(LOGTAG, "Permiso denegado");
}
}
}
}
| {
"content_hash": "1c4ed55e61475d302357f9c61fd31009",
"timestamp": "",
"source": "github",
"line_count": 324,
"max_line_length": 141,
"avg_line_length": 30.123456790123456,
"alnum_prop": 0.6425204918032786,
"repo_name": "ciglesiascrespo/Armark_App_ciglesias_2",
"id": "eb4874d304e8651474bd1ec145e308078cb39e26",
"size": "9760",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/java/com/feedhenry/armark/ArAlmacenActivity.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1310"
},
{
"name": "HTML",
"bytes": "3318"
},
{
"name": "Java",
"bytes": "191712"
},
{
"name": "JavaScript",
"bytes": "23612"
}
],
"symlink_target": ""
} |
package co.cask.cdap.examples.purchase;
import co.cask.cdap.api.app.AbstractApplication;
import co.cask.cdap.api.data.schema.UnsupportedTypeException;
import co.cask.cdap.api.data.stream.Stream;
import co.cask.cdap.api.dataset.DatasetProperties;
import co.cask.cdap.api.dataset.lib.KeyValueTable;
import co.cask.cdap.api.dataset.lib.ObjectMappedTable;
import co.cask.cdap.api.dataset.lib.ObjectMappedTableProperties;
import co.cask.cdap.api.schedule.Schedules;
/**
* This implements a simple purchase history application via a scheduled MapReduce Workflow --
* see package-info for more details.
*/
public class PurchaseApp extends AbstractApplication {
public static final String APP_NAME = "PurchaseHistory";
@Override
public void configure() {
setName(APP_NAME);
setDescription("Purchase history application");
// Ingest data into the Application via a Stream
addStream(new Stream("purchaseStream"));
// Store processed data in a Dataset
createDataset("frequentCustomers", KeyValueTable.class,
DatasetProperties.builder().setDescription("Store frequent customers").build());
// Store user profiles in a Dataset
createDataset("userProfiles", KeyValueTable.class,
DatasetProperties.builder().setDescription("Store user profiles").build());
// Process events in realtime using a Flow
addFlow(new PurchaseFlow());
// Specify a MapReduce to run on the acquired data
addMapReduce(new PurchaseHistoryBuilder());
// Run a Workflow that uses the MapReduce to run on the acquired data
addWorkflow(new PurchaseHistoryWorkflow());
// Retrieve the processed data using a Service
addService(new PurchaseHistoryService());
// Store and retrieve user profile data using a Service
addService(UserProfileServiceHandler.SERVICE_NAME, new UserProfileServiceHandler());
// Provide a Service to Application components
addService(new CatalogLookupService());
// Schedule the workflow
scheduleWorkflow(
Schedules.builder("DailySchedule")
.setMaxConcurrentRuns(1)
.createTimeSchedule("0 4 * * *"),
"PurchaseHistoryWorkflow");
// Schedule the workflow based on the data coming in the purchaseStream stream
scheduleWorkflow(
Schedules.builder("DataSchedule")
.setDescription("Schedule execution when 1 MB or more of data is ingested in the purchaseStream")
.setMaxConcurrentRuns(1)
.createDataSchedule(Schedules.Source.STREAM, "purchaseStream", 1),
"PurchaseHistoryWorkflow"
);
createDataset("history", PurchaseHistoryStore.class, PurchaseHistoryStore.properties("History dataset"));
try {
createDataset("purchases", ObjectMappedTable.class, ObjectMappedTableProperties.builder().setType(Purchase.class)
.setDescription("Store purchases").build());
} catch (UnsupportedTypeException e) {
// This exception is thrown by ObjectMappedTable if its parameter type cannot be
// (de)serialized (for example, if it is an interface and not a class, then there is
// no auto-magic way deserialize an object.) In this case that will not happen
// because PurchaseHistory and Purchase are actual classes.
throw new RuntimeException(e);
}
}
}
| {
"content_hash": "f90e4e4ce08851f45bdbe2563efb51dd",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 119,
"avg_line_length": 39.226190476190474,
"alnum_prop": 0.7332321699544765,
"repo_name": "caskdata/cdap",
"id": "c2655e46f59ddc696afc3bae8f4881076c7ba51d",
"size": "3897",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "cdap-examples/Purchase/src/main/java/co/cask/cdap/examples/purchase/PurchaseApp.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "26055"
},
{
"name": "CSS",
"bytes": "478678"
},
{
"name": "HTML",
"bytes": "647505"
},
{
"name": "Java",
"bytes": "19722699"
},
{
"name": "JavaScript",
"bytes": "2362906"
},
{
"name": "Python",
"bytes": "166065"
},
{
"name": "Ruby",
"bytes": "3178"
},
{
"name": "Scala",
"bytes": "173411"
},
{
"name": "Shell",
"bytes": "225202"
},
{
"name": "Visual Basic",
"bytes": "870"
}
],
"symlink_target": ""
} |
from extensions.interactions import base
class ImageClickInput(base.BaseInteraction):
"""Interaction allowing multiple-choice selection on an image."""
name = 'Image Region'
description = 'Allows learners to click on regions of an image.'
display_mode = base.DISPLAY_MODE_SUPPLEMENTAL
_dependency_ids = []
answer_type = 'ClickOnImage'
instructions = 'Click on the image'
narrow_instructions = 'View image'
needs_summary = False
# It is required to show which region is being clicked on while specifying
# a solution. Once this issue is fixed, ImageClickInput interaction can be
# supported by the solution feature.
can_have_solution = False
show_generic_submit_button = False
_customization_arg_specs = [{
'name': 'imageAndRegions',
'description': 'Image',
'schema': {
'type': 'custom',
'obj_type': 'ImageWithRegions',
},
'default_value': {
'imagePath': '',
'labeledRegions': []
},
}, {
'name': 'highlightRegionsOnHover',
'description': 'Highlight regions when the learner hovers over them',
'schema': {
'type': 'bool',
},
'default_value': False
}]
_answer_visualization_specs = [{
# Bar chart with answer counts.
'id': 'BarChart',
'options': {
'x_axis_label': 'Answer',
'y_axis_label': 'Count',
},
'calculation_id': 'AnswerFrequencies',
# Bar charts don't have any useful way to display which answers are
# addressed yet. By setting this option to False, we consequentially
# avoid doing extra computation.
'addressed_info_is_supported': False,
}]
| {
"content_hash": "5075719bad4cb8be32d3f4eac5b4ddcb",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 78,
"avg_line_length": 33.471698113207545,
"alnum_prop": 0.5997745208568207,
"repo_name": "AllanYangZhou/oppia",
"id": "12da01b4f01dde7f068165a871b472d834331fa1",
"size": "2396",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "extensions/interactions/ImageClickInput/ImageClickInput.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "82690"
},
{
"name": "HTML",
"bytes": "1128088"
},
{
"name": "JavaScript",
"bytes": "3945933"
},
{
"name": "Python",
"bytes": "4888439"
},
{
"name": "Shell",
"bytes": "50051"
}
],
"symlink_target": ""
} |
package org.apache.phoenix.hive.mapreduce;
import java.io.IOException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Properties;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hive.ql.io.AcidOutputFormat;
import org.apache.hadoop.hive.ql.io.RecordUpdater;
import org.apache.hadoop.hive.serde2.SerDeException;
import org.apache.hadoop.hive.serde2.SerDeStats;
import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.mapred.RecordWriter;
import org.apache.hadoop.mapred.Reporter;
import org.apache.hadoop.mapreduce.lib.db.DBWritable;
import org.apache.phoenix.hive.PhoenixSerializer;
import org.apache.phoenix.hive.PhoenixSerializer.DmlType;
import org.apache.phoenix.hive.constants.PhoenixStorageHandlerConstants;
import org.apache.phoenix.hive.util.PhoenixConnectionUtil;
import org.apache.phoenix.hive.util.PhoenixStorageHandlerUtil;
import org.apache.phoenix.hive.util.PhoenixUtil;
import org.apache.phoenix.jdbc.PhoenixConnection;
import org.apache.phoenix.mapreduce.util.PhoenixConfigurationUtil;
import org.apache.phoenix.schema.ConcurrentTableMutationException;
import org.apache.phoenix.schema.MetaDataClient;
import org.apache.phoenix.util.QueryUtil;
/**
*
* WARNING : There is possibility that WAL disable setting not working properly.
* Because mapper or tez task work on multi processor, If any mapper disabling and another mapper enabling before update. then WAL operated.
* @author JeongMin Ju
*
*/
public class PhoenixRecordWriter<T extends DBWritable> implements RecordWriter<NullWritable, T>, org.apache.hadoop.hive.ql.exec.FileSinkOperator.RecordWriter, RecordUpdater {
private static final Log LOG = LogFactory.getLog(PhoenixRecordWriter.class);
private Connection conn;
private PreparedStatement pstmt;
private long batchSize;
private long numRecords = 0;
private Configuration config;
private String tableName;
private MetaDataClient metaDataClient;
private boolean restoreWalMode;
// For RecordUpdater
private long rowCountDelta = 0;
private PhoenixSerializer phoenixSerializer;
private ObjectInspector objInspector;
private PreparedStatement pstmtForDelete;
// For RecordUpdater
public PhoenixRecordWriter(Path path, AcidOutputFormat.Options options) throws IOException {
Configuration config = options.getConfiguration();
Properties props = new Properties();
try {
initialize(config, props);
} catch (SQLException e) {
throw new IOException(e);
}
this.objInspector = options.getInspector();
try {
phoenixSerializer = new PhoenixSerializer(config, options.getTableProperties());
} catch (SerDeException e) {
throw new IOException(e);
}
}
public PhoenixRecordWriter(final Configuration configuration, final Properties props) throws SQLException {
initialize(configuration, props);
}
private void initialize(Configuration config, Properties properties) throws SQLException {
this.config = config;
tableName = config.get(PhoenixStorageHandlerConstants.PHOENIX_TABLE_NAME);
// Disable WAL
String walConfigName = tableName.toLowerCase() + PhoenixStorageHandlerConstants.DISABLE_WAL;
boolean disableWal = config.getBoolean(walConfigName, false);
if (disableWal) {
if (LOG.isDebugEnabled()) {
LOG.debug("<<<<<<<<<< " + walConfigName + " is true. batch.mode will be set true. >>>>>>>>>>");
}
properties.setProperty(PhoenixStorageHandlerConstants.BATCH_MODE, "true");
}
this.conn = PhoenixConnectionUtil.getInputConnection(config, properties);
if (disableWal) {
metaDataClient = new MetaDataClient((PhoenixConnection)conn);
if (!PhoenixUtil.isDisabledWal(metaDataClient, tableName)) {
// execute alter tablel statement if disable_wal is not true.
try {
PhoenixUtil.alterTableForWalDisable(conn, tableName, true);
} catch (ConcurrentTableMutationException e) {
if (LOG.isWarnEnabled()) {
LOG.warn("<<<<<<<<<< another mapper or task processing wal disable >>>>>>>>>>");
}
}
if (LOG.isDebugEnabled()) {
LOG.debug("<<<<<<<<<< " + tableName + "s wal disabled. >>>>>>>>>>");
}
// restore original value of disable_wal at the end.
restoreWalMode = true;
}
}
this.batchSize = PhoenixConfigurationUtil.getBatchSize(config);
if (LOG.isDebugEnabled()) {
LOG.debug("<<<<<<<<<< batch-size : " + batchSize + " >>>>>>>>>>");
}
String upsertQuery = QueryUtil.constructUpsertStatement(tableName, PhoenixUtil.getColumnInfoList(conn, tableName));
if (LOG.isDebugEnabled()) {
LOG.debug("<<<<<<<<<< upsert-query : " + upsertQuery + " >>>>>>>>>>");
}
this.pstmt = this.conn.prepareStatement(upsertQuery);
}
@Override
public void write(NullWritable key, T record) throws IOException {
try {
record.write(pstmt);
numRecords++;
pstmt.executeUpdate();
if (numRecords % batchSize == 0) {
LOG.debug("<<<<<<<<<< commit called on a batch of size : " + batchSize + " >>>>>>>>>>");
conn.commit();
}
} catch (SQLException e) {
throw new IOException("Exception while writing to table.", e);
}
}
@Override
public void close(Reporter reporter) throws IOException {
try {
conn.commit();
if (LOG.isInfoEnabled()) {
LOG.info("<<<<<<<<<< writen row : " + numRecords + " >>>>>>>>>>");
}
} catch (SQLException e) {
LOG.error("SQLException while performing the commit for the task.");
throw new IOException(e);
} finally {
try {
if (restoreWalMode && PhoenixUtil.isDisabledWal(metaDataClient, tableName)) {
try {
PhoenixUtil.alterTableForWalDisable(conn, tableName, false);
} catch (ConcurrentTableMutationException e) {
if (LOG.isWarnEnabled()) {
LOG.warn("<<<<<<<<<< another mapper or task processing wal enable >>>>>>>>>>");
}
}
if (LOG.isDebugEnabled()) {
LOG.debug("<<<<<<<<<< " + tableName + "s wal enabled. >>>>>>>>>>");
}
}
// 2016-01-25 Added by JeongMin Ju - flush if [table-name].auto.flush is true.
String autoFlushConfigName = tableName.toLowerCase() + PhoenixStorageHandlerConstants.AUTO_FLUSH;
boolean autoFlush = config.getBoolean(autoFlushConfigName, false);
if (autoFlush) {
if (LOG.isDebugEnabled()) {
LOG.debug("<<<<<<<<<< " + autoFlush + " is true. >>>>>>>>>>");
}
PhoenixUtil.flush(conn, tableName);
}
PhoenixUtil.closeResource(pstmt);
PhoenixUtil.closeResource(pstmtForDelete);
PhoenixUtil.closeResource(conn);
} catch (SQLException ex) {
LOG.error("SQLException while closing the connection for the task.");
throw new IOException(ex);
}
}
}
// For Testing
public boolean isRestoreWalMode() {
return restoreWalMode;
}
@SuppressWarnings("unchecked")
@Override
public void write(Writable w) throws IOException {
PhoenixResultWritable row = (PhoenixResultWritable)w;
write(NullWritable.get(), (T) row);
}
@Override
public void close(boolean abort) throws IOException {
close(Reporter.NULL);
}
@Override
public void insert(long currentTransaction, Object row) throws IOException {
if (LOG.isTraceEnabled()) {
LOG.trace("<<<<<<<<<< insert - currentTranscation : " + currentTransaction + ", row : " + PhoenixStorageHandlerUtil.toString(row) + " >>>>>>>>>>");
}
PhoenixResultWritable pResultWritable = (PhoenixResultWritable) phoenixSerializer.serialize(row, objInspector, DmlType.INSERT);
if (LOG.isTraceEnabled()) {
LOG.trace("<<<<<<<<<< data : " + pResultWritable.getValueList() + " >>>>>>>>>>");
}
write(pResultWritable);
rowCountDelta++;
}
@Override
public void update(long currentTransaction, Object row) throws IOException {
if (LOG.isTraceEnabled()) {
LOG.trace("<<<<<<<<<< update - currentTranscation : " + currentTransaction + ", row : " + PhoenixStorageHandlerUtil.toString(row) + " >>>>>>>>>>");
}
PhoenixResultWritable pResultWritable = (PhoenixResultWritable) phoenixSerializer.serialize(row, objInspector, DmlType.UPDATE);
if (LOG.isTraceEnabled()) {
LOG.trace("<<<<<<<<<< data : " + pResultWritable.getValueList() + " >>>>>>>>>>");
}
write(pResultWritable);
}
@Override
public void delete(long currentTransaction, Object row) throws IOException {
if (LOG.isTraceEnabled()) {
LOG.trace("<<<<<<<<<< delete - currentTranscation : " + currentTransaction + ", row : " + PhoenixStorageHandlerUtil.toString(row) + " >>>>>>>>>>");
}
PhoenixResultWritable pResultWritable = (PhoenixResultWritable) phoenixSerializer.serialize(row, objInspector, DmlType.DELETE);
if (LOG.isTraceEnabled()) {
LOG.trace("<<<<<<<<<< data : " + pResultWritable.getValueList() + " >>>>>>>>>>");
}
if (pstmtForDelete == null) {
try {
String deleteQuery = PhoenixUtil.constructDeleteStatement(conn, tableName);
if (LOG.isDebugEnabled()) {
LOG.debug("<<<<<<<<<< delete query : " + deleteQuery + " >>>>>>>>>>");
}
pstmtForDelete = conn.prepareStatement(deleteQuery);
} catch (SQLException e) {
throw new IOException(e);
}
}
delete(pResultWritable);
rowCountDelta--;
}
private void delete(PhoenixResultWritable pResultWritable) throws IOException {
try {
pResultWritable.delete(pstmtForDelete);
numRecords++;
pstmtForDelete.executeUpdate();
if (numRecords % batchSize == 0) {
LOG.debug("<<<<<<<<<< commit called on a batch of size : " + batchSize + " >>>>>>>>>>");
conn.commit();
}
} catch (SQLException e) {
throw new IOException("Exception while deleting to table.", e);
}
}
@Override
public void flush() throws IOException {
if (LOG.isDebugEnabled()) {
LOG.debug("<<<<<<<<<< flush >>>>>>>>>>");
}
try {
conn.commit();
if (LOG.isInfoEnabled()) {
LOG.info("<<<<<<<<<< writen row : " + numRecords + " >>>>>>>>>>");
}
} catch (SQLException e) {
LOG.error("SQLException while performing the commit for the task.");
throw new IOException(e);
}
}
@Override
public SerDeStats getStats() {
if (LOG.isDebugEnabled()) {
LOG.debug("<<<<<<<<<< getStats >>>>>>>>>>");
}
SerDeStats stats = new SerDeStats();
stats.setRowCount(rowCountDelta);
// Don't worry about setting raw data size diff. I have no idea how to calculate that
// without finding the row we are updating or deleting, which would be a mess.
return stats;
}
}
| {
"content_hash": "80d45987feb3bb818116671d724cda8f",
"timestamp": "",
"source": "github",
"line_count": 330,
"max_line_length": 175,
"avg_line_length": 35.275757575757574,
"alnum_prop": 0.6299287002834808,
"repo_name": "mini666/hive-phoenix-handler",
"id": "719e1141bb123ae8154e1f9606e874732b41c142",
"size": "12463",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/org/apache/phoenix/hive/mapreduce/PhoenixRecordWriter.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "411104"
}
],
"symlink_target": ""
} |
package org.typelibrary.dns;
public class ParseException extends RuntimeException {
public ParseException() {
super();
}
public ParseException(String msg, Throwable t, boolean enableSuppression, boolean writableStackTrace) {
super(msg, t, enableSuppression, writableStackTrace);
}
public ParseException(String msg, Throwable t) {
super(msg, t);
}
public ParseException(String msg) {
super(msg);
}
public ParseException(Throwable t) {
super(t);
}
}
| {
"content_hash": "995df51135e8f69f574a08a3e51ada9f",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 107,
"avg_line_length": 21.615384615384617,
"alnum_prop": 0.6227758007117438,
"repo_name": "jshyun/incubating",
"id": "6adf7aad8374315848c9d69d59c4e180c5d3f20f",
"size": "1173",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dns-types/src/main/java/org/typelibrary/dns/ParseException.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "402829"
}
],
"symlink_target": ""
} |
/** <p> cc.AtlasNode is a subclass of cc.Node that implements the cc.RGBAProtocol and<br/>
* cc.TextureProtocol protocol</p>
*
* <p> It knows how to render a TextureAtlas object. <br/>
* If you are going to render a TextureAtlas consider subclassing cc.AtlasNode (or a subclass of cc.AtlasNode)</p>
*
* <p> All features from cc.Node are valid, plus the following features: <br/>
* - opacity and RGB colors </p>
* @class
* @extends cc.Node
*
* @property {cc.Texture2D} texture - Current used texture
* @property {cc.TextureAtlas} textureAtlas - Texture atlas for cc.AtlasNode
* @property {Number} quadsToDraw - Number of quads to draw
*
*/
cc.AtlasNode = cc.Node.extend(/** @lends cc.AtlasNode# */{
textureAtlas: null,
quadsToDraw: 0,
//! chars per row
_itemsPerRow: 0,
//! chars per column
_itemsPerColumn: 0,
//! width of each char
_itemWidth: 0,
//! height of each char
_itemHeight: 0,
_colorUnmodified: null,
// protocol variables
_opacityModifyRGB: false,
_blendFunc: null,
_ignoreContentScaleFactor: false, // This variable is only used for CCLabelAtlas FPS display. So plz don't modify its value.
_className: "AtlasNode",
/**
* Creates a cc.AtlasNode with an Atlas file the width and height of each item and the quantity of items to render
* Constructor of cc.AtlasNode
* @param {String} tile
* @param {Number} tileWidth
* @param {Number} tileHeight
* @param {Number} itemsToRender
* @example
* var node = new cc.AtlasNode("pathOfTile", 16, 16, 1);
*/
ctor: function (tile, tileWidth, tileHeight, itemsToRender) {
cc.Node.prototype.ctor.call(this);
this._colorUnmodified = cc.color.WHITE;
this._blendFunc = {src: cc.BLEND_SRC, dst: cc.BLEND_DST};
this._ignoreContentScaleFactor = false;
itemsToRender !== undefined && this.initWithTileFile(tile, tileWidth, tileHeight, itemsToRender);
},
/** updates the Atlas (indexed vertex array).
* Shall be overridden in subclasses
*/
updateAtlasValues: function () {
cc.log(cc._LogInfos.AtlasNode_updateAtlasValues);
},
/** cc.AtlasNode - RGBA protocol
* @return {cc.Color}
*/
getColor: function () {
if (this._opacityModifyRGB)
return this._colorUnmodified;
return cc.Node.prototype.getColor.call(this);
},
/**
* @param {Boolean} value
*/
setOpacityModifyRGB: function (value) {
var oldColor = this.color;
this._opacityModifyRGB = value;
this.color = oldColor;
},
/**
* @return {Boolean}
*/
isOpacityModifyRGB: function () {
return this._opacityModifyRGB;
},
/** cc.AtlasNode - CocosNodeTexture protocol
* @return {cc.BlendFunc}
*/
getBlendFunc: function () {
return this._blendFunc;
},
/**
* BlendFunc setter
* @param {Number | cc.BlendFunc} src
* @param {Number} dst
*/
setBlendFunc: function (src, dst) {
if (dst === undefined)
this._blendFunc = src;
else
this._blendFunc = {src: src, dst: dst};
},
/**
* @param {cc.TextureAtlas} value
*/
setTextureAtlas: function (value) {
this.textureAtlas = value;
},
/**
* @return {cc.TextureAtlas}
*/
getTextureAtlas: function () {
return this.textureAtlas;
},
/**
* @return {Number}
*/
getQuadsToDraw: function () {
return this.quadsToDraw;
},
/**
* @param {Number} quadsToDraw
*/
setQuadsToDraw: function (quadsToDraw) {
this.quadsToDraw = quadsToDraw;
},
_textureForCanvas: null,
_originalTexture: null,
_uniformColor: null,
_colorF32Array: null,
/** initializes an cc.AtlasNode with an Atlas file the width and height of each item and the quantity of items to render
* @param {String} tile
* @param {Number} tileWidth
* @param {Number} tileHeight
* @param {Number} itemsToRender
* @return {Boolean}
*/
initWithTileFile: function (tile, tileWidth, tileHeight, itemsToRender) {
if (!tile)
throw "cc.AtlasNode.initWithTileFile(): title should not be null";
var texture = cc.textureCache.addImage(tile);
return this.initWithTexture(texture, tileWidth, tileHeight, itemsToRender);
},
/**
* initializes an CCAtlasNode with a texture the width and height of each item measured in points and the quantity of items to render
* @param {cc.Texture2D} texture
* @param {Number} tileWidth
* @param {Number} tileHeight
* @param {Number} itemsToRender
* @return {Boolean}
*/
initWithTexture: null,
_initWithTextureForCanvas: function (texture, tileWidth, tileHeight, itemsToRender) {
this._itemWidth = tileWidth;
this._itemHeight = tileHeight;
this._opacityModifyRGB = true;
this._originalTexture = texture;
if (!this._originalTexture) {
cc.log(cc._LogInfos.AtlasNode__initWithTexture);
return false;
}
this._textureForCanvas = this._originalTexture;
this._calculateMaxItems();
this.quadsToDraw = itemsToRender;
return true;
},
_initWithTextureForWebGL: function (texture, tileWidth, tileHeight, itemsToRender) {
this._itemWidth = tileWidth;
this._itemHeight = tileHeight;
this._colorUnmodified = cc.color.WHITE;
this._opacityModifyRGB = true;
this._blendFunc.src = cc.BLEND_SRC;
this._blendFunc.dst = cc.BLEND_DST;
var locRealColor = this._realColor;
this._colorF32Array = new Float32Array([locRealColor.r / 255.0, locRealColor.g / 255.0, locRealColor.b / 255.0, this._realOpacity / 255.0]);
this.textureAtlas = new cc.TextureAtlas();
this.textureAtlas.initWithTexture(texture, itemsToRender);
if (!this.textureAtlas) {
cc.log(cc._LogInfos.AtlasNode__initWithTexture);
return false;
}
this._updateBlendFunc();
this._updateOpacityModifyRGB();
this._calculateMaxItems();
this.quadsToDraw = itemsToRender;
//shader stuff
this.shaderProgram = cc.shaderCache.programForKey(cc.SHADER_POSITION_TEXTURE_UCOLOR);
this._uniformColor = cc._renderContext.getUniformLocation(this.shaderProgram.getProgram(), "u_color");
return true;
},
draw: null,
/**
* @param {WebGLRenderingContext} ctx renderContext
*/
_drawForWebGL: function (ctx) {
var context = ctx || cc._renderContext;
cc.nodeDrawSetup(this);
cc.glBlendFunc(this._blendFunc.src, this._blendFunc.dst);
if(this._uniformColor && this._colorF32Array){
context.uniform4fv(this._uniformColor, this._colorF32Array);
this.textureAtlas.drawNumberOfQuads(this.quadsToDraw, 0);
}
},
/**
* @function
* @param {cc.Color} color3
*/
setColor: null,
_setColorForCanvas: function (color3) {
var locRealColor = this._realColor;
if ((locRealColor.r == color3.r) && (locRealColor.g == color3.g) && (locRealColor.b == color3.b))
return;
var temp = cc.color(color3.r, color3.g, color3.b);
this._colorUnmodified = color3;
if (this._opacityModifyRGB) {
var locDisplayedOpacity = this._displayedOpacity;
temp.r = temp.r * locDisplayedOpacity / 255;
temp.g = temp.g * locDisplayedOpacity / 255;
temp.b = temp.b * locDisplayedOpacity / 255;
}
cc.Node.prototype.setColor.call(this, color3);
this._changeTextureColor();
},
_changeTextureColor: function(){
var locTexture = this.getTexture();
if (locTexture && this._originalTexture) {
var element = this._originalTexture.getHtmlElementObj();
if(!element)
return;
var locElement = locTexture.getHtmlElementObj();
var textureRect = cc.rect(0, 0, element.width, element.height);
if (locElement instanceof HTMLCanvasElement)
cc.generateTintImageWithMultiply(element, this._displayedColor, textureRect, locElement);
else {
locElement = cc.generateTintImageWithMultiply(element, this._displayedColor, textureRect);
locTexture = new cc.Texture2D();
locTexture.initWithElement(locElement);
locTexture.handleLoadedTexture();
this.setTexture(locTexture);
}
}
},
_setColorForWebGL: function (color3) {
var temp = cc.color(color3.r, color3.g, color3.b);
this._colorUnmodified = color3;
var locDisplayedOpacity = this._displayedOpacity;
if (this._opacityModifyRGB) {
temp.r = temp.r * locDisplayedOpacity / 255;
temp.g = temp.g * locDisplayedOpacity / 255;
temp.b = temp.b * locDisplayedOpacity / 255;
}
cc.Node.prototype.setColor.call(this, color3);
var locDisplayedColor = this._displayedColor;
this._colorF32Array = new Float32Array([locDisplayedColor.r / 255.0, locDisplayedColor.g / 255.0,
locDisplayedColor.b / 255.0, locDisplayedOpacity / 255.0]);
},
/**
* @function
* @param {Number} opacity
*/
setOpacity: function (opacity) {
},
_setOpacityForCanvas: function (opacity) {
cc.Node.prototype.setOpacity.call(this, opacity);
// special opacity for premultiplied textures
if (this._opacityModifyRGB) {
this.color = this._colorUnmodified;
}
},
_setOpacityForWebGL: function (opacity) {
cc.Node.prototype.setOpacity.call(this, opacity);
// special opacity for premultiplied textures
if (this._opacityModifyRGB) {
this.color = this._colorUnmodified;
} else {
var locDisplayedColor = this._displayedColor;
this._colorF32Array = new Float32Array([locDisplayedColor.r / 255.0, locDisplayedColor.g / 255.0,
locDisplayedColor.b / 255.0, this._displayedOpacity / 255.0]);
}
},
// cc.Texture protocol
/**
* returns the used texture
* @function
* @return {cc.Texture2D}
*/
getTexture: null,
_getTextureForCanvas: function () {
return this._textureForCanvas;
},
_getTextureForWebGL: function () {
return this.textureAtlas.texture;
},
/**
* sets a new texture. it will be retained
* @function
* @param {cc.Texture2D} texture
*/
setTexture: null,
_setTextureForCanvas: function (texture) {
this._textureForCanvas = texture;
},
_setTextureForWebGL: function (texture) {
this.textureAtlas.texture = texture;
this._updateBlendFunc();
this._updateOpacityModifyRGB();
},
_calculateMaxItems: null,
_calculateMaxItemsForCanvas: function () {
var selTexture = this.texture;
var size = selTexture.getContentSize();
this._itemsPerColumn = 0 | (size.height / this._itemHeight);
this._itemsPerRow = 0 | (size.width / this._itemWidth);
},
_calculateMaxItemsForWebGL: function () {
var selTexture = this.texture;
var size = selTexture.getContentSize();
if (this._ignoreContentScaleFactor)
size = selTexture.getContentSizeInPixels();
this._itemsPerColumn = 0 | (size.height / this._itemHeight);
this._itemsPerRow = 0 | (size.width / this._itemWidth);
},
_updateBlendFunc: function () {
if (!this.textureAtlas.texture.hasPremultipliedAlpha()) {
this._blendFunc.src = cc.SRC_ALPHA;
this._blendFunc.dst = cc.ONE_MINUS_SRC_ALPHA;
}
},
_updateOpacityModifyRGB: function () {
this._opacityModifyRGB = this.textureAtlas.texture.hasPremultipliedAlpha();
},
_setIgnoreContentScaleFactor: function (ignoreContentScaleFactor) {
this._ignoreContentScaleFactor = ignoreContentScaleFactor;
}
});
var _p = cc.AtlasNode.prototype;
if (cc._renderType === cc._RENDER_TYPE_WEBGL) {
_p.initWithTexture = _p._initWithTextureForWebGL;
_p.draw = _p._drawForWebGL;
_p.setColor = _p._setColorForWebGL;
_p.setOpacity = _p._setOpacityForWebGL;
_p.getTexture = _p._getTextureForWebGL;
_p.setTexture = _p._setTextureForWebGL;
_p._calculateMaxItems = _p._calculateMaxItemsForWebGL;
} else {
_p.initWithTexture = _p._initWithTextureForCanvas;
_p.draw = cc.Node.prototype.draw;
_p.setColor = _p._setColorForCanvas;
_p.setOpacity = _p._setOpacityForCanvas;
_p.getTexture = _p._getTextureForCanvas;
_p.setTexture = _p._setTextureForCanvas;
_p._calculateMaxItems = _p._calculateMaxItemsForCanvas;
if(!cc.sys._supportCanvasNewBlendModes)
_p._changeTextureColor = function(){
var locElement, locTexture = this.getTexture();
if (locTexture && this._originalTexture) {
locElement = locTexture.getHtmlElementObj();
if (!locElement)
return;
var element = this._originalTexture.getHtmlElementObj();
var cacheTextureForColor = cc.textureCache.getTextureColors(element);
if (cacheTextureForColor) {
var textureRect = cc.rect(0, 0, element.width, element.height);
if (locElement instanceof HTMLCanvasElement)
cc.generateTintImage(locElement, cacheTextureForColor, this._displayedColor, textureRect, locElement);
else {
locElement = cc.generateTintImage(locElement, cacheTextureForColor, this._displayedColor, textureRect);
locTexture = new cc.Texture2D();
locTexture.initWithElement(locElement);
locTexture.handleLoadedTexture();
this.setTexture(locTexture);
}
}
}
};
}
// Override properties
cc.defineGetterSetter(_p, "opacity", _p.getOpacity, _p.setOpacity);
cc.defineGetterSetter(_p, "color", _p.getColor, _p.setColor);
// Extended properties
/** @expose */
_p.texture;
cc.defineGetterSetter(_p, "texture", _p.getTexture, _p.setTexture);
/** @expose */
_p.textureAtlas;
/** @expose */
_p.quadsToDraw;
/** creates a cc.AtlasNode with an Atlas file the width and height of each item and the quantity of items to render
* @deprecated
* @param {String} tile
* @param {Number} tileWidth
* @param {Number} tileHeight
* @param {Number} itemsToRender
* @return {cc.AtlasNode}
* @example
* // example
* var node = cc.AtlasNode.create("pathOfTile", 16, 16, 1);
*/
cc.AtlasNode.create = function (tile, tileWidth, tileHeight, itemsToRender) {
return new cc.AtlasNode(tile, tileWidth, tileHeight, itemsToRender);
};
| {
"content_hash": "d585779064a4870b593568dfbd7b0990",
"timestamp": "",
"source": "github",
"line_count": 455,
"max_line_length": 158,
"avg_line_length": 33.30769230769231,
"alnum_prop": 0.6154404486967997,
"repo_name": "SystemEngineer/coastline-js",
"id": "8137fbce7409a3bb93be5fc2f841877ca8473484",
"size": "16508",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "client/frameworks/cocos2d-html5/cocos2d/core/base-nodes/CCAtlasNode.js",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "JavaScript",
"bytes": "3770527"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Login Page - Photon Admin Panel Theme</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<link rel="shortcut icon" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/favicon.ico"/>
<link rel="apple-touch-icon" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/iosicon.png"/>
<link rel="stylesheet" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/css/css_compiled/photon-min.css?v1.1" media="all"/>
<link rel="stylesheet" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/css/css_compiled/photon-min-part2.css?v1.1" media="all"/>
<link rel="stylesheet" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/css/css_compiled/photon-responsive-min.css?v1.1" media="all"/>
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="css/css_compiled/ie-only-min.css?v1.1" />
<![endif]-->
<!--[if lt IE 9]>
<link rel="stylesheet" type="text/css" href="css/css_compiled/ie8-only-min.css?v1.1" />
<script type="text/javascript" src="js/plugins/excanvas.js"></script>
<script type="text/javascript" src="js/plugins/html5shiv.js"></script>
<script type="text/javascript" src="js/plugins/respond.min.js"></script>
<script type="text/javascript" src="js/plugins/fixFontIcons.js"></script>
<![endif]-->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/bootstrap/bootstrap.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/modernizr.custom.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/jquery.pnotify.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/less-1.3.1.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/xbreadcrumbs.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/jquery.maskedinput-1.3.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/jquery.autotab-1.1b.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/charCount.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/jquery.textareaCounter.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/elrte.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/elrte.en.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/select2.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/jquery-picklist.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/jquery.validate.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/additional-methods.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/jquery.form.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/jquery.metadata.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/jquery.mockjax.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/jquery.uniform.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/jquery.tagsinput.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/jquery.rating.pack.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/farbtastic.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/jquery.timeentry.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/jquery.jstree.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/dataTables.bootstrap.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/jquery.mousewheel.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/jquery.mCustomScrollbar.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/jquery.flot.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/jquery.flot.stack.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/jquery.flot.pie.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/jquery.flot.resize.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/raphael.2.1.0.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/justgage.1.0.1.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/jquery.qrcode.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/jquery.clock.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/jquery.countdown.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/jquery.jqtweet.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/jquery.cookie.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/bootstrap-fileupload.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/prettify/prettify.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/bootstrapSwitch.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/plugins/mfupload.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/js/common.js"></script>
</head>
<body class="body-login">
<div class="nav-fixed-topright" style="visibility: hidden">
<ul class="nav nav-user-menu">
<li class="user-sub-menu-container">
<a href="javascript:;">
<i class="user-icon"></i><span class="nav-user-selection">Theme Options</span><i class="icon-menu-arrow"></i>
</a>
<ul class="nav user-sub-menu">
<li class="light">
<a href="javascript:;">
<i class='icon-photon stop'></i>Light Version
</a>
</li>
<li class="dark">
<a href="javascript:;">
<i class='icon-photon stop'></i>Dark Version
</a>
</li>
</ul>
</li>
<li>
<a href="javascript:;">
<i class="icon-photon mail"></i>
</a>
</li>
<li>
<a href="javascript:;">
<i class="icon-photon comment_alt2_stroke"></i>
<div class="notification-count">12</div>
</a>
</li>
</ul>
</div>
<script>
$(function(){
setTimeout(function(){
$('.nav-fixed-topright').removeAttr('style');
}, 300);
$(window).scroll(function(){
if($('.breadcrumb-container').length){
var scrollState = $(window).scrollTop();
if (scrollState > 0) $('.nav-fixed-topright').addClass('nav-released');
else $('.nav-fixed-topright').removeClass('nav-released')
}
});
$('.user-sub-menu-container').on('click', function(){
$(this).toggleClass('active-user-menu');
});
$('.user-sub-menu .light').on('click', function(){
if ($('body').is('.light-version')) return;
$('body').addClass('light-version');
setTimeout(function() {
$.cookie('themeColor', 'light', {
expires: 7,
path: '/'
});
}, 500);
});
$('.user-sub-menu .dark').on('click', function(){
if ($('body').is('.light-version')) {
$('body').removeClass('light-version');
$.cookie('themeColor', 'dark', {
expires: 7,
path: '/'
});
}
});
});
</script>
<div class="container-login">
<div class="form-centering-wrapper">
<div class="form-window-login">
<div class="form-window-login-logo">
<div class="login-logo">
<img src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/images/photon/js/js/plugins/images/photon/login-logo@2x.png" alt="Photon UI"/>
</div>
<h2 class="login-title">Welcome to Photon UI!</h2>
<div class="login-member">Not a Member? <a href="jquery.autotab-1.1b.js.html#">Sign Up »</a>
<a href="jquery.autotab-1.1b.js.html#" class="btn btn-facebook"><i class="icon-fb"></i>Login with Facebook<i class="icon-fb-arrow"></i></a>
</div>
<div class="login-or">Or</div>
<div class="login-input-area">
<form method="POST" action="dashboard.php">
<span class="help-block">Login With Your Photon Account</span>
<input type="text" name="email" placeholder="Email">
<input type="password" name="password" placeholder="Password">
<button type="submit" class="btn btn-large btn-success btn-login">Login</button>
</form>
<a href="jquery.autotab-1.1b.js.html#" class="forgot-pass">Forgot Your Password?</a>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-1936460-27']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>
| {
"content_hash": "2b107c10f9e7257c83492c2f9ee50ee1",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 223,
"avg_line_length": 82.45054945054945,
"alnum_prop": 0.7377049180327869,
"repo_name": "user-tony/photon-rails",
"id": "4e660ed6704185515fae052369780eec7e86fea4",
"size": "15006",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/assets/css/css_compiled/@{photonImagePath}plugins/elrte/css/css_compiled/images/photon/js/js/plugins/jquery.autotab-1.1b.js.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "291750913"
},
{
"name": "JavaScript",
"bytes": "59305"
},
{
"name": "Ruby",
"bytes": "203"
},
{
"name": "Shell",
"bytes": "99"
}
],
"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/html; charset=utf-8" />
<title>Welcome to PyBayes’s documentation! — PyBayes 1.0 documentation</title>
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="PyBayes 1.0 documentation" href="#" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="nav-item nav-item-0"><a href="#">PyBayes 1.0 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="welcome-to-pybayes-s-documentation">
<h1>Welcome to PyBayes’s documentation!<a class="headerlink" href="#welcome-to-pybayes-s-documentation" title="Permalink to this headline">¶</a></h1>
<p>Contents:</p>
<div class="toctree-wrapper compound">
<ul class="simple">
</ul>
</div>
</div>
<div class="section" id="indices-and-tables">
<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h1>
<ul class="simple">
<li><a class="reference internal" href="genindex.html"><span>Index</span></a></li>
<li><a class="reference internal" href="py-modindex.html"><span>Module Index</span></a></li>
<li><a class="reference internal" href="search.html"><span>Search Page</span></a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="#">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Welcome to PyBayes’s documentation!</a></li>
<li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li>
</ul>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/index.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
©2016, Nathan Pucheril, Keith Hardaway.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.1</a>
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.3</a>
|
<a href="_sources/index.txt"
rel="nofollow">Page source</a></li>
</div>
</body>
</html> | {
"content_hash": "dc0dd02905e0ab6a6159e9f1bef2aee6",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 155,
"avg_line_length": 34.888888888888886,
"alnum_prop": 0.610485056344929,
"repo_name": "nathanpucheril/PyBayes",
"id": "280c7cf9d480b4604a7051939f1e5bc9423f8b31",
"size": "4086",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "docs/docs/_build/html/index.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "16603"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/Hongbao.iml" filepath="$PROJECT_DIR$/Hongbao.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
</modules>
</component>
</project> | {
"content_hash": "6cf6528fe6f11124bbccd0e6ce078946",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 96,
"avg_line_length": 39,
"alnum_prop": 0.6552706552706553,
"repo_name": "xuehaiwuya12/h3_ong4_bao",
"id": "169f6d12421b5a03c6371358467db4a6c594271a",
"size": "351",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Hongbao/.idea/modules.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "26454"
}
],
"symlink_target": ""
} |
Charts are a popular and convenient way to visualize data in Rally. Unfortunately due to their complexity they are also one of the most difficult tasks perform when writing apps.
This exercise will demonstrate how to use the [Rally.ui.chart.Chart](http://help.rallydev.com/apps/2.1/doc/#!/api/Rally.ui.chart.Chart) component to build a basic chart showing portfolio item throughput by release.
Some helpful documentation:
* [Rally.ui.chart.Chart](http://help.rallydev.com/apps/2.1/doc/#!/api/Rally.ui.chart.Chart)
* [Data Visualization Guide](https://help.rallydev.com/apps/2.1/doc/#!/guide/data_visualization)
* [Bare Metal Chart Example](https://help.rallydev.com/apps/2.1/doc/#!/example/bare-metal-chart)
* [Lodash](https://help.rallydev.com/apps/2.1/doc/#!/guide/third_party_libs-section-lo-dash-2.4.1)
* [Highcharts API Reference](http://api.highcharts.com/highcharts)
A [solution](solution/) to this problem is provided to compare against.
| {
"content_hash": "201f8c43d06dad361409527d89ac96d4",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 214,
"avg_line_length": 73.15384615384616,
"alnum_prop": 0.7644584647739222,
"repo_name": "RallyApps/getting-started",
"id": "6b2147d8ceebcb5ab29746edb684a40912e73078",
"size": "961",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "charts/README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "440"
},
{
"name": "JavaScript",
"bytes": "20397"
}
],
"symlink_target": ""
} |
// Copyright (c) 2017. Bartosz Rachwal. The National Institute of Advanced Industrial Science and Technology, Japan. All rights reserved.
using System;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using IoT.Common.Encryption.Hash;
using IoT.Common.Encryption.Service;
using IoT.Common.Log;
using IoT.Common.Tools;
using IoT.Device.Coordinator;
using IoT.Device.Register;
using IoT.Device.Server;
using IoT.Device.Server.Configuration;
namespace IoT.Console
{
public class Program
{
public static void Main(string[] args)
{
var host = "192.168.12.3";
ushort port = 8000;
var deviceListenerIpAddress = IPAddress.Parse(host);
var deviceServerConfiguration = new DefaultDeviceServerConfiguration(deviceListenerIpAddress, port);
var hashAlgorithm = new HMACSHA256Algorithm();
var deviceRegister = new DefaultDeviceRegister(hashAlgorithm);
deviceRegister.Register("d3eea2beeb292f7e57fbddb8cac330c8", "acd00f2964667ef33f23d3ce0d80117a");
deviceRegister.Register("7bbabd1e128a7642d27757bf47012950", "68b3ca8f0a5eb99b1650f70069071abf");
var logger = new ConsoleLogger();
var encryptionService = new DefaultEncyptionService(deviceRegister);
var deviceCoordinator = new DefaultDeviceCoordinator(encryptionService, logger);
var deviceServer = new EdgeDeviceServer(deviceServerConfiguration, deviceCoordinator);
deviceServer.StartAsync();
WaitForExit();
}
private static byte[] FormatMessage(string message)
{
var mod = (message.Length + 3) % 16;
var size = mod == 0 ? message.Length + 3 : message.Length + 3 + 16 - mod;
var formatted = new byte[size];
formatted[message.Length] = 23;
formatted[message.Length + 1] = 56;
formatted[message.Length + 2] = 10;
Encoding.UTF8.GetBytes(message, 0, message.Length, formatted, 0);
return formatted;
}
private static void WaitForExit()
{
var run = true;
while (run)
{
var text = System.Console.ReadLine();
if (string.IsNullOrEmpty(text))
continue;
if (text.Trim().ToLower().Equals("exit"))
{
run = false;
}
}
}
}
} | {
"content_hash": "cbe4b2c56794e430af99064662989c70",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 138,
"avg_line_length": 34.342465753424655,
"alnum_prop": 0.6198643797367371,
"repo_name": "rachwal/IoT",
"id": "649ee7a04e7cc53cd276fb81e28ea9d0ba3d17fa",
"size": "2509",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "IoT/IoT.Console/Program.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "38631"
}
],
"symlink_target": ""
} |
use std::collections::HashMap;
use std::path::PathBuf;
use std::env;
use tempdir::TempDir;
use super::stream::{Stream, StreamError};
use super::parser::{parse_statement, Statement, ParseError, ColumnSpec};
use super::row::builder::RowBuilder;
use super::parser::Expression;
use super::storage::disk::Disk;
use super::storage::memory::Memory;
#[derive(Debug, PartialEq)]
pub enum DatabaseError {
TableExists,
QueryParseError,
UnknownError,
StreamNotFound,
FieldNotFound(String),
}
type DatabaseResult<T> = Result<T, DatabaseError>;
#[derive(Debug)]
pub enum QueryResult {
ResultSet(ResultSet),
Insert(u64),
StreamCreated,
}
impl From<ParseError> for DatabaseError {
fn from(err: ParseError) -> DatabaseError {
DatabaseError::QueryParseError
}
}
impl From<StreamError> for DatabaseError {
fn from(err: StreamError) -> DatabaseError {
let tmp = match err {
StreamError::FieldNotFound(x) =>
DatabaseError::FieldNotFound(x),
_ =>
DatabaseError::UnknownError
};
tmp
}
}
#[derive(Debug)]
struct ResultSet {
statement: Statement,
num_results: u64,
}
impl ResultSet {
fn new(statement: Statement) -> ResultSet {
ResultSet{num_results:0, statement: statement}
}
}
pub struct Database {
path: PathBuf,
tables: HashMap<String, Stream>
}
impl Database {
pub fn new(path: PathBuf) -> Database {
// create the directory if it doesn't exist?
Database{
tables: HashMap::new(),
path: path,
}
}
pub fn new_temp() -> Database {
let tmpdir = TempDir::new("totalrecalldb").expect("Creating temp dir failed");
info!("Created temporary DB at {:?}", tmpdir.path());
Database::new(tmpdir.into_path())
}
pub fn create_stream(&mut self, name: &str) -> DatabaseResult<&mut Stream> {
if self.tables.contains_key(name) {
return Err(DatabaseError::TableExists);
}
let mut p = self.path.clone();
p.push(name);
let storage = Disk::new(50, p).expect("Could not create disk storage");
let tmp = Stream::new(storage);
self.tables.insert(name.to_string(), tmp);
let stream = self.tables.get_mut(name).unwrap();
Ok(stream)
}
pub fn create_temp_stream(&mut self) -> DatabaseResult<Stream> {
let storage = Memory::new().expect("Memory is failing uggghhh");
let mut stream = Stream::new(storage);
Ok(stream)
}
fn get_stream(&self, name: &str) -> Option<&Stream> {
self.tables.get(name)
}
fn get_stream_mut(&mut self, name: &str) -> Option<&mut Stream> {
self.tables.get_mut(name)
}
pub fn execute(&mut self, query: &str) -> Result<QueryResult, DatabaseError> {
let parsed = parse_statement(query)?;
let p2 = parsed.clone();
let result = match parsed {
Statement::Insert(stream, row_builder) =>
self.insert(&stream, row_builder),
Statement::DeclareStream(stream, fields) =>
self.declare_stream(&stream, fields),
Statement::Select(table, predicates) => {
// going to return the resultset now
// the expectation is that all the validation be done up front
let tmp = ResultSet::new(p2);
Ok(QueryResult::ResultSet(tmp))
}
_ => Err(DatabaseError::UnknownError)
};
result
}
pub fn select(&self, stream: &str, predicates: Option<Box<Expression>>) ->
Result<QueryResult, DatabaseError> {
let result = self.get_stream(stream)
.ok_or(DatabaseError::StreamNotFound)?
.select(predicates)?;
Err(DatabaseError::UnknownError)
}
pub fn insert(&mut self, stream: &str, row_builder: RowBuilder) -> DatabaseResult<QueryResult> {
let stream = self.get_stream_mut(stream).ok_or(DatabaseError::StreamNotFound)?;
let id = stream.insert(row_builder)?;
Ok(QueryResult::Insert(id))
}
pub fn declare_stream(&mut self,
stream: &str,
fields: Vec<ColumnSpec>) -> DatabaseResult<QueryResult> {
let stream = self.create_stream(stream)?;
for col_spec in fields {
stream.schema.add_type(&col_spec.name, col_spec.ftype);
}
Ok(QueryResult::StreamCreated)
}
}
#[cfg(test)]
mod tests {
use super::Database;
use super::DatabaseError;
// returns a valid DB for use with testing with valid simple schema
fn get_db_with_stream() -> Database {
let mut db = Database::new_temp();
db.create_stream("Jon");
db
}
#[test]
fn create_table() {
let mut db = Database::new_temp();
db.create_stream("Jon");
}
#[test]
fn create_table_fails_when_table_exists() {
let mut db = get_db_with_stream();
if let Err(result) = db.create_stream("Jon") {
assert_eq!(result, DatabaseError::TableExists);
} else {
panic!("Was expecting DatabaseError::TableExists, got an OK");
}
}
}
| {
"content_hash": "36fcbb1da9c42609449ce4a0ae95a701",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 100,
"avg_line_length": 28.43548387096774,
"alnum_prop": 0.5865002836074872,
"repo_name": "rustyrazorblade/TotalRecallDB",
"id": "8a06dbf8bcc0ea7618dccbbaf209f43839492417",
"size": "5289",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/db/database.rs",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Python",
"bytes": "694"
},
{
"name": "Rust",
"bytes": "53688"
}
],
"symlink_target": ""
} |
layout: post
date: '2016-01-18'
title: "Alan Hannah Bardot Sleeveless Tea-Length Aline/Princess"
category: Alan Hannah
tags: [Alan Hannah,Aline/Princess ,Bateau,Tea-Length,Sleeveless]
---
### Alan Hannah Bardot
Just **$329.99**
### Sleeveless Tea-Length Aline/Princess
<table><tr><td>BRANDS</td><td>Alan Hannah</td></tr><tr><td>Silhouette</td><td>Aline/Princess </td></tr><tr><td>Neckline</td><td>Bateau</td></tr><tr><td>Hemline/Train</td><td>Tea-Length</td></tr><tr><td>Sleeve</td><td>Sleeveless</td></tr></table>
<a href="https://www.readybrides.com/en/alan-hannah/19877-alan-hannah-bardot.html"><img src="//static.msromantic.com/45027/alan-hannah-bardot.jpg" alt="Alan Hannah Bardot" style="width:100%;" /></a>
<!-- break --><a href="https://www.readybrides.com/en/alan-hannah/19877-alan-hannah-bardot.html"><img src="//static.msromantic.com/45028/alan-hannah-bardot.jpg" alt="Alan Hannah Bardot" style="width:100%;" /></a>
<a href="https://www.readybrides.com/en/alan-hannah/19877-alan-hannah-bardot.html"><img src="//static.msromantic.com/45026/alan-hannah-bardot.jpg" alt="Alan Hannah Bardot" style="width:100%;" /></a>
Buy it: [https://www.readybrides.com/en/alan-hannah/19877-alan-hannah-bardot.html](https://www.readybrides.com/en/alan-hannah/19877-alan-hannah-bardot.html)
| {
"content_hash": "be3bc421d801922af49ef25f3301abba",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 245,
"avg_line_length": 85.86666666666666,
"alnum_prop": 0.7204968944099379,
"repo_name": "variousweddingdress/variousweddingdress.github.io",
"id": "a5ddcab2ab8d15b42db0242f96e2f72abf8cee8a",
"size": "1292",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_posts/2016-01-18-Alan-Hannah-Bardot-Sleeveless-TeaLength-AlinePrincess.md",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "83876"
},
{
"name": "HTML",
"bytes": "14755"
},
{
"name": "Ruby",
"bytes": "897"
}
],
"symlink_target": ""
} |
import json
import os
from django import http
from django.views import generic
from horizon import exceptions
ADD_TO_FIELD_HEADER = "HTTP_X_HORIZON_ADD_TO_FIELD"
class ModalFormMixin(object):
def get_template_names(self):
if self.request.is_ajax():
if not hasattr(self, "ajax_template_name"):
# Transform standard template name to ajax name (leading "_")
bits = list(os.path.split(self.template_name))
bits[1] = "".join(("_", bits[1]))
self.ajax_template_name = os.path.join(*bits)
template = self.ajax_template_name
else:
template = self.template_name
return template
def get_context_data(self, **kwargs):
context = super(ModalFormMixin, self).get_context_data(**kwargs)
if self.request.is_ajax():
context['hide'] = True
if ADD_TO_FIELD_HEADER in self.request.META:
context['add_to_field'] = self.request.META[ADD_TO_FIELD_HEADER]
return context
class ModalFormView(ModalFormMixin, generic.FormView):
"""
The main view class from which all views which handle forms in Horizon
should inherit. It takes care of all details with processing
:class:`~horizon.forms.base.SelfHandlingForm` classes, and modal concerns
when the associated template inherits from
`horizon/common/_modal_form.html`.
Subclasses must define a ``form_class`` and ``template_name`` attribute
at minimum.
See Django's documentation on the `FormView <https://docs.djangoproject.com
/en/dev/ref/class-based-views/generic-editing/#formview>`_ class for
more details.
"""
def get_object_id(self, obj):
"""
For dynamic insertion of resources created in modals, this method
returns the id of the created object. Defaults to returning the ``id``
attribute.
"""
return obj.id
def get_object_display(self, obj):
"""
For dynamic insertion of resources created in modals, this method
returns the display name of the created object. Defaults to returning
the ``name`` attribute.
"""
return obj.name
def get_form(self, form_class):
"""
Returns an instance of the form to be used in this view.
"""
return form_class(self.request, **self.get_form_kwargs())
def form_valid(self, form):
try:
handled = form.handle(self.request, form.cleaned_data)
except:
handled = None
exceptions.handle(self.request)
if handled:
if ADD_TO_FIELD_HEADER in self.request.META:
field_id = self.request.META[ADD_TO_FIELD_HEADER]
data = [self.get_object_id(handled),
self.get_object_display(handled)]
response = http.HttpResponse(json.dumps(data))
response["X-Horizon-Add-To-Field"] = field_id
elif isinstance(handled, http.HttpResponse):
return handled
else:
success_url = self.get_success_url()
response = http.HttpResponseRedirect(success_url)
# TODO(gabriel): This is not a long-term solution to how
# AJAX should be handled, but it's an expedient solution
# until the blueprint for AJAX handling is architected
# and implemented.
response['X-Horizon-Location'] = success_url
return response
else:
# If handled didn't return, we can assume something went
# wrong, and we should send back the form as-is.
return self.form_invalid(form)
| {
"content_hash": "6660c64b571b8eeb3bdde2039bdcb470",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 79,
"avg_line_length": 36.97029702970297,
"alnum_prop": 0.6076593465452598,
"repo_name": "rackerlabs/horizon",
"id": "b37c4d254ac2e1d126c2732d63d6f169224517ef",
"size": "4384",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "horizon/forms/views.py",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package storage
import (
"fmt"
"github.com/matrix-org/dendrite/federationapi/storage/postgres"
"github.com/matrix-org/dendrite/federationapi/storage/sqlite3"
"github.com/matrix-org/dendrite/internal/caching"
"github.com/matrix-org/dendrite/setup/base"
"github.com/matrix-org/dendrite/setup/config"
"github.com/matrix-org/gomatrixserverlib"
)
// NewDatabase opens a new database
func NewDatabase(base *base.BaseDendrite, dbProperties *config.DatabaseOptions, cache caching.FederationCache, isLocalServerName func(gomatrixserverlib.ServerName) bool) (Database, error) {
switch {
case dbProperties.ConnectionString.IsSQLite():
return sqlite3.NewDatabase(base, dbProperties, cache, isLocalServerName)
case dbProperties.ConnectionString.IsPostgres():
return postgres.NewDatabase(base, dbProperties, cache, isLocalServerName)
default:
return nil, fmt.Errorf("unexpected database type")
}
}
| {
"content_hash": "8371519fa0c1869c321bdc037f7cff3e",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 189,
"avg_line_length": 37.708333333333336,
"alnum_prop": 0.8022099447513812,
"repo_name": "matrix-org/dendrite",
"id": "142e281ea1489b0ea22a555479299ae9dc36eebc",
"size": "1549",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "federationapi/storage/storage.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1233"
},
{
"name": "Dockerfile",
"bytes": "13674"
},
{
"name": "Go",
"bytes": "4019336"
},
{
"name": "JavaScript",
"bytes": "1799"
},
{
"name": "Python",
"bytes": "9860"
},
{
"name": "Shell",
"bytes": "11023"
}
],
"symlink_target": ""
} |
#ifndef TENSORFLOW_COMPILER_MLIR_TOOLS_KERNEL_GEN_TRANSFORMS_PASSES_H_
#define TENSORFLOW_COMPILER_MLIR_TOOLS_KERNEL_GEN_TRANSFORMS_PASSES_H_
#include <memory>
#include "mlir/Dialect/GPU/GPUDialect.h" // from @llvm-project
#include "mlir/Dialect/LLVMIR/LLVMDialect.h" // from @llvm-project
#include "mlir/IR/Module.h" // from @llvm-project
#include "mlir/Pass/Pass.h" // from @llvm-project
namespace mlir {
namespace kernel_gen {
namespace tf_framework {
// Pass to replace some of the Standard ops with TF Framework ops.
// * adds tf_framework::OpKernelContextType argument to the function
// * std.alloc becomes tf_framework.alloc_raw
// * std.dealloc becomes tf_framework.dealloc_raw
std::unique_ptr<OperationPass<ModuleOp> > CreateEmbedTFFrameworkPass();
} // namespace tf_framework
namespace transforms {
// Pass for applying LLVM legalization patterns.
std::unique_ptr<OperationPass<ModuleOp> > CreateTFKernelToLLVMPass();
// Pass to tranform shape computations in shape dialect to standard and scf
// using memref descriptors.
std::unique_ptr<OperationPass<ModuleOp> > CreateShapeToDescriptorsPass();
// Pass to tranform computations on values to their corresponding parts on
// buffers.
std::unique_ptr<OperationPass<ModuleOp> > CreateBufferizePass();
// Pass to materialize broadcasts.
std::unique_ptr<FunctionPass> CreateMaterializeBroadcastsPass();
// Pass to convert scf::ParallelOp to scf::ForOp.
std::unique_ptr<FunctionPass> CreateParallelLoopsToSequential();
// Pass to propagate TF ABI knowledge, e.g. offsets, alignment.
std::unique_ptr<OperationPass<LLVM::LLVMFuncOp>>
CreatePropagateTensorFlowABIKnowledgePass(
mlir::FunctionType type = {}, llvm::ArrayRef<uint32_t> same_shape = {});
// Pass to annotate GPU Module with its PTX.
std::unique_ptr<OperationPass<gpu::GPUModuleOp>> CreateGpuKernelToBlobPass(
mlir::StringRef blob_annotation = "", int32_t architecture = 0);
// Pass to unfuse batch norm.
std::unique_ptr<FunctionPass> CreateUnfuseBatchNormPass();
} // namespace transforms
#define GEN_PASS_REGISTRATION
#include "tensorflow/compiler/mlir/tools/kernel_gen/transforms/kernel_gen_passes.h.inc"
} // namespace kernel_gen
} // namespace mlir
#endif // TENSORFLOW_COMPILER_MLIR_TOOLS_KERNEL_GEN_TRANSFORMS_PASSES_H_
| {
"content_hash": "9ee53584e9225c402de9843675fa31fd",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 87,
"avg_line_length": 35.609375,
"alnum_prop": 0.7687582272926722,
"repo_name": "davidzchen/tensorflow",
"id": "967473c3fc9073d2dc249e5f6d8dbbec07f2cc63",
"size": "2947",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tensorflow/compiler/mlir/tools/kernel_gen/transforms/passes.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "32240"
},
{
"name": "Batchfile",
"bytes": "55269"
},
{
"name": "C",
"bytes": "887514"
},
{
"name": "C#",
"bytes": "8562"
},
{
"name": "C++",
"bytes": "81865221"
},
{
"name": "CMake",
"bytes": "6500"
},
{
"name": "Dockerfile",
"bytes": "112853"
},
{
"name": "Go",
"bytes": "1867241"
},
{
"name": "HTML",
"bytes": "4686483"
},
{
"name": "Java",
"bytes": "971474"
},
{
"name": "Jupyter Notebook",
"bytes": "549437"
},
{
"name": "LLVM",
"bytes": "6536"
},
{
"name": "MLIR",
"bytes": "1921657"
},
{
"name": "Makefile",
"bytes": "65901"
},
{
"name": "Objective-C",
"bytes": "116558"
},
{
"name": "Objective-C++",
"bytes": "316967"
},
{
"name": "PHP",
"bytes": "4236"
},
{
"name": "Pascal",
"bytes": "318"
},
{
"name": "Pawn",
"bytes": "19963"
},
{
"name": "Perl",
"bytes": "7536"
},
{
"name": "Python",
"bytes": "37285698"
},
{
"name": "RobotFramework",
"bytes": "1779"
},
{
"name": "Roff",
"bytes": "2705"
},
{
"name": "Ruby",
"bytes": "7464"
},
{
"name": "SWIG",
"bytes": "8992"
},
{
"name": "Shell",
"bytes": "700629"
},
{
"name": "Smarty",
"bytes": "35540"
},
{
"name": "Starlark",
"bytes": "3604653"
},
{
"name": "Swift",
"bytes": "62814"
},
{
"name": "Vim Snippet",
"bytes": "58"
}
],
"symlink_target": ""
} |
#ifndef INCLUDE_git_time_h__
#define INCLUDE_git_time_h__
#include "git2/common.h"
GIT_BEGIN_DECL
/**
* Return a monotonic time value, useful for measuring running time
* and setting up timeouts.
*
* The returned value is an arbitrary point in time -- it can only be
* used when comparing it to another `git_time_monotonic` call.
*
* The time is returned in seconds, with a decimal fraction that differs
* on accuracy based on the underlying system, but should be least
* accurate to Nanoseconds.
*
* This function cannot fail.
*/
GIT_EXTERN(double) git_time_monotonic(void);
GIT_END_DECL
#endif
| {
"content_hash": "8993e90d527a6e38baf7a82f3c927c7b",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 72,
"avg_line_length": 23.615384615384617,
"alnum_prop": 0.7280130293159609,
"repo_name": "GuapoTaco/chigraph",
"id": "e4f87e6e1d305ea5fbb867b5170af40adc3a8e38",
"size": "828",
"binary": false,
"copies": "17",
"ref": "refs/heads/master",
"path": "third_party/libgit2/include/git2/sys/time.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C++",
"bytes": "365956"
},
{
"name": "CMake",
"bytes": "4030"
},
{
"name": "LLVM",
"bytes": "180"
},
{
"name": "Shell",
"bytes": "647"
}
],
"symlink_target": ""
} |
layout: post
section-type: post
comments: true
title: "How to start a movement using a twitter bot"
category: tech
tags: [ 'python','programming','bots','social media' ]
---
## BOTS ,BOTS ,BOTS

So lets face bots are taking over, they are on all major social media sites Facebook, Telegram, Slack and Twitter. Even Whatsapp which is against having bots on its platform is filled with bots with a vast number of services ranging from giving sports updates to conversational A.I bots to web-browsing.
To all those a bit lost here, a bot is just software developed to automate tasks you would normally do on your own like checking game scores, making dinner reservations ,fetching or displaying information.Bots have been around for a long time(about 50 years now) but they have only become famous now due to advancements in A.I, a rise in RESTful APIs and their integration onto the social media platform.
### MY TWITTER BOT

In this tutorial I will show you how to make a simple twitter bot using python that re-tweets everything on a certain topic on #hashtag.
Hmmmm ,but whats the point of a it mindlessly retweeting posts ?
Glad you asked ,It can be used to promote certain events or news across a wider audience. People can use this to receive updates on a particular topic, instead of the original poster on Twitter as they are only interested in specific Tweets and not everything that user has to say. People can use the hashtag ReTweet bots to follow the hashtag within their stream, so they don’t have to search for it.You can use this bot to promote your business or support a movement or an organisation using a particular hashtag. A live implementation can be found here [A Bot has no name](https://twitter.com/thisflag_zw) , the bot Re-tweets everything with the hashtag #ThisFlag ,a movement against corruption in Zimbabwe.
### NOW TO THE FUN STUFF !!!
First thing is first , head to twitter and create a new app, details on how to do that can be found here [Create a twitter app](http://iag.me/socialmedia/how-to-create-a-twitter-app-in-8-easy-steps/) .Make sure the application has both read and write access in step 8.
You'll need to generate and copy your:
* OAUTH_TOKEN
* OAUTH_SECRET
* CONSUMER_KEY
* CONSUMER_SECRET
we will need them later
Although the are many twitter libraries for python, in this tutorial we will be using [Tweepy](http://www.tweepy.org/) an easy-to-use Python library for accessing the Twitter API.
First head over to your console and install tweepy using
```
pip install tweepy
```
Next lets import it
```python
# import the necessary libraries
import tweepy
```
Now we will define all necessary variables for the script
```python
# define the necessary variables
# The hashtag or search term to retweet
hashtag = ""
#tweet language ,you can leave it blank for all languages
tweetLanguage = ""
# Number of tweets to retweet at a time (Twitter has a limit of 180 requests per every 15 mins)
num =
#Your twitter app consumer key
consumer_key=""
#Your twitter app consumer secret
consumer_secret=""
#Your twitter app access_token
access_token=""
#Your twitter app access_token_secret
access_token_secret=""
```
Setting up tweepy is very is simple ,all we have to do is specify our keys
```python
# Setting up tweepy
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
```
Now its time to make our code actually do something useful ,the following snippet queries twitter using our hashtag
```python
# search query
timelineIterator = tweepy.Cursor(api.search, q=hashtag, lang=tweetLanguage).items(num)
# put everything into a list to be able to sort/filter
timeline = []
for status in timelineIterator:
timeline.append(status)
```
Finally we loop through our search results and retweet them one by one.
```python
tweet_counter = 0
error_counter = 0
# iterate the timeline and retweet
for status in timeline:
try:
print("(%(date)s) %(name)s: %(message)s\n" % \
{"date": status.created_at,
"name": status.author.screen_name.encode('utf-8'),
"message": status.text.encode('utf-8')})
api.retweet(status.id)
tweet_counter += 1
except tweepy.error.TweepError as e:
# just in case tweet got deleted in the meantime or already re-tweeted
error_counter += 1
# print e
continue
print("Finished. %d Tweets re tweeted, %d errors occurred." % (tweet_counter, error_counter))
```
And thats it, save your code and run it ,and watch the magic.
For a further advanced and more re-usable version of this code, checkout my repository [here](https://github.com/mikeyny/retweet-bot)
#### **DISCLAIMER**
The above code is my python3.5 implementation of github user basti2342 's [retweet-bot](https://github.com/basti2342/retweet-bot)
| {
"content_hash": "64837cb61cd57a8b9be8c60eebefaf0e",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 710,
"avg_line_length": 37.65942028985507,
"alnum_prop": 0.7477390802385991,
"repo_name": "mikeyny/blog",
"id": "db6fa59462e835fc783132747d27b42cab141338",
"size": "5203",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_posts/2016-07-30-twitter-bot.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "26258"
},
{
"name": "HTML",
"bytes": "40446"
},
{
"name": "Ruby",
"bytes": "2490"
},
{
"name": "Shell",
"bytes": "214"
}
],
"symlink_target": ""
} |
<?php
namespace MicroCMS\DependencyInjection;
use Monolog\Logger;
trait LogAwareTrait
{
/**
* The Monolog logger
* @param Monolog\Logger logger
*/
protected $logger;
/**
* getLogger
* This is implemented here so it can be
* overridden by classes if needed.
*
* @return Monolog\Logger|null $logger
*/
public function getLogger()
{
$logger = null;
if ($this->logger) {
$logger = $this->logger;
}
return($logger);
}
/**
* setLogger
* Set the logger object.
*
* @param Monolog\Logger $logger
* @return void
*/
public function setLogger(Logger $logger)
{
$this->logger = $logger;
}
/**
* log
* Log a message to the log handler if set.
*
* @param mixed $level
* @param string $mesg
* @param array $context
* @return void
*/
protected function log($level, $mesg, $context = array())
{
if ($logger = $this->getLogger()) {
$context = array_merge($this->getDefaultContext(), $context);
$logger->log($level, $mesg, $context);
}
}
/**
* emergency
* PSR3 log function - emergency level
* System is unusable
*
* @param string $mesg
* @param array $context
* @return void
*/
protected function emergency($mesg, $context = array())
{
$this->log(Logger::EMERGENCY, $mesg, $context);
}
/**
* alert
* PSR3 log function - alert level
* Action must be taken immediately.
*
* @param string $mesg
* @param array $context
* @return void
*/
protected function alert($mesg, $context = array())
{
$this->log(Logger::ALERT, $mesg, $context);
}
/**
* critical
* PSR3 log function - critical level
* Critical conditions.
*
* @param string $mesg
* @param array $context
* @return void
*/
protected function critical($mesg, $context = array())
{
$this->log(Logger::CRITICAL, $mesg, $context);
}
/**
* error
* PSR3 log function - error level
* Runtime errors that do not require immediate action but should typically
* be logged and monitored.
*
* @param string $mesg
* @param array $context
* @return void
*/
protected function error($mesg, $context = array())
{
$this->log(Logger::ERROR, $mesg, $context);
}
/**
* warning
* PSR3 log function - warning level
* Exceptional occurrences that are not errors.
*
* @param string $mesg
* @param array $context
* @return void
*/
protected function warning($mesg, $context = array())
{
$this->log(Logger::WARNING, $mesg, $context);
}
/**
* notice
* PSR3 log function - notice level
* Normal but significant events.
*
* @param string $mesg
* @param array $context
* @return void
*/
protected function notice($mesg, $context = array())
{
$this->log(Logger::NOTICE, $mesg, $context);
}
/**
* info
* PSR3 log function - info level
* Interesting events.
*
* @param string $mesg
* @param array $context
* @return void
*/
protected function info($mesg, $context = array())
{
$this->log(Logger::INFO, $mesg, $context);
}
/**
* debug
* PSR3 log function - debug level
* Detailed debug information.
*
* @param string $mesg
* @param array $context
* @return void
*/
protected function debug($mesg, $context = array())
{
$this->log(Logger::DEBUG, $mesg, $context);
}
/**
* getDefaultContext
* Get the default context for log messages.
*
* @return array $context
*/
protected function getDefaultContext()
{
$context = array(
'class' => get_class($this),
);
return($context);
}
}
| {
"content_hash": "7711062c083a3b9056c2e33cb73f6ed2",
"timestamp": "",
"source": "github",
"line_count": 191,
"max_line_length": 79,
"avg_line_length": 21.219895287958114,
"alnum_prop": 0.5361460646434739,
"repo_name": "james481/MicroCMS",
"id": "c757125f4d33c343000f337604bfab5518ba6feb",
"size": "4400",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/MicroCMS/DependencyInjection/LogAwareTrait.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "99314"
}
],
"symlink_target": ""
} |
import json
import shutil
import zipfile
from django.conf import settings # For mocking.
import jwt
import mock
from nose.tools import eq_, raises
from requests import Timeout
import mkt.site.tests
from lib.crypto import packaged
from lib.crypto.receipt import crack, sign, SigningError
from mkt.site.storage_utils import copy_to_storage
from mkt.site.fixtures import fixture
from mkt.site.storage_utils import public_storage, private_storage
from mkt.versions.models import Version
from mkt.webapps.models import Webapp
def mock_sign(version_id, reviewer=False):
"""
This is a mock for using in tests, where we really don't want to be
actually signing the apps. This just copies the file over and returns
the path. It doesn't have much error checking.
"""
version = Version.objects.get(pk=version_id)
file_obj = version.all_files[0]
path = (file_obj.signed_reviewer_file_path if reviewer else
file_obj.signed_file_path)
with private_storage.open(path, 'w') as dest_f:
shutil.copyfileobj(private_storage.open(file_obj.file_path), dest_f)
return path
@mock.patch('lib.crypto.receipt.requests.post')
@mock.patch.object(settings, 'SIGNING_SERVER', 'http://localhost')
class TestReceipt(mkt.site.tests.TestCase):
def test_called(self, get):
get.return_value = self.get_response(200)
sign('my-receipt')
eq_(get.call_args[1]['data'], 'my-receipt')
def test_some_unicode(self, get):
get.return_value = self.get_response(200)
sign({'name': u'Вагиф Сәмәдоғлу'})
def get_response(self, code):
return mock.Mock(status_code=code,
content=json.dumps({'receipt': ''}))
def test_good(self, req):
req.return_value = self.get_response(200)
sign('x')
@raises(SigningError)
def test_timeout(self, req):
req.side_effect = Timeout
req.return_value = self.get_response(200)
sign('x')
@raises(SigningError)
def test_error(self, req):
req.return_value = self.get_response(403)
sign('x')
@raises(SigningError)
def test_other(self, req):
req.return_value = self.get_response(206)
sign('x')
class TestCrack(mkt.site.tests.TestCase):
def test_crack(self):
eq_(crack(jwt.encode('foo', 'x')), [u'foo'])
def test_crack_mulitple(self):
eq_(crack('~'.join([jwt.encode('foo', 'x'), jwt.encode('bar', 'y')])),
[u'foo', u'bar'])
class PackagedApp(mkt.site.tests.TestCase, mkt.site.tests.MktPaths):
fixtures = fixture('webapp_337141', 'users')
def setUp(self):
self.app = Webapp.objects.get(pk=337141)
self.app.update(is_packaged=True)
self.version = self.app.current_version
self.file = self.version.all_files[0]
self.file.update(filename='mozball.zip')
def setup_files(self):
# Clean out any left over stuff.
public_storage.delete(self.file.signed_file_path)
private_storage.delete(self.file.signed_reviewer_file_path)
# Make sure the source file is there.
if not private_storage.exists(self.file.file_path):
copy_to_storage(self.packaged_app_path('mozball.zip'),
self.file.file_path)
@mock.patch('lib.crypto.packaged.os.unlink', new=mock.Mock)
class TestPackaged(PackagedApp, mkt.site.tests.TestCase):
def setUp(self):
super(TestPackaged, self).setUp()
self.setup_files()
@raises(packaged.SigningError)
def test_not_packaged(self):
self.app.update(is_packaged=False)
packaged.sign(self.version.pk)
@raises(packaged.SigningError)
def test_no_file(self):
[f.delete() for f in self.app.current_version.all_files]
packaged.sign(self.version.pk)
@mock.patch('lib.crypto.packaged.sign_app')
def test_already_exists(self, sign_app):
with public_storage.open(self.file.signed_file_path, 'w') as f:
f.write('.')
assert packaged.sign(self.version.pk)
assert not sign_app.called
@mock.patch('lib.crypto.packaged.sign_app')
def test_resign_already_exists(self, sign_app):
private_storage.open(self.file.signed_file_path, 'w')
packaged.sign(self.version.pk, resign=True)
assert sign_app.called
@mock.patch('lib.crypto.packaged.sign_app')
def test_sign_consumer(self, sign_app):
packaged.sign(self.version.pk)
assert sign_app.called
ids = json.loads(sign_app.call_args[0][2])
eq_(ids['id'], self.app.guid)
eq_(ids['version'], self.version.pk)
@mock.patch('lib.crypto.packaged.sign_app')
def test_sign_reviewer(self, sign_app):
packaged.sign(self.version.pk, reviewer=True)
assert sign_app.called
ids = json.loads(sign_app.call_args[0][2])
eq_(ids['id'], 'reviewer-{guid}-{version_id}'.format(
guid=self.app.guid, version_id=self.version.pk))
eq_(ids['version'], self.version.pk)
@raises(ValueError)
def test_server_active(self):
with self.settings(SIGNED_APPS_SERVER_ACTIVE=True):
packaged.sign(self.version.pk)
@raises(ValueError)
def test_reviewer_server_active(self):
with self.settings(SIGNED_APPS_REVIEWER_SERVER_ACTIVE=True):
packaged.sign(self.version.pk, reviewer=True)
@mock.patch('lib.crypto.packaged._no_sign')
def test_server_inactive(self, _no_sign):
with self.settings(SIGNED_APPS_SERVER_ACTIVE=False):
packaged.sign(self.version.pk)
assert _no_sign.called
@mock.patch('lib.crypto.packaged._no_sign')
def test_reviewer_server_inactive(self, _no_sign):
with self.settings(SIGNED_APPS_REVIEWER_SERVER_ACTIVE=False):
packaged.sign(self.version.pk, reviewer=True)
assert _no_sign.called
def test_server_endpoint(self):
with self.settings(SIGNED_APPS_SERVER_ACTIVE=True,
SIGNED_APPS_SERVER='http://sign.me',
SIGNED_APPS_REVIEWER_SERVER='http://review.me'):
endpoint = packaged._get_endpoint()
assert endpoint.startswith('http://sign.me'), (
'Unexpected endpoint returned.')
def test_server_reviewer_endpoint(self):
with self.settings(SIGNED_APPS_REVIEWER_SERVER_ACTIVE=True,
SIGNED_APPS_SERVER='http://sign.me',
SIGNED_APPS_REVIEWER_SERVER='http://review.me'):
endpoint = packaged._get_endpoint(reviewer=True)
assert endpoint.startswith('http://review.me'), (
'Unexpected endpoint returned.')
@mock.patch.object(packaged, '_get_endpoint', lambda _: '/fake/url/')
@mock.patch('requests.post')
def test_inject_ids(self, post):
post().status_code = 200
post().content = '{"zigbert.rsa": ""}'
packaged.sign(self.version.pk)
zf = zipfile.ZipFile(public_storage.open(self.file.signed_file_path),
mode='r')
ids_data = zf.read('META-INF/ids.json')
eq_(sorted(json.loads(ids_data).keys()), ['id', 'version'])
| {
"content_hash": "10e78c5f7428e45b1237177bad0014d6",
"timestamp": "",
"source": "github",
"line_count": 200,
"max_line_length": 78,
"avg_line_length": 35.895,
"alnum_prop": 0.6369967962111714,
"repo_name": "luckylavish/zamboni",
"id": "66277e39122e1afe88656e243926dc7358323e79",
"size": "7217",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/crypto/tests.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "357271"
},
{
"name": "HTML",
"bytes": "2278036"
},
{
"name": "JavaScript",
"bytes": "533454"
},
{
"name": "Makefile",
"bytes": "4281"
},
{
"name": "Python",
"bytes": "4353206"
},
{
"name": "Shell",
"bytes": "11156"
},
{
"name": "Smarty",
"bytes": "1159"
}
],
"symlink_target": ""
} |
'use strict';
var m = require('mithril');
var ol = require('../contrib/ol');
var EVENTS = require('./events');
var SL_GetFeatureInfoAllVisibleControl = function (sl_map, options) {
// default options
this.options = {
// initial module options
};
if (!sl_map || Object.getOwnPropertyNames(sl_map).length === 0) {
throw new Error('SL_GetFeatureInfoControl map parameter must be defined');
}
if (!options || Object.getOwnPropertyNames(options).length === 0) {
throw new Error('SL_GetFeatureInfoControl options parameter must be defined');
}
// override and extend default options
for (var opt in options) {
if (options.hasOwnProperty(opt)) {
this.options[opt] = options[opt];
}
}
// internal reference to the map object
this.sl_map = sl_map;
// initialize the getfeatureinfo control
this.init();
this.initEvents();
};
SL_GetFeatureInfoAllVisibleControl.prototype = {
init: function() {
this.SL_GFI_Source = new ol.source.Vector({
// projection: data.map.getView().getProjection(),
defaultProjection: this.sl_map.map.getView().getProjection(),
format: new ol.format.GeoJSON()
});
this.SL_GFI_Layer = new ol.layer.Vector({
source: this.SL_GFI_Source
});
},
handleMouseClick: function (evt) {
var self = this;
EVENTS.emit('layerControl.get.queryLayers', {
type: 'visible',
callback: function (queryLayers) {
EVENTS.emit('getFeatureInfo.url', {
coordinate: evt.coordinate,
queryLayers: queryLayers,
callback: self.getFeatureInfo.bind(self)
});
}
});
},
getFeatureInfo: function(url) {
var self = this;
var geojsonFormat = new ol.format.GeoJSON();
EVENTS.emit('spinner.activate');
m.request({
method: 'GET',
url: url
}).then(function (response) {
// reset data of the previous source
self.SL_GFI_Source.clear(true);
EVENTS.emit('featureOverlay.clear');
var features = geojsonFormat.readFeatures(response);
self.SL_GFI_Source.addFeatures(features);
// add new features
EVENTS.emit('getFeatureInfoAllVisible.results', {
features: features
});
EVENTS.emit('spinner.deactivate');
});
},
initEvents: function() {
var self = this;
EVENTS.on('getFeatureInfoAllVisible.result.clicked', function(data) {
var feature = self.SL_GFI_Source.getFeatureById(data.result.id());
self.sl_map.map.getView().fit(
feature.getGeometry().getExtent(), self.sl_map.map.getSize()
);
EVENTS.emit('featureOverlay.add', {
feature: feature
});
});
EVENTS.on('getFeatureInfoAllVisible.results.closed', function () {
self.SL_GFI_Source.clear(true);
EVENTS.emit('featureOverlay.clear');
});
// handle GFI for all visible layers
EVENTS.on('getFeatureInfoAllVisible.tool.activate', function() {
self.sl_map.addControlOverlayLayer(self.SL_GFI_Layer);
// bind handleMouseClick context to self
self.sl_map.map.on('singleclick', self.handleMouseClick, self);
});
EVENTS.on('getFeatureInfoAllVisible.tool.deactivate', function() {
self.SL_GFI_Source.clear(true);
self.sl_map.removeControlOverlayLayer(self.SL_GFI_Layer);
self.sl_map.map.un('singleclick', self.handleMouseClick, self);
});
}
};
module.exports = SL_GetFeatureInfoAllVisibleControl;
| {
"content_hash": "72a83dca0226a4cdd559b966399d0a37",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 86,
"avg_line_length": 30.440944881889763,
"alnum_prop": 0.5765649249870667,
"repo_name": "candela-it/sunlumo",
"id": "555ab30b952b603f2943754afddcb9cd6b807fc5",
"size": "3866",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "django_project/lib_js/lib/sl_getfeatureinfoAllVisibleControl.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "394728"
},
{
"name": "HTML",
"bytes": "2964"
},
{
"name": "JavaScript",
"bytes": "364730"
},
{
"name": "Python",
"bytes": "99692"
},
{
"name": "Ruby",
"bytes": "900"
},
{
"name": "Shell",
"bytes": "446"
}
],
"symlink_target": ""
} |
describe WillPaginate::NoBrainer::CollectionMethods do
describe '#total_entries' do
before do
2.times { |i| User.create(salary: i) }
end
context 'when the scope is cloned' do
let(:criteria) { User.page }
it 'resets total_entries memoization' do
expect(criteria.total_entries).to eq(2)
expect(criteria.where(salary: 1).total_entries).to eq(1)
end
end
end
end
| {
"content_hash": "935092b19b201bfb3cabb8d28c675ebe",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 64,
"avg_line_length": 26.25,
"alnum_prop": 0.6476190476190476,
"repo_name": "vyorkin-personal/will_paginate-nobrainer",
"id": "38a716dcf3743804e4688931dc339524b5284081",
"size": "420",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/will_paginate/nobrainer/collection_methods_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "21500"
}
],
"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/html; charset=utf-8" />
<title>IMPLICIT_DEPENDS_INCLUDE_TRANSFORM — CMake 3.7.2 Documentation</title>
<link rel="stylesheet" href="../_static/cmake.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '3.7.2',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="shortcut icon" href="../_static/cmake-favicon.ico"/>
<link rel="top" title="CMake 3.7.2 Documentation" href="../index.html" />
<link rel="up" title="cmake-properties(7)" href="../manual/cmake-properties.7.html" />
<link rel="next" title="INCLUDE_DIRECTORIES" href="INCLUDE_DIRECTORIES.html" />
<link rel="prev" title="EXCLUDE_FROM_ALL" href="EXCLUDE_FROM_ALL.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="INCLUDE_DIRECTORIES.html" title="INCLUDE_DIRECTORIES"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="EXCLUDE_FROM_ALL.html" title="EXCLUDE_FROM_ALL"
accesskey="P">previous</a> |</li>
<li>
<img src="../_static/cmake-logo-16.png" alt=""
style="vertical-align: middle; margin-top: -2px" />
</li>
<li>
<a href="https://cmake.org/">CMake</a> »
</li>
<li>
<a href="../index.html">3.7.2 Documentation</a> »
</li>
<li class="nav-item nav-item-1"><a href="../manual/cmake-properties.7.html" accesskey="U">cmake-properties(7)</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="implicit-depends-include-transform">
<span id="prop_dir:IMPLICIT_DEPENDS_INCLUDE_TRANSFORM"></span><h1>IMPLICIT_DEPENDS_INCLUDE_TRANSFORM<a class="headerlink" href="#implicit-depends-include-transform" title="Permalink to this headline">¶</a></h1>
<p>Specify #include line transforms for dependencies in a directory.</p>
<p>This property specifies rules to transform macro-like #include lines
during implicit dependency scanning of C and C++ source files. The
list of rules must be semicolon-separated with each entry of the form
“A_MACRO(%)=value-with-%” (the % must be literal). During dependency
scanning occurrences of A_MACRO(...) on #include lines will be
replaced by the value given with the macro argument substituted for
‘%’. For example, the entry</p>
<div class="highlight-python"><div class="highlight"><pre><span></span>MYDIR(%)=<mydir/%>
</pre></div>
</div>
<p>will convert lines of the form</p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="c1">#include MYDIR(myheader.h)</span>
</pre></div>
</div>
<p>to</p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="c1">#include <mydir/myheader.h></span>
</pre></div>
</div>
<p>allowing the dependency to be followed.</p>
<p>This property applies to sources in all targets within a directory.
The property value is initialized in each directory by its value in
the directory’s parent.</p>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="EXCLUDE_FROM_ALL.html"
title="previous chapter">EXCLUDE_FROM_ALL</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="INCLUDE_DIRECTORIES.html"
title="next chapter">INCLUDE_DIRECTORIES</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/prop_dir/IMPLICIT_DEPENDS_INCLUDE_TRANSFORM.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="INCLUDE_DIRECTORIES.html" title="INCLUDE_DIRECTORIES"
>next</a> |</li>
<li class="right" >
<a href="EXCLUDE_FROM_ALL.html" title="EXCLUDE_FROM_ALL"
>previous</a> |</li>
<li>
<img src="../_static/cmake-logo-16.png" alt=""
style="vertical-align: middle; margin-top: -2px" />
</li>
<li>
<a href="https://cmake.org/">CMake</a> »
</li>
<li>
<a href="../index.html">3.7.2 Documentation</a> »
</li>
<li class="nav-item nav-item-1"><a href="../manual/cmake-properties.7.html" >cmake-properties(7)</a> »</li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2000-2016 Kitware, Inc. and Contributors.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4a0+.
</div>
</body>
</html> | {
"content_hash": "5f64ff6c8313991560e94f991bfcb185",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 210,
"avg_line_length": 40.775,
"alnum_prop": 0.6154199877375843,
"repo_name": "ontouchstart/emcc",
"id": "43d32038e1c537901bed9a66199d2853b7218990",
"size": "6525",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "base/cmake-3.7.2-Linux-x86_64/doc/cmake/html/prop_dir/IMPLICIT_DEPENDS_INCLUDE_TRANSFORM.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "848"
},
{
"name": "C",
"bytes": "20000"
},
{
"name": "C++",
"bytes": "891"
},
{
"name": "CMake",
"bytes": "2589623"
},
{
"name": "CSS",
"bytes": "18021"
},
{
"name": "Emacs Lisp",
"bytes": "14622"
},
{
"name": "Fortran",
"bytes": "2105"
},
{
"name": "HTML",
"bytes": "11279244"
},
{
"name": "JavaScript",
"bytes": "1132533"
},
{
"name": "M4",
"bytes": "1463"
},
{
"name": "Makefile",
"bytes": "3446"
},
{
"name": "Python",
"bytes": "75862"
},
{
"name": "Roff",
"bytes": "1491560"
},
{
"name": "Shell",
"bytes": "19707"
},
{
"name": "Vim script",
"bytes": "46564"
}
],
"symlink_target": ""
} |
namespace subresource_filter {
namespace {
const mojom::ActivationState kDisabled;
RulesetVerificationStatus GetRulesetVerification() {
RulesetService* service =
g_browser_process->subresource_filter_ruleset_service();
VerifiedRulesetDealer::Handle* dealer_handle = service->GetRulesetDealer();
auto callback_method = [](base::OnceClosure quit_closure,
RulesetVerificationStatus* status,
VerifiedRulesetDealer* verified_dealer) {
*status = verified_dealer->status();
std::move(quit_closure).Run();
};
RulesetVerificationStatus status;
base::RunLoop run_loop;
auto callback =
base::BindRepeating(callback_method, run_loop.QuitClosure(), &status);
dealer_handle->GetDealerAsync(callback);
run_loop.Run();
return status;
}
const char kIndexedRulesetVerifyHistogram[] =
"SubresourceFilter.IndexRuleset.Verify.Status";
} // namespace
IN_PROC_BROWSER_TEST_F(SubresourceFilterBrowserTest,
RulesetVerified_Activation) {
base::HistogramTester histogram_tester;
ASSERT_NO_FATAL_FAILURE(
SetRulesetToDisallowURLsWithPathSuffix("included_script.js"));
RulesetService* service =
g_browser_process->subresource_filter_ruleset_service();
ASSERT_TRUE(service->GetRulesetDealer());
auto ruleset_handle =
std::make_unique<VerifiedRuleset::Handle>(service->GetRulesetDealer());
AsyncDocumentSubresourceFilter::InitializationParams params(
GURL("https://example.com/"), mojom::ActivationLevel::kEnabled, false);
testing::TestActivationStateCallbackReceiver receiver;
AsyncDocumentSubresourceFilter filter(ruleset_handle.get(), std::move(params),
receiver.GetCallback());
receiver.WaitForActivationDecision();
mojom::ActivationState expected_state;
expected_state.activation_level = mojom::ActivationLevel::kEnabled;
receiver.ExpectReceivedOnce(expected_state);
histogram_tester.ExpectUniqueSample(kIndexedRulesetVerifyHistogram,
VerifyStatus::kPassValidChecksum, 1);
}
// TODO(ericrobinson): Add a test using a PRE_ phase that corrupts the ruleset
// on disk to test something closer to an actual execution path for checksum.
IN_PROC_BROWSER_TEST_F(SubresourceFilterBrowserTest, NoRuleset_NoActivation) {
base::HistogramTester histogram_tester;
// Do not set the ruleset, which results in an invalid ruleset.
RulesetService* service =
g_browser_process->subresource_filter_ruleset_service();
ASSERT_TRUE(service->GetRulesetDealer());
auto ruleset_handle =
std::make_unique<VerifiedRuleset::Handle>(service->GetRulesetDealer());
AsyncDocumentSubresourceFilter::InitializationParams params(
GURL("https://example.com/"), mojom::ActivationLevel::kEnabled, false);
testing::TestActivationStateCallbackReceiver receiver;
AsyncDocumentSubresourceFilter filter(ruleset_handle.get(), std::move(params),
receiver.GetCallback());
receiver.WaitForActivationDecision();
receiver.ExpectReceivedOnce(kDisabled);
histogram_tester.ExpectTotalCount(kIndexedRulesetVerifyHistogram, 0);
}
IN_PROC_BROWSER_TEST_F(SubresourceFilterBrowserTest, InvalidRuleset_Checksum) {
base::HistogramTester histogram_tester;
const char kTestRulesetSuffix[] = "foo";
const int kNumberOfRules = 500;
TestRulesetCreator ruleset_creator;
TestRulesetPair test_ruleset_pair;
ASSERT_NO_FATAL_FAILURE(
ruleset_creator.CreateRulesetToDisallowURLsWithManySuffixes(
kTestRulesetSuffix, kNumberOfRules, &test_ruleset_pair));
RulesetService* service =
g_browser_process->subresource_filter_ruleset_service();
// Publish the good ruleset.
TestRulesetPublisher publisher(service);
publisher.SetRuleset(test_ruleset_pair.unindexed);
// Now corrupt it by flipping one entry. This can only be detected
// via the checksum, and not the Flatbuffer Verifier. This was determined
// at random by flipping elements until this test failed, then adding
// the checksum code and ensuring it passed.
testing::TestRuleset::CorruptByFilling(test_ruleset_pair.indexed, 28246,
28247, 32);
OpenAndPublishRuleset(service, test_ruleset_pair.indexed.path);
ASSERT_TRUE(service->GetRulesetDealer());
auto ruleset_handle =
std::make_unique<VerifiedRuleset::Handle>(service->GetRulesetDealer());
AsyncDocumentSubresourceFilter::InitializationParams params(
GURL("https://example.com/"), mojom::ActivationLevel::kEnabled, false);
testing::TestActivationStateCallbackReceiver receiver;
AsyncDocumentSubresourceFilter filter(ruleset_handle.get(), std::move(params),
receiver.GetCallback());
receiver.WaitForActivationDecision();
receiver.ExpectReceivedOnce(kDisabled);
RulesetVerificationStatus dealer_status = GetRulesetVerification();
EXPECT_EQ(RulesetVerificationStatus::kCorrupt, dealer_status);
// If AdTagging is enabled, then the initial SetRuleset will trigger
// a call to Verify. Make sure we see that and the later failure.
if (base::FeatureList::IsEnabled(kAdTagging)) {
histogram_tester.ExpectBucketCount(kIndexedRulesetVerifyHistogram,
VerifyStatus::kPassValidChecksum, 1);
histogram_tester.ExpectBucketCount(kIndexedRulesetVerifyHistogram,
VerifyStatus::kChecksumFailVerifierPass,
1);
histogram_tester.ExpectTotalCount(kIndexedRulesetVerifyHistogram, 2);
} else {
// Otherwise we see only a single Verify when the new ruleset is accessed,
// and that should be a failure.
histogram_tester.ExpectUniqueSample(kIndexedRulesetVerifyHistogram,
VerifyStatus::kChecksumFailVerifierPass,
1);
}
}
IN_PROC_BROWSER_TEST_F(SubresourceFilterBrowserTest,
InvalidRuleset_NoActivation) {
base::HistogramTester histogram_tester;
const char kTestRulesetSuffix[] = "foo";
const int kNumberOfRules = 500;
TestRulesetCreator ruleset_creator;
TestRulesetPair test_ruleset_pair;
ASSERT_NO_FATAL_FAILURE(
ruleset_creator.CreateRulesetToDisallowURLsWithManySuffixes(
kTestRulesetSuffix, kNumberOfRules, &test_ruleset_pair));
testing::TestRuleset::CorruptByTruncating(test_ruleset_pair.indexed, 123);
// Just publish the corrupt indexed file directly, to simulate it being
// corrupt on startup.
RulesetService* service =
g_browser_process->subresource_filter_ruleset_service();
ASSERT_TRUE(service->GetRulesetDealer());
OpenAndPublishRuleset(service, test_ruleset_pair.indexed.path);
auto ruleset_handle =
std::make_unique<VerifiedRuleset::Handle>(service->GetRulesetDealer());
AsyncDocumentSubresourceFilter::InitializationParams params(
GURL("https://example.com/"), mojom::ActivationLevel::kEnabled, false);
testing::TestActivationStateCallbackReceiver receiver;
AsyncDocumentSubresourceFilter filter(ruleset_handle.get(), std::move(params),
receiver.GetCallback());
receiver.WaitForActivationDecision();
receiver.ExpectReceivedOnce(kDisabled);
RulesetVerificationStatus dealer_status = GetRulesetVerification();
EXPECT_EQ(RulesetVerificationStatus::kCorrupt, dealer_status);
histogram_tester.ExpectUniqueSample(kIndexedRulesetVerifyHistogram,
VerifyStatus::kVerifierFailChecksumZero,
1);
}
class SubresourceFilterBrowserTestWithoutAdTagging
: public SubresourceFilterBrowserTest {
public:
SubresourceFilterBrowserTestWithoutAdTagging() {
feature_list_.InitAndDisableFeature(subresource_filter::kAdTagging);
}
private:
base::test::ScopedFeatureList feature_list_;
};
IN_PROC_BROWSER_TEST_F(SubresourceFilterBrowserTestWithoutAdTagging,
LazyRulesetValidation) {
// The ruleset shouldn't be validated until it's used, unless ad tagging is
// enabled.
SetRulesetToDisallowURLsWithPathSuffix("included_script.js");
RulesetVerificationStatus dealer_status = GetRulesetVerification();
EXPECT_EQ(RulesetVerificationStatus::kNotVerified, dealer_status);
}
class SubresourceFilterBrowserTestWithAdTagging
: public SubresourceFilterBrowserTest {
public:
SubresourceFilterBrowserTestWithAdTagging() {
feature_list_.InitAndEnableFeature(subresource_filter::kAdTagging);
}
private:
base::test::ScopedFeatureList feature_list_;
};
IN_PROC_BROWSER_TEST_F(SubresourceFilterBrowserTestWithAdTagging,
AdsTaggingImmediateRulesetValidation) {
// When Ads Tagging is enabled, the ruleset should be validated as soon as
// it's published.
SetRulesetToDisallowURLsWithPathSuffix("included_script.js");
RulesetVerificationStatus dealer_status = GetRulesetVerification();
EXPECT_EQ(RulesetVerificationStatus::kIntact, dealer_status);
}
} // namespace subresource_filter
| {
"content_hash": "1b1d0f3897345c4df77b054053627a91",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 80,
"avg_line_length": 43.208530805687204,
"alnum_prop": 0.7280903806076561,
"repo_name": "nwjs/chromium.src",
"id": "8a948cca1da8bc270370e571a59dc5c5f23b25c1",
"size": "10053",
"binary": false,
"copies": "6",
"ref": "refs/heads/nw70",
"path": "chrome/browser/subresource_filter/ruleset_browsertest.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<style lang="css">
body {
background-color: #F4F4F4;
color: #333;
font-family: Segoe UI,Tahoma,Arial,Verdana,sans-serif;
}
p#intro {
font-family: Cambria,serif;
font-size: 1.1em;
color: #444;
}
p#intro a {
color: #444;
}
p#intro a:visited {
color: #444;
}
.block {
background-color: #e0e0e0;
padding: 16px;
margin: 20px;
}
p.case_text_block {
border-radius: 10px;
border: 1px solid #aaa;
padding: 16px;
margin: 4px 20px;
color: #444;
}
p.case_desc {
}
p.case_expect {
}
p.case_outcome {
}
p.case_closing_beh {
}
pre.http_dump {
font-family: Consolas, "Courier New", monospace;
font-size: 0.8em;
color: #333;
border-radius: 10px;
border: 1px solid #aaa;
padding: 16px;
margin: 4px 20px;
}
span.case_pickle {
font-family: Consolas, "Courier New", monospace;
font-size: 0.7em;
color: #000;
}
p#case_result,p#close_result {
border-radius: 10px;
background-color: #e8e2d1;
padding: 20px;
margin: 20px;
}
h1 {
margin-left: 60px;
}
h2 {
margin-left: 30px;
}
h3 {
margin-left: 50px;
}
a.up {
float: right;
border-radius: 16px;
margin-top: 16px;
margin-bottom: 10px;
margin-right: 30px;
padding-left: 10px;
padding-right: 10px;
padding-bottom: 2px;
padding-top: 2px;
background-color: #666;
color: #fff;
text-decoration: none;
font-size: 0.8em;
}
a.up:visited {
}
a.up:hover {
background-color: #028ec9;
}
</style>
<style lang="css">
p.case {
color: #fff;
border-radius: 10px;
padding: 20px;
margin: 12px 20px;
font-size: 1.2em;
}
p.case_ok {
background-color: #0a0;
}
p.case_non_strict, p.case_no_close {
background-color: #9a0;
}
p.case_info {
background-color: #4095BF;
}
p.case_failed {
background-color: #900;
}
table {
border-collapse: collapse;
border-spacing: 0px;
margin-left: 80px;
margin-bottom: 12px;
margin-top: 0px;
}
td
{
margin: 0;
font-size: 0.8em;
border: 1px #fff solid;
padding-top: 6px;
padding-bottom: 6px;
padding-left: 16px;
padding-right: 16px;
text-align: right;
}
td.right {
text-align: right;
}
td.left {
text-align: left;
}
tr.stats_header {
color: #eee;
background-color: #000;
}
tr.stats_row {
color: #000;
background-color: #fc3;
}
tr.stats_total {
color: #fff;
background-color: #888;
}
div#wirelog {
margin-top: 20px;
margin-bottom: 80px;
}
pre.wirelog_rx_octets {color: #aaa; margin: 0; background-color: #060; padding: 2px;}
pre.wirelog_tx_octets {color: #aaa; margin: 0; background-color: #600; padding: 2px;}
pre.wirelog_tx_octets_sync {color: #aaa; margin: 0; background-color: #606; padding: 2px;}
pre.wirelog_rx_frame {color: #fff; margin: 0; background-color: #0a0; padding: 2px;}
pre.wirelog_tx_frame {color: #fff; margin: 0; background-color: #a00; padding: 2px;}
pre.wirelog_tx_frame_sync {color: #fff; margin: 0; background-color: #a0a; padding: 2px;}
pre.wirelog_delay {color: #fff; margin: 0; background-color: #000; padding: 2px;}
pre.wirelog_kill_after {color: #fff; margin: 0; background-color: #000; padding: 2px;}
pre.wirelog_tcp_closed_by_me {color: #fff; margin: 0; background-color: #008; padding: 2px;}
pre.wirelog_tcp_closed_by_peer {color: #fff; margin: 0; background-color: #000; padding: 2px;}
</style>
</head>
<body>
<a name="top"></a>
<br/>
<center><a href="http://autobahn.ws/testsuite" title="Autobahn WebSockets Testsuite"><img src="http://autobahn.ws/static/img/ws_protocol_test_report.png" border="0" width="820" height="46" alt="Autobahn WebSockets Testsuite Report"></img></a></center>
<center><a href="http://autobahn.ws" title="Autobahn WebSockets"> <img src="http://autobahn.ws/static/img/ws_protocol_test_report_autobahn.png" border="0" width="300" height="68" alt="Autobahn WebSockets"> </img></a></center>
<br/>
<p class="case case_ok">snacka - <span style="font-size: 1.3em;"><b>Case 6.22.13</b></span> : Pass - <span style="font-size: 0.9em;"><b>2</b> ms @ 2013-09-26T21:20:11Z</a></p>
<p class="case_text_block case_desc"><b>Case Description</b><br/><br/>Send a text message with payload which is valid UTF-8 in one fragment.<br><br>Payload: 0xf1afbfbe</p>
<p class="case_text_block case_expect"><b>Case Expectation</b><br/><br/>The message is echo'ed back to us.</p>
<p class="case_text_block case_outcome">
<b>Case Outcome</b><br/><br/>Actual events match at least one expected.<br/><br/>
<i>Expected:</i><br/><span class="case_pickle">{'OK': [('message', '0xf1afbfbe', False)]}</span><br/><br/>
<i>Observed:</i><br><span class="case_pickle">[('message', '0xf1afbfbe', False)]</span>
</p>
<p class="case_text_block case_closing_beh"><b>Case Closing Behavior</b><br/><br/>Connection was properly closed (OK)</p>
<br/><hr/>
<h2>Opening Handshake</h2>
<pre class="http_dump">GET /runCase?case=177&agent=snacka HTTP/1.1
Host: localhost:9001
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key:x3JJHMbDL1EzLkh9GBhXDw==
Sec-WebSocket-Version: 13</pre>
<pre class="http_dump">HTTP/1.1 101 Switching Protocols
Server: AutobahnTestSuite/0.5.5-0.5.14
Upgrade: WebSocket
Connection: Upgrade
Sec-WebSocket-Accept: HSmrc0sMlYUkAGmm5OPpG2HaGWk=</pre>
<br/><hr/>
<h2>Closing Behavior</h2>
<table>
<tr class="stats_header"><td>Key</td><td class="left">Value</td><td class="left">Description</td></tr>
<tr class="stats_row"><td>isServer</td><td class="left">True</td><td class="left">True, iff I (the fuzzer) am a server, and the peer is a client.</td></tr>
<tr class="stats_row"><td>closedByMe</td><td class="left">True</td><td class="left">True, iff I have initiated closing handshake (that is, did send close first).</td></tr>
<tr class="stats_row"><td>failedByMe</td><td class="left">False</td><td class="left">True, iff I have failed the WS connection (i.e. due to protocol error). Failing can be either by initiating closing handshake or brutal drop TCP.</td></tr>
<tr class="stats_row"><td>droppedByMe</td><td class="left">True</td><td class="left">True, iff I dropped the TCP connection.</td></tr>
<tr class="stats_row"><td>wasClean</td><td class="left">True</td><td class="left">True, iff full WebSockets closing handshake was performed (close frame sent and received) _and_ the server dropped the TCP (which is its responsibility).</td></tr>
<tr class="stats_row"><td>wasNotCleanReason</td><td class="left">None</td><td class="left">When wasClean == False, the reason what happened.</td></tr>
<tr class="stats_row"><td>wasServerConnectionDropTimeout</td><td class="left">False</td><td class="left">When we are a client, and we expected the server to drop the TCP, but that didn't happen in time, this gets True.</td></tr>
<tr class="stats_row"><td>wasOpenHandshakeTimeout</td><td class="left">False</td><td class="left">When performing the opening handshake, but the peer did not finish in time, this gets True.</td></tr>
<tr class="stats_row"><td>wasCloseHandshakeTimeout</td><td class="left">False</td><td class="left">When we initiated a closing handshake, but the peer did not respond in time, this gets True.</td></tr>
<tr class="stats_row"><td>localCloseCode</td><td class="left">1000</td><td class="left">The close code I sent in close frame (if any).</td></tr>
<tr class="stats_row"><td>localCloseReason</td><td class="left">None</td><td class="left">The close reason I sent in close frame (if any).</td></tr>
<tr class="stats_row"><td>remoteCloseCode</td><td class="left">1000</td><td class="left">The close code the peer sent me in close frame (if any).</td></tr>
<tr class="stats_row"><td>remoteCloseReason</td><td class="left">None</td><td class="left">The close reason the peer sent me in close frame (if any).</td></tr>
</table> <br/><hr/>
<h2>Wire Statistics</h2>
<h3>Octets Received by Chop Size</h3>
<table>
<tr class="stats_header"><td>Chop Size</td><td>Count</td><td>Octets</td></tr>
<tr class="stats_row"><td>8</td><td>1</td><td>8</td></tr>
<tr class="stats_row"><td>10</td><td>1</td><td>10</td></tr>
<tr class="stats_row"><td>181</td><td>1</td><td>181</td></tr>
<tr class="stats_total"><td>Total</td><td>3</td><td>199</td></tr>
</table>
<h3>Octets Transmitted by Chop Size</h3>
<table>
<tr class="stats_header"><td>Chop Size</td><td>Count</td><td>Octets</td></tr>
<tr class="stats_row"><td>4</td><td>1</td><td>4</td></tr>
<tr class="stats_row"><td>6</td><td>1</td><td>6</td></tr>
<tr class="stats_row"><td>169</td><td>1</td><td>169</td></tr>
<tr class="stats_total"><td>Total</td><td>3</td><td>179</td></tr>
</table>
<h3>Frames Received by Opcode</h3>
<table>
<tr class="stats_header"><td>Opcode</td><td>Count</td></tr>
<tr class="stats_row"><td>1</td><td>1</td></tr>
<tr class="stats_row"><td>8</td><td>1</td></tr>
<tr class="stats_total"><td>Total</td><td>2</td></tr>
</table>
<h3>Frames Transmitted by Opcode</h3>
<table>
<tr class="stats_header"><td>Opcode</td><td>Count</td></tr>
<tr class="stats_row"><td>1</td><td>1</td></tr>
<tr class="stats_row"><td>8</td><td>1</td></tr>
<tr class="stats_total"><td>Total</td><td>2</td></tr>
</table>
<br/><hr/>
<h2>Wire Log</h2>
<div id="wirelog">
<pre class="wirelog_rx_octets">000 RX OCTETS: 474554202f72756e436173653f636173653d313737266167656e743d736e61636b6120485454502f312e310d0a486f73743a</pre>
<pre class="wirelog_rx_octets"> 206c6f63616c686f73743a393030 ...</pre>
<pre class="wirelog_tx_octets">001 TX OCTETS: 485454502f312e312031303120537769746368696e672050726f746f636f6c730d0a5365727665723a204175746f6261686e</pre>
<pre class="wirelog_tx_octets"> 5465737453756974652f302e352e ...</pre>
<pre class="wirelog_tx_frame">002 TX FRAME : OPCODE=1, FIN=True, RSV=0, PAYLOAD-LEN=4, MASK=None, PAYLOAD-REPEAT-LEN=None, CHOPSIZE=None, SYNC=False</pre>
<pre class="wirelog_tx_frame"> 0xf1afbfbe</pre>
<pre class="wirelog_tx_octets">003 TX OCTETS: 8104f1afbfbe</pre>
<pre class="wirelog_kill_after">004 FAIL CONNECTION AFTER 0.500000 sec</pre>
<pre class="wirelog_rx_octets">005 RX OCTETS: 818420642f06d1cb90b8</pre>
<pre class="wirelog_rx_frame">006 RX FRAME : OPCODE=1, FIN=True, RSV=0, PAYLOAD-LEN=4, MASKED=True, MASK=3230363432663036</pre>
<pre class="wirelog_rx_frame"> 0xf1afbfbe</pre>
<pre class="wirelog_tx_frame">007 TX FRAME : OPCODE=8, FIN=True, RSV=0, PAYLOAD-LEN=2, MASK=None, PAYLOAD-REPEAT-LEN=None, CHOPSIZE=None, SYNC=False</pre>
<pre class="wirelog_tx_frame"> 0x03e8</pre>
<pre class="wirelog_tx_octets">008 TX OCTETS: 880203e8</pre>
<pre class="wirelog_rx_octets">009 RX OCTETS: 8882114b438712a3</pre>
<pre class="wirelog_rx_frame">010 RX FRAME : OPCODE=8, FIN=True, RSV=0, PAYLOAD-LEN=2, MASKED=True, MASK=3131346234333837</pre>
<pre class="wirelog_rx_frame"> 0x03e8</pre>
<pre class="wirelog_tcp_closed_by_me">011 TCP DROPPED BY ME</pre>
</div>
<br/><hr/>
</body>
</html>
| {
"content_hash": "e87f35dc9a8b23d546720d5651dc7ac7",
"timestamp": "",
"source": "github",
"line_count": 301,
"max_line_length": 266,
"avg_line_length": 38.62126245847176,
"alnum_prop": 0.631483870967742,
"repo_name": "stuffmatic/snacka",
"id": "3df56cad131ac99c62980f64432b0449f865cb6d",
"size": "11625",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "doc/autobahntestresults/snacka_case_6_22_13.html",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "C",
"bytes": "495433"
},
{
"name": "CSS",
"bytes": "29478"
},
{
"name": "Erlang",
"bytes": "469"
},
{
"name": "JavaScript",
"bytes": "39903"
},
{
"name": "Python",
"bytes": "2814"
},
{
"name": "Shell",
"bytes": "49"
}
],
"symlink_target": ""
} |
"""
This module is home to the Selection class
"""
from pyecobee.ecobee_object import EcobeeObject
class Selection(EcobeeObject):
"""
This class has been auto generated by scraping
https://www.ecobee.com/home/developer/api/documentation/v1/objects/Selection.shtml
Attribute names have been generated by converting ecobee property
names from camelCase to snake_case.
A getter property has been generated for each attribute.
A setter property has been generated for each attribute whose value
of READONLY is "no".
An __init__ argument without a default value has been generated if
the value of REQUIRED is "yes".
An __init__ argument with a default value of None has been generated
if the value of REQUIRED is "no".
"""
__slots__ = [
'_selection_type',
'_selection_match',
'_include_runtime',
'_include_extended_runtime',
'_include_electricity',
'_include_settings',
'_include_location',
'_include_program',
'_include_events',
'_include_device',
'_include_technician',
'_include_utility',
'_include_management',
'_include_alerts',
'_include_reminders',
'_include_weather',
'_include_house_details',
'_include_oem_cfg',
'_include_equipment_status',
'_include_notification_settings',
'_include_privacy',
'_include_version',
'_include_security_settings',
'_include_sensors',
'_include_audio',
'_include_energy',
]
attribute_name_map = {
'selection_type': 'selectionType',
'selectionType': 'selection_type',
'selection_match': 'selectionMatch',
'selectionMatch': 'selection_match',
'include_runtime': 'includeRuntime',
'includeRuntime': 'include_runtime',
'include_extended_runtime': 'includeExtendedRuntime',
'includeExtendedRuntime': 'include_extended_runtime',
'include_electricity': 'includeElectricity',
'includeElectricity': 'include_electricity',
'include_settings': 'includeSettings',
'includeSettings': 'include_settings',
'include_location': 'includeLocation',
'includeLocation': 'include_location',
'include_program': 'includeProgram',
'includeProgram': 'include_program',
'include_events': 'includeEvents',
'includeEvents': 'include_events',
'include_device': 'includeDevice',
'includeDevice': 'include_device',
'include_technician': 'includeTechnician',
'includeTechnician': 'include_technician',
'include_utility': 'includeUtility',
'includeUtility': 'include_utility',
'include_management': 'includeManagement',
'includeManagement': 'include_management',
'include_alerts': 'includeAlerts',
'includeAlerts': 'include_alerts',
'include_reminders': 'includeReminders',
'includeReminders': 'include_reminders',
'include_weather': 'includeWeather',
'includeWeather': 'include_weather',
'include_house_details': 'includeHouseDetails',
'includeHouseDetails': 'include_house_details',
'include_oem_cfg': 'includeOemCfg',
'includeOemCfg': 'include_oem_cfg',
'include_equipment_status': 'includeEquipmentStatus',
'includeEquipmentStatus': 'include_equipment_status',
'include_notification_settings': 'includeNotificationSettings',
'includeNotificationSettings': 'include_notification_settings',
'include_privacy': 'includePrivacy',
'includePrivacy': 'include_privacy',
'include_version': 'includeVersion',
'includeVersion': 'include_version',
'include_security_settings': 'includeSecuritySettings',
'includeSecuritySettings': 'include_security_settings',
'include_sensors': 'includeSensors',
'includeSensors': 'include_sensors',
'include_audio': 'includeAudio',
'includeAudio': 'include_audio',
'include_energy': 'includeEnergy',
'includeEnergy': 'include_energy',
}
attribute_type_map = {
'selection_type': 'six.text_type',
'selection_match': 'six.text_type',
'include_runtime': 'boolean',
'include_extended_runtime': 'boolean',
'include_electricity': 'boolean',
'include_settings': 'boolean',
'include_location': 'boolean',
'include_program': 'boolean',
'include_events': 'boolean',
'include_device': 'boolean',
'include_technician': 'boolean',
'include_utility': 'boolean',
'include_management': 'boolean',
'include_alerts': 'boolean',
'include_reminders': 'boolean',
'include_weather': 'boolean',
'include_house_details': 'boolean',
'include_oem_cfg': 'boolean',
'include_equipment_status': 'boolean',
'include_notification_settings': 'boolean',
'include_privacy': 'boolean',
'include_version': 'boolean',
'include_security_settings': 'boolean',
'include_sensors': 'boolean',
'include_audio': 'boolean',
'include_energy': 'boolean',
}
def __init__(
self,
selection_type,
selection_match,
include_runtime=None,
include_extended_runtime=None,
include_electricity=None,
include_settings=None,
include_location=None,
include_program=None,
include_events=None,
include_device=None,
include_technician=None,
include_utility=None,
include_management=None,
include_alerts=None,
include_reminders=None,
include_weather=None,
include_house_details=None,
include_oem_cfg=None,
include_equipment_status=None,
include_notification_settings=None,
include_privacy=None,
include_version=None,
include_security_settings=None,
include_sensors=None,
include_audio=None,
include_energy=None,
):
"""
Construct a Selection instance
"""
self._selection_type = selection_type
self._selection_match = selection_match
self._include_runtime = include_runtime
self._include_extended_runtime = include_extended_runtime
self._include_electricity = include_electricity
self._include_settings = include_settings
self._include_location = include_location
self._include_program = include_program
self._include_events = include_events
self._include_device = include_device
self._include_technician = include_technician
self._include_utility = include_utility
self._include_management = include_management
self._include_alerts = include_alerts
self._include_reminders = include_reminders
self._include_weather = include_weather
self._include_house_details = include_house_details
self._include_oem_cfg = include_oem_cfg
self._include_equipment_status = include_equipment_status
self._include_notification_settings = include_notification_settings
self._include_privacy = include_privacy
self._include_version = include_version
self._include_security_settings = include_security_settings
self._include_sensors = include_sensors
self._include_audio = include_audio
self._include_energy = include_energy
@property
def selection_type(self):
"""
Gets the selection_type attribute of this Selection instance.
:return: The value of the selection_type attribute of this
Selection instance.
:rtype: six.text_type
"""
return self._selection_type
@selection_type.setter
def selection_type(self, selection_type):
"""
Sets the selection_type attribute of this Selection instance.
:param selection_type: The selection_type value to set for the
selection_type attribute of this Selection instance.
:type: six.text_type
"""
self._selection_type = selection_type
@property
def selection_match(self):
"""
Gets the selection_match attribute of this Selection instance.
:return: The value of the selection_match attribute of this
Selection instance.
:rtype: six.text_type
"""
return self._selection_match
@selection_match.setter
def selection_match(self, selection_match):
"""
Sets the selection_match attribute of this Selection instance.
:param selection_match: The selection_match value to set for the
selection_match attribute of this Selection instance.
:type: six.text_type
"""
self._selection_match = selection_match
@property
def include_runtime(self):
"""
Gets the include_runtime attribute of this Selection instance.
:return: The value of the include_runtime attribute of this
Selection instance.
:rtype: boolean
"""
return self._include_runtime
@include_runtime.setter
def include_runtime(self, include_runtime):
"""
Sets the include_runtime attribute of this Selection instance.
:param include_runtime: The include_runtime value to set for the
include_runtime attribute of this Selection instance.
:type: boolean
"""
self._include_runtime = include_runtime
@property
def include_extended_runtime(self):
"""
Gets the include_extended_runtime attribute of this Selection
instance.
:return: The value of the include_extended_runtime attribute of
this Selection instance.
:rtype: boolean
"""
return self._include_extended_runtime
@include_extended_runtime.setter
def include_extended_runtime(self, include_extended_runtime):
"""
Sets the include_extended_runtime attribute of this Selection
instance.
:param include_extended_runtime: The include_extended_runtime
value to set for the include_extended_runtime attribute of this
Selection instance.
:type: boolean
"""
self._include_extended_runtime = include_extended_runtime
@property
def include_electricity(self):
"""
Gets the include_electricity attribute of this Selection
instance.
:return: The value of the include_electricity attribute of this
Selection instance.
:rtype: boolean
"""
return self._include_electricity
@include_electricity.setter
def include_electricity(self, include_electricity):
"""
Sets the include_electricity attribute of this Selection
instance.
:param include_electricity: The include_electricity value to set
for the include_electricity attribute of this Selection
instance.
:type: boolean
"""
self._include_electricity = include_electricity
@property
def include_settings(self):
"""
Gets the include_settings attribute of this Selection instance.
:return: The value of the include_settings attribute of this
Selection instance.
:rtype: boolean
"""
return self._include_settings
@include_settings.setter
def include_settings(self, include_settings):
"""
Sets the include_settings attribute of this Selection instance.
:param include_settings: The include_settings value to set for
the include_settings attribute of this Selection instance.
:type: boolean
"""
self._include_settings = include_settings
@property
def include_location(self):
"""
Gets the include_location attribute of this Selection instance.
:return: The value of the include_location attribute of this
Selection instance.
:rtype: boolean
"""
return self._include_location
@include_location.setter
def include_location(self, include_location):
"""
Sets the include_location attribute of this Selection instance.
:param include_location: The include_location value to set for
the include_location attribute of this Selection instance.
:type: boolean
"""
self._include_location = include_location
@property
def include_program(self):
"""
Gets the include_program attribute of this Selection instance.
:return: The value of the include_program attribute of this
Selection instance.
:rtype: boolean
"""
return self._include_program
@include_program.setter
def include_program(self, include_program):
"""
Sets the include_program attribute of this Selection instance.
:param include_program: The include_program value to set for the
include_program attribute of this Selection instance.
:type: boolean
"""
self._include_program = include_program
@property
def include_events(self):
"""
Gets the include_events attribute of this Selection instance.
:return: The value of the include_events attribute of this
Selection instance.
:rtype: boolean
"""
return self._include_events
@include_events.setter
def include_events(self, include_events):
"""
Sets the include_events attribute of this Selection instance.
:param include_events: The include_events value to set for the
include_events attribute of this Selection instance.
:type: boolean
"""
self._include_events = include_events
@property
def include_device(self):
"""
Gets the include_device attribute of this Selection instance.
:return: The value of the include_device attribute of this
Selection instance.
:rtype: boolean
"""
return self._include_device
@include_device.setter
def include_device(self, include_device):
"""
Sets the include_device attribute of this Selection instance.
:param include_device: The include_device value to set for the
include_device attribute of this Selection instance.
:type: boolean
"""
self._include_device = include_device
@property
def include_technician(self):
"""
Gets the include_technician attribute of this Selection
instance.
:return: The value of the include_technician attribute of this
Selection instance.
:rtype: boolean
"""
return self._include_technician
@include_technician.setter
def include_technician(self, include_technician):
"""
Sets the include_technician attribute of this Selection
instance.
:param include_technician: The include_technician value to set
for the include_technician attribute of this Selection instance.
:type: boolean
"""
self._include_technician = include_technician
@property
def include_utility(self):
"""
Gets the include_utility attribute of this Selection instance.
:return: The value of the include_utility attribute of this
Selection instance.
:rtype: boolean
"""
return self._include_utility
@include_utility.setter
def include_utility(self, include_utility):
"""
Sets the include_utility attribute of this Selection instance.
:param include_utility: The include_utility value to set for the
include_utility attribute of this Selection instance.
:type: boolean
"""
self._include_utility = include_utility
@property
def include_management(self):
"""
Gets the include_management attribute of this Selection
instance.
:return: The value of the include_management attribute of this
Selection instance.
:rtype: boolean
"""
return self._include_management
@include_management.setter
def include_management(self, include_management):
"""
Sets the include_management attribute of this Selection
instance.
:param include_management: The include_management value to set
for the include_management attribute of this Selection instance.
:type: boolean
"""
self._include_management = include_management
@property
def include_alerts(self):
"""
Gets the include_alerts attribute of this Selection instance.
:return: The value of the include_alerts attribute of this
Selection instance.
:rtype: boolean
"""
return self._include_alerts
@include_alerts.setter
def include_alerts(self, include_alerts):
"""
Sets the include_alerts attribute of this Selection instance.
:param include_alerts: The include_alerts value to set for the
include_alerts attribute of this Selection instance.
:type: boolean
"""
self._include_alerts = include_alerts
@property
def include_reminders(self):
"""
Gets the include_reminders attribute of this Selection instance.
:return: The value of the include_reminders attribute of this
Selection instance.
:rtype: boolean
"""
return self._include_reminders
@include_reminders.setter
def include_reminders(self, include_reminders):
"""
Sets the include_reminders attribute of this Selection instance.
:param include_reminders: The include_reminders value to set for
the include_reminders attribute of this Selection instance.
:type: boolean
"""
self._include_reminders = include_reminders
@property
def include_weather(self):
"""
Gets the include_weather attribute of this Selection instance.
:return: The value of the include_weather attribute of this
Selection instance.
:rtype: boolean
"""
return self._include_weather
@include_weather.setter
def include_weather(self, include_weather):
"""
Sets the include_weather attribute of this Selection instance.
:param include_weather: The include_weather value to set for the
include_weather attribute of this Selection instance.
:type: boolean
"""
self._include_weather = include_weather
@property
def include_house_details(self):
"""
Gets the include_house_details attribute of this Selection
instance.
:return: The value of the include_house_details attribute of
this Selection instance.
:rtype: boolean
"""
return self._include_house_details
@include_house_details.setter
def include_house_details(self, include_house_details):
"""
Sets the include_house_details attribute of this Selection
instance.
:param include_house_details: The include_house_details value to
set for the include_house_details attribute of this Selection
instance.
:type: boolean
"""
self._include_house_details = include_house_details
@property
def include_oem_cfg(self):
"""
Gets the include_oem_cfg attribute of this Selection instance.
:return: The value of the include_oem_cfg attribute of this
Selection instance.
:rtype: boolean
"""
return self._include_oem_cfg
@include_oem_cfg.setter
def include_oem_cfg(self, include_oem_cfg):
"""
Sets the include_oem_cfg attribute of this Selection instance.
:param include_oem_cfg: The include_oem_cfg value to set for the
include_oem_cfg attribute of this Selection instance.
:type: boolean
"""
self._include_oem_cfg = include_oem_cfg
@property
def include_equipment_status(self):
"""
Gets the include_equipment_status attribute of this Selection
instance.
:return: The value of the include_equipment_status attribute of
this Selection instance.
:rtype: boolean
"""
return self._include_equipment_status
@include_equipment_status.setter
def include_equipment_status(self, include_equipment_status):
"""
Sets the include_equipment_status attribute of this Selection
instance.
:param include_equipment_status: The include_equipment_status
value to set for the include_equipment_status attribute of this
Selection instance.
:type: boolean
"""
self._include_equipment_status = include_equipment_status
@property
def include_notification_settings(self):
"""
Gets the include_notification_settings attribute of this
Selection instance.
:return: The value of the include_notification_settings
attribute of this Selection instance.
:rtype: boolean
"""
return self._include_notification_settings
@include_notification_settings.setter
def include_notification_settings(self, include_notification_settings):
"""
Sets the include_notification_settings attribute of this
Selection instance.
:param include_notification_settings: The
include_notification_settings value to set for the
include_notification_settings attribute of this Selection
instance.
:type: boolean
"""
self._include_notification_settings = include_notification_settings
@property
def include_privacy(self):
"""
Gets the include_privacy attribute of this Selection instance.
:return: The value of the include_privacy attribute of this
Selection instance.
:rtype: boolean
"""
return self._include_privacy
@include_privacy.setter
def include_privacy(self, include_privacy):
"""
Sets the include_privacy attribute of this Selection instance.
:param include_privacy: The include_privacy value to set for the
include_privacy attribute of this Selection instance.
:type: boolean
"""
self._include_privacy = include_privacy
@property
def include_version(self):
"""
Gets the include_version attribute of this Selection instance.
:return: The value of the include_version attribute of this
Selection instance.
:rtype: boolean
"""
return self._include_version
@include_version.setter
def include_version(self, include_version):
"""
Sets the include_version attribute of this Selection instance.
:param include_version: The include_version value to set for the
include_version attribute of this Selection instance.
:type: boolean
"""
self._include_version = include_version
@property
def include_security_settings(self):
"""
Gets the include_security_settings attribute of this Selection
instance.
:return: The value of the include_security_settings attribute of
this Selection instance.
:rtype: boolean
"""
return self._include_security_settings
@include_security_settings.setter
def include_security_settings(self, include_security_settings):
"""
Sets the include_security_settings attribute of this Selection
instance.
:param include_security_settings: The include_security_settings
value to set for the include_security_settings attribute of this
Selection instance.
:type: boolean
"""
self._include_security_settings = include_security_settings
@property
def include_sensors(self):
"""
Gets the include_sensors attribute of this Selection instance.
:return: The value of the include_sensors attribute of this
Selection instance.
:rtype: boolean
"""
return self._include_sensors
@include_sensors.setter
def include_sensors(self, include_sensors):
"""
Sets the include_sensors attribute of this Selection instance.
:param include_sensors: The include_sensors value to set for the
include_sensors attribute of this Selection instance.
:type: boolean
"""
self._include_sensors = include_sensors
@property
def include_audio(self):
"""
Gets the include_audio attribute of this Selection instance.
:return: The value of the include_audio attribute of this
Selection instance.
:rtype: boolean
"""
return self._include_audio
@include_audio.setter
def include_audio(self, include_audio):
"""
Sets the include_audio attribute of this Selection instance.
:param include_audio: The include_audio value to set for the
include_audio attribute of this Selection instance.
:type: boolean
"""
self._include_audio = include_audio
@property
def include_energy(self):
"""
Gets the include_energy attribute of this Selection instance.
:return: The value of the include_energy attribute of this
Selection instance.
:rtype: boolean
"""
return self._include_energy
@include_energy.setter
def include_energy(self, include_energy):
"""
Sets the include_energy attribute of this Selection instance.
:param include_energy: The include_energy value to set for the
include_energy attribute of this Selection instance.
:type: boolean
"""
self._include_energy = include_energy
| {
"content_hash": "3701c8d12ae46ac2cfc1fd628fa4d356",
"timestamp": "",
"source": "github",
"line_count": 842,
"max_line_length": 86,
"avg_line_length": 31.048693586698338,
"alnum_prop": 0.6362697471598516,
"repo_name": "sfanous/Pyecobee",
"id": "5ce39f5d73313f254a0263a06dc4c1e017f860a5",
"size": "26143",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pyecobee/objects/selection.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "580006"
}
],
"symlink_target": ""
} |
package com.taobao.tddl.optimizer.core.plan.bean;
import java.util.Collection;
import com.taobao.tddl.optimizer.core.plan.IDataNodeExecutor;
public abstract class DataNodeExecutor<RT extends IDataNodeExecutor> implements IDataNodeExecutor<RT> {
protected String requestHostName;
protected Long requestId;
protected Long subRequestId;
protected String targetNode;
protected boolean consistentRead = true;
protected Integer thread;
protected Object extra;
protected boolean useBIO = false;
protected String sql;
protected boolean streaming = false;
protected boolean lazyLoad = false;
protected boolean existSequenceVal = false; // 是否存在sequence
protected Long lastSequenceVal = null; // 上一次生成的sequenceVal
@Override
public RT executeOn(String targetNode) {
this.targetNode = targetNode;
return (RT) this;
}
@Override
public boolean getConsistent() {
return consistentRead;
}
@Override
public Object getExtra() {
return this.extra;
}
@Override
public String getDataNode() {
return targetNode;
}
@Override
public String getRequestHostName() {
return requestHostName;
}
@Override
public Long getRequestId() {
return requestId;
}
@Override
public String getSql() {
return this.sql;
}
@Override
public Long getSubRequestId() {
return requestId;
}
@Override
public Integer getThread() {
return this.thread;
}
@Override
public boolean isStreaming() {
return this.streaming;
}
@Override
public boolean isUseBIO() {
return this.useBIO;
}
@Override
public RT setConsistent(boolean consistent) {
this.consistentRead = consistent;
return (RT) this;
}
@Override
public RT setExtra(Object obj) {
this.extra = obj;
return (RT) this;
}
@Override
public RT setRequestHostName(String requestHostName) {
this.requestHostName = requestHostName;
return (RT) this;
}
@Override
public RT setRequestId(Long requestId) {
this.requestId = requestId;
return (RT) this;
}
@Override
public RT setSql(String sql) {
this.sql = sql;
return (RT) this;
}
@Override
public RT setStreaming(boolean streaming) {
this.streaming = streaming;
return (RT) this;
}
@Override
public RT setSubRequestId(Long subRequestId) {
this.subRequestId = subRequestId;
return (RT) this;
}
/**
* 表明一个建议的用于执行该节点的线程id
*/
@Override
public RT setThread(Integer i) {
this.thread = i;
return (RT) this;
}
@Override
public RT setUseBIO(boolean useBIO) {
this.useBIO = useBIO;
return (RT) this;
}
public void ensureCapacity(Collection collection, int minCapacity) {
while (collection.size() <= minCapacity) {
collection.add(null);
}
}
@Override
public boolean lazyLoad() {
return this.lazyLoad;
}
@Override
public void setLazyLoad(boolean lazyLoad) {
this.lazyLoad = lazyLoad;
}
@Override
public boolean isExistSequenceVal() {
return this.existSequenceVal;
}
@Override
public void setExistSequenceVal(boolean existSequenceVal) {
this.existSequenceVal = existSequenceVal;
}
@Override
public Long getLastSequenceVal() {
return lastSequenceVal;
}
@Override
public void setLastSequenceVal(Long lastSequenceVal) {
this.lastSequenceVal = lastSequenceVal;
}
}
| {
"content_hash": "220541676e84a471ae8decafde44b7e8",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 103,
"avg_line_length": 21.86627906976744,
"alnum_prop": 0.6229726136665781,
"repo_name": "ninqing/tddl",
"id": "42d0bc020118aa40383c2b1bc954733148baf174",
"size": "3815",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tddl-optimizer/src/main/java/com/taobao/tddl/optimizer/core/plan/bean/DataNodeExecutor.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "6943251"
}
],
"symlink_target": ""
} |
describe('Ancillary Chunks', function () {
// Transparency chunk
require('./transparency');
// Text
require('./text');
// International text
require('./international');
// Modification time
require('./time');
// Background chunk
require('./background');
// Chroma settings
require('./chroma');
// Gamma info
require('./gamma');
// Histogram
require('./histogram');
// Physical dimensions
require('./physical');
// Significant bits in IDAT chunks
require('./significantBits');
// Suggested Palette
require('./suggestedPalette');
// Intent
require('./intent');
});
| {
"content_hash": "9a6d8ed5baf5bdfae304f9b573911b06",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 42,
"avg_line_length": 15.763157894736842,
"alnum_prop": 0.6527545909849749,
"repo_name": "yahoo/pngjs-image",
"id": "6f1e5aacb3df7e832be6e1f2d2f054d174d75fad",
"size": "721",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/png/decode/ancillary/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "350297"
}
],
"symlink_target": ""
} |
package io.dropwizard.views.mustache;
import com.github.mustachejava.Mustache;
import com.github.mustachejava.MustacheException;
import com.github.mustachejava.MustacheFactory;
import com.google.common.base.Charsets;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.google.common.util.concurrent.UncheckedExecutionException;
import io.dropwizard.views.View;
import io.dropwizard.views.ViewRenderer;
import javax.ws.rs.WebApplicationException;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.nio.charset.Charset;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.ExecutionException;
/**
* A {@link ViewRenderer} which renders Mustache ({@code .mustache}) templates.
*/
public class MustacheViewRenderer implements ViewRenderer {
private final LoadingCache<Class<? extends View>, MustacheFactory> factories;
public MustacheViewRenderer() {
this.factories = CacheBuilder.newBuilder()
.build(new CacheLoader<Class<? extends View>, MustacheFactory>() {
@Override
public MustacheFactory load(Class<? extends View> key) throws Exception {
return new PerClassMustacheFactory(key);
}
});
}
@Override
public boolean isRenderable(View view) {
return view.getTemplateName().endsWith(getSuffix());
}
@Override
public void render(View view, Locale locale, OutputStream output) throws IOException, WebApplicationException {
try {
final Mustache template = factories.get(view.getClass())
.compile(view.getTemplateName());
final Charset charset = view.getCharset().or(Charsets.UTF_8);
try (OutputStreamWriter writer = new OutputStreamWriter(output, charset)) {
template.execute(writer, view);
}
} catch (ExecutionException | UncheckedExecutionException | MustacheException ignored) {
throw new FileNotFoundException("Template " + view.getTemplateName() + " not found.");
}
}
@Override
public void configure(Map<String, String> options) {}
@Override
public String getSuffix() {
return ".mustache";
}
}
| {
"content_hash": "a70347af36b0016204338a05b14fb1f8",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 115,
"avg_line_length": 39.06060606060606,
"alnum_prop": 0.6543832428238945,
"repo_name": "ckingsbu/dropwizard",
"id": "26e9d05521fc83bb18dc799a1b8bd2f23bb5f787",
"size": "2578",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "dropwizard-views-mustache/src/main/java/io/dropwizard/views/mustache/MustacheViewRenderer.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "501"
},
{
"name": "Java",
"bytes": "1280237"
},
{
"name": "Shell",
"bytes": "4572"
}
],
"symlink_target": ""
} |
import React from 'react'
import { Field, FieldArray, reduxForm, formValueSelector } from 'redux-form';
import { connect } from 'react-redux';
import { renderFieldInput, renderFieldTextArea, renderFieldSelect, renderFieldTags, renderFieldInputButton, renderFieldCheckbox, renderFieldCategoria} from './renderField';
import asyncValidate from './asyncValidate';
import validate from './validate';
import FileInput from './FileInput'
import Query from './Query'
const renderFieldArray = ({fields, setName, onDropFunction, handleSubmit, setTemplate, uploading, getCategoria, filePullLoaded, sottocategoria, tipodataset, modalitacaricamento, tipofile, addTagsFiletagsToForm, tempopolling, nomefile, urlws, reset, errorNext, getSchemaFromWS, query, setQuery, resultQuery, executeQuery, resetQueryValue, openModalInfo, config, meta : {touched, error} }) => <div>
<Field
name="titolo"
component={renderFieldInput}
label="Titolo"
onChange={setName}
openModalInfo={openModalInfo}
config={config}
/>
<Field
name="nome"
component={renderFieldInput}
label="Nome"
readonly="true"
openModalInfo={openModalInfo}
config={config}
/>
{/* <Field
name="public"
options={config['dafvoc-ingform-dataset_visibility']}
component={renderFieldSelect}
label="Pubblico/OpenData"
openModalInfo={openModalInfo}
config={config}
/> */}
<Field
name="descrizione"
component={renderFieldTextArea}
label="Descrizione"
openModalInfo={openModalInfo}
config={config}
/>
<Field
name="categoria"
options={getCategoria(1,undefined)}
component={renderFieldCategoria}
label="Categoria"
openModalInfo={openModalInfo}
config={config}
/>
{(sottocategoria && sottocategoria.length>0) &&
<Field
name="sottocategoria"
options={sottocategoria}
component={renderFieldCategoria}
label="Sotto categoria"
openModalInfo={openModalInfo}
config={config}
/>
}
<Field
name="filetags"
component={renderFieldTags}
label="Tags"
addTagsToForm={addTagsFiletagsToForm}
openModalInfo={openModalInfo}
config={config}
/>
{/* <Field
name="template"
options={config['dafvoc-ingform-template']}
component={renderFieldSelect}
label="Template"
onChange={setTemplate}
openModalInfo={openModalInfo}
config={config}
/> */}
<Field
name="tipodataset"
options={config['dafvoc-ingform-newtype']}
component={renderFieldSelect}
label="Tipo Dataset"
openModalInfo={openModalInfo}
config={config}
/>
{tipodataset=='primitive' &&
<div>
<Field
name="tipofile"
options={config['dafvoc-ingform-filetype']}
component={renderFieldSelect}
label="Tipo di File"
openModalInfo={openModalInfo}
config={config}
/>
<Field
name="modalitacaricamento"
options={config['dafvoc-ingform-ingest_type']}
component={renderFieldSelect}
label="Modalità Caricamento"
openModalInfo={openModalInfo}
config={config}
/>
{(modalitacaricamento=='sftp' || modalitacaricamento=='webservice_push')&&
<div className="card">
<div className="card-body">
<h5 className="card-title">Caricamento tramite SFTP / API PUT</h5>
<div className="form-group">
<div className="col-md-12">
<p>Definisci lo schema del tuo Dataset caricando un sample (max 1MB), il file completo lo potrai caricare in seguito:</p>
{/* <Field
name="caricafile"
component={renderFieldCheckbox}
label="Caricare il file al termine della metadatazione"
openModalInfo={openModalInfo}
config={config}
/> */}
<Field
name="tempopolling"
options={config['tempoDiPollingOptions']}
component={renderFieldSelect}
label="Tempo di Polling"
openModalInfo={openModalInfo}
config={config}
/>
{tempopolling==0 &&
<Field
name="espressionecron"
component={renderFieldInput}
label="Espressione"
openModalInfo={openModalInfo}
config={config}
/>
}
{tempopolling==1 &&
<div>
<Field
name="timerunita"
options={config['timerUnita']}
component={renderFieldSelect}
label="Unità"
openModalInfo={openModalInfo}
config={config}
/>
<Field
name="timerquantita"
component={renderFieldInput}
label="Quantità"
openModalInfo={openModalInfo}
config={config}
/>
</div>
}
{nomefile?
<div>
<Field
name="nomefile"
component={renderFieldInputButton}
label="Nome File Caricato"
readonly="true"
buttonLabel="Elimina File"
onClick={reset}
iconClassName="fa fa-trash fa-lg"
config={config}
/>
</div>
:
<Field
name="filesftp"
label="Caricamento:"
component={FileInput}
classNameLabel="file-input-label"
className="file-input"
dropzone_options={{
multiple: false,
accept: 'image/*'
}}
onDropFunction={onDropFunction}
fields={fields}
tipofile={tipofile}
/>
}
</div>
</div>
</div>
</div>
}
{modalitacaricamento=='webservice_pull' &&
<div className="card">
<div className="card-body">
<h5 className="card-title">Caricamento tramite Web Service</h5>
<div className="form-group">
<div className="col-md-12">
<Field
name="tempopolling"
options={config['tempoDiPollingOptions']}
component={renderFieldSelect}
label="Tempo di Polling"
openModalInfo={openModalInfo}
config={config}
/>
{tempopolling==0 &&
<Field
name="espressionecron"
component={renderFieldInput}
label="Espressione"
openModalInfo={openModalInfo}
config={config}
/>
}
{tempopolling==1 &&
<div>
<Field
name="timerunita"
options={config['timerUnita']}
component={renderFieldSelect}
label="Unità"
openModalInfo={openModalInfo}
config={config}
/>
<Field
name="timerquantita"
component={renderFieldInput}
label="Quantità"
openModalInfo={openModalInfo}
config={config}
/>
</div>
}
{filePullLoaded?
<div>
<Field
name="urlws"
component={renderFieldInputButton}
label="Url Servizio Pull"
readonly="true"
buttonLabel="Elimina File"
onClick={reset}
iconClassName={uploading?"fas fa-circle-notch fa-spin fa-lg":"fa fa-trash fa-lg"}
config={config}
/>
</div>
:
<Field
name="urlws"
component={renderFieldInputButton}
label="Inserisci URL"
buttonLabel="Carica"
onClick={getSchemaFromWS.bind(this,fields, urlws, tipofile)}
iconClassName="fa fa-plus"
placeholder="http://"
openModalInfo={openModalInfo}
config={config}
/>
}
</div>
</div>
</div>
</div>
}
</div>
}
{tipodataset=='derived_sql' &&
<Query
setQuery={setQuery}
fields={fields}
onDropFunction={onDropFunction}
/>
}
{tipodataset=='derived_procspark' &&
<div>
<Field
name="sparkprocedure"
component={renderFieldInputButton}
label="File Procedura"
buttonLabel="Importa"
onClick={getSchemaFromWS.bind(this,fields, urlws)}
iconClassName="fa fa-upload"
placeholder=".jar"
openModalInfo={openModalInfo}
config={config}
/>
</div>
}
{errorNext && <div className="text-danger">{errorNext}</div>}
<div>
<button type="button" onClick={handleSubmit} className="btn btn-primary float-right">Avanti</button>
</div>
</div>
let WizardFormFirstPage = props => {
const { onDropFunction, handleSubmit, reset, categoria, filePullLoaded, tipodataset, tipofile, setTemplate, addTagsFiletagsToForm, modalitacaricamento, tempopolling, getCategoria, setName, nomefile, urlws, previousPage, getSchemaFromWS, query, setQuery, resultQuery, executeQuery, resetQueryValue, openModalInfo, errorNext, config, uploading } = props;
var sottocategoria = getCategoria(2,categoria)
return (
<div className="mt-5">
<p className="text-justify"><b>Benvenuto</b> ricordati che a grandi poteri derivano grandi responsabilità</p>
<form className="mt-5">
<FieldArray
name="inferred"
component={renderFieldArray}
onDropFunction={onDropFunction}
categoria={categoria}
sottocategoria={sottocategoria}
tipodataset={tipodataset}
modalitacaricamento={modalitacaricamento}
getCategoria={getCategoria}
reset={reset}
setName={setName}
nomefile={nomefile}
previousPage={previousPage}
getSchemaFromWS={getSchemaFromWS}
urlws={urlws}
tempopolling={tempopolling}
errorNext={errorNext}
setTemplate={setTemplate}
query={query}
setQuery={setQuery}
resultQuery={resultQuery}
executeQuery={executeQuery}
resetQueryValue={resetQueryValue}
addTagsFiletagsToForm={addTagsFiletagsToForm}
openModalInfo={openModalInfo}
config={config}
tipofile={tipofile}
filePullLoaded={filePullLoaded}
handleSubmit={handleSubmit}
uploading={uploading}
/>
</form>
</div>
);
};
WizardFormFirstPage = reduxForm({
form: 'wizard',
destroyOnUnmount: false,
forceUnregisterOnUnmount: true,
validate,
asyncValidate,
asyncBlurFields: ['titolo']
})(WizardFormFirstPage);
const selector = formValueSelector('wizard')
WizardFormFirstPage = connect(state => {
const categoria = selector(state, 'categoria')
const tipodataset = selector(state, 'tipodataset')
const modalitacaricamento = selector(state, 'modalitacaricamento')
const tempopolling = selector(state, 'tempopolling')
const nomefile = selector(state, 'nomefile')
const urlws = selector(state, 'urlws')
const tipofile = selector(state, 'tipofile')
return { categoria, tipodataset, modalitacaricamento, tempopolling, nomefile, urlws, tipofile }
})(WizardFormFirstPage)
export default WizardFormFirstPage
| {
"content_hash": "bf646fa44d72043959dcc2516e3c885a",
"timestamp": "",
"source": "github",
"line_count": 367,
"max_line_length": 396,
"avg_line_length": 41.926430517711175,
"alnum_prop": 0.43296289075193345,
"repo_name": "giux78/daf-dataportal",
"id": "6050936b11c477487a764d1508754fb2e45f5f6a",
"size": "15393",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/components/IngestionWizardFormAdvanced/WizardFormFirstPage.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "812942"
},
{
"name": "Dockerfile",
"bytes": "547"
},
{
"name": "HTML",
"bytes": "4331"
},
{
"name": "JavaScript",
"bytes": "1559857"
},
{
"name": "Shell",
"bytes": "2866"
}
],
"symlink_target": ""
} |
from flask import Flask,render_template,request,redirect,session,url_for,g
import loganalysis_v2
import user
import gconf
import time
from datetime import timedelta
app=Flask(__name__)
app.secret_key = 'A0Zr98j/3yX R~XHH!jmN]LWX/,?RT'
@app.route('/')
def index():
if not 'username' in session:
return redirect(url_for('login'))
else:
return redirect(url_for('users'))
@app.route('/log/',methods=['POST','GET'])
def log():
if not 'username' in session:
return render_template('login.html',error=u'请先登录!')
else:
params = request.args if request.method == 'GET' else request.form
topn=params.get('topn',10)
topn=int(topn) if str(topn).isdigit() else 10
SrcFileName='www_access_20140823.log'
rt_list=loganalysis_v2.FilterNginx(SrcFileName,Num=topn)
return render_template('log.html',rt_list=rt_list,title="top"+str(topn))
@app.route('/login/',methods=['POST','GET'])
def login():
params = request.args if request.method == 'GET' else request.form
username=params.get('username', '')
password=params.get('password','')
if user.validate_user(username, password):
session.permanent = True
app.permanent_session_lifetime = timedelta(minutes=5)
session['username']=username
return redirect('/users/')
else:
return render_template('login.html',username=username,error=u'用户名或密码错误')
@app.route('/users/')
def users():
if not 'username' in session:
return render_template('login.html',error=u'请先登录!')
else:
UserList=user.GetUser(gconf.UserFile)
return render_template('users.html',userlist=UserList)
@app.route('/user/create/')
def usercreate():
return render_template('createuser.html')
@app.route('/user/add/',methods=['POST','GET'])
def useradd():
params = request.args if request.method == 'GET' else request.form
username,password,age=params.get('username',''),params.get('password',''),params.get('age','')
Flag=user.JudgUser(username)
print Flag
if Flag:
return render_template('createuser.html',userexist= u'抱歉,用户%s已经存在' %(username))
else:
Flag=user.AddUser(username, password, age)
if Flag:
UserList=user.GetUser(gconf.UserFile)
return render_template('users.html',userlist=UserList,color='green',Flag=u'恭喜,添加成功')
else:
return render_template('createuser.html',userexist= u'抱歉,用户%s添加失败' %(username))
@app.route('/user/modify/',methods=['GET'])
def usermodify():
username,password,age=request.args.get('username',''),request.args.get('password',''),request.args.get('age','')
return render_template('modifyuser.html',username=username,password=password,age=age)
@app.route('/user/change/',methods=['POST','GET'])
def userchange():
params = request.args if request.method == 'GET' else request.form
username,password,age=params.get('username',''),params.get('password',''),params.get('age','')
Flag=user.ChangeUser(username, password, age)
if Flag=='samepassword':
return render_template('modifyuser.html',username=username,password=password,age=age,samepassword=u'抱歉,用户%s修改后的密码不能和原密码相同' %(username))
elif Flag:
UserList=user.GetUser(gconf.UserFile)
return render_template('users.html',userlist=UserList,color='green',Flag=u'恭喜,修改成功')
else:
return render_template('modifyuser.html',error=u'抱歉,用户%s修改失败' %(username))
@app.route('/user/del/',methods=['GET'])
def userdel():
username=request.args.get('username','')
Flag=user.DelUser(username)
if Flag:
UserList=user.GetUser(gconf.UserFile)
return render_template('users.html',userlist=UserList,color='green',Flag=u'恭喜,用户%s删除成功' %(username))
else:
UserList=user.GetUser(gconf.UserFile)
return render_template('users.html',userlist=UserList,color='red',Flag=u'抱歉,用户%s删除失败' %(username))
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8080, debug=True)
'''
不错,继续加油
改进点
1. 在打开编辑用户页面,目前只有三个属性,可以都使用get方式都传递到后台,再渲染到模板中没有问题
但常用方法是:只传递用户的唯一标识,在后台再通过唯一标识查找存储的信息,回显到编辑页面中
'''
| {
"content_hash": "f42c05be2138937468f1eb412bdbc183",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 143,
"avg_line_length": 38.495327102803735,
"alnum_prop": 0.6732216557416849,
"repo_name": "51reboot/actual_09_homework",
"id": "9eff9cccebcae98f52cd7d13e7e82b9560142dcf",
"size": "4553",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "05/huxianglin/cmdb/app.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "4623850"
},
{
"name": "HTML",
"bytes": "90670692"
},
{
"name": "JavaScript",
"bytes": "31827839"
},
{
"name": "Nginx",
"bytes": "1073"
},
{
"name": "PHP",
"bytes": "349512"
},
{
"name": "Python",
"bytes": "1705997"
},
{
"name": "Shell",
"bytes": "10001"
},
{
"name": "Smarty",
"bytes": "342164"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_151) on Wed Jul 17 09:39:59 MST 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ErrorPageConsumer (BOM: * : All 2.4.1.Final-SNAPSHOT API)</title>
<meta name="date" content="2019-07-17">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ErrorPageConsumer (BOM: * : All 2.4.1.Final-SNAPSHOT API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":18};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],16:["t5","Default Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/ErrorPageConsumer.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">Thorntail API, 2.4.1.Final-SNAPSHOT</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ErrorPage.html" title="class in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ErrorPageSupplier.html" title="interface in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/wildfly/swarm/config/undertow/configuration/ErrorPageConsumer.html" target="_top">Frames</a></li>
<li><a href="ErrorPageConsumer.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.wildfly.swarm.config.undertow.configuration</div>
<h2 title="Interface ErrorPageConsumer" class="title">Interface ErrorPageConsumer<T extends <a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ErrorPage.html" title="class in org.wildfly.swarm.config.undertow.configuration">ErrorPage</a><T>></h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Functional Interface:</dt>
<dd>This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.</dd>
</dl>
<hr>
<br>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/FunctionalInterface.html?is-external=true" title="class or interface in java.lang">@FunctionalInterface</a>
public interface <span class="typeNameLabel">ErrorPageConsumer<T extends <a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ErrorPage.html" title="class in org.wildfly.swarm.config.undertow.configuration">ErrorPage</a><T>></span></pre>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span><span id="t5" class="tableTab"><span><a href="javascript:show(16);">Default Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ErrorPageConsumer.html#accept-T-">accept</a></span>(<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ErrorPageConsumer.html" title="type parameter in ErrorPageConsumer">T</a> value)</code>
<div class="block">Configure a pre-constructed instance of ErrorPage resource</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>default <a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ErrorPageConsumer.html" title="interface in org.wildfly.swarm.config.undertow.configuration">ErrorPageConsumer</a><<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ErrorPageConsumer.html" title="type parameter in ErrorPageConsumer">T</a>></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ErrorPageConsumer.html#andThen-org.wildfly.swarm.config.undertow.configuration.ErrorPageConsumer-">andThen</a></span>(<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ErrorPageConsumer.html" title="interface in org.wildfly.swarm.config.undertow.configuration">ErrorPageConsumer</a><<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ErrorPageConsumer.html" title="type parameter in ErrorPageConsumer">T</a>> after)</code> </td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="accept-org.wildfly.swarm.config.undertow.configuration.ErrorPage-">
<!-- -->
</a><a name="accept-T-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>accept</h4>
<pre>void accept(<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ErrorPageConsumer.html" title="type parameter in ErrorPageConsumer">T</a> value)</pre>
<div class="block">Configure a pre-constructed instance of ErrorPage resource</div>
</li>
</ul>
<a name="andThen-org.wildfly.swarm.config.undertow.configuration.ErrorPageConsumer-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>andThen</h4>
<pre>default <a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ErrorPageConsumer.html" title="interface in org.wildfly.swarm.config.undertow.configuration">ErrorPageConsumer</a><<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ErrorPageConsumer.html" title="type parameter in ErrorPageConsumer">T</a>> andThen(<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ErrorPageConsumer.html" title="interface in org.wildfly.swarm.config.undertow.configuration">ErrorPageConsumer</a><<a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ErrorPageConsumer.html" title="type parameter in ErrorPageConsumer">T</a>> after)</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/ErrorPageConsumer.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">Thorntail API, 2.4.1.Final-SNAPSHOT</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ErrorPage.html" title="class in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../../../org/wildfly/swarm/config/undertow/configuration/ErrorPageSupplier.html" title="interface in org.wildfly.swarm.config.undertow.configuration"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/wildfly/swarm/config/undertow/configuration/ErrorPageConsumer.html" target="_top">Frames</a></li>
<li><a href="ErrorPageConsumer.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2019 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p>
</body>
</html>
| {
"content_hash": "ff10b17d4e075ccc79035dd3610343c4",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 740,
"avg_line_length": 47.471774193548384,
"alnum_prop": 0.6596449503100315,
"repo_name": "wildfly-swarm/wildfly-swarm-javadocs",
"id": "672dd9090bb979bd4f8f951bccffded0757ed7f8",
"size": "11773",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "2.4.1.Final-SNAPSHOT/apidocs/org/wildfly/swarm/config/undertow/configuration/ErrorPageConsumer.html",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package org.ovirt.engine.core.dao;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import org.ovirt.engine.core.common.businessentities.Quota;
import org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum;
import org.ovirt.engine.core.common.businessentities.QuotaStorage;
import org.ovirt.engine.core.common.businessentities.QuotaVdsGroup;
import org.ovirt.engine.core.compat.Guid;
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
import org.springframework.jdbc.core.simple.SimpleJdbcCall;
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
/**
* <code>QuotaDAODbFacadeImpl</code> implements the calling to quota stored procedures (@see QuotaDAO).
*/
public class QuotaDAODbFacadeImpl extends BaseDAODbFacade implements QuotaDAO {
/**
* Save <code>Quota</code> entity with specific <code>Quota</code> storage and <code>Quota</code> vdsGroup
* limitation list.
*/
@Override
public void save(Quota quota) {
saveGlobalQuota(quota);
saveStorageSpecificQuotas(quota);
saveVdsGroupSpecificQuotas(quota);
}
/**
* Get <code>Quota</code> by name.
*
* @param quotaName
* - The quota name to find.
* @return The quota entity that was found.
*/
@Override
public Quota getQuotaByQuotaName(String quotaName) {
MapSqlParameterSource quotaParameterSource = getCustomMapSqlParameterSource();
quotaParameterSource.addValue("quota_name", quotaName);
Quota quotaEntity =
getCallsHandler().executeRead("GetQuotaByQuotaName", getQuotaFromResultSet(), quotaParameterSource);
return quotaEntity;
}
/**
* Get list of <code>Quotas</code> which are consumed by ad element id in storage pool (if not storage pool id not
* null).
*
* @param adElementId
* - The user ID or group ID.
* @param storagePoolId
* - The storage pool Id to search the quotas in (If null search all over the setup).
* @return All quotas for user.
*/
@Override
public List<Quota> getQuotaByAdElementId(Guid adElementId, Guid storagePoolId) {
MapSqlParameterSource quotaParameterSource = getCustomMapSqlParameterSource();
quotaParameterSource.addValue("ad_element_id", adElementId);
quotaParameterSource.addValue("storage_pool_id", storagePoolId);
List<Quota> quotaEntityList =
getCallsHandler().executeReadList("GetQuotaByAdElementId",
getQuotaMetaDataFromResultSet(),
quotaParameterSource);
return quotaEntityList;
}
/**
* Get specific limitation for <code>VdsGroup</code>.
*
* @param vdsGroupId
* - The vds group id, if null returns all the vds group limitations in the storage pool.
* @param quotaId
* - The <code>Quota</code> id
* @return List of QuotaStorage
*/
@Override
public List<QuotaVdsGroup> getQuotaVdsGroupByVdsGroupGuid(Guid vdsGroupId, Guid quotaId) {
return getQuotaVdsGroupByVdsGroupGuid(vdsGroupId, quotaId, true);
}
/**
* Get specific limitation for <code>VdsGroup</code>.
*
* @param vdsGroupId
* - The vds group id, if null returns all the vds group limitations in the storage pool.
* @param quotaId
* - The <code>Quota</code> id
* @param allowEmpty
* - Whether to return empty quotas or not
* @return List of QuotaStorage
*/
@Override
public List<QuotaVdsGroup> getQuotaVdsGroupByVdsGroupGuid(Guid vdsGroupId, Guid quotaId, boolean allowEmpty) {
MapSqlParameterSource parameterSource =
createQuotaIdParameterMapper(quotaId)
.addValue("vds_group_id", vdsGroupId)
.addValue("allow_empty", allowEmpty);
List<QuotaVdsGroup> quotaVdsGroupList = getCallsHandler().executeReadList("GetQuotaVdsGroupByVdsGroupGuid",
getVdsGroupQuotaResultSet(),
parameterSource);
return quotaVdsGroupList;
}
/**
* Get specific limitation for storage domain.
*
* @param storageId
* - The storage id, if null returns all the storages limitation in the storage pool.
* @param quotaId
* - The quota id
* @return List of QuotaStorage
*/
@Override
public List<QuotaStorage> getQuotaStorageByStorageGuid(Guid storageId, Guid quotaId) {
return getQuotaStorageByStorageGuid(storageId, quotaId, true);
}
/**
* Get specific limitation for storage domain.
*
* @param storageId
* - The storage id, if null returns all the storages limitation in the storage pool.
* @param quotaId
* - The quota id
* @param allowEmpty
* - Whether to return empty quotas or not
* @return List of QuotaStorage
*/
@Override
public List<QuotaStorage> getQuotaStorageByStorageGuid(Guid storageId, Guid quotaId, boolean allowEmpty) {
MapSqlParameterSource parameterSource =
createQuotaIdParameterMapper(quotaId).addValue("storage_id", storageId).addValue("allow_empty",
allowEmpty);
List<QuotaStorage> quotaStorageList = getCallsHandler().executeReadList("GetQuotaStorageByStorageGuid",
getQuotaStorageResultSet(),
parameterSource);
return quotaStorageList;
}
/**
* Returns all the Quota storages in the storage pool if v_storage_id is null, if v_storage_id is not null then a
* specific quota storage will be returned.
*/
@Override
public List<Quota> getQuotaByStoragePoolGuid(Guid storagePoolId) {
MapSqlParameterSource parameterSource =
getCustomMapSqlParameterSource().addValue("storage_pool_id", storagePoolId);
List<Quota> quotaList = getCallsHandler().executeReadList("GetQuotaByStoragePoolGuid",
getQuotaFromResultSet(),
parameterSource);
return quotaList;
}
/**
* Get full <code>Quota</code> entity.
*/
@Override
public Quota getById(Guid quotaId) {
MapSqlParameterSource parameterSource = createQuotaIdParameterMapper(quotaId);
Quota quotaEntity =
getCallsHandler().executeRead("GetQuotaByQuotaGuid", getQuotaFromResultSet(), parameterSource);
if (quotaEntity != null) {
quotaEntity.setQuotaVdsGroups(getQuotaVdsGroupByQuotaGuid(quotaId));
quotaEntity.setQuotaStorages(getQuotaStorageByQuotaGuid(quotaId));
}
return quotaEntity;
}
/**
* Get all quota storages which belong to quota with quotaId.
*/
@Override
public List<QuotaStorage> getQuotaStorageByQuotaGuid(Guid quotaId) {
MapSqlParameterSource parameterSource = createQuotaIdParameterMapper(quotaId);
return getCallsHandler().executeReadList("GetQuotaStorageByQuotaGuid",
getQuotaStorageResultSet(),
parameterSource);
}
/**
* Get all quota storages which belong to quota with quotaId.
*/
@Override
public List<QuotaStorage> getQuotaStorageByQuotaGuidWithGeneralDefault(Guid quotaId) {
return getQuotaStorageByStorageGuid(null, quotaId, false);
}
/**
* Get all quota Vds groups, which belong to quota with quotaId.
*/
@Override
public List<QuotaVdsGroup> getQuotaVdsGroupByQuotaGuid(Guid quotaId) {
MapSqlParameterSource parameterSource = createQuotaIdParameterMapper(quotaId);
return getCallsHandler().executeReadList("GetQuotaVdsGroupByQuotaGuid",
getVdsGroupQuotaResultSet(),
parameterSource);
}
/**
* Get all quota Vds groups, which belong to quota with quotaId.
* In case no quota Vds Groups are returned, a fictitious QuotaVdsGroup is returned,
* with an {@link Guid.Empty} Vds Id and a <code>null</code> name.
*/
@Override
public List<QuotaVdsGroup> getQuotaVdsGroupByQuotaGuidWithGeneralDefault(Guid quotaId) {
return getQuotaVdsGroupByVdsGroupGuid(null, quotaId, false);
}
@Override
public List<Quota> getAllRelevantQuotasForStorage(Guid storageId, Guid userID, boolean isFiltered) {
MapSqlParameterSource quotaParameterSource = getCustomMapSqlParameterSource();
quotaParameterSource.addValue("storage_id", storageId).addValue("user_id", userID).addValue("is_filtered", isFiltered);
List<Quota> quotas =
getCallsHandler().executeReadList("getAllThinQuotasByStorageId",
getQuotaMetaDataFromResultSet(),
quotaParameterSource);
return quotas;
}
@Override
public List<Quota> getAllRelevantQuotasForVdsGroup(Guid vdsGroupId, Guid userID, boolean isFiltered) {
MapSqlParameterSource quotaParameterSource = getCustomMapSqlParameterSource();
quotaParameterSource.addValue("vds_group_id", vdsGroupId).addValue("user_id", userID).addValue("is_filtered", isFiltered);
List<Quota> quotas =
getCallsHandler().executeReadList("getAllThinQuotasByVDSGroupId",
getQuotaMetaDataFromResultSet(),
quotaParameterSource);
return quotas;
}
/**
* Remove quota with quota id.
*/
@Override
public void remove(Guid id) {
getCallsHandler().executeModification("DeleteQuotaByQuotaGuid",
createQuotaIdParameterMapper(id));
}
/**
* Update <Code>quota</Code>, by updating the quota meta data and remove all its limitations and add the limitations
* from the quota parameter.
*/
@Override
public void update(Quota quota) {
getCallsHandler().executeModification("UpdateQuotaMetaData",
createQuotaMetaDataParameterMapper(quota));
getCallsHandler().executeModification("DeleteQuotaLimitationByQuotaGuid",
createQuotaIdParameterMapper(quota.getId()));
getCallsHandler().executeModification("InsertQuotaLimitation", getFullQuotaParameterMap(quota));
saveStorageSpecificQuotas(quota);
saveVdsGroupSpecificQuotas(quota);
}
/**
* Return initialized entity with quota Vds group result set.
*/
private ParameterizedRowMapper<QuotaVdsGroup> getVdsGroupQuotaResultSet() {
ParameterizedRowMapper<QuotaVdsGroup> mapperQuotaLimitation = new ParameterizedRowMapper<QuotaVdsGroup>() {
@Override
public QuotaVdsGroup mapRow(ResultSet rs, int rowNum)
throws SQLException {
QuotaVdsGroup entity = new QuotaVdsGroup();
entity.setQuotaId(Guid.createGuidFromString(rs.getString("quota_id")));
entity.setQuotaVdsGroupId(Guid.createGuidFromString(rs.getString("quota_vds_group_id")));
entity.setVdsGroupId(Guid.createGuidFromString(rs.getString("vds_group_id")));
entity.setVdsGroupName(rs.getString("vds_group_name"));
entity.setMemSizeMB((Long) rs.getObject("mem_size_mb"));
entity.setMemSizeMBUsage((Long) rs.getObject("mem_size_mb_usage"));
entity.setVirtualCpu((Integer) rs.getObject("virtual_cpu"));
entity.setVirtualCpuUsage((Integer) rs.getObject("virtual_cpu_usage"));
return entity;
}
};
return mapperQuotaLimitation;
}
/**
* Returns initialized entity with quota Storage result set.
*/
private ParameterizedRowMapper<QuotaStorage> getQuotaStorageResultSet() {
ParameterizedRowMapper<QuotaStorage> mapperQuotaLimitation = new ParameterizedRowMapper<QuotaStorage>() {
@Override
public QuotaStorage mapRow(ResultSet rs, int rowNum)
throws SQLException {
QuotaStorage entity = new QuotaStorage();
entity.setQuotaId(Guid.createGuidFromString(rs.getString("quota_id")));
entity.setQuotaStorageId(Guid.createGuidFromString(rs.getString("quota_storage_id")));
entity.setStorageId(Guid.createGuidFromString(rs.getString("storage_id")));
entity.setStorageName(rs.getString("storage_name"));
entity.setStorageSizeGB((Long) rs.getObject("storage_size_gb"));
entity.setStorageSizeGBUsage((Double) rs.getObject("storage_size_gb_usage"));
return entity;
}
};
return mapperQuotaLimitation;
}
/**
* Returns initialized entity with quota result set.
*/
private ParameterizedRowMapper<Quota> getQuotaFromResultSet() {
ParameterizedRowMapper<Quota> mapper = new ParameterizedRowMapper<Quota>() {
@Override
public Quota mapRow(ResultSet rs, int rowNum)
throws SQLException {
Quota entity = getQuotaMetaDataFromResultSet(rs);
// Check if memory size is not null, this is an indication if global limitation for vds group exists or
// not, since global limitation must be for all the quota vds group parameters.
if (rs.getObject("mem_size_mb") != null) {
// Set global vds group quota.
QuotaVdsGroup vdsGroupEntity = new QuotaVdsGroup();
vdsGroupEntity.setMemSizeMB((Long) rs.getObject("mem_size_mb"));
vdsGroupEntity.setMemSizeMBUsage((Long) rs.getObject("mem_size_mb_usage"));
vdsGroupEntity.setVirtualCpu((Integer) rs.getObject("virtual_cpu"));
vdsGroupEntity.setVirtualCpuUsage((Integer) rs.getObject("virtual_cpu_usage"));
entity.setGlobalQuotaVdsGroup(vdsGroupEntity);
}
// Check if storage limit size is not null, this is an indication if global limitation for storage
// exists or
// not.
if (rs.getObject("storage_size_gb") != null) {
// Set global storage quota.
QuotaStorage storageEntity = new QuotaStorage();
storageEntity.setStorageSizeGB((Long) rs.getObject("storage_size_gb"));
storageEntity.setStorageSizeGBUsage((Double) rs.getObject("storage_size_gb_usage"));
entity.setGlobalQuotaStorage(storageEntity);
}
return entity;
}
};
return mapper;
}
/**
* Returns initialized entity with quota meta data result set.
*/
private ParameterizedRowMapper<Quota> getQuotaMetaDataFromResultSet() {
ParameterizedRowMapper<Quota> mapper = new ParameterizedRowMapper<Quota>() {
@Override
public Quota mapRow(ResultSet rs, int rowNum)
throws SQLException {
return getQuotaMetaDataFromResultSet(rs);
}
};
return mapper;
}
private Quota getQuotaMetaDataFromResultSet(ResultSet rs) throws SQLException {
Quota entity = new Quota();
entity.setId(Guid.createGuidFromString(rs.getString("quota_id")));
entity.setStoragePoolId(Guid.createGuidFromString(rs.getString("storage_pool_id")));
entity.setStoragePoolName(rs.getString("storage_pool_name"));
entity.setQuotaName((String) rs.getObject("quota_name"));
entity.setDescription((String) rs.getObject("description"));
entity.setThresholdVdsGroupPercentage((Integer) rs.getObject("threshold_vds_group_percentage"));
entity.setThresholdStoragePercentage((Integer) rs.getObject("threshold_storage_percentage"));
entity.setGraceVdsGroupPercentage((Integer) rs.getObject("grace_vds_group_percentage"));
entity.setGraceStoragePercentage((Integer) rs.getObject("grace_storage_percentage"));
entity.setQuotaEnforcementType(QuotaEnforcementTypeEnum.forValue(rs.getInt("quota_enforcement_type")));
return entity;
}
private MapSqlParameterSource createQuotaIdParameterMapper(Guid quotaId) {
MapSqlParameterSource quotaParameterSource = getCustomMapSqlParameterSource()
.addValue("id", quotaId);
return quotaParameterSource;
}
/**
* Build quota storage parameter map, for quota limitation table, to indicate specific limitation on storage domain.
*
* @param quotaId
* - The global quota id which the storage is referencing to
* @param quotaStorage
* - The business entity which reflects the limitation on the specific storage.
* @return - Parameter Map
*/
private MapSqlParameterSource getQuotaStorageParameterMap(Guid quotaId, QuotaStorage quotaStorage) {
MapSqlParameterSource storageQuotaParameterMap =
createQuotaIdParameterMapper(quotaStorage.getQuotaStorageId()).addValue("quota_id",
quotaId)
.addValue("storage_id", quotaStorage.getStorageId())
.addValue("vds_group_id", null)
.addValue("storage_size_gb", quotaStorage.getStorageSizeGB())
.addValue("virtual_cpu", null)
.addValue("mem_size_mb", null);
return storageQuotaParameterMap;
}
/**
* Build quota vds group parameter map, for quota limitation table, to indicate specific limitation on specific
* <code>VdsGroup</code>.
*
* @param quotaId
* - The global quota id which the <code>VdsGroup</code> is referencing to
* @param quotaVdsGroup
* - The business entity which reflects the limitation on the specific vdsGroup.
* @return - <code>VdsGroup</code> Parameter Map
*/
private MapSqlParameterSource getQuotaVdsGroupParameterMap(Guid quotaId, QuotaVdsGroup quotaVdsGroup) {
MapSqlParameterSource vdsGroupQuotaParameterMap =
createQuotaIdParameterMapper(quotaVdsGroup.getQuotaVdsGroupId()).addValue("quota_id", quotaId)
.addValue("vds_group_id", quotaVdsGroup.getVdsGroupId())
.addValue("storage_id", null)
.addValue("storage_size_gb", null)
.addValue("virtual_cpu", quotaVdsGroup.getVirtualCpu())
.addValue("mem_size_mb", quotaVdsGroup.getMemSizeMB());
return vdsGroupQuotaParameterMap;
}
/**
* Build parameter map, for quota limitation table, to indicate global limitation on <code>StoragePool</code>.
*
* @param quota
* - The global quota.
* @return - Global quota Parameter Map.
*/
private MapSqlParameterSource getFullQuotaParameterMap(Quota quota) {
MapSqlParameterSource quotaParameterMap =
getCustomMapSqlParameterSource()
.addValue("id", quota.getId())
.addValue("quota_id", quota.getId())
.addValue("vds_group_id", null)
.addValue("storage_id", null)
.addValue("storage_size_gb",
quota.getGlobalQuotaStorage() != null ? quota.getGlobalQuotaStorage()
.getStorageSizeGB() : null)
.addValue("virtual_cpu",
quota.getGlobalQuotaVdsGroup() != null ? quota.getGlobalQuotaVdsGroup().getVirtualCpu()
: null)
.addValue("mem_size_mb",
quota.getGlobalQuotaVdsGroup() != null ? quota.getGlobalQuotaVdsGroup().getMemSizeMB()
: null);
return quotaParameterMap;
}
private MapSqlParameterSource createQuotaMetaDataParameterMapper(Quota quota) {
return createQuotaIdParameterMapper(quota.getId()).addValue("storage_pool_id", quota.getStoragePoolId())
.addValue("quota_name", quota.getQuotaName())
.addValue("description", quota.getDescription())
.addValue("threshold_vds_group_percentage", quota.getThresholdVdsGroupPercentage())
.addValue("threshold_storage_percentage", quota.getThresholdStoragePercentage())
.addValue("grace_vds_group_percentage", quota.getGraceVdsGroupPercentage())
.addValue("grace_storage_percentage", quota.getGraceStoragePercentage());
}
private void saveGlobalQuota(Quota quota) {
getCallsHandler().executeModification("InsertQuota", createQuotaMetaDataParameterMapper(quota));
getCallsHandler().executeModification("InsertQuotaLimitation", getFullQuotaParameterMap(quota));
}
private void saveVdsGroupSpecificQuotas(Quota quota) {
// Add quota specific vds group limitations.
for (QuotaVdsGroup quotaVdsGroup : quota.getQuotaVdsGroups()) {
getCallsHandler().executeModification("InsertQuotaLimitation",
getQuotaVdsGroupParameterMap(quota.getId(), quotaVdsGroup));
}
}
private void saveStorageSpecificQuotas(Quota quota) {
// Add quota specific storage domains limitations.
for (QuotaStorage quotaStorage : quota.getQuotaStorages()) {
getCallsHandler().executeModification("InsertQuotaLimitation",
getQuotaStorageParameterMap(quota.getId(), quotaStorage));
}
}
@Override
public List<Quota> getAllWithQuery(String query) {
return new SimpleJdbcTemplate(jdbcTemplate).query(query, getQuotaMetaDataFromResultSet());
}
@Override
public boolean isQuotaInUse(Quota quota){
MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource()
.addValue("quota_id", quota.getId());
Map<String, Object> dbResults =
new SimpleJdbcCall(jdbcTemplate).withFunctionName("IsQuotaInUse").execute(
parameterSource);
String resultKey = dialect.getFunctionReturnKey();
return dbResults.get(resultKey) != null && (Boolean) dbResults.get(resultKey);
}
}
| {
"content_hash": "60456b566ff2d78915777ac4091dfda3",
"timestamp": "",
"source": "github",
"line_count": 499,
"max_line_length": 130,
"avg_line_length": 45.13226452905812,
"alnum_prop": 0.6469073309355713,
"repo_name": "jbeecham/ovirt-engine",
"id": "20676d57452a61a6c5ce96cc09e474027e74ec03",
"size": "22521",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/QuotaDAODbFacadeImpl.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
#if !defined(XALANSOURCETREEDOCUMENTFRAGMENT_HEADER_GUARD_1357924680)
#define XALANSOURCETREEDOCUMENTFRAGMENT_HEADER_GUARD_1357924680
#include <xalanc/XalanSourceTree/XalanSourceTreeDefinitions.hpp>
#include <xalanc/Include/XalanMemMgrAutoPtr.hpp>
#include <xalanc/XalanDOM/XalanDocumentFragment.hpp>
#include <xalanc/XalanSourceTree/XalanSourceTreeDocument.hpp>
namespace XALAN_CPP_NAMESPACE {
class XalanSourceTreeComment;
class XalanSourceTreeDocument;
class XalanSourceTreeElement;
class XalanSourceTreeProcessingInstruction;
class XalanSourceTreeText;
class XALAN_XALANSOURCETREE_EXPORT XalanSourceTreeDocumentFragment : public XalanDocumentFragment
{
public:
XalanSourceTreeDocumentFragment(MemoryManager& theManager,
XalanSourceTreeDocument& theOwnerDocument);
/*
XalanSourceTreeDocumentFragment(
MemoryManager& theManager,
const XalanSourceTreeDocumentFragment& theSource,
bool deep = false);
*/
virtual
~XalanSourceTreeDocumentFragment();
// These interfaces are inherited from XalanNode...
virtual const XalanDOMString&
getNodeName() const;
virtual const XalanDOMString&
getNodeValue() const;
virtual NodeType
getNodeType() const;
virtual XalanNode*
getParentNode() const;
virtual const XalanNodeList*
getChildNodes() const;
virtual XalanNode*
getFirstChild() const;
virtual XalanNode*
getLastChild() const;
virtual XalanNode*
getPreviousSibling() const;
virtual XalanNode*
getNextSibling() const;
virtual const XalanNamedNodeMap*
getAttributes() const;
virtual XalanSourceTreeDocument*
getOwnerDocument() const;
virtual const XalanDOMString&
getNamespaceURI() const;
virtual const XalanDOMString&
getPrefix() const;
virtual const XalanDOMString&
getLocalName() const;
virtual bool
isIndexed() const;
virtual IndexType
getIndex() const;
// These interfaces are new...
void
appendChildNode(XalanSourceTreeComment* theChild);
void
appendChildNode(XalanSourceTreeElement* theChild);
void
appendChildNode(XalanSourceTreeProcessingInstruction* theChild);
void
appendChildNode(XalanSourceTreeText* theChild);
void
clearChildren();
protected:
XalanSourceTreeDocumentFragment&
operator=(const XalanSourceTreeDocumentFragment& theSource);
bool
operator==(const XalanSourceTreeDocumentFragment& theRHS) const;
private:
MemoryManager& m_manager;
XalanSourceTreeDocument* const m_ownerDocument;
XalanNode* m_firstChild;
};
}
#endif // !defined(XALANSOURCETREEDOCUMENTFRAGMENT_HEADER_GUARD_1357924680)
| {
"content_hash": "10c43cd26274105dfa452f84e858dc90",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 97,
"avg_line_length": 20.746376811594203,
"alnum_prop": 0.7100943066713238,
"repo_name": "apache/xalan-c",
"id": "0aabc443fa69188eefe03aaf3c418899b2763766",
"size": "3666",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/xalanc/XalanSourceTree/XalanSourceTreeDocumentFragment.hpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "3173"
},
{
"name": "C",
"bytes": "28507"
},
{
"name": "C++",
"bytes": "6991580"
},
{
"name": "CSS",
"bytes": "6035"
},
{
"name": "HTML",
"bytes": "2113"
},
{
"name": "Makefile",
"bytes": "98631"
},
{
"name": "Shell",
"bytes": "39806"
},
{
"name": "XSLT",
"bytes": "42281"
}
],
"symlink_target": ""
} |
package org.openkilda.floodlight.feature;
import static org.apache.commons.lang3.StringUtils.containsIgnoreCase;
import org.openkilda.model.SwitchFeature;
import net.floodlightcontroller.core.IOFSwitch;
import java.util.Optional;
public class GroupPacketOutFeature extends AbstractFeature {
public static final String ACTON_MANUFACTURED = "Sonus";
@Override
public Optional<SwitchFeature> discover(IOFSwitch sw) {
Optional<SwitchFeature> empty = Optional.empty();
if (containsIgnoreCase(sw.getSwitchDescription().getManufacturerDescription(), CENTEC_MANUFACTURED)) {
return empty;
}
if (containsIgnoreCase(sw.getSwitchDescription().getManufacturerDescription(), ACTON_MANUFACTURED)) {
return empty;
}
return Optional.of(SwitchFeature.GROUP_PACKET_OUT_CONTROLLER);
}
}
| {
"content_hash": "cba229d1d2731c819f96553991e1c869",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 110,
"avg_line_length": 28.9,
"alnum_prop": 0.7335640138408305,
"repo_name": "telstra/open-kilda",
"id": "26798ae6f1b4adf6f291dba0c209c1a82c574b5b",
"size": "1484",
"binary": false,
"copies": "2",
"ref": "refs/heads/develop",
"path": "src-java/floodlight-service/floodlight-modules/src/main/java/org/openkilda/floodlight/feature/GroupPacketOutFeature.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C++",
"bytes": "89798"
},
{
"name": "CMake",
"bytes": "4314"
},
{
"name": "CSS",
"bytes": "233390"
},
{
"name": "Dockerfile",
"bytes": "30541"
},
{
"name": "Groovy",
"bytes": "2234079"
},
{
"name": "HTML",
"bytes": "362166"
},
{
"name": "Java",
"bytes": "14631453"
},
{
"name": "JavaScript",
"bytes": "369015"
},
{
"name": "Jinja",
"bytes": "937"
},
{
"name": "Makefile",
"bytes": "20500"
},
{
"name": "Python",
"bytes": "367364"
},
{
"name": "Shell",
"bytes": "62664"
},
{
"name": "TypeScript",
"bytes": "867537"
}
],
"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 app.metatron.discovery.domain.tag;
import com.google.common.collect.Lists;
import com.querydsl.core.types.Predicate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.projection.ProjectionFactory;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import app.metatron.discovery.common.entity.DomainType;
import app.metatron.discovery.domain.mdm.MetadataRepository;
import app.metatron.discovery.domain.user.UserController;
import app.metatron.discovery.util.ProjectionUtils;
@Component
@Transactional(readOnly = true)
public class TagService {
private static final Logger LOGGER = LoggerFactory.getLogger(UserController.class);
@Autowired
public TagRepository tagRepository;
@Autowired
MetadataRepository metadataRepository;
@Autowired
public ProjectionFactory projectionFactory;
TagProjections tagProjections = new TagProjections();
public List findByTagsInDomainItem(Tag.Scope scope, DomainType domainType, String domainId, String projection) {
List tags = tagRepository.findByTagsInDomainItem(scope, domainType, domainId);
return ProjectionUtils.toListResource(projectionFactory, tagProjections.getProjectionByName(projection), tags);
}
public List<Tag> findByTagsWithDomain(Tag.Scope scope, DomainType domainType, String nameContains, Sort sort) {
Predicate predicate = TagPredicate.searchList(scope, domainType, nameContains);
return Lists.newArrayList(tagRepository.findAll(predicate, sort));
}
@Transactional
public void updateTagsInDomainItem(Tag.Scope scope, DomainType domainType, String domainId, List<String> tags) {
long detachedTagCount = tagRepository.detachTag(scope, domainType, domainId, null);
LOGGER.debug("Detached tags count : {}", detachedTagCount);
attachTagsToDomainItem(scope, domainType, domainId, tags);
}
@Transactional
public void attachTagsToDomainItem(Tag.Scope scope, DomainType domainType, String domainId, List<String> tags) {
for (String tagName : tags) {
TagDomain tagDomain = new TagDomain(domainType, domainId);
Tag tag = tagRepository.findByTagNameAndDomain(scope, domainType, tagName);
if(tag == null) {
tag = new Tag(tagName, scope, domainType);
}
tag.addTagDomain(tagDomain);
tagRepository.save(tag);
LOGGER.debug("Add Tags to Item : {}", tag);
}
}
@Transactional
public void detachTagsFromDomainItem(Tag.Scope scope, DomainType domainType, String domainId, List<String> tags) {
tagRepository.detachTag(scope, domainType, domainId, tags);
}
@Transactional
public void deleteTags(Tag.Scope scope, DomainType domainType, List<String> tags) {
for (String tagName : tags) {
Tag tag = tagRepository.findByTagNameAndDomain(scope, domainType, tagName);
if(tag != null) {
tagRepository.delete(tag);
LOGGER.debug("Successfully delete tags : {} ({}, {})", tagName, scope, domainType);
}
}
}
public List<TagCountDTO> getTagsWithCount(Tag.Scope scope, DomainType domainType, String nameContains,
boolean includeEmpty, Sort sort) {
List<TagCountDTO> tagCountDTOS = tagRepository.findTagsWithCount(scope, domainType, nameContains, includeEmpty, sort);
return tagCountDTOS;
}
public Page<TagCountDTO> getTagsWithCount(Tag.Scope scope, DomainType domainType, String nameContains,
boolean includeEmpty, Pageable pageable) {
Page<TagCountDTO> tagCountDTOS = tagRepository.findTagsWithCount(scope, domainType, nameContains, includeEmpty, pageable);
return tagCountDTOS;
}
}
| {
"content_hash": "89871683360dc1b75d7f19bc1061c85e",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 126,
"avg_line_length": 37.625,
"alnum_prop": 0.7510520487264674,
"repo_name": "metatron-app/metatron-discovery",
"id": "caae920b61ae90a37b378437cce1d673d83a0dde",
"size": "4515",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "discovery-server/src/main/java/app/metatron/discovery/domain/tag/TagService.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "5768"
},
{
"name": "CSS",
"bytes": "3355512"
},
{
"name": "Dockerfile",
"bytes": "589"
},
{
"name": "HTML",
"bytes": "3250794"
},
{
"name": "Java",
"bytes": "7408311"
},
{
"name": "JavaScript",
"bytes": "5541901"
},
{
"name": "Python",
"bytes": "543"
},
{
"name": "R",
"bytes": "1302"
},
{
"name": "Shell",
"bytes": "9660"
},
{
"name": "TSQL",
"bytes": "11234"
},
{
"name": "TypeScript",
"bytes": "7903758"
}
],
"symlink_target": ""
} |
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
//controllers
const treeController = require('./../data/controllers/treeController');
const branchController = require('./../data/controllers/branchController');
app.use(function (req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
})
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.get('/trees', (req, res) => {
treeController.getAllTrees(req, res);
})
app.get('/branches', (req, res) => {
branchController.getAllBranches(req, res);
})
//send post request as json object with key "ids" and ids as an array (e.g. "ids":[1,3,5] )
//ex: axios.post('localhost:3030/findbranches',{ids:[1,2,3]}) -> Returns JSON with branches 1,2,3
app.post('/findbranches', (req, res) => {
//receives the array of branch ids
let branchIds= req.body.ids;
branchController.findBranches(branchIds, res);
})
//update tree score
app.listen(3030);
| {
"content_hash": "c1238bda68db44bfc1a0493af858e7a6",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 97,
"avg_line_length": 30.18918918918919,
"alnum_prop": 0.6830796777081468,
"repo_name": "ForestIO/ForestIO",
"id": "a41df704f21c44f01af41f1d321b949855a2fd7e",
"size": "1130",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/server/server.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "404"
},
{
"name": "HTML",
"bytes": "1590"
},
{
"name": "JavaScript",
"bytes": "11159"
}
],
"symlink_target": ""
} |
package com.nio.filecopy;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.AclFileAttributeView;
import java.nio.file.attribute.BasicFileAttributeView;
import java.nio.file.attribute.BasicFileAttributes;
import java.nio.file.attribute.DosFileAttributeView;
import java.nio.file.attribute.DosFileAttributes;
import java.nio.file.attribute.PosixFileAttributeView;
import java.nio.file.attribute.PosixFileAttributes;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Properties;
import java.util.concurrent.FutureTask;
import com.nio.filecopy.bean.JobBean;
import com.nio.filecopy.bean.MountBean;
import com.nio.filecopy.bean.filter.DateOptions;
import com.nio.filecopy.bean.filter.DateType;
import com.nio.filecopy.bean.filter.Filter;
import com.nio.filecopy.bean.filter.Mode;
import com.nio.filecopy.bean.filter.Options;
import com.nio.filecopy.bean.filter.DataUnit.Unit;
import com.nio.filecopy.database.CoreDatabase;
import com.nio.filecopy.database.mysql.FilterDatabase;
import com.nio.filecopy.database.mysql.JobDatabase;
import com.nio.filecopy.database.mysql.MountDatabase;
import com.nio.filecopy.job.Job;
import com.nio.filecopy.mount.MountManager;
import com.nio.filecopy.task.TaskMap;
import com.nio.filecopy.task.TaskConstants;
import com.nio.filecopy.task.copy.CopyManager;
import com.nio.filecopy.task.inventory.InventoryConstants;
import com.nio.filecopy.task.inventory.InventoryHandler;
import com.nio.filecopy.task.inventory.InventoryManager;
import com.nio.filecopy.util.MD5Util;
import com.nio.filecopy.util.PropertiesUtil;
public class Test {
// private static void getAttr(Path file) throws IOException {
// getBasicAttr(file);
// getDosAttr(file);
// getAclAttr(file);
// getPosixAttr(file);
// }
//
// /*
// * Write basic attribute from source to target
// * modify time, access time, create time
// */
// private static void getBasicAttr(Path file) throws IOException {
//
// BasicFileAttributeView sourceBasicView = Files.getFileAttributeView(file, BasicFileAttributeView.class);
//
// if(sourceBasicView != null) {
// BasicFileAttributes basicAttrs = sourceBasicView.readAttributes();
//
//
// System.out.println("basicAttrs.size():"+(basicAttrs.size()));
// System.out.println("basicAttrs.creationTime():"+basicAttrs.creationTime().toString());
// System.out.println("basicAttrs.lastModifiedTime():"+basicAttrs.lastModifiedTime().toString());
// System.out.println("basicAttrs.lastAccessTime():"+basicAttrs.lastAccessTime().toString());
// }
//
// }
//
// /*
// * Write dos attribute from source to target
// * isArchive, isHidden, isReadOnly, isSystem
// */
// private static void getDosAttr(Path file) throws IOException {
// DosFileAttributeView sourceDosView = Files.getFileAttributeView(file, DosFileAttributeView.class);
//
// if(sourceDosView != null) {
// DosFileAttributes dosAttrs = sourceDosView.readAttributes();
// System.out.println("dosAttrs.isArchive():"+String.valueOf(dosAttrs.isArchive() ? 1: 0));
// System.out.println("dosAttrs.isHidden():"+String.valueOf(dosAttrs.isHidden() ? 1: 0));
// System.out.println("dosAttrs.isReadOnly():"+String.valueOf(dosAttrs.isReadOnly() ? 1: 0));
// System.out.println("dosAttrs.isSystem():"+String.valueOf(dosAttrs.isSystem() ? 1: 0));
// }
//
// }
//
// /*
// * Write ACL attribute from source to target
// * Permission of the file
// */
// private static void getAclAttr(Path file) throws IOException {
// AclFileAttributeView sourceAclView = Files.getFileAttributeView(file, AclFileAttributeView.class);
// if(sourceAclView != null) {
// System.out.println("sourceAclView.getOwner():"+sourceAclView.getOwner());
// System.out.println("sourceAclView.getAcl():"+sourceAclView.getAcl().toString());
// }
// }
//
// /*
// * Write Posix(user permissions) from source to target
// * Only work on Unix
// */
// private static void getPosixAttr(Path file) throws IOException {
//
// PosixFileAttributeView sourcePosixView = Files.getFileAttributeView(file, PosixFileAttributeView.class);
//
// if(sourcePosixView != null) {
// PosixFileAttributes posixAttrs = sourcePosixView.readAttributes();
//
// System.out.println("posixAttrs.owner():"+posixAttrs.owner().toString());
// System.out.println("posixAttrs.permissions():"+posixAttrs.permissions().toString());
// }
// }
public static void main(String[] args) {
// Path file = Paths.get("D:\\test.jar");
// System.out.println(file.getFileSystem().getSeparator());
// try {
// getAttr(file);
// } catch (IOException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
// System.out.println(MD5Util.getFileMD5(Paths.get("D:\\test.jar").toFile()));
Properties dbConfiguration = PropertiesUtil.getProperties("c3p0.properties");
Properties redisConfiguration = PropertiesUtil.getProperties("redis.properties");
CoreDatabase cd = new CoreDatabase();
cd.initialize(dbConfiguration, redisConfiguration);
TaskMap.initialize();
JobBean jobBean = new JobBean();
jobBean.setName("test");
jobBean.setDescription("123");
jobBean.setFilterId(0);
jobBean.setSource("D:\\copy_test");
jobBean.setTarget("D:\\copy_test_2");
List<Integer> list = Arrays.asList(new Integer[]{1,2});
jobBean.setTaskIdList(list);
Job job = JobControler.getInstance().createJob(jobBean);
System.out.println(job.getJobBean());
JobControler.getInstance().startJobById(job.getJobId());
// MountBean bean = new MountBean();
// bean.setPath("aaa");
// bean.setDirPath("bbb");
// bean.setUsername("ccc");
// bean.setPassword("ddd");
// System.out.println(MountDatabase.getInstance().delShare(1));
// MountManager.getInstance().delShare(1);
//
// Filter filter = new Filter();
// filter.setName("name");
// filter.setDesc("desc");
// filter.addDateFilter(DateType.CREATE_DATE, DateOptions.RANGE, new Date(), new Date(), Mode.EXCLUDE);
// filter.addDateFilter(DateType.CREATE_DATE, DateOptions.LATER, new Date(), null, Mode.EXCLUDE);
// filter.addExtentionFilter(".pdf", Mode.INCLUDE);
// filter.addGroupFilter("group", Options.NOT_EQUAL, Mode.INCLUDE);
// filter.addOwnerFilter("owner", Options.NOT_EQUAL, Mode.EXCLUDE);
// filter.setSizeFilter(2, Unit.B, 3, Unit.GB, Mode.EXCLUDE);
// FilterDatabase.getInstance().insertFilter(filter);
// FilterDatabase.getInstance().delFilter(2);
// System.out.println(FilterDatabase.getInstance().getFilter(1));
// JobDatabase.getInstance().createFileTable(2);
// JobDatabase.getInstance().createHashTable(2);
// Runnable run = new Runnable(){
//
// @Override
// public void run() {
// // TODO Auto-generated method stub
// try {
// Thread.sleep(10000l);
// } catch (InterruptedException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
//
// System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
// JobControler.getInstance().stopJobById(1);
// }
// };
//
// Thread thread = new Thread(run);
// thread.start();
// JobControler.getInstance().startJobById(1);
// JobDatabase.getInstance().restJobStatus(1);
// Job job = JobDatabase.getInstance().getJobById(1);
// System.out.println(job.getJobId());
// System.out.println(job.getName());
// System.out.println(job.getDescription());
// System.out.println(job.getSource());
// System.out.println(job.getTarget());
// System.out.println(job.getTaskIdList());
// System.out.println(job.getTasksStatus());
// job.getTaskControler().initialize(job.getJobId(), job.getSource(), job.getTarget());
// job.run();
// System.out.println("11111111111111111111" + job.getTasksStatus());
// Job job = new Job();
// job.setName("asd");
// job.setDescription("111");
// job.setSource("D:\\path");
// job.setTarget("d:\\target");
// List<Integer> list = Arrays.asList(new Integer[]{1,2});
// job.setTaskIdList(list);
//
// System.out.println(JobDatabase.getInstance().createJob(job));
//
// System.out.println(TaskMap.getTaskMap());
// InventoryManager im = new InventoryManager();
//
// Properties inventoryProperties = new Properties();
// inventoryProperties.put(TaskConstants.JOB_ID, "1");
// inventoryProperties.put(TaskConstants.JOB_SOURCE, "D:\\copy_test\\Project\\Deedao_Server\\");
//
// im.initialize(inventoryProperties);
//
// im.run();
//
//
// CopyManager cm = new CopyManager();
// Properties properties = new Properties();
// properties.put(TaskConstants.JOB_ID, "1");
// properties.put(TaskConstants.JOB_SOURCE, "D:\\copy_test\\Project\\Deedao_Server\\");
// properties.put(TaskConstants.JOB_TARGET, "D:\\copy_test_2\\Project\\Deedao_Server\\");
// properties.put(TaskConstants.THREADS, "10");
// cm.initialize(properties);
// cm.run();
}
}
| {
"content_hash": "bb05c511ebd9610dea3a14c354c9cb8f",
"timestamp": "",
"source": "github",
"line_count": 254,
"max_line_length": 112,
"avg_line_length": 36.40944881889764,
"alnum_prop": 0.6850129757785467,
"repo_name": "JianMingZhuo/NIOCopy",
"id": "d42813d07c36c240bd4ba98457c5f33d0bc9188e",
"size": "9248",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/nio/filecopy/Test.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "183230"
},
{
"name": "Shell",
"bytes": "1868"
}
],
"symlink_target": ""
} |
import vdb
import getpass
defconfig = {
'viv':{
'SymbolCacheSave':True,
'parsers':{
'pe':{
'loadresources':False,
'carvepes':True,
'nx':False,
},
'elf':{
},
'blob':{
'arch':'',
'bigend':False,
'baseaddr':0x20200000,
},
'macho':{
'baseaddr':0x70700000,
'fatarch':'',
},
'ihex':{
'arch':'',
'offset':0,
},
'srec':{
'arch':'',
'offset':0,
},
},
'analysis':{
'pointertables':{
'table_min_len':4,
},
'symswitchcase':{
'max_instr_count': 10,
'max_cases': 500,
'case_failure': 5000,
'min_func_instr_size': 10,
'timeout_secs': 45,
}
},
'remote':{
'wait_for_plat_arch': 10,
},
},
'cli':vdb.defconfig.get('cli'), # FIXME make our own...
'vdb':vdb.defconfig.get('vdb'),
'user':{
'name': getpass.getuser(),
}
}
defconfig.get('cli').update(vdb.defconfig.get('cli'))
# Config elements docs
docconfig = {
'viv':{
'SymbolCacheSave':'Save vivisect names to the vdb configured symbol cache?',
'parsers':{
'pe':{
'loadresources':'Should we load resource segments?',
'carvepes':'Should we carve pes?',
'nx':'Should we truly treat sections that dont execute as non executable?'
},
'elf':{
},
'blob':{
'arch':'What architecture is the blob?',
'baseaddr':'Base virtual address for loading the blob.',
},
'macho':{
'baseaddr':'Base virtual address for loading the macho',
'fatarch':'Which architecture binary to extract from a FAT macho',
},
'ihex':{
'arch':'What architecture is the ihex dump?',
},
'srec':{
'arch':'What architecture is the srec dump?',
'offset':'Skip over initial bytes in the file',
},
},
'analysis':{
'pointertables':{
'table_min_len':'How many pointers must be in a row to make a table?',
},
},
'remote':{
'wait_for_plat_arch':'How many secs to wait for the remote server/workspace to provide a Platform or Architecture before moving on.',
}
},
'vdb':vdb.docconfig.get('vdb'),
'user':{
'name': 'Username. When not set, defaults to current system user.',
}
}
| {
"content_hash": "65939f9b266a964d1ff9cf34703d3c62",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 145,
"avg_line_length": 26.787037037037038,
"alnum_prop": 0.42378154165226406,
"repo_name": "atlas0fd00m/vivisect",
"id": "f22edace12ef9a2ebb57f6587b15896e8e515c85",
"size": "2893",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "vivisect/defconfig.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "167795"
},
{
"name": "CSS",
"bytes": "15980"
},
{
"name": "Makefile",
"bytes": "355"
},
{
"name": "Python",
"bytes": "17710506"
},
{
"name": "Shell",
"bytes": "476"
}
],
"symlink_target": ""
} |
require 'rubygems' if RUBY_VERSION < '1.9.0'
require 'sensu-handler'
require 'httparty'
class StatusPageIOMetrics < Sensu::Handler
# override filters from Sensu::Handler. not appropriate for metric handlers
def filter; end
def send_metric(value, timestamp, metric_id)
# puts "Sending #{value} #{timestamp} #{metric_id}"
begin
timeout(3) do
HTTParty.post(
"https://api.statuspage.io/v1/pages/#{@page_id}/metrics/#{metric_id}/data.json",
:headers => { 'Authorization' => "OAuth #{@api_key}"},
:body => {
:data => {
:timestamp => timestamp,
:value => value.to_f
}
}
)
end
rescue Timeout::Error
puts "statuspageio -- timed out while sending metrics"
rescue => error
puts "statuspageio -- failed to send metric #{metric_id} : #{error}"
end
end
def handle
# Grab page_id and api_key from dashboard
@api_key = settings['handlers']['statuspageio_metrics']['api_key']
@page_id = settings['handlers']['statuspageio_metrics']['page_id']
# Get a dict of metric_from_output => metric_ids
# This allows the re-use of standard metrics plugins that can be mapped to
# statuspage io metrics
@metrics = settings['handlers']['statuspageio_metrics']['metrics'] || {}
# Split graphite-style metrics
@event['check']['output'].split(/\n/).each do |m|
metric, value, timestamp = m.split()
# Get the metric ID from the check, or from the global mapping
metric_id = @event['check']['statuspageio_metric_id'] || @metrics[metric]
send_metric(value, timestamp, metric_id) if metric_id
end
end
end
| {
"content_hash": "a9c6f9e153bb997cfd3edee80a91a253",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 90,
"avg_line_length": 33.3921568627451,
"alnum_prop": 0.61714621256606,
"repo_name": "broadinstitute/sensu-community-plugins",
"id": "f5a2825ab9a7e43b1e091817608f24741574da59",
"size": "2146",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "handlers/metrics/statuspageio_metrics.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "58992"
},
{
"name": "Ruby",
"bytes": "500337"
},
{
"name": "Shell",
"bytes": "22809"
}
],
"symlink_target": ""
} |
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="{% case page.language %} {% when 'es' %} {{ site.description_es }} {% else %} {{ site.description }} {% endcase %}">
<meta name="author" content=" {{ site.author }}">
<title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/grayscale.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
| {
"content_hash": "b46377fb3958019cd888e96ad2c57a6c",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 154,
"avg_line_length": 47.58620689655172,
"alnum_prop": 0.6297101449275362,
"repo_name": "Comunidades-Tecnologicas/clsxmadrid",
"id": "c88e94afa93c35cb2e140e1d254aef59194aaa36",
"size": "1380",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "web/_includes/head.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "28"
},
{
"name": "CSS",
"bytes": "125111"
},
{
"name": "HTML",
"bytes": "26311"
},
{
"name": "JavaScript",
"bytes": "5962"
}
],
"symlink_target": ""
} |
<component name="ProjectDictionaryState">
<dictionary name="KPRASAN6" />
</component> | {
"content_hash": "8c1a7251c51a342ce5d4a054660f441d",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 41,
"avg_line_length": 29,
"alnum_prop": 0.7586206896551724,
"repo_name": "skprasan/NFCCarUser",
"id": "4e2b81faff365d9f5a7d9680e4ccf7c2752a1aec",
"size": "87",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": ".idea/dictionaries/KPRASAN6.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "11272"
}
],
"symlink_target": ""
} |
import csv
import matplotlib.pyplot as plt
import numpy as np
import scipy.signal as sci
import seaborn as sns
import sensorprocessor as sp
import signalfilters as mf
csv_missed = '/Users/philliphartin/TAUT/SensorRecordings/3802/6/3802_1409230847_Accelerometer.csv'
csv_acknowledged = '/Users/philliphartin/TAUT/SensorRecordings/3802/6/3802_1403040715_Accelerometer.csv'
def calculate_percentagedifference(v1, v2):
import math
percentage_diff = abs((abs(v1) - abs(v2)) / ((v1 + v2) / 2) * 100)
if math.isnan(percentage_diff):
return 0
else:
return percentage_diff
def calculate_difference(original, comparison):
# Create a list of the difference in values between two dicts
percentage_change = {}
percentage_difference = {}
for key, value in original.items():
value_orig = value
value_comp = comparison[key]
# percentrage_change[key] = abs(value_orig - value_comp)
percentage_change[key] = calculate_percentagechange(value_orig, value_comp)
percentage_difference[key] = calculate_percentagedifference(value_orig, value_comp)
return percentage_difference
def calculate_percentagechange(old_value, new_value, multiply=True):
change = new_value - old_value
try:
percentage_change = (change / float(old_value))
if multiply:
percentage_change = percentage_change * 100
return percentage_change
except ZeroDivisionError as e:
print(e)
return None
def calcualate_meanfordictionary(data):
values = []
for key, value in data.items():
values.append(value)
return np.mean(values)
def make_ticklabels_invisible(fig):
for i, ax in enumerate(fig.axes):
ax.text(0.5, 0.5, "ax%d" % (i + 1), va="center", ha="center")
for tl in ax.get_xticklabels() + ax.get_yticklabels():
tl.set_visible(False)
def import_sensorfile(filepath):
with open(filepath) as csv_sensorfile:
sensorfile = csv.reader(csv_sensorfile, delimiter=',', quotechar='|')
sensor_rows = []
for row in sensorfile:
# the correct format has 4 elements (avoids header and footer rows)
if len(row) == 4:
try:
timestamp = int(row[0])
x = float(row[1])
y = float(row[2])
z = float(row[3])
sensor_rows.append([timestamp, x, y, z])
except ValueError:
continue
return sensor_rows
def process_input(data):
t_series = []
x_series = []
y_series = []
z_series = []
mag_series = []
for row in data:
# Get t at index in row
t = row[0]
x = row[1]
y = row[2]
z = row[3]
# Add to Series
t_series.append(t)
x_series.append(x)
y_series.append(y)
z_series.append(z)
mag_series.append(sp.get_magnitude(x, y, z))
numpymag = np.array(mag_series)
return numpymag
def window_data(data):
length = len(data)
# first 2/3rds of recording
endpoint = length / 10
endpoint *= 7
startpoint = endpoint - 100
return data[startpoint:endpoint]
def write_to_csv(data, filename):
import csv
# Get headers from dictionary
header = []
example = data[0]
for key, value in example.items():
header.append(key)
with open(str(filename) + '.csv', 'w') as csvfile:
writer = csv.DictWriter(csvfile, fieldnames=sorted(header))
writer.writeheader()
for item in data:
writer.writerow(item)
def plot_against(missed, acknowledged):
sensor_miss = import_sensorfile(missed)
sensor_ack = import_sensorfile(acknowledged)
# Window data
mag_miss = window_data(process_input(sensor_miss))
mag_ack = window_data(process_input(sensor_ack))
# Filter setup
kernel = 15
# apply filter
mag_miss_filter = sci.medfilt(mag_miss, kernel)
mag_ack_filter = sci.medfilt(mag_ack, kernel)
# calibrate data
mag_miss_cal = mf.calibrate_median(mag_miss)
mag_miss_cal_filter = mf.calibrate_median(mag_miss_filter)
mag_ack_cal = mf.calibrate_median(mag_ack)
mag_ack_cal_filter = mf.calibrate_median(mag_ack_filter)
# PLOT
ylimit_top = [-5, 10]
ylimits_filtered = [-4, 4]
ylimits_filtered_bottom = [-1.5, 1.5]
sns.set_style("darkgrid")
current_palette = sns.color_palette('muted')
sns.set_palette(current_palette)
plt.figure(0)
# Plot RAW missed and acknowledged reminders
ax1 = plt.subplot2grid((4, 2), (0, 0), colspan=2)
plt.ylim(ylimit_top)
raw_miss = plt.plot(mag_miss_cal, label='Missed (Unfiltered)')
raw_ack = plt.plot(mag_ack_cal, label='Acknowledged (Unfiltered)')
plt.legend(loc='upper left')
ax2 = plt.subplot2grid((4, 2), (1, 0))
# Plot Missed Reminder RAW
plt.ylim(ylimits_filtered)
plt.plot(mag_miss_cal, linestyle='-', label='Unfiltered')
plt.legend(loc='lower left')
ax3 = plt.subplot2grid((4, 2), (1, 1))
# Plot Acknow Reminder RAW
plt.ylim(ylimits_filtered)
plt.plot(mag_ack_cal, linestyle='-', label='Unfiltered')
plt.legend(loc='lower left')
ax4 = plt.subplot2grid((4, 2), (2, 0))
# Plot Missed Reminder Filter
plt.ylim(ylimits_filtered)
plt.plot(mag_miss_cal, linestyle=':', label='Unfiltered')
plt.plot(mag_miss_cal_filter, linestyle='-', label='Median Filter (k=' + str(kernel) + ')')
plt.legend(loc='lower left')
ax5 = plt.subplot2grid((4, 2), (2, 1))
# Plot Acknow Reminder Filter
plt.ylim(ylimits_filtered)
plt.plot(mag_ack_cal, linestyle=':', label='Unfiltered')
plt.plot(mag_ack_cal_filter, linestyle='-', label='Median Filter (k=' + str(kernel) + ')')
plt.legend(loc='lower left')
ax6 = plt.subplot2grid((4, 2), (3, 0), colspan=2)
plt.ylim(ylimits_filtered_bottom)
plt.style.use('grayscale')
plt.plot(mag_miss_cal_filter, label='Missed (Filtered)')
plt.plot(mag_ack_cal_filter, label='Acknowledged (Filtered)')
plt.legend(loc='lower left')
plt.suptitle("Applying Filters to Signals")
plt.show()
def plot_singlewave(file):
sensor = import_sensorfile(file)
sensor_processed = process_input(sensor)
timestamps = []
[timestamps.append(str(item[0])) for item in sensor]
sensor_processed_calibrated = mf.calibrate_median(sensor_processed)
sensor_filtered = mf.medfilt(sensor_processed_calibrated, 3)
plt.plot(sensor_filtered, linewidth='0.8')
plt.xlim([0, 12000])
plt.ylim([-5, 5])
plt.ylabel('Acceleration (g)')
plt.xlabel('Time (ms)')
# plt.xticks(sensor_filtered, timestamps, rotation='vertical')
plt.show()
def plot_example(missed, acknowledged):
sensor_miss = import_sensorfile(missed)
sensor_ack = import_sensorfile(acknowledged)
# Window data
mag_miss = window_data(process_input(sensor_miss))
mag_ack = window_data(process_input(sensor_ack))
# Window data
mag_miss = window_data(process_input(sensor_miss))
mag_ack = window_data(process_input(sensor_ack))
# Filter setup
kernel = 15
# apply filter
mag_miss_filter = sci.medfilt(mag_miss, kernel)
mag_ack_filter = sci.medfilt(mag_ack, kernel)
# calibrate data
mag_miss_cal = mf.calibrate_median(mag_miss)
mag_miss_cal_filter = mf.calibrate_median(mag_miss_filter)
mag_ack_cal = mf.calibrate_median(mag_ack)
mag_ack_cal_filter = mf.calibrate_median(mag_ack_filter)
# PLOT
sns.set_style("white")
current_palette = sns.color_palette('muted')
sns.set_palette(current_palette)
plt.figure(0)
# Plot RAW missed and acknowledged reminders
ax1 = plt.subplot2grid((2, 1), (0, 0))
plt.ylim([-1.5, 1.5])
plt.ylabel('Acceleration (g)')
plt.plot(mag_miss_cal, label='Recording 1')
plt.legend(loc='lower left')
ax2 = plt.subplot2grid((2, 1), (1, 0))
# Plot Missed Reminder RAW
plt.ylim([-1.5, 1.5])
plt.ylabel('Acceleration (g)')
plt.xlabel('t (ms)')
plt.plot(mag_ack_cal, linestyle='-', label='Recording 2')
plt.legend(loc='lower left')
# CALC AND SAVE STATS
stats_one = sp.calc_stats_for_data_stream_as_dictionary(mag_miss_cal)
stats_two = sp.calc_stats_for_data_stream_as_dictionary(mag_ack_cal)
data = [stats_one, stats_two]
write_to_csv(data, 'example_waves')
plt.show()
def plot_kernal_length_experiment(missed, acknowledged):
sensor_miss = import_sensorfile(missed)
sensor_ack = import_sensorfile(acknowledged)
# Window data
mag_miss = window_data(process_input(sensor_miss))
mag_ack = window_data(process_input(sensor_ack))
# Filter setup
difference = []
stats_output = []
for num in range(3, 63):
# check if odd
if num % 2 != 0:
kernel = num
# apply filter
mag_miss_filter = sci.medfilt(mag_miss, kernel)
mag_ack_filter = sci.medfilt(mag_ack, kernel)
# calibrate data
mag_miss_cal = mf.calibrate_median(mag_miss)
mag_miss_cal_filter = mf.calibrate_median(mag_miss_filter)
mag_ack_cal = mf.calibrate_median(mag_ack)
mag_ack_cal_filter = mf.calibrate_median(mag_ack_filter)
# STATS
# Calculate the stats for raw and windowed for each
stats_miss = sp.calc_stats_for_data_stream_as_dictionary(mag_miss_cal)
stats_miss_filter = sp.calc_stats_for_data_stream_as_dictionary(mag_miss_cal_filter)
stats_ack = sp.calc_stats_for_data_stream_as_dictionary(mag_ack_cal)
stats_ack_filter = sp.calc_stats_for_data_stream_as_dictionary(mag_ack_cal_filter)
stats_data = [stats_miss, stats_miss_filter, stats_ack, stats_ack_filter]
[data.pop("med", None) for data in stats_data]
print('Stats Missed:' + str(stats_miss))
print('Stats Acknowledged: ' + str(stats_ack))
print('Stats Missed Filtered: ' + str(stats_miss_filter))
print('Stats Acknowledged Filtered:' + str(stats_ack_filter))
# Calculate the percentage difference between the values
dif_stats_raw = calculate_difference(stats_miss, stats_ack)
dif_stats_filtered = calculate_difference(stats_miss_filter, stats_ack_filter)
print('Difference in RAW as percentage:' + str(dif_stats_raw))
print('Difference in FILTERED as percentage:' + str(dif_stats_filtered))
dif_stats_raw_overall = calcualate_meanfordictionary(dif_stats_raw)
dif_stats_filtered_overall = calcualate_meanfordictionary(dif_stats_filtered)
print('Avg. Difference RAW: ' + str(dif_stats_raw_overall))
print('Avg. Difference Filtered: ' + str(dif_stats_filtered_overall))
difference.append((kernel, dif_stats_filtered_overall))
if kernel == 15:
stats_output.append(stats_miss)
stats_output.append(stats_ack)
stats_output.append(stats_miss_filter)
stats_output.append(stats_ack_filter)
stats_output.append(dif_stats_raw)
stats_output.append(dif_stats_filtered)
write_to_csv(stats_output)
x_val = [x[0] for x in difference]
y_val = [x[1] for x in difference]
xticks = [str(x) for x in x_val]
base_val = [54] * 63
plt.xticks(x_val, xticks)
plt.xlabel('Window Length (k)')
plt.ylabel('Percentage Difference (%)')
plt.ylim([40, 140])
plt.plot(x_val, y_val, label='Median Filter')
plt.plot(base_val, linestyle='--', label='Baseline (Unfiltered)')
plt.legend(loc='lower right')
plt.show()
# plot_against(csv_missed, csv_acknowledged)
# plot_kernal_length_experiment(csv_missed, csv_acknowledged)
# plot_example(csv_missed, csv_acknowledged)
# plot_singlewave(csv_acknowledged)
| {
"content_hash": "dc6732d789e11eedb9dfe244c0ec1d4d",
"timestamp": "",
"source": "github",
"line_count": 382,
"max_line_length": 104,
"avg_line_length": 31.400523560209425,
"alnum_prop": 0.629845769070446,
"repo_name": "pjhartin/taut-sensoranalysis-python",
"id": "bf228b0594587c9478b1c788a1d96fd2e60d13bd",
"size": "11995",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "plotting.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "39869"
}
],
"symlink_target": ""
} |
package securesocial.core.providers
import play.api.libs.json.JsObject
import securesocial.core._
import securesocial.core.services.{CacheService, RoutesService}
import scala.concurrent.Future
/**
* A Google OAuth2 Provider
*/
class GoogleProvider(routesService: RoutesService,
cacheService: CacheService,
client: OAuth2Client)
extends OAuth2Provider(routesService, client, cacheService)
{
val UserInfoApi = "https://www.googleapis.com/oauth2/v1/userinfo?access_token="
val Error = "error"
val Message = "message"
val Type = "type"
val Id = "id"
val Name = "name"
val GivenName = "given_name"
val FamilyName = "family_name"
val Picture = "picture"
val Email = "email"
override val id = GoogleProvider.Google
def fillProfile(info: OAuth2Info): Future[BasicProfile] = {
import scala.concurrent.ExecutionContext.Implicits.global
val accessToken = info.accessToken
client.retrieveProfile(UserInfoApi + accessToken).map { me =>
(me \ Error).asOpt[JsObject] match {
case Some(error) =>
val message = (error \ Message).as[String]
val errorType = (error \ Type).as[String]
logger.error("[securesocial] error retrieving profile information from Google. Error type = %s, message = %s"
.format(errorType, message))
throw new AuthenticationException()
case _ =>
val userId = (me \ Id).as[String]
val firstName = (me \ GivenName).asOpt[String]
val lastName = (me \ FamilyName).asOpt[String]
val fullName = (me \ Name).asOpt[String]
val avatarUrl = (me \ Picture).asOpt[String]
val email = (me \ Email).asOpt[String]
BasicProfile(id, userId, firstName, lastName, fullName, email, avatarUrl, authMethod, oAuth2Info = Some(info))
}
} recover {
case e: AuthenticationException => throw e
case e =>
logger.error( "[securesocial] error retrieving profile information from Google", e)
throw new AuthenticationException()
}
}
}
object GoogleProvider {
val Google = "google"
}
| {
"content_hash": "11b3f9aa6e6c84c4bef673e50b80ff88",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 122,
"avg_line_length": 33.90625,
"alnum_prop": 0.6483870967741936,
"repo_name": "matthewchartier/securesocial",
"id": "46aacb1dcafc743400ef4067168678f757672c96",
"size": "2818",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "module-code/app/securesocial/core/providers/GoogleProvider.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Erlang",
"bytes": "3190"
},
{
"name": "HTML",
"bytes": "18185"
},
{
"name": "Java",
"bytes": "32371"
},
{
"name": "NewLisp",
"bytes": "3144"
},
{
"name": "Perl6",
"bytes": "3038"
},
{
"name": "Ruby",
"bytes": "4138"
},
{
"name": "Scala",
"bytes": "210580"
}
],
"symlink_target": ""
} |
<?xml version="1.0" ?><!DOCTYPE TS><TS language="el_GR" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="14"/>
<source>About Richcoin</source>
<translation>Σχετικα:Richcoin</translation>
</message>
<message>
<location filename="../forms/aboutdialog.ui" line="53"/>
<source><b>Richcoin</b> version</source>
<translation><b>Richcoin</b>έκδοση</translation>
</message>
<message>
<location filename="../forms/aboutdialog.ui" line="97"/>
<source>Copyright © 2009-2012 Richcoin Developers
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file license.txt 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>Copyright © 2009-2012 Προγραμματιστές του Richcoin
Αυτό ειναι πειραματικο λογισμικο.
Διανέμεται κατω από άδεια MIT/X11 , δες το συνοδεύων αρχειο license.txt ή http://www.opensource.org/licenses/mit-license.php.
Αυτό προϊόν περιλαμβάνει λογισμικο ανεπτυγμενο από το OpenSSL Project για χρήση στο OpenSSL Toolkit (http://www.openssl.org/) και κρυπτογραφικο κωδικα γραμένο από τον by 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>Βιβλίο Διευθύνσεων</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="20"/>
<source>These are your Richcoin 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>Αυτές είναι οι διευθύνσεις Richcoin για την παραλαβή πληρωμών. Μπορεί να θέλετε να δίνετε διαφορετική διεύθυνση σε κάθε αποστολέα έτσι ώστε να μπορείτε να παρακολουθείτε ποιος σας πληρώνει.</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="36"/>
<source>Double-click to edit address or label</source>
<translation>Διπλό-κλικ για επεξεργασία της διεύθυνσης ή της ετικέτας</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="63"/>
<source>Create a new address</source>
<translation>Δημιούργησε νέα διεύθυνση</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="77"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Αντέγραψε την επιλεγμένη διεύθυνση στο πρόχειρο του συστήματος</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="66"/>
<source>&New Address</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="80"/>
<source>&Copy Address</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="91"/>
<source>Show &QR Code</source>
<translation>Δείξε &QR κωδικα</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="102"/>
<source>Sign a message to prove you own this address</source>
<translation>Υπέγραψε ένα μήνυμα για να αποδείξεις ότι σου ανήκει η διεύθυνση</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="105"/>
<source>&Sign Message</source>
<translation>&Υπέγραψε το μήνυμα</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="116"/>
<source>Delete the currently selected address from the list. Only sending addresses can be deleted.</source>
<translation>Διέγραψε την επιλεγμένη διεύθυνση από την λίστα. Μόνο διευθύνσεις αποστολής μπορούν να διαγραφούν.</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="119"/>
<source>&Delete</source>
<translation>&Διαγραφή</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="63"/>
<source>Copy &Label</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../addressbookpage.cpp" line="65"/>
<source>&Edit</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../addressbookpage.cpp" line="292"/>
<source>Export Address Book Data</source>
<translation>Εξαγωγή Δεδομενων Βιβλίου Διευθύνσεων</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="293"/>
<source>Comma separated file (*.csv)</source>
<translation>Αρχείο οριοθετημένο με κόμματα (*.csv)</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="306"/>
<source>Error exporting</source>
<translation>Εξαγωγή λαθών</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="306"/>
<source>Could not write to file %1.</source>
<translation>Δεν μπόρεσα να γράψω στο αρχείο %1.</translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="142"/>
<source>Label</source>
<translation>Ετικέτα</translation>
</message>
<message>
<location filename="../addresstablemodel.cpp" line="142"/>
<source>Address</source>
<translation>Διεύθυνση</translation>
</message>
<message>
<location filename="../addresstablemodel.cpp" line="178"/>
<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 filename="../forms/askpassphrasedialog.ui" line="47"/>
<source>Enter passphrase</source>
<translation>Βάλτε κωδικό πρόσβασης</translation>
</message>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="61"/>
<source>New passphrase</source>
<translation>Νέος κωδικός πρόσβασης</translation>
</message>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="75"/>
<source>Repeat new passphrase</source>
<translation>Επανέλαβε τον νέο κωδικό πρόσβασης</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="33"/>
<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> οχτώ ή παραπάνω λέξεις</b>.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="34"/>
<source>Encrypt wallet</source>
<translation>Κρυπτογράφησε το πορτοφόλι</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="37"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Αυτη η ενεργεία χρειάζεται τον κωδικό του πορτοφολιού για να ξεκλειδώσει το πορτοφόλι.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="42"/>
<source>Unlock wallet</source>
<translation>Ξεκλειδωσε το πορτοφολι</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="45"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Αυτη η ενεργεια χρειάζεται τον κωδικο του πορτοφολιου για να αποκρυπτογραφησειι το πορτοφολι.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="50"/>
<source>Decrypt wallet</source>
<translation>Αποκρυπτογράφησε το πορτοφολι</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="53"/>
<source>Change passphrase</source>
<translation>Άλλαξε κωδικο πρόσβασης</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="54"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>Εισάγετε τον παλιό και τον νεο κωδικο στο πορτοφολι.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="100"/>
<source>Confirm wallet encryption</source>
<translation>Επιβεβαίωσε την κρυπτογραφηση του πορτοφολιού</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="101"/>
<source>WARNING: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR RICHCOINS</b>!
Are you sure you wish to encrypt your wallet?</source>
<translation>Προσοχη: Εαν κρυπτογραφησεις το πορτοφολι σου και χάσεις τον κωδικο σου θα χάσεις <b> ΟΛΑ ΣΟΥ ΤΑ RICHCOINS</b>!
Είσαι σίγουρος ότι θέλεις να κρυπτογραφησεις το πορτοφολι;</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="110"/>
<location filename="../askpassphrasedialog.cpp" line="159"/>
<source>Wallet encrypted</source>
<translation>Κρυπτογραφημενο πορτοφολι</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="111"/>
<source>Richcoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your richcoins from being stolen by malware infecting your computer.</source>
<translation>Το Richcoin θα κλεισει τώρα για να τελειώσει την διαδικασία κρυπτογραφησης. Θυμησου ότι κρυπτογραφώντας το πορτοφολι σου δεν μπορείς να προστατέψεις πλήρως τα richcoins σου από κλοπή στην περίπτωση όπου μολυνθεί ο υπολογιστής σου με κακόβουλο λογισμικο.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="207"/>
<location filename="../askpassphrasedialog.cpp" line="231"/>
<source>Warning: The Caps Lock key is on.</source>
<translation>Προσοχη: το πλήκτρο Caps Lock είναι ενεργο.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="116"/>
<location filename="../askpassphrasedialog.cpp" line="123"/>
<location filename="../askpassphrasedialog.cpp" line="165"/>
<location filename="../askpassphrasedialog.cpp" line="171"/>
<source>Wallet encryption failed</source>
<translation>Η κρυπτογραφηση του πορτοφολιού απέτυχε</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="117"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>Η κρυπτογράφηση του πορτοφολιού απέτυχε λογω εσωτερικού σφάλματος. Το πορτοφολι δεν κρυπτογραφηθηκε.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="124"/>
<location filename="../askpassphrasedialog.cpp" line="172"/>
<source>The supplied passphrases do not match.</source>
<translation>Οι εισαχθέντες κωδικοί δεν ταιριάζουν.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="135"/>
<source>Wallet unlock failed</source>
<translation>το ξεκλείδωμα του πορτοφολιού απέτυχε</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="136"/>
<location filename="../askpassphrasedialog.cpp" line="147"/>
<location filename="../askpassphrasedialog.cpp" line="166"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>Ο κωδικος που εισήχθη για την αποκρυπτογραφηση του πορτοφολιού ήταν λαθος.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="146"/>
<source>Wallet decryption failed</source>
<translation>Η αποκρυπτογραφηση του πορτοφολιού απέτυχε</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="160"/>
<source>Wallet passphrase was succesfully changed.</source>
<translation>Ο κωδικος του πορτοφολιού άλλαξε με επιτυχία.</translation>
</message>
</context>
<context>
<name>RichcoinGUI</name>
<message>
<location filename="../richcoingui.cpp" line="73"/>
<source>Richcoin Wallet</source>
<translation>Πορτοφολι Richcoin</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="215"/>
<source>Sign &message...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoingui.cpp" line="248"/>
<source>Show/Hide &Richcoin</source>
<translation>Εμφάνισε/Κρύψε &Richcoin</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="515"/>
<source>Synchronizing with network...</source>
<translation>Συγχρονισμός με το δίκτυο...</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="185"/>
<source>&Overview</source>
<translation>&Επισκόπηση</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="186"/>
<source>Show general overview of wallet</source>
<translation>Εμφάνισε γενική εικονα του πορτοφολιού</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="191"/>
<source>&Transactions</source>
<translation>&Συναλλαγές</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="192"/>
<source>Browse transaction history</source>
<translation>Περιήγηση στο ιστορικο συνναλαγων</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="197"/>
<source>&Address Book</source>
<translation>&Βιβλίο Διευθύνσεων</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="198"/>
<source>Edit the list of stored addresses and labels</source>
<translation>Εξεργασια της λιστας των αποθηκευμενων διευθύνσεων και ετικετων</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="203"/>
<source>&Receive coins</source>
<translation>&Παραλαβή νομισματων</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="204"/>
<source>Show the list of addresses for receiving payments</source>
<translation>Εμφάνισε την λίστα των διευθύνσεων για την παραλαβή πληρωμων</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="209"/>
<source>&Send coins</source>
<translation>&Αποστολη νομισματων</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="216"/>
<source>Prove you control an address</source>
<translation>Απέδειξε ότι ελέγχεις μια διεύθυνση</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="235"/>
<source>E&xit</source>
<translation>Έ&ξοδος</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="236"/>
<source>Quit application</source>
<translation>Εξοδος από την εφαρμογή</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="239"/>
<source>&About %1</source>
<translation>&Περί %1</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="240"/>
<source>Show information about Richcoin</source>
<translation>Εμφάνισε πληροφορίες σχετικά με το Richcoin</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="242"/>
<source>About &Qt</source>
<translation>Σχετικά με &Qt</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="243"/>
<source>Show information about Qt</source>
<translation>Εμφάνισε πληροφορίες σχετικά με Qt</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="245"/>
<source>&Options...</source>
<translation>&Επιλογές...</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="252"/>
<source>&Encrypt Wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoingui.cpp" line="255"/>
<source>&Backup Wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoingui.cpp" line="257"/>
<source>&Change Passphrase...</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location filename="../richcoingui.cpp" line="517"/>
<source>~%n block(s) remaining</source>
<translation><numerusform>~%n μπλοκ απέμεινε</numerusform><numerusform>~%n μπλοκ απέμειναν</numerusform></translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="528"/>
<source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source>
<translation>Κατέβηκαν %1 από %2 μπλοκ του ιστορικού συναλλαγών (%3% ολοκληρώθηκαν)</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="250"/>
<source>&Export...</source>
<translation>&Εξαγωγή</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="210"/>
<source>Send coins to a Richcoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoingui.cpp" line="246"/>
<source>Modify configuration options for Richcoin</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoingui.cpp" line="249"/>
<source>Show or hide the Richcoin window</source>
<translation>Εμφάνισε ή κρύψε το παράθυρο Richcoin</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="251"/>
<source>Export the data in the current tab to a file</source>
<translation>Εξαγωγή δεδομένων καρτέλας σε αρχείο</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="253"/>
<source>Encrypt or decrypt wallet</source>
<translation>Κρυπτογράφηση ή αποκρυπτογράφηση πορτοφολιού</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="256"/>
<source>Backup wallet to another location</source>
<translation>Δημιουργία αντιγράφου ασφαλείας πορτοφολιού σε άλλη τοποθεσία</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="258"/>
<source>Change the passphrase used for wallet encryption</source>
<translation>Αλλαγή του κωδικού κρυπτογράφησης του πορτοφολιού</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="259"/>
<source>&Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoingui.cpp" line="260"/>
<source>Open debugging and diagnostic console</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoingui.cpp" line="261"/>
<source>&Verify message...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoingui.cpp" line="262"/>
<source>Verify a message signature</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoingui.cpp" line="286"/>
<source>&File</source>
<translation>&Αρχείο</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="296"/>
<source>&Settings</source>
<translation>&Ρυθμίσεις</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="302"/>
<source>&Help</source>
<translation>&Βοήθεια</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="311"/>
<source>Tabs toolbar</source>
<translation>Εργαλειοθήκη καρτελών</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="322"/>
<source>Actions toolbar</source>
<translation>Εργαλειοθήκη ενεργειών</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="334"/>
<location filename="../richcoingui.cpp" line="343"/>
<source>[testnet]</source>
<translation>[testnet]</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="343"/>
<location filename="../richcoingui.cpp" line="399"/>
<source>Richcoin client</source>
<translation>Πελάτης Richcoin</translation>
</message>
<message numerus="yes">
<location filename="../richcoingui.cpp" line="492"/>
<source>%n active connection(s) to Richcoin network</source>
<translation><numerusform>%n ενεργή σύνδεση στο δίκτυο Richcoin</numerusform><numerusform>%n ενεργές συνδέσεις στο δίκτυο Βitcoin</numerusform></translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="540"/>
<source>Downloaded %1 blocks of transaction history.</source>
<translation>Έγινε λήψη %1 μπλοκ ιστορικού συναλλαγών</translation>
</message>
<message numerus="yes">
<location filename="../richcoingui.cpp" line="555"/>
<source>%n second(s) ago</source>
<translation><numerusform>%n δευτερόλεπτο πριν</numerusform><numerusform>%n δευτερόλεπτα πριν</numerusform></translation>
</message>
<message numerus="yes">
<location filename="../richcoingui.cpp" line="559"/>
<source>%n minute(s) ago</source>
<translation><numerusform>%n λεπτό πριν</numerusform><numerusform>%n λεπτά πριν</numerusform></translation>
</message>
<message numerus="yes">
<location filename="../richcoingui.cpp" line="563"/>
<source>%n hour(s) ago</source>
<translation><numerusform>%n ώρα πριν</numerusform><numerusform>%n ώρες πριν</numerusform></translation>
</message>
<message numerus="yes">
<location filename="../richcoingui.cpp" line="567"/>
<source>%n day(s) ago</source>
<translation><numerusform>%n ημέρα πριν</numerusform><numerusform>%n ημέρες πριν</numerusform></translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="573"/>
<source>Up to date</source>
<translation>Ενημερωμένο</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="580"/>
<source>Catching up...</source>
<translation>Ενημέρωση...</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="590"/>
<source>Last received block was generated %1.</source>
<translation>Το τελευταίο μπλοκ που ελήφθη %1.</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="649"/>
<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>Η συναλλαγή ξεπερνάει το όριο.
Μπορεί να ολοκληρωθεί με μια αμοιβή των %1, η οποία αποδίδεται στους κόμβους που επεξεργάζονται τις συναλλαγές και βοηθούν στην υποστήριξη του δικτύου.
Θέλετε να συνεχίσετε;</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="654"/>
<source>Confirm transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoingui.cpp" line="681"/>
<source>Sent transaction</source>
<translation>Η συναλλαγή απεστάλη</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="682"/>
<source>Incoming transaction</source>
<translation>Εισερχόμενη συναλλαγή</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="683"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation>Ημερομηνία: %1
Ποσό: %2
Τύπος: %3
Διεύθυνση: %4
</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="804"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>Το πορτοφόλι είναι <b>κρυπτογραφημένο</b> και <b>ξεκλείδωτο</b></translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="812"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>Το πορτοφόλι είναι <b>κρυπτογραφημένο</b> και <b>κλειδωμένο</b></translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="835"/>
<source>Backup Wallet</source>
<translation>Αντίγραφο ασφαλείας του πορτοφολιού</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="835"/>
<source>Wallet Data (*.dat)</source>
<translation>Αρχεία δεδομένων πορτοφολιού (*.dat)</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="838"/>
<source>Backup Failed</source>
<translation>Αποτυχία κατά τη δημιουργία αντιγράφου</translation>
</message>
<message>
<location filename="../richcoingui.cpp" line="838"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation>Παρουσιάστηκε σφάλμα κατά την αποθήκευση των δεδομένων πορτοφολιού στη νέα τοποθεσία.</translation>
</message>
<message>
<location filename="../richcoin.cpp" line="112"/>
<source>A fatal error occured. Richcoin can no longer continue safely and will quit.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="84"/>
<source>Network Alert</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>DisplayOptionsPage</name>
<message>
<location filename="../optionsdialog.cpp" line="246"/>
<source>Display</source>
<translation>Απεικόνισης</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="257"/>
<source>default</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="263"/>
<source>The user interface language can be set here. This setting will only take effect after restarting Richcoin.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="252"/>
<source>User Interface &Language:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="273"/>
<source>&Unit to show amounts in:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="277"/>
<source>Choose the default subdivision unit to show in the interface, and when sending coins</source>
<translation>Επιλέξτε τη μονάδα υποδιαίρεσης που θα εμφανίζεται</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="284"/>
<source>&Display addresses in transaction list</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="285"/>
<source>Whether to show Richcoin addresses in the transaction list</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="303"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="303"/>
<source>This setting will take effect after restarting Richcoin.</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 filename="../forms/editaddressdialog.ui" line="25"/>
<source>&Label</source>
<translation>&Επιγραφή</translation>
</message>
<message>
<location filename="../forms/editaddressdialog.ui" line="35"/>
<source>The label associated with this address book entry</source>
<translation>Η επιγραφή που σχετίζεται με αυτή την καταχώρηση του βιβλίου διευθύνσεων</translation>
</message>
<message>
<location filename="../forms/editaddressdialog.ui" line="42"/>
<source>&Address</source>
<translation>&Διεύθυνση</translation>
</message>
<message>
<location filename="../forms/editaddressdialog.ui" line="52"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation>Η διεύθυνση που σχετίζεται με αυτή την καταχώρηση του βιβλίου διευθύνσεων. Μπορεί να τροποποιηθεί μόνο για τις διευθύνσεις αποστολής.</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="20"/>
<source>New receiving address</source>
<translation>Νέα διεύθυνση λήψης</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="24"/>
<source>New sending address</source>
<translation>Νέα διεύθυνση αποστολής</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="27"/>
<source>Edit receiving address</source>
<translation>Επεξεργασία διεύθυνσης λήψης</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="31"/>
<source>Edit sending address</source>
<translation>Επεξεργασία διεύθυνσης αποστολής</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="91"/>
<source>The entered address "%1" is already in the address book.</source>
<translation>Η διεύθυνση "%1" βρίσκεται ήδη στο βιβλίο διευθύνσεων.</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="96"/>
<source>The entered address "%1" is not a valid Richcoin address.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="101"/>
<source>Could not unlock wallet.</source>
<translation>Δεν είναι δυνατό το ξεκλείδωμα του πορτοφολιού.</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="106"/>
<source>New key generation failed.</source>
<translation>Η δημιουργία νέου κλειδιού απέτυχε.</translation>
</message>
</context>
<context>
<name>HelpMessageBox</name>
<message>
<location filename="../richcoin.cpp" line="133"/>
<location filename="../richcoin.cpp" line="143"/>
<source>Richcoin-Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoin.cpp" line="133"/>
<source>version</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoin.cpp" line="135"/>
<source>Usage:</source>
<translation>Χρήση:</translation>
</message>
<message>
<location filename="../richcoin.cpp" line="136"/>
<source>options</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoin.cpp" line="138"/>
<source>UI options</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoin.cpp" line="139"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation>Όρισε γλώσσα, για παράδειγμα "de_DE"(προεπιλογή:τοπικές ρυθμίσεις)</translation>
</message>
<message>
<location filename="../richcoin.cpp" line="140"/>
<source>Start minimized</source>
<translation>Έναρξη ελαχιστοποιημένο</translation>
</message>
<message>
<location filename="../richcoin.cpp" line="141"/>
<source>Show splash screen on startup (default: 1)</source>
<translation>Εμφάνισε την οθόνη εκκίνησης κατά την εκκίνηση(προεπιλογή:1)</translation>
</message>
</context>
<context>
<name>MainOptionsPage</name>
<message>
<location filename="../optionsdialog.cpp" line="227"/>
<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 filename="../optionsdialog.cpp" line="212"/>
<source>Pay transaction &fee</source>
<translation>Αμοιβή &συναλλαγής</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="204"/>
<source>Main</source>
<translation>Βασικές</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="206"/>
<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>Η προαιρετική αμοιβή για κάθε kB επισπεύδει την επεξεργασία των συναλλαγών σας. Οι περισσότερες συναλλαγές είναι 1 kB. Προτείνεται αμοιβή 0.01.</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="222"/>
<source>&Start Richcoin on system login</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="223"/>
<source>Automatically start Richcoin after logging in to the system</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="226"/>
<source>&Detach databases at shutdown</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>MessagePage</name>
<message>
<location filename="../forms/messagepage.ui" line="14"/>
<source>Sign Message</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/messagepage.ui" line="20"/>
<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 filename="../forms/messagepage.ui" line="38"/>
<source>The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation>Η διεύθυνση που θα υπογραφεί μαζί με το μήνυμα (π.χ. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>
</message>
<message>
<location filename="../forms/messagepage.ui" line="48"/>
<source>Choose adress from address book</source>
<translation>Αντιγραφή διεύθυνσης από το βιβλίο διευθύνσεων</translation>
</message>
<message>
<location filename="../forms/messagepage.ui" line="58"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location filename="../forms/messagepage.ui" line="71"/>
<source>Paste address from clipboard</source>
<translation>Επικόλληση διεύθυνσης από το βιβλίο διευθύνσεων</translation>
</message>
<message>
<location filename="../forms/messagepage.ui" line="81"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location filename="../forms/messagepage.ui" line="93"/>
<source>Enter the message you want to sign here</source>
<translation>Εισάγετε εδώ το μήνυμα που θέλετε να υπογράψετε</translation>
</message>
<message>
<location filename="../forms/messagepage.ui" line="128"/>
<source>Copy the current signature to the system clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/messagepage.ui" line="131"/>
<source>&Copy Signature</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/messagepage.ui" line="142"/>
<source>Reset all sign message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/messagepage.ui" line="145"/>
<source>Clear &All</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../messagepage.cpp" line="31"/>
<source>Click "Sign Message" to get signature</source>
<translation>Κάντε κλικ στο "Υπογραφή Μηνύματος" για να λάβετε την υπογραφή</translation>
</message>
<message>
<location filename="../forms/messagepage.ui" line="114"/>
<source>Sign a message to prove you own this address</source>
<translation>Υπογράψτε ένα μήνυμα για να βεβαιώσετε πως είστε ο κάτοχος αυτής της διεύθυνσης</translation>
</message>
<message>
<location filename="../forms/messagepage.ui" line="117"/>
<source>&Sign Message</source>
<translation>&Υπογραφή Μηνύματος</translation>
</message>
<message>
<location filename="../messagepage.cpp" line="30"/>
<source>Enter a Richcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation>Εισάγετε μια διεύθυνση Richcoin (π.χ. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>
</message>
<message>
<location filename="../messagepage.cpp" line="83"/>
<location filename="../messagepage.cpp" line="90"/>
<location filename="../messagepage.cpp" line="105"/>
<location filename="../messagepage.cpp" line="117"/>
<source>Error signing</source>
<translation>Σφάλμα υπογραφής</translation>
</message>
<message>
<location filename="../messagepage.cpp" line="83"/>
<source>%1 is not a valid address.</source>
<translation>Η %1 δεν είναι έγκυρη διεύθυνση.</translation>
</message>
<message>
<location filename="../messagepage.cpp" line="90"/>
<source>%1 does not refer to a key.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../messagepage.cpp" line="105"/>
<source>Private key for %1 is not available.</source>
<translation>Το προσωπικό κλειδί της %1 δεν είναι διαθέσιμο.</translation>
</message>
<message>
<location filename="../messagepage.cpp" line="117"/>
<source>Sign failed</source>
<translation>Αποτυχία υπογραφής</translation>
</message>
</context>
<context>
<name>NetworkOptionsPage</name>
<message>
<location filename="../optionsdialog.cpp" line="345"/>
<source>Network</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="347"/>
<source>Map port using &UPnP</source>
<translation>Απόδοση θυρών με χρήστη &UPnP</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="348"/>
<source>Automatically open the Richcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation>Αυτόματο άνοιγμα των θυρών Richcoin στον δρομολογητή. Λειτουργεί μόνο αν ο δρομολογητής σας υποστηρίζει τη λειτουργία UPnP.</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="351"/>
<source>&Connect through SOCKS4 proxy:</source>
<translation>&Σύνδεση μέσω SOCKS4 διαμεσολαβητή</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="352"/>
<source>Connect to the Bitcon network through a SOCKS4 proxy (e.g. when connecting through Tor)</source>
<translation>Σύνδεση στο Richcoin δίκτυο μέσω διαμεσολαβητή SOCKS4 (π.χ. για σύνδεση μέσω Tor)</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="357"/>
<source>Proxy &IP:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="366"/>
<source>&Port:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="363"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation>Διεύθυνση IP του διαμεσολαβητή (π.χ. 127.0.0.1)</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="372"/>
<source>Port of the proxy (e.g. 1234)</source>
<translation>Η θύρα του διαμεσολαβητή (π.χ. 1234)</translation>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../optionsdialog.cpp" line="135"/>
<source>Options</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 filename="../forms/overviewpage.ui" line="47"/>
<location filename="../forms/overviewpage.ui" line="204"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the Richcoin network after a connection is established, but this process has not completed yet.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="89"/>
<source>Balance:</source>
<translation>Υπόλοιπο</translation>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="147"/>
<source>Number of transactions:</source>
<translation>Αριθμός συναλλαγών</translation>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="118"/>
<source>Unconfirmed:</source>
<translation>Ανεπιβεβαίωτες</translation>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="40"/>
<source>Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="197"/>
<source><b>Recent transactions</b></source>
<translation><b>Πρόσφατες συναλλαγές</b></translation>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="105"/>
<source>Your current balance</source>
<translation>Το τρέχον υπόλοιπο</translation>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="134"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation>Το άθροισμα των συναλλαγών που δεν έχουν ακόμα επιβεβαιωθεί και δεν προσμετρώνται στο τρέχον υπόλοιπό σας</translation>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="154"/>
<source>Total number of transactions in wallet</source>
<translation>Σύνολο συναλλαγών στο πορτοφόλι</translation>
</message>
<message>
<location filename="../overviewpage.cpp" line="110"/>
<location filename="../overviewpage.cpp" line="111"/>
<source>out of sync</source>
<translation type="unfinished"/>
</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 filename="../forms/qrcodedialog.ui" line="32"/>
<source>QR Code</source>
<translation>Κώδικας QR</translation>
</message>
<message>
<location filename="../forms/qrcodedialog.ui" line="55"/>
<source>Request Payment</source>
<translation>Αίτηση πληρωμής</translation>
</message>
<message>
<location filename="../forms/qrcodedialog.ui" line="70"/>
<source>Amount:</source>
<translation>Ποσό:</translation>
</message>
<message>
<location filename="../forms/qrcodedialog.ui" line="105"/>
<source>BTC</source>
<translation>BTC</translation>
</message>
<message>
<location filename="../forms/qrcodedialog.ui" line="121"/>
<source>Label:</source>
<translation>Επιγραφή:</translation>
</message>
<message>
<location filename="../forms/qrcodedialog.ui" line="144"/>
<source>Message:</source>
<translation>Μήνυμα:</translation>
</message>
<message>
<location filename="../forms/qrcodedialog.ui" line="186"/>
<source>&Save As...</source>
<translation>&Αποθήκευση ως...</translation>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="45"/>
<source>Error encoding URI into QR Code.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="63"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation>Το αποτέλεσμα της διεύθυνσης είναι πολύ μεγάλο. Μειώστε το μέγεθος για το κείμενο της ετικέτας/ μηνύματος.</translation>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="120"/>
<source>Save QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="120"/>
<source>PNG Images (*.png)</source>
<translation>Εικόνες PNG (*.png)</translation>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="14"/>
<source>Richcoin debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="46"/>
<source>Client name</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="56"/>
<location filename="../forms/rpcconsole.ui" line="79"/>
<location filename="../forms/rpcconsole.ui" line="102"/>
<location filename="../forms/rpcconsole.ui" line="125"/>
<location filename="../forms/rpcconsole.ui" line="161"/>
<location filename="../forms/rpcconsole.ui" line="214"/>
<location filename="../forms/rpcconsole.ui" line="237"/>
<location filename="../forms/rpcconsole.ui" line="260"/>
<location filename="../rpcconsole.cpp" line="245"/>
<source>N/A</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="69"/>
<source>Client version</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="24"/>
<source>&Information</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="39"/>
<source>Client</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="115"/>
<source>Startup time</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="144"/>
<source>Network</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="151"/>
<source>Number of connections</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="174"/>
<source>On testnet</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="197"/>
<source>Block chain</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="204"/>
<source>Current number of blocks</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="227"/>
<source>Estimated total blocks</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="250"/>
<source>Last block time</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="292"/>
<source>Debug logfile</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="299"/>
<source>Open the Richcoin debug logfile from the current data directory. This can take a few seconds for large logfiles.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="302"/>
<source>&Open</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="323"/>
<source>&Console</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="92"/>
<source>Build date</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/rpcconsole.ui" line="372"/>
<source>Clear console</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../rpcconsole.cpp" line="212"/>
<source>Welcome to the Richcoin RPC console.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../rpcconsole.cpp" line="213"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../rpcconsole.cpp" line="214"/>
<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="122"/>
<location filename="../sendcoinsdialog.cpp" line="127"/>
<location filename="../sendcoinsdialog.cpp" line="132"/>
<location filename="../sendcoinsdialog.cpp" line="137"/>
<location filename="../sendcoinsdialog.cpp" line="143"/>
<location filename="../sendcoinsdialog.cpp" line="148"/>
<location filename="../sendcoinsdialog.cpp" line="153"/>
<source>Send Coins</source>
<translation>Αποστολή νομισμάτων</translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="64"/>
<source>Send to multiple recipients at once</source>
<translation>Αποστολή σε πολλούς αποδέκτες ταυτόχρονα</translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="67"/>
<source>&Add Recipient</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="84"/>
<source>Remove all transaction fields</source>
<translation>Διαγραφή όλων των πεδίων συναλλαγής</translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="87"/>
<source>Clear &All</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="106"/>
<source>Balance:</source>
<translation>Υπόλοιπο:</translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="113"/>
<source>123.456 BTC</source>
<translation>123,456 BTC</translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="144"/>
<source>Confirm the send action</source>
<translation>Επιβεβαίωση αποστολής</translation>
</message>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="147"/>
<source>&Send</source>
<translation>&Αποστολή</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="94"/>
<source><b>%1</b> to %2 (%3)</source>
<translation><b>%1</b> σε %2 (%3)</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="99"/>
<source>Confirm send coins</source>
<translation>Επιβεβαίωση αποστολής νομισμάτων</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="100"/>
<source>Are you sure you want to send %1?</source>
<translation>Είστε βέβαιοι για την αποστολή %1;</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="100"/>
<source> and </source>
<translation>και</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="123"/>
<source>The recepient address is not valid, please recheck.</source>
<translation>Η διεύθυνση του αποδέκτη δεν είναι σωστή. Παρακαλώ ελέγξτε ξανά.</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="128"/>
<source>The amount to pay must be larger than 0.</source>
<translation>Το ποσό πληρωμής πρέπει να είναι μεγαλύτερο από 0.</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="133"/>
<source>The amount exceeds your balance.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="138"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="144"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="149"/>
<source>Error: Transaction creation failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="154"/>
<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>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="14"/>
<source>Form</source>
<translation>Φόρμα</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="29"/>
<source>A&mount:</source>
<translation>&Ποσό:</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="42"/>
<source>Pay &To:</source>
<translation>Πληρωμή &σε:</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="66"/>
<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 filename="../forms/sendcoinsentry.ui" line="75"/>
<source>&Label:</source>
<translation>&Επιγραφή</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="93"/>
<source>The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation>Η διεύθυνση γι' αποστολή πληρωμής
(π.χ. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose address from address book</source>
<translation>Επιλογή διεύθυνσης από το βιβλίο διευθύνσεων</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="113"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="120"/>
<source>Paste address from clipboard</source>
<translation>Επικόλληση διεύθυνσης από το πρόχειρο</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="130"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="137"/>
<source>Remove this recipient</source>
<translation>Αφαίρεση αποδέκτη</translation>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="26"/>
<source>Enter a Richcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation>Εισάγετε μια διεύθυνση Richcoin (π.χ. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="21"/>
<source>Open for %1 blocks</source>
<translation>Ανοιχτό για %1 μπλοκ</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="23"/>
<source>Open until %1</source>
<translation>Ανοιχτό μέχρι %1</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="29"/>
<source>%1/offline?</source>
<translation>%1/χωρίς σύνδεση;</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="31"/>
<source>%1/unconfirmed</source>
<translation>%1/χωρίς επιβεβαίωση</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="33"/>
<source>%1 confirmations</source>
<translation>%1 επιβεβαιώσεις</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="51"/>
<source><b>Status:</b> </source>
<translation><b>Κατάσταση:</b></translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="56"/>
<source>, has not been successfully broadcast yet</source>
<translation>, δεν έχει ακόμα μεταδοθεί μ' επιτυχία</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="58"/>
<source>, broadcast through %1 node</source>
<translation>, έχει μεταδοθεί μέσω %1 κόμβου</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="60"/>
<source>, broadcast through %1 nodes</source>
<translation>, έχει μεταδοθεί μέσω %1 κόμβων</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="64"/>
<source><b>Date:</b> </source>
<translation><b>Ημερομηνία:</b> </translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="71"/>
<source><b>Source:</b> Generated<br></source>
<translation><b>Προέλευση:</b> Δημιουργία<br></translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="77"/>
<location filename="../transactiondesc.cpp" line="94"/>
<source><b>From:</b> </source>
<translation><b>Από:</b> </translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="94"/>
<source>unknown</source>
<translation>άγνωστο</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="95"/>
<location filename="../transactiondesc.cpp" line="118"/>
<location filename="../transactiondesc.cpp" line="178"/>
<source><b>To:</b> </source>
<translation><b>Προς:</b> </translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="98"/>
<source> (yours, label: </source>
<translation> (δικές σας, επιγραφή: </translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="100"/>
<source> (yours)</source>
<translation> (δικές σας)</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="136"/>
<location filename="../transactiondesc.cpp" line="150"/>
<location filename="../transactiondesc.cpp" line="195"/>
<location filename="../transactiondesc.cpp" line="212"/>
<source><b>Credit:</b> </source>
<translation><b>Πίστωση:</b> </translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="138"/>
<source>(%1 matures in %2 more blocks)</source>
<translation>(%1 ωρίμανση σε %2 επιπλέον μπλοκ)</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="142"/>
<source>(not accepted)</source>
<translation>(μη αποδεκτό)</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="186"/>
<location filename="../transactiondesc.cpp" line="194"/>
<location filename="../transactiondesc.cpp" line="209"/>
<source><b>Debit:</b> </source>
<translation><b>Χρέωση:</b> </translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="200"/>
<source><b>Transaction fee:</b> </source>
<translation><b>Αμοιβή συναλλαγής:</b> </translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="216"/>
<source><b>Net amount:</b> </source>
<translation><b>Καθαρό ποσό:</b> </translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="222"/>
<source>Message:</source>
<translation>Μήνυμα:</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="224"/>
<source>Comment:</source>
<translation>Σχόλιο:</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="226"/>
<source>Transaction ID:</source>
<translation>ID Συναλλαγής:</translation>
</message>
<message>
<location filename="../transactiondesc.cpp" line="229"/>
<source>Generated coins must wait 120 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, it will change to "not accepted" and not be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation>Πρέπει να περιμένετε 120 μπλοκ πριν μπορέσετε να χρησιμοποιήσετε τα νομίσματα που έχετε δημιουργήσει. Το μπλοκ που δημιουργήσατε μεταδόθηκε στο δίκτυο για να συμπεριληφθεί στην αλυσίδα των μπλοκ. Αν δεν μπει σε αυτή θα μετατραπεί σε "μη αποδεκτό" και δε θα μπορεί να καταναλωθεί. Αυτό συμβαίνει σπάνια όταν κάποιος άλλος κόμβος δημιουργήσει ένα μπλοκ λίγα δευτερόλεπτα πριν από εσάς.</translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="14"/>
<source>Transaction details</source>
<translation>Λεπτομέρειες συναλλαγής</translation>
</message>
<message>
<location filename="../forms/transactiondescdialog.ui" line="20"/>
<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 filename="../transactiontablemodel.cpp" line="226"/>
<source>Type</source>
<translation>Τύπος</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="226"/>
<source>Address</source>
<translation>Διεύθυνση</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="226"/>
<source>Amount</source>
<translation>Ποσό</translation>
</message>
<message numerus="yes">
<location filename="../transactiontablemodel.cpp" line="281"/>
<source>Open for %n block(s)</source>
<translation><numerusform>Ανοιχτό για %n μπλοκ</numerusform><numerusform>Ανοιχτό για %n μπλοκ</numerusform></translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="284"/>
<source>Open until %1</source>
<translation>Ανοιχτό μέχρι %1</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="287"/>
<source>Offline (%1 confirmations)</source>
<translation>Χωρίς σύνδεση (%1 επικυρώσεις)</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="290"/>
<source>Unconfirmed (%1 of %2 confirmations)</source>
<translation>Χωρίς επιβεβαίωση (%1 από %2 επικυρώσεις)</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="293"/>
<source>Confirmed (%1 confirmations)</source>
<translation>Επικυρωμένη (%1 επικυρώσεις)</translation>
</message>
<message numerus="yes">
<location filename="../transactiontablemodel.cpp" line="301"/>
<source>Mined balance will be available in %n more blocks</source>
<translation><numerusform>Το υπόλοιπο από την εξόρυξη θα είναι διαθέσιμο μετά από %n μπλοκ</numerusform><numerusform>Το υπόλοιπο από την εξόρυξη θα είναι διαθέσιμο μετά από %n μπλοκ</numerusform></translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="307"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation>Αυτό το μπλοκ δεν έχει παραληφθεί από κανέναν άλλο κόμβο και κατά πάσα πιθανότητα θα απορριφθεί!</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="310"/>
<source>Generated but not accepted</source>
<translation>Δημιουργήθηκε αλλά απορρίφθηκε</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="353"/>
<source>Received with</source>
<translation>Παραλαβή με</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="355"/>
<source>Received from</source>
<translation>Ελήφθη από</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="358"/>
<source>Sent to</source>
<translation>Αποστολή προς</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="360"/>
<source>Payment to yourself</source>
<translation>Πληρωμή προς εσάς</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="362"/>
<source>Mined</source>
<translation>Εξόρυξη</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="400"/>
<source>(n/a)</source>
<translation>(δ/α)</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="599"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>Κατάσταση συναλλαγής. Πηγαίνετε το ποντίκι πάνω από αυτό το πεδίο για να δείτε τον αριθμό των επικυρώσεων</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="601"/>
<source>Date and time that the transaction was received.</source>
<translation>Ημερομηνία κι ώρα λήψης της συναλλαγής.</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="603"/>
<source>Type of transaction.</source>
<translation>Είδος συναλλαγής.</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="605"/>
<source>Destination address of transaction.</source>
<translation>Διεύθυνση αποστολής της συναλλαγής.</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="607"/>
<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 filename="../transactionview.cpp" line="71"/>
<source>All</source>
<translation>Όλα</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="56"/>
<source>Today</source>
<translation>Σήμερα</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="57"/>
<source>This week</source>
<translation>Αυτή την εβδομάδα</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="58"/>
<source>This month</source>
<translation>Αυτόν τον μήνα</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="59"/>
<source>Last month</source>
<translation>Τον προηγούμενο μήνα</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="60"/>
<source>This year</source>
<translation>Αυτό το έτος</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="61"/>
<source>Range...</source>
<translation>Έκταση...</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="72"/>
<source>Received with</source>
<translation>Ελήφθη με</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="74"/>
<source>Sent to</source>
<translation>Απεστάλη προς</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="76"/>
<source>To yourself</source>
<translation>Προς εσάς</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="77"/>
<source>Mined</source>
<translation>Εξόρυξη</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="78"/>
<source>Other</source>
<translation>Άλλο</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="85"/>
<source>Enter address or label to search</source>
<translation>Αναζήτηση με βάση τη διεύθυνση ή την επιγραφή</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="92"/>
<source>Min amount</source>
<translation>Ελάχιστο ποσό</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="126"/>
<source>Copy address</source>
<translation>Αντιγραφή διεύθυνσης</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="127"/>
<source>Copy label</source>
<translation>Αντιγραφή επιγραφής</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="128"/>
<source>Copy amount</source>
<translation>Αντιγραφή ποσού</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="129"/>
<source>Edit label</source>
<translation>Επεξεργασία επιγραφής</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="130"/>
<source>Show transaction details</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../transactionview.cpp" line="270"/>
<source>Export Transaction Data</source>
<translation>Εξαγωγή Στοιχείων Συναλλαγών</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="271"/>
<source>Comma separated file (*.csv)</source>
<translation>Αρχείο οριοθετημένο με κόμματα (*.csv)</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="279"/>
<source>Confirmed</source>
<translation>Επικυρωμένες</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="280"/>
<source>Date</source>
<translation>Ημερομηνία</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="281"/>
<source>Type</source>
<translation>Τύπος</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="282"/>
<source>Label</source>
<translation>Επιγραφή</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="283"/>
<source>Address</source>
<translation>Διεύθυνση</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="284"/>
<source>Amount</source>
<translation>Ποσό</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="285"/>
<source>ID</source>
<translation>ID</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="289"/>
<source>Error exporting</source>
<translation>Σφάλμα εξαγωγής</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="289"/>
<source>Could not write to file %1.</source>
<translation>Αδυναμία εγγραφής στο αρχείο %1.</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="384"/>
<source>Range:</source>
<translation>Έκταση:</translation>
</message>
<message>
<location filename="../transactionview.cpp" line="392"/>
<source>to</source>
<translation>έως</translation>
</message>
</context>
<context>
<name>VerifyMessageDialog</name>
<message>
<location filename="../forms/verifymessagedialog.ui" line="14"/>
<source>Verify Signed Message</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/verifymessagedialog.ui" line="20"/>
<source>Enter the message and signature below (be careful to correctly copy newlines, spaces, tabs and other invisible characters) to obtain the Richcoin address used to sign the message.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/verifymessagedialog.ui" line="62"/>
<source>Verify a message and obtain the Richcoin address used to sign the message</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/verifymessagedialog.ui" line="65"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/verifymessagedialog.ui" line="79"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Αντιγραφή της επιλεγμένης διεύθυνσης στο πρόχειρο</translation>
</message>
<message>
<location filename="../forms/verifymessagedialog.ui" line="82"/>
<source>&Copy Address</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/verifymessagedialog.ui" line="93"/>
<source>Reset all verify message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/verifymessagedialog.ui" line="96"/>
<source>Clear &All</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../verifymessagedialog.cpp" line="28"/>
<source>Enter Richcoin signature</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../verifymessagedialog.cpp" line="29"/>
<source>Click "Verify Message" to obtain address</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../verifymessagedialog.cpp" line="55"/>
<location filename="../verifymessagedialog.cpp" line="62"/>
<source>Invalid Signature</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../verifymessagedialog.cpp" line="55"/>
<source>The signature could not be decoded. Please check the signature and try again.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../verifymessagedialog.cpp" line="62"/>
<source>The signature did not match the message digest. Please check the signature and try again.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../verifymessagedialog.cpp" line="72"/>
<source>Address not found in address book.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../verifymessagedialog.cpp" line="72"/>
<source>Address found in address book: %1</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="158"/>
<source>Sending...</source>
<translation>Αποστολή...</translation>
</message>
</context>
<context>
<name>WindowOptionsPage</name>
<message>
<location filename="../optionsdialog.cpp" line="313"/>
<source>Window</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="316"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation>&Ελαχιστοποίηση στην περιοχή ειδοποιήσεων αντί της γραμμής εργασιών</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="317"/>
<source>Show only a tray icon after minimizing the window</source>
<translation>Εμφάνιση εικονιδίου στην περιοχή ειδοποιήσεων μόνο κατά την ελαχιστοποίηση</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="320"/>
<source>M&inimize on close</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="321"/>
<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>
</context>
<context>
<name>richcoin-core</name>
<message>
<location filename="../richcoinstrings.cpp" line="43"/>
<source>Richcoin version</source>
<translation>Έκδοση Richcoin</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="44"/>
<source>Usage:</source>
<translation>Χρήση:</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="45"/>
<source>Send command to -server or richcoind</source>
<translation>Αποστολή εντολής στον εξυπηρετητή ή στο richcoind</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="46"/>
<source>List commands</source>
<translation>Λίστα εντολών</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="47"/>
<source>Get help for a command</source>
<translation>Επεξήγηση εντολής</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="49"/>
<source>Options:</source>
<translation>Επιλογές:</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="50"/>
<source>Specify configuration file (default: richcoin.conf)</source>
<translation>Ορίστε αρχείο ρυθμίσεων (προεπιλογή: richcoin.conf)</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="51"/>
<source>Specify pid file (default: richcoind.pid)</source>
<translation>Ορίστε αρχείο pid (προεπιλογή: richcoind.pid)</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="52"/>
<source>Generate coins</source>
<translation>Δημιουργία νομισμάτων</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="53"/>
<source>Don't generate coins</source>
<translation>Άρνηση δημιουργίας νομισμάτων</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="54"/>
<source>Specify data directory</source>
<translation>Ορισμός φακέλου δεδομένων</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="55"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation>Όρισε το μέγεθος της βάσης προσωρινής αποθήκευσης σε megabytes(προεπιλογή:25)</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="56"/>
<source>Set database disk log size in megabytes (default: 100)</source>
<translation>Όρισε το μέγεθος της βάσης ιστορικού σε megabytes (προεπιλογή:100)</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="57"/>
<source>Specify connection timeout (in milliseconds)</source>
<translation>Ορισμός λήξης χρονικού ορίου (σε χιλιοστά του δευτερολέπτου)</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="63"/>
<source>Listen for connections on <port> (default: 8333 or testnet: 18333)</source>
<translation>Εισερχόμενες συνδέσεις στη θύρα <port> (προεπιλογή: 8333 ή στο testnet: 18333)</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="64"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation>Μέγιστες αριθμός συνδέσεων με τους peers <n> (προεπιλογή: 125)</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="66"/>
<source>Connect only to the specified node</source>
<translation>Σύνδεση μόνο με ορισμένο κόμβο</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="67"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="68"/>
<source>Specify your own public address</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="69"/>
<source>Only connect to nodes in network <net> (IPv4 or IPv6)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="70"/>
<source>Try to discover public IP address (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="73"/>
<source>Bind to given address. Use [host]:port notation for IPv6</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="75"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation>Όριο αποσύνδεσης προβληματικών peers (προεπιλογή: 100)</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="76"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation>Δευτερόλεπτα πριν επιτραπεί ξανά η σύνδεση των προβληματικών peers (προεπιλογή: 86400)</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="79"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 10000)</source>
<translation>Μέγιστος buffer λήψης ανά σύνδεση, <n>*1000 bytes (προεπιλογή: 10000)</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="80"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 10000)</source>
<translation>Μέγιστος buffer αποστολής ανά σύνδεση, <n>*1000 bytes (προεπιλογή: 10000)</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="83"/>
<source>Detach block and address databases. Increases shutdown time (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="86"/>
<source>Accept command line and JSON-RPC commands</source>
<translation>Αποδοχή εντολών κονσόλας και JSON-RPC</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="87"/>
<source>Run in the background as a daemon and accept commands</source>
<translation>Εκτέλεση στο παρασκήνιο κι αποδοχή εντολών</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="88"/>
<source>Use the test network</source>
<translation>Χρήση του δοκιμαστικού δικτύου</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="89"/>
<source>Output extra debugging information</source>
<translation>Έξοδος επιπλέον πληροφοριών εντοπισμού σφαλμάτων</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="90"/>
<source>Prepend debug output with timestamp</source>
<translation>Χρονοσφραγίδα πληροφοριών εντοπισμού σφαλμάτων</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="91"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation>Αποστολή πληροφοριών εντοπισμού σφαλμάτων στην κονσόλα αντί του αρχείου debug.log</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="92"/>
<source>Send trace/debug info to debugger</source>
<translation>Αποστολή πληροφοριών εντοπισμού σφαλμάτων στον debugger</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="93"/>
<source>Username for JSON-RPC connections</source>
<translation>Όνομα χρήστη για τις συνδέσεις JSON-RPC</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="94"/>
<source>Password for JSON-RPC connections</source>
<translation>Κωδικός για τις συνδέσεις JSON-RPC</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="95"/>
<source>Listen for JSON-RPC connections on <port> (default: 8332)</source>
<translation>Εισερχόμενες συνδέσεις JSON-RPC στη θύρα <port> (προεπιλογή: 8332)</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="96"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation>Αποδοχή συνδέσεων JSON-RPC από συγκεκριμένη διεύθυνση IP</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="97"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation>Αποστολή εντολών στον κόμβο <ip> (προεπιλογή: 127.0.0.1)</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="98"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation>Εκτέλεσε την εντολή όταν το καλύτερο μπλοκ αλλάξει(%s στην εντολή αντικαθίσταται από το hash του μπλοκ)</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="101"/>
<source>Upgrade wallet to latest format</source>
<translation>Αναβάθμισε το πορτοφόλι στην τελευταία έκδοση</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="102"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation>Όριο πλήθους κλειδιών pool <n> (προεπιλογή: 100)</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="103"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation>Επανέλεγχος της αλυσίδας μπλοκ για απούσες συναλλαγές</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="104"/>
<source>How many blocks to check at startup (default: 2500, 0 = all)</source>
<translation>Πόσα μπλοκ να ελέγχω κατά την εκκίνηση (προεπιλογή:2500,0=όλα)</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="105"/>
<source>How thorough the block verification is (0-6, default: 1)</source>
<translation>Πόσο εξονυχιστική να είναι η επιβεβαίωση του μπλοκ(0-6, προεπιλογή:1)</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="106"/>
<source>Imports blocks from external blk000?.dat file</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="108"/>
<source>
SSL options: (see the Richcoin Wiki for SSL setup instructions)</source>
<translation>
Ρυθμίσεις SSL: (ανατρέξτε στο Richcoin Wiki για οδηγίες ρυθμίσεων SSL)</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="111"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>Χρήση του OpenSSL (https) για συνδέσεις JSON-RPC</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="112"/>
<source>Server certificate file (default: server.cert)</source>
<translation>Αρχείο πιστοποιητικού του διακομιστή (προεπιλογή: server.cert)</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="113"/>
<source>Server private key (default: server.pem)</source>
<translation>Προσωπικό κλειδί του διακομιστή (προεπιλογή: server.pem)</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="114"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation>Αποδεκτά κρυπτογραφήματα (προεπιλογή: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="145"/>
<source>Warning: Disk space is low</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="107"/>
<source>This help message</source>
<translation>Αυτό το κείμενο βοήθειας</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="121"/>
<source>Cannot obtain a lock on data directory %s. Richcoin is probably already running.</source>
<translation>Αδυναμία κλειδώματος του φακέλου δεδομένων %s. Πιθανώς το Richcoin να είναι ήδη ενεργό.</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="48"/>
<source>Richcoin</source>
<translation>Richcoin</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="30"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="58"/>
<source>Connect through socks proxy</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="59"/>
<source>Select the version of socks proxy to use (4 or 5, 5 is default)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="60"/>
<source>Do not use proxy for connections to network <net> (IPv4 or IPv6)</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="61"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="62"/>
<source>Pass DNS requests to (SOCKS5) proxy</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="142"/>
<source>Loading addresses...</source>
<translation>Φόρτωση διευθύνσεων...</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="132"/>
<source>Error loading blkindex.dat</source>
<translation>Σφάλμα φόρτωσης blkindex.dat</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="134"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation>Σφάλμα φόρτωσης wallet.dat: Κατεστραμμένο Πορτοφόλι</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="135"/>
<source>Error loading wallet.dat: Wallet requires newer version of Richcoin</source>
<translation>Σφάλμα φόρτωσης wallet.dat: Το Πορτοφόλι απαιτεί μια νεότερη έκδοση του Richcoin</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="136"/>
<source>Wallet needed to be rewritten: restart Richcoin to complete</source>
<translation>Απαιτείται η επανεγγραφή του Πορτοφολιού, η οποία θα ολοκληρωθεί στην επανεκκίνηση του Richcoin</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="137"/>
<source>Error loading wallet.dat</source>
<translation>Σφάλμα φόρτωσης αρχείου wallet.dat</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="124"/>
<source>Invalid -proxy address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="125"/>
<source>Unknown network specified in -noproxy: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="127"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="126"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="128"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="129"/>
<source>Not listening on any port</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="130"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="117"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="143"/>
<source>Error: could not start node</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="31"/>
<source>Error: Wallet locked, unable to create transaction </source>
<translation>Σφάλμα: το πορτοφόλι είναι κλειδωμένο, δεν μπορεί να δημιουργηθεί συναλλαγή</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="32"/>
<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>Σφάλμα: Αυτή η συναλλαγή απαιτεί αμοιβή συναλλαγής τουλάχιστον %s λόγω του μεγέθους, πολυπλοκότητας ή της χρήσης πρόσφατης παραλαβής κεφαλαίου</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="35"/>
<source>Error: Transaction creation failed </source>
<translation>Σφάλμα: Η δημιουργία της συναλλαγής απέτυχε</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="36"/>
<source>Sending...</source>
<translation>Αποστολή...</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="37"/>
<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>Σφάλμα: Η συναλλαγή απορρίφθηκε.
Αυτό ίσως οφείλεται στο ότι τα νομίσματά σας έχουν ήδη ξοδευτεί, π.χ. με την αντιγραφή του wallet.dat σε άλλο σύστημα και την χρήση τους εκεί, χωρίς η συναλλαγή να έχει καταγραφεί στο παρόν σύστημα.</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="41"/>
<source>Invalid amount</source>
<translation>Λάθος ποσότητα</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="42"/>
<source>Insufficient funds</source>
<translation>Ανεπαρκές κεφάλαιο</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="131"/>
<source>Loading block index...</source>
<translation>Φόρτωση ευρετηρίου μπλοκ...</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="65"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation>Προσέθεσε ένα κόμβο για σύνδεση και προσπάθησε να κρατήσεις την σύνδεση ανοιχτή</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="28"/>
<source>Unable to bind to %s on this computer. Richcoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="71"/>
<source>Find peers using internet relay chat (default: 0)</source>
<translation>Βρες ομότιμους υπολογιστές χρησιμοποιώντας internet relay chat(Προεπιλογή:0)</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="72"/>
<source>Accept connections from outside (default: 1)</source>
<translation>Να δέχεσαι συνδέσεις από έξω(προεπιλογή:1)</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="74"/>
<source>Find peers using DNS lookup (default: 1)</source>
<translation>Βρες ομότιμους υπολογιστές χρησιμοποιώντας αναζήτηση DNS(προεπιλογή:1)</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="81"/>
<source>Use Universal Plug and Play to map the listening port (default: 1)</source>
<translation>Χρησιμοποίησε Universal Plug and Play για την χρήση της πόρτας αναμονής (προεπιλογή:1)</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="82"/>
<source>Use Universal Plug and Play to map the listening port (default: 0)</source>
<translation>Χρησιμοποίησε Universal Plug and Play για την χρήση της πόρτας αναμονής (προεπιλογή:0)</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="85"/>
<source>Fee per KB to add to transactions you send</source>
<translation>Αμοιβή ανά KB που θα προστίθεται στις συναλλαγές που στέλνεις</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="118"/>
<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 filename="../richcoinstrings.cpp" line="133"/>
<source>Loading wallet...</source>
<translation>Φόρτωση πορτοφολιού...</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="138"/>
<source>Cannot downgrade wallet</source>
<translation>Δεν μπορώ να υποβαθμίσω το πορτοφόλι</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="139"/>
<source>Cannot initialize keypool</source>
<translation>Δεν μπορώ αν αρχικοποιήσω την λίστα κλειδιών</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="140"/>
<source>Cannot write default address</source>
<translation>Δεν μπορώ να γράψω την προεπιλεγμένη διεύθυνση</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="141"/>
<source>Rescanning...</source>
<translation>Ανίχνευση...</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="144"/>
<source>Done loading</source>
<translation>Η φόρτωση ολοκληρώθηκε</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="8"/>
<source>To use the %s option</source>
<translation>Χρήση της %s επιλογής</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="9"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=richcoinrpc
rpcpassword=%s
(you do not need to remember this password)
If the file does not exist, create it with owner-readable-only file permissions.
</source>
<translation>%s, πρέπει να βάλεις ένα κωδικό στο αρχείο παραμέτρων: %s
Προτείνεται να χρησιμοποιήσεις τον παρακάτω τυχαίο κωδικό:
rpcuser=richcoinrpc
rpcpassword=%s
(δεν χρειάζεται να θυμάσαι αυτόν τον κωδικό)
Εάν το αρχείο δεν υπάρχει, δημιούργησε το με δικαιώματα μόνο για ανάγνωση από τον δημιουργό.</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="18"/>
<source>Error</source>
<translation>Σφάλμα</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="19"/>
<source>An error occured while setting up the RPC port %i for listening: %s</source>
<translation>Ένα σφάλμα συνέβη καθώς προετοιμαζόταν η πόρτα RPC %i για αναμονή:%s </translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="20"/>
<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>Πρέπει να βάλεις ένα κωδικό στο αρχείο παραμέτρων: %s
Εάν το αρχείο δεν υπάρχει, δημιούργησε το με δικαιώματα μόνο για ανάγνωση από τον δημιουργό</translation>
</message>
<message>
<location filename="../richcoinstrings.cpp" line="25"/>
<source>Warning: Please check that your computer's date and time are correct. If your clock is wrong Richcoin will not work properly.</source>
<translation>Προειδοποίηση: Παρακαλώ βεβαιωθείτε πως η ημερομηνία κι ώρα του συστήματός σας είναι σωστές. Αν το ρολόι του υπολογιστή σας πάει λάθος, ενδέχεται να μη λειτουργεί σωστά το Richcoin.</translation>
</message>
</context>
</TS> | {
"content_hash": "a82e2134ae17ea72fff6a9922da15265",
"timestamp": "",
"source": "github",
"line_count": 2521,
"max_line_length": 428,
"avg_line_length": 44.22451408171361,
"alnum_prop": 0.6483541124764552,
"repo_name": "richcoin/richcoin",
"id": "b7e74e15391400fcafb9eae4d336186f50e070d2",
"size": "122738",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/qt/locale/richcoin_el_GR.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "57989"
},
{
"name": "C++",
"bytes": "1576458"
},
{
"name": "Objective-C",
"bytes": "2463"
},
{
"name": "Prolog",
"bytes": "22838"
},
{
"name": "Python",
"bytes": "18156"
},
{
"name": "Shell",
"bytes": "1152"
},
{
"name": "TypeScript",
"bytes": "7629866"
}
],
"symlink_target": ""
} |
import { ChildProcess, fork, ForkOptions } from 'child_process';
import { IDisposable, toDisposable, dispose } from 'vs/base/common/lifecycle';
import { Delayer, always, createCancelablePromise } from 'vs/base/common/async';
import { deepClone, assign } from 'vs/base/common/objects';
import { Emitter, fromNodeEventEmitter, Event } from 'vs/base/common/event';
import { createQueuedSender } from 'vs/base/node/processes';
import { ChannelServer as IPCServer, ChannelClient as IPCClient, IChannelClient, IChannel } from 'vs/base/parts/ipc/node/ipc';
import { isRemoteConsoleLog, log } from 'vs/base/node/console';
import { CancellationToken } from 'vs/base/common/cancellation';
import * as errors from 'vs/base/common/errors';
/**
* This implementation doesn't perform well since it uses base64 encoding for buffers.
* We should move all implementations to use named ipc.net, so we stop depending on cp.fork.
*/
export class Server extends IPCServer {
constructor() {
super({
send: r => { try { process.send(r.toString('base64')); } catch (e) { /* not much to do */ } },
onMessage: fromNodeEventEmitter(process, 'message', msg => Buffer.from(msg, 'base64'))
});
process.once('disconnect', () => this.dispose());
}
}
export interface IIPCOptions {
/**
* A descriptive name for the server this connection is to. Used in logging.
*/
serverName: string;
/**
* Time in millies before killing the ipc process. The next request after killing will start it again.
*/
timeout?: number;
/**
* Arguments to the module to execute.
*/
args?: string[];
/**
* Environment key-value pairs to be passed to the process that gets spawned for the ipc.
*/
env?: any;
/**
* Allows to assign a debug port for debugging the application executed.
*/
debug?: number;
/**
* Allows to assign a debug port for debugging the application and breaking it on the first line.
*/
debugBrk?: number;
/**
* See https://github.com/Microsoft/vscode/issues/27665
* Allows to pass in fresh execArgv to the forked process such that it doesn't inherit them from `process.execArgv`.
* e.g. Launching the extension host process with `--inspect-brk=xxx` and then forking a process from the extension host
* results in the forked process inheriting `--inspect-brk=xxx`.
*/
freshExecArgv?: boolean;
/**
* Enables our createQueuedSender helper for this Client. Uses a queue when the internal Node.js queue is
* full of messages - see notes on that method.
*/
useQueue?: boolean;
}
export class Client implements IChannelClient, IDisposable {
private disposeDelayer: Delayer<void>;
private activeRequests = new Set<IDisposable>();
private child: ChildProcess;
private _client: IPCClient;
private channels = new Map<string, IChannel>();
private _onDidProcessExit = new Emitter<{ code: number, signal: string }>();
readonly onDidProcessExit = this._onDidProcessExit.event;
constructor(private modulePath: string, private options: IIPCOptions) {
const timeout = options && options.timeout ? options.timeout : 60000;
this.disposeDelayer = new Delayer<void>(timeout);
this.child = null;
this._client = null;
}
getChannel<T extends IChannel>(channelName: string): T {
const that = this;
return {
call<T>(command: string, arg?: any, cancellationToken?: CancellationToken): Thenable<T> {
return that.requestPromise<T>(channelName, command, arg, cancellationToken);
},
listen(event: string, arg?: any) {
return that.requestEvent(channelName, event, arg);
}
} as T;
}
protected requestPromise<T>(channelName: string, name: string, arg?: any, cancellationToken = CancellationToken.None): Thenable<T> {
if (!this.disposeDelayer) {
return Promise.reject(new Error('disposed'));
}
if (cancellationToken.isCancellationRequested) {
return Promise.reject(errors.canceled());
}
this.disposeDelayer.cancel();
const channel = this.getCachedChannel(channelName);
const result = createCancelablePromise(token => channel.call<T>(name, arg, token));
const cancellationTokenListener = cancellationToken.onCancellationRequested(() => result.cancel());
const disposable = toDisposable(() => result.cancel());
this.activeRequests.add(disposable);
always(result, () => {
cancellationTokenListener.dispose();
this.activeRequests.delete(disposable);
if (this.activeRequests.size === 0) {
this.disposeDelayer.trigger(() => this.disposeClient());
}
});
return result;
}
protected requestEvent<T>(channelName: string, name: string, arg?: any): Event<T> {
if (!this.disposeDelayer) {
return Event.None;
}
this.disposeDelayer.cancel();
let listener: IDisposable;
const emitter = new Emitter<any>({
onFirstListenerAdd: () => {
const channel = this.getCachedChannel(channelName);
const event: Event<T> = channel.listen(name, arg);
listener = event(emitter.fire, emitter);
this.activeRequests.add(listener);
},
onLastListenerRemove: () => {
this.activeRequests.delete(listener);
listener.dispose();
if (this.activeRequests.size === 0 && this.disposeDelayer) {
this.disposeDelayer.trigger(() => this.disposeClient());
}
}
});
return emitter.event;
}
private get client(): IPCClient {
if (!this._client) {
const args = this.options && this.options.args ? this.options.args : [];
const forkOpts: ForkOptions = Object.create(null);
forkOpts.env = assign(deepClone(process.env), { 'VSCODE_PARENT_PID': String(process.pid) });
if (this.options && this.options.env) {
forkOpts.env = assign(forkOpts.env, this.options.env);
}
if (this.options && this.options.freshExecArgv) {
forkOpts.execArgv = [];
}
if (this.options && typeof this.options.debug === 'number') {
forkOpts.execArgv = ['--nolazy', '--inspect=' + this.options.debug];
}
if (this.options && typeof this.options.debugBrk === 'number') {
forkOpts.execArgv = ['--nolazy', '--inspect-brk=' + this.options.debugBrk];
}
this.child = fork(this.modulePath, args, forkOpts);
const onMessageEmitter = new Emitter<Buffer>();
const onRawMessage = fromNodeEventEmitter(this.child, 'message', msg => msg);
onRawMessage(msg => {
// Handle remote console logs specially
if (isRemoteConsoleLog(msg)) {
log(msg, `IPC Library: ${this.options.serverName}`);
return null;
}
// Anything else goes to the outside
onMessageEmitter.fire(Buffer.from(msg, 'base64'));
});
const sender = this.options.useQueue ? createQueuedSender(this.child) : this.child;
const send = (r: Buffer) => this.child && this.child.connected && sender.send(r.toString('base64'));
const onMessage = onMessageEmitter.event;
const protocol = { send, onMessage };
this._client = new IPCClient(protocol);
const onExit = () => this.disposeClient();
process.once('exit', onExit);
this.child.on('error', err => console.warn('IPC "' + this.options.serverName + '" errored with ' + err));
this.child.on('exit', (code: any, signal: any) => {
process.removeListener('exit', onExit);
this.activeRequests.forEach(r => dispose(r));
this.activeRequests.clear();
if (code !== 0 && signal !== 'SIGTERM') {
console.warn('IPC "' + this.options.serverName + '" crashed with exit code ' + code + ' and signal ' + signal);
}
if (this.disposeDelayer) {
this.disposeDelayer.cancel();
}
this.disposeClient();
this._onDidProcessExit.fire({ code, signal });
});
}
return this._client;
}
private getCachedChannel(name: string): IChannel {
let channel = this.channels.get(name);
if (!channel) {
channel = this.client.getChannel(name);
this.channels.set(name, channel);
}
return channel;
}
private disposeClient() {
if (this._client) {
this.child.kill();
this.child = null;
this._client = null;
this.channels.clear();
}
}
dispose() {
this._onDidProcessExit.dispose();
this.disposeDelayer.cancel();
this.disposeDelayer = null;
this.disposeClient();
this.activeRequests.clear();
}
}
| {
"content_hash": "0f262f2a07183b08e0cbc04e33e28cec",
"timestamp": "",
"source": "github",
"line_count": 267,
"max_line_length": 133,
"avg_line_length": 30.288389513108616,
"alnum_prop": 0.6857920118709039,
"repo_name": "0xmohit/vscode",
"id": "9812c24e2d4ba3ce6b35a9bca275703ae29ffa27",
"size": "8438",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/vs/base/parts/ipc/node/ipc.cp.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "5838"
},
{
"name": "C",
"bytes": "818"
},
{
"name": "C#",
"bytes": "1640"
},
{
"name": "C++",
"bytes": "1072"
},
{
"name": "CSS",
"bytes": "498480"
},
{
"name": "Clojure",
"bytes": "1206"
},
{
"name": "CoffeeScript",
"bytes": "590"
},
{
"name": "Dockerfile",
"bytes": "3689"
},
{
"name": "F#",
"bytes": "634"
},
{
"name": "Go",
"bytes": "652"
},
{
"name": "Groovy",
"bytes": "3928"
},
{
"name": "HLSL",
"bytes": "184"
},
{
"name": "HTML",
"bytes": "37165"
},
{
"name": "Inno Setup",
"bytes": "165483"
},
{
"name": "Java",
"bytes": "599"
},
{
"name": "JavaScript",
"bytes": "926375"
},
{
"name": "Lua",
"bytes": "252"
},
{
"name": "Makefile",
"bytes": "1380"
},
{
"name": "Objective-C",
"bytes": "1387"
},
{
"name": "PHP",
"bytes": "998"
},
{
"name": "Perl",
"bytes": "857"
},
{
"name": "Perl 6",
"bytes": "1065"
},
{
"name": "PowerShell",
"bytes": "5118"
},
{
"name": "Python",
"bytes": "2405"
},
{
"name": "R",
"bytes": "362"
},
{
"name": "Roff",
"bytes": "351"
},
{
"name": "Ruby",
"bytes": "1703"
},
{
"name": "Rust",
"bytes": "532"
},
{
"name": "ShaderLab",
"bytes": "330"
},
{
"name": "Shell",
"bytes": "29933"
},
{
"name": "Swift",
"bytes": "284"
},
{
"name": "TypeScript",
"bytes": "19113179"
},
{
"name": "Visual Basic",
"bytes": "893"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrapの練習</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container" style="padding: 20px 0">
<p>Production A <span class="label label-primary">on sales</span></p>
<p>Inbox <span class="badge"></span></p>
<p>Outbox <span class="badge">10</span></p>
<div class="alert alert-info">
<button type="button" name="button" class="close" data-dismiss="alert">×</button>
notices!
</div>
<div class="panel panel-primary">
<div class="panel-heading">
お知らせ
</div>
<div class="panel-body">
おはよう!
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "0adb5e345f11d947d988ab094fbdd680",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 95,
"avg_line_length": 29.305555555555557,
"alnum_prop": 0.5867298578199052,
"repo_name": "arthurbryant/bootstrap",
"id": "9188afbc545e1d701068a56ea3cfef57dc4fc3ad",
"size": "1079",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "notice.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "5014"
},
{
"name": "JavaScript",
"bytes": "484"
}
],
"symlink_target": ""
} |
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Garbage collector (GC).
//
// GC is:
// - mark&sweep
// - mostly precise (with the exception of some C-allocated objects, assembly frames/arguments, etc)
// - parallel (up to MaxGcproc threads)
// - partially concurrent (mark is stop-the-world, while sweep is concurrent)
// - non-moving/non-compacting
// - full (non-partial)
//
// GC rate.
// Next GC is after we've allocated an extra amount of memory proportional to
// the amount already in use. The proportion is controlled by GOGC environment variable
// (100 by default). If GOGC=100 and we're using 4M, we'll GC again when we get to 8M
// (this mark is tracked in next_gc variable). This keeps the GC cost in linear
// proportion to the allocation cost. Adjusting GOGC just changes the linear constant
// (and also the amount of extra memory used).
//
// Concurrent sweep.
// The sweep phase proceeds concurrently with normal program execution.
// The heap is swept span-by-span both lazily (when a goroutine needs another span)
// and concurrently in a background goroutine (this helps programs that are not CPU bound).
// However, at the end of the stop-the-world GC phase we don't know the size of the live heap,
// and so next_gc calculation is tricky and happens as follows.
// At the end of the stop-the-world phase next_gc is conservatively set based on total
// heap size; all spans are marked as "needs sweeping".
// Whenever a span is swept, next_gc is decremented by GOGC*newly_freed_memory.
// The background sweeper goroutine simply sweeps spans one-by-one bringing next_gc
// closer to the target value. However, this is not enough to avoid over-allocating memory.
// Consider that a goroutine wants to allocate a new span for a large object and
// there are no free swept spans, but there are small-object unswept spans.
// If the goroutine naively allocates a new span, it can surpass the yet-unknown
// target next_gc value. In order to prevent such cases (1) when a goroutine needs
// to allocate a new small-object span, it sweeps small-object spans for the same
// object size until it frees at least one object; (2) when a goroutine needs to
// allocate large-object span from heap, it sweeps spans until it frees at least
// that many pages into heap. Together these two measures ensure that we don't surpass
// target next_gc value by a large margin. There is an exception: if a goroutine sweeps
// and frees two nonadjacent one-page spans to the heap, it will allocate a new two-page span,
// but there can still be other one-page unswept spans which could be combined into a two-page span.
// It's critical to ensure that no operations proceed on unswept spans (that would corrupt
// mark bits in GC bitmap). During GC all mcaches are flushed into the central cache,
// so they are empty. When a goroutine grabs a new span into mcache, it sweeps it.
// When a goroutine explicitly frees an object or sets a finalizer, it ensures that
// the span is swept (either by sweeping it, or by waiting for the concurrent sweep to finish).
// The finalizer goroutine is kicked off only when all spans are swept.
// When the next GC starts, it sweeps all not-yet-swept spans (if any).
#include "runtime.h"
#include "arch_GOARCH.h"
#include "malloc.h"
#include "stack.h"
#include "mgc0.h"
#include "chan.h"
#include "race.h"
#include "type.h"
#include "typekind.h"
#include "funcdata.h"
#include "../../cmd/ld/textflag.h"
enum {
Debug = 0,
CollectStats = 0,
ConcurrentSweep = 1,
WorkbufSize = 16*1024,
FinBlockSize = 4*1024,
handoffThreshold = 4,
IntermediateBufferCapacity = 64,
// Bits in type information
PRECISE = 1,
LOOP = 2,
PC_BITS = PRECISE | LOOP,
RootData = 0,
RootBss = 1,
RootFinalizers = 2,
RootSpanTypes = 3,
RootFlushCaches = 4,
RootCount = 5,
};
#define GcpercentUnknown (-2)
// Initialized from $GOGC. GOGC=off means no gc.
static int32 gcpercent = GcpercentUnknown;
static FuncVal* poolcleanup;
void
sync·runtime_registerPoolCleanup(FuncVal *f)
{
poolcleanup = f;
}
static void
clearpools(void)
{
P *p, **pp;
MCache *c;
int32 i;
// clear sync.Pool's
if(poolcleanup != nil)
reflect·call(poolcleanup, nil, 0, 0);
for(pp=runtime·allp; p=*pp; pp++) {
// clear tinyalloc pool
c = p->mcache;
if(c != nil) {
c->tiny = nil;
c->tinysize = 0;
}
// clear defer pools
for(i=0; i<nelem(p->deferpool); i++)
p->deferpool[i] = nil;
}
}
// Holding worldsema grants an M the right to try to stop the world.
// The procedure is:
//
// runtime·semacquire(&runtime·worldsema);
// m->gcing = 1;
// runtime·stoptheworld();
//
// ... do stuff ...
//
// m->gcing = 0;
// runtime·semrelease(&runtime·worldsema);
// runtime·starttheworld();
//
uint32 runtime·worldsema = 1;
typedef struct Obj Obj;
struct Obj
{
byte *p; // data pointer
uintptr n; // size of data in bytes
uintptr ti; // type info
};
typedef struct Workbuf Workbuf;
struct Workbuf
{
#define SIZE (WorkbufSize-sizeof(LFNode)-sizeof(uintptr))
LFNode node; // must be first
uintptr nobj;
Obj obj[SIZE/sizeof(Obj) - 1];
uint8 _padding[SIZE%sizeof(Obj) + sizeof(Obj)];
#undef SIZE
};
typedef struct Finalizer Finalizer;
struct Finalizer
{
FuncVal *fn;
void *arg;
uintptr nret;
Type *fint;
PtrType *ot;
};
typedef struct FinBlock FinBlock;
struct FinBlock
{
FinBlock *alllink;
FinBlock *next;
int32 cnt;
int32 cap;
Finalizer fin[1];
};
extern byte data[];
extern byte edata[];
extern byte bss[];
extern byte ebss[];
extern byte gcdata[];
extern byte gcbss[];
static Lock finlock; // protects the following variables
static FinBlock *finq; // list of finalizers that are to be executed
static FinBlock *finc; // cache of free blocks
static FinBlock *allfin; // list of all blocks
bool runtime·fingwait;
bool runtime·fingwake;
static Lock gclock;
static G* fing;
static void runfinq(void);
static void bgsweep(void);
static Workbuf* getempty(Workbuf*);
static Workbuf* getfull(Workbuf*);
static void putempty(Workbuf*);
static Workbuf* handoff(Workbuf*);
static void gchelperstart(void);
static void flushallmcaches(void);
static bool scanframe(Stkframe *frame, void *wbufp);
static void addstackroots(G *gp, Workbuf **wbufp);
static FuncVal runfinqv = {runfinq};
static FuncVal bgsweepv = {bgsweep};
static struct {
uint64 full; // lock-free list of full blocks
uint64 empty; // lock-free list of empty blocks
byte pad0[CacheLineSize]; // prevents false-sharing between full/empty and nproc/nwait
uint32 nproc;
int64 tstart;
volatile uint32 nwait;
volatile uint32 ndone;
Note alldone;
ParFor *markfor;
Lock;
byte *chunk;
uintptr nchunk;
} work;
enum {
GC_DEFAULT_PTR = GC_NUM_INSTR,
GC_CHAN,
GC_NUM_INSTR2
};
static struct {
struct {
uint64 sum;
uint64 cnt;
} ptr;
uint64 nbytes;
struct {
uint64 sum;
uint64 cnt;
uint64 notype;
uint64 typelookup;
} obj;
uint64 rescan;
uint64 rescanbytes;
uint64 instr[GC_NUM_INSTR2];
uint64 putempty;
uint64 getfull;
struct {
uint64 foundbit;
uint64 foundword;
uint64 foundspan;
} flushptrbuf;
struct {
uint64 foundbit;
uint64 foundword;
uint64 foundspan;
} markonly;
uint32 nbgsweep;
uint32 npausesweep;
} gcstats;
// markonly marks an object. It returns true if the object
// has been marked by this function, false otherwise.
// This function doesn't append the object to any buffer.
static bool
markonly(void *obj)
{
byte *p;
uintptr *bitp, bits, shift, x, xbits, off, j;
MSpan *s;
PageID k;
// Words outside the arena cannot be pointers.
if(obj < runtime·mheap.arena_start || obj >= runtime·mheap.arena_used)
return false;
// obj may be a pointer to a live object.
// Try to find the beginning of the object.
// Round down to word boundary.
obj = (void*)((uintptr)obj & ~((uintptr)PtrSize-1));
// Find bits for this word.
off = (uintptr*)obj - (uintptr*)runtime·mheap.arena_start;
bitp = (uintptr*)runtime·mheap.arena_start - off/wordsPerBitmapWord - 1;
shift = off % wordsPerBitmapWord;
xbits = *bitp;
bits = xbits >> shift;
// Pointing at the beginning of a block?
if((bits & (bitAllocated|bitBlockBoundary)) != 0) {
if(CollectStats)
runtime·xadd64(&gcstats.markonly.foundbit, 1);
goto found;
}
// Pointing just past the beginning?
// Scan backward a little to find a block boundary.
for(j=shift; j-->0; ) {
if(((xbits>>j) & (bitAllocated|bitBlockBoundary)) != 0) {
shift = j;
bits = xbits>>shift;
if(CollectStats)
runtime·xadd64(&gcstats.markonly.foundword, 1);
goto found;
}
}
// Otherwise consult span table to find beginning.
// (Manually inlined copy of MHeap_LookupMaybe.)
k = (uintptr)obj>>PageShift;
x = k;
x -= (uintptr)runtime·mheap.arena_start>>PageShift;
s = runtime·mheap.spans[x];
if(s == nil || k < s->start || obj >= s->limit || s->state != MSpanInUse)
return false;
p = (byte*)((uintptr)s->start<<PageShift);
if(s->sizeclass == 0) {
obj = p;
} else {
uintptr size = s->elemsize;
int32 i = ((byte*)obj - p)/size;
obj = p+i*size;
}
// Now that we know the object header, reload bits.
off = (uintptr*)obj - (uintptr*)runtime·mheap.arena_start;
bitp = (uintptr*)runtime·mheap.arena_start - off/wordsPerBitmapWord - 1;
shift = off % wordsPerBitmapWord;
xbits = *bitp;
bits = xbits >> shift;
if(CollectStats)
runtime·xadd64(&gcstats.markonly.foundspan, 1);
found:
// Now we have bits, bitp, and shift correct for
// obj pointing at the base of the object.
// Only care about allocated and not marked.
if((bits & (bitAllocated|bitMarked)) != bitAllocated)
return false;
if(work.nproc == 1)
*bitp |= bitMarked<<shift;
else {
for(;;) {
x = *bitp;
if(x & (bitMarked<<shift))
return false;
if(runtime·casp((void**)bitp, (void*)x, (void*)(x|(bitMarked<<shift))))
break;
}
}
// The object is now marked
return true;
}
// PtrTarget is a structure used by intermediate buffers.
// The intermediate buffers hold GC data before it
// is moved/flushed to the work buffer (Workbuf).
// The size of an intermediate buffer is very small,
// such as 32 or 64 elements.
typedef struct PtrTarget PtrTarget;
struct PtrTarget
{
void *p;
uintptr ti;
};
typedef struct Scanbuf Scanbuf;
struct Scanbuf
{
struct {
PtrTarget *begin;
PtrTarget *end;
PtrTarget *pos;
} ptr;
struct {
Obj *begin;
Obj *end;
Obj *pos;
} obj;
Workbuf *wbuf;
Obj *wp;
uintptr nobj;
};
typedef struct BufferList BufferList;
struct BufferList
{
PtrTarget ptrtarget[IntermediateBufferCapacity];
Obj obj[IntermediateBufferCapacity];
uint32 busy;
byte pad[CacheLineSize];
};
#pragma dataflag NOPTR
static BufferList bufferList[MaxGcproc];
static Type *itabtype;
static void enqueue(Obj obj, Workbuf **_wbuf, Obj **_wp, uintptr *_nobj);
// flushptrbuf moves data from the PtrTarget buffer to the work buffer.
// The PtrTarget buffer contains blocks irrespective of whether the blocks have been marked or scanned,
// while the work buffer contains blocks which have been marked
// and are prepared to be scanned by the garbage collector.
//
// _wp, _wbuf, _nobj are input/output parameters and are specifying the work buffer.
//
// A simplified drawing explaining how the todo-list moves from a structure to another:
//
// scanblock
// (find pointers)
// Obj ------> PtrTarget (pointer targets)
// ↑ |
// | |
// `----------'
// flushptrbuf
// (find block start, mark and enqueue)
static void
flushptrbuf(Scanbuf *sbuf)
{
byte *p, *arena_start, *obj;
uintptr size, *bitp, bits, shift, j, x, xbits, off, nobj, ti, n;
MSpan *s;
PageID k;
Obj *wp;
Workbuf *wbuf;
PtrTarget *ptrbuf;
PtrTarget *ptrbuf_end;
arena_start = runtime·mheap.arena_start;
wp = sbuf->wp;
wbuf = sbuf->wbuf;
nobj = sbuf->nobj;
ptrbuf = sbuf->ptr.begin;
ptrbuf_end = sbuf->ptr.pos;
n = ptrbuf_end - sbuf->ptr.begin;
sbuf->ptr.pos = sbuf->ptr.begin;
if(CollectStats) {
runtime·xadd64(&gcstats.ptr.sum, n);
runtime·xadd64(&gcstats.ptr.cnt, 1);
}
// If buffer is nearly full, get a new one.
if(wbuf == nil || nobj+n >= nelem(wbuf->obj)) {
if(wbuf != nil)
wbuf->nobj = nobj;
wbuf = getempty(wbuf);
wp = wbuf->obj;
nobj = 0;
if(n >= nelem(wbuf->obj))
runtime·throw("ptrbuf has to be smaller than WorkBuf");
}
while(ptrbuf < ptrbuf_end) {
obj = ptrbuf->p;
ti = ptrbuf->ti;
ptrbuf++;
// obj belongs to interval [mheap.arena_start, mheap.arena_used).
if(Debug > 1) {
if(obj < runtime·mheap.arena_start || obj >= runtime·mheap.arena_used)
runtime·throw("object is outside of mheap");
}
// obj may be a pointer to a live object.
// Try to find the beginning of the object.
// Round down to word boundary.
if(((uintptr)obj & ((uintptr)PtrSize-1)) != 0) {
obj = (void*)((uintptr)obj & ~((uintptr)PtrSize-1));
ti = 0;
}
// Find bits for this word.
off = (uintptr*)obj - (uintptr*)arena_start;
bitp = (uintptr*)arena_start - off/wordsPerBitmapWord - 1;
shift = off % wordsPerBitmapWord;
xbits = *bitp;
bits = xbits >> shift;
// Pointing at the beginning of a block?
if((bits & (bitAllocated|bitBlockBoundary)) != 0) {
if(CollectStats)
runtime·xadd64(&gcstats.flushptrbuf.foundbit, 1);
goto found;
}
ti = 0;
// Pointing just past the beginning?
// Scan backward a little to find a block boundary.
for(j=shift; j-->0; ) {
if(((xbits>>j) & (bitAllocated|bitBlockBoundary)) != 0) {
obj = (byte*)obj - (shift-j)*PtrSize;
shift = j;
bits = xbits>>shift;
if(CollectStats)
runtime·xadd64(&gcstats.flushptrbuf.foundword, 1);
goto found;
}
}
// Otherwise consult span table to find beginning.
// (Manually inlined copy of MHeap_LookupMaybe.)
k = (uintptr)obj>>PageShift;
x = k;
x -= (uintptr)arena_start>>PageShift;
s = runtime·mheap.spans[x];
if(s == nil || k < s->start || obj >= s->limit || s->state != MSpanInUse)
continue;
p = (byte*)((uintptr)s->start<<PageShift);
if(s->sizeclass == 0) {
obj = p;
} else {
size = s->elemsize;
int32 i = ((byte*)obj - p)/size;
obj = p+i*size;
}
// Now that we know the object header, reload bits.
off = (uintptr*)obj - (uintptr*)arena_start;
bitp = (uintptr*)arena_start - off/wordsPerBitmapWord - 1;
shift = off % wordsPerBitmapWord;
xbits = *bitp;
bits = xbits >> shift;
if(CollectStats)
runtime·xadd64(&gcstats.flushptrbuf.foundspan, 1);
found:
// Now we have bits, bitp, and shift correct for
// obj pointing at the base of the object.
// Only care about allocated and not marked.
if((bits & (bitAllocated|bitMarked)) != bitAllocated)
continue;
if(work.nproc == 1)
*bitp |= bitMarked<<shift;
else {
for(;;) {
x = *bitp;
if(x & (bitMarked<<shift))
goto continue_obj;
if(runtime·casp((void**)bitp, (void*)x, (void*)(x|(bitMarked<<shift))))
break;
}
}
// If object has no pointers, don't need to scan further.
if((bits & bitScan) == 0)
continue;
// Ask span about size class.
// (Manually inlined copy of MHeap_Lookup.)
x = (uintptr)obj >> PageShift;
x -= (uintptr)arena_start>>PageShift;
s = runtime·mheap.spans[x];
PREFETCH(obj);
*wp = (Obj){obj, s->elemsize, ti};
wp++;
nobj++;
continue_obj:;
}
// If another proc wants a pointer, give it some.
if(work.nwait > 0 && nobj > handoffThreshold && work.full == 0) {
wbuf->nobj = nobj;
wbuf = handoff(wbuf);
nobj = wbuf->nobj;
wp = wbuf->obj + nobj;
}
sbuf->wp = wp;
sbuf->wbuf = wbuf;
sbuf->nobj = nobj;
}
static void
flushobjbuf(Scanbuf *sbuf)
{
uintptr nobj, off;
Obj *wp, obj;
Workbuf *wbuf;
Obj *objbuf;
Obj *objbuf_end;
wp = sbuf->wp;
wbuf = sbuf->wbuf;
nobj = sbuf->nobj;
objbuf = sbuf->obj.begin;
objbuf_end = sbuf->obj.pos;
sbuf->obj.pos = sbuf->obj.begin;
while(objbuf < objbuf_end) {
obj = *objbuf++;
// Align obj.b to a word boundary.
off = (uintptr)obj.p & (PtrSize-1);
if(off != 0) {
obj.p += PtrSize - off;
obj.n -= PtrSize - off;
obj.ti = 0;
}
if(obj.p == nil || obj.n == 0)
continue;
// If buffer is full, get a new one.
if(wbuf == nil || nobj >= nelem(wbuf->obj)) {
if(wbuf != nil)
wbuf->nobj = nobj;
wbuf = getempty(wbuf);
wp = wbuf->obj;
nobj = 0;
}
*wp = obj;
wp++;
nobj++;
}
// If another proc wants a pointer, give it some.
if(work.nwait > 0 && nobj > handoffThreshold && work.full == 0) {
wbuf->nobj = nobj;
wbuf = handoff(wbuf);
nobj = wbuf->nobj;
wp = wbuf->obj + nobj;
}
sbuf->wp = wp;
sbuf->wbuf = wbuf;
sbuf->nobj = nobj;
}
// Program that scans the whole block and treats every block element as a potential pointer
static uintptr defaultProg[2] = {PtrSize, GC_DEFAULT_PTR};
// Hchan program
static uintptr chanProg[2] = {0, GC_CHAN};
// Local variables of a program fragment or loop
typedef struct Frame Frame;
struct Frame {
uintptr count, elemsize, b;
uintptr *loop_or_ret;
};
// Sanity check for the derived type info objti.
static void
checkptr(void *obj, uintptr objti)
{
uintptr *pc1, *pc2, type, tisize, i, j, x;
byte *objstart;
Type *t;
MSpan *s;
if(!Debug)
runtime·throw("checkptr is debug only");
if(obj < runtime·mheap.arena_start || obj >= runtime·mheap.arena_used)
return;
type = runtime·gettype(obj);
t = (Type*)(type & ~(uintptr)(PtrSize-1));
if(t == nil)
return;
x = (uintptr)obj >> PageShift;
x -= (uintptr)(runtime·mheap.arena_start)>>PageShift;
s = runtime·mheap.spans[x];
objstart = (byte*)((uintptr)s->start<<PageShift);
if(s->sizeclass != 0) {
i = ((byte*)obj - objstart)/s->elemsize;
objstart += i*s->elemsize;
}
tisize = *(uintptr*)objti;
// Sanity check for object size: it should fit into the memory block.
if((byte*)obj + tisize > objstart + s->elemsize) {
runtime·printf("object of type '%S' at %p/%p does not fit in block %p/%p\n",
*t->string, obj, tisize, objstart, s->elemsize);
runtime·throw("invalid gc type info");
}
if(obj != objstart)
return;
// If obj points to the beginning of the memory block,
// check type info as well.
if(t->string == nil ||
// Gob allocates unsafe pointers for indirection.
(runtime·strcmp(t->string->str, (byte*)"unsafe.Pointer") &&
// Runtime and gc think differently about closures.
runtime·strstr(t->string->str, (byte*)"struct { F uintptr") != t->string->str)) {
pc1 = (uintptr*)objti;
pc2 = (uintptr*)t->gc;
// A simple best-effort check until first GC_END.
for(j = 1; pc1[j] != GC_END && pc2[j] != GC_END; j++) {
if(pc1[j] != pc2[j]) {
runtime·printf("invalid gc type info for '%s', type info %p [%d]=%p, block info %p [%d]=%p\n",
t->string ? (int8*)t->string->str : (int8*)"?", pc1, (int32)j, pc1[j], pc2, (int32)j, pc2[j]);
runtime·throw("invalid gc type info");
}
}
}
}
// scanblock scans a block of n bytes starting at pointer b for references
// to other objects, scanning any it finds recursively until there are no
// unscanned objects left. Instead of using an explicit recursion, it keeps
// a work list in the Workbuf* structures and loops in the main function
// body. Keeping an explicit work list is easier on the stack allocator and
// more efficient.
static void
scanblock(Workbuf *wbuf, bool keepworking)
{
byte *b, *arena_start, *arena_used;
uintptr n, i, end_b, elemsize, size, ti, objti, count, type, nobj;
uintptr *pc, precise_type, nominal_size;
uintptr *chan_ret, chancap;
void *obj;
Type *t, *et;
Slice *sliceptr;
String *stringptr;
Frame *stack_ptr, stack_top, stack[GC_STACK_CAPACITY+4];
BufferList *scanbuffers;
Scanbuf sbuf;
Eface *eface;
Iface *iface;
Hchan *chan;
ChanType *chantype;
Obj *wp;
if(sizeof(Workbuf) % WorkbufSize != 0)
runtime·throw("scanblock: size of Workbuf is suboptimal");
// Memory arena parameters.
arena_start = runtime·mheap.arena_start;
arena_used = runtime·mheap.arena_used;
stack_ptr = stack+nelem(stack)-1;
precise_type = false;
nominal_size = 0;
if(wbuf) {
nobj = wbuf->nobj;
wp = &wbuf->obj[nobj];
} else {
nobj = 0;
wp = nil;
}
// Initialize sbuf
scanbuffers = &bufferList[m->helpgc];
sbuf.ptr.begin = sbuf.ptr.pos = &scanbuffers->ptrtarget[0];
sbuf.ptr.end = sbuf.ptr.begin + nelem(scanbuffers->ptrtarget);
sbuf.obj.begin = sbuf.obj.pos = &scanbuffers->obj[0];
sbuf.obj.end = sbuf.obj.begin + nelem(scanbuffers->obj);
sbuf.wbuf = wbuf;
sbuf.wp = wp;
sbuf.nobj = nobj;
// (Silence the compiler)
chan = nil;
chantype = nil;
chan_ret = nil;
goto next_block;
for(;;) {
// Each iteration scans the block b of length n, queueing pointers in
// the work buffer.
if(CollectStats) {
runtime·xadd64(&gcstats.nbytes, n);
runtime·xadd64(&gcstats.obj.sum, sbuf.nobj);
runtime·xadd64(&gcstats.obj.cnt, 1);
}
if(ti != 0) {
if(Debug > 1) {
runtime·printf("scanblock %p %D ti %p\n", b, (int64)n, ti);
}
pc = (uintptr*)(ti & ~(uintptr)PC_BITS);
precise_type = (ti & PRECISE);
stack_top.elemsize = pc[0];
if(!precise_type)
nominal_size = pc[0];
if(ti & LOOP) {
stack_top.count = 0; // 0 means an infinite number of iterations
stack_top.loop_or_ret = pc+1;
} else {
stack_top.count = 1;
}
if(Debug) {
// Simple sanity check for provided type info ti:
// The declared size of the object must be not larger than the actual size
// (it can be smaller due to inferior pointers).
// It's difficult to make a comprehensive check due to inferior pointers,
// reflection, gob, etc.
if(pc[0] > n) {
runtime·printf("invalid gc type info: type info size %p, block size %p\n", pc[0], n);
runtime·throw("invalid gc type info");
}
}
} else if(UseSpanType) {
if(CollectStats)
runtime·xadd64(&gcstats.obj.notype, 1);
type = runtime·gettype(b);
if(type != 0) {
if(CollectStats)
runtime·xadd64(&gcstats.obj.typelookup, 1);
t = (Type*)(type & ~(uintptr)(PtrSize-1));
switch(type & (PtrSize-1)) {
case TypeInfo_SingleObject:
pc = (uintptr*)t->gc;
precise_type = true; // type information about 'b' is precise
stack_top.count = 1;
stack_top.elemsize = pc[0];
break;
case TypeInfo_Array:
pc = (uintptr*)t->gc;
if(pc[0] == 0)
goto next_block;
precise_type = true; // type information about 'b' is precise
stack_top.count = 0; // 0 means an infinite number of iterations
stack_top.elemsize = pc[0];
stack_top.loop_or_ret = pc+1;
break;
case TypeInfo_Chan:
chan = (Hchan*)b;
chantype = (ChanType*)t;
chan_ret = nil;
pc = chanProg;
break;
default:
if(Debug > 1)
runtime·printf("scanblock %p %D type %p %S\n", b, (int64)n, type, *t->string);
runtime·throw("scanblock: invalid type");
return;
}
if(Debug > 1)
runtime·printf("scanblock %p %D type %p %S pc=%p\n", b, (int64)n, type, *t->string, pc);
} else {
pc = defaultProg;
if(Debug > 1)
runtime·printf("scanblock %p %D unknown type\n", b, (int64)n);
}
} else {
pc = defaultProg;
if(Debug > 1)
runtime·printf("scanblock %p %D no span types\n", b, (int64)n);
}
if(IgnorePreciseGC)
pc = defaultProg;
pc++;
stack_top.b = (uintptr)b;
end_b = (uintptr)b + n - PtrSize;
for(;;) {
if(CollectStats)
runtime·xadd64(&gcstats.instr[pc[0]], 1);
obj = nil;
objti = 0;
switch(pc[0]) {
case GC_PTR:
obj = *(void**)(stack_top.b + pc[1]);
objti = pc[2];
if(Debug > 2)
runtime·printf("gc_ptr @%p: %p ti=%p\n", stack_top.b+pc[1], obj, objti);
pc += 3;
if(Debug)
checkptr(obj, objti);
break;
case GC_SLICE:
sliceptr = (Slice*)(stack_top.b + pc[1]);
if(Debug > 2)
runtime·printf("gc_slice @%p: %p/%D/%D\n", sliceptr, sliceptr->array, (int64)sliceptr->len, (int64)sliceptr->cap);
if(sliceptr->cap != 0) {
obj = sliceptr->array;
// Can't use slice element type for scanning,
// because if it points to an array embedded
// in the beginning of a struct,
// we will scan the whole struct as the slice.
// So just obtain type info from heap.
}
pc += 3;
break;
case GC_APTR:
obj = *(void**)(stack_top.b + pc[1]);
if(Debug > 2)
runtime·printf("gc_aptr @%p: %p\n", stack_top.b+pc[1], obj);
pc += 2;
break;
case GC_STRING:
stringptr = (String*)(stack_top.b + pc[1]);
if(Debug > 2)
runtime·printf("gc_string @%p: %p/%D\n", stack_top.b+pc[1], stringptr->str, (int64)stringptr->len);
if(stringptr->len != 0)
markonly(stringptr->str);
pc += 2;
continue;
case GC_EFACE:
eface = (Eface*)(stack_top.b + pc[1]);
pc += 2;
if(Debug > 2)
runtime·printf("gc_eface @%p: %p %p\n", stack_top.b+pc[1], eface->type, eface->data);
if(eface->type == nil)
continue;
// eface->type
t = eface->type;
if((void*)t >= arena_start && (void*)t < arena_used) {
*sbuf.ptr.pos++ = (PtrTarget){t, 0};
if(sbuf.ptr.pos == sbuf.ptr.end)
flushptrbuf(&sbuf);
}
// eface->data
if(eface->data >= arena_start && eface->data < arena_used) {
if(t->size <= sizeof(void*)) {
if((t->kind & KindNoPointers))
continue;
obj = eface->data;
if((t->kind & ~KindNoPointers) == KindPtr) {
// Only use type information if it is a pointer-containing type.
// This matches the GC programs written by cmd/gc/reflect.c's
// dgcsym1 in case TPTR32/case TPTR64. See rationale there.
et = ((PtrType*)t)->elem;
if(!(et->kind & KindNoPointers))
objti = (uintptr)((PtrType*)t)->elem->gc;
}
} else {
obj = eface->data;
objti = (uintptr)t->gc;
}
}
break;
case GC_IFACE:
iface = (Iface*)(stack_top.b + pc[1]);
pc += 2;
if(Debug > 2)
runtime·printf("gc_iface @%p: %p/%p %p\n", stack_top.b+pc[1], iface->tab, nil, iface->data);
if(iface->tab == nil)
continue;
// iface->tab
if((void*)iface->tab >= arena_start && (void*)iface->tab < arena_used) {
*sbuf.ptr.pos++ = (PtrTarget){iface->tab, (uintptr)itabtype->gc};
if(sbuf.ptr.pos == sbuf.ptr.end)
flushptrbuf(&sbuf);
}
// iface->data
if(iface->data >= arena_start && iface->data < arena_used) {
t = iface->tab->type;
if(t->size <= sizeof(void*)) {
if((t->kind & KindNoPointers))
continue;
obj = iface->data;
if((t->kind & ~KindNoPointers) == KindPtr) {
// Only use type information if it is a pointer-containing type.
// This matches the GC programs written by cmd/gc/reflect.c's
// dgcsym1 in case TPTR32/case TPTR64. See rationale there.
et = ((PtrType*)t)->elem;
if(!(et->kind & KindNoPointers))
objti = (uintptr)((PtrType*)t)->elem->gc;
}
} else {
obj = iface->data;
objti = (uintptr)t->gc;
}
}
break;
case GC_DEFAULT_PTR:
while(stack_top.b <= end_b) {
obj = *(byte**)stack_top.b;
if(Debug > 2)
runtime·printf("gc_default_ptr @%p: %p\n", stack_top.b, obj);
stack_top.b += PtrSize;
if(obj >= arena_start && obj < arena_used) {
*sbuf.ptr.pos++ = (PtrTarget){obj, 0};
if(sbuf.ptr.pos == sbuf.ptr.end)
flushptrbuf(&sbuf);
}
}
goto next_block;
case GC_END:
if(--stack_top.count != 0) {
// Next iteration of a loop if possible.
stack_top.b += stack_top.elemsize;
if(stack_top.b + stack_top.elemsize <= end_b+PtrSize) {
pc = stack_top.loop_or_ret;
continue;
}
i = stack_top.b;
} else {
// Stack pop if possible.
if(stack_ptr+1 < stack+nelem(stack)) {
pc = stack_top.loop_or_ret;
stack_top = *(++stack_ptr);
continue;
}
i = (uintptr)b + nominal_size;
}
if(!precise_type) {
// Quickly scan [b+i,b+n) for possible pointers.
for(; i<=end_b; i+=PtrSize) {
if(*(byte**)i != nil) {
// Found a value that may be a pointer.
// Do a rescan of the entire block.
enqueue((Obj){b, n, 0}, &sbuf.wbuf, &sbuf.wp, &sbuf.nobj);
if(CollectStats) {
runtime·xadd64(&gcstats.rescan, 1);
runtime·xadd64(&gcstats.rescanbytes, n);
}
break;
}
}
}
goto next_block;
case GC_ARRAY_START:
i = stack_top.b + pc[1];
count = pc[2];
elemsize = pc[3];
pc += 4;
// Stack push.
*stack_ptr-- = stack_top;
stack_top = (Frame){count, elemsize, i, pc};
continue;
case GC_ARRAY_NEXT:
if(--stack_top.count != 0) {
stack_top.b += stack_top.elemsize;
pc = stack_top.loop_or_ret;
} else {
// Stack pop.
stack_top = *(++stack_ptr);
pc += 1;
}
continue;
case GC_CALL:
// Stack push.
*stack_ptr-- = stack_top;
stack_top = (Frame){1, 0, stack_top.b + pc[1], pc+3 /*return address*/};
pc = (uintptr*)((byte*)pc + *(int32*)(pc+2)); // target of the CALL instruction
continue;
case GC_REGION:
obj = (void*)(stack_top.b + pc[1]);
size = pc[2];
objti = pc[3];
pc += 4;
if(Debug > 2)
runtime·printf("gc_region @%p: %D %p\n", stack_top.b+pc[1], (int64)size, objti);
*sbuf.obj.pos++ = (Obj){obj, size, objti};
if(sbuf.obj.pos == sbuf.obj.end)
flushobjbuf(&sbuf);
continue;
case GC_CHAN_PTR:
chan = *(Hchan**)(stack_top.b + pc[1]);
if(Debug > 2 && chan != nil)
runtime·printf("gc_chan_ptr @%p: %p/%D/%D %p\n", stack_top.b+pc[1], chan, (int64)chan->qcount, (int64)chan->dataqsiz, pc[2]);
if(chan == nil) {
pc += 3;
continue;
}
if(markonly(chan)) {
chantype = (ChanType*)pc[2];
if(!(chantype->elem->kind & KindNoPointers)) {
// Start chanProg.
chan_ret = pc+3;
pc = chanProg+1;
continue;
}
}
pc += 3;
continue;
case GC_CHAN:
// There are no heap pointers in struct Hchan,
// so we can ignore the leading sizeof(Hchan) bytes.
if(!(chantype->elem->kind & KindNoPointers)) {
// Channel's buffer follows Hchan immediately in memory.
// Size of buffer (cap(c)) is second int in the chan struct.
chancap = ((uintgo*)chan)[1];
if(chancap > 0) {
// TODO(atom): split into two chunks so that only the
// in-use part of the circular buffer is scanned.
// (Channel routines zero the unused part, so the current
// code does not lead to leaks, it's just a little inefficient.)
*sbuf.obj.pos++ = (Obj){(byte*)chan+runtime·Hchansize, chancap*chantype->elem->size,
(uintptr)chantype->elem->gc | PRECISE | LOOP};
if(sbuf.obj.pos == sbuf.obj.end)
flushobjbuf(&sbuf);
}
}
if(chan_ret == nil)
goto next_block;
pc = chan_ret;
continue;
default:
runtime·printf("runtime: invalid GC instruction %p at %p\n", pc[0], pc);
runtime·throw("scanblock: invalid GC instruction");
return;
}
if(obj >= arena_start && obj < arena_used) {
*sbuf.ptr.pos++ = (PtrTarget){obj, objti};
if(sbuf.ptr.pos == sbuf.ptr.end)
flushptrbuf(&sbuf);
}
}
next_block:
// Done scanning [b, b+n). Prepare for the next iteration of
// the loop by setting b, n, ti to the parameters for the next block.
if(sbuf.nobj == 0) {
flushptrbuf(&sbuf);
flushobjbuf(&sbuf);
if(sbuf.nobj == 0) {
if(!keepworking) {
if(sbuf.wbuf)
putempty(sbuf.wbuf);
return;
}
// Emptied our buffer: refill.
sbuf.wbuf = getfull(sbuf.wbuf);
if(sbuf.wbuf == nil)
return;
sbuf.nobj = sbuf.wbuf->nobj;
sbuf.wp = sbuf.wbuf->obj + sbuf.wbuf->nobj;
}
}
// Fetch b from the work buffer.
--sbuf.wp;
b = sbuf.wp->p;
n = sbuf.wp->n;
ti = sbuf.wp->ti;
sbuf.nobj--;
}
}
// Append obj to the work buffer.
// _wbuf, _wp, _nobj are input/output parameters and are specifying the work buffer.
static void
enqueue(Obj obj, Workbuf **_wbuf, Obj **_wp, uintptr *_nobj)
{
uintptr nobj, off;
Obj *wp;
Workbuf *wbuf;
if(Debug > 1)
runtime·printf("append obj(%p %D %p)\n", obj.p, (int64)obj.n, obj.ti);
// Align obj.b to a word boundary.
off = (uintptr)obj.p & (PtrSize-1);
if(off != 0) {
obj.p += PtrSize - off;
obj.n -= PtrSize - off;
obj.ti = 0;
}
if(obj.p == nil || obj.n == 0)
return;
// Load work buffer state
wp = *_wp;
wbuf = *_wbuf;
nobj = *_nobj;
// If another proc wants a pointer, give it some.
if(work.nwait > 0 && nobj > handoffThreshold && work.full == 0) {
wbuf->nobj = nobj;
wbuf = handoff(wbuf);
nobj = wbuf->nobj;
wp = wbuf->obj + nobj;
}
// If buffer is full, get a new one.
if(wbuf == nil || nobj >= nelem(wbuf->obj)) {
if(wbuf != nil)
wbuf->nobj = nobj;
wbuf = getempty(wbuf);
wp = wbuf->obj;
nobj = 0;
}
*wp = obj;
wp++;
nobj++;
// Save work buffer state
*_wp = wp;
*_wbuf = wbuf;
*_nobj = nobj;
}
static void
enqueue1(Workbuf **wbufp, Obj obj)
{
Workbuf *wbuf;
wbuf = *wbufp;
if(wbuf->nobj >= nelem(wbuf->obj))
*wbufp = wbuf = getempty(wbuf);
wbuf->obj[wbuf->nobj++] = obj;
}
static void
markroot(ParFor *desc, uint32 i)
{
Workbuf *wbuf;
FinBlock *fb;
MHeap *h;
MSpan **allspans, *s;
uint32 spanidx, sg;
G *gp;
void *p;
USED(&desc);
wbuf = getempty(nil);
// Note: if you add a case here, please also update heapdump.c:dumproots.
switch(i) {
case RootData:
enqueue1(&wbuf, (Obj){data, edata - data, (uintptr)gcdata});
break;
case RootBss:
enqueue1(&wbuf, (Obj){bss, ebss - bss, (uintptr)gcbss});
break;
case RootFinalizers:
for(fb=allfin; fb; fb=fb->alllink)
enqueue1(&wbuf, (Obj){(byte*)fb->fin, fb->cnt*sizeof(fb->fin[0]), 0});
break;
case RootSpanTypes:
// mark span types and MSpan.specials (to walk spans only once)
h = &runtime·mheap;
sg = h->sweepgen;
allspans = h->allspans;
for(spanidx=0; spanidx<runtime·mheap.nspan; spanidx++) {
Special *sp;
SpecialFinalizer *spf;
s = allspans[spanidx];
if(s->sweepgen != sg) {
runtime·printf("sweep %d %d\n", s->sweepgen, sg);
runtime·throw("gc: unswept span");
}
if(s->state != MSpanInUse)
continue;
// The garbage collector ignores type pointers stored in MSpan.types:
// - Compiler-generated types are stored outside of heap.
// - The reflect package has runtime-generated types cached in its data structures.
// The garbage collector relies on finding the references via that cache.
if(s->types.compression == MTypes_Words || s->types.compression == MTypes_Bytes)
markonly((byte*)s->types.data);
for(sp = s->specials; sp != nil; sp = sp->next) {
if(sp->kind != KindSpecialFinalizer)
continue;
// don't mark finalized object, but scan it so we
// retain everything it points to.
spf = (SpecialFinalizer*)sp;
// A finalizer can be set for an inner byte of an object, find object beginning.
p = (void*)((s->start << PageShift) + spf->offset/s->elemsize*s->elemsize);
enqueue1(&wbuf, (Obj){p, s->elemsize, 0});
enqueue1(&wbuf, (Obj){(void*)&spf->fn, PtrSize, 0});
enqueue1(&wbuf, (Obj){(void*)&spf->fint, PtrSize, 0});
enqueue1(&wbuf, (Obj){(void*)&spf->ot, PtrSize, 0});
}
}
break;
case RootFlushCaches:
flushallmcaches();
break;
default:
// the rest is scanning goroutine stacks
if(i - RootCount >= runtime·allglen)
runtime·throw("markroot: bad index");
gp = runtime·allg[i - RootCount];
// remember when we've first observed the G blocked
// needed only to output in traceback
if((gp->status == Gwaiting || gp->status == Gsyscall) && gp->waitsince == 0)
gp->waitsince = work.tstart;
addstackroots(gp, &wbuf);
break;
}
if(wbuf)
scanblock(wbuf, false);
}
// Get an empty work buffer off the work.empty list,
// allocating new buffers as needed.
static Workbuf*
getempty(Workbuf *b)
{
if(b != nil)
runtime·lfstackpush(&work.full, &b->node);
b = (Workbuf*)runtime·lfstackpop(&work.empty);
if(b == nil) {
// Need to allocate.
runtime·lock(&work);
if(work.nchunk < sizeof *b) {
work.nchunk = 1<<20;
work.chunk = runtime·SysAlloc(work.nchunk, &mstats.gc_sys);
if(work.chunk == nil)
runtime·throw("runtime: cannot allocate memory");
}
b = (Workbuf*)work.chunk;
work.chunk += sizeof *b;
work.nchunk -= sizeof *b;
runtime·unlock(&work);
}
b->nobj = 0;
return b;
}
static void
putempty(Workbuf *b)
{
if(CollectStats)
runtime·xadd64(&gcstats.putempty, 1);
runtime·lfstackpush(&work.empty, &b->node);
}
// Get a full work buffer off the work.full list, or return nil.
static Workbuf*
getfull(Workbuf *b)
{
int32 i;
if(CollectStats)
runtime·xadd64(&gcstats.getfull, 1);
if(b != nil)
runtime·lfstackpush(&work.empty, &b->node);
b = (Workbuf*)runtime·lfstackpop(&work.full);
if(b != nil || work.nproc == 1)
return b;
runtime·xadd(&work.nwait, +1);
for(i=0;; i++) {
if(work.full != 0) {
runtime·xadd(&work.nwait, -1);
b = (Workbuf*)runtime·lfstackpop(&work.full);
if(b != nil)
return b;
runtime·xadd(&work.nwait, +1);
}
if(work.nwait == work.nproc)
return nil;
if(i < 10) {
m->gcstats.nprocyield++;
runtime·procyield(20);
} else if(i < 20) {
m->gcstats.nosyield++;
runtime·osyield();
} else {
m->gcstats.nsleep++;
runtime·usleep(100);
}
}
}
static Workbuf*
handoff(Workbuf *b)
{
int32 n;
Workbuf *b1;
// Make new buffer with half of b's pointers.
b1 = getempty(nil);
n = b->nobj/2;
b->nobj -= n;
b1->nobj = n;
runtime·memmove(b1->obj, b->obj+b->nobj, n*sizeof b1->obj[0]);
m->gcstats.nhandoff++;
m->gcstats.nhandoffcnt += n;
// Put b on full list - let first half of b get stolen.
runtime·lfstackpush(&work.full, &b->node);
return b1;
}
extern byte pclntab[]; // base for f->ptrsoff
BitVector
runtime·stackmapdata(StackMap *stackmap, int32 n)
{
if(n < 0 || n >= stackmap->n)
runtime·throw("stackmapdata: index out of range");
return (BitVector){stackmap->nbit, stackmap->data + n*((stackmap->nbit+31)/32)};
}
// Scans an interface data value when the interface type indicates
// that it is a pointer.
static void
scaninterfacedata(uintptr bits, byte *scanp, bool afterprologue, void *wbufp)
{
Itab *tab;
Type *type;
if(runtime·precisestack && afterprologue) {
if(bits == BitsIface) {
tab = *(Itab**)scanp;
if(tab->type->size <= sizeof(void*) && (tab->type->kind & KindNoPointers))
return;
} else { // bits == BitsEface
type = *(Type**)scanp;
if(type->size <= sizeof(void*) && (type->kind & KindNoPointers))
return;
}
}
enqueue1(wbufp, (Obj){scanp+PtrSize, PtrSize, 0});
}
// Starting from scanp, scans words corresponding to set bits.
static void
scanbitvector(Func *f, bool precise, byte *scanp, BitVector *bv, bool afterprologue, void *wbufp)
{
uintptr word, bits;
uint32 *wordp;
int32 i, remptrs;
byte *p;
wordp = bv->data;
for(remptrs = bv->n; remptrs > 0; remptrs -= 32) {
word = *wordp++;
if(remptrs < 32)
i = remptrs;
else
i = 32;
i /= BitsPerPointer;
for(; i > 0; i--) {
bits = word & 3;
switch(bits) {
case BitsDead:
if(runtime·debug.gcdead)
*(uintptr*)scanp = PoisonGC;
break;
case BitsScalar:
break;
case BitsPointer:
p = *(byte**)scanp;
if(p != nil) {
if(Debug > 2)
runtime·printf("frame %s @%p: ptr %p\n", runtime·funcname(f), scanp, p);
if(precise && (p < (byte*)PageSize || (uintptr)p == PoisonGC || (uintptr)p == PoisonStack)) {
// Looks like a junk value in a pointer slot.
// Liveness analysis wrong?
m->traceback = 2;
runtime·printf("bad pointer in frame %s at %p: %p\n", runtime·funcname(f), scanp, p);
runtime·throw("bad pointer in scanbitvector");
}
enqueue1(wbufp, (Obj){scanp, PtrSize, 0});
}
break;
case BitsMultiWord:
p = scanp;
word >>= BitsPerPointer;
scanp += PtrSize;
i--;
if(i == 0) {
// Get next chunk of bits
remptrs -= 32;
word = *wordp++;
if(remptrs < 32)
i = remptrs;
else
i = 32;
i /= BitsPerPointer;
}
switch(word & 3) {
case BitsString:
if(Debug > 2)
runtime·printf("frame %s @%p: string %p/%D\n", runtime·funcname(f), p, ((String*)p)->str, (int64)((String*)p)->len);
if(((String*)p)->len != 0)
markonly(((String*)p)->str);
break;
case BitsSlice:
word >>= BitsPerPointer;
scanp += PtrSize;
i--;
if(i == 0) {
// Get next chunk of bits
remptrs -= 32;
word = *wordp++;
if(remptrs < 32)
i = remptrs;
else
i = 32;
i /= BitsPerPointer;
}
if(Debug > 2)
runtime·printf("frame %s @%p: slice %p/%D/%D\n", runtime·funcname(f), p, ((Slice*)p)->array, (int64)((Slice*)p)->len, (int64)((Slice*)p)->cap);
if(((Slice*)p)->cap < ((Slice*)p)->len) {
m->traceback = 2;
runtime·printf("bad slice in frame %s at %p: %p/%p/%p\n", runtime·funcname(f), p, ((byte**)p)[0], ((byte**)p)[1], ((byte**)p)[2]);
runtime·throw("slice capacity smaller than length");
}
if(((Slice*)p)->cap != 0)
enqueue1(wbufp, (Obj){p, PtrSize, 0});
break;
case BitsIface:
case BitsEface:
if(*(byte**)p != nil) {
if(Debug > 2) {
if((word&3) == BitsEface)
runtime·printf("frame %s @%p: eface %p %p\n", runtime·funcname(f), p, ((uintptr*)p)[0], ((uintptr*)p)[1]);
else
runtime·printf("frame %s @%p: iface %p %p\n", runtime·funcname(f), p, ((uintptr*)p)[0], ((uintptr*)p)[1]);
}
scaninterfacedata(word & 3, p, afterprologue, wbufp);
}
break;
}
}
word >>= BitsPerPointer;
scanp += PtrSize;
}
}
}
// Scan a stack frame: local variables and function arguments/results.
static bool
scanframe(Stkframe *frame, void *wbufp)
{
Func *f;
StackMap *stackmap;
BitVector bv;
uintptr size;
uintptr targetpc;
int32 pcdata;
bool afterprologue;
bool precise;
f = frame->fn;
targetpc = frame->pc;
if(targetpc != f->entry)
targetpc--;
pcdata = runtime·pcdatavalue(f, PCDATA_StackMapIndex, targetpc);
if(pcdata == -1) {
// We do not have a valid pcdata value but there might be a
// stackmap for this function. It is likely that we are looking
// at the function prologue, assume so and hope for the best.
pcdata = 0;
}
// Scan local variables if stack frame has been allocated.
// Use pointer information if known.
afterprologue = (frame->varp > (byte*)frame->sp);
precise = false;
if(afterprologue) {
stackmap = runtime·funcdata(f, FUNCDATA_LocalsPointerMaps);
if(stackmap == nil) {
// No locals information, scan everything.
size = frame->varp - (byte*)frame->sp;
if(Debug > 2)
runtime·printf("frame %s unsized locals %p+%p\n", runtime·funcname(f), frame->varp-size, size);
enqueue1(wbufp, (Obj){frame->varp - size, size, 0});
} else if(stackmap->n < 0) {
// Locals size information, scan just the locals.
size = -stackmap->n;
if(Debug > 2)
runtime·printf("frame %s conservative locals %p+%p\n", runtime·funcname(f), frame->varp-size, size);
enqueue1(wbufp, (Obj){frame->varp - size, size, 0});
} else if(stackmap->n > 0) {
// Locals bitmap information, scan just the pointers in
// locals.
if(pcdata < 0 || pcdata >= stackmap->n) {
// don't know where we are
runtime·printf("pcdata is %d and %d stack map entries for %s (targetpc=%p)\n",
pcdata, stackmap->n, runtime·funcname(f), targetpc);
runtime·throw("scanframe: bad symbol table");
}
bv = runtime·stackmapdata(stackmap, pcdata);
size = (bv.n * PtrSize) / BitsPerPointer;
precise = true;
scanbitvector(f, true, frame->varp - size, &bv, afterprologue, wbufp);
}
}
// Scan arguments.
// Use pointer information if known.
stackmap = runtime·funcdata(f, FUNCDATA_ArgsPointerMaps);
if(stackmap != nil) {
bv = runtime·stackmapdata(stackmap, pcdata);
scanbitvector(f, precise, frame->argp, &bv, true, wbufp);
} else {
if(Debug > 2)
runtime·printf("frame %s conservative args %p+%p\n", runtime·funcname(f), frame->argp, (uintptr)frame->arglen);
enqueue1(wbufp, (Obj){frame->argp, frame->arglen, 0});
}
return true;
}
static void
addstackroots(G *gp, Workbuf **wbufp)
{
M *mp;
int32 n;
Stktop *stk;
uintptr sp, guard;
void *base;
uintptr size;
switch(gp->status){
default:
runtime·printf("unexpected G.status %d (goroutine %p %D)\n", gp->status, gp, gp->goid);
runtime·throw("mark - bad status");
case Gdead:
return;
case Grunning:
runtime·throw("mark - world not stopped");
case Grunnable:
case Gsyscall:
case Gwaiting:
break;
}
if(gp == g)
runtime·throw("can't scan our own stack");
if((mp = gp->m) != nil && mp->helpgc)
runtime·throw("can't scan gchelper stack");
if(gp->syscallstack != (uintptr)nil) {
// Scanning another goroutine that is about to enter or might
// have just exited a system call. It may be executing code such
// as schedlock and may have needed to start a new stack segment.
// Use the stack segment and stack pointer at the time of
// the system call instead, since that won't change underfoot.
sp = gp->syscallsp;
stk = (Stktop*)gp->syscallstack;
guard = gp->syscallguard;
} else {
// Scanning another goroutine's stack.
// The goroutine is usually asleep (the world is stopped).
sp = gp->sched.sp;
stk = (Stktop*)gp->stackbase;
guard = gp->stackguard;
// For function about to start, context argument is a root too.
if(gp->sched.ctxt != 0 && runtime·mlookup(gp->sched.ctxt, &base, &size, nil))
enqueue1(wbufp, (Obj){base, size, 0});
}
if(ScanStackByFrames) {
USED(sp);
USED(stk);
USED(guard);
runtime·gentraceback(~(uintptr)0, ~(uintptr)0, 0, gp, 0, nil, 0x7fffffff, scanframe, wbufp, false);
} else {
n = 0;
while(stk) {
if(sp < guard-StackGuard || (uintptr)stk < sp) {
runtime·printf("scanstack inconsistent: g%D#%d sp=%p not in [%p,%p]\n", gp->goid, n, sp, guard-StackGuard, stk);
runtime·throw("scanstack");
}
if(Debug > 2)
runtime·printf("conservative stack %p+%p\n", (byte*)sp, (uintptr)stk-sp);
enqueue1(wbufp, (Obj){(byte*)sp, (uintptr)stk - sp, (uintptr)defaultProg | PRECISE | LOOP});
sp = stk->gobuf.sp;
guard = stk->stackguard;
stk = (Stktop*)stk->stackbase;
n++;
}
}
}
void
runtime·queuefinalizer(byte *p, FuncVal *fn, uintptr nret, Type *fint, PtrType *ot)
{
FinBlock *block;
Finalizer *f;
runtime·lock(&finlock);
if(finq == nil || finq->cnt == finq->cap) {
if(finc == nil) {
finc = runtime·persistentalloc(FinBlockSize, 0, &mstats.gc_sys);
finc->cap = (FinBlockSize - sizeof(FinBlock)) / sizeof(Finalizer) + 1;
finc->alllink = allfin;
allfin = finc;
}
block = finc;
finc = block->next;
block->next = finq;
finq = block;
}
f = &finq->fin[finq->cnt];
finq->cnt++;
f->fn = fn;
f->nret = nret;
f->fint = fint;
f->ot = ot;
f->arg = p;
runtime·fingwake = true;
runtime·unlock(&finlock);
}
void
runtime·iterate_finq(void (*callback)(FuncVal*, byte*, uintptr, Type*, PtrType*))
{
FinBlock *fb;
Finalizer *f;
uintptr i;
for(fb = allfin; fb; fb = fb->alllink) {
for(i = 0; i < fb->cnt; i++) {
f = &fb->fin[i];
callback(f->fn, f->arg, f->nret, f->fint, f->ot);
}
}
}
void
runtime·MSpan_EnsureSwept(MSpan *s)
{
uint32 sg;
// Caller must disable preemption.
// Otherwise when this function returns the span can become unswept again
// (if GC is triggered on another goroutine).
if(m->locks == 0 && m->mallocing == 0 && g != m->g0)
runtime·throw("MSpan_EnsureSwept: m is not locked");
sg = runtime·mheap.sweepgen;
if(runtime·atomicload(&s->sweepgen) == sg)
return;
if(runtime·cas(&s->sweepgen, sg-2, sg-1)) {
runtime·MSpan_Sweep(s);
return;
}
// unfortunate condition, and we don't have efficient means to wait
while(runtime·atomicload(&s->sweepgen) != sg)
runtime·osyield();
}
// Sweep frees or collects finalizers for blocks not marked in the mark phase.
// It clears the mark bits in preparation for the next GC round.
// Returns true if the span was returned to heap.
bool
runtime·MSpan_Sweep(MSpan *s)
{
int32 cl, n, npages, nfree;
uintptr size, off, *bitp, shift, bits;
uint32 sweepgen;
byte *p;
MCache *c;
byte *arena_start;
MLink head, *end;
byte *type_data;
byte compression;
uintptr type_data_inc;
MLink *x;
Special *special, **specialp, *y;
bool res, sweepgenset;
// It's critical that we enter this function with preemption disabled,
// GC must not start while we are in the middle of this function.
if(m->locks == 0 && m->mallocing == 0 && g != m->g0)
runtime·throw("MSpan_Sweep: m is not locked");
sweepgen = runtime·mheap.sweepgen;
if(s->state != MSpanInUse || s->sweepgen != sweepgen-1) {
runtime·printf("MSpan_Sweep: state=%d sweepgen=%d mheap.sweepgen=%d\n",
s->state, s->sweepgen, sweepgen);
runtime·throw("MSpan_Sweep: bad span state");
}
arena_start = runtime·mheap.arena_start;
cl = s->sizeclass;
size = s->elemsize;
if(cl == 0) {
n = 1;
} else {
// Chunk full of small blocks.
npages = runtime·class_to_allocnpages[cl];
n = (npages << PageShift) / size;
}
res = false;
nfree = 0;
end = &head;
c = m->mcache;
sweepgenset = false;
// mark any free objects in this span so we don't collect them
for(x = s->freelist; x != nil; x = x->next) {
// This is markonly(x) but faster because we don't need
// atomic access and we're guaranteed to be pointing at
// the head of a valid object.
off = (uintptr*)x - (uintptr*)runtime·mheap.arena_start;
bitp = (uintptr*)runtime·mheap.arena_start - off/wordsPerBitmapWord - 1;
shift = off % wordsPerBitmapWord;
*bitp |= bitMarked<<shift;
}
// Unlink & free special records for any objects we're about to free.
specialp = &s->specials;
special = *specialp;
while(special != nil) {
// A finalizer can be set for an inner byte of an object, find object beginning.
p = (byte*)(s->start << PageShift) + special->offset/size*size;
off = (uintptr*)p - (uintptr*)arena_start;
bitp = (uintptr*)arena_start - off/wordsPerBitmapWord - 1;
shift = off % wordsPerBitmapWord;
bits = *bitp>>shift;
if((bits & (bitAllocated|bitMarked)) == bitAllocated) {
// Find the exact byte for which the special was setup
// (as opposed to object beginning).
p = (byte*)(s->start << PageShift) + special->offset;
// about to free object: splice out special record
y = special;
special = special->next;
*specialp = special;
if(!runtime·freespecial(y, p, size, false)) {
// stop freeing of object if it has a finalizer
*bitp |= bitMarked << shift;
}
} else {
// object is still live: keep special record
specialp = &special->next;
special = *specialp;
}
}
type_data = (byte*)s->types.data;
type_data_inc = sizeof(uintptr);
compression = s->types.compression;
switch(compression) {
case MTypes_Bytes:
type_data += 8*sizeof(uintptr);
type_data_inc = 1;
break;
}
// Sweep through n objects of given size starting at p.
// This thread owns the span now, so it can manipulate
// the block bitmap without atomic operations.
p = (byte*)(s->start << PageShift);
for(; n > 0; n--, p += size, type_data+=type_data_inc) {
off = (uintptr*)p - (uintptr*)arena_start;
bitp = (uintptr*)arena_start - off/wordsPerBitmapWord - 1;
shift = off % wordsPerBitmapWord;
bits = *bitp>>shift;
if((bits & bitAllocated) == 0)
continue;
if((bits & bitMarked) != 0) {
*bitp &= ~(bitMarked<<shift);
continue;
}
if(runtime·debug.allocfreetrace)
runtime·tracefree(p, size);
// Clear mark and scan bits.
*bitp &= ~((bitScan|bitMarked)<<shift);
if(cl == 0) {
// Free large span.
runtime·unmarkspan(p, 1<<PageShift);
s->needzero = 1;
// important to set sweepgen before returning it to heap
runtime·atomicstore(&s->sweepgen, sweepgen);
sweepgenset = true;
// See note about SysFault vs SysFree in malloc.goc.
if(runtime·debug.efence)
runtime·SysFault(p, size);
else
runtime·MHeap_Free(&runtime·mheap, s, 1);
c->local_nlargefree++;
c->local_largefree += size;
runtime·xadd64(&mstats.next_gc, -(uint64)(size * (gcpercent + 100)/100));
res = true;
} else {
// Free small object.
switch(compression) {
case MTypes_Words:
*(uintptr*)type_data = 0;
break;
case MTypes_Bytes:
*(byte*)type_data = 0;
break;
}
if(size > 2*sizeof(uintptr))
((uintptr*)p)[1] = (uintptr)0xdeaddeaddeaddeadll; // mark as "needs to be zeroed"
else if(size > sizeof(uintptr))
((uintptr*)p)[1] = 0;
end->next = (MLink*)p;
end = (MLink*)p;
nfree++;
}
}
// We need to set s->sweepgen = h->sweepgen only when all blocks are swept,
// because of the potential for a concurrent free/SetFinalizer.
// But we need to set it before we make the span available for allocation
// (return it to heap or mcentral), because allocation code assumes that a
// span is already swept if available for allocation.
if(!sweepgenset && nfree == 0) {
// The span must be in our exclusive ownership until we update sweepgen,
// check for potential races.
if(s->state != MSpanInUse || s->sweepgen != sweepgen-1) {
runtime·printf("MSpan_Sweep: state=%d sweepgen=%d mheap.sweepgen=%d\n",
s->state, s->sweepgen, sweepgen);
runtime·throw("MSpan_Sweep: bad span state after sweep");
}
runtime·atomicstore(&s->sweepgen, sweepgen);
}
if(nfree > 0) {
c->local_nsmallfree[cl] += nfree;
c->local_cachealloc -= nfree * size;
runtime·xadd64(&mstats.next_gc, -(uint64)(nfree * size * (gcpercent + 100)/100));
res = runtime·MCentral_FreeSpan(&runtime·mheap.central[cl], s, nfree, head.next, end);
//MCentral_FreeSpan updates sweepgen
}
return res;
}
// State of background sweep.
// Pretected by gclock.
static struct
{
G* g;
bool parked;
MSpan** spans;
uint32 nspan;
uint32 spanidx;
} sweep;
// background sweeping goroutine
static void
bgsweep(void)
{
g->issystem = 1;
for(;;) {
while(runtime·sweepone() != -1) {
gcstats.nbgsweep++;
runtime·gosched();
}
runtime·lock(&gclock);
if(!runtime·mheap.sweepdone) {
// It's possible if GC has happened between sweepone has
// returned -1 and gclock lock.
runtime·unlock(&gclock);
continue;
}
sweep.parked = true;
g->isbackground = true;
runtime·parkunlock(&gclock, "GC sweep wait");
g->isbackground = false;
}
}
// sweeps one span
// returns number of pages returned to heap, or -1 if there is nothing to sweep
uintptr
runtime·sweepone(void)
{
MSpan *s;
uint32 idx, sg;
uintptr npages;
// increment locks to ensure that the goroutine is not preempted
// in the middle of sweep thus leaving the span in an inconsistent state for next GC
m->locks++;
sg = runtime·mheap.sweepgen;
for(;;) {
idx = runtime·xadd(&sweep.spanidx, 1) - 1;
if(idx >= sweep.nspan) {
runtime·mheap.sweepdone = true;
m->locks--;
return -1;
}
s = sweep.spans[idx];
if(s->state != MSpanInUse) {
s->sweepgen = sg;
continue;
}
if(s->sweepgen != sg-2 || !runtime·cas(&s->sweepgen, sg-2, sg-1))
continue;
if(s->incache)
runtime·throw("sweep of incache span");
npages = s->npages;
if(!runtime·MSpan_Sweep(s))
npages = 0;
m->locks--;
return npages;
}
}
static void
dumpspan(uint32 idx)
{
int32 sizeclass, n, npages, i, column;
uintptr size;
byte *p;
byte *arena_start;
MSpan *s;
bool allocated;
s = runtime·mheap.allspans[idx];
if(s->state != MSpanInUse)
return;
arena_start = runtime·mheap.arena_start;
p = (byte*)(s->start << PageShift);
sizeclass = s->sizeclass;
size = s->elemsize;
if(sizeclass == 0) {
n = 1;
} else {
npages = runtime·class_to_allocnpages[sizeclass];
n = (npages << PageShift) / size;
}
runtime·printf("%p .. %p:\n", p, p+n*size);
column = 0;
for(; n>0; n--, p+=size) {
uintptr off, *bitp, shift, bits;
off = (uintptr*)p - (uintptr*)arena_start;
bitp = (uintptr*)arena_start - off/wordsPerBitmapWord - 1;
shift = off % wordsPerBitmapWord;
bits = *bitp>>shift;
allocated = ((bits & bitAllocated) != 0);
for(i=0; i<size; i+=sizeof(void*)) {
if(column == 0) {
runtime·printf("\t");
}
if(i == 0) {
runtime·printf(allocated ? "(" : "[");
runtime·printf("%p: ", p+i);
} else {
runtime·printf(" ");
}
runtime·printf("%p", *(void**)(p+i));
if(i+sizeof(void*) >= size) {
runtime·printf(allocated ? ") " : "] ");
}
column++;
if(column == 8) {
runtime·printf("\n");
column = 0;
}
}
}
runtime·printf("\n");
}
// A debugging function to dump the contents of memory
void
runtime·memorydump(void)
{
uint32 spanidx;
for(spanidx=0; spanidx<runtime·mheap.nspan; spanidx++) {
dumpspan(spanidx);
}
}
void
runtime·gchelper(void)
{
uint32 nproc;
m->traceback = 2;
gchelperstart();
// parallel mark for over gc roots
runtime·parfordo(work.markfor);
// help other threads scan secondary blocks
scanblock(nil, true);
bufferList[m->helpgc].busy = 0;
nproc = work.nproc; // work.nproc can change right after we increment work.ndone
if(runtime·xadd(&work.ndone, +1) == nproc-1)
runtime·notewakeup(&work.alldone);
m->traceback = 0;
}
static void
cachestats(void)
{
MCache *c;
P *p, **pp;
for(pp=runtime·allp; p=*pp; pp++) {
c = p->mcache;
if(c==nil)
continue;
runtime·purgecachedstats(c);
}
}
static void
flushallmcaches(void)
{
P *p, **pp;
MCache *c;
// Flush MCache's to MCentral.
for(pp=runtime·allp; p=*pp; pp++) {
c = p->mcache;
if(c==nil)
continue;
runtime·MCache_ReleaseAll(c);
}
}
void
runtime·updatememstats(GCStats *stats)
{
M *mp;
MSpan *s;
int32 i;
uint64 stacks_inuse, smallfree;
uint64 *src, *dst;
if(stats)
runtime·memclr((byte*)stats, sizeof(*stats));
stacks_inuse = 0;
for(mp=runtime·allm; mp; mp=mp->alllink) {
stacks_inuse += mp->stackinuse*FixedStack;
if(stats) {
src = (uint64*)&mp->gcstats;
dst = (uint64*)stats;
for(i=0; i<sizeof(*stats)/sizeof(uint64); i++)
dst[i] += src[i];
runtime·memclr((byte*)&mp->gcstats, sizeof(mp->gcstats));
}
}
mstats.stacks_inuse = stacks_inuse;
mstats.mcache_inuse = runtime·mheap.cachealloc.inuse;
mstats.mspan_inuse = runtime·mheap.spanalloc.inuse;
mstats.sys = mstats.heap_sys + mstats.stacks_sys + mstats.mspan_sys +
mstats.mcache_sys + mstats.buckhash_sys + mstats.gc_sys + mstats.other_sys;
// Calculate memory allocator stats.
// During program execution we only count number of frees and amount of freed memory.
// Current number of alive object in the heap and amount of alive heap memory
// are calculated by scanning all spans.
// Total number of mallocs is calculated as number of frees plus number of alive objects.
// Similarly, total amount of allocated memory is calculated as amount of freed memory
// plus amount of alive heap memory.
mstats.alloc = 0;
mstats.total_alloc = 0;
mstats.nmalloc = 0;
mstats.nfree = 0;
for(i = 0; i < nelem(mstats.by_size); i++) {
mstats.by_size[i].nmalloc = 0;
mstats.by_size[i].nfree = 0;
}
// Flush MCache's to MCentral.
flushallmcaches();
// Aggregate local stats.
cachestats();
// Scan all spans and count number of alive objects.
for(i = 0; i < runtime·mheap.nspan; i++) {
s = runtime·mheap.allspans[i];
if(s->state != MSpanInUse)
continue;
if(s->sizeclass == 0) {
mstats.nmalloc++;
mstats.alloc += s->elemsize;
} else {
mstats.nmalloc += s->ref;
mstats.by_size[s->sizeclass].nmalloc += s->ref;
mstats.alloc += s->ref*s->elemsize;
}
}
// Aggregate by size class.
smallfree = 0;
mstats.nfree = runtime·mheap.nlargefree;
for(i = 0; i < nelem(mstats.by_size); i++) {
mstats.nfree += runtime·mheap.nsmallfree[i];
mstats.by_size[i].nfree = runtime·mheap.nsmallfree[i];
mstats.by_size[i].nmalloc += runtime·mheap.nsmallfree[i];
smallfree += runtime·mheap.nsmallfree[i] * runtime·class_to_size[i];
}
mstats.nmalloc += mstats.nfree;
// Calculate derived stats.
mstats.total_alloc = mstats.alloc + runtime·mheap.largefree + smallfree;
mstats.heap_alloc = mstats.alloc;
mstats.heap_objects = mstats.nmalloc - mstats.nfree;
}
// Structure of arguments passed to function gc().
// This allows the arguments to be passed via runtime·mcall.
struct gc_args
{
int64 start_time; // start time of GC in ns (just before stoptheworld)
bool eagersweep;
};
static void gc(struct gc_args *args);
static void mgc(G *gp);
static int32
readgogc(void)
{
byte *p;
p = runtime·getenv("GOGC");
if(p == nil || p[0] == '\0')
return 100;
if(runtime·strcmp(p, (byte*)"off") == 0)
return -1;
return runtime·atoi(p);
}
// force = 1 - do GC regardless of current heap usage
// force = 2 - go GC and eager sweep
void
runtime·gc(int32 force)
{
struct gc_args a;
int32 i;
// The atomic operations are not atomic if the uint64s
// are not aligned on uint64 boundaries. This has been
// a problem in the past.
if((((uintptr)&work.empty) & 7) != 0)
runtime·throw("runtime: gc work buffer is misaligned");
if((((uintptr)&work.full) & 7) != 0)
runtime·throw("runtime: gc work buffer is misaligned");
// The gc is turned off (via enablegc) until
// the bootstrap has completed.
// Also, malloc gets called in the guts
// of a number of libraries that might be
// holding locks. To avoid priority inversion
// problems, don't bother trying to run gc
// while holding a lock. The next mallocgc
// without a lock will do the gc instead.
if(!mstats.enablegc || g == m->g0 || m->locks > 0 || runtime·panicking)
return;
if(gcpercent == GcpercentUnknown) { // first time through
runtime·lock(&runtime·mheap);
if(gcpercent == GcpercentUnknown)
gcpercent = readgogc();
runtime·unlock(&runtime·mheap);
}
if(gcpercent < 0)
return;
runtime·semacquire(&runtime·worldsema, false);
if(force==0 && mstats.heap_alloc < mstats.next_gc) {
// typically threads which lost the race to grab
// worldsema exit here when gc is done.
runtime·semrelease(&runtime·worldsema);
return;
}
// Ok, we're doing it! Stop everybody else
a.start_time = runtime·nanotime();
a.eagersweep = force >= 2;
m->gcing = 1;
runtime·stoptheworld();
clearpools();
// Run gc on the g0 stack. We do this so that the g stack
// we're currently running on will no longer change. Cuts
// the root set down a bit (g0 stacks are not scanned, and
// we don't need to scan gc's internal state). Also an
// enabler for copyable stacks.
for(i = 0; i < (runtime·debug.gctrace > 1 ? 2 : 1); i++) {
if(i > 0)
a.start_time = runtime·nanotime();
// switch to g0, call gc(&a), then switch back
g->param = &a;
g->status = Gwaiting;
g->waitreason = "garbage collection";
runtime·mcall(mgc);
}
// all done
m->gcing = 0;
m->locks++;
runtime·semrelease(&runtime·worldsema);
runtime·starttheworld();
m->locks--;
// now that gc is done, kick off finalizer thread if needed
if(!ConcurrentSweep) {
// give the queued finalizers, if any, a chance to run
runtime·gosched();
}
}
static void
mgc(G *gp)
{
gc(gp->param);
gp->param = nil;
gp->status = Grunning;
runtime·gogo(&gp->sched);
}
static void
gc(struct gc_args *args)
{
int64 t0, t1, t2, t3, t4;
uint64 heap0, heap1, obj, ninstr;
GCStats stats;
uint32 i;
Eface eface;
if(runtime·debug.allocfreetrace)
runtime·tracegc();
m->traceback = 2;
t0 = args->start_time;
work.tstart = args->start_time;
if(CollectStats)
runtime·memclr((byte*)&gcstats, sizeof(gcstats));
m->locks++; // disable gc during mallocs in parforalloc
if(work.markfor == nil)
work.markfor = runtime·parforalloc(MaxGcproc);
m->locks--;
if(itabtype == nil) {
// get C pointer to the Go type "itab"
runtime·gc_itab_ptr(&eface);
itabtype = ((PtrType*)eface.type)->elem;
}
t1 = 0;
if(runtime·debug.gctrace)
t1 = runtime·nanotime();
// Sweep what is not sweeped by bgsweep.
while(runtime·sweepone() != -1)
gcstats.npausesweep++;
work.nwait = 0;
work.ndone = 0;
work.nproc = runtime·gcprocs();
runtime·parforsetup(work.markfor, work.nproc, RootCount + runtime·allglen, nil, false, markroot);
if(work.nproc > 1) {
runtime·noteclear(&work.alldone);
runtime·helpgc(work.nproc);
}
t2 = 0;
if(runtime·debug.gctrace)
t2 = runtime·nanotime();
gchelperstart();
runtime·parfordo(work.markfor);
scanblock(nil, true);
t3 = 0;
if(runtime·debug.gctrace)
t3 = runtime·nanotime();
bufferList[m->helpgc].busy = 0;
if(work.nproc > 1)
runtime·notesleep(&work.alldone);
cachestats();
// next_gc calculation is tricky with concurrent sweep since we don't know size of live heap
// estimate what was live heap size after previous GC (for tracing only)
heap0 = mstats.next_gc*100/(gcpercent+100);
// conservatively set next_gc to high value assuming that everything is live
// concurrent/lazy sweep will reduce this number while discovering new garbage
mstats.next_gc = mstats.heap_alloc+mstats.heap_alloc*gcpercent/100;
t4 = runtime·nanotime();
mstats.last_gc = runtime·unixnanotime(); // must be Unix time to make sense to user
mstats.pause_ns[mstats.numgc%nelem(mstats.pause_ns)] = t4 - t0;
mstats.pause_total_ns += t4 - t0;
mstats.numgc++;
if(mstats.debuggc)
runtime·printf("pause %D\n", t4-t0);
if(runtime·debug.gctrace) {
heap1 = mstats.heap_alloc;
runtime·updatememstats(&stats);
if(heap1 != mstats.heap_alloc) {
runtime·printf("runtime: mstats skew: heap=%D/%D\n", heap1, mstats.heap_alloc);
runtime·throw("mstats skew");
}
obj = mstats.nmalloc - mstats.nfree;
stats.nprocyield += work.markfor->nprocyield;
stats.nosyield += work.markfor->nosyield;
stats.nsleep += work.markfor->nsleep;
runtime·printf("gc%d(%d): %D+%D+%D+%D us, %D -> %D MB, %D (%D-%D) objects,"
" %d/%d/%d sweeps,"
" %D(%D) handoff, %D(%D) steal, %D/%D/%D yields\n",
mstats.numgc, work.nproc, (t1-t0)/1000, (t2-t1)/1000, (t3-t2)/1000, (t4-t3)/1000,
heap0>>20, heap1>>20, obj,
mstats.nmalloc, mstats.nfree,
sweep.nspan, gcstats.nbgsweep, gcstats.npausesweep,
stats.nhandoff, stats.nhandoffcnt,
work.markfor->nsteal, work.markfor->nstealcnt,
stats.nprocyield, stats.nosyield, stats.nsleep);
gcstats.nbgsweep = gcstats.npausesweep = 0;
if(CollectStats) {
runtime·printf("scan: %D bytes, %D objects, %D untyped, %D types from MSpan\n",
gcstats.nbytes, gcstats.obj.cnt, gcstats.obj.notype, gcstats.obj.typelookup);
if(gcstats.ptr.cnt != 0)
runtime·printf("avg ptrbufsize: %D (%D/%D)\n",
gcstats.ptr.sum/gcstats.ptr.cnt, gcstats.ptr.sum, gcstats.ptr.cnt);
if(gcstats.obj.cnt != 0)
runtime·printf("avg nobj: %D (%D/%D)\n",
gcstats.obj.sum/gcstats.obj.cnt, gcstats.obj.sum, gcstats.obj.cnt);
runtime·printf("rescans: %D, %D bytes\n", gcstats.rescan, gcstats.rescanbytes);
runtime·printf("instruction counts:\n");
ninstr = 0;
for(i=0; i<nelem(gcstats.instr); i++) {
runtime·printf("\t%d:\t%D\n", i, gcstats.instr[i]);
ninstr += gcstats.instr[i];
}
runtime·printf("\ttotal:\t%D\n", ninstr);
runtime·printf("putempty: %D, getfull: %D\n", gcstats.putempty, gcstats.getfull);
runtime·printf("markonly base lookup: bit %D word %D span %D\n", gcstats.markonly.foundbit, gcstats.markonly.foundword, gcstats.markonly.foundspan);
runtime·printf("flushptrbuf base lookup: bit %D word %D span %D\n", gcstats.flushptrbuf.foundbit, gcstats.flushptrbuf.foundword, gcstats.flushptrbuf.foundspan);
}
}
// We cache current runtime·mheap.allspans array in sweep.spans,
// because the former can be resized and freed.
// Otherwise we would need to take heap lock every time
// we want to convert span index to span pointer.
// Free the old cached array if necessary.
if(sweep.spans && sweep.spans != runtime·mheap.allspans)
runtime·SysFree(sweep.spans, sweep.nspan*sizeof(sweep.spans[0]), &mstats.other_sys);
// Cache the current array.
runtime·mheap.sweepspans = runtime·mheap.allspans;
runtime·mheap.sweepgen += 2;
runtime·mheap.sweepdone = false;
sweep.spans = runtime·mheap.allspans;
sweep.nspan = runtime·mheap.nspan;
sweep.spanidx = 0;
// Temporary disable concurrent sweep, because we see failures on builders.
if(ConcurrentSweep && !args->eagersweep) {
runtime·lock(&gclock);
if(sweep.g == nil)
sweep.g = runtime·newproc1(&bgsweepv, nil, 0, 0, runtime·gc);
else if(sweep.parked) {
sweep.parked = false;
runtime·ready(sweep.g);
}
runtime·unlock(&gclock);
} else {
// Sweep all spans eagerly.
while(runtime·sweepone() != -1)
gcstats.npausesweep++;
}
// Shrink a stack if not much of it is being used.
// TODO: do in a parfor
for(i = 0; i < runtime·allglen; i++)
runtime·shrinkstack(runtime·allg[i]);
runtime·MProf_GC();
m->traceback = 0;
}
extern uintptr runtime·sizeof_C_MStats;
void
runtime·ReadMemStats(MStats *stats)
{
// Have to acquire worldsema to stop the world,
// because stoptheworld can only be used by
// one goroutine at a time, and there might be
// a pending garbage collection already calling it.
runtime·semacquire(&runtime·worldsema, false);
m->gcing = 1;
runtime·stoptheworld();
runtime·updatememstats(nil);
// Size of the trailing by_size array differs between Go and C,
// NumSizeClasses was changed, but we can not change Go struct because of backward compatibility.
runtime·memcopy(runtime·sizeof_C_MStats, stats, &mstats);
m->gcing = 0;
m->locks++;
runtime·semrelease(&runtime·worldsema);
runtime·starttheworld();
m->locks--;
}
void
runtime∕debug·readGCStats(Slice *pauses)
{
uint64 *p;
uint32 i, n;
// Calling code in runtime/debug should make the slice large enough.
if(pauses->cap < nelem(mstats.pause_ns)+3)
runtime·throw("runtime: short slice passed to readGCStats");
// Pass back: pauses, last gc (absolute time), number of gc, total pause ns.
p = (uint64*)pauses->array;
runtime·lock(&runtime·mheap);
n = mstats.numgc;
if(n > nelem(mstats.pause_ns))
n = nelem(mstats.pause_ns);
// The pause buffer is circular. The most recent pause is at
// pause_ns[(numgc-1)%nelem(pause_ns)], and then backward
// from there to go back farther in time. We deliver the times
// most recent first (in p[0]).
for(i=0; i<n; i++)
p[i] = mstats.pause_ns[(mstats.numgc-1-i)%nelem(mstats.pause_ns)];
p[n] = mstats.last_gc;
p[n+1] = mstats.numgc;
p[n+2] = mstats.pause_total_ns;
runtime·unlock(&runtime·mheap);
pauses->len = n+3;
}
int32
runtime·setgcpercent(int32 in) {
int32 out;
runtime·lock(&runtime·mheap);
if(gcpercent == GcpercentUnknown)
gcpercent = readgogc();
out = gcpercent;
if(in < 0)
in = -1;
gcpercent = in;
runtime·unlock(&runtime·mheap);
return out;
}
static void
gchelperstart(void)
{
if(m->helpgc < 0 || m->helpgc >= MaxGcproc)
runtime·throw("gchelperstart: bad m->helpgc");
if(runtime·xchg(&bufferList[m->helpgc].busy, 1))
runtime·throw("gchelperstart: already busy");
if(g != m->g0)
runtime·throw("gchelper not running on g0 stack");
}
static void
runfinq(void)
{
Finalizer *f;
FinBlock *fb, *next;
byte *frame;
uint32 framesz, framecap, i;
Eface *ef, ef1;
// This function blocks for long periods of time, and because it is written in C
// we have no liveness information. Zero everything so that uninitialized pointers
// do not cause memory leaks.
f = nil;
fb = nil;
next = nil;
frame = nil;
framecap = 0;
framesz = 0;
i = 0;
ef = nil;
ef1.type = nil;
ef1.data = nil;
// force flush to memory
USED(&f);
USED(&fb);
USED(&next);
USED(&framesz);
USED(&i);
USED(&ef);
USED(&ef1);
for(;;) {
runtime·lock(&finlock);
fb = finq;
finq = nil;
if(fb == nil) {
runtime·fingwait = true;
g->isbackground = true;
runtime·parkunlock(&finlock, "finalizer wait");
g->isbackground = false;
continue;
}
runtime·unlock(&finlock);
if(raceenabled)
runtime·racefingo();
for(; fb; fb=next) {
next = fb->next;
for(i=0; i<fb->cnt; i++) {
f = &fb->fin[i];
framesz = sizeof(Eface) + f->nret;
if(framecap < framesz) {
runtime·free(frame);
// The frame does not contain pointers interesting for GC,
// all not yet finalized objects are stored in finq.
// If we do not mark it as FlagNoScan,
// the last finalized object is not collected.
frame = runtime·mallocgc(framesz, 0, FlagNoScan|FlagNoInvokeGC);
framecap = framesz;
}
if(f->fint == nil)
runtime·throw("missing type in runfinq");
if(f->fint->kind == KindPtr) {
// direct use of pointer
*(void**)frame = f->arg;
} else if(((InterfaceType*)f->fint)->mhdr.len == 0) {
// convert to empty interface
ef = (Eface*)frame;
ef->type = f->ot;
ef->data = f->arg;
} else {
// convert to interface with methods, via empty interface.
ef1.type = f->ot;
ef1.data = f->arg;
if(!runtime·ifaceE2I2((InterfaceType*)f->fint, ef1, (Iface*)frame))
runtime·throw("invalid type conversion in runfinq");
}
reflect·call(f->fn, frame, framesz, framesz);
f->fn = nil;
f->arg = nil;
f->ot = nil;
}
fb->cnt = 0;
runtime·lock(&finlock);
fb->next = finc;
finc = fb;
runtime·unlock(&finlock);
}
// Zero everything that's dead, to avoid memory leaks.
// See comment at top of function.
f = nil;
fb = nil;
next = nil;
i = 0;
ef = nil;
ef1.type = nil;
ef1.data = nil;
runtime·gc(1); // trigger another gc to clean up the finalized objects, if possible
}
}
void
runtime·createfing(void)
{
if(fing != nil)
return;
// Here we use gclock instead of finlock,
// because newproc1 can allocate, which can cause on-demand span sweep,
// which can queue finalizers, which would deadlock.
runtime·lock(&gclock);
if(fing == nil)
fing = runtime·newproc1(&runfinqv, nil, 0, 0, runtime·gc);
runtime·unlock(&gclock);
}
G*
runtime·wakefing(void)
{
G *res;
res = nil;
runtime·lock(&finlock);
if(runtime·fingwait && runtime·fingwake) {
runtime·fingwait = false;
runtime·fingwake = false;
res = fing;
}
runtime·unlock(&finlock);
return res;
}
void
runtime·marknogc(void *v)
{
uintptr *b, off, shift;
off = (uintptr*)v - (uintptr*)runtime·mheap.arena_start; // word offset
b = (uintptr*)runtime·mheap.arena_start - off/wordsPerBitmapWord - 1;
shift = off % wordsPerBitmapWord;
*b = (*b & ~(bitAllocated<<shift)) | bitBlockBoundary<<shift;
}
void
runtime·markscan(void *v)
{
uintptr *b, off, shift;
off = (uintptr*)v - (uintptr*)runtime·mheap.arena_start; // word offset
b = (uintptr*)runtime·mheap.arena_start - off/wordsPerBitmapWord - 1;
shift = off % wordsPerBitmapWord;
*b |= bitScan<<shift;
}
// mark the block at v as freed.
void
runtime·markfreed(void *v)
{
uintptr *b, off, shift;
if(0)
runtime·printf("markfreed %p\n", v);
if((byte*)v > (byte*)runtime·mheap.arena_used || (byte*)v < runtime·mheap.arena_start)
runtime·throw("markfreed: bad pointer");
off = (uintptr*)v - (uintptr*)runtime·mheap.arena_start; // word offset
b = (uintptr*)runtime·mheap.arena_start - off/wordsPerBitmapWord - 1;
shift = off % wordsPerBitmapWord;
*b = (*b & ~(bitMask<<shift)) | (bitAllocated<<shift);
}
// check that the block at v of size n is marked freed.
void
runtime·checkfreed(void *v, uintptr n)
{
uintptr *b, bits, off, shift;
if(!runtime·checking)
return;
if((byte*)v+n > (byte*)runtime·mheap.arena_used || (byte*)v < runtime·mheap.arena_start)
return; // not allocated, so okay
off = (uintptr*)v - (uintptr*)runtime·mheap.arena_start; // word offset
b = (uintptr*)runtime·mheap.arena_start - off/wordsPerBitmapWord - 1;
shift = off % wordsPerBitmapWord;
bits = *b>>shift;
if((bits & bitAllocated) != 0) {
runtime·printf("checkfreed %p+%p: off=%p have=%p\n",
v, n, off, bits & bitMask);
runtime·throw("checkfreed: not freed");
}
}
// mark the span of memory at v as having n blocks of the given size.
// if leftover is true, there is left over space at the end of the span.
void
runtime·markspan(void *v, uintptr size, uintptr n, bool leftover)
{
uintptr *b, *b0, off, shift, i, x;
byte *p;
if((byte*)v+size*n > (byte*)runtime·mheap.arena_used || (byte*)v < runtime·mheap.arena_start)
runtime·throw("markspan: bad pointer");
if(runtime·checking) {
// bits should be all zero at the start
off = (byte*)v + size - runtime·mheap.arena_start;
b = (uintptr*)(runtime·mheap.arena_start - off/wordsPerBitmapWord);
for(i = 0; i < size/PtrSize/wordsPerBitmapWord; i++) {
if(b[i] != 0)
runtime·throw("markspan: span bits not zero");
}
}
p = v;
if(leftover) // mark a boundary just past end of last block too
n++;
b0 = nil;
x = 0;
for(; n-- > 0; p += size) {
// Okay to use non-atomic ops here, because we control
// the entire span, and each bitmap word has bits for only
// one span, so no other goroutines are changing these
// bitmap words.
off = (uintptr*)p - (uintptr*)runtime·mheap.arena_start; // word offset
b = (uintptr*)runtime·mheap.arena_start - off/wordsPerBitmapWord - 1;
shift = off % wordsPerBitmapWord;
if(b0 != b) {
if(b0 != nil)
*b0 = x;
b0 = b;
x = 0;
}
x |= bitAllocated<<shift;
}
*b0 = x;
}
// unmark the span of memory at v of length n bytes.
void
runtime·unmarkspan(void *v, uintptr n)
{
uintptr *p, *b, off;
if((byte*)v+n > (byte*)runtime·mheap.arena_used || (byte*)v < runtime·mheap.arena_start)
runtime·throw("markspan: bad pointer");
p = v;
off = p - (uintptr*)runtime·mheap.arena_start; // word offset
if(off % wordsPerBitmapWord != 0)
runtime·throw("markspan: unaligned pointer");
b = (uintptr*)runtime·mheap.arena_start - off/wordsPerBitmapWord - 1;
n /= PtrSize;
if(n%wordsPerBitmapWord != 0)
runtime·throw("unmarkspan: unaligned length");
// Okay to use non-atomic ops here, because we control
// the entire span, and each bitmap word has bits for only
// one span, so no other goroutines are changing these
// bitmap words.
n /= wordsPerBitmapWord;
while(n-- > 0)
*b-- = 0;
}
void
runtime·MHeap_MapBits(MHeap *h)
{
// Caller has added extra mappings to the arena.
// Add extra mappings of bitmap words as needed.
// We allocate extra bitmap pieces in chunks of bitmapChunk.
enum {
bitmapChunk = 8192
};
uintptr n;
n = (h->arena_used - h->arena_start) / wordsPerBitmapWord;
n = ROUND(n, bitmapChunk);
n = ROUND(n, PhysPageSize);
if(h->bitmap_mapped >= n)
return;
runtime·SysMap(h->arena_start - n, n - h->bitmap_mapped, h->arena_reserved, &mstats.gc_sys);
h->bitmap_mapped = n;
}
| {
"content_hash": "93afebd393a46c6b088a758630b073c7",
"timestamp": "",
"source": "github",
"line_count": 2888,
"max_line_length": 163,
"avg_line_length": 27.01662049861496,
"alnum_prop": 0.6456090433712703,
"repo_name": "h8liu/golang",
"id": "e51ce24ff6b3ce30f350dd2d7f5fcdb4dbc902da",
"size": "78445",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/pkg/runtime/mgc0.c",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "662606"
},
{
"name": "Awk",
"bytes": "3851"
},
{
"name": "C",
"bytes": "4744078"
},
{
"name": "C++",
"bytes": "141121"
},
{
"name": "CSS",
"bytes": "3120"
},
{
"name": "Emacs Lisp",
"bytes": "50460"
},
{
"name": "Go",
"bytes": "17135166"
},
{
"name": "JavaScript",
"bytes": "13246"
},
{
"name": "Objective-C",
"bytes": "21738"
},
{
"name": "Perl",
"bytes": "189380"
},
{
"name": "Python",
"bytes": "121128"
},
{
"name": "Shell",
"bytes": "102098"
},
{
"name": "VimL",
"bytes": "28180"
}
],
"symlink_target": ""
} |
function toggleTodo(todoId, done) {
chrome.storage.local.get(todoId, function(result) {
result[todoId]['done'] = done;
chrome.storage.local.set(result);
});
}
function todoCheckHanlder() {
var $todo = $(this).parent();
$todo.toggleClass('checked', this.checked);
toggleTodo($todo.attr('id'), this.checked);
}
// chrome.storage.local.get($todo.attr('id'), function(result) {
// var todo = result[$todo.attr('id')];
// todo.done = isChecked;
// });
function clearDoneTodos() {
$('.todo.checked').each(function() {
removeTodo($(this));
});
}
function addTodoElement(todo) {
var checked = todo.done ? 'checked' : '';
var $list = $('.todo-list');
var $content = $('.content');
var todoHtml = ''
+ '<li class="todo ' + checked + '" id="' + todo.id + '">'
+ ' <a href="###" class="action-remove">删除</a>'
+ ' <input type="checkbox" ' + checked + ' />' + todo.title
+ '</li>';
$list.append(todoHtml);
$content.stop().animate({
scrollTop: $list.prop('scrollHeight')
}, 300);
}
function saveTodo(title, callback) {
var todo = { title: title, done: false };
todo.id = 'todo-' + new Date().getTime();
var record = {};
record[todo.id] = todo;
chrome.storage.local.set(record);
}
function removeTodoHandler() {
removeTodo($(this).parents('.todo'));
}
function removeTodo($todo) {
$todo.fadeOut($todo.remove);
chrome.storage.local.remove($todo.attr('id'), function() {
$todo.remove();
});
}
function saveTodo(todo) {
var object = {};
object[todo.id] = todo;
chrome.storage.local.set(object);
}
function addTodoHandler(event) {
if (event.keyCode != 13) return;
var todo = {
id: 'todo-' + new Date().getTime(),
title: this.value,
done: false
};
saveTodo(todo);
addTodoElement(todo);
this.value = '';
}
function loadTodos() {
chrome.storage.local.get(null, function(todos) {
for (var id in todos) {
addTodoElement(todos[id]);
}
});
}
$(function() {
$('#todo-input').on('keypress', addTodoHandler);
$(document).on('change', '.todo :checkbox', todoCheckHanlder);
$(document).on('click', '.action-remove', removeTodoHandler);
$('.action-clear').on('click', clearDoneTodos);
loadTodos();
});
| {
"content_hash": "a28e25e583cd32b9bad1c7a8081b85db",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 66,
"avg_line_length": 22.237623762376238,
"alnum_prop": 0.6055209260908282,
"repo_name": "GDG-Xian/chrome-todo-app",
"id": "5f76cdaa7eca5689f1eedd5e1d1b80095d3fe55f",
"size": "2250",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "js/main.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "918"
},
{
"name": "HTML",
"bytes": "708"
},
{
"name": "JavaScript",
"bytes": "2925"
}
],
"symlink_target": ""
} |
import React from 'react';
const renderMessage = message => {
if (!message) {
return null;
}
if (typeof(message) === 'string') {
return message;
}
let error = '';
if (typeof(message) === 'object') {
Object.keys(message).forEach(key => {
message[key].forEach(line => {
error += line + '\n';
})
})
}
return error;
};
const Error = ({ message }) =>
<div style={{
width: '100%',
display: 'flex',
justifyContent: 'center',
}}>
<p style={{ 'color': 'red' }}>{renderMessage(message)}</p>
</div>;
export default Error; | {
"content_hash": "47bb34e744d3fc3cfd41cb17713361a1",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 62,
"avg_line_length": 17.38235294117647,
"alnum_prop": 0.5346869712351946,
"repo_name": "merrettr/school-ui",
"id": "0820c46fb6bd330d6cff72b3cd50412cffedd339",
"size": "591",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/components/Error.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "152"
},
{
"name": "HTML",
"bytes": "355"
},
{
"name": "JavaScript",
"bytes": "92891"
}
],
"symlink_target": ""
} |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package ht.edu.fds.mbds.android.bibliotheque.service;
import ht.edu.fds.mbds.android.bibliotheque.Pret;
import ht.edu.fds.mbds.android.bibliotheque.bean.AbstractFacade;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
/**
*
* @author edou
*/
@Stateless
@Path("ht.edu.fds.mbds.android.bibliotheque.pret")
public class PretFacadeREST extends AbstractFacade<Pret> {
@PersistenceContext(unitName = "BibliothequePU")
private EntityManager em;
public PretFacadeREST() {
super(Pret.class);
}
@POST
@Override
@Consumes({"application/xml", "application/json"})
public void create(Pret entity) {
super.create(entity);
}
@PUT
@Override
@Consumes({"application/xml", "application/json"})
public void edit(Pret entity) {
super.edit(entity);
}
@DELETE
@Path("{id}")
public void remove(@PathParam("id") Long id) {
super.remove(super.find(id));
}
@GET
@Path("{id}")
@Produces({"application/xml", "application/json"})
public Pret find(@PathParam("id") Long id) {
return super.find(id);
}
@GET
@Override
@Produces({"application/xml", "application/json"})
public List<Pret> findAll() {
return super.findAll();
}
@GET
@Path("{from}/{to}")
@Produces({"application/xml", "application/json"})
public List<Pret> findRange(@PathParam("from") Integer from, @PathParam("to") Integer to) {
return super.findRange(new int[]{from, to});
}
@GET
@Path("count")
@Produces("text/plain")
public String countREST() {
return String.valueOf(super.count());
}
@Override
protected EntityManager getEntityManager() {
return em;
}
}
| {
"content_hash": "25486c6381da9254e625db46a24f9bdf",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 95,
"avg_line_length": 24.1123595505618,
"alnum_prop": 0.6542404473438956,
"repo_name": "eamosse/mbds_haiti_android_nfc",
"id": "e4d47339f3ba15eeb4ed8227344d556040c40603",
"size": "2146",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/java/ht/edu/fds/mbds/android/bibliotheque/service/PretFacadeREST.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "101533"
},
{
"name": "JavaScript",
"bytes": "398153"
}
],
"symlink_target": ""
} |
var _ = require("lodash");
var path = require("path");
var Bacon = require("baconjs");
var nodegit = require("nodegit");
var Logger = require("../logger.js");
var AppConfig = require("../models/app_configuration.js");
var Domain = require("../models/domain.js");
var Git = require("../models/git.js")(path.resolve("."));
var domain = module.exports;
var list = domain.list = function(api, params) {
var alias = params.options.alias;
var s_appData = AppConfig.getAppData(alias);
var s_domain = s_appData.flatMap(function(appData) {
return Domain.list(api, appData.app_id, appData.org_id);
});
s_domain.onValue(function(domains) {
Logger.println(_.map(domains, 'fqdn').join('\n'));
});
s_domain.onError(Logger.error);
};
var add = domain.add = function(api, params) {
var fqdn = params.args[0];
var alias = params.options.alias;
var s_appData = AppConfig.getAppData(alias);
var s_domain = s_appData.flatMap(function(appData) {
return Domain.create(api, fqdn, appData.app_id, appData.org_id);
});
s_domain.onValue(function() {
Logger.println("Your domain has been successfully saved");
});
s_domain.onError(Logger.error);
};
var rm = domain.rm = function(api, params) {
var fqdn = params.args[0];
var alias = params.options.alias;
var s_appData = AppConfig.getAppData(alias);
var s_domain = s_appData.flatMap(function(appData) {
return Domain.remove(api, fqdn, appData.app_id, appData.org_id);
});
s_domain.onValue(function() {
Logger.println("Your domain has been successfully removed");
});
s_domain.onError(Logger.error);
};
| {
"content_hash": "5dfa09f59af64063c2d22280740bf87c",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 68,
"avg_line_length": 26.016129032258064,
"alnum_prop": 0.6732796032238065,
"repo_name": "BlackYoup/clever-tools",
"id": "a2cfbc53a51128f8ea2867ce62b2e90eb35d47ca",
"size": "1613",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/commands/domain.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "135070"
},
{
"name": "Shell",
"bytes": "2396"
}
],
"symlink_target": ""
} |
package fr.paris.lutece.util.url;
import org.apache.commons.lang3.StringUtils;
// Java Util
import java.util.ArrayList;
import java.util.List;
/**
* This class provides utility methods for the generation of Url String
*/
public class UrlItem
{
// //////////////////////////////////////////////////////////////////////////
// Constants
private static final String ANCHOR_DELIMITER = "#";
/** the root of the url. */
private String _strRoot;
/** the list of parameters. */
private List<UrlParameterItem> _listParameters = new ArrayList<>( );
private String _strAnchor;
/**
* Constructs an url with no parameters.
*
* @param strRoot
* The url's root.
*/
public UrlItem( String strRoot )
{
_strRoot = strRoot;
}
/**
* Add a Parameter to the url.
*
* @param strName
* The name of the parameter.
* @param strValue
* The value of the parameter.
*/
public void addParameter( String strName, String strValue )
{
_listParameters.add( new UrlParameterItem( strName, strValue ) );
}
/**
* Add a Parameter to the url.
*
* @param strName
* The name of the parameter.
* @param nValue
* The value of the parameter.
*/
public void addParameter( String strName, int nValue )
{
_listParameters.add( new UrlParameterItem( strName, nValue ) );
}
/**
* Return the url string.
*
* @return String The url string.
*/
public String getUrl( )
{
StringBuilder urlCode = new StringBuilder( _strRoot );
boolean bFirst = ( _strRoot.indexOf( '?' ) == -1 );
for ( UrlParameterItem parameter : _listParameters )
{
// Add a ? or & to the root url if it does already contains one
urlCode.append( parameter.getCode( bFirst ) );
bFirst = false;
}
if ( ( getAnchor( ) != null ) && !getAnchor( ).equals( StringUtils.EMPTY ) )
{
urlCode.append( ANCHOR_DELIMITER );
urlCode.append( getAnchor( ) );
}
return urlCode.toString( );
}
/**
* Return the url string.
*
* @return String The url string with entity code.
*/
public String getUrlWithEntity( )
{
StringBuilder urlCode = new StringBuilder( _strRoot );
boolean bFirst = ( _strRoot.indexOf( '?' ) == -1 );
for ( UrlParameterItem parameter : _listParameters )
{
// Add a ? or & to the root url if it does already contains one
urlCode.append( parameter.getCodeEntity( bFirst ) );
bFirst = false;
}
if ( StringUtils.isNotEmpty( getAnchor( ) ) )
{
urlCode.append( ANCHOR_DELIMITER + getAnchor( ) );
}
return urlCode.toString( );
}
/**
* Get the anchor
*
* @return the _srtAnchor
*/
public String getAnchor( )
{
return _strAnchor;
}
/**
* Set the anchor
*
* @param strAnchorName
* the _srtAnchor to set
*/
public void setAnchor( String strAnchorName )
{
_strAnchor = strAnchorName;
}
/**
* {@inheritDoc}
*/
@Override
public String toString( )
{
return getUrl( );
}
}
| {
"content_hash": "2296765187daec161ead59f0601a3c38",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 84,
"avg_line_length": 23.6,
"alnum_prop": 0.5306838106370544,
"repo_name": "lutece-platform/lutece-core",
"id": "19c690272abc13fd7b6ee606d1e69d8d1dd1d927",
"size": "5001",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/java/fr/paris/lutece/util/url/UrlItem.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "555349"
},
{
"name": "HTML",
"bytes": "1151441"
},
{
"name": "Java",
"bytes": "5819396"
},
{
"name": "JavaScript",
"bytes": "1631308"
},
{
"name": "XSLT",
"bytes": "31757"
}
],
"symlink_target": ""
} |
module Main where
import System.Exit
import qualified SuffixStructures.SuffixArray as SA
import qualified SuffixStructures.SuffixTree as ST
import qualified Data.List as List
import Test.QuickCheck
test_suffixarray :: IO ()
test_suffixarray = quickCheckWith stdArgs { maxSuccess = 5000 } test_dc3
where
test_dc3 :: String -> Bool
test_dc3 s = invalid || ((SA.construct s) == (SA.construct_naive s))
where
invalid :: Bool
invalid = SA.nul `elem` s
test_suffixtree :: IO ()
test_suffixtree = quickCheckWith stdArgs { maxSuccess = 500 } test_stree_substr_query
where
test_stree_substr_query :: String -> Bool
test_stree_substr_query s = invalid || all_substrings_present
where
invalid :: Bool
invalid = SA.nul `elem` s
all_substrings_present :: Bool
all_substrings_present = all (ST.contains_substring stree) all_substrings
all_substrings :: [String]
all_substrings = List.nub . concatMap List.inits . List.tails $ s
stree :: ST.SuffixTree
stree = ST.construct s
main :: IO ()
main = do
test_suffixarray
test_suffixtree
exitSuccess
| {
"content_hash": "faee918181a19d0325f4b623867af33c",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 85,
"avg_line_length": 25.74418604651163,
"alnum_prop": 0.7055103884372177,
"repo_name": "bgwines/suffix-tree",
"id": "53487e372d06c16c8458637a20763b5ce417e908",
"size": "1107",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Tests/test-suffix.hs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Haskell",
"bytes": "28925"
}
],
"symlink_target": ""
} |
<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if IE 9]> <html class="no-js ie9" lang="en"> <![endif]-->
<!--[if gt IE 9]><!-->
<html class="no-js" lang="en">
<!--<![endif]-->
<head>
<meta charset="utf-8">
<title>Conker Tree Science: Leaf Watch — Error</title>
<meta name="description"
content="Help scientists at the Universities of Bristol and Hull monitor what's happening with the UK's conker trees as they are attacked by a species of non-native moth.">
<meta name="author" content="University of Bristol">
<!-- Mobile viewport optimized: j.mp/bplateviewport -->
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="css/style.css">
<link rel="icon" type="image/png" href="images/favicon.png" />
</head>
<body class="overview">
<div id="container">
<div id="header">
<a id="logo" href="."><img src="images/logo.png"
alt="Conker Tree Science: Leaf Watch" width="256" height="98" />
</a>
<ul>
<li id="overview"><a href=".">Overview</a>
</li>
<li id="validate"><a href="validate">Help validate data</a>
</li>
<li id="results"><a href="results">Results</a>
</li>
<li id="blog"><a href="http://naturelocator.ilrt.bris.ac.uk/">Blog</a>
</li>
</ul>
</div>
<!-- /header -->
<div id="content">
<div id="main" role="main">
<h1 class="message">Sorry, something went wrong!</h1>
<div class="highlight">
<div class="inner">
<p>
An error occurred when processing your request. Please try again.
If you find this error re-occurring frequently please <a
href="mailto:conker-science@bristol.ac.uk">contact us</a>.
</p>
</div>
<!-- /inner -->
</div>
<!-- /highlight -->
</div>
<div id="sidebar">
<!-- /section -->
<div class="section">
<h2>See the results so far</h2>
<ul class="objects">
<li><a class="thumb" href="results"><img
src="images/map-thumb.png" alt="Map of data" width="80"
height="80" /> </a>
<p>Take a look at the results from 2011 so far.</p>
<p class="more">
<a href="results">See more</a>
</p></li>
</ul>
</div>
<!-- /section -->
</div>
<!-- /sidebar -->
</div>
<!-- /content -->
<div id="footer">
<ul>
<li><a href="http://naturelocator.ilrt.bristol.ac.uk"><img
src="images/logo-nature-locator.png" alt="Nature Locator"
width="165" height="39" />
</a>
</li>
<li><a href="http://www.jisc.ac.uk"><img
src="images/logo-jisc.png" alt="JISC" width="65" height="38" />
</a>
</li>
<li><a href="http://www.bristol.ac.uk"><img
src="images/logo-bristol.png" alt="University of Bristol"
width="108" height="33" />
</a>
</li>
<li><a href="http://www.hull.ac.uk"><img
src="images/logo-hull.png" alt="University of Hull" width="134"
height="33" />
</a>
</li>
</ul>
<p class="legal">
Copyright ©2011 University of Bristol.<br /> Funded by <a
href="http://www.jisc.ac.uk">JISC</a>. Built by <a
href="http://www.ilrt.bristol.ac.uk">ILRT</a>.
<a href="mailto:conker-science@bristol.ac.uk">Contact us</a>.
</p>
</div>
<!-- /footer -->
</div>
<!--! end of #container -->
<!-- JavaScript at the bottom for fast page loading -->
<script src="scripts/jquery-1.6.4.min.js"></script>
</body>
</html>
| {
"content_hash": "ede62f0b215a7fcf06bdc195a76d43fa",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 173,
"avg_line_length": 28.0703125,
"alnum_prop": 0.5733370442527136,
"repo_name": "ilrt/NatureLocator",
"id": "326c21d2097ba353764f2fdaa0566194162010ac",
"size": "3593",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "AppEngine/nature-locator-gaelyk/src/main/webapp/error.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Groovy",
"bytes": "37512"
},
{
"name": "Java",
"bytes": "10432"
},
{
"name": "JavaScript",
"bytes": "125677"
}
],
"symlink_target": ""
} |
@interface NSNumber (SZRound)
- (NSNumber *)sz_doRoundWithDigit:(NSUInteger)digit;
- (NSNumber *)sz_doCeilWithDigit:(NSUInteger)digit;
- (NSNumber *)sz_doFloorWithDigit:(NSUInteger)digit;
@end
| {
"content_hash": "bd643b3e5de3bca26d83858f6563b00f",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 52,
"avg_line_length": 27.857142857142858,
"alnum_prop": 0.764102564102564,
"repo_name": "chenshengzhi/SZCategories",
"id": "b83e2cc5b6ce2bdab90c4cef5ca383c976a7ec46",
"size": "374",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "SZCategories/Foundation/NSNumber/NSNumber+SZRound.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "160070"
},
{
"name": "Ruby",
"bytes": "5196"
}
],
"symlink_target": ""
} |
package com.codefollower.douyu.http.ssl;
import java.io.IOException;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
/**
* Default server socket factory. Doesn't do much except give us
* plain old server sockets.
*
* @author db@eng.sun.com
* @author Harish Prabandham
*/
public class DefaultServerSocketFactory implements ServerSocketFactory {
public DefaultServerSocketFactory() {
}
@Override
public ServerSocket createSocket (int port) throws IOException {
return new ServerSocket (port);
}
@Override
public ServerSocket createSocket (int port, int backlog)
throws IOException {
return new ServerSocket (port, backlog);
}
@Override
public ServerSocket createSocket (int port, int backlog,
InetAddress ifAddress) throws IOException {
return new ServerSocket (port, backlog, ifAddress);
}
@Override
public Socket acceptSocket(ServerSocket socket) throws IOException {
return socket.accept();
}
@Override
public void handshake(Socket sock) throws IOException {
// NOOP
}
}
| {
"content_hash": "b7a22a39ee488129963f51447d21c6c6",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 72,
"avg_line_length": 24.083333333333332,
"alnum_prop": 0.6920415224913494,
"repo_name": "codefollower/Open-Source-Research",
"id": "d97620b7f967a35ebcf24e27a230ffa817f1626d",
"size": "1969",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Douyu-0.7.1/douyu-http/src/main/java/com/codefollower/douyu/http/ssl/DefaultServerSocketFactory.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "146130"
},
{
"name": "C",
"bytes": "1175615"
},
{
"name": "C++",
"bytes": "52932465"
},
{
"name": "CSS",
"bytes": "13948"
},
{
"name": "D",
"bytes": "90195"
},
{
"name": "Java",
"bytes": "32377266"
},
{
"name": "JavaScript",
"bytes": "39651"
},
{
"name": "Objective-C",
"bytes": "18238"
},
{
"name": "Shell",
"bytes": "276979"
},
{
"name": "XSLT",
"bytes": "351083"
}
],
"symlink_target": ""
} |
The `<Errors />` component provides a handy way of displaying form errors for a given `model`.
```jsx
// in render...
<Control.text
type="email"
model="user.email"
validators={{ isEmail, isRequired }}
/>
<Errors
model="user.email"
messages={{
isRequired: 'Please provide an email address.',
isEmail: (val) => `${val} is not a valid email.`,
}}
/>
```
By default, `<Errors />` will display a `<div>` with each error message wrapped in a `<span>` as children:
```html
<div>
<span>foo@bar is not a valid email.</span>
<!-- ... other error messages -->
</div>
```
There are many configurable props that will let you control:
- when error messages should be shown
- custom error messages based on the model value
- the wrapper component (default: `<div>`)
- the message component (default: `<span>`)
# Prop Types
## `model="..."` (required)
_(String | Function)_: the string representation of the model path to show the errors for that model. A tracking function may be provided, as well.
### Notes
- If you want to display form-wide errors, just use the form model! For example, if you have a form-wide `passwordsMatch` validator on the `user` form, you can display an error message like so:
```jsx
<Errors
model="user"
messages={{
passwordsMatch: 'Passwords do not match.',
}}
/>
```
## `messages={{...}}`
_(Object)_: a plain object mapping where:
- the keys are error keys (such as `"required"`)
- the values are either strings or functions.
If the message value is a function, it will be called with the model value.
### Example
```jsx
<Errors
model="user.email"
messages={{
required: 'Please enter an email address.',
length: 'The email address is too long.',
invalid: (val) => `${val} is not a valid email address.',
}}
/>
```
### Notes
- The `messages` prop is a great place to keep custom error messages that can vary based on the location in the UI, instead of hardcoding error messages in validation fuctions.
- If a message is _not_ provided for an error key, the message will default to the key value in the control's `.errors` property.
- This means if you're using `actions.setErrors` or the `errors={{...}}` prop in `<Control>` or `<Field>` to set error messages, they will automatically be shown in `<Errors />`.
## `show={...}`
_(Any)_: The `show` prop determines when error messages should be shown, based on the model's field state (determined by the form reducer).
It can be a boolean, or a function, string, or object as a [Lodash iteratee](https://lodash.com/docs#iteratee).
### Examples
- `show={true}` will always show the errors if they exist
- `show={(field) => field.touched && !field.focus}` will show errors if the model's field is touched and not focused
- `show={{touched: true, focus: false}}` is the same as above
- `show="touched"` will show errors if the model's field is touched
### Notes
- For the greatest amount of control, use `show` as a function.
- Use `show` as a boolean if you want to calculate when an error should be shown based on external factors, such as form state.
## `wrapper={...}`
_(String | Function | Element)_: The `wrapper` component, which is the component that wraps all errors, can be configured using this prop. Default: `"div"`.
### Examples
- `wrapper="ul"` will wrap all errors in an `<ul>`
- `wrapper={(props) => <div className="errors">{props.children}</div>}` will render the specified functional component, with all the props from `<Errors>` and some computed props:
- `modelValue` - the current value of the `model`
- `fieldValue` - the current field state of the `model`
- `wrapper={CustomErrors}` will wrap all errors in a `<CustomErrors>` component, which will receive the same props as above.
## `component={...}`
_(String | Function | Element)_: The `component`, which is the component for each error message, can be configured using this prop. Default: `"span"`.
### Examples
- `component="li"` will wrap all errors in a `<li>`
- `component={(props) => <div className="error">{props.children}</div>}` will render the error message in the specified functional component, with these props:
- `modelValue` - the current value of the `model`
- `fieldValue` - the current field state of the `model`
- `children` - the error message (text).
- `component={CustomError}` will wrap the error in a `<CustomError>` component, which will receive the same props as above.
| {
"content_hash": "ebbaaadf7bfaca6e1c5a50480b53448b",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 193,
"avg_line_length": 37.8034188034188,
"alnum_prop": 0.6938729369206421,
"repo_name": "davidkpiano/redux-simple-form",
"id": "1de04748925b57a4c1879b864171bffc4a93ae79",
"size": "4460",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "docs/api/Errors.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "135704"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
Index Fungorum
#### Published in
null
#### Original name
Agaricus dealbatus Batsch, 1783
### Remarks
null | {
"content_hash": "5613b638a01f230978630ac891de956a",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 10.461538461538462,
"alnum_prop": 0.7132352941176471,
"repo_name": "mdoering/backbone",
"id": "58174b454e56dc9777ad6949ae8b71a4deb43174",
"size": "202",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Fungi/Basidiomycota/Agaricomycetes/Agaricales/Tricholomataceae/Clitocybe/Clitocybe rivulosa/Clitocybe rivulosa dealbata/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
- `v::instance(string $instanceName)`
Validates if the input is an instance of the given class or interface.
```php
v::instance('DateTime')->validate(new DateTime); //true
v::instance('Traversable')->validate(new ArrayObject); //true
```
Message template for this validator includes `{{instanceName}}`.
***
See also:
* [ObjectType](ObjectType.md)
| {
"content_hash": "2e714fd20eae3b8d1389f18c97e3b3b6",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 70,
"avg_line_length": 23.6,
"alnum_prop": 0.7146892655367232,
"repo_name": "zinovyev/Validation",
"id": "4a6318c123d56c3594cdc71f6bba1cdf43803c73",
"size": "366",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/Instance.md",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "PHP",
"bytes": "1085942"
}
],
"symlink_target": ""
} |
/*
* Knetik Platform API Documentation latest
* This is the spec for the Knetik API. Use this in conjunction with the documentation found at https://knetikcloud.com.
*
* OpenAPI spec version: latest
* Contact: support@knetik.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package com.knetikcloud.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.knetikcloud.model.ExpressionResource;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* Expressions are instructions for the rule engine to resolve certain values. For example instead of `user 1` it'd state `user provided by the event`. Full list and definitions available at GET /bre/expressions.
*/
@ApiModel(description = "Expressions are instructions for the rule engine to resolve certain values. For example instead of `user 1` it'd state `user provided by the event`. Full list and definitions available at GET /bre/expressions.")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-03-14T12:03:43.231-04:00")
public class ConfigLookupResource {
@JsonProperty("definition")
private String definition = null;
@JsonProperty("lookup_key")
private ExpressionResource lookupKey = null;
@JsonProperty("required_key_type")
private String requiredKeyType = null;
@JsonProperty("type")
private String type = null;
@JsonProperty("value_type")
private String valueType = null;
public ConfigLookupResource definition(String definition) {
this.definition = definition;
return this;
}
/**
* Get definition
* @return definition
**/
@ApiModelProperty(value = "")
public String getDefinition() {
return definition;
}
public void setDefinition(String definition) {
this.definition = definition;
}
public ConfigLookupResource lookupKey(ExpressionResource lookupKey) {
this.lookupKey = lookupKey;
return this;
}
/**
* Get lookupKey
* @return lookupKey
**/
@ApiModelProperty(value = "")
public ExpressionResource getLookupKey() {
return lookupKey;
}
public void setLookupKey(ExpressionResource lookupKey) {
this.lookupKey = lookupKey;
}
public ConfigLookupResource requiredKeyType(String requiredKeyType) {
this.requiredKeyType = requiredKeyType;
return this;
}
/**
* Get requiredKeyType
* @return requiredKeyType
**/
@ApiModelProperty(value = "")
public String getRequiredKeyType() {
return requiredKeyType;
}
public void setRequiredKeyType(String requiredKeyType) {
this.requiredKeyType = requiredKeyType;
}
public ConfigLookupResource type(String type) {
this.type = type;
return this;
}
/**
* Get type
* @return type
**/
@ApiModelProperty(value = "")
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public ConfigLookupResource valueType(String valueType) {
this.valueType = valueType;
return this;
}
/**
* Get valueType
* @return valueType
**/
@ApiModelProperty(value = "")
public String getValueType() {
return valueType;
}
public void setValueType(String valueType) {
this.valueType = valueType;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ConfigLookupResource configLookupResource = (ConfigLookupResource) o;
return Objects.equals(this.definition, configLookupResource.definition) &&
Objects.equals(this.lookupKey, configLookupResource.lookupKey) &&
Objects.equals(this.requiredKeyType, configLookupResource.requiredKeyType) &&
Objects.equals(this.type, configLookupResource.type) &&
Objects.equals(this.valueType, configLookupResource.valueType);
}
@Override
public int hashCode() {
return Objects.hash(definition, lookupKey, requiredKeyType, type, valueType);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ConfigLookupResource {\n");
sb.append(" definition: ").append(toIndentedString(definition)).append("\n");
sb.append(" lookupKey: ").append(toIndentedString(lookupKey)).append("\n");
sb.append(" requiredKeyType: ").append(toIndentedString(requiredKeyType)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" valueType: ").append(toIndentedString(valueType)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| {
"content_hash": "edbc9f2cf02f1fcd8bf636fafeaeda6f",
"timestamp": "",
"source": "github",
"line_count": 184,
"max_line_length": 236,
"avg_line_length": 28.206521739130434,
"alnum_prop": 0.7013487475915221,
"repo_name": "knetikmedia/knetikcloud-java-client",
"id": "0b5315ba0dba13f1645a77aee70ce4084a30aaf0",
"size": "5190",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/knetikcloud/model/ConfigLookupResource.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "4225052"
},
{
"name": "Scala",
"bytes": "1159"
},
{
"name": "Shell",
"bytes": "1664"
}
],
"symlink_target": ""
} |
"""The Keenetic Client class."""
from homeassistant.components.binary_sensor import (
BinarySensorDeviceClass,
BinarySensorEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from . import KeeneticRouter
from .const import DOMAIN, ROUTER
async def async_setup_entry(
hass: HomeAssistant, config_entry: ConfigEntry, async_add_entities
):
"""Set up device tracker for Keenetic NDMS2 component."""
router: KeeneticRouter = hass.data[DOMAIN][config_entry.entry_id][ROUTER]
async_add_entities([RouterOnlineBinarySensor(router)])
class RouterOnlineBinarySensor(BinarySensorEntity):
"""Representation router connection status."""
_attr_device_class = BinarySensorDeviceClass.CONNECTIVITY
_attr_should_poll = False
def __init__(self, router: KeeneticRouter) -> None:
"""Initialize the APCUPSd binary device."""
self._router = router
@property
def name(self):
"""Return the name of the online status sensor."""
return f"{self._router.name} Online"
@property
def unique_id(self) -> str:
"""Return a unique identifier for this device."""
return f"online_{self._router.config_entry.entry_id}"
@property
def is_on(self):
"""Return true if the UPS is online, else false."""
return self._router.available
@property
def device_info(self):
"""Return a client description for device registry."""
return self._router.device_info
async def async_added_to_hass(self):
"""Client entity created."""
self.async_on_remove(
async_dispatcher_connect(
self.hass,
self._router.signal_update,
self.async_write_ha_state,
)
)
| {
"content_hash": "d4ed342289335ede6e31458f43a52cf1",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 77,
"avg_line_length": 30.901639344262296,
"alnum_prop": 0.6689655172413793,
"repo_name": "home-assistant/home-assistant",
"id": "351f3f6687527ffd515d92abdfdfd2cf01779ee4",
"size": "1885",
"binary": false,
"copies": "1",
"ref": "refs/heads/dev",
"path": "homeassistant/components/keenetic_ndms2/binary_sensor.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "20557383"
},
{
"name": "Shell",
"bytes": "6671"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DawidPerdekLab4
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FormMain());
}
}
}
| {
"content_hash": "b29bb05dcc19dc8195ccceda0f040001",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 65,
"avg_line_length": 23.5,
"alnum_prop": 0.6170212765957447,
"repo_name": "superdyzio/PWR-Stuff",
"id": "6d3a54899fcb57c71bb85fcf75d2c0e2170e656c",
"size": "519",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Kredek/dawid_perdek/lab4/zad_lab/Program.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "17829"
},
{
"name": "Batchfile",
"bytes": "1042"
},
{
"name": "C",
"bytes": "2403055"
},
{
"name": "C#",
"bytes": "625528"
},
{
"name": "C++",
"bytes": "3066245"
},
{
"name": "CMake",
"bytes": "983251"
},
{
"name": "CSS",
"bytes": "218848"
},
{
"name": "Common Lisp",
"bytes": "378578"
},
{
"name": "HTML",
"bytes": "4999679"
},
{
"name": "Java",
"bytes": "475300"
},
{
"name": "JavaScript",
"bytes": "266296"
},
{
"name": "M",
"bytes": "2385"
},
{
"name": "M4",
"bytes": "3010"
},
{
"name": "Makefile",
"bytes": "3734730"
},
{
"name": "Matlab",
"bytes": "160418"
},
{
"name": "OCaml",
"bytes": "2021"
},
{
"name": "PHP",
"bytes": "10629"
},
{
"name": "Perl",
"bytes": "7551"
},
{
"name": "PowerShell",
"bytes": "31323"
},
{
"name": "Python",
"bytes": "607184"
},
{
"name": "QMake",
"bytes": "1211"
},
{
"name": "Scala",
"bytes": "4781"
},
{
"name": "Shell",
"bytes": "1550640"
},
{
"name": "Tcl",
"bytes": "4143"
},
{
"name": "q",
"bytes": "1050"
}
],
"symlink_target": ""
} |
author: robmyers
comments: false
date: 2004-11-17 05:55:15+00:00
layout: post
slug: remix-reading-2
title: Remix Reading
wordpress_id: 247
categories:
- Free Culture
---
The Remix Reading site is shaping up very well. They've got a domain but it's just a placeholder with the flyer on at the moment. Do download the flyer, though.
[http://www.remixreading.org/](http://www.remixreading.org/)
| {
"content_hash": "1060c8dc58d2d9c417741f5398ff0b73",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 162,
"avg_line_length": 22.444444444444443,
"alnum_prop": 0.7351485148514851,
"repo_name": "robmyers/robmyers.org",
"id": "18c722f09142cabae2311d7ebb64c6bde9880b18",
"size": "408",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_posts/2004-11-17-remix-reading-2.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "18921"
},
{
"name": "HTML",
"bytes": "14981"
},
{
"name": "JavaScript",
"bytes": "62388"
},
{
"name": "PHP",
"bytes": "30"
},
{
"name": "R",
"bytes": "16999"
},
{
"name": "Ruby",
"bytes": "2751"
},
{
"name": "Scheme",
"bytes": "2307"
}
],
"symlink_target": ""
} |
package org.pdxfinder.services.dto;
/*
* Created by abayomi on 18/10/2018.
*/
public class EngraftmentDataDTO {
private String strainName;
private String strainSymbol;
private String engraftmentSite;
private String engraftmentType;
private String engraftmentMaterial;
private String engraftmentMaterialState;
private String passage;
public EngraftmentDataDTO() {
}
public EngraftmentDataDTO(String strainName,
String strainSymbol,
String engraftmentSite,
String engraftmentType,
String engraftmentMaterial,
String engraftmentMaterialState,
String passage) {
this.strainName = strainName;
this.strainSymbol = strainSymbol;
this.engraftmentSite = engraftmentSite;
this.engraftmentType = engraftmentType;
this.engraftmentMaterial = engraftmentMaterial;
this.engraftmentMaterialState = engraftmentMaterialState;
this.passage = passage;
}
public String getStrainName() {
return strainName;
}
public void setStrainName(String strainName) {
this.strainName = strainName;
}
public String getStrainSymbol() {
return strainSymbol;
}
public void setStrainSymbol(String strainSymbol) {
this.strainSymbol = strainSymbol;
}
public String getEngraftmentSite() {
return engraftmentSite;
}
public void setEngraftmentSite(String engraftmentSite) {
this.engraftmentSite = engraftmentSite;
}
public String getEngraftmentType() {
return engraftmentType;
}
public void setEngraftmentType(String engraftmentType) {
this.engraftmentType = engraftmentType;
}
public String getEngraftmentMaterial() {
return engraftmentMaterial;
}
public void setEngraftmentMaterial(String engraftmentMaterial) {
this.engraftmentMaterial = engraftmentMaterial;
}
public String getEngraftmentMaterialState() {
return engraftmentMaterialState;
}
public void setEngraftmentMaterialState(String engraftmentMaterialState) {
this.engraftmentMaterialState = engraftmentMaterialState;
}
public String getPassage() {
return passage;
}
public void setPassage(String passage) {
this.passage = passage;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
EngraftmentDataDTO that = (EngraftmentDataDTO) o;
if (strainName != null ? !strainName.equals(that.strainName) : that.strainName != null) return false;
if (engraftmentSite != null ? !engraftmentSite.equals(that.engraftmentSite) : that.engraftmentSite != null)
return false;
if (engraftmentType != null ? !engraftmentType.equals(that.engraftmentType) : that.engraftmentType != null)
return false;
if (engraftmentMaterial != null ? !engraftmentMaterial.equals(that.engraftmentMaterial) : that.engraftmentMaterial != null)
return false;
return engraftmentMaterialState != null ? engraftmentMaterialState.equals(that.engraftmentMaterialState) : that.engraftmentMaterialState == null;
}
@Override
public int hashCode() {
int result = strainName != null ? strainName.hashCode() : 0;
result = 31 * result + (engraftmentSite != null ? engraftmentSite.hashCode() : 0);
result = 31 * result + (engraftmentType != null ? engraftmentType.hashCode() : 0);
result = 31 * result + (engraftmentMaterial != null ? engraftmentMaterial.hashCode() : 0);
result = 31 * result + (engraftmentMaterialState != null ? engraftmentMaterialState.hashCode() : 0);
return result;
}
}
| {
"content_hash": "70dfd048debbfcdb18ffbce77548b0bb",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 153,
"avg_line_length": 33.08403361344538,
"alnum_prop": 0.6558293116586233,
"repo_name": "PDXFinder/pdxfinder",
"id": "067632bef46f00a66bb6fa4787b41515423179f5",
"size": "3937",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "data-services/src/main/java/org/pdxfinder/services/dto/EngraftmentDataDTO.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "388623"
},
{
"name": "HTML",
"bytes": "316442"
},
{
"name": "Java",
"bytes": "1321020"
},
{
"name": "JavaScript",
"bytes": "257341"
},
{
"name": "TypeScript",
"bytes": "73991"
}
],
"symlink_target": ""
} |
<?php
namespace tests\functional\test_simple;
use r7r\ste\STECore;
use tests\functional\BaseTest;
class Test extends BaseTest
{
protected function getDirectory(): string
{
return __DIR__;
}
protected function setUpSte(STECore $ste): void
{
$ste->vars["foo"] = "World";
}
}
| {
"content_hash": "926b88b52447c3b9b8bfbe7e51410460",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 51,
"avg_line_length": 16.68421052631579,
"alnum_prop": 0.6340694006309149,
"repo_name": "kch42/ste",
"id": "78b5ac02e41d948550882d9f3595907efc7ab064",
"size": "317",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/functional/test_simple/Test.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "65832"
},
{
"name": "Shell",
"bytes": "804"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.