text stringlengths 2 1.04M | meta dict |
|---|---|
<?php
namespace Iltar\HttpBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\DefinitionDecorator;
use Symfony\Component\DependencyInjection\Reference;
/**
* @author Iltar van der Berg <kjarli@gmail.com>
*/
final class DecorateRouterPass implements CompilerPassInterface
{
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container)
{
if (!$container->hasParameter('iltar.http.router.enabled')) {
return;
}
$resolvers = [];
foreach ($container->findTaggedServiceIds('router.parameter_resolver') as $serviceId => $tags) {
$tag = current($tags);
if (!array_key_exists('priority', $tag)) {
throw new \InvalidArgumentException(
'The router.parameter_resolver tag requires a priority to be set for ' . $serviceId . '.'
);
}
$newId = 'iltar.http.parameter_resolver.' . $serviceId;
$container->setDefinition(
$newId,
(new DefinitionDecorator('iltar.http.parameter_resolver.abstract'))->replaceArgument(1, $serviceId)
);
$resolvers[] = [
'priority' => $tag['priority'],
'service' => $newId
];
}
if (empty($resolvers)) {
return;
}
$container->setDefinition(
'iltar.http.parameter_resolving_router',
(new DefinitionDecorator('iltar.http.parameter_resolving_router.abstract'))->setDecoratedService('router')
);
usort($resolvers, function ($a, $b) {
if ($a['priority'] === $b['priority']) {
return 0;
}
return $a['priority'] > $b['priority'] ? -1 : 1;
});
$container->findDefinition('iltar.http.router.parameter_resolver_collection')
->replaceArgument(0, array_map(function (array $resolver) {
return new Reference($resolver['service']);
}, $resolvers));
}
}
| {
"content_hash": "9ff84356b3e996d771e09c9e0c2b3357",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 118,
"avg_line_length": 32.88059701492537,
"alnum_prop": 0.5787562414888788,
"repo_name": "WouterJ/http-bundle",
"id": "7c01117bd5871d21867e25dfbe3fa5545d9e40ea",
"size": "2203",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/DependencyInjection/DecorateRouterPass.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "33369"
}
],
"symlink_target": ""
} |
import discord
from discord.ext import commands
from . import switch, wiiu_support, wiiu_results, ctr_support, ctr_results
class Results(commands.Cog):
"""
Parses game console result codes.
"""
def fetch(self, error):
if ctr_support.is_valid(error):
return ctr_support.get(error)
if ctr_results.is_valid(error):
return ctr_results.get(error)
if wiiu_support.is_valid(error):
return wiiu_support.get(error)
if wiiu_results.is_valid(error):
return wiiu_results.get(error)
if switch.is_valid(error):
return switch.get(error)
# Console name, module name, result, color
return None
def err2hex(self, error, suppress_error=False):
# If it's already hex, just return it.
if self.is_hex(error):
return error
# Only Switch is supported. The other two can only give nonsense results.
if switch.is_valid(error):
return switch.err2hex(error, suppress_error)
if not suppress_error:
return 'Invalid or unsupported error code format. \
Only Nintendo Switch XXXX-YYYY formatted error codes are supported.'
def hex2err(self, error, suppress_error=False):
# Don't bother processing anything if it's not hex.
if self.is_hex(error):
if switch.is_valid(error):
return switch.hex2err(error)
if not suppress_error:
return 'This isn\'t a hexadecimal value!'
def fixup_input(self, user_input):
# Truncate input to 16 chars so as not to create a huge embed or do
# eventual regex on a huge string. If we add support for consoles that
# that have longer error codes, adjust accordingly.
user_input = user_input[:16]
# Fix up hex input if 0x was omitted. It's fine if it doesn't convert.
try:
user_input = hex(int(user_input, 16))
except ValueError:
pass
return user_input
def is_hex(self, user_input):
try:
user_input = hex(int(user_input, 16))
except ValueError:
return False
return True
def check_meme(self, err: str) -> str:
memes = {
'0xdeadbeef': 'you sure you want to eat that?',
'0xdeadbabe': 'i think you have bigger problems if that\'s the case',
'0x8badf00d': 'told you not to eat it'
}
return memes.get(err.casefold())
@commands.command(aliases=['err', 'res'])
async def result(self, ctx, err: str):
"""
Displays information on game console result codes, with a fancy embed.
0x prefix is not required for hex input.
Examples:
.err 0xD960D02B
.err D960D02B
.err 022-2634
.err 102-2804
.err 2168-0002
.err 2-ARVHA-0000
"""
err = self.fixup_input(err)
if (meme := self.check_meme(err)) is not None:
return await ctx.send(meme)
ret = self.fetch(err)
if ret:
embed = discord.Embed(title=ret.get_title())
if ret.extra_description:
embed.description = ret.extra_description
for field in ret:
embed.add_field(name=field.field_name, value=field.message, inline=False)
embed.color = ret.color
await ctx.send(embed=embed)
else:
await ctx.send(f'{ctx.author.mention}, the code you entered is \
invalid or is for a system I don\'t have support for.')
@commands.command(aliases=['serr'])
async def nxerr(self, ctx, err: str):
"""
Displays information on switch result codes, with a fancy embed.
0x prefix is not required for hex input.
Examples:
.nxerr 0x4A8
.nxerr 4A8
.nxerr 2168-0002
.nxerr 2-ARVHA-0000
"""
err = self.fixup_input(err)
if (meme := self.check_meme(err)) is not None:
return await ctx.send(meme)
ret = None
if switch.is_valid(err):
ret = switch.get(err)
if ret:
embed = discord.Embed(title=ret.get_title())
if ret.extra_description:
embed.description = ret.extra_description
for field in ret:
embed.add_field(name=field.field_name, value=field.message, inline=False)
embed.color = ret.color
await ctx.send(embed=embed)
else:
await ctx.send(f'{ctx.author.mention}, the code you entered is \
invalid for the switch.')
@commands.command(aliases=['3dserr'])
async def ctrerr(self, ctx, err: str):
"""
Displays information on 3DS result codes, with a fancy embed.
0x prefix is not required for hex input.
Examples:
.ctrerr 0xD960D02B
.ctrerr D960D02B
.ctrerr 022-2634
"""
err = self.fixup_input(err)
if (meme := self.check_meme(err)) is not None:
return await ctx.send(meme)
ret = None
if ctr_support.is_valid(err):
ret = ctr_support.get(err)
elif ctr_results.is_valid(err):
ret = ctr_results.get(err)
if ret:
embed = discord.Embed(title=ret.get_title())
if ret.extra_description:
embed.description = ret.extra_description
for field in ret:
embed.add_field(name=field.field_name, value=field.message, inline=False)
embed.color = ret.color
await ctx.send(embed=embed)
else:
await ctx.send(f'{ctx.author.mention}, the code you entered is \
invalid for the 3DS.')
@commands.command(aliases=['wiiuerr'])
async def cafeerr(self, ctx, err: str):
"""
Displays information on Wii U result codes, with a fancy embed.
0x prefix is not required for hex input.
Examples:
.cafeerr 0xC070FA80
.cafeerr C070FA80
.cafeerr 0x18106FFF
.cafeerr 18106FFF
.cafeerr 102-2804
"""
err = self.fixup_input(err)
if (meme := self.check_meme(err)) is not None:
return await ctx.send(meme)
ret = None
if wiiu_support.is_valid(err):
ret = wiiu_support.get(err)
elif wiiu_results.is_valid(err):
ret = wiiu_results.get(err)
if ret:
embed = discord.Embed(title=ret.get_title())
if ret.extra_description:
embed.description = ret.extra_description
for field in ret:
embed.add_field(name=field.field_name, value=field.message, inline=False)
embed.color = ret.color
await ctx.send(embed=embed)
else:
await ctx.send(f'{ctx.author.mention}, the code you entered is \
invalid for the Wii U.')
@commands.command(name='err2hex')
async def cmderr2hex(self, ctx, error: str):
"""
Converts a support code of a console to a hex result code.
Switch only supported.
3DS and WiiU support and result codes are not directly interchangeable.
"""
error = self.fixup_input(error)
await ctx.send(self.err2hex(error))
@commands.command(name='hex2err')
async def cmdhex2err(self, ctx, error: str):
"""
Converts a hex result code of a console to a support code.
Switch only supported.
3DS and WiiU support and result codes are not directly interchangeable.
"""
error = self.fixup_input(error)
await ctx.send(self.hex2err(error))
@commands.command()
async def hexinfo(self, ctx, error: str):
"""
Breaks down a 3DS result code into its components.
"""
error = self.fixup_input(error)
if self.is_hex(error):
if ctr_results.is_valid(error):
mod, desc, summary, level = ctr_results.hexinfo(error)
embed = discord.Embed(title="3DS hex result info")
embed.add_field(name="Module", value=mod, inline=False)
embed.add_field(name="Summary", value=summary, inline=False)
embed.add_field(name="Level", value=level, inline=False)
embed.add_field(name="Description", value=desc, inline=False)
await ctx.send(embed=embed)
else:
await ctx.send('This isn\'t a 3DS result code.')
else:
await ctx.send('This isn\'t a hexadecimal value!')
def setup(bot):
bot.add_cog(Results(bot))
| {
"content_hash": "025cc2200cec708e126ce8fbe2d2dfdb",
"timestamp": "",
"source": "github",
"line_count": 260,
"max_line_length": 89,
"avg_line_length": 33.32692307692308,
"alnum_prop": 0.5779572994806693,
"repo_name": "ihaveamac/Kurisu",
"id": "b14c001e3de600d07ad43cd889404f94a6525365",
"size": "8665",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "cogs/results/__init__.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "234699"
}
],
"symlink_target": ""
} |
Readout Scan Tasks
==================
.. currentmodule:: recirq.readout_scan.tasks
.. autoclass:: ReadoutScanTask
.. rubric:: Functions
.. autofunction:: run_readout_scan
| {
"content_hash": "e533965bf74181a76de50a8ea7478beb",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 44,
"avg_line_length": 19.333333333333332,
"alnum_prop": 0.6666666666666666,
"repo_name": "quantumlib/ReCirq",
"id": "8798283c9a6a21070bf00fc6c783024c495204c5",
"size": "174",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dev_tools/docs/sphinx/readout_scan_tasks.rst",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "365"
},
{
"name": "Dockerfile",
"bytes": "300"
},
{
"name": "Jupyter Notebook",
"bytes": "22201"
},
{
"name": "Makefile",
"bytes": "670"
},
{
"name": "Python",
"bytes": "989707"
},
{
"name": "Shell",
"bytes": "2189"
}
],
"symlink_target": ""
} |
package com.vmware.vim25;
/**
* @author Steve Jin (http://www.doublecloud.org)
* @version 5.1
*/
@SuppressWarnings("all")
public class ExtensionFaultTypeInfo extends DynamicData {
public String faultID;
public String getFaultID() {
return this.faultID;
}
public void setFaultID(String faultID) {
this.faultID = faultID;
}
} | {
"content_hash": "498fbb751adcb5b07b150ef539a63d66",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 57,
"avg_line_length": 17.523809523809526,
"alnum_prop": 0.6630434782608695,
"repo_name": "n4ybn/yavijava",
"id": "a10dd116976a76ea67c904c18d24dfb0f6575a56",
"size": "2008",
"binary": false,
"copies": "5",
"ref": "refs/heads/gradle",
"path": "src/main/java/com/vmware/vim25/ExtensionFaultTypeInfo.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Groovy",
"bytes": "14019"
},
{
"name": "Java",
"bytes": "8544369"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<script>
if (window.testRunner)
testRunner.overridePreference("WebKitCSSGridLayoutEnabled", 1);
</script>
<link href="resources/grid.css" rel="stylesheet">
<style>
.grid {
width: 100px;
height: 200px;
}
#grid1 {
grid-definition-columns: 30px;
grid-definition-rows: minmax(20px, 80px) 160px;
}
#grid2 {
grid-definition-columns: 30px;
grid-definition-rows: minmax(50%, 120px) minmax(20px, 40%);
}
#grid3 {
grid-definition-columns: 30px;
/* Overlapping range. */
grid-definition-rows: minmax(10px, 180px) minmax(30px, 150px);
}
#grid4 {
grid-definition-columns: 30px;
grid-definition-rows: minmax(20px, 80px) 60px;
-webkit-writing-mode: vertical-rl;
}
#grid5 {
grid-definition-columns: 30px;
/* 90% > 80px, 80px should be ignored. */
grid-definition-rows: minmax(90%, 80px) minmax(10px, 60%);
-webkit-writing-mode: vertical-lr;
}
#grid6 {
/* Overlapping range. */
grid-definition-columns: 30px;
grid-definition-rows: minmax(10px, 180px) minmax(30px, 150px);
-webkit-writing-mode: horizontal-bt;
}
.firstRowFirstColumn {
width: 100%;
height: 100%;
}
.secondRowFirstColumn {
width: 100%;
height: 100%;
}
</style>
<script src="../../resources/check-layout.js"></script>
<body onload="checkLayout('.grid')">
<p><a href="https://webkit.org/b/104700">Bug 104700<a>: [CSS Grid Layout] Implement grid items sizing for fixed minmax grid tracks</p>
<p>Checks that a grid element with fixed minmax properly compute the logical height in several writing-mode.</p>
<div class="grid" id="grid1" data-expected-width="100" data-expected-height="200">
<div class="firstRowFirstColumn" data-expected-height="40" data-expected-width="30"></div>
<div class="secondRowFirstColumn" data-expected-height="160" data-expected-width="30"></div>
</div>
<div class="grid" id="grid2" data-expected-width="100" data-expected-height="200">
<div class="firstRowFirstColumn" data-expected-height="120" data-expected-width="30"></div>
<div class="secondRowFirstColumn" data-expected-height="80" data-expected-width="30"></div>
</div>
<div class="grid" id="grid3" data-expected-width="100" data-expected-height="200">
<div class="firstRowFirstColumn" data-expected-height="90" data-expected-width="30"></div>
<div class="secondRowFirstColumn" data-expected-height="110" data-expected-width="30"></div>
</div>
<div class="grid" id="grid4" data-expected-width="100" data-expected-height="200">
<div class="firstRowFirstColumn" data-expected-height="30" data-expected-width="40"></div>
<div class="secondRowFirstColumn" data-expected-height="30" data-expected-width="60"></div>
</div>
<div class="grid" id="grid5" data-expected-width="100" data-expected-height="200">
<div class="firstRowFirstColumn" data-expected-height="30" data-expected-width="90"></div>
<div class="secondRowFirstColumn" data-expected-height="30" data-expected-width="10"></div>
</div>
<div class="grid" id="grid6" data-expected-width="100" data-expected-height="200">
<div class="firstRowFirstColumn" data-expected-height="90" data-expected-width="30"></div>
<div class="secondRowFirstColumn" data-expected-height="110" data-expected-width="30"></div>
</div>
</body>
</html>
| {
"content_hash": "68fe11595d47e46e7de2bad23bcaa4c6",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 134,
"avg_line_length": 33.95876288659794,
"alnum_prop": 0.6964177292046144,
"repo_name": "lordmos/blink",
"id": "2e618a2d1d3645c0e33b04247444fb3b253d0ce1",
"size": "3294",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "LayoutTests/fast/css-grid-layout/minmax-fixed-logical-height-only.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "6433"
},
{
"name": "C",
"bytes": "753714"
},
{
"name": "C++",
"bytes": "40028043"
},
{
"name": "CSS",
"bytes": "539440"
},
{
"name": "F#",
"bytes": "8755"
},
{
"name": "Java",
"bytes": "18650"
},
{
"name": "JavaScript",
"bytes": "25700387"
},
{
"name": "Objective-C",
"bytes": "426711"
},
{
"name": "PHP",
"bytes": "141755"
},
{
"name": "Perl",
"bytes": "901523"
},
{
"name": "Python",
"bytes": "3748305"
},
{
"name": "Ruby",
"bytes": "141818"
},
{
"name": "Shell",
"bytes": "9635"
},
{
"name": "XSLT",
"bytes": "49328"
}
],
"symlink_target": ""
} |
//
// Copyright 2005-2007 Adobe Systems Incorporated
//
// Distributed under the Boost Software License, Version 1.0
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
#include <boost/gil.hpp>
#include <boost/mpl/vector.hpp>
#include <cassert>
#include <exception>
#include <iostream>
#include <vector>
using namespace boost::gil;
using namespace std;
void test_pixel_iterator()
{
boost::function_requires<Point2DConcept<point<int>>>();
boost::function_requires<MutablePixelIteratorConcept<bgr8_ptr_t> >();
boost::function_requires<MutablePixelIteratorConcept<cmyk8_planar_ptr_t> >();
boost::function_requires<PixelIteratorConcept<rgb8c_planar_step_ptr_t> >();
boost::function_requires<MutableStepIteratorConcept<rgb8_step_ptr_t> >();
boost::function_requires<MutablePixelLocatorConcept<rgb8_step_loc_t> >();
boost::function_requires<PixelLocatorConcept<rgb8c_planar_step_loc_t> >();
boost::function_requires<MutableStepIteratorConcept<cmyk8_planar_step_ptr_t> >();
boost::function_requires<StepIteratorConcept<gray8c_step_ptr_t> >();
boost::function_requires<MutablePixelLocatorConcept<memory_based_2d_locator<rgb8_step_ptr_t> > >();
typedef const bit_aligned_pixel_reference<std::uint8_t, boost::mpl::vector3_c<int,1,2,1>, bgr_layout_t, true> bgr121_ref_t;
typedef bit_aligned_pixel_iterator<bgr121_ref_t> bgr121_ptr_t;
boost::function_requires<MutablePixelIteratorConcept<bgr121_ptr_t> >();
boost::function_requires<PixelBasedConcept<bgr121_ptr_t> >();
boost::function_requires<MemoryBasedIteratorConcept<bgr121_ptr_t> >();
boost::function_requires<HasDynamicXStepTypeConcept<bgr121_ptr_t> >();
// TEST dynamic_step_t
BOOST_STATIC_ASSERT(( boost::is_same<cmyk16_step_ptr_t,dynamic_x_step_type<cmyk16_step_ptr_t>::type>::value ));
BOOST_STATIC_ASSERT(( boost::is_same<cmyk16_planar_step_ptr_t,dynamic_x_step_type<cmyk16_planar_ptr_t>::type>::value ));
BOOST_STATIC_ASSERT(( boost::is_same<iterator_type<uint8_t,gray_layout_t,false,false,false>::type,gray8c_ptr_t>::value ));
// TEST iterator_is_step
BOOST_STATIC_ASSERT(iterator_is_step< cmyk16_step_ptr_t >::value);
BOOST_STATIC_ASSERT(iterator_is_step< cmyk16_planar_step_ptr_t >::value);
BOOST_STATIC_ASSERT(!iterator_is_step< cmyk16_planar_ptr_t >::value);
typedef color_convert_deref_fn<rgb8c_ref_t, gray8_pixel_t> ccv_rgb_g_fn;
typedef color_convert_deref_fn<gray8c_ref_t, rgb8_pixel_t> ccv_g_rgb_fn;
gil_function_requires<PixelDereferenceAdaptorConcept<ccv_rgb_g_fn> >();
gil_function_requires<PixelDereferenceAdaptorConcept<deref_compose<ccv_rgb_g_fn,ccv_g_rgb_fn> > >();
typedef dereference_iterator_adaptor<rgb8_ptr_t, ccv_rgb_g_fn> rgb2gray_ptr;
BOOST_STATIC_ASSERT(!iterator_is_step< rgb2gray_ptr >::value);
typedef dynamic_x_step_type<rgb2gray_ptr>::type rgb2gray_step_ptr;
BOOST_STATIC_ASSERT(( boost::is_same< rgb2gray_step_ptr, dereference_iterator_adaptor<rgb8_step_ptr_t, ccv_rgb_g_fn> >::value));
make_step_iterator(rgb2gray_ptr(),2);
typedef dereference_iterator_adaptor<rgb8_step_ptr_t, ccv_rgb_g_fn> rgb2gray_step_ptr1;
BOOST_STATIC_ASSERT(iterator_is_step< rgb2gray_step_ptr1 >::value);
BOOST_STATIC_ASSERT(( boost::is_same< rgb2gray_step_ptr1, dynamic_x_step_type<rgb2gray_step_ptr1>::type >::value));
typedef memory_based_step_iterator<dereference_iterator_adaptor<rgb8_ptr_t, ccv_rgb_g_fn> > rgb2gray_step_ptr2;
BOOST_STATIC_ASSERT(iterator_is_step< rgb2gray_step_ptr2 >::value);
BOOST_STATIC_ASSERT(( boost::is_same< rgb2gray_step_ptr2, dynamic_x_step_type<rgb2gray_step_ptr2>::type >::value));
make_step_iterator(rgb2gray_step_ptr2(),2);
// bit_aligned iterators test
// Mutable reference to a BGR232 pixel
typedef const bit_aligned_pixel_reference<std::uint8_t, boost::mpl::vector3_c<unsigned,2,3,2>, bgr_layout_t, true> bgr232_ref_t;
// A mutable iterator over BGR232 pixels
typedef bit_aligned_pixel_iterator<bgr232_ref_t> bgr232_ptr_t;
// BGR232 pixel value. It is a packed_pixel of size 1 byte. (The last bit is unused)
typedef std::iterator_traits<bgr232_ptr_t>::value_type bgr232_pixel_t;
BOOST_STATIC_ASSERT((sizeof(bgr232_pixel_t)==1));
bgr232_pixel_t red(0,0,3); // = 0RRGGGBB, = 01100000
// a buffer of 7 bytes fits exactly 8 BGR232 pixels.
unsigned char pix_buffer[7];
std::fill(pix_buffer,pix_buffer+7,0);
bgr232_ptr_t pix_it(&pix_buffer[0],0); // start at bit 0 of the first pixel
for (int i=0; i<8; ++i) {
*pix_it++ = red;
}
// test cross byte pixel values - meaning when a pixel value is stretched over two bytes
typedef bit_aligned_image1_type< 3, gray_layout_t >::type gray3_image_t;
typedef gray3_image_t image_t;
typedef image_t::view_t view_t;
typedef view_t::reference ref_t;
typedef bit_aligned_pixel_iterator< ref_t > iterator_t;
std::vector< unsigned char > buf( 4 );
// bit pattern is: 1011 0110 0110 1101 1101 1011
// each byte is read right to left
buf[0] = 182;
buf[1] = 109;
buf[2] = 219;
iterator_t it( &buf[0], 0 );
ref_t p1 = *it; it++;
ref_t p2 = *it; it++;
ref_t p3 = *it; it++;
ref_t p4 = *it; it++;
ref_t p5 = *it; it++;
ref_t p6 = *it; it++;
ref_t p7 = *it; it++;
ref_t p8 = *it; it++;
unsigned char v1 = get_color( p1, gray_color_t() );
unsigned char v2 = get_color( p2, gray_color_t() );
unsigned char v3 = get_color( p3, gray_color_t() );
unsigned char v4 = get_color( p4, gray_color_t() );
unsigned char v5 = get_color( p5, gray_color_t() );
unsigned char v6 = get_color( p6, gray_color_t() );
unsigned char v7 = get_color( p7, gray_color_t() );
unsigned char v8 = get_color( p8, gray_color_t() );
// all values should be 110b ( 6 );
assert( v1 == 6 );
assert( v2 == 6 );
assert( v3 == 6 );
assert( v4 == 6 );
assert( v5 == 6 );
assert( v6 == 6 );
assert( v7 == 6 );
assert( v8 == 6 );
}
// TODO: Make better tests. Use some code from below.
/*
template <typename Pixel>
void invert_pixel1(Pixel& pix) {
at_c<0>(pix)=0;
}
template <typename T> inline void ignore_unused_variable_warning(const T&){}
void test_pixel_iterator() {
rgb8_pixel_t rgb8(1,2,3);
rgba8_pixel_t rgba8;
rgb8_ptr_t ptr1=&rgb8;
memunit_advance(ptr1, 3);
const rgb8_ptr_t ptr2=memunit_advanced(ptr1,10);
memunit_distance(ptr1,ptr2);
const rgb8_pixel_t& ref=memunit_advanced_ref(ptr1,10); ignore_unused_variable_warning(ref);
rgb8_planar_ptr_t planarPtr1(&rgb8);
rgb8_planar_ptr_t planarPtr2(&rgb8);
memunit_advance(planarPtr1,10);
memunit_distance(planarPtr1,planarPtr2);
rgb8_planar_ptr_t planarPtr3=memunit_advanced(planarPtr1,10);
// planarPtr2=&rgba8;
planar_pixel_reference<uint8_t&,rgb_t> pxl=*(planarPtr1+5);
rgb8_pixel_t pv2=pxl;
rgb8_pixel_t pv3=*(planarPtr1+5);
rgb8_pixel_t pv=planarPtr1[5];
assert(*(planarPtr1+5)==planarPtr1[5]);
rgb8_planar_ref_t planarRef=memunit_advanced_ref(planarPtr1,10);
rgb8_step_ptr_t stepIt(&rgb8,5);
stepIt++;
rgb8_step_ptr_t stepIt2=stepIt+10;
stepIt2=stepIt;
rgb8_step_ptr_t stepIt3(&rgb8,5);
rgb8_pixel_t& ref1=stepIt3[5];
// bool v=boost::is_POD<iterator_traits<memory_based_step_iterator<rgb8_ptr_t> >::value_type>::value;
// v=boost::is_POD<rgb8_pixel_t>::value;
// v=boost::is_POD<int>::value;
rgb8_step_ptr_t rgb8StepIt(ptr1, 10);
rgb8_step_ptr_t rgb8StepIt2=rgb8StepIt;
rgb8StepIt=rgb8StepIt2;
++rgb8StepIt;
rgb8_ref_t reff=*rgb8StepIt; ignore_unused_variable_warning(reff);
rgb8StepIt+=10;
std::ptrdiff_t dst=rgb8StepIt2-rgb8StepIt; ignore_unused_variable_warning(dst);
rgb8_pixel_t val1=ref1;
rgb8_ptr_t ptr=&ref1;
invert_pixel1(*planarPtr1);
// invert_pixel1(*ptr);
rgb8c_planar_ptr_t r8cpp;
// invert_pixel1(*r8cpp);
rgb8_pixel_t& val21=stepIt3[5];
rgb8_pixel_t val22=val21;
rgb8_pixel_t val2=stepIt3[5];
rgb8_ptr_t ptr11=&(stepIt3[5]); ignore_unused_variable_warning(ptr11);
rgb8_ptr_t ptr3=&*(stepIt3+5); ignore_unused_variable_warning(ptr3);
rgb8_step_ptr_t stepIt4(ptr,5);
++stepIt4;
rgb8_step_ptr_t stepIt5;
if (stepIt4==stepIt5) {
int st=0;ignore_unused_variable_warning(st);
}
iterator_from_2d<rgb8_loc_t> pix_img_it(rgb8_loc_t(ptr, 20), 5);
++pix_img_it;
pix_img_it+=10;
rgb8_pixel_t& refr=*pix_img_it;
refr=rgb8_pixel_t(1,2,3);
*pix_img_it=rgb8_pixel_t(1,2,3);
pix_img_it[3]=rgb8_pixel_t(1,2,3);
*(pix_img_it+3)=rgb8_pixel_t(1,2,3);
iterator_from_2d<rgb8c_loc_t> pix_img_it_c(rgb8c_loc_t(rgb8c_ptr_t(ptr),20), 5);
++pix_img_it_c;
pix_img_it_c+=10;
// *pix_img_it_c=rgb8_pixel_t(1,2,3); // error: assigning though const iterator
typedef iterator_from_2d<rgb8_loc_t>::difference_type dif_t;
dif_t dt=0;
std::ptrdiff_t tdt=dt; ignore_unused_variable_warning(tdt);
// memory_based_step_iterator<rgb8_pixel_t> stepIt3Err=stepIt+10; // error: non-const from const iterator
memory_based_2d_locator<rgb8_step_ptr_t> xy_locator(ptr,27);
xy_locator.x()++;
// memory_based_step_iterator<rgb8_pixel_t>& yit=xy_locator.y();
xy_locator.y()++;
xy_locator+=point<std::ptrdiff_t>(3,4);
// *xy_locator=(xy_locator(-1,0)+xy_locator(0,1))/2;
rgb8_pixel_t& rf=*xy_locator; ignore_unused_variable_warning(rf);
make_step_iterator(rgb8_ptr_t(),3);
make_step_iterator(rgb8_planar_ptr_t(),3);
make_step_iterator(rgb8_planar_step_ptr_t(),3);
// Test operator-> on planar ptrs
{
rgb8c_planar_ptr_t cp(&rgb8);
rgb8_planar_ptr_t p(&rgb8);
// get_color(p,red_t()) = get_color(cp,green_t()); // does not compile - cannot assign a non-const pointer to a const pointer. Otherwise you will be able to modify the value through it.
}
// xy_locator.y()++;
// dimensions to explore
//
// values, references, pointers
// color spaces (rgb,cmyk,gray)
// channel ordering (bgr vs rgb)
// planar vs interleaved
// Pixel POINTERS
// typedef const iterator_traits<rgb8_ptr_t>::pointer RGB8ConstPtr;
typedef const rgb8_ptr_t RGB8ConstPtr;
typedef const rgb8_planar_ptr_t RGB8ConstPlanarPtr;
// typedef const iterator_traits<rgb8_planar_ptr_t>::pointer RGB8ConstPlanarPtr;
// constructing from values, references and other pointers
RGB8ConstPtr rgb8_const_ptr=NULL; ignore_unused_variable_warning(rgb8_const_ptr);
rgb8_ptr_t rgb8ptr=&rgb8;
rgb8=bgr8_pixel_t(30,20,10);
rgb8_planar_ptr_t rgb8_pptr=&rgb8;
++rgb8_pptr;
rgb8_pptr--;
rgb8_pptr[0]=rgb8;
RGB8ConstPlanarPtr rgb8_const_planar_ptr=&rgb8;
rgb8c_planar_ptr_t r8c=&rgb8;
r8c=&rgb8;
rgb8_pptr=&rgb8;
// rgb8_const_planar_ptr=&rgb16p; // error: incompatible bit depth
// iterator_traits<CMYK8>::pointer cmyk8_ptr_t=&rgb8; // error: incompatible pointer type
RGB8ConstPtr rgb8_const_ptr_err=rgb8ptr; // const pointer from non-regular pointer
ignore_unused_variable_warning(rgb8_const_ptr_err);
// dereferencing pointers to obtain references
rgb8_ref_t rgb8ref_2=*rgb8ptr; ignore_unused_variable_warning(rgb8ref_2);
assert(rgb8ref_2==rgb8);
// RGB8Ref rgb8ref_2_err=*rgb8_const_planar_ptr; // error: non-const reference from const pointer
rgb8_planar_ref_t rgb8planarref_3=*rgb8_pptr; // planar reference from planar pointer
assert(rgb8planarref_3==rgb8);
// RGB8Ref rgb8ref_3=*rgb8_planar_ptr_t; // error: non-planar reference from planar pointer
const rgb8_pixel_t crgb8=rgb8;
*rgb8_pptr=rgb8;
*rgb8_pptr=crgb8;
memunit_advance(rgb8_pptr,3);
memunit_advance(rgb8_pptr,-3);
}
*/
int main()
{
try
{
test_pixel_iterator();
return EXIT_SUCCESS;
}
catch (std::exception const& e)
{
std::cerr << e.what() << std::endl;
return EXIT_FAILURE;
}
catch (...)
{
return EXIT_FAILURE;
}
}
| {
"content_hash": "5f0e2465b55794d3575618e4de5ba315",
"timestamp": "",
"source": "github",
"line_count": 338,
"max_line_length": 198,
"avg_line_length": 35.81065088757396,
"alnum_prop": 0.6675479180436219,
"repo_name": "c72578/poedit",
"id": "f2450517698118e718f9098d53b1b990d19d46c8",
"size": "12104",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "deps/boost/libs/gil/test/pixel_iterator.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "23633"
},
{
"name": "C++",
"bytes": "1088488"
},
{
"name": "Inno Setup",
"bytes": "11765"
},
{
"name": "M4",
"bytes": "104132"
},
{
"name": "Makefile",
"bytes": "9152"
},
{
"name": "Objective-C",
"bytes": "26402"
},
{
"name": "Objective-C++",
"bytes": "13730"
},
{
"name": "Python",
"bytes": "3081"
},
{
"name": "Ruby",
"bytes": "261"
},
{
"name": "Shell",
"bytes": "10717"
},
{
"name": "sed",
"bytes": "557"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<!DOCTYPE html>
<html lang=sl>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Določitev nastavitvev posredniškega strežnika</title>
<script type="text/javascript" src="jquery.js"></script><script type="text/javascript" src="jquery.syntax.js"></script><script type="text/javascript" src="yelp.js"></script><link rel="shortcut icon" href="https://www.ubuntu.si/favicon.ico">
<link rel="stylesheet" type="text/css" href="../vodnik_1404.css">
</head>
<body id="home"><div id="wrapper" class="hfeed">
<div id="header">
<div id="branding">
<div id="blog-title"><span><a rel="home" title="Ubuntu Slovenija | Uradna spletna stran slovenske skupnosti Linux distribucije Ubuntu" href="//www.ubuntu.si">Ubuntu Slovenija | Uradna spletna stran slovenske skupnosti Linux distribucije Ubuntu</a></span></div>
<h1 id="blog-description"></h1>
</div>
<div id="access"><div id="loco-header-menu"><ul id="primary-header-menu"><li class="widget-container widget_nav_menu" id="nav_menu-3"><div class="menu-glavni-meni-container"><ul class="menu" id="menu-glavni-meni">
<li id="menu-item-15" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-15"><a href="//www.ubuntu.si">Domov</a></li>
<li id="menu-item-2776" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-2776"><a href="//www.ubuntu.si/category/novice/">Novice</a></li>
<li id="menu-item-16" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-16"><a href="//www.ubuntu.si/forum/">Forum</a></li>
<li id="menu-item-19" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-19"><a href="//www.ubuntu.si/kaj-je-ubuntu/">Kaj je Ubuntu?</a></li>
<li id="menu-item-20" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-20"><a href="//www.ubuntu.si/pogosta_vprasanja/">Pogosta vprašanja</a></li>
<li id="menu-item-17" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-17"><a href="//www.ubuntu.si/skupnost/">Skupnost</a></li>
<li id="menu-item-18" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-18"><a href="//www.ubuntu.si/povezave/">Povezave</a></li>
</ul></div></li></ul></div></div>
</div>
<div id="main"><div id="cwt-content" class="clearfix content-area"><div id="page">
<div class="trails" role="navigation"><div class="trail"> » <a class="trail" href="index.html" title="Namizni vodnik Ubuntu"><span class="media"><span class="media media-image"><img src="figures/ubuntu-logo.png" height="16" width="16" class="media media-inline" alt="Pomoč"></span></span> Namizni vodnik Ubuntu</a> » <a class="trail" href="net.html" title="Omreženje, splet, pošta in klepet">Omreženje, splet, pošta in klepet</a> » <a class="trail" href="net-general.html" title="Izrazi in namigi omrežja">Izrazi in namigi omrežja</a> » </div></div>
<div id="content">
<div class="hgroup"><h1 class="title"><span class="title">Določitev nastavitvev posredniškega strežnika</span></h1></div>
<div class="region">
<div class="contents"></div>
<div id="what" class="sect"><div class="inner">
<div class="hgroup"><h2 class="title"><span class="title">Kaj je posredniški strežnik?</span></h2></div>
<div class="region"><div class="contents"><p class="p"><span class="em">Spletni posredniški strežnik</span> filtrira spletišča, ki jih gledate. Na podlagi pravil se odloči katera od zahtevanih spletnih strani in njihov delov vam bo prikazana. Običajno se uporabljajo v podjetjih in javnih brezžičnih dostopnih točkah za nadzor do spletišč, ki jih lahko gledate, preprečevanje dostopa do interneta brez prijave ali za preverjanje varnosti spletišč.</p></div></div>
</div></div>
<div id="change" class="sect"><div class="inner">
<div class="hgroup"><h2 class="title"><span class="title">Sprememba posredniškega strežnika</span></h2></div>
<div class="region"><div class="contents">
<div class="steps"><div class="inner"><div class="region"><ol class="steps">
<li class="steps"><p class="p">Kliknite ikono skrajno desno na menijski vrstici ter izberite <span class="gui">Sistemske nastavitve</span>.</p></li>
<li class="steps"><p class="p">Odprite <span class="gui">Omrežje</span> in s seznama na levi strani okna izberite <span class="gui">Omrežni posredniški strežnik</span>.</p></li>
<li class="steps">
<p class="p">Med naslednjimi načini izberite kateri posredniški strežnik želite uporabiti.</p>
<div class="terms"><div class="inner"><div class="region"><dl class="terms">
<dt class="terms">Brez</dt>
<dd class="terms"><p class="p">Programi bodo za pridobivanje vsebine s spleta uporabili neposredno povezavo.</p></dd>
<dt class="terms">Ročno</dt>
<dd class="terms"><p class="p">Za vsak protokol protokol preko posredniškega strežnika določi posredniški strežnik in vrata za protokol. Protokoli so <span class="gui">HTTP</span>, <span class="gui">HTTPS</span>, <span class="gui">FTP</span> in <span class="gui">SOCKS</span>.</p></dd>
<dt class="terms">Samodejno</dt>
<dd class="terms"><p class="p">Url kaže na vir, ki vsebuje ustrezno nastavitev za vaš sistem.</p></dd>
</dl></div></div></div>
</li>
</ol></div></div></div>
<p class="p">Nastavitve posredniškega strežnika bodo uveljavljene za programe, ki za uporabo izbranih nastavitev uporabijo omrežno povezavo.</p>
</div></div>
</div></div>
<div class="sect sect-links" role="navigation">
<div class="hgroup"></div>
<div class="contents"><div class="links guidelinks"><div class="inner">
<div class="title"><h2><span class="title">Več podrobnosti</span></h2></div>
<div class="region"><ul><li class="links ">
<a href="net-general.html" title="Izrazi in namigi omrežja">Izrazi in namigi omrežja</a><span class="desc"> — <span class="link"><a href="net-findip.html" title="Najdite svoj naslov IP">Najdite svoj naslov IP</a></span>, <span class="link"><a href="net-wireless-wepwpa.html" title="Kaj WEP in WPA pomenita?">varnost WEP in WPA</a></span>, <span class="link"><a href="net-macaddress.html" title="Kaj je naslov MAC?">naslovi MAC</a></span>, <span class="link"><a href="net-proxy.html" title="Določitev nastavitvev posredniškega strežnika">posredniški strežniki</a></span> …</span>
</li></ul></div>
</div></div></div>
</div>
</div>
<div class="clear"></div>
</div>
</div></div></div>
<div id="footer">
<img src="https://piwik-ubuntusi.rhcloud.com/piwik.php?idsite=1&rec=1" style="border:0" alt=""><div id="siteinfo"><p>Material v tem dokumentu je na voljo pod prosto licenco. To je prevod dokumentacije Ubuntu, ki jo je sestavila <a href="https://wiki.ubuntu.com/DocumentationTeam">Ubuntu dokumentacijska ekipa za Ubuntu</a>. V slovenščino jo je prevedla skupina <a href="https://wiki.lugos.si/slovenjenje:ubuntu">Ubuntu prevajalcev</a>. Za poročanje napak v prevodih v tej dokumentaciji ali Ubuntuju pošljite sporočilo na <a href="mailto:ubuntu-l10n-slv@lists.ubuntu.com?subject=Prijava%20napak%20v%20prevodih">dopisni seznam</a>.</p></div>
</div>
</div></body>
</html>
| {
"content_hash": "c5a4f3e30685dd8c076998c65a71e93c",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 643,
"avg_line_length": 93.89189189189189,
"alnum_prop": 0.7186240644789867,
"repo_name": "ubuntu-si/ubuntu.si",
"id": "cd7c874adf852578cb59c37a5b22f6403f0e32ee",
"size": "7024",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "vodnik/16.04/net-proxy.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "1814"
},
{
"name": "CSS",
"bytes": "662090"
},
{
"name": "HTML",
"bytes": "20513819"
},
{
"name": "JavaScript",
"bytes": "768139"
},
{
"name": "PHP",
"bytes": "437543"
},
{
"name": "Shell",
"bytes": "22354"
},
{
"name": "Smarty",
"bytes": "3767"
}
],
"symlink_target": ""
} |
#include <stdlib.h>
#include <apr_general.h>
#include <sofia-sip/sdp.h>
#include "rtsp_message.h"
#include "mrcp_unirtsp_sdp.h"
#include "mrcp_unirtsp_logger.h"
#include "mpf_rtp_attribs.h"
#include "mpf_rtp_pt.h"
#include "apt_text_stream.h"
#include "apt_log.h"
/** Generate SDP media by RTP media descriptor */
static apr_size_t sdp_rtp_media_generate(char *buffer, apr_size_t size, const mrcp_session_descriptor_t *descriptor, const mpf_rtp_media_descriptor_t *audio_media)
{
apr_size_t offset = 0;
if(audio_media->state == MPF_MEDIA_ENABLED) {
int codec_count = 0;
int i;
mpf_codec_descriptor_t *codec_descriptor;
apr_array_header_t *descriptor_arr = audio_media->codec_list.descriptor_arr;
const apt_str_t *direction_str;
if(!descriptor_arr) {
return 0;
}
offset += snprintf(buffer+offset,size-offset,"m=audio %d RTP/AVP",audio_media->port);
for(i=0; i<descriptor_arr->nelts; i++) {
codec_descriptor = &APR_ARRAY_IDX(descriptor_arr,i,mpf_codec_descriptor_t);
if(codec_descriptor->enabled == TRUE) {
offset += snprintf(buffer+offset,size-offset," %d",codec_descriptor->payload_type);
codec_count++;
}
}
if(!codec_count){
/* SDP m line should have at least one media format listed; use a reserved RTP payload type */
offset += snprintf(buffer+offset,size-offset," %d",RTP_PT_RESERVED);
}
offset += snprintf(buffer+offset,size-offset,"\r\n");
for(i=0; i<descriptor_arr->nelts; i++) {
codec_descriptor = &APR_ARRAY_IDX(descriptor_arr,i,mpf_codec_descriptor_t);
if(codec_descriptor->enabled == TRUE && codec_descriptor->name.buf) {
offset += snprintf(buffer+offset,size-offset,"a=rtpmap:%d %s/%d\r\n",
codec_descriptor->payload_type,
codec_descriptor->name.buf,
codec_descriptor->rtp_sampling_rate);
if (codec_descriptor->format_params) {
int j;
apt_pair_t *pair;
offset += snprintf(buffer + offset, size - offset, "a=fmtp:%d ",
codec_descriptor->payload_type);
for (j = 0; j<codec_descriptor->format_params->nelts; j++) {
pair = (apt_pair_t*)codec_descriptor->format_params->elts + j;
if (j != 0) {
*(buffer + offset) = ';';
offset++;
}
if (pair->name.length) {
memcpy(buffer + offset, pair->name.buf, pair->name.length);
offset += pair->name.length;
if (pair->value.length) {
*(buffer + offset) = '=';
offset++;
memcpy(buffer + offset, pair->value.buf, pair->value.length);
offset += pair->value.length;
}
}
}
offset += snprintf(buffer + offset, size - offset, "\r\n");
}
}
}
direction_str = mpf_rtp_direction_str_get(audio_media->direction);
if(direction_str) {
offset += snprintf(buffer+offset,size-offset,"a=%s\r\n",direction_str->buf);
}
if(audio_media->ptime) {
offset += snprintf(buffer+offset,size-offset,"a=ptime:%hu\r\n",audio_media->ptime);
}
}
else {
offset += snprintf(buffer+offset,size-offset,"m=audio 0 RTP/AVP %d\r\n",RTP_PT_RESERVED);
}
return offset;
}
/** Generate RTP media descriptor by SDP media */
static apt_bool_t mpf_rtp_media_generate(mpf_rtp_media_descriptor_t *rtp_media, const sdp_media_t *sdp_media, const apt_str_t *ip, apr_pool_t *pool)
{
mpf_rtp_attrib_e id;
apt_str_t name;
sdp_attribute_t *attrib = NULL;
sdp_rtpmap_t *map;
mpf_codec_descriptor_t *codec;
for(attrib = sdp_media->m_attributes; attrib; attrib=attrib->a_next) {
apt_string_set(&name,attrib->a_name);
id = mpf_rtp_attrib_id_find(&name);
switch(id) {
case RTP_ATTRIB_PTIME:
rtp_media->ptime = (apr_uint16_t)atoi(attrib->a_value);
break;
default:
break;
}
}
mpf_codec_list_init(&rtp_media->codec_list,5,pool);
for(map = sdp_media->m_rtpmaps; map; map = map->rm_next) {
codec = mpf_codec_list_add(&rtp_media->codec_list);
if(codec) {
codec->payload_type = (apr_byte_t)map->rm_pt;
apt_string_assign(&codec->name,map->rm_encoding,pool);
mpf_codec_rtp_sampling_rate_set(codec, (apr_uint16_t)map->rm_rate);
codec->channel_count = 1;
if (map->rm_fmtp) {
apt_str_t value;
apt_string_assign(&value, map->rm_fmtp, pool);
if (!codec->format_params) {
codec->format_params = apt_pair_array_create(1, pool);
}
apt_pair_array_parse(codec->format_params, &value, pool);
}
}
}
switch(sdp_media->m_mode) {
case sdp_inactive:
rtp_media->direction = STREAM_DIRECTION_NONE;
break;
case sdp_sendonly:
rtp_media->direction = STREAM_DIRECTION_SEND;
break;
case sdp_recvonly:
rtp_media->direction = STREAM_DIRECTION_RECEIVE;
break;
case sdp_sendrecv:
rtp_media->direction = STREAM_DIRECTION_DUPLEX;
break;
}
if(sdp_media->m_connections) {
apt_string_assign(&rtp_media->ip,sdp_media->m_connections->c_address,pool);
}
else {
rtp_media->ip = *ip;
}
if(sdp_media->m_port) {
rtp_media->port = (apr_port_t)sdp_media->m_port;
rtp_media->state = MPF_MEDIA_ENABLED;
}
else {
rtp_media->state = MPF_MEDIA_DISABLED;
}
return TRUE;
}
/** Generate MRCP descriptor by SDP session */
static apt_bool_t mrcp_descriptor_generate_by_rtsp_sdp_session(mrcp_session_descriptor_t *descriptor, const sdp_session_t *sdp, const char *force_destination_ip, apr_pool_t *pool)
{
sdp_media_t *sdp_media;
if(force_destination_ip) {
apt_string_assign(&descriptor->ip,force_destination_ip,pool);
}
else if(sdp->sdp_connection) {
apt_string_assign(&descriptor->ip,sdp->sdp_connection->c_address,pool);
}
for(sdp_media=sdp->sdp_media; sdp_media; sdp_media=sdp_media->m_next) {
switch(sdp_media->m_type) {
case sdp_media_audio:
{
mpf_rtp_media_descriptor_t *media = mpf_rtp_media_descriptor_alloc(pool);
media->id = mrcp_session_audio_media_add(descriptor,media);
mpf_rtp_media_generate(media,sdp_media,&descriptor->ip,pool);
break;
}
case sdp_media_video:
{
mpf_rtp_media_descriptor_t *media = mpf_rtp_media_descriptor_alloc(pool);
media->id = mrcp_session_video_media_add(descriptor,media);
mpf_rtp_media_generate(media,sdp_media,&descriptor->ip,pool);
break;
}
default:
apt_log(RTSP_LOG_MARK,APT_PRIO_INFO,"Not Supported SDP Media [%s]", sdp_media->m_type_name);
break;
}
}
return TRUE;
}
/** Generate MRCP descriptor by RTSP request */
MRCP_DECLARE(mrcp_session_descriptor_t*) mrcp_descriptor_generate_by_rtsp_request(
const rtsp_message_t *request,
const char *force_destination_ip,
const apr_table_t *resource_map,
apr_pool_t *pool,
su_home_t *home)
{
mrcp_session_descriptor_t *descriptor = NULL;
const char *resource_name = mrcp_name_get_by_rtsp_name(
resource_map,
request->start_line.common.request_line.resource_name);
if(!resource_name) {
return NULL;
}
if(request->start_line.common.request_line.method_id == RTSP_METHOD_SETUP) {
if(rtsp_header_property_check(&request->header,RTSP_HEADER_FIELD_CONTENT_TYPE) == TRUE &&
rtsp_header_property_check(&request->header,RTSP_HEADER_FIELD_CONTENT_LENGTH) == TRUE &&
request->body.buf) {
sdp_parser_t *parser;
sdp_session_t *sdp;
parser = sdp_parse(home,request->body.buf,request->body.length,0);
sdp = sdp_session(parser);
if(sdp) {
descriptor = mrcp_session_descriptor_create(pool);
mrcp_descriptor_generate_by_rtsp_sdp_session(descriptor,sdp,force_destination_ip,pool);
}
else {
apt_log(RTSP_LOG_MARK,APT_PRIO_WARNING,"Failed to Parse SDP Message");
}
sdp_parser_free(parser);
}
else {
/* create default descriptor in case RTSP SETUP contains no SDP */
mpf_rtp_media_descriptor_t *media;
descriptor = mrcp_session_descriptor_create(pool);
media = mpf_rtp_media_descriptor_alloc(pool);
media->state = MPF_MEDIA_ENABLED;
media->id = mrcp_session_audio_media_add(descriptor,media);
if(rtsp_header_property_check(&request->header,RTSP_HEADER_FIELD_TRANSPORT) == TRUE) {
media->port = request->header.transport.client_port_range.min;
media->ip = request->header.transport.destination;
}
}
if(descriptor) {
apt_string_assign(&descriptor->resource_name,resource_name,pool);
descriptor->resource_state = TRUE;
}
}
else if(request->start_line.common.request_line.method_id == RTSP_METHOD_TEARDOWN) {
descriptor = mrcp_session_descriptor_create(pool);
apt_string_assign(&descriptor->resource_name,resource_name,pool);
descriptor->resource_state = FALSE;
}
return descriptor;
}
/** Generate MRCP descriptor by RTSP response */
MRCP_DECLARE(mrcp_session_descriptor_t*) mrcp_descriptor_generate_by_rtsp_response(
const rtsp_message_t *request,
const rtsp_message_t *response,
const char *force_destination_ip,
const apr_table_t *resource_map,
apr_pool_t *pool,
su_home_t *home)
{
mrcp_session_descriptor_t *descriptor = NULL;
const char *resource_name = mrcp_name_get_by_rtsp_name(
resource_map,
request->start_line.common.request_line.resource_name);
if(!resource_name) {
return NULL;
}
if(request->start_line.common.request_line.method_id == RTSP_METHOD_SETUP) {
if(rtsp_header_property_check(&response->header,RTSP_HEADER_FIELD_CONTENT_TYPE) == TRUE &&
rtsp_header_property_check(&response->header,RTSP_HEADER_FIELD_CONTENT_LENGTH) == TRUE &&
response->body.buf) {
sdp_parser_t *parser;
sdp_session_t *sdp;
parser = sdp_parse(home,response->body.buf,response->body.length,0);
sdp = sdp_session(parser);
if(sdp) {
descriptor = mrcp_session_descriptor_create(pool);
mrcp_descriptor_generate_by_rtsp_sdp_session(descriptor,sdp,force_destination_ip,pool);
apt_string_assign(&descriptor->resource_name,resource_name,pool);
descriptor->resource_state = TRUE;
descriptor->response_code = response->start_line.common.status_line.status_code;
}
else {
apt_log(RTSP_LOG_MARK,APT_PRIO_WARNING,"Failed to Parse SDP Message");
}
sdp_parser_free(parser);
}
else {
descriptor = mrcp_session_descriptor_create(pool);
apt_string_assign(&descriptor->resource_name,resource_name,pool);
descriptor->resource_state = FALSE;
descriptor->response_code = response->start_line.common.status_line.status_code;
}
}
else if(request->start_line.common.request_line.method_id == RTSP_METHOD_TEARDOWN) {
descriptor = mrcp_session_descriptor_create(pool);
apt_string_assign(&descriptor->resource_name,resource_name,pool);
descriptor->resource_state = FALSE;
}
return descriptor;
}
/** Generate RTSP request by MRCP descriptor */
MRCP_DECLARE(rtsp_message_t*) rtsp_request_generate_by_mrcp_descriptor(const mrcp_session_descriptor_t *descriptor, const apr_table_t *resource_map, apr_pool_t *pool)
{
apr_size_t i;
apr_size_t count;
apr_size_t audio_index = 0;
mpf_rtp_media_descriptor_t *audio_media;
apr_size_t video_index = 0;
mpf_rtp_media_descriptor_t *video_media;
apr_size_t offset = 0;
char buffer[2048];
apr_size_t size = sizeof(buffer);
rtsp_message_t *request;
const char *ip = descriptor->ext_ip.buf ? descriptor->ext_ip.buf : (descriptor->ip.buf ? descriptor->ip.buf : "0.0.0.0");
request = rtsp_request_create(pool);
request->start_line.common.request_line.resource_name = rtsp_name_get_by_mrcp_name(
resource_map,
descriptor->resource_name.buf);
if(descriptor->resource_state != TRUE) {
request->start_line.common.request_line.method_id = RTSP_METHOD_TEARDOWN;
return request;
}
request->start_line.common.request_line.method_id = RTSP_METHOD_SETUP;
buffer[0] = '\0';
offset += snprintf(buffer+offset,size-offset,
"v=0\r\n"
"o=%s 0 0 IN IP4 %s\r\n"
"s=-\r\n"
"c=IN IP4 %s\r\n"
"t=0 0\r\n",
descriptor->origin.buf ? descriptor->origin.buf : "-",
ip,
ip);
count = mrcp_session_media_count_get(descriptor);
for(i=0; i<count; i++) {
audio_media = mrcp_session_audio_media_get(descriptor,audio_index);
if(audio_media && audio_media->id == i) {
/* generate audio media */
audio_index++;
offset += sdp_rtp_media_generate(buffer+offset,size-offset,descriptor,audio_media);
request->header.transport.client_port_range.min = audio_media->port;
request->header.transport.client_port_range.max = audio_media->port+1;
continue;
}
video_media = mrcp_session_video_media_get(descriptor,video_index);
if(video_media && video_media->id == i) {
/* generate video media */
video_index++;
offset += sdp_rtp_media_generate(buffer+offset,size-offset,descriptor,video_media);
continue;
}
}
request->header.transport.protocol = RTSP_TRANSPORT_RTP;
request->header.transport.profile = RTSP_PROFILE_AVP;
request->header.transport.delivery = RTSP_DELIVERY_UNICAST;
rtsp_header_property_add(&request->header,RTSP_HEADER_FIELD_TRANSPORT,request->pool);
if(offset) {
apt_string_assign_n(&request->body,buffer,offset,pool);
request->header.content_type = RTSP_CONTENT_TYPE_SDP;
rtsp_header_property_add(&request->header,RTSP_HEADER_FIELD_CONTENT_TYPE,request->pool);
request->header.content_length = offset;
rtsp_header_property_add(&request->header,RTSP_HEADER_FIELD_CONTENT_LENGTH,request->pool);
}
return request;
}
/** Generate RTSP response by MRCP descriptor */
MRCP_DECLARE(rtsp_message_t*) rtsp_response_generate_by_mrcp_descriptor(const rtsp_message_t *request, const mrcp_session_descriptor_t *descriptor, const apr_table_t *resource_map, apr_pool_t *pool)
{
rtsp_message_t *response = NULL;
switch(descriptor->status) {
case MRCP_SESSION_STATUS_OK:
response = rtsp_response_create(request,RTSP_STATUS_CODE_OK,RTSP_REASON_PHRASE_OK,pool);
break;
case MRCP_SESSION_STATUS_NO_SUCH_RESOURCE:
response = rtsp_response_create(request,RTSP_STATUS_CODE_NOT_FOUND,RTSP_REASON_PHRASE_NOT_FOUND,pool);
break;
case MRCP_SESSION_STATUS_UNACCEPTABLE_RESOURCE:
case MRCP_SESSION_STATUS_UNAVAILABLE_RESOURCE:
response = rtsp_response_create(request,RTSP_STATUS_CODE_NOT_ACCEPTABLE,RTSP_REASON_PHRASE_NOT_ACCEPTABLE,pool);
break;
case MRCP_SESSION_STATUS_ERROR:
response = rtsp_response_create(request,RTSP_STATUS_CODE_INTERNAL_SERVER_ERROR,RTSP_REASON_PHRASE_INTERNAL_SERVER_ERROR,pool);
break;
}
if(!response) {
return NULL;
}
if(descriptor->status == MRCP_SESSION_STATUS_OK) {
apr_size_t i;
apr_size_t count;
apr_size_t audio_index = 0;
mpf_rtp_media_descriptor_t *audio_media;
apr_size_t video_index = 0;
mpf_rtp_media_descriptor_t *video_media;
apr_size_t offset = 0;
char buffer[2048];
apr_size_t size = sizeof(buffer);
const char *ip = descriptor->ext_ip.buf ? descriptor->ext_ip.buf : (descriptor->ip.buf ? descriptor->ip.buf : "0.0.0.0");
buffer[0] = '\0';
offset += snprintf(buffer+offset,size-offset,
"v=0\r\n"
"o=%s 0 0 IN IP4 %s\r\n"
"s=-\r\n"
"c=IN IP4 %s\r\n"
"t=0 0\r\n",
descriptor->origin.buf ? descriptor->origin.buf : "-",
ip,
ip);
count = mrcp_session_media_count_get(descriptor);
for(i=0; i<count; i++) {
audio_media = mrcp_session_audio_media_get(descriptor,audio_index);
if(audio_media && audio_media->id == i) {
/* generate audio media */
rtsp_transport_t *transport;
audio_index++;
offset += sdp_rtp_media_generate(buffer+offset,size-offset,descriptor,audio_media);
transport = &response->header.transport;
transport->server_port_range.min = audio_media->port;
transport->server_port_range.max = audio_media->port+1;
transport->client_port_range = request->header.transport.client_port_range;
continue;
}
video_media = mrcp_session_video_media_get(descriptor,video_index);
if(video_media && video_media->id == i) {
/* generate video media */
video_index++;
offset += sdp_rtp_media_generate(buffer+offset,size-offset,descriptor,video_media);
continue;
}
}
/* ok */
response->header.transport.protocol = RTSP_TRANSPORT_RTP;
response->header.transport.profile = RTSP_PROFILE_AVP;
response->header.transport.delivery = RTSP_DELIVERY_UNICAST;
rtsp_header_property_add(&response->header,RTSP_HEADER_FIELD_TRANSPORT,response->pool);
if(offset) {
apt_string_assign_n(&response->body,buffer,offset,pool);
response->header.content_type = RTSP_CONTENT_TYPE_SDP;
rtsp_header_property_add(&response->header,RTSP_HEADER_FIELD_CONTENT_TYPE,response->pool);
response->header.content_length = offset;
rtsp_header_property_add(&response->header,RTSP_HEADER_FIELD_CONTENT_LENGTH,response->pool);
}
}
return response;
}
/** Generate RTSP resource discovery request */
MRCP_DECLARE(rtsp_message_t*) rtsp_resource_discovery_request_generate(
const char *resource_name,
const apr_table_t *resource_map,
apr_pool_t *pool)
{
rtsp_message_t *request = rtsp_request_create(pool);
request->start_line.common.request_line.resource_name = rtsp_name_get_by_mrcp_name(
resource_map,
resource_name);
request->start_line.common.request_line.method_id = RTSP_METHOD_DESCRIBE;
return request;
}
/** Generate resource discovery descriptor by RTSP response */
MRCP_DECLARE(mrcp_session_descriptor_t*) mrcp_resource_discovery_response_generate(
const rtsp_message_t *request,
const rtsp_message_t *response,
const apr_table_t *resource_map,
apr_pool_t *pool,
su_home_t *home)
{
mrcp_session_descriptor_t *descriptor = NULL;
const char *resource_name = mrcp_name_get_by_rtsp_name(
resource_map,
request->start_line.common.request_line.resource_name);
if(!resource_name) {
return NULL;
}
descriptor = mrcp_session_descriptor_create(pool);
apt_string_assign(&descriptor->resource_name,resource_name,pool);
if(rtsp_header_property_check(&response->header,RTSP_HEADER_FIELD_CONTENT_TYPE) == TRUE &&
rtsp_header_property_check(&response->header,RTSP_HEADER_FIELD_CONTENT_LENGTH) == TRUE &&
response->body.buf) {
sdp_parser_t *parser;
sdp_session_t *sdp;
parser = sdp_parse(home,response->body.buf,response->body.length,0);
sdp = sdp_session(parser);
if(sdp) {
mrcp_descriptor_generate_by_rtsp_sdp_session(descriptor,sdp,0,pool);
descriptor->resource_state = TRUE;
descriptor->response_code = response->start_line.common.status_line.status_code;
}
else {
apt_string_assign(&descriptor->resource_name,resource_name,pool);
descriptor->resource_state = TRUE;
}
sdp_parser_free(parser);
}
else {
descriptor->resource_state = FALSE;
}
return descriptor;
}
/** Generate RTSP resource discovery response */
MRCP_DECLARE(rtsp_message_t*) rtsp_resource_discovery_response_generate(
const rtsp_message_t *request,
const char *ip,
const char *origin,
apr_pool_t *pool)
{
rtsp_message_t *response = rtsp_response_create(request,RTSP_STATUS_CODE_OK,RTSP_REASON_PHRASE_OK,pool);
if(response) {
apr_size_t offset = 0;
char buffer[2048];
apr_size_t size = sizeof(buffer);
if(!ip) {
ip = "0.0.0.0";
}
if(!origin) {
origin = "-";
}
buffer[0] = '\0';
offset += snprintf(buffer+offset,size-offset,
"v=0\r\n"
"o=%s 0 0 IN IP4 %s\r\n"
"s=-\r\n"
"c=IN IP4 %s\r\n"
"t=0 0\r\n"
"m=audio 0 RTP/AVP 0 8 96 101\r\n"
"a=rtpmap:0 PCMU/8000\r\n"
"a=rtpmap:8 PCMA/8000\r\n"
"a=rtpmap:96 L16/8000\r\n"
"a=rtpmap:101 telephone-event/8000\r\n",
origin,
ip,
ip);
if(offset) {
apt_string_assign_n(&response->body,buffer,offset,pool);
response->header.content_type = RTSP_CONTENT_TYPE_SDP;
rtsp_header_property_add(&response->header,RTSP_HEADER_FIELD_CONTENT_TYPE,response->pool);
response->header.content_length = offset;
rtsp_header_property_add(&response->header,RTSP_HEADER_FIELD_CONTENT_LENGTH,response->pool);
}
}
return response;
}
/** Get MRCP resource name by RTSP resource name */
MRCP_DECLARE(const char*) mrcp_name_get_by_rtsp_name(const apr_table_t *resource_map, const char *rtsp_name)
{
if(rtsp_name) {
const apr_array_header_t *header = apr_table_elts(resource_map);
apr_table_entry_t *entry = (apr_table_entry_t *)header->elts;
int i;
for(i=0; i<header->nelts; i++) {
if(!entry[i].val) continue;
if(strcasecmp(entry[i].val,rtsp_name) == 0) {
return entry[i].key;
}
}
apt_log(RTSP_LOG_MARK,APT_PRIO_WARNING,"Unknown RTSP Resource Name [%s]", rtsp_name);
}
return "unknown";
}
/** Get RTSP resource name by MRCP resource name */
MRCP_DECLARE(const char*) rtsp_name_get_by_mrcp_name(const apr_table_t *resource_map, const char *mrcp_name)
{
const char *rtsp_name = apr_table_get(resource_map,mrcp_name);
if(rtsp_name) {
return rtsp_name;
}
return mrcp_name;
}
| {
"content_hash": "be9cf90ed2590f4c2a60f277426987b6",
"timestamp": "",
"source": "github",
"line_count": 609,
"max_line_length": 198,
"avg_line_length": 33.77668308702791,
"alnum_prop": 0.6825960136120564,
"repo_name": "unispeech/unimrcp",
"id": "6b4cf58933cfc40f1abd1a2e46e1f0adf112eaee",
"size": "21172",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "modules/mrcp-unirtsp/src/mrcp_unirtsp_sdp.c",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "2033804"
},
{
"name": "C++",
"bytes": "154912"
},
{
"name": "CMake",
"bytes": "84069"
},
{
"name": "M4",
"bytes": "62930"
},
{
"name": "Makefile",
"bytes": "32416"
},
{
"name": "Shell",
"bytes": "3244"
}
],
"symlink_target": ""
} |
package com.formulasearchengine.mathmltools.utils;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class UtilityTest {
private String badExample =
"H^{*}_\\lambda =\\left(\\prod_{i=1}^{k}n_{i}!\\right)\\prod_{i<j}\\frac{n_{i}+n_{j}% }{n_{i}-n_{j}}=2^{-\\frac{k}{2}}\\sqrt{H_{\\tilde{\\lambda}}},\\quad\\frac{1}{\\sqrt{% H_{\\tilde{\\lambda}}}}=\\sqrt{s_{\\tilde{\\lambda}}({\\bf t}_{\\infty})}=2^{-\\frac{k% }{2}}Q_{\\lambda}(\\frac{{\\bf t}_{\\infty}}{2}),";
private String goodExample =
"H^{*}_{\\lambda} =\\left(\\prod_{i=1}^{k}n_{i}!\\right)\\prod_{i<j}\\frac{n_{i}+n_{j}" +
"}{n_{i}-n_{j}}=2^{-\\frac{k}{2}}\\sqrt{H_{\\tilde{\\lambda}}},\\quad\\frac{1}{\\sqrt{" +
"H_{\\tilde{\\lambda}}}}=\\sqrt{s_{\\tilde{\\lambda}}({\\bf t}_{\\infty})}=2^{-\\frac{k" +
"}{2}}Q_{\\lambda}(\\frac{{\\bf t}_{\\infty}}{2})";
@Test
public void htmlEscapeSimple() {
String simpleBad = "n_{j}% q";
String simpleGood = "n_{j}q";
assertEquals(simpleGood, Utility.latexPreProcessing(simpleBad));
}
@Test
public void htmlEscapeMultiSimple() {
String simpleMultiBad = "n_{% j}% q";
String simpleMultiGood = "n_{j}q";
assertEquals(simpleMultiGood, Utility.latexPreProcessing(simpleMultiBad));
}
@Test
public void htmlEscapeIntermediate() {
String intBad = "n_{% j<i}% q";
String intGood = "n_{j<i}q";
assertEquals(intGood, Utility.latexPreProcessing(intBad));
}
@Test
public void bugCheckUnderscore() {
String simpleBad = "n_\\lol";
String simpleGood = "n_{\\lol}";
assertEquals(simpleGood, Utility.latexPreProcessing(simpleBad));
}
@Test
public void bugCheckUnderscoreMulti() {
String multiBad = "H^{*}_\\lambda = K_\\Deluxe deluxe";
String multiGood = "H^{*}_{\\lambda} = K_{\\Deluxe} deluxe";
assertEquals(multiGood, Utility.latexPreProcessing(multiBad));
}
@Test
public void badEnding() {
String bad = "ib\\sa,";
String good = "ib\\sa";
assertEquals(good, Utility.latexPreProcessing(bad));
}
@Test
public void badStartEnding() {
String bad = "\\[\\{\\}\\]";
String good = "\\{\\}";
assertEquals(good, Utility.latexPreProcessing(bad));
}
@Test
public void realExample() {
assertEquals(goodExample, Utility.latexPreProcessing(badExample));
}
}
| {
"content_hash": "a17b3eb1ff2da9f2f723d9983d6d6c07",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 339,
"avg_line_length": 37.56521739130435,
"alnum_prop": 0.5567129629629629,
"repo_name": "physikerwelt/MathMLTools",
"id": "1d07044095e706c4607682ed2ee62421f298d772",
"size": "2592",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "mathml-utils/src/test/java/com/formulasearchengine/mathmltools/utils/UtilityTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "116587"
},
{
"name": "XQuery",
"bytes": "208"
},
{
"name": "XSLT",
"bytes": "69576"
}
],
"symlink_target": ""
} |
<?php
/* UserBundle:Group:show_content.html.twig */
class __TwigTemplate_79a34b6ef7efed5af149773d229ef0cdc312250319ab24b2dc1ba3c7a3daedd2 extends Twig_Template
{
public function __construct(Twig_Environment $env)
{
parent::__construct($env);
$this->parent = false;
$this->blocks = array(
);
}
protected function doDisplay(array $context, array $blocks = array())
{
// line 1
echo "<div class=\"fos_user_group_show\">
<p>";
// line 2
echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("group.show.name", array(), "FOSUserBundle"), "html", null, true);
echo ": ";
echo twig_escape_filter($this->env, $this->getAttribute((isset($context["group"]) ? $context["group"] : $this->getContext($context, "group")), "getName", array(), "method"), "html", null, true);
echo "</p>
</div>
";
}
public function getTemplateName()
{
return "UserBundle:Group:show_content.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 22 => 2, 19 => 1,);
}
}
/* <div class="fos_user_group_show">*/
/* <p>{{ 'group.show.name'|trans([], 'FOSUserBundle') }}: {{ group.getName() }}</p>*/
/* </div>*/
/* */
| {
"content_hash": "d184aa490fc48788ad0bfcb2844a25bd",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 202,
"avg_line_length": 28.145833333333332,
"alnum_prop": 0.5795706883789785,
"repo_name": "benhammadiali/ISETK",
"id": "cef6d8e4cbc748046f93d8a6272a03f2f7bddfea",
"size": "1351",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/cache/dev/twig/e7/e76d8cf7175335495f0c0fa1509865d1797fa8e49f995e5c82c95f72ab06740a.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "3073"
},
{
"name": "Batchfile",
"bytes": "401"
},
{
"name": "CSS",
"bytes": "139701"
},
{
"name": "HTML",
"bytes": "225691"
},
{
"name": "JavaScript",
"bytes": "245407"
},
{
"name": "PHP",
"bytes": "127112"
},
{
"name": "Shell",
"bytes": "1859"
}
],
"symlink_target": ""
} |
// Copyright 2021 The KeepTry Open Source Project
//
// 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 dp;
import string.MaxMatchNumberOfPatterns;
import java.util.Arrays;
public class Leetcode1039MinimumScoreTriangulationofPolygon {
public static int minScoreTriangulation(int[] values) {
/*
n == values.length
3 <= n <= 50
1 <= values[i] <= 100
values[i] is the value of the ith vertex (i.e., clockwise order).
*/
/*
Idea:
For a given convex n-sided polygon and one of its cutting solution.
A vertex can belong to one triangle or more triangles.
While an edge belongs to only one triangle for a given cutting solution.
In a given convex n-sided polygon with edges n > 3.
<1> Select an edge, it can be in n-2 triangles, and each triangle can cut the polygon into 2 or 3 parts including itself. Each part with edges m > 3
can going on along this way, till all cut parts are a triangle.
<2> In step <1>, for a given convex n-sided polygon, there are n options to select
the edge with its triangle to cut the polygon. The last possible cut resolutions
are same.
But the benefit of selecting the edge represented by the start vertex and end vertex
in the given convex n-sided polygon represented by vertex value: int[] values,
values[i] is the value of the ith vertex (i.e., clockwise order), is each cut part(s),
excepting the triangle used to cut, still can be represented by a subarray of
the int[] values.
Then the status translation equation comes from here
dp[i][j] is the smallest possible total score can achieved
with some triangulation of the convex n-sided polygon represented by vertex
value: int[] values, values[i] is the value of the ith vertex
(i.e., clockwise order).
dp[i][j] = min{values[i]*value[j]*value[x]+ dp[i][x]+dp[x][j]}
x is the index, i< x < j, 0<= x + 2 <= j <= n-1
Initial value of dp[i][j]:
according to the equation
dp[i][j] = 0 when j-i < 2. default value.
dp[i][j] = MAX_VALUE when j-i >= 2.
*/
int N = values.length;
int[][] dp = new int[N][N];
// O(N^3) time, O(N^2) space
for (int p = 3; p <= N; p++) {
for (int s = 0; s + p - 1 < N; s++) {
int e = s + p - 1;
dp[s][e] = Integer.MAX_VALUE;
for (int m = s + 1; m < e; m++) {
int tri = values[s] * values[e] * values[m];
dp[s][e] = Math.min(dp[s][e], dp[s][m] + tri + dp[m][e]);
}
}
}
return dp[0][N - 1];
}
public static void main(String[] args) {
System.out.println(minScoreTriangulation(new int[] {1, 2, 3}) == 6);
}
}
| {
"content_hash": "fd9cf9145e7b42e5c99c54cf4443b87b",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 153,
"avg_line_length": 41.55696202531646,
"alnum_prop": 0.6268656716417911,
"repo_name": "BruceZu/sawdust",
"id": "9d6a3b5521b37996f7fa62998bc3d6e22042600e",
"size": "3283",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "arrows/src/main/java/dp/Leetcode1039MinimumScoreTriangulationofPolygon.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "204"
},
{
"name": "GAP",
"bytes": "3991"
},
{
"name": "HTML",
"bytes": "50170"
},
{
"name": "Java",
"bytes": "1743989"
},
{
"name": "Python",
"bytes": "13432"
},
{
"name": "Shell",
"bytes": "233"
}
],
"symlink_target": ""
} |
package pl.designpatterns.structural.extensionobjects;
public class SoldierRole extends Role implements SoldierActions {
public SoldierRole(Actions actions) {
this.actions = actions;
}
@Override
public String whoAmI() {
return SoldierRole.class.getSimpleName();
}
@Override
public String openAfire() {
return actions.moveArms() + " The sheep is firing at cows.";
}
@Override
public String march() {
return actions.moveLegs() + " The sheep is marching.";
}
}
| {
"content_hash": "d24274116b63dfe91e52547618f36081",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 68,
"avg_line_length": 22.5,
"alnum_prop": 0.6518518518518519,
"repo_name": "vego1mar/JDP",
"id": "a3ef914303edfefc227308c3baa0d0d3c279a0a0",
"size": "540",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/pl/designpatterns/structural/extensionobjects/SoldierRole.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "145"
},
{
"name": "Java",
"bytes": "106037"
}
],
"symlink_target": ""
} |
<?xml version="1.0" ?><!DOCTYPE TS><TS language="sv" version="2.0">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Bitcoin</source>
<translation>Om Bitcoin</translation>
</message>
<message>
<location line="+39"/>
<source><b>Bitcoin</b> version</source>
<translation><b>Bitcoin</b>-version</translation>
</message>
<message>
<location line="+57"/>
<source>
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source>
<translation>
Detta är experimentell mjukvara.
Distribuerad under mjukvarulicensen MIT/X11, se den medföljande filen COPYING eller http://www.opensource.org/licenses/mit-license.php.
Denna produkten innehåller mjukvara utvecklad av OpenSSL Project för användning i OpenSSL Toolkit (http://www.openssl.org/) och kryptografisk mjukvara utvecklad av Eric Young (eay@cryptsoft.com) samt UPnP-mjukvara skriven av Thomas Bernard.</translation>
</message>
<message>
<location filename="../aboutdialog.cpp" line="+14"/>
<source>Copyright</source>
<translation>Copyright</translation>
</message>
<message>
<location line="+0"/>
<source>The Bitcoin developers</source>
<translation>Bitcoin-utvecklarna</translation>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation>Adressbok</translation>
</message>
<message>
<location line="+19"/>
<source>Double-click to edit address or label</source>
<translation>Dubbel-klicka för att ändra adressen eller etiketten</translation>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation>Skapa ny adress</translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Kopiera den markerade adressen till systemets Urklipp</translation>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation>&Ny adress</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+63"/>
<source>These are your Bitcoin 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>Detta är dina Bitcoin-adresser för att ta emot betalningar. Du kan ge varje avsändare en egen adress så att du kan hålla reda på vem som betalar dig.</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>&Copy Address</source>
<translation>&Kopiera adress</translation>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation>Visa &QR-kod</translation>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a Bitcoin address</source>
<translation>Signera ett meddelande för att bevisa att du äger denna adress</translation>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation>Signera &Meddelande</translation>
</message>
<message>
<location line="+25"/>
<source>Delete the currently selected address from the list</source>
<translation>Ta bort den valda adressen från listan</translation>
</message>
<message>
<location line="+27"/>
<source>Export the data in the current tab to a file</source>
<translation>Exportera informationen i den nuvarande fliken till en fil</translation>
</message>
<message>
<location line="+3"/>
<source>&Export</source>
<translation>&Exportera</translation>
</message>
<message>
<location line="-44"/>
<source>Verify a message to ensure it was signed with a specified Bitcoin address</source>
<translation>Verifiera meddelandet för att vara säker på att den var signerad med den specificerade Bitcoin-adressen</translation>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation>&Verifiera Meddelande</translation>
</message>
<message>
<location line="+14"/>
<source>&Delete</source>
<translation>&Radera</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="-5"/>
<source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>
<translation>Detta är dina Bitcoin adresser för att skicka betalningar. Kolla alltid summan och den mottagande adressen innan du skickar Bitcoins.</translation>
</message>
<message>
<location line="+13"/>
<source>Copy &Label</source>
<translation>Kopiera &etikett</translation>
</message>
<message>
<location line="+1"/>
<source>&Edit</source>
<translation>&Editera</translation>
</message>
<message>
<location line="+1"/>
<source>Send &Coins</source>
<translation>Skicka &Bitcoins</translation>
</message>
<message>
<location line="+265"/>
<source>Export Address Book Data</source>
<translation>Exportera Adressbok</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Kommaseparerad fil (*.csv)</translation>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation>Fel vid export</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Kunde inte skriva till filen %1.</translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+144"/>
<source>Label</source>
<translation>Etikett</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Adress</translation>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation>(Ingen etikett)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="+26"/>
<source>Passphrase Dialog</source>
<translation>Lösenords Dialog</translation>
</message>
<message>
<location line="+21"/>
<source>Enter passphrase</source>
<translation>Ange lösenord</translation>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation>Nytt lösenord</translation>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation>Upprepa nytt lösenord</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>Ange plånbokens nya lösenord. <br/> Använd ett lösenord på <b>10 eller fler slumpmässiga tecken,</b> eller <b>åtta eller fler ord.</b></translation>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation>Kryptera plånbok</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Denna operation behöver din plånboks lösenord för att låsa upp plånboken.</translation>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation>Lås upp plånbok</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Denna operation behöver din plånboks lösenord för att dekryptera plånboken.</translation>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation>Dekryptera plånbok</translation>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation>Ändra lösenord</translation>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>Ange plånbokens gamla och nya lösenord.</translation>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation>Bekräfta kryptering av plånbok</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>!</source>
<translation>VARNING: Om du krypterar din plånbok och glömmer ditt lösenord, kommer du att <b>FÖRLORA ALLA DINA TILLGÅNGAR</b>!</translation>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation>Är du säker på att du vill kryptera din plånbok?</translation>
</message>
<message>
<location line="+15"/>
<source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>
<translation>VIKTIGT: Alla tidigare säkerhetskopior du har gjort av plånbokens fil ska ersättas med den nya genererade, krypterade plånboks filen. Av säkerhetsskäl kommer tidigare säkerhetskopior av den okrypterade plånboks filen blir oanvändbara när du börjar använda en ny, krypterad plånbok.</translation>
</message>
<message>
<location line="+100"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation>Varning: Caps Lock är påslaget!</translation>
</message>
<message>
<location line="-130"/>
<location line="+58"/>
<source>Wallet encrypted</source>
<translation>Plånboken är krypterad</translation>
</message>
<message>
<location line="-56"/>
<source>Bitcoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>
<translation>Programmet kommer nu att stänga ner för att färdigställa krypteringen. Tänk på att en krypterad plånbok inte skyddar mot stöld om din dator är infekterad med en keylogger.</translation>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+42"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation>Kryptering av plånbok misslyckades</translation>
</message>
<message>
<location line="-54"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>Kryptering av plånbok misslyckades på grund av ett internt fel. Din plånbok blev inte krypterad.</translation>
</message>
<message>
<location line="+7"/>
<location line="+48"/>
<source>The supplied passphrases do not match.</source>
<translation>De angivna lösenorden överensstämmer inte.</translation>
</message>
<message>
<location line="-37"/>
<source>Wallet unlock failed</source>
<translation>Upplåsning av plånbok misslyckades</translation>
</message>
<message>
<location line="+1"/>
<location line="+11"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>Lösenordet för dekryptering av plånbok var felaktig.</translation>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation>Dekryptering av plånbok misslyckades</translation>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation>Plånbokens lösenord har ändrats.</translation>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="+254"/>
<source>Sign &message...</source>
<translation>Signera &meddelande...</translation>
</message>
<message>
<location line="+246"/>
<source>Synchronizing with network...</source>
<translation>Synkroniserar med nätverk...</translation>
</message>
<message>
<location line="-321"/>
<source>&Overview</source>
<translation>&Översikt</translation>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation>Visa översiktsvy av plånbok</translation>
</message>
<message>
<location line="+20"/>
<source>&Transactions</source>
<translation>&Transaktioner</translation>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation>Bläddra i transaktionshistorik</translation>
</message>
<message>
<location line="+7"/>
<source>Edit the list of stored addresses and labels</source>
<translation>Redigera listan med lagrade adresser och etiketter</translation>
</message>
<message>
<location line="-14"/>
<source>Show the list of addresses for receiving payments</source>
<translation>Visa listan med adresser för att ta emot betalningar</translation>
</message>
<message>
<location line="+31"/>
<source>E&xit</source>
<translation>&Avsluta</translation>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation>Avsluta programmet</translation>
</message>
<message>
<location line="+7"/>
<source>Show information about Bitcoin</source>
<translation>Visa information om Bitcoin</translation>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation>Om &Qt</translation>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation>Visa information om Qt</translation>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation>&Alternativ...</translation>
</message>
<message>
<location line="+9"/>
<source>&Encrypt Wallet...</source>
<translation>&Kryptera plånbok...</translation>
</message>
<message>
<location line="+3"/>
<source>&Backup Wallet...</source>
<translation>&Säkerhetskopiera plånbok...</translation>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation>&Byt Lösenord...</translation>
</message>
<message>
<location line="+251"/>
<source>Importing blocks from disk...</source>
<translation>Importerar block från disk...</translation>
</message>
<message>
<location line="+3"/>
<source>Reindexing blocks on disk...</source>
<translation>Återindexerar block på disken...</translation>
</message>
<message>
<location line="-319"/>
<source>Send coins to a Bitcoin address</source>
<translation>Skicka mynt till en Bitcoin-adress</translation>
</message>
<message>
<location line="+52"/>
<source>Modify configuration options for Bitcoin</source>
<translation>Ändra konfigurationsalternativ för Bitcoin</translation>
</message>
<message>
<location line="+12"/>
<source>Backup wallet to another location</source>
<translation>Säkerhetskopiera plånboken till en annan plats</translation>
</message>
<message>
<location line="+2"/>
<source>Change the passphrase used for wallet encryption</source>
<translation>Byt lösenord för kryptering av plånbok</translation>
</message>
<message>
<location line="+6"/>
<source>&Debug window</source>
<translation>&Debug fönster</translation>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation>Öppna debug- och diagnostikkonsolen</translation>
</message>
<message>
<location line="-4"/>
<source>&Verify message...</source>
<translation>&Verifiera meddelande...</translation>
</message>
<message>
<location line="-183"/>
<location line="+6"/>
<location line="+508"/>
<source>Bitcoin</source>
<translation>Bitcoin</translation>
</message>
<message>
<location line="-514"/>
<location line="+6"/>
<source>Wallet</source>
<translation>Plånbok</translation>
</message>
<message>
<location line="+107"/>
<source>&Send</source>
<translation>&Skicka</translation>
</message>
<message>
<location line="+7"/>
<source>&Receive</source>
<translation>&Ta emot</translation>
</message>
<message>
<location line="+14"/>
<source>&Addresses</source>
<translation>&Adresser</translation>
</message>
<message>
<location line="+23"/>
<location line="+2"/>
<source>&About Bitcoin</source>
<translation>&Om Bitcoin</translation>
</message>
<message>
<location line="+10"/>
<location line="+2"/>
<source>&Show / Hide</source>
<translation>&Visa / Göm</translation>
</message>
<message>
<location line="+1"/>
<source>Show or hide the main Window</source>
<translation>Visa eller göm huvudfönstret</translation>
</message>
<message>
<location line="+3"/>
<source>Encrypt the private keys that belong to your wallet</source>
<translation>Kryptera de privata nycklar som tillhör din plånbok</translation>
</message>
<message>
<location line="+7"/>
<source>Sign messages with your Bitcoin addresses to prove you own them</source>
<translation>Signera meddelanden med din Bitcoinadress för att bevisa att du äger dem</translation>
</message>
<message>
<location line="+2"/>
<source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>
<translation>Verifiera meddelanden för att vara säker på att de var signerade med den specificerade Bitcoin-adressen</translation>
</message>
<message>
<location line="+28"/>
<source>&File</source>
<translation>&Arkiv</translation>
</message>
<message>
<location line="+7"/>
<source>&Settings</source>
<translation>&Inställningar</translation>
</message>
<message>
<location line="+6"/>
<source>&Help</source>
<translation>&Hjälp</translation>
</message>
<message>
<location line="+9"/>
<source>Tabs toolbar</source>
<translation>Verktygsfält för Tabbar</translation>
</message>
<message>
<location line="-228"/>
<location line="+288"/>
<source>[testnet]</source>
<translation>[testnet]</translation>
</message>
<message>
<location line="-5"/>
<location line="+5"/>
<source>Bitcoin client</source>
<translation>Bitcoin-klient</translation>
</message>
<message numerus="yes">
<location line="+121"/>
<source>%n active connection(s) to Bitcoin network</source>
<translation><numerusform>%n aktiv anslutning till Bitcoin-nätverket</numerusform><numerusform>%n aktiva anslutningar till Bitcoin-nätverket</numerusform></translation>
</message>
<message>
<location line="+22"/>
<source>No block source available...</source>
<translation>Ingen block-källa tillgänglig...</translation>
</message>
<message>
<location line="+12"/>
<source>Processed %1 of %2 (estimated) blocks of transaction history.</source>
<translation>Bearbetat %1 av %2 (uppskattade) block av transaktionshistorik.</translation>
</message>
<message>
<location line="+4"/>
<source>Processed %1 blocks of transaction history.</source>
<translation>Bearbetat %1 block i transaktionshistoriken.</translation>
</message>
<message numerus="yes">
<location line="+20"/>
<source>%n hour(s)</source>
<translation><numerusform>%n timme</numerusform><numerusform>%n timmar</numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation><numerusform>%n dag</numerusform><numerusform>%n dagar</numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n week(s)</source>
<translation><numerusform>%n vecka</numerusform><numerusform>%n veckor</numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>%1 behind</source>
<translation>%1 efter</translation>
</message>
<message>
<location line="+14"/>
<source>Last received block was generated %1 ago.</source>
<translation>Senast mottagna block genererades %1 sen.</translation>
</message>
<message>
<location line="+2"/>
<source>Transactions after this will not yet be visible.</source>
<translation>Transaktioner efter denna kommer inte ännu vara synliga.</translation>
</message>
<message>
<location line="+22"/>
<source>Error</source>
<translation>Fel</translation>
</message>
<message>
<location line="+3"/>
<source>Warning</source>
<translation>Varning</translation>
</message>
<message>
<location line="+3"/>
<source>Information</source>
<translation>Information</translation>
</message>
<message>
<location line="+70"/>
<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>Transaktionen överskrider storleksgränsen. Du kan dock fortfarande skicka den mot en kostnad av %1, som går till noderna som behandlar din transaktion och bidrar till nätverket. Vill du betala denna avgift?</translation>
</message>
<message>
<location line="-140"/>
<source>Up to date</source>
<translation>Uppdaterad</translation>
</message>
<message>
<location line="+31"/>
<source>Catching up...</source>
<translation>Hämtar senaste...</translation>
</message>
<message>
<location line="+113"/>
<source>Confirm transaction fee</source>
<translation>Bekräfta överföringsavgift</translation>
</message>
<message>
<location line="+8"/>
<source>Sent transaction</source>
<translation>Transaktion skickad</translation>
</message>
<message>
<location line="+0"/>
<source>Incoming transaction</source>
<translation>Inkommande transaktion</translation>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation>Datum: %1
Belopp: %2
Typ: %3
Adress: %4
</translation>
</message>
<message>
<location line="+33"/>
<location line="+23"/>
<source>URI handling</source>
<translation>URI hantering</translation>
</message>
<message>
<location line="-23"/>
<location line="+23"/>
<source>URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>
<translation>URI går inte att tolkas! Detta kan orsakas av en ogiltig Bitcoin-adress eller felaktiga URI parametrar.</translation>
</message>
<message>
<location line="+17"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>Denna plånbok är <b>krypterad</b> och för närvarande <b>olåst</b></translation>
</message>
<message>
<location line="+8"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>Denna plånbok är <b>krypterad</b> och för närvarande <b>låst</b></translation>
</message>
<message>
<location filename="../bitcoin.cpp" line="+110"/>
<source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>
<translation>Ett allvarligt fel har uppstått. Bitcoin kan inte längre köras säkert och kommer att avslutas.</translation>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+105"/>
<source>Network Alert</source>
<translation>Nätverkslarm</translation>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation>Redigera Adress</translation>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation>&Etikett</translation>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation>Den etikett som är associerad med detta adressboksinlägg</translation>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation>&Adress</translation>
</message>
<message>
<location line="+10"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation>Adressen som är associerad med detta adressboksinlägg. Detta kan enbart ändras för sändande adresser.</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+21"/>
<source>New receiving address</source>
<translation>Ny mottagaradress</translation>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation>Ny avsändaradress</translation>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation>Redigera mottagaradress</translation>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation>Redigera avsändaradress</translation>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation>Den angivna adressen "%1" finns redan i adressboken.</translation>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid Bitcoin address.</source>
<translation>Den angivna adressen "%1" är inte en giltig Bitcoin-adress.</translation>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation>Plånboken kunde inte låsas upp.</translation>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation>Misslyckades med generering av ny nyckel.</translation>
</message>
</context>
<context>
<name>FreespaceChecker</name>
<message>
<location filename="../intro.cpp" line="+61"/>
<source>A new data directory will be created.</source>
<translation>En ny datakatalog kommer att skapas.</translation>
</message>
<message>
<location line="+22"/>
<source>name</source>
<translation>namn</translation>
</message>
<message>
<location line="+2"/>
<source>Directory already exists. Add %1 if you intend to create a new directory here.</source>
<translation>Katalogen finns redan. Läggtill %1 om du vill skapa en ny katalog här.</translation>
</message>
<message>
<location line="+3"/>
<source>Path already exists, and is not a directory.</source>
<translation>Sökvägen finns redan, och är inte en katalog.</translation>
</message>
<message>
<location line="+7"/>
<source>Cannot create data directory here.</source>
<translation>Kan inte skapa datakatalog här.</translation>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+517"/>
<location line="+13"/>
<source>Bitcoin-Qt</source>
<translation>Bitcoin-Qt</translation>
</message>
<message>
<location line="-13"/>
<source>version</source>
<translation>version</translation>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation>Användning:</translation>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation>kommandoradsalternativ</translation>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation>UI alternativ</translation>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation>Ändra språk, till exempel "de_DE" (förvalt: systemets språk)</translation>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation>Starta som minimerad</translation>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation>Visa startbilden vid uppstart (förvalt: 1)</translation>
</message>
<message>
<location line="+1"/>
<source>Choose data directory on startup (default: 0)</source>
<translation>Välj datakatalog vid uppstart (förvalt: 0)</translation>
</message>
</context>
<context>
<name>Intro</name>
<message>
<location filename="../forms/intro.ui" line="+14"/>
<source>Welcome</source>
<translation>Välkommen</translation>
</message>
<message>
<location line="+9"/>
<source>Welcome to Bitcoin-Qt.</source>
<translation>Välkommen till Bitcoin-Qt.</translation>
</message>
<message>
<location line="+26"/>
<source>As this is the first time the program is launched, you can choose where Bitcoin-Qt will store its data.</source>
<translation>Eftersom detta är första gången programmet startas, kan du välja var Bitcoin-Qt ska lagra sina data.</translation>
</message>
<message>
<location line="+10"/>
<source>Bitcoin-Qt will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory.</source>
<translation>Bitcoin-QT kommer att ladda ner och spara en kopia av Bitcoin blockkedjan. Åtminstone %1GB av data kommer att sparas i denna katalog, och den kommer att växa övertiden. Plånboken kommer också att sparas i denna katalog.</translation>
</message>
<message>
<location line="+10"/>
<source>Use the default data directory</source>
<translation>Använd den förvalda datakatalogen</translation>
</message>
<message>
<location line="+7"/>
<source>Use a custom data directory:</source>
<translation>Använd en anpassad datakatalog:</translation>
</message>
<message>
<location filename="../intro.cpp" line="+100"/>
<source>Error</source>
<translation>Fel</translation>
</message>
<message>
<location line="+9"/>
<source>GB of free space available</source>
<translation>GB ledigt utrymme är tillgängligt</translation>
</message>
<message>
<location line="+3"/>
<source>(of %1GB needed)</source>
<translation>(av %1GB behövs)</translation>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../forms/optionsdialog.ui" line="+14"/>
<source>Options</source>
<translation>Alternativ</translation>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation>&Allmänt</translation>
</message>
<message>
<location line="+6"/>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source>
<translation>Valfri transaktionsavgift per kB som ser till att dina transaktioner behandlas snabbt. De flesta transaktioner är 1 kB.</translation>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation>Betala överförings&avgift</translation>
</message>
<message>
<location line="+31"/>
<source>Automatically start Bitcoin after logging in to the system.</source>
<translation>Starta Bitcoin automatiskt efter inloggning.</translation>
</message>
<message>
<location line="+3"/>
<source>&Start Bitcoin on system login</source>
<translation>&Starta Bitcoin vid systemstart</translation>
</message>
<message>
<location line="+35"/>
<source>Reset all client options to default.</source>
<translation>Återställ alla klient inställningar till förvalen.</translation>
</message>
<message>
<location line="+3"/>
<source>&Reset Options</source>
<translation>&Återställ Alternativ</translation>
</message>
<message>
<location line="+13"/>
<source>&Network</source>
<translation>&Nätverk</translation>
</message>
<message>
<location line="+6"/>
<source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation>Öppna automatiskt Bitcoin-klientens port på routern. Detta fungerar endast om din router har UPnP aktiverat.</translation>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation>Tilldela port med hjälp av &UPnP</translation>
</message>
<message>
<location line="+7"/>
<source>Connect to the Bitcoin network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation>Anslut till Bitcoin-nätverket genom en SOCKS-proxy (t.ex. när du ansluter genom Tor).</translation>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation>&Anslut genom SOCKS-proxy:</translation>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation>Proxy-&IP: </translation>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation>Proxyns IP-adress (t.ex. 127.0.0.1)</translation>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation>&Port: </translation>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation>Proxyns port (t.ex. 9050)</translation>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation>SOCKS &Version:</translation>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation>SOCKS version av proxyn (t.ex. 5)</translation>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation>&Fönster</translation>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation>Visa endast en systemfältsikon vid minimering.</translation>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation>&Minimera till systemfältet istället för aktivitetsfältet</translation>
</message>
<message>
<location line="+7"/>
<source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>
<translation>Minimera applikationen istället för att stänga ner den när fönstret stängs. Detta innebär att programmet fotrsätter att köras tills du väljer Avsluta i menyn.</translation>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation>M&inimera vid stängning</translation>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation>&Visa</translation>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation>Användargränssnittets &språk: </translation>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting Bitcoin.</source>
<translation>Användargränssnittets språk kan ställas in här. Denna inställning träder i kraft efter en omstart av Bitcoin.</translation>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation>&Måttenhet att visa belopp i: </translation>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation>Välj en måttenhet att visa när du skickar mynt.</translation>
</message>
<message>
<location line="+9"/>
<source>Whether to show Bitcoin addresses in the transaction list or not.</source>
<translation>Anger om Bitcoin-adresser skall visas i transaktionslistan.</translation>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation>&Visa adresser i transaktionslistan</translation>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation>&OK</translation>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation>&Avbryt</translation>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation>&Verkställ</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+54"/>
<source>default</source>
<translation>standard</translation>
</message>
<message>
<location line="+130"/>
<source>Confirm options reset</source>
<translation>Bekräfta att alternativen ska återställs</translation>
</message>
<message>
<location line="+1"/>
<source>Some settings may require a client restart to take effect.</source>
<translation>Vissa inställningar kan behöva en omstart av klienten för att börja gälla.</translation>
</message>
<message>
<location line="+0"/>
<source>Do you want to proceed?</source>
<translation>Vill du fortsätta?</translation>
</message>
<message>
<location line="+42"/>
<location line="+9"/>
<source>Warning</source>
<translation>Varning</translation>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting Bitcoin.</source>
<translation>Denna inställning träder i kraft efter en omstart av Bitcoin.</translation>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation>Den medföljande proxy adressen är ogiltig.</translation>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation>Formulär</translation>
</message>
<message>
<location line="+50"/>
<location line="+202"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>
<translation>Den visade informationen kan vara inaktuell. Plånboken synkroniseras automatiskt med Bitcoin-nätverket efter att anslutningen är upprättad, men denna process har inte slutförts ännu.</translation>
</message>
<message>
<location line="-131"/>
<source>Unconfirmed:</source>
<translation>Obekräftade:</translation>
</message>
<message>
<location line="-78"/>
<source>Wallet</source>
<translation>Plånbok</translation>
</message>
<message>
<location line="+49"/>
<source>Confirmed:</source>
<translation>Bekräftade:</translation>
</message>
<message>
<location line="+16"/>
<source>Your current spendable balance</source>
<translation>Ditt tillgängliga saldo</translation>
</message>
<message>
<location line="+29"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>
<translation>Totalt antal transaktioner som ännu inte bekräftats, och som ännu inte räknas med i aktuellt saldo</translation>
</message>
<message>
<location line="+13"/>
<source>Immature:</source>
<translation>Omogen:</translation>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation>Den genererade balansen som ännu inte har mognat</translation>
</message>
<message>
<location line="+13"/>
<source>Total:</source>
<translation>Totalt:</translation>
</message>
<message>
<location line="+16"/>
<source>Your current total balance</source>
<translation>Ditt nuvarande totala saldo</translation>
</message>
<message>
<location line="+53"/>
<source><b>Recent transactions</b></source>
<translation><b>Nyligen genomförda transaktioner</b></translation>
</message>
<message>
<location filename="../overviewpage.cpp" line="+116"/>
<location line="+1"/>
<source>out of sync</source>
<translation>osynkroniserad</translation>
</message>
</context>
<context>
<name>PaymentServer</name>
<message>
<location filename="../paymentserver.cpp" line="+108"/>
<source>Cannot start bitcoin: click-to-pay handler</source>
<translation>Kan inte starta bitcoin: klicka-och-betala handhavare</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location filename="../bitcoin.cpp" line="+92"/>
<location filename="../intro.cpp" line="-32"/>
<source>Bitcoin</source>
<translation>Bitcoin</translation>
</message>
<message>
<location line="+1"/>
<source>Error: Specified data directory "%1" does not exist.</source>
<translation>Fel: Den angivna datakatalogen "%1" finns inte.</translation>
</message>
<message>
<location filename="../intro.cpp" line="+1"/>
<source>Error: Specified data directory "%1" can not be created.</source>
<translation>Fel: Den angivna datakatalogen "%1" kan inte skapas.</translation>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="+14"/>
<source>QR Code Dialog</source>
<translation>QR-kod dialogruta</translation>
</message>
<message>
<location line="+59"/>
<source>Request Payment</source>
<translation>Begär Betalning</translation>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation>Belopp:</translation>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation>Etikett:</translation>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation>Meddelande:</translation>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation>&Spara som...</translation>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+64"/>
<source>Error encoding URI into QR Code.</source>
<translation>Fel vid skapande av QR-kod från URI.</translation>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation>Det angivna beloppet är ogiltigt, vänligen kontrollera.</translation>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation>URI:n är för lång, försöka minska texten för etikett / meddelande.</translation>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation>Spara QR-kod</translation>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation>PNG-bilder (*.png)</translation>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation>Klientnamn</translation>
</message>
<message>
<location line="+10"/>
<location line="+23"/>
<location line="+26"/>
<location line="+23"/>
<location line="+23"/>
<location line="+36"/>
<location line="+53"/>
<location line="+23"/>
<location line="+23"/>
<location filename="../rpcconsole.cpp" line="+345"/>
<source>N/A</source>
<translation>ej tillgänglig</translation>
</message>
<message>
<location line="-217"/>
<source>Client version</source>
<translation>Klient-version</translation>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation>&Information</translation>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation>Använder OpenSSL version</translation>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation>Uppstartstid</translation>
</message>
<message>
<location line="+29"/>
<source>Network</source>
<translation>Nätverk</translation>
</message>
<message>
<location line="+7"/>
<source>Number of connections</source>
<translation>Antalet anslutningar</translation>
</message>
<message>
<location line="+23"/>
<source>On testnet</source>
<translation>På testnet</translation>
</message>
<message>
<location line="+23"/>
<source>Block chain</source>
<translation>Blockkedja</translation>
</message>
<message>
<location line="+7"/>
<source>Current number of blocks</source>
<translation>Aktuellt antal block</translation>
</message>
<message>
<location line="+23"/>
<source>Estimated total blocks</source>
<translation>Beräknade totala block</translation>
</message>
<message>
<location line="+23"/>
<source>Last block time</source>
<translation>Sista blocktid</translation>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation>&Öppna</translation>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation>Kommandoradsalternativ</translation>
</message>
<message>
<location line="+7"/>
<source>Show the Bitcoin-Qt help message to get a list with possible Bitcoin command-line options.</source>
<translation>Visa Bitcoin-Qt hjälpmeddelande för att få en lista med möjliga Bitcoin kommandoradsalternativ.</translation>
</message>
<message>
<location line="+3"/>
<source>&Show</source>
<translation>&Visa</translation>
</message>
<message>
<location line="+24"/>
<source>&Console</source>
<translation>&Konsol</translation>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation>Kompileringsdatum</translation>
</message>
<message>
<location line="-104"/>
<source>Bitcoin - Debug window</source>
<translation>Bitcoin - Debug fönster</translation>
</message>
<message>
<location line="+25"/>
<source>Bitcoin Core</source>
<translation>Bitcoin Kärna</translation>
</message>
<message>
<location line="+279"/>
<source>Debug log file</source>
<translation>Debugloggfil</translation>
</message>
<message>
<location line="+7"/>
<source>Open the Bitcoin debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation>Öppna Bitcoin debug-loggfilen som finns i datakatalogen. Detta kan ta några sekunder för stora loggfiler.</translation>
</message>
<message>
<location line="+102"/>
<source>Clear console</source>
<translation>Rensa konsollen</translation>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-30"/>
<source>Welcome to the Bitcoin RPC console.</source>
<translation>Välkommen till Bitcoin RPC-konsollen.</translation>
</message>
<message>
<location line="+1"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation>Använd upp- och ner-pilarna för att navigera i historiken, och <b>Ctrl-L</b> för att rensa skärmen.</translation>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation>Skriv <b>help</b> för en översikt av alla kommandon.</translation>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="+14"/>
<location filename="../sendcoinsdialog.cpp" line="+128"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation>Skicka pengar</translation>
</message>
<message>
<location line="+50"/>
<source>Send to multiple recipients at once</source>
<translation>Skicka till flera mottagare samtidigt</translation>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation>Lägg till &mottagare</translation>
</message>
<message>
<location line="+20"/>
<source>Remove all transaction fields</source>
<translation>Ta bort alla transaktions-fält</translation>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation>Rensa &alla</translation>
</message>
<message>
<location line="+22"/>
<source>Balance:</source>
<translation>Balans:</translation>
</message>
<message>
<location line="+10"/>
<source>123.456 BTC</source>
<translation>123,456 BTC</translation>
</message>
<message>
<location line="+31"/>
<source>Confirm the send action</source>
<translation>Bekräfta sändordern</translation>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation>&Skicka</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-62"/>
<location line="+2"/>
<source><b>%1</b> to %2 (%3)</source>
<translation><b>%1</b> till %2 (%3)</translation>
</message>
<message>
<location line="+6"/>
<source>Confirm send coins</source>
<translation>Bekräfta skickade mynt</translation>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation>Är du säker på att du vill skicka %1?</translation>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation> och </translation>
</message>
<message>
<location line="+23"/>
<source>The recipient address is not valid, please recheck.</source>
<translation>Mottagarens adress är inte giltig, vänligen kontrollera igen.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation>Det betalade beloppet måste vara större än 0.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation>Värdet överstiger ditt saldo.</translation>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation>Totalvärdet överstiger ditt saldo när transaktionsavgiften %1 är pålagd.</translation>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation>Dubblett av adress funnen, kan bara skicka till varje adress en gång per sändning.</translation>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed!</source>
<translation>Fel: Transaktionen gick inte att skapa!</translation>
</message>
<message>
<location line="+5"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation>Fel: Transaktionen avslogs. Detta kan hända om några av mynten i plånboken redan spenderats, t.ex om du använt en kopia av wallet.dat och mynt spenderades i kopian men inte markerats som spenderas här.</translation>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation>Formulär</translation>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation>&Belopp:</translation>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation>Betala &Till:</translation>
</message>
<message>
<location line="+34"/>
<source>The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation>Adressen som betalningen skall skickas till (t.ex. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>
</message>
<message>
<location line="+60"/>
<location filename="../sendcoinsentry.cpp" line="+26"/>
<source>Enter a label for this address to add it to your address book</source>
<translation>Ange ett namn för den här adressen och lägg till den i din adressbok</translation>
</message>
<message>
<location line="-78"/>
<source>&Label:</source>
<translation>&Etikett:</translation>
</message>
<message>
<location line="+28"/>
<source>Choose address from address book</source>
<translation>Välj adress från adresslistan</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="+7"/>
<source>Paste address from clipboard</source>
<translation>Klistra in adress från Urklipp</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+7"/>
<source>Remove this recipient</source>
<translation>Ta bort denna mottagare</translation>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation>Ange en Bitcoin-adress (t.ex. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="+14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation>Signaturer - Signera / Verifiera ett Meddelande</translation>
</message>
<message>
<location line="+13"/>
<source>&Sign Message</source>
<translation>&Signera Meddelande</translation>
</message>
<message>
<location line="+6"/>
<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>Du kan signera meddelanden med dina adresser för att bevisa att du äger dem. Var försiktig med vad du signerar eftersom phising-attacker kan försöka få dig att skriva över din identitet till någon annan. Signera bara väldetaljerade påståenden du kan gå i god för.</translation>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation>Adressen att signera meddelandet med (t.ex. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>
</message>
<message>
<location line="+10"/>
<location line="+213"/>
<source>Choose an address from the address book</source>
<translation>Välj en adress från adressboken</translation>
</message>
<message>
<location line="-203"/>
<location line="+213"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="-203"/>
<source>Paste address from clipboard</source>
<translation>Klistra in adress från Urklipp</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+12"/>
<source>Enter the message you want to sign here</source>
<translation>Skriv in meddelandet du vill signera här</translation>
</message>
<message>
<location line="+7"/>
<source>Signature</source>
<translation>Signatur</translation>
</message>
<message>
<location line="+27"/>
<source>Copy the current signature to the system clipboard</source>
<translation>Kopiera signaturen till systemets Urklipp</translation>
</message>
<message>
<location line="+21"/>
<source>Sign the message to prove you own this Bitcoin address</source>
<translation>Signera meddelandet för att bevisa att du äger denna adress</translation>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation>Signera &Meddelande</translation>
</message>
<message>
<location line="+14"/>
<source>Reset all sign message fields</source>
<translation>Rensa alla fält</translation>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation>Rensa &alla</translation>
</message>
<message>
<location line="-87"/>
<source>&Verify Message</source>
<translation>&Verifiera Meddelande</translation>
</message>
<message>
<location line="+6"/>
<source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source>
<translation>Skriv in din adress, meddelande (se till att du kopierar radbrytningar, mellanslag, tabbar, osv. exakt) och signatur nedan för att verifiera meddelandet. Var noga med att inte läsa in mer i signaturen än vad som finns i det signerade meddelandet, för att undvika att luras av en man-in-the-middle attack.</translation>
</message>
<message>
<location line="+21"/>
<source>The address the message was signed with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation>Adressen som meddelandet var signerat med (t.ex. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified Bitcoin address</source>
<translation>Verifiera meddelandet för att vara säker på att den var signerad med den angivna Bitcoin-adressen</translation>
</message>
<message>
<location line="+3"/>
<source>Verify &Message</source>
<translation>Verifiera &Meddelande</translation>
</message>
<message>
<location line="+14"/>
<source>Reset all verify message fields</source>
<translation>Rensa alla fält</translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+27"/>
<location line="+3"/>
<source>Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation>Ange en Bitcoin-adress (t.ex. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation>Klicka "Signera Meddelande" för att få en signatur</translation>
</message>
<message>
<location line="+3"/>
<source>Enter Bitcoin signature</source>
<translation>Ange Bitcoin-signatur</translation>
</message>
<message>
<location line="+82"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation>Den angivna adressen är ogiltig.</translation>
</message>
<message>
<location line="-81"/>
<location line="+8"/>
<location line="+73"/>
<location line="+8"/>
<source>Please check the address and try again.</source>
<translation>Vad god kontrollera adressen och försök igen.</translation>
</message>
<message>
<location line="-81"/>
<location line="+81"/>
<source>The entered address does not refer to a key.</source>
<translation>Den angivna adressen refererar inte till en nyckel.</translation>
</message>
<message>
<location line="-73"/>
<source>Wallet unlock was cancelled.</source>
<translation>Upplåsningen av plånboken avbröts.</translation>
</message>
<message>
<location line="+8"/>
<source>Private key for the entered address is not available.</source>
<translation>Privata nyckel för den angivna adressen är inte tillgänglig.</translation>
</message>
<message>
<location line="+12"/>
<source>Message signing failed.</source>
<translation>Signeringen av meddelandet misslyckades.</translation>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation>Meddelandet är signerat.</translation>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation>Signaturen kunde inte avkodas.</translation>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation>Kontrollera signaturen och försök igen.</translation>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation>Signaturen matchade inte meddelandesammanfattningen.</translation>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation>Meddelandet verifikation misslyckades.</translation>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation>Meddelandet är verifierad.</translation>
</message>
</context>
<context>
<name>SplashScreen</name>
<message>
<location filename="../splashscreen.cpp" line="+22"/>
<source>The Bitcoin developers</source>
<translation>Bitcoin-utvecklarna</translation>
</message>
<message>
<location line="+1"/>
<source>[testnet]</source>
<translation>[testnet]</translation>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+20"/>
<source>Open until %1</source>
<translation>Öppet till %1</translation>
</message>
<message>
<location line="+6"/>
<source>%1/offline</source>
<translation>%1/nerkopplad</translation>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation>%1/obekräftade</translation>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation>%1 bekräftelser</translation>
</message>
<message>
<location line="+18"/>
<source>Status</source>
<translation>Status</translation>
</message>
<message numerus="yes">
<location line="+7"/>
<source>, broadcast through %n node(s)</source>
<translation><numerusform>, sänd genom %n nod</numerusform><numerusform>, sänd genom %n noder</numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation>Datum</translation>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation>Källa</translation>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation>Genererad</translation>
</message>
<message>
<location line="+5"/>
<location line="+17"/>
<source>From</source>
<translation>Från</translation>
</message>
<message>
<location line="+1"/>
<location line="+22"/>
<location line="+58"/>
<source>To</source>
<translation>Till</translation>
</message>
<message>
<location line="-77"/>
<location line="+2"/>
<source>own address</source>
<translation>egen adress</translation>
</message>
<message>
<location line="-2"/>
<source>label</source>
<translation>etikett</translation>
</message>
<message>
<location line="+37"/>
<location line="+12"/>
<location line="+45"/>
<location line="+17"/>
<location line="+30"/>
<source>Credit</source>
<translation>Kredit</translation>
</message>
<message numerus="yes">
<location line="-102"/>
<source>matures in %n more block(s)</source>
<translation><numerusform>mognar om %n block</numerusform><numerusform>mognar om %n fler block</numerusform></translation>
</message>
<message>
<location line="+2"/>
<source>not accepted</source>
<translation>inte accepterad</translation>
</message>
<message>
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
<location line="+30"/>
<source>Debit</source>
<translation>Belasta</translation>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation>Transaktionsavgift</translation>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation>Nettobelopp</translation>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation>Meddelande</translation>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation>Kommentar</translation>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation>Transaktions-ID</translation>
</message>
<message>
<location line="+3"/>
<source>Generated coins must mature 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, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation>Genererade mynt måste vänta 120 block innan de kan användas. När du skapade detta block sändes det till nätverket för att läggas till i blockkedjan. Om blocket inte kommer in i kedjan kommer det att ändras till "accepteras inte" och kommer ej att gå att spendera. Detta kan ibland hända om en annan nod genererar ett block nästan samtidigt som dig.</translation>
</message>
<message>
<location line="+7"/>
<source>Debug information</source>
<translation>Debug information</translation>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation>Transaktion</translation>
</message>
<message>
<location line="+3"/>
<source>Inputs</source>
<translation>Inputs</translation>
</message>
<message>
<location line="+23"/>
<source>Amount</source>
<translation>Mängd</translation>
</message>
<message>
<location line="+1"/>
<source>true</source>
<translation>sant</translation>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation>falsk</translation>
</message>
<message>
<location line="-209"/>
<source>, has not been successfully broadcast yet</source>
<translation>, har inte lyckats skickas ännu</translation>
</message>
<message numerus="yes">
<location line="-35"/>
<source>Open for %n more block(s)</source>
<translation><numerusform>Öppet för %n mer block</numerusform><numerusform>Öppet för %n mer block</numerusform></translation>
</message>
<message>
<location line="+70"/>
<source>unknown</source>
<translation>okänd</translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="+14"/>
<source>Transaction details</source>
<translation>Transaktionsdetaljer</translation>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation>Den här panelen visar en detaljerad beskrivning av transaktionen</translation>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="+225"/>
<source>Date</source>
<translation>Datum</translation>
</message>
<message>
<location line="+0"/>
<source>Type</source>
<translation>Typ</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Adress</translation>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation>Mängd</translation>
</message>
<message numerus="yes">
<location line="+57"/>
<source>Open for %n more block(s)</source>
<translation><numerusform>Öppet för %n mer block</numerusform><numerusform>Öppet för %n mer block</numerusform></translation>
</message>
<message>
<location line="+3"/>
<source>Open until %1</source>
<translation>Öppet till %1</translation>
</message>
<message>
<location line="+3"/>
<source>Offline (%1 confirmations)</source>
<translation>Offline (%1 bekräftelser)</translation>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed (%1 of %2 confirmations)</source>
<translation>Obekräftad (%1 av %2 bekräftelser)</translation>
</message>
<message>
<location line="+3"/>
<source>Confirmed (%1 confirmations)</source>
<translation>Bekräftad (%1 bekräftelser)</translation>
</message>
<message numerus="yes">
<location line="+8"/>
<source>Mined balance will be available when it matures in %n more block(s)</source>
<translation><numerusform>Genererade balansen kommer att finnas tillgänglig när den mognar om %n mer block</numerusform><numerusform>Genererade balansen kommer att finnas tillgänglig när den mognar om %n fler block</numerusform></translation>
</message>
<message>
<location line="+5"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation>Det här blocket togs inte emot av några andra noder och kommer antagligen inte att bli godkänt.</translation>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation>Genererad men inte accepterad</translation>
</message>
<message>
<location line="+43"/>
<source>Received with</source>
<translation>Mottagen med</translation>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation>Mottaget från</translation>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation>Skickad till</translation>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation>Betalning till dig själv</translation>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation>Genererade</translation>
</message>
<message>
<location line="+38"/>
<source>(n/a)</source>
<translation>(n/a)</translation>
</message>
<message>
<location line="+199"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>Transaktionsstatus. Håll muspekaren över för att se antal bekräftelser.</translation>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation>Tidpunkt då transaktionen mottogs.</translation>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation>Transaktionstyp.</translation>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation>Transaktionens destinationsadress.</translation>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation>Belopp draget eller tillagt till balans.</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+52"/>
<location line="+16"/>
<source>All</source>
<translation>Alla</translation>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation>Idag</translation>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation>Denna vecka</translation>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation>Denna månad</translation>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation>Föregående månad</translation>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation>Det här året</translation>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation>Period...</translation>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation>Mottagen med</translation>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation>Skickad till</translation>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation>Till dig själv</translation>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation>Genererade</translation>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation>Övriga</translation>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation>Sök efter adress eller etikett </translation>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation>Minsta mängd</translation>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation>Kopiera adress</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>Kopiera etikett</translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>Kopiera belopp</translation>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation>Kopiera transaktions ID</translation>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation>Ändra etikett</translation>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation>Visa transaktionsdetaljer</translation>
</message>
<message>
<location line="+143"/>
<source>Export Transaction Data</source>
<translation>Exportera Transaktionsdata</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Kommaseparerad fil (*. csv)</translation>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation>Bekräftad</translation>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation>Datum</translation>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation>Typ</translation>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation>Etikett</translation>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation>Adress</translation>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation>Mängd</translation>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation>ID</translation>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation>Fel vid export</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Kunde inte skriva till filen %1.</translation>
</message>
<message>
<location line="+100"/>
<source>Range:</source>
<translation>Intervall:</translation>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation>till</translation>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+193"/>
<source>Send Coins</source>
<translation>Skicka pengar</translation>
</message>
</context>
<context>
<name>WalletView</name>
<message>
<location filename="../walletview.cpp" line="+46"/>
<source>&Export</source>
<translation>&Exportera</translation>
</message>
<message>
<location line="+1"/>
<source>Export the data in the current tab to a file</source>
<translation>Exportera informationen i den nuvarande fliken till en fil</translation>
</message>
<message>
<location line="+197"/>
<source>Backup Wallet</source>
<translation>Säkerhetskopiera Plånbok</translation>
</message>
<message>
<location line="+0"/>
<source>Wallet Data (*.dat)</source>
<translation>Plånboks-data (*.dat)</translation>
</message>
<message>
<location line="+3"/>
<source>Backup Failed</source>
<translation>Säkerhetskopiering misslyckades</translation>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation>Det inträffade ett fel när plånboken skulle sparas till den nya platsen.</translation>
</message>
<message>
<location line="+4"/>
<source>Backup Successful</source>
<translation>Säkerhetskopiering lyckades</translation>
</message>
<message>
<location line="+0"/>
<source>The wallet data was successfully saved to the new location.</source>
<translation>Plånbokens data har sparats till den nya platsen.</translation>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+98"/>
<source>Bitcoin version</source>
<translation>Bitcoin version</translation>
</message>
<message>
<location line="+104"/>
<source>Usage:</source>
<translation>Användning:</translation>
</message>
<message>
<location line="-30"/>
<source>Send command to -server or bitcoind</source>
<translation>Skicka kommando till -server eller bitcoind</translation>
</message>
<message>
<location line="-23"/>
<source>List commands</source>
<translation>Lista kommandon</translation>
</message>
<message>
<location line="-13"/>
<source>Get help for a command</source>
<translation>Få hjälp med ett kommando</translation>
</message>
<message>
<location line="+25"/>
<source>Options:</source>
<translation>Inställningar:</translation>
</message>
<message>
<location line="+24"/>
<source>Specify configuration file (default: bitcoin.conf)</source>
<translation>Ange konfigurationsfil (förvalt: bitcoin.conf)</translation>
</message>
<message>
<location line="+3"/>
<source>Specify pid file (default: bitcoind.pid)</source>
<translation>Ange pid fil (förvalt: bitcoind.pid)</translation>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation>Ange katalog för data</translation>
</message>
<message>
<location line="-9"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation>Sätt databas cache storleken i megabyte (förvalt: 25)</translation>
</message>
<message>
<location line="-28"/>
<source>Listen for connections on <port> (default: 8333 or testnet: 18333)</source>
<translation>Lyssna efter anslutningar på <port> (förvalt: 8333 eller testnet: 18333)</translation>
</message>
<message>
<location line="+5"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation>Ha som mest <n> anslutningar till andra klienter (förvalt: 125)</translation>
</message>
<message>
<location line="-49"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation>Anslut till en nod för att hämta klientadresser, och koppla från</translation>
</message>
<message>
<location line="+84"/>
<source>Specify your own public address</source>
<translation>Ange din egen publika adress</translation>
</message>
<message>
<location line="+3"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation>Tröskelvärde för att koppla ifrån klienter som missköter sig (förvalt: 100)</translation>
</message>
<message>
<location line="-136"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation>Antal sekunder att hindra klienter som missköter sig från att ansluta (förvalt: 86400)</translation>
</message>
<message>
<location line="-33"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation>Ett fel uppstod vid upprättandet av RPC port %u för att lyssna på IPv4: %s</translation>
</message>
<message>
<location line="+31"/>
<source>Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332)</source>
<translation>Lyssna på JSON-RPC-anslutningar på <port> (förvalt: 8332 eller testnet: 18332)</translation>
</message>
<message>
<location line="+37"/>
<source>Accept command line and JSON-RPC commands</source>
<translation>Tillåt kommandon från kommandotolken och JSON-RPC-kommandon</translation>
</message>
<message>
<location line="+77"/>
<source>Run in the background as a daemon and accept commands</source>
<translation>Kör i bakgrunden som tjänst och acceptera kommandon</translation>
</message>
<message>
<location line="+38"/>
<source>Use the test network</source>
<translation>Använd testnätverket</translation>
</message>
<message>
<location line="-114"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation>Acceptera anslutningar utifrån (förvalt: 1 om ingen -proxy eller -connect)</translation>
</message>
<message>
<location line="-84"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=bitcoinrpc
rpcpassword=%s
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com
</source>
<translation>%s, du behöver sätta ett rpclösensord i konfigurationsfilen:
%s
Det är rekommenderat att använda följande slumpade lösenord:
rpcuser=bitcoinrpc
rpcpassword=%s
(du behöver inte komma ihåg lösenordet)
Användarnamnet och lösenordet FÅR INTE bara detsamma.
Om filen inte existerar, skapa den med enbart ägarläsbara filrättigheter.
Det är också rekommenderat att sätta alertnotify så du meddelas om problem;
till exempel: alertnotify=echo %%s | mail -s "Bitcoin Alert" admin@foo.com
</translation>
</message>
<message>
<location line="+17"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source>
<translation>Ett fel uppstod vid upprättandet av RPC port %u för att lyssna på IPv6, faller tillbaka till IPV4: %s</translation>
</message>
<message>
<location line="+3"/>
<source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>
<translation>Bind till given adress och lyssna alltid på den. Använd [värd]:port notation för IPv6</translation>
</message>
<message>
<location line="+3"/>
<source>Cannot obtain a lock on data directory %s. Bitcoin is probably already running.</source>
<translation>Kan inte låsa data-mappen %s. Bitcoin körs förmodligen redan.</translation>
</message>
<message>
<location line="+3"/>
<source>Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development.</source>
<translation>Ange regressiontestläge, som använder en speciell kedja i vilka block kan lösas omedelbart. Detta är avsett för regressiontestnings verktyg och applikationsutveckling.</translation>
</message>
<message>
<location line="+4"/>
<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>Fel: Transaktionen avslogs! Detta kan hända om några av mynten i plånboken redan spenderats, t.ex om du använt en kopia av wallet.dat och mynt spenderades i kopian men inte markerats som spenderas här.</translation>
</message>
<message>
<location line="+4"/>
<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>Fel: Denna transaktion kräver en transaktionsavgift på minst %s på grund av dess storlek, komplexitet, eller användning av senast mottagna bitcoins!</translation>
</message>
<message>
<location line="+3"/>
<source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source>
<translation>Exekvera kommando när ett relevant meddelande är mottagen (%s i cmd är utbytt med ett meddelande)</translation>
</message>
<message>
<location line="+3"/>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation>Exekvera kommando när en plånbokstransaktion ändras (%s i cmd är ersatt av TxID)</translation>
</message>
<message>
<location line="+11"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation>Sätt den maximala storleken av hög-prioriterade/låg-avgifts transaktioner i byte (förvalt: 27000)</translation>
</message>
<message>
<location line="+6"/>
<source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>
<translation>Detta är ett förhands testbygge - använd på egen risk - använd inte för mining eller handels applikationer</translation>
</message>
<message>
<location line="+5"/>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation>Varning: -paytxfee är satt väldigt hög! Detta är avgiften du kommer betala för varje transaktion.</translation>
</message>
<message>
<location line="+3"/>
<source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source>
<translation>Varning: Visade transaktioner kanske inte är korrekt! Du kan behöva uppgradera, eller andra noder kan behöva uppgradera.</translation>
</message>
<message>
<location line="+3"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin will not work properly.</source>
<translation>Varning: Vänligen kolla så att din dators datum och tid är korrekt! Om din klocka går fel kommer Bitcoin inte fungera korrekt.</translation>
</message>
<message>
<location line="+3"/>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation>Varning: fel vid läsning av wallet.dat! Alla nycklar lästes korrekt, men transaktionsdatan eller adressbokens poster kanske saknas eller är felaktiga.</translation>
</message>
<message>
<location line="+3"/>
<source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source>
<translation>Varning: wallet.dat korrupt, datan har räddats! Den ursprungliga wallet.dat har sparas som wallet.{timestamp}.bak i %s; om ditt saldo eller transaktioner är felaktiga ska du återställa från en säkerhetskopia.</translation>
</message>
<message>
<location line="+14"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation>Försök att rädda de privata nycklarna från en korrupt wallet.dat</translation>
</message>
<message>
<location line="+2"/>
<source>Block creation options:</source>
<translation>Block skapande inställningar:</translation>
</message>
<message>
<location line="+5"/>
<source>Connect only to the specified node(s)</source>
<translation>Koppla enbart upp till den/de specificerade noden/noder</translation>
</message>
<message>
<location line="+3"/>
<source>Corrupted block database detected</source>
<translation>Korrupt blockdatabas har upptäckts</translation>
</message>
<message>
<location line="+1"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation>Hitta egen IP-adress (förvalt: 1 under lyssning och utan -externalip)</translation>
</message>
<message>
<location line="+1"/>
<source>Do you want to rebuild the block database now?</source>
<translation>Vill du bygga om blockdatabasen nu?</translation>
</message>
<message>
<location line="+2"/>
<source>Error initializing block database</source>
<translation>Fel vid initiering av blockdatabasen</translation>
</message>
<message>
<location line="+1"/>
<source>Error initializing wallet database environment %s!</source>
<translation>Fel vid initiering av plånbokens databasmiljö %s!</translation>
</message>
<message>
<location line="+1"/>
<source>Error loading block database</source>
<translation>Fel vid inläsning av blockdatabasen</translation>
</message>
<message>
<location line="+4"/>
<source>Error opening block database</source>
<translation>Fel vid öppning av blockdatabasen</translation>
</message>
<message>
<location line="+2"/>
<source>Error: Disk space is low!</source>
<translation>Fel: Hårddiskutrymme är lågt!</translation>
</message>
<message>
<location line="+1"/>
<source>Error: Wallet locked, unable to create transaction!</source>
<translation>Fel: Plånboken är låst, det går ej att skapa en transaktion!</translation>
</message>
<message>
<location line="+1"/>
<source>Error: system error: </source>
<translation>Fel: systemfel:</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation>Misslyckades att lyssna på någon port. Använd -listen=0 om du vill detta.</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to read block info</source>
<translation>Misslyckades att läsa blockinformation</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to read block</source>
<translation>Misslyckades att läsa blocket</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to sync block index</source>
<translation>Misslyckades att synkronisera blockindex</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write block index</source>
<translation>Misslyckades att skriva blockindex</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write block info</source>
<translation>Misslyckades att skriva blockinformation</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write block</source>
<translation>Misslyckades att skriva blocket</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write file info</source>
<translation>Misslyckades att skriva filinformation</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write to coin database</source>
<translation>Misslyckades att skriva till myntdatabas</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write transaction index</source>
<translation>Misslyckades att skriva transaktionsindex</translation>
</message>
<message>
<location line="+1"/>
<source>Failed to write undo data</source>
<translation>Misslyckades att skriva ångradata</translation>
</message>
<message>
<location line="+2"/>
<source>Find peers using DNS lookup (default: 1 unless -connect)</source>
<translation>Sök efter klienter med DNS sökningen (förvalt: 1 om inte -connect)</translation>
</message>
<message>
<location line="+1"/>
<source>Generate coins (default: 0)</source>
<translation>Generera mynt (förvalt: 0)</translation>
</message>
<message>
<location line="+2"/>
<source>How many blocks to check at startup (default: 288, 0 = all)</source>
<translation>Hur många block att kontrollera vid uppstart (standardvärde: 288, 0 = alla)</translation>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-4, default: 3)</source>
<translation>Hur grundlig blockverifikationen är (0-4, förvalt: 3)</translation>
</message>
<message>
<location line="+2"/>
<source>Incorrect or no genesis block found. Wrong datadir for network?</source>
<translation>Felaktig eller inget genesisblock hittades. Fel datadir för nätverket?</translation>
</message>
<message>
<location line="+18"/>
<source>Not enough file descriptors available.</source>
<translation>Inte tillräckligt med filbeskrivningar tillgängliga.</translation>
</message>
<message>
<location line="+8"/>
<source>Rebuild block chain index from current blk000??.dat files</source>
<translation>Återskapa blockkedjans index från nuvarande blk000??.dat filer</translation>
</message>
<message>
<location line="+16"/>
<source>Set the number of threads to service RPC calls (default: 4)</source>
<translation>Ange antalet trådar för att hantera RPC anrop (standard: 4)</translation>
</message>
<message>
<location line="+7"/>
<source>Specify wallet file (within data directory)</source>
<translation>Ange plånboksfil (inom datakatalogen)</translation>
</message>
<message>
<location line="+20"/>
<source>Verifying blocks...</source>
<translation>Verifierar block...</translation>
</message>
<message>
<location line="+1"/>
<source>Verifying wallet...</source>
<translation>Verifierar plånboken...</translation>
</message>
<message>
<location line="+1"/>
<source>Wallet %s resides outside data directory %s</source>
<translation>Plånbok %s ligger utanför datakatalogen %s</translation>
</message>
<message>
<location line="+4"/>
<source>You need to rebuild the database using -reindex to change -txindex</source>
<translation>Du måste återskapa databasen med -reindex för att ändra -txindex</translation>
</message>
<message>
<location line="-76"/>
<source>Imports blocks from external blk000??.dat file</source>
<translation>Importerar block från extern blk000??.dat fil</translation>
</message>
<message>
<location line="-76"/>
<source>Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)</source>
<translation>Ange antalet skriptkontrolltrådar (upp till 16, 0 = auto, <0 = lämna så många kärnor lediga, förval: 0)</translation>
</message>
<message>
<location line="+78"/>
<source>Information</source>
<translation>Information</translation>
</message>
<message>
<location line="+3"/>
<source>Invalid -tor address: '%s'</source>
<translation>Ogiltig -tor adress: '%s'</translation>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -minrelaytxfee=<amount>: '%s'</source>
<translation>Ogiltigt belopp för -minrelaytxfee=<belopp>: '%s'</translation>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -mintxfee=<amount>: '%s'</source>
<translation>Ogiltigt belopp för -mintxfee=<belopp>: '%s'</translation>
</message>
<message>
<location line="+8"/>
<source>Maintain a full transaction index (default: 0)</source>
<translation>Upprätthåll ett fullständigt transaktionsindex (förval: 0)</translation>
</message>
<message>
<location line="+2"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation>Maximal buffert för mottagning per anslutning, <n>*1000 byte (förvalt: 5000)</translation>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation>Maximal buffert för sändning per anslutning, <n>*1000 byte (förvalt: 5000)</translation>
</message>
<message>
<location line="+2"/>
<source>Only accept block chain matching built-in checkpoints (default: 1)</source>
<translation>Acceptera bara blockkedjans matchande inbyggda kontrollpunkter (förvalt: 1)</translation>
</message>
<message>
<location line="+1"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation>Anslut enbart till noder i nätverket <net> (IPv4, IPv6 eller Tor)</translation>
</message>
<message>
<location line="+2"/>
<source>Output extra debugging information. Implies all other -debug* options</source>
<translation>Skriv ut extra felsökningsinformation. Gäller alla andra -debug* alternativ</translation>
</message>
<message>
<location line="+1"/>
<source>Output extra network debugging information</source>
<translation>Skriv ut extra felsökningsinformation om nätverk</translation>
</message>
<message>
<location line="+2"/>
<source>Prepend debug output with timestamp</source>
<translation>Skriv ut tid i felsökningsinformationen</translation>
</message>
<message>
<location line="+5"/>
<source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source>
<translation>SSL-inställningar: (se Bitcoin-wikin för SSL-setup instruktioner)</translation>
</message>
<message>
<location line="+1"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation>Välj socks-proxy version att använda (4-5, förvalt: 5)</translation>
</message>
<message>
<location line="+3"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation>Skicka trace-/debuginformation till terminalen istället för till debug.log</translation>
</message>
<message>
<location line="+1"/>
<source>Send trace/debug info to debugger</source>
<translation>Skicka trace-/debuginformation till debugger</translation>
</message>
<message>
<location line="+5"/>
<source>Set maximum block size in bytes (default: 250000)</source>
<translation>Sätt maximal blockstorlek i byte (förvalt: 250000)</translation>
</message>
<message>
<location line="+1"/>
<source>Set minimum block size in bytes (default: 0)</source>
<translation>Sätt minsta blockstorlek i byte (förvalt: 0)</translation>
</message>
<message>
<location line="+2"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation>Krymp debug.log filen vid klient start (förvalt: 1 vid ingen -debug)</translation>
</message>
<message>
<location line="+1"/>
<source>Signing transaction failed</source>
<translation>Signering av transaktion misslyckades</translation>
</message>
<message>
<location line="+2"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation>Ange timeout för uppkoppling i millisekunder (förvalt: 5000)</translation>
</message>
<message>
<location line="+5"/>
<source>System error: </source>
<translation>Systemfel:</translation>
</message>
<message>
<location line="+4"/>
<source>Transaction amount too small</source>
<translation>Transaktions belopp för liten</translation>
</message>
<message>
<location line="+1"/>
<source>Transaction amounts must be positive</source>
<translation>Transaktionens belopp måste vara positiva</translation>
</message>
<message>
<location line="+1"/>
<source>Transaction too large</source>
<translation>Transaktionen är för stor</translation>
</message>
<message>
<location line="+7"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation>Använd UPnP för att mappa den lyssnande porten (förvalt: 0)</translation>
</message>
<message>
<location line="+1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation>Använd UPnP för att mappa den lyssnande porten (förvalt: 1 under lyssning)</translation>
</message>
<message>
<location line="+1"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation>Använd en proxy för att nå tor (förvalt: samma som -proxy)</translation>
</message>
<message>
<location line="+2"/>
<source>Username for JSON-RPC connections</source>
<translation>Användarnamn för JSON-RPC-anslutningar</translation>
</message>
<message>
<location line="+5"/>
<source>Warning</source>
<translation>Varning</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation>Varning: denna version är föråldrad, uppgradering krävs!</translation>
</message>
<message>
<location line="+2"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation>wallet.dat korrupt, räddning misslyckades</translation>
</message>
<message>
<location line="-52"/>
<source>Password for JSON-RPC connections</source>
<translation>Lösenord för JSON-RPC-anslutningar</translation>
</message>
<message>
<location line="-68"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation>Tillåt JSON-RPC-anslutningar från specifika IP-adresser</translation>
</message>
<message>
<location line="+77"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation>Skicka kommandon till klient på <ip> (förvalt: 127.0.0.1)</translation>
</message>
<message>
<location line="-121"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation>Exekvera kommando när det bästa blocket ändras (%s i cmd är utbytt av blockhash)</translation>
</message>
<message>
<location line="+149"/>
<source>Upgrade wallet to latest format</source>
<translation>Uppgradera plånboken till senaste formatet</translation>
</message>
<message>
<location line="-22"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation>Sätt storleken på nyckelpoolen till <n> (förvalt: 100)</translation>
</message>
<message>
<location line="-12"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation>Sök i blockkedjan efter saknade plånboks transaktioner</translation>
</message>
<message>
<location line="+36"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>Använd OpenSSL (https) för JSON-RPC-anslutningar</translation>
</message>
<message>
<location line="-27"/>
<source>Server certificate file (default: server.cert)</source>
<translation>Serverns certifikatfil (förvalt: server.cert)</translation>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation>Serverns privata nyckel (förvalt: server.pem)</translation>
</message>
<message>
<location line="-156"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation>Accepterade krypteringsalgoritmer (förvalt: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation>
</message>
<message>
<location line="+171"/>
<source>This help message</source>
<translation>Det här hjälp medelandet</translation>
</message>
<message>
<location line="+6"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation>Det går inte att binda till %s på den här datorn (bind returnerade felmeddelande %d, %s)</translation>
</message>
<message>
<location line="-93"/>
<source>Connect through socks proxy</source>
<translation>Anslut genom socks-proxy</translation>
</message>
<message>
<location line="-10"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation>Tillåt DNS-sökningar för -addnode, -seednode och -connect</translation>
</message>
<message>
<location line="+56"/>
<source>Loading addresses...</source>
<translation>Laddar adresser...</translation>
</message>
<message>
<location line="-36"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation>Fel vid inläsningen av wallet.dat: Plånboken är skadad</translation>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat: Wallet requires newer version of Bitcoin</source>
<translation>Fel vid inläsningen av wallet.dat: Plånboken kräver en senare version av Bitcoin</translation>
</message>
<message>
<location line="+96"/>
<source>Wallet needed to be rewritten: restart Bitcoin to complete</source>
<translation>Plånboken behöver skrivas om: Starta om Bitcoin för att färdigställa</translation>
</message>
<message>
<location line="-98"/>
<source>Error loading wallet.dat</source>
<translation>Fel vid inläsning av plånboksfilen wallet.dat</translation>
</message>
<message>
<location line="+29"/>
<source>Invalid -proxy address: '%s'</source>
<translation>Ogiltig -proxy adress: '%s'</translation>
</message>
<message>
<location line="+57"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation>Okänt nätverk som anges i -onlynet: '%s'</translation>
</message>
<message>
<location line="-1"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation>Okänd -socks proxy version begärd: %i</translation>
</message>
<message>
<location line="-98"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation>Kan inte matcha -bind adress: '%s'</translation>
</message>
<message>
<location line="+1"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation>Kan inte matcha -externalip adress: '%s'</translation>
</message>
<message>
<location line="+45"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation>Ogiltigt belopp för -paytxfee=<belopp>:'%s'</translation>
</message>
<message>
<location line="+1"/>
<source>Invalid amount</source>
<translation>Ogiltig mängd</translation>
</message>
<message>
<location line="-6"/>
<source>Insufficient funds</source>
<translation>Otillräckligt med bitcoins</translation>
</message>
<message>
<location line="+10"/>
<source>Loading block index...</source>
<translation>Laddar blockindex...</translation>
</message>
<message>
<location line="-58"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation>Lägg till en nod att koppla upp mot och försök att hålla anslutningen öppen</translation>
</message>
<message>
<location line="-25"/>
<source>Unable to bind to %s on this computer. Bitcoin is probably already running.</source>
<translation>Det går inte att binda till %s på den här datorn. Bitcoin är förmodligen redan igång.</translation>
</message>
<message>
<location line="+64"/>
<source>Fee per KB to add to transactions you send</source>
<translation>Avgift per KB att lägga till på transaktioner du skickar</translation>
</message>
<message>
<location line="+20"/>
<source>Loading wallet...</source>
<translation>Laddar plånbok...</translation>
</message>
<message>
<location line="-53"/>
<source>Cannot downgrade wallet</source>
<translation>Kan inte nedgradera plånboken</translation>
</message>
<message>
<location line="+3"/>
<source>Cannot write default address</source>
<translation>Kan inte skriva standardadress</translation>
</message>
<message>
<location line="+65"/>
<source>Rescanning...</source>
<translation>Söker igen...</translation>
</message>
<message>
<location line="-58"/>
<source>Done loading</source>
<translation>Klar med laddning</translation>
</message>
<message>
<location line="+84"/>
<source>To use the %s option</source>
<translation>Att använda %s alternativet</translation>
</message>
<message>
<location line="-76"/>
<source>Error</source>
<translation>Fel</translation>
</message>
<message>
<location line="-31"/>
<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>Du behöver välja ett rpclösensord i konfigurationsfilen:
%s
Om filen inte existerar, skapa den med filrättigheten endast läsbar för ägaren.</translation>
</message>
</context>
</TS> | {
"content_hash": "ed15d8bfe73ff0757c3ff38571c3087f",
"timestamp": "",
"source": "github",
"line_count": 3074,
"max_line_length": 395,
"avg_line_length": 39.702016916070264,
"alnum_prop": 0.6336731015043755,
"repo_name": "imton/bitcoin",
"id": "9107c01dfb342414109d6d0170c54bc313ba9d4d",
"size": "122819",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "src/qt/locale/bitcoin_sv.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "90743"
},
{
"name": "C++",
"bytes": "2759181"
},
{
"name": "CSS",
"bytes": "1127"
},
{
"name": "Objective-C",
"bytes": "5711"
},
{
"name": "Prolog",
"bytes": "667"
},
{
"name": "Python",
"bytes": "82396"
},
{
"name": "Shell",
"bytes": "15082"
},
{
"name": "TypeScript",
"bytes": "6429954"
}
],
"symlink_target": ""
} |
package training.tests;
import org.openqa.selenium.By;
import org.testng.Assert;
import org.testng.annotations.Test;
import java.nio.file.Path;
import java.nio.file.Paths;
// Задание 12. Сценарий добавления товара
public class TrainingTest008 extends TestBase{
@Test(description = "Задание 12. Сценарий добавления товара")
public void addNewProduct() {
// Логин в панель администрирования учебного приложения
loginInStore(loginPass, loginPass);
// Открываем меню Catalog - Кликаем на пункт меню
clickOnElement(By.xpath("//span[.='Catalog']"));
// Кликаем на пункт подменю
clickOnElement(By.xpath("//ul[@class='docs']//span[.='Catalog']"));
// Нажимаем на кнопку Add New Product
clickOnElement(By.xpath("//a[contains(text(),'Add New Product')]"));
// Данные нового товара
NewProduct product = new NewProduct();
// Переходим на закладку General
clickOnElement(By.xpath("//div[@class='tabs']//a[.='General']"));
// Заполняем Status - Enabled
clickOnElement(By.xpath("//label[contains(text(),'Enabled')]/input"));
// Заполняем поле Name
enterText(By.cssSelector("[name^=name]"), product.getName());
// Заполняем поле Code
enterText(By.name("code"), product.getCode());
// Заполняем Categories - выставляем все галочки
checkElementsCheckbox(By.name("categories[]"));
// Заполняем поле Default Category - выбираем случайный
selectElement(By.cssSelector("select[name=default_category_id]"), null);
// Заполняем Gender - выставляем все галочки
checkElementsCheckbox(By.name("product_groups[]"));
// Заполняем поле Quantity
enterText(By.name("quantity"), product.getQuantity());
// Заполняем поле Quantity Unit - выбираем случайный
selectElement(By.cssSelector("select[name=quantity_unit_id]"), null);
// Заполняем поле Delivery Status - выбираем случайный
selectElement(By.cssSelector("select[name=delivery_status_id]"), null);
// Заполняем поле Sold Out Status - выбираем случайный
selectElement(By.cssSelector("select[name=sold_out_status_id]"), null);
// Заполняем поле Upload Images путем к файлу с картинкой
Path filePath = Paths.get("new_duck_1.png");
attachFile(By.name("new_images[]"), filePath.toAbsolutePath().toString());
// Заполняем поле Date Valid From
enterText(By.name("date_valid_from"), product.getDateValidFrom());
// Заполняем поле Date Valid To
enterText(By.name("date_valid_to"), product.getDateValidTo());
// Переходим на закладку Information
clickOnElement(By.xpath("//div[@class='tabs']//a[.='Information']"));
// Заполняем поле Manufacturer - выбираем случайный
selectElement(By.cssSelector("select[name=manufacturer_id]"), null);
// Заполняем поле Supplier - выбираем случайный
selectElement(By.cssSelector("select[name=supplier_id]"), null);
// Заполняем поле Keywords
enterText(By.name("keywords"), product.getKeywords());
// Заполняем поле Short Description
enterText(By.cssSelector("[name^=short_description"), product.getShortDescription());
// Заполняем поле Description
getDriver().findElement(By.cssSelector("div.trumbowyg-editor")).sendKeys(product.getDescription());
// Заполняем поле Head Title
enterText(By.cssSelector("[name^=head_title"), product.getHeadTitle());
// Заполняем поле Meta Description
enterText(By.cssSelector("[name^=meta_description"), product.getMetaDescription());
// Переходим на закладку Prices
clickOnElement(By.xpath("//div[@class='tabs']//a[.='Prices']"));
// Заполняем поле Purchase Price
enterText(By.name("purchase_price"), product.getPurchasePrice());
selectElement(By.cssSelector("select[name=purchase_price_currency_code"), null);
// Заполняем поле Tax Class
selectElement(By.cssSelector("select[name=tax_class_id"), null);
// Заполняем поле Price
enterText(By.name("prices[USD]"), product.getPricesUsd());
// Price Incl. Tax (?) - автоматически заполняется
// Заполняем поле Price
enterText(By.name("prices[EUR]"), product.getPricesEur());
// Price Incl. Tax (?) - автоматически заполняется
// Нажимаем на кнопку Save
clickOnElement(By.name("save"));
// кликаем на пункт меню Catalog
clickOnElement(By.xpath("//span[.='Catalog']"));
// Кликаем на пункт подменю
clickOnElement(By.xpath("//ul[@class='docs']//span[.='Catalog']"));
// Проверяем, что продукт появился в каталоге
Assert.assertTrue(isElementPresent(By.xpath("//tr[@class='row']//a[.='" + product.getName() + "']")));
}
}
| {
"content_hash": "4129d879bdb3f57f2613c32b007b9b31",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 110,
"avg_line_length": 49.25252525252525,
"alnum_prop": 0.6536095159967186,
"repo_name": "ElenaBakradze/seleniumTraining-homework",
"id": "ebe88bc673a657cbeceb86e49a4460cca1a84a29",
"size": "5730",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/test/java/training/tests/TrainingTest008.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "76127"
}
],
"symlink_target": ""
} |
/* First created by JCasGen Fri Nov 08 15:24:17 MST 2013 */
package gov.va.vinci.leo.types;
/*
* #%L
* Leo Core
* %%
* Copyright (C) 2010 - 2014 Department of Veterans Affairs
* %%
* 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.
* #L%
*/
import org.apache.uima.jcas.JCas;
import org.apache.uima.jcas.JCasRegistry;
import org.apache.uima.jcas.cas.TOP_Type;
import org.apache.uima.jcas.tcas.Annotation;
/**
* Updated by JCasGen Fri Nov 08 15:24:17 MST 2013
* XML source: /var/folders/1s/dht183xn48l3gs7t9_63bkvc0000gn/T/leoTypeDescription_afd93e25-d2a1-46ea-a02f-cd9e2b43cf2c3073653397021757898.xml
* @generated */
public class TR extends Annotation {
/** @generated
* @ordered
*/
@SuppressWarnings ("hiding")
public final static int typeIndexID = JCasRegistry.register(TR.class);
/** @generated
* @ordered
*/
@SuppressWarnings ("hiding")
public final static int type = typeIndexID;
/** @generated */
@Override
public int getTypeIndexID() {return typeIndexID;}
/** Never called. Disable default constructor
* @generated */
protected TR() {/* intentionally empty block */}
/** Internal - constructor used by generator
* @generated */
public TR(int addr, TOP_Type type) {
super(addr, type);
readObject();
}
/** @generated */
public TR(JCas jcas) {
super(jcas);
readObject();
}
/** @generated */
public TR(JCas jcas, int begin, int end) {
super(jcas);
setBegin(begin);
setEnd(end);
readObject();
}
/** <!-- begin-user-doc -->
* Write your own initialization here
* <!-- end-user-doc -->
@generated modifiable */
private void readObject() {/*default - does nothing empty block */}
}
| {
"content_hash": "feb790d3b3a072ddf68530004f8a2b8c",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 142,
"avg_line_length": 26.88095238095238,
"alnum_prop": 0.6682905225863596,
"repo_name": "department-of-veterans-affairs/Leo",
"id": "96af6d59f29003cce9227195d4c47b474dec49d9",
"size": "2258",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "core/src/test/java/gov/va/vinci/leo/types/TR.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Groovy",
"bytes": "5532"
},
{
"name": "Java",
"bytes": "1153442"
},
{
"name": "Shell",
"bytes": "638"
}
],
"symlink_target": ""
} |
package android.text;
import android.graphics.Paint;
import android.text.style.UpdateLayout;
import android.text.style.WrapTogetherSpan;
import com.android.internal.util.ArrayUtils;
import java.lang.ref.WeakReference;
/**
* DynamicLayout is a text layout that updates itself as the text is edited.
* <p>This is used by widgets to control text layout. You should not need
* to use this class directly unless you are implementing your own widget
* or custom display object, or need to call
* {@link android.graphics.Canvas#drawText(java.lang.CharSequence, int, int, float, float, android.graphics.Paint)
* Canvas.drawText()} directly.</p>
*/
public class DynamicLayout extends Layout
{
private static final int PRIORITY = 128;
private static final int BLOCK_MINIMUM_CHARACTER_LENGTH = 400;
/**
* Make a layout for the specified text that will be updated as
* the text is changed.
*/
public DynamicLayout(CharSequence base,
TextPaint paint,
int width, Alignment align,
float spacingmult, float spacingadd,
boolean includepad) {
this(base, base, paint, width, align, spacingmult, spacingadd,
includepad);
}
/**
* Make a layout for the transformed text (password transformation
* being the primary example of a transformation)
* that will be updated as the base text is changed.
*/
public DynamicLayout(CharSequence base, CharSequence display,
TextPaint paint,
int width, Alignment align,
float spacingmult, float spacingadd,
boolean includepad) {
this(base, display, paint, width, align, spacingmult, spacingadd,
includepad, null, 0);
}
/**
* Make a layout for the transformed text (password transformation
* being the primary example of a transformation)
* that will be updated as the base text is changed.
* If ellipsize is non-null, the Layout will ellipsize the text
* down to ellipsizedWidth.
*/
public DynamicLayout(CharSequence base, CharSequence display,
TextPaint paint,
int width, Alignment align,
float spacingmult, float spacingadd,
boolean includepad,
TextUtils.TruncateAt ellipsize, int ellipsizedWidth) {
this(base, display, paint, width, align, TextDirectionHeuristics.FIRSTSTRONG_LTR,
spacingmult, spacingadd, includepad, ellipsize, ellipsizedWidth);
}
/**
* Make a layout for the transformed text (password transformation
* being the primary example of a transformation)
* that will be updated as the base text is changed.
* If ellipsize is non-null, the Layout will ellipsize the text
* down to ellipsizedWidth.
* *
* *@hide
*/
public DynamicLayout(CharSequence base, CharSequence display,
TextPaint paint,
int width, Alignment align, TextDirectionHeuristic textDir,
float spacingmult, float spacingadd,
boolean includepad,
TextUtils.TruncateAt ellipsize, int ellipsizedWidth) {
super((ellipsize == null)
? display
: (display instanceof Spanned)
? new SpannedEllipsizer(display)
: new Ellipsizer(display),
paint, width, align, textDir, spacingmult, spacingadd);
mBase = base;
mDisplay = display;
if (ellipsize != null) {
mInts = new PackedIntVector(COLUMNS_ELLIPSIZE);
mEllipsizedWidth = ellipsizedWidth;
mEllipsizeAt = ellipsize;
} else {
mInts = new PackedIntVector(COLUMNS_NORMAL);
mEllipsizedWidth = width;
mEllipsizeAt = null;
}
mObjects = new PackedObjectVector<Directions>(1);
mIncludePad = includepad;
/*
* This is annoying, but we can't refer to the layout until
* superclass construction is finished, and the superclass
* constructor wants the reference to the display text.
*
* This will break if the superclass constructor ever actually
* cares about the content instead of just holding the reference.
*/
if (ellipsize != null) {
Ellipsizer e = (Ellipsizer) getText();
e.mLayout = this;
e.mWidth = ellipsizedWidth;
e.mMethod = ellipsize;
mEllipsize = true;
}
// Initial state is a single line with 0 characters (0 to 0),
// with top at 0 and bottom at whatever is natural, and
// undefined ellipsis.
int[] start;
if (ellipsize != null) {
start = new int[COLUMNS_ELLIPSIZE];
start[ELLIPSIS_START] = ELLIPSIS_UNDEFINED;
} else {
start = new int[COLUMNS_NORMAL];
}
Directions[] dirs = new Directions[] { DIRS_ALL_LEFT_TO_RIGHT };
Paint.FontMetricsInt fm = paint.getFontMetricsInt();
int asc = fm.ascent;
int desc = fm.descent;
start[DIR] = DIR_LEFT_TO_RIGHT << DIR_SHIFT;
start[TOP] = 0;
start[DESCENT] = desc;
mInts.insertAt(0, start);
start[TOP] = desc - asc;
mInts.insertAt(1, start);
mObjects.insertAt(0, dirs);
// Update from 0 characters to whatever the real text is
reflow(base, 0, 0, base.length());
if (base instanceof Spannable) {
if (mWatcher == null)
mWatcher = new ChangeWatcher(this);
// Strip out any watchers for other DynamicLayouts.
Spannable sp = (Spannable) base;
ChangeWatcher[] spans = sp.getSpans(0, sp.length(), ChangeWatcher.class);
for (int i = 0; i < spans.length; i++)
sp.removeSpan(spans[i]);
sp.setSpan(mWatcher, 0, base.length(),
Spannable.SPAN_INCLUSIVE_INCLUSIVE |
(PRIORITY << Spannable.SPAN_PRIORITY_SHIFT));
}
}
private void reflow(CharSequence s, int where, int before, int after) {
if (s != mBase)
return;
CharSequence text = mDisplay;
int len = text.length();
// seek back to the start of the paragraph
int find = TextUtils.lastIndexOf(text, '\n', where - 1);
if (find < 0)
find = 0;
else
find = find + 1;
{
int diff = where - find;
before += diff;
after += diff;
where -= diff;
}
// seek forward to the end of the paragraph
int look = TextUtils.indexOf(text, '\n', where + after);
if (look < 0)
look = len;
else
look++; // we want the index after the \n
int change = look - (where + after);
before += change;
after += change;
// seek further out to cover anything that is forced to wrap together
if (text instanceof Spanned) {
Spanned sp = (Spanned) text;
boolean again;
do {
again = false;
Object[] force = sp.getSpans(where, where + after,
WrapTogetherSpan.class);
for (int i = 0; i < force.length; i++) {
int st = sp.getSpanStart(force[i]);
int en = sp.getSpanEnd(force[i]);
if (st < where) {
again = true;
int diff = where - st;
before += diff;
after += diff;
where -= diff;
}
if (en > where + after) {
again = true;
int diff = en - (where + after);
before += diff;
after += diff;
}
}
} while (again);
}
// find affected region of old layout
int startline = getLineForOffset(where);
int startv = getLineTop(startline);
int endline = getLineForOffset(where + before);
if (where + after == len)
endline = getLineCount();
int endv = getLineTop(endline);
boolean islast = (endline == getLineCount());
// generate new layout for affected text
StaticLayout reflowed;
synchronized (sLock) {
reflowed = sStaticLayout;
sStaticLayout = null;
}
if (reflowed == null) {
reflowed = new StaticLayout(null);
} else {
reflowed.prepare();
}
reflowed.generate(text, where, where + after,
getPaint(), getWidth(), getTextDirectionHeuristic(), getSpacingMultiplier(),
getSpacingAdd(), false,
true, mEllipsizedWidth, mEllipsizeAt);
int n = reflowed.getLineCount();
// If the new layout has a blank line at the end, but it is not
// the very end of the buffer, then we already have a line that
// starts there, so disregard the blank line.
if (where + after != len && reflowed.getLineStart(n - 1) == where + after)
n--;
// remove affected lines from old layout
mInts.deleteAt(startline, endline - startline);
mObjects.deleteAt(startline, endline - startline);
// adjust offsets in layout for new height and offsets
int ht = reflowed.getLineTop(n);
int toppad = 0, botpad = 0;
if (mIncludePad && startline == 0) {
toppad = reflowed.getTopPadding();
mTopPadding = toppad;
ht -= toppad;
}
if (mIncludePad && islast) {
botpad = reflowed.getBottomPadding();
mBottomPadding = botpad;
ht += botpad;
}
mInts.adjustValuesBelow(startline, START, after - before);
mInts.adjustValuesBelow(startline, TOP, startv - endv + ht);
// insert new layout
int[] ints;
if (mEllipsize) {
ints = new int[COLUMNS_ELLIPSIZE];
ints[ELLIPSIS_START] = ELLIPSIS_UNDEFINED;
} else {
ints = new int[COLUMNS_NORMAL];
}
Directions[] objects = new Directions[1];
for (int i = 0; i < n; i++) {
ints[START] = reflowed.getLineStart(i) |
(reflowed.getParagraphDirection(i) << DIR_SHIFT) |
(reflowed.getLineContainsTab(i) ? TAB_MASK : 0);
int top = reflowed.getLineTop(i) + startv;
if (i > 0)
top -= toppad;
ints[TOP] = top;
int desc = reflowed.getLineDescent(i);
if (i == n - 1)
desc += botpad;
ints[DESCENT] = desc;
objects[0] = reflowed.getLineDirections(i);
if (mEllipsize) {
ints[ELLIPSIS_START] = reflowed.getEllipsisStart(i);
ints[ELLIPSIS_COUNT] = reflowed.getEllipsisCount(i);
}
mInts.insertAt(startline + i, ints);
mObjects.insertAt(startline + i, objects);
}
updateBlocks(startline, endline - 1, n);
synchronized (sLock) {
sStaticLayout = reflowed;
reflowed.finish();
}
}
/**
* Create the initial block structure, cutting the text into blocks of at least
* BLOCK_MINIMUM_CHARACTER_SIZE characters, aligned on the ends of paragraphs.
*/
private void createBlocks() {
int offset = BLOCK_MINIMUM_CHARACTER_LENGTH;
mNumberOfBlocks = 0;
final CharSequence text = mDisplay;
while (true) {
offset = TextUtils.indexOf(text, '\n', offset);
if (offset < 0) {
addBlockAtOffset(text.length());
break;
} else {
addBlockAtOffset(offset);
offset += BLOCK_MINIMUM_CHARACTER_LENGTH;
}
}
// mBlockIndices and mBlockEndLines should have the same length
mBlockIndices = new int[mBlockEndLines.length];
for (int i = 0; i < mBlockEndLines.length; i++) {
mBlockIndices[i] = INVALID_BLOCK_INDEX;
}
}
/**
* Create a new block, ending at the specified character offset.
* A block will actually be created only if has at least one line, i.e. this offset is
* not on the end line of the previous block.
*/
private void addBlockAtOffset(int offset) {
final int line = getLineForOffset(offset);
if (mBlockEndLines == null) {
// Initial creation of the array, no test on previous block ending line
mBlockEndLines = new int[ArrayUtils.idealIntArraySize(1)];
mBlockEndLines[mNumberOfBlocks] = line;
mNumberOfBlocks++;
return;
}
final int previousBlockEndLine = mBlockEndLines[mNumberOfBlocks - 1];
if (line > previousBlockEndLine) {
if (mNumberOfBlocks == mBlockEndLines.length) {
// Grow the array if needed
int[] blockEndLines = new int[ArrayUtils.idealIntArraySize(mNumberOfBlocks + 1)];
System.arraycopy(mBlockEndLines, 0, blockEndLines, 0, mNumberOfBlocks);
mBlockEndLines = blockEndLines;
}
mBlockEndLines[mNumberOfBlocks] = line;
mNumberOfBlocks++;
}
}
/**
* This method is called every time the layout is reflowed after an edition.
* It updates the internal block data structure. The text is split in blocks
* of contiguous lines, with at least one block for the entire text.
* When a range of lines is edited, new blocks (from 0 to 3 depending on the
* overlap structure) will replace the set of overlapping blocks.
* Blocks are listed in order and are represented by their ending line number.
* An index is associated to each block (which will be used by display lists),
* this class simply invalidates the index of blocks overlapping a modification.
*
* This method is package private and not private so that it can be tested.
*
* @param startLine the first line of the range of modified lines
* @param endLine the last line of the range, possibly equal to startLine, lower
* than getLineCount()
* @param newLineCount the number of lines that will replace the range, possibly 0
*
* @hide
*/
void updateBlocks(int startLine, int endLine, int newLineCount) {
if (mBlockEndLines == null) {
createBlocks();
return;
}
int firstBlock = -1;
int lastBlock = -1;
for (int i = 0; i < mNumberOfBlocks; i++) {
if (mBlockEndLines[i] >= startLine) {
firstBlock = i;
break;
}
}
for (int i = firstBlock; i < mNumberOfBlocks; i++) {
if (mBlockEndLines[i] >= endLine) {
lastBlock = i;
break;
}
}
final int lastBlockEndLine = mBlockEndLines[lastBlock];
boolean createBlockBefore = startLine > (firstBlock == 0 ? 0 :
mBlockEndLines[firstBlock - 1] + 1);
boolean createBlock = newLineCount > 0;
boolean createBlockAfter = endLine < mBlockEndLines[lastBlock];
int numAddedBlocks = 0;
if (createBlockBefore) numAddedBlocks++;
if (createBlock) numAddedBlocks++;
if (createBlockAfter) numAddedBlocks++;
final int numRemovedBlocks = lastBlock - firstBlock + 1;
final int newNumberOfBlocks = mNumberOfBlocks + numAddedBlocks - numRemovedBlocks;
if (newNumberOfBlocks == 0) {
// Even when text is empty, there is actually one line and hence one block
mBlockEndLines[0] = 0;
mBlockIndices[0] = INVALID_BLOCK_INDEX;
mNumberOfBlocks = 1;
return;
}
if (newNumberOfBlocks > mBlockEndLines.length) {
final int newSize = ArrayUtils.idealIntArraySize(newNumberOfBlocks);
int[] blockEndLines = new int[newSize];
int[] blockIndices = new int[newSize];
System.arraycopy(mBlockEndLines, 0, blockEndLines, 0, firstBlock);
System.arraycopy(mBlockIndices, 0, blockIndices, 0, firstBlock);
System.arraycopy(mBlockEndLines, lastBlock + 1,
blockEndLines, firstBlock + numAddedBlocks, mNumberOfBlocks - lastBlock - 1);
System.arraycopy(mBlockIndices, lastBlock + 1,
blockIndices, firstBlock + numAddedBlocks, mNumberOfBlocks - lastBlock - 1);
mBlockEndLines = blockEndLines;
mBlockIndices = blockIndices;
} else {
System.arraycopy(mBlockEndLines, lastBlock + 1,
mBlockEndLines, firstBlock + numAddedBlocks, mNumberOfBlocks - lastBlock - 1);
System.arraycopy(mBlockIndices, lastBlock + 1,
mBlockIndices, firstBlock + numAddedBlocks, mNumberOfBlocks - lastBlock - 1);
}
mNumberOfBlocks = newNumberOfBlocks;
final int deltaLines = newLineCount - (endLine - startLine + 1);
for (int i = firstBlock + numAddedBlocks; i < mNumberOfBlocks; i++) {
mBlockEndLines[i] += deltaLines;
}
int blockIndex = firstBlock;
if (createBlockBefore) {
mBlockEndLines[blockIndex] = startLine - 1;
mBlockIndices[blockIndex] = INVALID_BLOCK_INDEX;
blockIndex++;
}
if (createBlock) {
mBlockEndLines[blockIndex] = startLine + newLineCount - 1;
mBlockIndices[blockIndex] = INVALID_BLOCK_INDEX;
blockIndex++;
}
if (createBlockAfter) {
mBlockEndLines[blockIndex] = lastBlockEndLine + deltaLines;
mBlockIndices[blockIndex] = INVALID_BLOCK_INDEX;
}
}
/**
* This package private method is used for test purposes only
* @hide
*/
void setBlocksDataForTest(int[] blockEndLines, int[] blockIndices, int numberOfBlocks) {
mBlockEndLines = new int[blockEndLines.length];
mBlockIndices = new int[blockIndices.length];
System.arraycopy(blockEndLines, 0, mBlockEndLines, 0, blockEndLines.length);
System.arraycopy(blockIndices, 0, mBlockIndices, 0, blockIndices.length);
mNumberOfBlocks = numberOfBlocks;
}
/**
* @hide
*/
public int[] getBlockEndLines() {
return mBlockEndLines;
}
/**
* @hide
*/
public int[] getBlockIndices() {
return mBlockIndices;
}
/**
* @hide
*/
public int getNumberOfBlocks() {
return mNumberOfBlocks;
}
@Override
public int getLineCount() {
return mInts.size() - 1;
}
@Override
public int getLineTop(int line) {
return mInts.getValue(line, TOP);
}
@Override
public int getLineDescent(int line) {
return mInts.getValue(line, DESCENT);
}
@Override
public int getLineStart(int line) {
return mInts.getValue(line, START) & START_MASK;
}
@Override
public boolean getLineContainsTab(int line) {
return (mInts.getValue(line, TAB) & TAB_MASK) != 0;
}
@Override
public int getParagraphDirection(int line) {
return mInts.getValue(line, DIR) >> DIR_SHIFT;
}
@Override
public final Directions getLineDirections(int line) {
return mObjects.getValue(line, 0);
}
@Override
public int getTopPadding() {
return mTopPadding;
}
@Override
public int getBottomPadding() {
return mBottomPadding;
}
@Override
public int getEllipsizedWidth() {
return mEllipsizedWidth;
}
private static class ChangeWatcher implements TextWatcher, SpanWatcher {
public ChangeWatcher(DynamicLayout layout) {
mLayout = new WeakReference<DynamicLayout>(layout);
}
private void reflow(CharSequence s, int where, int before, int after) {
DynamicLayout ml = mLayout.get();
if (ml != null)
ml.reflow(s, where, before, after);
else if (s instanceof Spannable)
((Spannable) s).removeSpan(this);
}
public void beforeTextChanged(CharSequence s, int where, int before, int after) {
// Intentionally empty
}
public void onTextChanged(CharSequence s, int where, int before, int after) {
reflow(s, where, before, after);
}
public void afterTextChanged(Editable s) {
// Intentionally empty
}
public void onSpanAdded(Spannable s, Object o, int start, int end) {
if (o instanceof UpdateLayout)
reflow(s, start, end - start, end - start);
}
public void onSpanRemoved(Spannable s, Object o, int start, int end) {
if (o instanceof UpdateLayout)
reflow(s, start, end - start, end - start);
}
public void onSpanChanged(Spannable s, Object o, int start, int end, int nstart, int nend) {
if (o instanceof UpdateLayout) {
reflow(s, start, end - start, end - start);
reflow(s, nstart, nend - nstart, nend - nstart);
}
}
private WeakReference<DynamicLayout> mLayout;
}
@Override
public int getEllipsisStart(int line) {
if (mEllipsizeAt == null) {
return 0;
}
return mInts.getValue(line, ELLIPSIS_START);
}
@Override
public int getEllipsisCount(int line) {
if (mEllipsizeAt == null) {
return 0;
}
return mInts.getValue(line, ELLIPSIS_COUNT);
}
private CharSequence mBase;
private CharSequence mDisplay;
private ChangeWatcher mWatcher;
private boolean mIncludePad;
private boolean mEllipsize;
private int mEllipsizedWidth;
private TextUtils.TruncateAt mEllipsizeAt;
private PackedIntVector mInts;
private PackedObjectVector<Directions> mObjects;
/**
* Value used in mBlockIndices when a block has been created or recycled and indicating that its
* display list needs to be re-created.
* @hide
*/
public static final int INVALID_BLOCK_INDEX = -1;
// Stores the line numbers of the last line of each block (inclusive)
private int[] mBlockEndLines;
// The indices of this block's display list in TextView's internal display list array or
// INVALID_BLOCK_INDEX if this block has been invalidated during an edition
private int[] mBlockIndices;
// Number of items actually currently being used in the above 2 arrays
private int mNumberOfBlocks;
private int mTopPadding, mBottomPadding;
private static StaticLayout sStaticLayout = new StaticLayout(null);
private static final Object[] sLock = new Object[0];
private static final int START = 0;
private static final int DIR = START;
private static final int TAB = START;
private static final int TOP = 1;
private static final int DESCENT = 2;
private static final int COLUMNS_NORMAL = 3;
private static final int ELLIPSIS_START = 3;
private static final int ELLIPSIS_COUNT = 4;
private static final int COLUMNS_ELLIPSIZE = 5;
private static final int START_MASK = 0x1FFFFFFF;
private static final int DIR_SHIFT = 30;
private static final int TAB_MASK = 0x20000000;
private static final int ELLIPSIS_UNDEFINED = 0x80000000;
}
| {
"content_hash": "0876a8f16f82b45d986e4360c02078b9",
"timestamp": "",
"source": "github",
"line_count": 709,
"max_line_length": 114,
"avg_line_length": 33.91960507757405,
"alnum_prop": 0.579441972639195,
"repo_name": "haikuowuya/android_system_code",
"id": "d909362357ed108c3cf7d67fbffc77805ab3b654",
"size": "24668",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/android/text/DynamicLayout.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "182432"
},
{
"name": "Java",
"bytes": "124952631"
}
],
"symlink_target": ""
} |
DatabaseCleaner[:mongoid].strategy = :truncation
DatabaseCleaner[:mongoid].clean_with :truncation
RSpec.configure do |config|
config.before do
Doorkeeper::Application.create_indexes
Doorkeeper::AccessGrant.create_indexes
Doorkeeper::AccessToken.create_indexes
end
end
module Doorkeeper
class PlaceholderApplicationOwner
include Mongoid::Document
if ::Mongoid::VERSION >= '3'
self.store_in collection: :placeholder_application_owners
else
self.store_in :placeholder_application_owners
end
has_many :applications
end
module OrmHelper
def mock_application_owner
PlaceholderApplicationOwner.new
end
end
end
| {
"content_hash": "3ab689c1dcfa75a5c7ed65d06b025e5d",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 63,
"avg_line_length": 22.6,
"alnum_prop": 0.7463126843657817,
"repo_name": "phillbaker/doorkeeper",
"id": "7b180183143d32055688f0cf6a0d067070f115f0",
"size": "678",
"binary": false,
"copies": "6",
"ref": "refs/heads/bugfix/csrf",
"path": "spec/support/orm/mongoid.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1072"
},
{
"name": "Ruby",
"bytes": "266666"
}
],
"symlink_target": ""
} |
<?php
/** Zend_Form */
#require_once 'Zend/Form.php';
/**
* Dijit-enabled Form
*
* @uses Zend_Form
* @package Zend_Dojo
* @subpackage Form
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Form.php 24593 2012-01-05 20:35:02Z matthew $
*/
class Zend_Dojo_Form extends Zend_Form
{
/**
* Constructor
*
* @param array|Zend_Config|null $options
* @return void
*/
public function __construct($options = null)
{
$this->addPrefixPath('Zend_Dojo_Form_Decorator', 'Zend/Dojo/Form/Decorator', 'decorator')
->addPrefixPath('Zend_Dojo_Form_Element', 'Zend/Dojo/Form/Element', 'element')
->addElementPrefixPath('Zend_Dojo_Form_Decorator', 'Zend/Dojo/Form/Decorator', 'decorator')
->addDisplayGroupPrefixPath('Zend_Dojo_Form_Decorator', 'Zend/Dojo/Form/Decorator')
->setDefaultDisplayGroupClass('Zend_Dojo_Form_DisplayGroup');
parent::__construct($options);
}
/**
* Load the default decorators
*
* @return void
*/
public function loadDefaultDecorators()
{
if ($this->loadDefaultDecoratorsIsDisabled()) {
return;
}
$decorators = $this->getDecorators();
if (empty($decorators)) {
$this->addDecorator('FormElements')
->addDecorator('HtmlTag', array('tag' => 'dl', 'class' => 'zend_form_dojo'))
->addDecorator('DijitForm');
}
}
/**
* Set the view object
*
* Ensures that the view object has the dojo view helper path set.
*
* @param Zend_View_Interface $view
* @return Zend_Dojo_Form_Element_Dijit
*/
public function setView(Zend_View_Interface $view = null)
{
if (null !== $view) {
if (false === $view->getPluginLoader('helper')->getPaths('Zend_Dojo_View_Helper')) {
$view->addHelperPath('Zend/Dojo/View/Helper', 'Zend_Dojo_View_Helper');
}
}
return parent::setView($view);
}
}
| {
"content_hash": "929ea4c86a194d02173d7b3ef3a101b8",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 104,
"avg_line_length": 30.64788732394366,
"alnum_prop": 0.5827205882352942,
"repo_name": "Dan-Magebinary/magentoo",
"id": "1e40a506e9ce7330e83655c86431a7d6e7f385a4",
"size": "2866",
"binary": false,
"copies": "16",
"ref": "refs/heads/master",
"path": "lib/Zend/Dojo/Form.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ActionScript",
"bytes": "19946"
},
{
"name": "CSS",
"bytes": "1655613"
},
{
"name": "JavaScript",
"bytes": "1036085"
},
{
"name": "PHP",
"bytes": "44369093"
},
{
"name": "PowerShell",
"bytes": "1028"
},
{
"name": "Ruby",
"bytes": "288"
},
{
"name": "Shell",
"bytes": "1753"
},
{
"name": "XSLT",
"bytes": "2066"
}
],
"symlink_target": ""
} |
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for webs5\routes\wayPoints.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>
<a href="../../index.html">all files</a> / <a href="index.html">webs5/routes/</a> wayPoints.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>6/6</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>6/6</span>
</div>
</div>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10</td><td class="line-coverage quiet"><span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1×</span></td><td class="text"><pre class="prettyprint lang-js">var express = require('express');
var router = express();
var wayPointRepo = require('../repositories/wayPointRepository');
router.route('/:id')
.get(wayPointRepo.getWayPoint);
router.route('/:id/user')
.post(wayPointRepo.tagWaypoint);
// Export
module.exports = router;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Apr 05 2016 13:07:11 GMT+0200 (West-Europa (zomertijd))
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
</body>
</html>
| {
"content_hash": "5447ad46494542f2f54c5e8711ff5cae",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 140,
"avg_line_length": 32.26086956521739,
"alnum_prop": 0.613544474393531,
"repo_name": "nieka/webs5",
"id": "639b5b9f9f9fa007dc628542d313f9a2408c0411",
"size": "2974",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "coverage/lcov-report/webs5/routes/wayPoints.js.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "5169"
},
{
"name": "HTML",
"bytes": "222552"
},
{
"name": "JavaScript",
"bytes": "81140"
}
],
"symlink_target": ""
} |
#include <windows.h>
#include <stdio.h>
#include "dlfcn.h"
/* Note:
* MSDN says these functions are not thread-safe. We make no efforts to have
* any kind of thread safety.
*/
typedef struct global_object {
HMODULE hModule;
struct global_object *previous;
struct global_object *next;
} global_object;
static global_object first_object;
/* These functions implement a double linked list for the global objects. */
static global_object *global_search( HMODULE hModule )
{
global_object *pobject;
if( hModule == NULL )
return NULL;
for( pobject = &first_object; pobject ; pobject = pobject->next )
if( pobject->hModule == hModule )
return pobject;
return NULL;
}
static void global_add( HMODULE hModule )
{
global_object *pobject;
global_object *nobject;
if( hModule == NULL )
return;
pobject = global_search( hModule );
/* Do not add object again if it's already on the list */
if( pobject )
return;
for( pobject = &first_object; pobject->next ; pobject = pobject->next );
nobject = (global_object *)malloc( sizeof(global_object) );
/* Should this be enough to fail global_add, and therefore also fail
* dlopen?
*/
if( !nobject )
return;
pobject->next = nobject;
nobject->next = NULL;
nobject->previous = pobject;
nobject->hModule = hModule;
}
static void global_rem( HMODULE hModule )
{
global_object *pobject;
if( hModule == NULL )
return;
pobject = global_search( hModule );
if( !pobject )
return;
if( pobject->next )
pobject->next->previous = pobject->previous;
if( pobject->previous )
pobject->previous->next = pobject->next;
free( pobject );
}
/* POSIX says dlerror( ) doesn't have to be thread-safe, so we use one
* static buffer.
* MSDN says the buffer cannot be larger than 64K bytes, so we set it to
* the limit.
*/
static char error_buffer[65535];
static char *current_error;
static int copy_string( char *dest, int dest_size, const char *src )
{
int i = 0;
/* gcc should optimize this out */
if( !src && !dest )
return 0;
for( i = 0 ; i < dest_size-1 ; i++ )
{
if( !src[i] )
break;
else
dest[i] = src[i];
}
dest[i] = '\0';
return i;
}
static void save_err_str( const char *str )
{
DWORD dwMessageId;
DWORD pos;
dwMessageId = GetLastError( );
if( dwMessageId == 0 )
return;
/* Format error message to:
* "<argument to function that failed>": <Windows localized error message>
*/
pos = copy_string( error_buffer, sizeof(error_buffer), "\"" );
pos += copy_string( error_buffer+pos, sizeof(error_buffer)-pos, str );
pos += copy_string( error_buffer+pos, sizeof(error_buffer)-pos, "\": " );
pos += FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwMessageId,
MAKELANGID( LANG_NEUTRAL, SUBLANG_DEFAULT ),
error_buffer+pos, sizeof(error_buffer)-pos, NULL );
if( pos > 1 )
{
/* POSIX says the string must not have trailing <newline> */
if( error_buffer[pos-2] == '\r' && error_buffer[pos-1] == '\n' )
error_buffer[pos-2] = '\0';
}
current_error = error_buffer;
}
static void save_err_ptr_str( const void *ptr )
{
char ptr_buf[19]; /* 0x<pointer> up to 64 bits. */
sprintf( ptr_buf, "0x%p", ptr );
save_err_str( ptr_buf );
}
void *dlopen( const char *file, int mode )
{
HMODULE hModule;
UINT uMode;
current_error = NULL;
/* Do not let Windows display the critical-error-handler message box */
uMode = SetErrorMode( SEM_FAILCRITICALERRORS );
if( file == 0 )
{
/* POSIX says that if the value of file is 0, a handle on a global
* symbol object must be provided. That object must be able to access
* all symbols from the original program file, and any objects loaded
* with the RTLD_GLOBAL flag.
* The return value from GetModuleHandle( ) allows us to retrieve
* symbols only from the original program file. For objects loaded with
* the RTLD_GLOBAL flag, we create our own list later on.
*/
hModule = GetModuleHandle( NULL );
if( !hModule )
save_err_ptr_str( file );
}
else
{
char lpFileName[MAX_PATH];
int i;
/* MSDN says backslashes *must* be used instead of forward slashes. */
for( i = 0 ; i < sizeof(lpFileName)-1 ; i++ )
{
if( !file[i] )
break;
else if( file[i] == '/' )
lpFileName[i] = '\\';
else
lpFileName[i] = file[i];
}
lpFileName[i] = '\0';
/* POSIX says the search path is implementation-defined.
* LOAD_WITH_ALTERED_SEARCH_PATH is used to make it behave more closely
* to UNIX's search paths (start with system folders instead of current
* folder).
*/
hModule = LoadLibraryEx( (LPSTR) lpFileName, NULL,
LOAD_WITH_ALTERED_SEARCH_PATH );
/* If the object was loaded with RTLD_GLOBAL, add it to list of global
* objects, so that its symbols may be retrieved even if the handle for
* the original program file is passed. POSIX says that if the same
* file is specified in multiple invocations, and any of them are
* RTLD_GLOBAL, even if any further invocations use RTLD_LOCAL, the
* symbols will remain global.
*/
if( !hModule )
save_err_str( lpFileName );
else if( (mode & RTLD_GLOBAL) )
global_add( hModule );
}
/* Return to previous state of the error-mode bit flags. */
SetErrorMode( uMode );
return (void *) hModule;
}
int dlclose( void *handle )
{
HMODULE hModule = (HMODULE) handle;
BOOL ret;
current_error = NULL;
ret = FreeLibrary( hModule );
/* If the object was loaded with RTLD_GLOBAL, remove it from list of global
* objects.
*/
if( ret )
global_rem( hModule );
else
save_err_ptr_str( handle );
/* dlclose's return value in inverted in relation to FreeLibrary's. */
ret = !ret;
return (int) ret;
}
void *dlsym( void *handle, const char *name )
{
FARPROC symbol;
current_error = NULL;
symbol = GetProcAddress( (HMODULE)handle, name );
if( symbol == NULL )
{
HMODULE hModule;
/* If the handle for the original program file is passed, also search
* in all globally loaded objects.
*/
hModule = GetModuleHandle( NULL );
if( hModule == handle )
{
global_object *pobject;
for( pobject = &first_object; pobject ; pobject = pobject->next )
{
if( pobject->hModule )
{
symbol = GetProcAddress( pobject->hModule, name );
if( symbol != NULL )
break;
}
}
}
CloseHandle( hModule );
}
if( symbol == NULL )
save_err_str( name );
return (void*) symbol;
}
char *dlerror( void )
{
char *error_pointer = current_error;
/* POSIX says that invoking dlerror( ) a second time, immediately following
* a prior invocation, shall result in NULL being returned.
*/
current_error = NULL;
return error_pointer;
}
| {
"content_hash": "c39cf27abdc0dd3f5ef67abbbade347f",
"timestamp": "",
"source": "github",
"line_count": 297,
"max_line_length": 79,
"avg_line_length": 25.545454545454547,
"alnum_prop": 0.5765124555160143,
"repo_name": "npenin/mc",
"id": "6d72740d47e7850b7be08cf634925bdee4da08cb",
"size": "8387",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "node_modules/ffi/deps/dlfcn-win32/dlfcn.c",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "8731"
},
{
"name": "JavaScript",
"bytes": "85797"
}
],
"symlink_target": ""
} |
/*************************************************************************/
/* collision_polygon_3d_editor_plugin.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "collision_polygon_3d_editor_plugin.h"
#include "canvas_item_editor_plugin.h"
#include "core/input/input.h"
#include "core/io/file_access.h"
#include "core/math/geometry_2d.h"
#include "core/os/keyboard.h"
#include "editor/editor_settings.h"
#include "node_3d_editor_plugin.h"
#include "scene/3d/camera_3d.h"
void CollisionPolygon3DEditor::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_READY: {
button_create->set_icon(get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")));
button_edit->set_icon(get_theme_icon(SNAME("MovePoint"), SNAME("EditorIcons")));
button_edit->set_pressed(true);
get_tree()->connect("node_removed", callable_mp(this, &CollisionPolygon3DEditor::_node_removed));
} break;
case NOTIFICATION_PROCESS: {
if (!node) {
return;
}
if (_get_depth() != prev_depth) {
_polygon_draw();
prev_depth = _get_depth();
}
} break;
}
}
void CollisionPolygon3DEditor::_node_removed(Node *p_node) {
if (p_node == node) {
node = nullptr;
if (imgeom->get_parent() == p_node) {
p_node->remove_child(imgeom);
}
hide();
set_process(false);
}
}
void CollisionPolygon3DEditor::_menu_option(int p_option) {
switch (p_option) {
case MODE_CREATE: {
mode = MODE_CREATE;
button_create->set_pressed(true);
button_edit->set_pressed(false);
} break;
case MODE_EDIT: {
mode = MODE_EDIT;
button_create->set_pressed(false);
button_edit->set_pressed(true);
} break;
}
}
void CollisionPolygon3DEditor::_wip_close() {
undo_redo->create_action(TTR("Create Polygon3D"));
undo_redo->add_undo_method(node, "set_polygon", node->call("get_polygon"));
undo_redo->add_do_method(node, "set_polygon", wip);
undo_redo->add_do_method(this, "_polygon_draw");
undo_redo->add_undo_method(this, "_polygon_draw");
wip.clear();
wip_active = false;
mode = MODE_EDIT;
button_edit->set_pressed(true);
button_create->set_pressed(false);
edited_point = -1;
undo_redo->commit_action();
}
bool CollisionPolygon3DEditor::forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event) {
if (!node) {
return false;
}
Transform3D gt = node->get_global_transform();
Transform3D gi = gt.affine_inverse();
float depth = _get_depth() * 0.5;
Vector3 n = gt.basis.get_axis(2).normalized();
Plane p(gt.origin + n * depth, n);
Ref<InputEventMouseButton> mb = p_event;
if (mb.is_valid()) {
Vector2 gpoint = mb->get_position();
Vector3 ray_from = p_camera->project_ray_origin(gpoint);
Vector3 ray_dir = p_camera->project_ray_normal(gpoint);
Vector3 spoint;
if (!p.intersects_ray(ray_from, ray_dir, &spoint)) {
return false;
}
spoint = gi.xform(spoint);
Vector2 cpoint(spoint.x, spoint.y);
//DO NOT snap here, it's confusing in 3D for adding points.
//Let the snap happen when the point is being moved, instead.
//cpoint = CanvasItemEditor::get_singleton()->snap_point(cpoint);
Vector<Vector2> poly = node->call("get_polygon");
//first check if a point is to be added (segment split)
real_t grab_threshold = EDITOR_GET("editors/poly_editor/point_grab_radius");
switch (mode) {
case MODE_CREATE: {
if (mb->get_button_index() == MOUSE_BUTTON_LEFT && mb->is_pressed()) {
if (!wip_active) {
wip.clear();
wip.push_back(cpoint);
wip_active = true;
edited_point_pos = cpoint;
snap_ignore = false;
_polygon_draw();
edited_point = 1;
return true;
} else {
if (wip.size() > 1 && p_camera->unproject_position(gt.xform(Vector3(wip[0].x, wip[0].y, depth))).distance_to(gpoint) < grab_threshold) {
//wip closed
_wip_close();
return true;
} else {
wip.push_back(cpoint);
edited_point = wip.size();
snap_ignore = false;
_polygon_draw();
return true;
}
}
} else if (mb->get_button_index() == MOUSE_BUTTON_RIGHT && mb->is_pressed() && wip_active) {
_wip_close();
}
} break;
case MODE_EDIT: {
if (mb->get_button_index() == MOUSE_BUTTON_LEFT) {
if (mb->is_pressed()) {
if (mb->is_ctrl_pressed()) {
if (poly.size() < 3) {
undo_redo->create_action(TTR("Edit Poly"));
undo_redo->add_undo_method(node, "set_polygon", poly);
poly.push_back(cpoint);
undo_redo->add_do_method(node, "set_polygon", poly);
undo_redo->add_do_method(this, "_polygon_draw");
undo_redo->add_undo_method(this, "_polygon_draw");
undo_redo->commit_action();
return true;
}
//search edges
int closest_idx = -1;
Vector2 closest_pos;
real_t closest_dist = 1e10;
for (int i = 0; i < poly.size(); i++) {
Vector2 points[2] = {
p_camera->unproject_position(gt.xform(Vector3(poly[i].x, poly[i].y, depth))),
p_camera->unproject_position(gt.xform(Vector3(poly[(i + 1) % poly.size()].x, poly[(i + 1) % poly.size()].y, depth)))
};
Vector2 cp = Geometry2D::get_closest_point_to_segment(gpoint, points);
if (cp.distance_squared_to(points[0]) < CMP_EPSILON2 || cp.distance_squared_to(points[1]) < CMP_EPSILON2) {
continue; //not valid to reuse point
}
real_t d = cp.distance_to(gpoint);
if (d < closest_dist && d < grab_threshold) {
closest_dist = d;
closest_pos = cp;
closest_idx = i;
}
}
if (closest_idx >= 0) {
pre_move_edit = poly;
poly.insert(closest_idx + 1, cpoint);
edited_point = closest_idx + 1;
edited_point_pos = cpoint;
node->call("set_polygon", poly);
_polygon_draw();
snap_ignore = true;
return true;
}
} else {
//look for points to move
int closest_idx = -1;
Vector2 closest_pos;
real_t closest_dist = 1e10;
for (int i = 0; i < poly.size(); i++) {
Vector2 cp = p_camera->unproject_position(gt.xform(Vector3(poly[i].x, poly[i].y, depth)));
real_t d = cp.distance_to(gpoint);
if (d < closest_dist && d < grab_threshold) {
closest_dist = d;
closest_pos = cp;
closest_idx = i;
}
}
if (closest_idx >= 0) {
pre_move_edit = poly;
edited_point = closest_idx;
edited_point_pos = poly[closest_idx];
_polygon_draw();
snap_ignore = false;
return true;
}
}
} else {
snap_ignore = false;
if (edited_point != -1) {
//apply
ERR_FAIL_INDEX_V(edited_point, poly.size(), false);
poly.write[edited_point] = edited_point_pos;
undo_redo->create_action(TTR("Edit Poly"));
undo_redo->add_do_method(node, "set_polygon", poly);
undo_redo->add_undo_method(node, "set_polygon", pre_move_edit);
undo_redo->add_do_method(this, "_polygon_draw");
undo_redo->add_undo_method(this, "_polygon_draw");
undo_redo->commit_action();
edited_point = -1;
return true;
}
}
}
if (mb->get_button_index() == MOUSE_BUTTON_RIGHT && mb->is_pressed() && edited_point == -1) {
int closest_idx = -1;
Vector2 closest_pos;
real_t closest_dist = 1e10;
for (int i = 0; i < poly.size(); i++) {
Vector2 cp = p_camera->unproject_position(gt.xform(Vector3(poly[i].x, poly[i].y, depth)));
real_t d = cp.distance_to(gpoint);
if (d < closest_dist && d < grab_threshold) {
closest_dist = d;
closest_pos = cp;
closest_idx = i;
}
}
if (closest_idx >= 0) {
undo_redo->create_action(TTR("Edit Poly (Remove Point)"));
undo_redo->add_undo_method(node, "set_polygon", poly);
poly.remove(closest_idx);
undo_redo->add_do_method(node, "set_polygon", poly);
undo_redo->add_do_method(this, "_polygon_draw");
undo_redo->add_undo_method(this, "_polygon_draw");
undo_redo->commit_action();
return true;
}
}
} break;
}
}
Ref<InputEventMouseMotion> mm = p_event;
if (mm.is_valid()) {
if (edited_point != -1 && (wip_active || mm->get_button_mask() & MOUSE_BUTTON_MASK_LEFT)) {
Vector2 gpoint = mm->get_position();
Vector3 ray_from = p_camera->project_ray_origin(gpoint);
Vector3 ray_dir = p_camera->project_ray_normal(gpoint);
Vector3 spoint;
if (!p.intersects_ray(ray_from, ray_dir, &spoint)) {
return false;
}
spoint = gi.xform(spoint);
Vector2 cpoint(spoint.x, spoint.y);
if (snap_ignore && !Input::get_singleton()->is_key_pressed(KEY_CTRL)) {
snap_ignore = false;
}
if (!snap_ignore && Node3DEditor::get_singleton()->is_snap_enabled()) {
cpoint = cpoint.snapped(Vector2(
Node3DEditor::get_singleton()->get_translate_snap(),
Node3DEditor::get_singleton()->get_translate_snap()));
}
edited_point_pos = cpoint;
_polygon_draw();
}
}
return false;
}
float CollisionPolygon3DEditor::_get_depth() {
if (bool(node->call("_has_editable_3d_polygon_no_depth"))) {
return 0;
}
return float(node->call("get_depth"));
}
void CollisionPolygon3DEditor::_polygon_draw() {
if (!node) {
return;
}
Vector<Vector2> poly;
if (wip_active) {
poly = wip;
} else {
poly = node->call("get_polygon");
}
float depth = _get_depth() * 0.5;
imesh->clear_surfaces();
imgeom->set_material_override(line_material);
imesh->surface_begin(Mesh::PRIMITIVE_LINES);
Rect2 rect;
for (int i = 0; i < poly.size(); i++) {
Vector2 p, p2;
p = i == edited_point ? edited_point_pos : poly[i];
if ((wip_active && i == poly.size() - 1) || (((i + 1) % poly.size()) == edited_point)) {
p2 = edited_point_pos;
} else {
p2 = poly[(i + 1) % poly.size()];
}
if (i == 0) {
rect.position = p;
} else {
rect.expand_to(p);
}
Vector3 point = Vector3(p.x, p.y, depth);
Vector3 next_point = Vector3(p2.x, p2.y, depth);
imesh->surface_set_color(Color(1, 0.3, 0.1, 0.8));
imesh->surface_add_vertex(point);
imesh->surface_set_color(Color(1, 0.3, 0.1, 0.8));
imesh->surface_add_vertex(next_point);
//Color col=Color(1,0.3,0.1,0.8);
//vpc->draw_line(point,next_point,col,2);
//vpc->draw_texture(handle,point-handle->get_size()*0.5);
}
rect = rect.grow(1);
AABB r;
r.position.x = rect.position.x;
r.position.y = rect.position.y;
r.position.z = depth;
r.size.x = rect.size.x;
r.size.y = rect.size.y;
r.size.z = 0;
imesh->surface_set_color(Color(0.8, 0.8, 0.8, 0.2));
imesh->surface_add_vertex(r.position);
imesh->surface_set_color(Color(0.8, 0.8, 0.8, 0.2));
imesh->surface_add_vertex(r.position + Vector3(0.3, 0, 0));
imesh->surface_set_color(Color(0.8, 0.8, 0.8, 0.2));
imesh->surface_add_vertex(r.position);
imesh->surface_set_color(Color(0.8, 0.8, 0.8, 0.2));
imesh->surface_add_vertex(r.position + Vector3(0.0, 0.3, 0));
imesh->surface_set_color(Color(0.8, 0.8, 0.8, 0.2));
imesh->surface_add_vertex(r.position + Vector3(r.size.x, 0, 0));
imesh->surface_set_color(Color(0.8, 0.8, 0.8, 0.2));
imesh->surface_add_vertex(r.position + Vector3(r.size.x, 0, 0) - Vector3(0.3, 0, 0));
imesh->surface_set_color(Color(0.8, 0.8, 0.8, 0.2));
imesh->surface_add_vertex(r.position + Vector3(r.size.x, 0, 0));
imesh->surface_set_color(Color(0.8, 0.8, 0.8, 0.2));
imesh->surface_add_vertex(r.position + Vector3(r.size.x, 0, 0) + Vector3(0, 0.3, 0));
imesh->surface_set_color(Color(0.8, 0.8, 0.8, 0.2));
imesh->surface_add_vertex(r.position + Vector3(0, r.size.y, 0));
imesh->surface_set_color(Color(0.8, 0.8, 0.8, 0.2));
imesh->surface_add_vertex(r.position + Vector3(0, r.size.y, 0) - Vector3(0, 0.3, 0));
imesh->surface_set_color(Color(0.8, 0.8, 0.8, 0.2));
imesh->surface_add_vertex(r.position + Vector3(0, r.size.y, 0));
imesh->surface_set_color(Color(0.8, 0.8, 0.8, 0.2));
imesh->surface_add_vertex(r.position + Vector3(0, r.size.y, 0) + Vector3(0.3, 0, 0));
imesh->surface_set_color(Color(0.8, 0.8, 0.8, 0.2));
imesh->surface_add_vertex(r.position + r.size);
imesh->surface_set_color(Color(0.8, 0.8, 0.8, 0.2));
imesh->surface_add_vertex(r.position + r.size - Vector3(0.3, 0, 0));
imesh->surface_set_color(Color(0.8, 0.8, 0.8, 0.2));
imesh->surface_add_vertex(r.position + r.size);
imesh->surface_set_color(Color(0.8, 0.8, 0.8, 0.2));
imesh->surface_add_vertex(r.position + r.size - Vector3(0.0, 0.3, 0));
imesh->surface_end();
if (poly.size() == 0) {
return;
}
Array a;
a.resize(Mesh::ARRAY_MAX);
Vector<Vector3> va;
{
va.resize(poly.size());
Vector3 *w = va.ptrw();
for (int i = 0; i < poly.size(); i++) {
Vector2 p, p2;
p = i == edited_point ? edited_point_pos : poly[i];
Vector3 point = Vector3(p.x, p.y, depth);
w[i] = point;
}
}
a[Mesh::ARRAY_VERTEX] = va;
m->add_surface_from_arrays(Mesh::PRIMITIVE_POINTS, a);
m->surface_set_material(0, handle_material);
}
void CollisionPolygon3DEditor::edit(Node *p_collision_polygon) {
if (p_collision_polygon) {
node = Object::cast_to<Node3D>(p_collision_polygon);
//Enable the pencil tool if the polygon is empty
if (Vector<Vector2>(node->call("get_polygon")).size() == 0) {
_menu_option(MODE_CREATE);
}
wip.clear();
wip_active = false;
edited_point = -1;
p_collision_polygon->add_child(imgeom);
_polygon_draw();
set_process(true);
prev_depth = -1;
} else {
node = nullptr;
if (imgeom->get_parent()) {
imgeom->get_parent()->remove_child(imgeom);
}
set_process(false);
}
}
void CollisionPolygon3DEditor::_bind_methods() {
ClassDB::bind_method(D_METHOD("_polygon_draw"), &CollisionPolygon3DEditor::_polygon_draw);
}
CollisionPolygon3DEditor::CollisionPolygon3DEditor(EditorNode *p_editor) {
node = nullptr;
editor = p_editor;
undo_redo = EditorNode::get_undo_redo();
add_child(memnew(VSeparator));
button_create = memnew(Button);
button_create->set_flat(true);
add_child(button_create);
button_create->connect("pressed", callable_mp(this, &CollisionPolygon3DEditor::_menu_option), varray(MODE_CREATE));
button_create->set_toggle_mode(true);
button_edit = memnew(Button);
button_edit->set_flat(true);
add_child(button_edit);
button_edit->connect("pressed", callable_mp(this, &CollisionPolygon3DEditor::_menu_option), varray(MODE_EDIT));
button_edit->set_toggle_mode(true);
mode = MODE_EDIT;
wip_active = false;
imgeom = memnew(MeshInstance3D);
imesh.instantiate();
imgeom->set_mesh(imesh);
imgeom->set_transform(Transform3D(Basis(), Vector3(0, 0, 0.00001)));
line_material = Ref<StandardMaterial3D>(memnew(StandardMaterial3D));
line_material->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
line_material->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
line_material->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
line_material->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true);
line_material->set_albedo(Color(1, 1, 1));
handle_material = Ref<StandardMaterial3D>(memnew(StandardMaterial3D));
handle_material->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
handle_material->set_flag(StandardMaterial3D::FLAG_USE_POINT_SIZE, true);
handle_material->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
handle_material->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
handle_material->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true);
Ref<Texture2D> handle = editor->get_gui_base()->get_theme_icon(SNAME("Editor3DHandle"), SNAME("EditorIcons"));
handle_material->set_point_size(handle->get_width());
handle_material->set_texture(StandardMaterial3D::TEXTURE_ALBEDO, handle);
pointsm = memnew(MeshInstance3D);
imgeom->add_child(pointsm);
m.instantiate();
pointsm->set_mesh(m);
pointsm->set_transform(Transform3D(Basis(), Vector3(0, 0, 0.00001)));
snap_ignore = false;
}
CollisionPolygon3DEditor::~CollisionPolygon3DEditor() {
memdelete(imgeom);
}
void Polygon3DEditorPlugin::edit(Object *p_object) {
collision_polygon_editor->edit(Object::cast_to<Node>(p_object));
}
bool Polygon3DEditorPlugin::handles(Object *p_object) const {
return Object::cast_to<Node3D>(p_object) && bool(p_object->call("_is_editable_3d_polygon"));
}
void Polygon3DEditorPlugin::make_visible(bool p_visible) {
if (p_visible) {
collision_polygon_editor->show();
} else {
collision_polygon_editor->hide();
collision_polygon_editor->edit(nullptr);
}
}
Polygon3DEditorPlugin::Polygon3DEditorPlugin(EditorNode *p_node) {
editor = p_node;
collision_polygon_editor = memnew(CollisionPolygon3DEditor(p_node));
Node3DEditor::get_singleton()->add_control_to_menu_panel(collision_polygon_editor);
collision_polygon_editor->hide();
}
Polygon3DEditorPlugin::~Polygon3DEditorPlugin() {
}
| {
"content_hash": "1fcdaf608a60d3a4562bd6e031c0dd3e",
"timestamp": "",
"source": "github",
"line_count": 577,
"max_line_length": 142,
"avg_line_length": 32.65164644714038,
"alnum_prop": 0.6140658174097664,
"repo_name": "honix/godot",
"id": "5d5f78e0dcfeca45c723ae02a588aa6d472f77b7",
"size": "18840",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "editor/plugins/collision_polygon_3d_editor_plugin.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "50004"
},
{
"name": "C++",
"bytes": "16813390"
},
{
"name": "HTML",
"bytes": "10302"
},
{
"name": "Java",
"bytes": "497061"
},
{
"name": "Makefile",
"bytes": "451"
},
{
"name": "Objective-C",
"bytes": "2644"
},
{
"name": "Objective-C++",
"bytes": "145442"
},
{
"name": "Python",
"bytes": "262658"
},
{
"name": "Shell",
"bytes": "11105"
}
],
"symlink_target": ""
} |
'use strict';
var $ = require('./$')
, ctx = require('./$.ctx')
, cof = require('./$.cof')
, invoke = require('./$.invoke')
, global = $.g
, isFunction = $.isFunction
, setTask = global.setImmediate
, clearTask = global.clearImmediate
, postMessage = global.postMessage
, addEventListener = global.addEventListener
, MessageChannel = global.MessageChannel
, counter = 0
, queue = {}
, ONREADYSTATECHANGE = 'onreadystatechange'
, defer, channel, port;
function run(){
var id = +this;
if($.has(queue, id)){
var fn = queue[id];
delete queue[id];
fn();
}
}
function listner(event){
run.call(event.data);
}
// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
if(!isFunction(setTask) || !isFunction(clearTask)){
setTask = function(fn){
var args = [], i = 1;
while(arguments.length > i)args.push(arguments[i++]);
queue[++counter] = function(){
invoke(isFunction(fn) ? fn : Function(fn), args);
};
defer(counter);
return counter;
};
clearTask = function(id){
delete queue[id];
};
// Node.js 0.8-
if(cof(global.process) == 'process'){
defer = function(id){
global.process.nextTick(ctx(run, id, 1));
};
// Modern browsers, skip implementation for WebWorkers
// IE8 has postMessage, but it's sync & typeof its postMessage is object
} else if(addEventListener && isFunction(postMessage) && !$.g.importScripts){
defer = function(id){
postMessage(id, '*');
};
addEventListener('message', listner, false);
// WebWorkers
} else if(isFunction(MessageChannel)){
channel = new MessageChannel;
port = channel.port2;
channel.port1.onmessage = listner;
defer = ctx(port.postMessage, port, 1);
// IE8-
} else if($.g.document && ONREADYSTATECHANGE in document.createElement('script')){
defer = function(id){
$.html.appendChild(document.createElement('script'))[ONREADYSTATECHANGE] = function(){
$.html.removeChild(this);
run.call(id);
};
};
// Rest old browsers
} else {
defer = function(id){
setTimeout(ctx(run, id, 1), 0);
};
}
}
module.exports = {
set: setTask,
clear: clearTask
}; | {
"content_hash": "321381fb512555c066085847a3223ea3",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 92,
"avg_line_length": 29.102564102564102,
"alnum_prop": 0.5973568281938326,
"repo_name": "sitepoint-editors/aurelia-reddit-client",
"id": "e588c17b0bab127e03272689cf4ddd8d7be9794c",
"size": "2270",
"binary": false,
"copies": "12",
"ref": "refs/heads/master",
"path": "jspm_packages/github/zloirock/core-js@0.8.1/modules/$.task.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "119594"
},
{
"name": "CoffeeScript",
"bytes": "2294"
},
{
"name": "HTML",
"bytes": "6720"
},
{
"name": "JavaScript",
"bytes": "4433506"
},
{
"name": "LiveScript",
"bytes": "219393"
},
{
"name": "Makefile",
"bytes": "880"
}
],
"symlink_target": ""
} |
"""
Created on 10 October 2017
@author: Ashiv Dhondea
"""
import matplotlib.pyplot as plt
from matplotlib import rc
rc('font', **{'family': 'serif', 'serif': ['Helvetica']})
rc('text', usetex=True)
params = {'text.latex.preamble' : [r'\usepackage{amsmath}', r'\usepackage{amssymb}']}
plt.rcParams.update(params)
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
import pandas as pd
import numpy as np
import math
import AstroFunctions as AstFn
# ------------------------------------------------------------------------------------ #
dframe = pd.read_excel("MeerKAT64v36.wgs84.64x4_edited.xlsx",sheetname="Sheet1")
dframe = dframe.reset_index()
meerkat_id = dframe['ID'][0:64]
meerkat_lat = dframe['Lat'][0:64].astype(dtype=np.float64, copy=True)
meerkat_lon = dframe['Lon'][0:64].astype(dtype=np.float64, copy=True)
# -----------------------------------
altitude_meerkat = 1.038; # [km]
meerkat_ecef = np.zeros([64,3],dtype=np.float64);
baselines = np.zeros([64,64],dtype=np.float64);
for i in range(0,np.shape(meerkat_ecef)[0]):
meerkat_ecef[i,:] = AstFn.fnRadarSite(math.radians(meerkat_lat[i]),math.radians(meerkat_lon[i]),altitude_meerkat);
for i in range(63,0,-1):
for j in range(0,i,1):
baselines[i,j] = np.linalg.norm(np.subtract(meerkat_ecef[i,:],meerkat_ecef[j,:]))
#longest_baseline_indices = np.argmax(baselines);
longest_baseline_indices_unravel = np.unravel_index(baselines.argmax(), baselines.shape)
print longest_baseline_indices_unravel
longest_baseline = np.max(baselines)
print longest_baseline
print baselines[longest_baseline_indices_unravel[0],longest_baseline_indices_unravel[1]]
print baselines[60,48]
lim_lon_min = meerkat_lon.min();
lim_lon_max = meerkat_lon.max();
lim_lat_min = meerkat_lat.min();
lim_lat_max = meerkat_lat.max();
fig = plt.figure(1);
plt.rc('text', usetex=True)
plt.rc('font', family='serif');
map = Basemap(llcrnrlon=lim_lon_min-0.005,llcrnrlat=lim_lat_min-0.01,urcrnrlon=lim_lon_max+0.005,urcrnrlat=lim_lat_max+0.01,resolution='f', projection='cass', lat_0 = 0.0, lon_0 = 0.0) # see http://boundingbox.klokantech.com/
#map.drawmapboundary(fill_color='aqua')
#map.fillcontinents(color='coral',lake_color='aqua')
map.drawmapboundary(fill_color='lightblue')
map.fillcontinents(color='beige',lake_color='lightblue')
parallels = np.arange(-81.,0.,0.02)
# labels = [left,right,top,bottom]
map.drawparallels(parallels,labels=[False,True,False,False],labelstyle='+/-',linewidth=0.2)
meridians = np.arange(10.,351.,0.02)
map.drawmeridians(meridians,labels=[True,False,False,True],labelstyle='+/-',linewidth=0.2)
for i in range(64):
x,y = map(meerkat_lon[i],meerkat_lat[i]);
map.plot(x,y,marker='o',markersize=3,color='blue');
for i in range(48,64,1):
x,y = map(meerkat_lon[i],meerkat_lat[i]);
plt.text(x, y, r"\textbf{%s}" %meerkat_id[i],fontsize=6,color='navy')
# plt.annotate(r"\textbf{%s}" %meerkat_id[i],xy = (x,y),color='navy')
plt.title(r'\textbf{Location of MeerKAT dishes}', fontsize=12);
fig.savefig('main_xxx_meerkat_layout.pdf',bbox_inches='tight',pad_inches=0.08,dpi=10);
| {
"content_hash": "357c16b8df0db39294a0b7dceedd8bc8",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 225,
"avg_line_length": 37.94047619047619,
"alnum_prop": 0.6655161593975526,
"repo_name": "AshivDhondea/SORADSIM",
"id": "d82c4824af3e15e4361bd473db883504c625cb44",
"size": "3212",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "miscellaneous/main_xxx_meerkat_layout.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Jupyter Notebook",
"bytes": "1189967"
},
{
"name": "Python",
"bytes": "484131"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>paramcoq: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.14.1 / paramcoq - 1.1.3+coq8.10</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
paramcoq
<small>
1.1.3+coq8.10
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-06-02 20:58:29 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-06-02 20:58:29 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-gmp 4 Virtual package relying on a GMP lib system installation
coq 8.14.1 Formal proof management system
dune 3.2.0 Fast, portable, and opinionated build system
ocaml 4.13.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.13.1 Official release 4.13.1
ocaml-config 2 OCaml Switch Configuration
ocaml-options-vanilla 1 Ensure that OCaml is compiled with no special options enabled
ocamlfind 1.9.3 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
maintainer: "Pierre Roux <pierre.roux@onera.fr>"
homepage: "https://github.com/coq-community/paramcoq"
dev-repo: "git+https://github.com/coq-community/paramcoq.git"
bug-reports: "https://github.com/coq-community/paramcoq/issues"
license: "MIT"
build: [make "-j%{jobs}%"]
install: [make "install"]
depends: [
"coq" {>= "8.10" & < "8.11~"}
]
tags: [
"keyword:paramcoq"
"keyword:parametricity"
"keyword:OCaml modules"
"category:Miscellaneous/Coq Extensions"
"logpath:Param"
"date:2021-09-24"
]
authors: [
"Chantal Keller (Inria, École polytechnique)"
"Marc Lasson (ÉNS de Lyon)"
"Abhishek Anand"
"Pierre Roux"
"Emilio Jesús Gallego Arias"
"Cyril Cohen"
"Matthieu Sozeau"
]
synopsis: "Plugin for generating parametricity statements to perform refinement proofs"
description: """
A Coq plugin providing commands for generating parametricity statements.
Typical applications of such statements are in data refinement proofs.
Note that the plugin is still in an experimental state - it is not very user
friendly (lack of good error messages) and still contains bugs. But it
is usable enough to "translate" a large chunk of the standard library."""
url {
src: "https://github.com/coq-community/paramcoq/archive/v1.1.3+coq8.10.tar.gz"
checksum: "sha512=7e1c8cb69a70d2ee900171e416cc20a4249ced681cae5d144001b0ba938b5d4bc841ca768c045a5ab1dcb42145a090f2339fafb1c49f999875a0b3891f67e328"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-paramcoq.1.1.3+coq8.10 coq.8.14.1</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.14.1).
The following dependencies couldn't be met:
- coq-paramcoq -> coq < 8.11~ -> ocaml < 4.10
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-paramcoq.1.1.3+coq8.10</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "af3755646dfba263130966a388289680",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 159,
"avg_line_length": 42.23888888888889,
"alnum_prop": 0.5637248454557412,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "61325b40810fbf8a32df8087903af2c4a84b22a5",
"size": "7631",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.13.1-2.0.10/released/8.14.1/paramcoq/1.1.3+coq8.10.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
#include "config.h"
#include "PDFDocumentImage.h"
#if USE(CG)
#if PLATFORM(IOS)
#include <CoreGraphics/CoreGraphics.h>
#include <ImageIO/ImageIO.h>
#endif
#include "GraphicsContext.h"
#include "ImageBuffer.h"
#include "ImageObserver.h"
#include "IntRect.h"
#include "Length.h"
#include "NotImplemented.h"
#include "SharedBuffer.h"
#include <CoreGraphics/CGContext.h>
#include <CoreGraphics/CGPDFDocument.h>
#include <wtf/MathExtras.h>
#include <wtf/RAMSize.h>
#include <wtf/RetainPtr.h>
#include <wtf/StdLibExtras.h>
#include <wtf/text/TextStream.h>
#if !PLATFORM(COCOA)
#include "ImageSourceCG.h"
#endif
namespace WebCore {
PDFDocumentImage::PDFDocumentImage(ImageObserver* observer)
: Image(observer)
{
}
PDFDocumentImage::~PDFDocumentImage() = default;
String PDFDocumentImage::filenameExtension() const
{
return "pdf";
}
FloatSize PDFDocumentImage::size() const
{
FloatSize expandedCropBoxSize = FloatSize(expandedIntSize(m_cropBox.size()));
if (m_rotationDegrees == 90 || m_rotationDegrees == 270)
return expandedCropBoxSize.transposedSize();
return expandedCropBoxSize;
}
void PDFDocumentImage::computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio)
{
// FIXME: If we want size negotiation with PDF documents as-image, this is the place to implement it (https://bugs.webkit.org/show_bug.cgi?id=12095).
Image::computeIntrinsicDimensions(intrinsicWidth, intrinsicHeight, intrinsicRatio);
intrinsicRatio = FloatSize();
}
EncodedDataStatus PDFDocumentImage::dataChanged(bool allDataReceived)
{
ASSERT(!m_document);
if (allDataReceived && !m_document) {
createPDFDocument();
if (pageCount()) {
m_hasPage = true;
computeBoundsForCurrentPage();
}
}
return m_document ? EncodedDataStatus::Complete : EncodedDataStatus::Unknown;
}
void PDFDocumentImage::setPdfImageCachingPolicy(PDFImageCachingPolicy pdfImageCachingPolicy)
{
if (m_pdfImageCachingPolicy == pdfImageCachingPolicy)
return;
m_pdfImageCachingPolicy = pdfImageCachingPolicy;
destroyDecodedData();
}
bool PDFDocumentImage::cacheParametersMatch(GraphicsContext& context, const FloatRect& dstRect, const FloatRect& srcRect) const
{
if (dstRect.size() != m_cachedDestinationSize)
return false;
if (srcRect != m_cachedSourceRect)
return false;
AffineTransform::DecomposedType decomposedTransform;
context.getCTM(GraphicsContext::DefinitelyIncludeDeviceScale).decompose(decomposedTransform);
AffineTransform::DecomposedType cachedDecomposedTransform;
m_cachedTransform.decompose(cachedDecomposedTransform);
if (decomposedTransform.scaleX != cachedDecomposedTransform.scaleX || decomposedTransform.scaleY != cachedDecomposedTransform.scaleY)
return false;
return true;
}
static void transformContextForPainting(GraphicsContext& context, const FloatRect& dstRect, const FloatRect& srcRect)
{
float hScale = dstRect.width() / srcRect.width();
float vScale = dstRect.height() / srcRect.height();
if (hScale != vScale) {
float minimumScale = std::max((dstRect.width() - 0.5) / srcRect.width(), (dstRect.height() - 0.5) / srcRect.height());
float maximumScale = std::min((dstRect.width() + 0.5) / srcRect.width(), (dstRect.height() + 0.5) / srcRect.height());
// If the difference between the two scales is due to integer rounding of image sizes,
// use the smaller of the two original scales to ensure that the image fits inside the
// space originally allocated for it.
if (minimumScale <= maximumScale) {
hScale = std::min(hScale, vScale);
vScale = hScale;
}
}
// drawPDFPage() relies on drawing the whole PDF into a context starting at (0, 0). We need
// to transform the destination context such that srcRect of the source context will be drawn
// in dstRect of destination context.
context.translate(dstRect.location() - srcRect.location());
context.scale(FloatSize(hScale, -vScale));
context.translate(0, -srcRect.height());
}
// To avoid the jetsam on iOS, we are going to limit the size of all the PDF cachedImages to be 64MB.
static const size_t s_maxCachedImageSide = 4 * 1024;
static const size_t s_maxCachedImageArea = s_maxCachedImageSide * s_maxCachedImageSide;
static const size_t s_maxDecodedDataSize = s_maxCachedImageArea * 4;
static size_t s_allDecodedDataSize = 0;
static FloatRect cachedImageRect(GraphicsContext& context, const FloatRect& dstRect)
{
FloatRect dirtyRect = context.clipBounds();
// Calculate the maximum rectangle we can cache around the center of the clipping bounds.
FloatSize maxSize = s_maxCachedImageSide / context.scaleFactor();
FloatPoint minLocation = FloatPoint(dirtyRect.center() - maxSize / 2);
// Ensure the clipping bounds are all included but within the bounds of the dstRect
return intersection(unionRect(dirtyRect, FloatRect(minLocation, maxSize)), dstRect);
}
void PDFDocumentImage::decodedSizeChanged(size_t newCachedBytes)
{
if (!m_cachedBytes && !newCachedBytes)
return;
if (imageObserver())
imageObserver()->decodedSizeChanged(*this, -static_cast<long long>(m_cachedBytes) + newCachedBytes);
ASSERT(s_allDecodedDataSize >= m_cachedBytes);
// Update with the difference in two steps to avoid unsigned underflow subtraction.
s_allDecodedDataSize -= m_cachedBytes;
s_allDecodedDataSize += newCachedBytes;
m_cachedBytes = newCachedBytes;
}
void PDFDocumentImage::updateCachedImageIfNeeded(GraphicsContext& context, const FloatRect& dstRect, const FloatRect& srcRect)
{
#if PLATFORM(IOS)
// On iOS, some clients use low-quality image interpolation always, which throws off this optimization,
// as we never get the subsequent high-quality paint. Since live resize is rare on iOS, disable the optimization.
// FIXME (136593): It's also possible to do the wrong thing here if CSS specifies low-quality interpolation via the "image-rendering"
// property, on all platforms. We should only do this optimization if we're actually in a ImageQualityController live resize,
// and are guaranteed to do a high-quality paint later.
bool repaintIfNecessary = true;
#else
// If we have an existing image, reuse it if we're doing a low-quality paint, even if cache parameters don't match;
// we'll rerender when we do the subsequent high-quality paint.
InterpolationQuality interpolationQuality = context.imageInterpolationQuality();
bool repaintIfNecessary = interpolationQuality != InterpolationNone && interpolationQuality != InterpolationLow;
#endif
switch (m_pdfImageCachingPolicy) {
case PDFImageCachingDisabled:
return;
case PDFImageCachingBelowMemoryLimit:
// Keep the memory used by the cached image below some threshold, otherwise WebKit process
// will jetsam if it exceeds its memory limit. Only a rectangle from the PDF may be cached.
m_cachedImageRect = cachedImageRect(context, dstRect);
break;
case PDFImageCachingClipBoundsOnly:
m_cachedImageRect = context.clipBounds();
break;
case PDFImageCachingEnabled:
m_cachedImageRect = dstRect;
break;
}
// Clipped option is for testing only. Force recaching the PDF with each draw.
if (m_pdfImageCachingPolicy != PDFImageCachingClipBoundsOnly) {
if (m_cachedImageBuffer && (!repaintIfNecessary || cacheParametersMatch(context, dstRect, srcRect)))
return;
}
FloatSize cachedImageSize = FloatRect(enclosingIntRect(m_cachedImageRect)).size();
// Cache the PDF image only if the size of the new image won't exceed the cache threshold.
if (m_pdfImageCachingPolicy == PDFImageCachingBelowMemoryLimit) {
IntSize scaledSize = ImageBuffer::compatibleBufferSize(cachedImageSize, context);
if (s_allDecodedDataSize + scaledSize.unclampedArea() * 4 - m_cachedBytes > s_maxDecodedDataSize) {
destroyDecodedData();
return;
}
}
m_cachedImageBuffer = ImageBuffer::createCompatibleBuffer(cachedImageSize, context);
if (!m_cachedImageBuffer) {
destroyDecodedData();
return;
}
auto& bufferContext = m_cachedImageBuffer->context();
// We need to transform the coordinate system such that top-left of m_cachedImageRect will be mapped to the
// top-left of dstRect. Although only m_cachedImageRect.size() of the image copied, the sizes of srcRect
// and dstRect should be passed to this function because they are used to calculate the image scaling.
transformContextForPainting(bufferContext, dstRect, FloatRect(m_cachedImageRect.location(), srcRect.size()));
drawPDFPage(bufferContext);
m_cachedTransform = context.getCTM(GraphicsContext::DefinitelyIncludeDeviceScale);
m_cachedDestinationSize = dstRect.size();
m_cachedSourceRect = srcRect;
IntSize internalSize = m_cachedImageBuffer->internalSize();
decodedSizeChanged(internalSize.unclampedArea() * 4);
}
ImageDrawResult PDFDocumentImage::draw(GraphicsContext& context, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator op, BlendMode, DecodingMode, ImageOrientationDescription)
{
if (!m_document || !m_hasPage)
return ImageDrawResult::DidNothing;
updateCachedImageIfNeeded(context, dstRect, srcRect);
{
GraphicsContextStateSaver stateSaver(context);
context.setCompositeOperation(op);
if (m_cachedImageBuffer) {
// Draw the ImageBuffer 'm_cachedImageBuffer' to the rectangle 'm_cachedImageRect'
// on the destination context. Since the pixels of the rectangle 'm_cachedImageRect'
// of the source PDF was copied to 'm_cachedImageBuffer', the sizes of the source
// and the destination rectangles will be equal and no scaling will be needed here.
context.drawImageBuffer(*m_cachedImageBuffer, m_cachedImageRect);
}
else {
transformContextForPainting(context, dstRect, srcRect);
drawPDFPage(context);
}
}
if (imageObserver())
imageObserver()->didDraw(*this);
return ImageDrawResult::DidDraw;
}
void PDFDocumentImage::destroyDecodedData(bool)
{
m_cachedImageBuffer = nullptr;
m_cachedImageRect = FloatRect();
decodedSizeChanged(0);
}
#if !USE(PDFKIT_FOR_PDFDOCUMENTIMAGE)
void PDFDocumentImage::createPDFDocument()
{
RetainPtr<CGDataProviderRef> dataProvider = adoptCF(CGDataProviderCreateWithCFData(data()->createCFData().get()));
m_document = adoptCF(CGPDFDocumentCreateWithProvider(dataProvider.get()));
}
void PDFDocumentImage::computeBoundsForCurrentPage()
{
ASSERT(pageCount() > 0);
CGPDFPageRef cgPage = CGPDFDocumentGetPage(m_document.get(), 1);
CGRect mediaBox = CGPDFPageGetBoxRect(cgPage, kCGPDFMediaBox);
// Get crop box (not always there). If not, use media box.
CGRect r = CGPDFPageGetBoxRect(cgPage, kCGPDFCropBox);
if (!CGRectIsEmpty(r))
m_cropBox = r;
else
m_cropBox = mediaBox;
m_rotationDegrees = CGPDFPageGetRotationAngle(cgPage);
}
unsigned PDFDocumentImage::pageCount() const
{
return CGPDFDocumentGetNumberOfPages(m_document.get());
}
static void applyRotationForPainting(GraphicsContext& context, FloatSize size, int rotationDegrees)
{
if (rotationDegrees == 90)
context.translate(0, size.height());
else if (rotationDegrees == 180)
context.translate(size);
else if (rotationDegrees == 270)
context.translate(size.width(), 0);
context.rotate(-deg2rad(static_cast<float>(rotationDegrees)));
}
void PDFDocumentImage::drawPDFPage(GraphicsContext& context)
{
applyRotationForPainting(context, size(), m_rotationDegrees);
context.translate(-m_cropBox.location());
#if USE(DIRECT2D)
notImplemented();
#else
// CGPDF pages are indexed from 1.
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200) || PLATFORM(IOS)
CGContextDrawPDFPageWithAnnotations(context.platformContext(), CGPDFDocumentGetPage(m_document.get(), 1), nullptr);
#else
CGContextDrawPDFPage(context.platformContext(), CGPDFDocumentGetPage(m_document.get(), 1));
#endif
#endif
}
#endif // !USE(PDFKIT_FOR_PDFDOCUMENTIMAGE)
#if PLATFORM(MAC)
RetainPtr<CFMutableDataRef> PDFDocumentImage::convertPostScriptDataToPDF(RetainPtr<CFDataRef>&& postScriptData)
{
// Convert PostScript to PDF using the Quartz 2D API.
// http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_ps_convert/chapter_16_section_1.html
CGPSConverterCallbacks callbacks = { };
auto converter = adoptCF(CGPSConverterCreate(0, &callbacks, 0));
auto provider = adoptCF(CGDataProviderCreateWithCFData(postScriptData.get()));
auto pdfData = adoptCF(CFDataCreateMutable(kCFAllocatorDefault, 0));
auto consumer = adoptCF(CGDataConsumerCreateWithCFData(pdfData.get()));
CGPSConverterConvert(converter.get(), provider.get(), consumer.get(), 0);
return pdfData;
}
#endif
void PDFDocumentImage::dump(TextStream& ts) const
{
Image::dump(ts);
ts.dumpProperty("page-count", pageCount());
ts.dumpProperty("crop-box", m_cropBox);
if (m_rotationDegrees)
ts.dumpProperty("rotation", m_rotationDegrees);
}
}
#endif // USE(CG)
| {
"content_hash": "3cbd92adad97c34ec84cbf9bb4a6aa70",
"timestamp": "",
"source": "github",
"line_count": 363,
"max_line_length": 192,
"avg_line_length": 37.074380165289256,
"alnum_prop": 0.7260365581810075,
"repo_name": "gubaojian/trylearn",
"id": "ab5c613251ad201c2d0bb90a0e98ad34cb9f4524",
"size": "14808",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "WebLayoutCore/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "AspectJ",
"bytes": "623"
},
{
"name": "Assembly",
"bytes": "1942"
},
{
"name": "Batchfile",
"bytes": "6632"
},
{
"name": "C",
"bytes": "6629351"
},
{
"name": "C++",
"bytes": "57418677"
},
{
"name": "CMake",
"bytes": "1269316"
},
{
"name": "CSS",
"bytes": "99559"
},
{
"name": "HTML",
"bytes": "283332"
},
{
"name": "Java",
"bytes": "267448"
},
{
"name": "JavaScript",
"bytes": "282026"
},
{
"name": "Makefile",
"bytes": "164797"
},
{
"name": "Objective-C",
"bytes": "956074"
},
{
"name": "Objective-C++",
"bytes": "3645713"
},
{
"name": "Perl",
"bytes": "192119"
},
{
"name": "Python",
"bytes": "39191"
},
{
"name": "Ragel",
"bytes": "128173"
},
{
"name": "Roff",
"bytes": "26536"
},
{
"name": "Ruby",
"bytes": "32784"
},
{
"name": "Shell",
"bytes": "7177"
},
{
"name": "Vue",
"bytes": "1776"
},
{
"name": "Yacc",
"bytes": "11866"
}
],
"symlink_target": ""
} |
#include <grpc/support/port_platform.h>
#if GRPC_ARES == 1 && !defined(GRPC_UV)
#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/iomgr/socket_utils_posix.h"
#include <string.h>
#include <sys/types.h>
#include <ares.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
#include "src/core/ext/filters/client_channel/parse_address.h"
#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h"
#include "src/core/lib/gpr/host_port.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
#include "src/core/lib/iomgr/nameser.h"
#include "src/core/lib/iomgr/sockaddr_utils.h"
static gpr_once g_basic_init = GPR_ONCE_INIT;
static gpr_mu g_init_mu;
struct grpc_ares_request {
/** indicates the DNS server to use, if specified */
struct ares_addr_port_node dns_server_addr;
/** following members are set in grpc_resolve_address_ares_impl */
/** closure to call when the request completes */
grpc_closure* on_done;
/** the pointer to receive the resolved addresses */
grpc_lb_addresses** lb_addrs_out;
/** the pointer to receive the service config in JSON */
char** service_config_json_out;
/** the evernt driver used by this request */
grpc_ares_ev_driver* ev_driver;
/** number of ongoing queries */
gpr_refcount pending_queries;
/** mutex guarding the rest of the state */
gpr_mu mu;
/** is there at least one successful query, set in on_done_cb */
bool success;
/** the errors explaining the request failure, set in on_done_cb */
grpc_error* error;
};
typedef struct grpc_ares_hostbyname_request {
/** following members are set in create_hostbyname_request */
/** the top-level request instance */
grpc_ares_request* parent_request;
/** host to resolve, parsed from the name to resolve */
char* host;
/** port to fill in sockaddr_in, parsed from the name to resolve */
uint16_t port;
/** is it a grpclb address */
bool is_balancer;
} grpc_ares_hostbyname_request;
static void do_basic_init(void) { gpr_mu_init(&g_init_mu); }
static uint16_t strhtons(const char* port) {
if (strcmp(port, "http") == 0) {
return htons(80);
} else if (strcmp(port, "https") == 0) {
return htons(443);
}
return htons(static_cast<unsigned short>(atoi(port)));
}
static void grpc_ares_request_ref(grpc_ares_request* r) {
gpr_ref(&r->pending_queries);
}
static void grpc_ares_request_unref(grpc_ares_request* r) {
/* If there are no pending queries, invoke on_done callback and destroy the
request */
if (gpr_unref(&r->pending_queries)) {
/* TODO(zyc): Sort results with RFC6724 before invoking on_done. */
GRPC_CLOSURE_SCHED(r->on_done, r->error);
gpr_mu_destroy(&r->mu);
grpc_ares_ev_driver_destroy(r->ev_driver);
gpr_free(r);
}
}
static grpc_ares_hostbyname_request* create_hostbyname_request(
grpc_ares_request* parent_request, char* host, uint16_t port,
bool is_balancer) {
grpc_ares_hostbyname_request* hr = static_cast<grpc_ares_hostbyname_request*>(
gpr_zalloc(sizeof(grpc_ares_hostbyname_request)));
hr->parent_request = parent_request;
hr->host = gpr_strdup(host);
hr->port = port;
hr->is_balancer = is_balancer;
grpc_ares_request_ref(parent_request);
return hr;
}
static void destroy_hostbyname_request(grpc_ares_hostbyname_request* hr) {
grpc_ares_request_unref(hr->parent_request);
gpr_free(hr->host);
gpr_free(hr);
}
static void on_hostbyname_done_cb(void* arg, int status, int timeouts,
struct hostent* hostent) {
grpc_ares_hostbyname_request* hr =
static_cast<grpc_ares_hostbyname_request*>(arg);
grpc_ares_request* r = hr->parent_request;
gpr_mu_lock(&r->mu);
if (status == ARES_SUCCESS) {
GRPC_ERROR_UNREF(r->error);
r->error = GRPC_ERROR_NONE;
r->success = true;
grpc_lb_addresses** lb_addresses = r->lb_addrs_out;
if (*lb_addresses == nullptr) {
*lb_addresses = grpc_lb_addresses_create(0, nullptr);
}
size_t prev_naddr = (*lb_addresses)->num_addresses;
size_t i;
for (i = 0; hostent->h_addr_list[i] != nullptr; i++) {
}
(*lb_addresses)->num_addresses += i;
(*lb_addresses)->addresses = static_cast<grpc_lb_address*>(
gpr_realloc((*lb_addresses)->addresses,
sizeof(grpc_lb_address) * (*lb_addresses)->num_addresses));
for (i = prev_naddr; i < (*lb_addresses)->num_addresses; i++) {
switch (hostent->h_addrtype) {
case AF_INET6: {
size_t addr_len = sizeof(struct sockaddr_in6);
struct sockaddr_in6 addr;
memset(&addr, 0, addr_len);
memcpy(&addr.sin6_addr, hostent->h_addr_list[i - prev_naddr],
sizeof(struct in6_addr));
addr.sin6_family = static_cast<sa_family_t>(hostent->h_addrtype);
addr.sin6_port = hr->port;
grpc_lb_addresses_set_address(
*lb_addresses, i, &addr, addr_len,
hr->is_balancer /* is_balancer */,
hr->is_balancer ? hr->host : nullptr /* balancer_name */,
nullptr /* user_data */);
char output[INET6_ADDRSTRLEN];
ares_inet_ntop(AF_INET6, &addr.sin6_addr, output, INET6_ADDRSTRLEN);
gpr_log(GPR_DEBUG,
"c-ares resolver gets a AF_INET6 result: \n"
" addr: %s\n port: %d\n sin6_scope_id: %d\n",
output, ntohs(hr->port), addr.sin6_scope_id);
break;
}
case AF_INET: {
size_t addr_len = sizeof(struct sockaddr_in);
struct sockaddr_in addr;
memset(&addr, 0, addr_len);
memcpy(&addr.sin_addr, hostent->h_addr_list[i - prev_naddr],
sizeof(struct in_addr));
addr.sin_family = static_cast<sa_family_t>(hostent->h_addrtype);
addr.sin_port = hr->port;
grpc_lb_addresses_set_address(
*lb_addresses, i, &addr, addr_len,
hr->is_balancer /* is_balancer */,
hr->is_balancer ? hr->host : nullptr /* balancer_name */,
nullptr /* user_data */);
char output[INET_ADDRSTRLEN];
ares_inet_ntop(AF_INET, &addr.sin_addr, output, INET_ADDRSTRLEN);
gpr_log(GPR_DEBUG,
"c-ares resolver gets a AF_INET result: \n"
" addr: %s\n port: %d\n",
output, ntohs(hr->port));
break;
}
}
}
} else if (!r->success) {
char* error_msg;
gpr_asprintf(&error_msg, "C-ares status is not ARES_SUCCESS: %s",
ares_strerror(status));
grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_msg);
gpr_free(error_msg);
if (r->error == GRPC_ERROR_NONE) {
r->error = error;
} else {
r->error = grpc_error_add_child(error, r->error);
}
}
gpr_mu_unlock(&r->mu);
destroy_hostbyname_request(hr);
}
static void on_srv_query_done_cb(void* arg, int status, int timeouts,
unsigned char* abuf, int alen) {
grpc_ares_request* r = static_cast<grpc_ares_request*>(arg);
grpc_core::ExecCtx exec_ctx;
gpr_log(GPR_DEBUG, "on_query_srv_done_cb");
if (status == ARES_SUCCESS) {
gpr_log(GPR_DEBUG, "on_query_srv_done_cb ARES_SUCCESS");
struct ares_srv_reply* reply;
const int parse_status = ares_parse_srv_reply(abuf, alen, &reply);
if (parse_status == ARES_SUCCESS) {
ares_channel* channel = grpc_ares_ev_driver_get_channel(r->ev_driver);
for (struct ares_srv_reply* srv_it = reply; srv_it != nullptr;
srv_it = srv_it->next) {
if (grpc_ipv6_loopback_available()) {
grpc_ares_hostbyname_request* hr = create_hostbyname_request(
r, srv_it->host, htons(srv_it->port), true /* is_balancer */);
ares_gethostbyname(*channel, hr->host, AF_INET6,
on_hostbyname_done_cb, hr);
}
grpc_ares_hostbyname_request* hr = create_hostbyname_request(
r, srv_it->host, htons(srv_it->port), true /* is_balancer */);
ares_gethostbyname(*channel, hr->host, AF_INET, on_hostbyname_done_cb,
hr);
grpc_ares_ev_driver_start(r->ev_driver);
}
}
if (reply != nullptr) {
ares_free_data(reply);
}
} else if (!r->success) {
char* error_msg;
gpr_asprintf(&error_msg, "C-ares status is not ARES_SUCCESS: %s",
ares_strerror(status));
grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_msg);
gpr_free(error_msg);
if (r->error == GRPC_ERROR_NONE) {
r->error = error;
} else {
r->error = grpc_error_add_child(error, r->error);
}
}
grpc_ares_request_unref(r);
}
static const char g_service_config_attribute_prefix[] = "grpc_config=";
static void on_txt_done_cb(void* arg, int status, int timeouts,
unsigned char* buf, int len) {
gpr_log(GPR_DEBUG, "on_txt_done_cb");
char* error_msg;
grpc_ares_request* r = static_cast<grpc_ares_request*>(arg);
const size_t prefix_len = sizeof(g_service_config_attribute_prefix) - 1;
struct ares_txt_ext* result = nullptr;
struct ares_txt_ext* reply = nullptr;
grpc_error* error = GRPC_ERROR_NONE;
gpr_mu_lock(&r->mu);
if (status != ARES_SUCCESS) goto fail;
status = ares_parse_txt_reply_ext(buf, len, &reply);
if (status != ARES_SUCCESS) goto fail;
// Find service config in TXT record.
for (result = reply; result != nullptr; result = result->next) {
if (result->record_start &&
memcmp(result->txt, g_service_config_attribute_prefix, prefix_len) ==
0) {
break;
}
}
// Found a service config record.
if (result != nullptr) {
size_t service_config_len = result->length - prefix_len;
*r->service_config_json_out =
static_cast<char*>(gpr_malloc(service_config_len + 1));
memcpy(*r->service_config_json_out, result->txt + prefix_len,
service_config_len);
for (result = result->next; result != nullptr && !result->record_start;
result = result->next) {
*r->service_config_json_out = static_cast<char*>(
gpr_realloc(*r->service_config_json_out,
service_config_len + result->length + 1));
memcpy(*r->service_config_json_out + service_config_len, result->txt,
result->length);
service_config_len += result->length;
}
(*r->service_config_json_out)[service_config_len] = '\0';
gpr_log(GPR_INFO, "found service config: %s", *r->service_config_json_out);
}
// Clean up.
ares_free_data(reply);
goto done;
fail:
gpr_asprintf(&error_msg, "C-ares TXT lookup status is not ARES_SUCCESS: %s",
ares_strerror(status));
error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_msg);
gpr_free(error_msg);
if (r->error == GRPC_ERROR_NONE) {
r->error = error;
} else {
r->error = grpc_error_add_child(error, r->error);
}
done:
gpr_mu_unlock(&r->mu);
grpc_ares_request_unref(r);
}
static grpc_ares_request* grpc_dns_lookup_ares_impl(
const char* dns_server, const char* name, const char* default_port,
grpc_pollset_set* interested_parties, grpc_closure* on_done,
grpc_lb_addresses** addrs, bool check_grpclb, char** service_config_json) {
grpc_error* error = GRPC_ERROR_NONE;
grpc_ares_hostbyname_request* hr = nullptr;
grpc_ares_request* r = nullptr;
ares_channel* channel = nullptr;
/* TODO(zyc): Enable tracing after #9603 is checked in */
/* if (grpc_dns_trace) {
gpr_log(GPR_DEBUG, "resolve_address (blocking): name=%s, default_port=%s",
name, default_port);
} */
/* parse name, splitting it into host and port parts */
char* host;
char* port;
gpr_split_host_port(name, &host, &port);
if (host == nullptr) {
error = grpc_error_set_str(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("unparseable host:port"),
GRPC_ERROR_STR_TARGET_ADDRESS, grpc_slice_from_copied_string(name));
goto error_cleanup;
} else if (port == nullptr) {
if (default_port == nullptr) {
error = grpc_error_set_str(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("no port in name"),
GRPC_ERROR_STR_TARGET_ADDRESS, grpc_slice_from_copied_string(name));
goto error_cleanup;
}
port = gpr_strdup(default_port);
}
grpc_ares_ev_driver* ev_driver;
error = grpc_ares_ev_driver_create(&ev_driver, interested_parties);
if (error != GRPC_ERROR_NONE) goto error_cleanup;
r = static_cast<grpc_ares_request*>(gpr_zalloc(sizeof(grpc_ares_request)));
gpr_mu_init(&r->mu);
r->ev_driver = ev_driver;
r->on_done = on_done;
r->lb_addrs_out = addrs;
r->service_config_json_out = service_config_json;
r->success = false;
r->error = GRPC_ERROR_NONE;
channel = grpc_ares_ev_driver_get_channel(r->ev_driver);
// If dns_server is specified, use it.
if (dns_server != nullptr) {
gpr_log(GPR_INFO, "Using DNS server %s", dns_server);
grpc_resolved_address addr;
if (grpc_parse_ipv4_hostport(dns_server, &addr, false /* log_errors */)) {
r->dns_server_addr.family = AF_INET;
struct sockaddr_in* in = reinterpret_cast<struct sockaddr_in*>(addr.addr);
memcpy(&r->dns_server_addr.addr.addr4, &in->sin_addr,
sizeof(struct in_addr));
r->dns_server_addr.tcp_port = grpc_sockaddr_get_port(&addr);
r->dns_server_addr.udp_port = grpc_sockaddr_get_port(&addr);
} else if (grpc_parse_ipv6_hostport(dns_server, &addr,
false /* log_errors */)) {
r->dns_server_addr.family = AF_INET6;
struct sockaddr_in6* in6 =
reinterpret_cast<struct sockaddr_in6*>(addr.addr);
memcpy(&r->dns_server_addr.addr.addr6, &in6->sin6_addr,
sizeof(struct in6_addr));
r->dns_server_addr.tcp_port = grpc_sockaddr_get_port(&addr);
r->dns_server_addr.udp_port = grpc_sockaddr_get_port(&addr);
} else {
error = grpc_error_set_str(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("cannot parse authority"),
GRPC_ERROR_STR_TARGET_ADDRESS, grpc_slice_from_copied_string(name));
gpr_free(r);
goto error_cleanup;
}
int status = ares_set_servers_ports(*channel, &r->dns_server_addr);
if (status != ARES_SUCCESS) {
char* error_msg;
gpr_asprintf(&error_msg, "C-ares status is not ARES_SUCCESS: %s",
ares_strerror(status));
error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_msg);
gpr_free(error_msg);
gpr_free(r);
goto error_cleanup;
}
}
gpr_ref_init(&r->pending_queries, 1);
if (grpc_ipv6_loopback_available()) {
hr = create_hostbyname_request(r, host, strhtons(port),
false /* is_balancer */);
ares_gethostbyname(*channel, hr->host, AF_INET6, on_hostbyname_done_cb, hr);
}
hr = create_hostbyname_request(r, host, strhtons(port),
false /* is_balancer */);
ares_gethostbyname(*channel, hr->host, AF_INET, on_hostbyname_done_cb, hr);
if (check_grpclb) {
/* Query the SRV record */
grpc_ares_request_ref(r);
char* service_name;
gpr_asprintf(&service_name, "_grpclb._tcp.%s", host);
ares_query(*channel, service_name, ns_c_in, ns_t_srv, on_srv_query_done_cb,
r);
gpr_free(service_name);
}
if (service_config_json != nullptr) {
grpc_ares_request_ref(r);
char* config_name;
gpr_asprintf(&config_name, "_grpc_config.%s", host);
ares_search(*channel, config_name, ns_c_in, ns_t_txt, on_txt_done_cb, r);
gpr_free(config_name);
}
/* TODO(zyc): Handle CNAME records here. */
grpc_ares_ev_driver_start(r->ev_driver);
grpc_ares_request_unref(r);
gpr_free(host);
gpr_free(port);
return r;
error_cleanup:
GRPC_CLOSURE_SCHED(on_done, error);
gpr_free(host);
gpr_free(port);
return nullptr;
}
grpc_ares_request* (*grpc_dns_lookup_ares)(
const char* dns_server, const char* name, const char* default_port,
grpc_pollset_set* interested_parties, grpc_closure* on_done,
grpc_lb_addresses** addrs, bool check_grpclb,
char** service_config_json) = grpc_dns_lookup_ares_impl;
void grpc_cancel_ares_request(grpc_ares_request* r) {
if (grpc_dns_lookup_ares == grpc_dns_lookup_ares_impl) {
grpc_ares_ev_driver_shutdown(r->ev_driver);
}
}
grpc_error* grpc_ares_init(void) {
gpr_once_init(&g_basic_init, do_basic_init);
gpr_mu_lock(&g_init_mu);
int status = ares_library_init(ARES_LIB_INIT_ALL);
gpr_mu_unlock(&g_init_mu);
if (status != ARES_SUCCESS) {
char* error_msg;
gpr_asprintf(&error_msg, "ares_library_init failed: %s",
ares_strerror(status));
grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_msg);
gpr_free(error_msg);
return error;
}
return GRPC_ERROR_NONE;
}
void grpc_ares_cleanup(void) {
gpr_mu_lock(&g_init_mu);
ares_library_cleanup();
gpr_mu_unlock(&g_init_mu);
}
/*
* grpc_resolve_address_ares related structs and functions
*/
typedef struct grpc_resolve_address_ares_request {
/** the pointer to receive the resolved addresses */
grpc_resolved_addresses** addrs_out;
/** currently resolving lb addresses */
grpc_lb_addresses* lb_addrs;
/** closure to call when the resolve_address_ares request completes */
grpc_closure* on_resolve_address_done;
/** a closure wrapping on_dns_lookup_done_cb, which should be invoked when the
grpc_dns_lookup_ares operation is done. */
grpc_closure on_dns_lookup_done;
} grpc_resolve_address_ares_request;
static void on_dns_lookup_done_cb(void* arg, grpc_error* error) {
grpc_resolve_address_ares_request* r =
static_cast<grpc_resolve_address_ares_request*>(arg);
grpc_resolved_addresses** resolved_addresses = r->addrs_out;
if (r->lb_addrs == nullptr || r->lb_addrs->num_addresses == 0) {
*resolved_addresses = nullptr;
} else {
*resolved_addresses = static_cast<grpc_resolved_addresses*>(
gpr_zalloc(sizeof(grpc_resolved_addresses)));
(*resolved_addresses)->naddrs = r->lb_addrs->num_addresses;
(*resolved_addresses)->addrs =
static_cast<grpc_resolved_address*>(gpr_zalloc(
sizeof(grpc_resolved_address) * (*resolved_addresses)->naddrs));
for (size_t i = 0; i < (*resolved_addresses)->naddrs; i++) {
GPR_ASSERT(!r->lb_addrs->addresses[i].is_balancer);
memcpy(&(*resolved_addresses)->addrs[i],
&r->lb_addrs->addresses[i].address, sizeof(grpc_resolved_address));
}
}
GRPC_CLOSURE_SCHED(r->on_resolve_address_done, GRPC_ERROR_REF(error));
if (r->lb_addrs != nullptr) grpc_lb_addresses_destroy(r->lb_addrs);
gpr_free(r);
}
static void grpc_resolve_address_ares_impl(const char* name,
const char* default_port,
grpc_pollset_set* interested_parties,
grpc_closure* on_done,
grpc_resolved_addresses** addrs) {
grpc_resolve_address_ares_request* r =
static_cast<grpc_resolve_address_ares_request*>(
gpr_zalloc(sizeof(grpc_resolve_address_ares_request)));
r->addrs_out = addrs;
r->on_resolve_address_done = on_done;
GRPC_CLOSURE_INIT(&r->on_dns_lookup_done, on_dns_lookup_done_cb, r,
grpc_schedule_on_exec_ctx);
grpc_dns_lookup_ares(nullptr /* dns_server */, name, default_port,
interested_parties, &r->on_dns_lookup_done, &r->lb_addrs,
false /* check_grpclb */,
nullptr /* service_config_json */);
}
void (*grpc_resolve_address_ares)(
const char* name, const char* default_port,
grpc_pollset_set* interested_parties, grpc_closure* on_done,
grpc_resolved_addresses** addrs) = grpc_resolve_address_ares_impl;
#endif /* GRPC_ARES == 1 && !defined(GRPC_UV) */
| {
"content_hash": "941e734f013b0028962ec6623e84f908",
"timestamp": "",
"source": "github",
"line_count": 524,
"max_line_length": 88,
"avg_line_length": 38.47328244274809,
"alnum_prop": 0.6235615079365079,
"repo_name": "murgatroid99/grpc",
"id": "71b06eb87e2d3a9ba30a8188ee2a7a053b4947b5",
"size": "20762",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "24926"
},
{
"name": "C",
"bytes": "1453210"
},
{
"name": "C#",
"bytes": "1646979"
},
{
"name": "C++",
"bytes": "28778506"
},
{
"name": "CMake",
"bytes": "481419"
},
{
"name": "DTrace",
"bytes": "147"
},
{
"name": "Go",
"bytes": "27069"
},
{
"name": "JavaScript",
"bytes": "48756"
},
{
"name": "M4",
"bytes": "43234"
},
{
"name": "Makefile",
"bytes": "1064586"
},
{
"name": "Objective-C",
"bytes": "266834"
},
{
"name": "Objective-C++",
"bytes": "21939"
},
{
"name": "PHP",
"bytes": "340922"
},
{
"name": "Python",
"bytes": "2227399"
},
{
"name": "Ruby",
"bytes": "799613"
},
{
"name": "Shell",
"bytes": "412607"
},
{
"name": "Swift",
"bytes": "3486"
}
],
"symlink_target": ""
} |
import { Amount } from "./amount";
import { Location } from "./location";
import { Period } from "./period";
import { Text } from "./text";
export class DeliveryTerms {
constructor(
public id: string = null,
public estimatedDeliveryPeriod: Period = new Period(),
public specialTerms: Text[] = [],
public incoterms: string = null,
public amount: Amount = new Amount(),
public deliveryLocation: Location = new Location(),
public hjid: string = null
) { }
}
| {
"content_hash": "b402f06f169bac26577daea46c1d7eae",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 62,
"avg_line_length": 29,
"alnum_prop": 0.6130268199233716,
"repo_name": "nimble-platform/frontend-service",
"id": "c9e3c2f9567ced7fd9d14cd7850079f112bb10fc",
"size": "1165",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/app/catalogue/model/publish/delivery-terms.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "135821"
},
{
"name": "Dockerfile",
"bytes": "369"
},
{
"name": "HTML",
"bytes": "1305632"
},
{
"name": "JavaScript",
"bytes": "8243"
},
{
"name": "Shell",
"bytes": "1721"
},
{
"name": "TypeScript",
"bytes": "2729038"
}
],
"symlink_target": ""
} |
package com.taobao.weex.ui.module;
import static com.taobao.weex.bridge.WXBridgeManager.KEY_ARGS;
import static com.taobao.weex.bridge.WXBridgeManager.KEY_METHOD;
import static com.taobao.weex.bridge.WXBridgeManager.METHOD_CALLBACK;
import static com.taobao.weex.bridge.WXBridgeManager.METHOD_CALL_JS;
import static com.taobao.weex.common.WXJSBridgeMsgType.MODULE_INTERVAL;
import static com.taobao.weex.common.WXJSBridgeMsgType.MODULE_TIMEOUT;
import android.os.Handler;
import android.os.Message;
import android.support.annotation.FloatRange;
import android.support.annotation.IntDef;
import android.support.annotation.IntRange;
import android.support.annotation.VisibleForTesting;
import android.util.SparseArray;
import com.taobao.weex.WXEnvironment;
import com.taobao.weex.WXSDKManager;
import com.taobao.weex.annotation.JSMethod;
import com.taobao.weex.bridge.WXBridgeManager;
import com.taobao.weex.bridge.WXHashMap;
import com.taobao.weex.bridge.WXJSObject;
import com.taobao.weex.common.Destroyable;
import com.taobao.weex.common.WXModule;
import com.taobao.weex.dom.action.Actions;
import com.taobao.weex.utils.WXJsonUtils;
import com.taobao.weex.utils.WXLogUtils;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.HashMap;
public class WXTimerModule extends WXModule implements Destroyable, Handler.Callback {
@IntDef({MODULE_TIMEOUT, MODULE_INTERVAL})
@Retention(RetentionPolicy.SOURCE)
@interface MessageType {}
private final static String TAG = "timer";
private Handler handler;
private SparseArray<Integer> antiIntAutoBoxing;
public WXTimerModule() {
handler = new Handler(WXBridgeManager.getInstance().getJSLooper(), this);
antiIntAutoBoxing = new SparseArray<>();
}
@JSMethod(uiThread = false)
public void setTimeout(@IntRange(from = 1) int funcId, @FloatRange(from = 0) float delay) {
if(mWXSDKInstance != null) {
postOrHoldMessage(MODULE_TIMEOUT, funcId, (int) delay, Integer.parseInt(mWXSDKInstance.getInstanceId()));
}
}
@JSMethod(uiThread = false)
public void setInterval(@IntRange(from = 1) int funcId, @FloatRange(from = 0) float interval) {
if(mWXSDKInstance != null) {
postOrHoldMessage(MODULE_INTERVAL, funcId, (int) interval, Integer.parseInt(mWXSDKInstance.getInstanceId()));
}
}
@JSMethod(uiThread = false)
public void clearTimeout(@IntRange(from = 1) int funcId) {
if (funcId <= 0) {
return;
}
removeOrHoldMessage(MODULE_TIMEOUT, funcId);
}
@JSMethod(uiThread = false)
public void clearInterval(@IntRange(from = 1) int funcId) {
if (funcId <= 0) {
return;
}
removeOrHoldMessage(MODULE_INTERVAL, funcId);
}
@Override
public void destroy() {
if (handler != null) {
if(WXEnvironment.isApkDebugable()) {
WXLogUtils.d(TAG, "Timer Module removeAllMessages: ");
}
handler.removeCallbacksAndMessages(null);
antiIntAutoBoxing.clear();
}
}
@Override
public boolean handleMessage(Message msg) {
boolean ret = false;
WXJSObject[] args;
if (msg != null) {
int what = msg.what;
if(WXEnvironment.isApkDebugable()) {
WXLogUtils.d(TAG, "Timer Module handleMessage : " + msg.what);
}
switch (what) {
case MODULE_TIMEOUT:
if (msg.obj == null) {
break;
}
args = createTimerArgs(msg.arg1, (Integer) msg.obj, false);
WXBridgeManager.getInstance().invokeExecJS(String.valueOf(msg.arg1), null, METHOD_CALL_JS, args, true);
ret = true;
break;
case MODULE_INTERVAL:
if (msg.obj == null) {
break;
}
postMessage(MODULE_INTERVAL, (Integer) msg.obj, msg.arg2, msg.arg1);
args = createTimerArgs(msg.arg1, (Integer) msg.obj, true);
WXBridgeManager.getInstance().invokeExecJS(String.valueOf(msg.arg1), null, METHOD_CALL_JS, args, true);
ret = true;
break;
default:
break;
}
}
return ret;
}
@VisibleForTesting
void setHandler(Handler handler) {
this.handler = handler;
}
private WXJSObject[] createTimerArgs(int instanceId, int funcId, boolean keepAlive) {
ArrayList<Object> argsList = new ArrayList<>();
argsList.add(funcId);
argsList.add(new HashMap<>());
argsList.add(keepAlive);
WXHashMap<String, Object> task = new WXHashMap<>();
task.put(KEY_METHOD, METHOD_CALLBACK);
task.put(KEY_ARGS, argsList);
Object[] tasks = {task};
return new WXJSObject[]{
new WXJSObject(WXJSObject.String, String.valueOf(instanceId)),
new WXJSObject(WXJSObject.JSON,
WXJsonUtils.fromObjectToJSONString(tasks))};
}
private void postOrHoldMessage(@MessageType final int what,final int funcId,final int interval,final int instanceId) {
if(mWXSDKInstance.isPreRenderMode()) {
WXSDKManager.getInstance().getWXDomManager().postAction(mWXSDKInstance.getInstanceId(), Actions.getExecutableRenderAction(new Runnable() {
@Override
public void run() {
postMessage(what,funcId,interval,instanceId);
}
}),false);
} else {
postMessage(what,funcId,interval,instanceId);
}
}
private void removeOrHoldMessage(@MessageType final int what,final int funcId) {
if(mWXSDKInstance.isPreRenderMode()) {
WXSDKManager.getInstance().getWXDomManager().postAction(mWXSDKInstance.getInstanceId(), Actions.getExecutableRenderAction(new Runnable() {
@Override
public void run() {
handler.removeMessages(what, antiIntAutoBoxing.get(funcId, funcId));
}
}),false);
} else {
handler.removeMessages(what, antiIntAutoBoxing.get(funcId, funcId));
}
}
private void postMessage(@MessageType int what,
@IntRange(from = 1) int funcId,
@IntRange(from = 0) int interval, int instanceId) {
if (interval < 0 || funcId <= 0) {
WXLogUtils.e(TAG, "interval < 0 or funcId <=0");
} else {
if(antiIntAutoBoxing.get(funcId) == null) {
antiIntAutoBoxing.put(funcId, funcId);
}
Message message = handler
.obtainMessage(what, instanceId, interval, antiIntAutoBoxing.get(funcId));
handler.sendMessageDelayed(message, interval);
}
}
}
| {
"content_hash": "c61a561dbdf3b51a57d4beae2ea033ce",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 144,
"avg_line_length": 34.23118279569893,
"alnum_prop": 0.6893356368776504,
"repo_name": "WEzou/weiXIn",
"id": "2c048c105f487bce771a86bac547e4189f34d684",
"size": "7176",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Carthage/Checkouts/incubator-weex/android/sdk/src/main/java/com/taobao/weex/ui/module/WXTimerModule.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "JavaScript",
"bytes": "522921"
},
{
"name": "Objective-C",
"bytes": "34406"
},
{
"name": "Swift",
"bytes": "48911"
}
],
"symlink_target": ""
} |
/**
* Created by charlie on 2017-03-19.
*/
$("#login-submit").click(function(e) {
console.log("Form submitted!");
var email = $("#inputEmail").val();
var password = $("#inputPassword").val();
$.get("/login", {
"userName": email,
"password": password
}, function(data) {
console.log(data);
var status = JSON.parse(data).status;
if (status === "success") {
window.location.href = "/";
}
else {
alert("Invalid username/password. You made Ben cry.");
}
});
});
$(document).ready(function() {
console.log("Starting login...");
}); | {
"content_hash": "96c65b4c5b33e7aaa8d859d0fcb2845d",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 66,
"avg_line_length": 22.344827586206897,
"alnum_prop": 0.5169753086419753,
"repo_name": "nwHacks-UVic-Pros-2017/mojio-automessage",
"id": "4665c6464f0885a5161afbcb27f7360c803df2b9",
"size": "648",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "static/js/signin.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "2887"
},
{
"name": "HTML",
"bytes": "5265"
},
{
"name": "JavaScript",
"bytes": "14153"
}
],
"symlink_target": ""
} |
package javax.enterprise.inject.spi;
/**
* This event only gets fired for custom Beans added via {@link AfterBeanDiscovery}.
* The event gets fired before registering those beans with the container.
*
* @version $Rev: 1796096 $ $Date: 2017-05-24 22:27:18 +0200 (Wed, 24 May 2017) $
*
* @param <BEANCLASS> bean class
*/
public interface ProcessSyntheticBean<BEANCLASS> extends ProcessBean<BEANCLASS>
{
/**
* @return the Extension instance adding the very Bean
*/
Extension getSource();
} | {
"content_hash": "879de39d3b972873120745ef7da8b7e2",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 84,
"avg_line_length": 28.555555555555557,
"alnum_prop": 0.7062256809338522,
"repo_name": "apache/geronimo-specs",
"id": "00e9dd9c289854339f8ec5fa443018998fe3b840",
"size": "1319",
"binary": false,
"copies": "2",
"ref": "refs/heads/trunk",
"path": "geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/ProcessSyntheticBean.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "9144"
},
{
"name": "Java",
"bytes": "9975580"
},
{
"name": "Shell",
"bytes": "13639"
}
],
"symlink_target": ""
} |
module PictureFrom
class FacebookPicture
def initialize
@facebook_crawler = Crawlers::FacebookCrawler.new
@facebook_api = Apis::FacebookApi.new
end
def picture_from_username(username)
@facebook_api.image_url_by_username(username)
end
def picture_from_user_info(user_info)
username = @facebook_crawler.image_url_by_user_info(user_info)
picture_from_username(username)
end
end
end
| {
"content_hash": "6b7e2a54a9cbce6d2bdc8c9b53d1ef82",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 68,
"avg_line_length": 23.210526315789473,
"alnum_prop": 0.6984126984126984,
"repo_name": "era/picture_from",
"id": "474ea251f69103776f3985ea46437ae3f491ad2a",
"size": "441",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "lib/picture_from/facebook_picture.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "19126"
}
],
"symlink_target": ""
} |
Mt.Class('Mt.Observable', {
constructor: function(config){
var me = this,
config = config || {};
Mt.applyConfig(me, config);
me.events = {};
if(me.listeners){
var listeners = me.listeners,
i = 0,
length = listeners.length;
for(;i<length;i++){
var lis = listeners[i],
eventName = null,
handler = null,
scope = null,
params = [];
for(var p in lis){
if(p === 'scope'){
scope = lis[p];
}
else if(p === 'params'){
params = lis[p];
}
else{
eventName = p;
handler = lis[p];
}
}
if(eventName === null || Mt.isFunction(handler) === false){
throw new Error('Event was not set');
}
if(Mt.isArray(params) === false){
throw new Error('params must be array');
}
me.addEvent(eventName);
me.on(eventName, handler, scope, params);
}
}
},
on: function(eventName, fn, scope, params){
if( this.events[eventName] === undefined ){
console.log(arguments);
throw new Error('Event name is not set: ' + eventName);
}
this.events[eventName].push({
fn:fn,
scope: scope,
params: params || []
});
},
un: function(eventName, fn){
var me = this,
eventListeners = me.events[eventName];
if(!eventListeners){
return false;
}
var i = 0,
length = eventListeners.length;
for(;i<length;i++){
var lis = eventListeners[i];
if(lis.fn === fn){
eventListeners.splice(i, 1);
return true;
}
}
return false;
},
once: function(eventName, fn, scope){
var me = this,
fnWrapper = function(){
fn.apply(this, arguments);
me.un(eventName, fnWrapper);
};
me.on(eventName, fnWrapper, scope);
},
unAll: function(){
this.events = {};
},
unAllByType: function(eventName){
this.events[eventName] = [];
},
fireEvent: function(eventName){
var me = this,
eventListeners = me.events[eventName];
if(!eventListeners){
return false;
}
var i = 1,
length = arguments.length,
args = [me];
for(;i<length;i++){
args.push(arguments[i]);
}
var i = 0,
length = eventListeners.length;
for(;i<length;i++){
var lis = eventListeners[i],
_args = [];
_args = _args.concat(args);
if( lis.params ){
_args = _args.concat(lis.params);
}
lis.fn.apply(lis.scope || me, _args);
}
},
addEvent: function(eventName){
var me = this;
me.events[eventName] = me.events[eventName] || [];
},
addEvents: function(eventName){
var me = this;
if(arguments.length > 1){
var tempEventName = [],
i = 0,
length = arguments.length;
for(;i<length;i++){
tempEventName[i] = arguments[i];
}
eventName = tempEventName;
}
if(Mt.typeOf(eventName) === 'string'){
me.events[eventName] = me.events[eventName] || [];
}
else if(Mt.typeOf(eventName) === 'array'){
var i = 0,
length = eventName.length;
for(; i < length; i++){
me.events[eventName[i]] = me.events[eventName[i]] || [];
}
}
},
has: function(eventName){
var lis = this.events[eventName];
if(!lis){
return false;
}
return lis.length !== 0;
}
}); | {
"content_hash": "cb6f63e170ee85bd47d8ba2bb22b21d4",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 63,
"avg_line_length": 19.73125,
"alnum_prop": 0.5638264174849541,
"repo_name": "MtJavaScript/Class",
"id": "95926c2181e6ebf420ee1fdb7b305cad06887f3d",
"size": "3173",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Observable.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "28120"
},
{
"name": "Shell",
"bytes": "60"
}
],
"symlink_target": ""
} |
package org.apache.ignite.gridify;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
import org.apache.ignite.compute.gridify.GridifySetToSet;
/**
* Test set-to-set target interface.
*/
public interface GridifySetToSetTargetInterface {
/**
* Find prime numbers in collection.
*
* @param input Input collection.
* @return Prime numbers.
*/
@GridifySetToSet(igniteInstanceName = "GridifySetToSetTarget", threshold = 2, splitSize = 2)
public Collection<Long> findPrimes(Collection<Long> input);
/**
* Find prime numbers in collection.
*
* @param input Input collection.
* @return Prime numbers.
*/
@GridifySetToSet(igniteInstanceName = "GridifySetToSetTarget", threshold = 2)
public Collection<Long> findPrimesWithoutSplitSize(Collection<Long> input);
/**
* Find prime numbers in collection.
*
* @param input Input collection.
* @return Prime numbers.
*/
@GridifySetToSet(igniteInstanceName = "GridifySetToSetTarget")
public Collection<Long> findPrimesWithoutSplitSizeAndThreshold(Collection<Long> input);
/**
* Find prime numbers in collection.
*
* @param input Input collection.
* @return Prime numbers.
*/
@GridifySetToSet(igniteInstanceName = "GridifySetToSetTarget")
public Collection<Long> findPrimesInListWithoutSplitSizeAndThreshold(List<Long> input);
/**
* Find prime numbers in collection.
*
* @param input Input collection.
* @return Prime numbers.
*/
@SuppressWarnings({"CollectionDeclaredAsConcreteClass"})
@GridifySetToSet(igniteInstanceName = "GridifySetToSetTarget")
public Collection<Long> findPrimesInArrayListWithoutSplitSizeAndThreshold(ArrayList<Long> input);
/**
* Find prime numbers in array.
*
* @param input Input collection.
* @return Prime numbers.
*/
@GridifySetToSet(igniteInstanceName = "GridifySetToSetTarget", threshold = 2, splitSize = 2)
public Long[] findPrimesInArray(Long[] input);
/**
* Find prime numbers in primitive array.
*
* @param input Input collection.
* @return Prime numbers.
*/
@GridifySetToSet(igniteInstanceName = "GridifySetToSetTarget", threshold = 2, splitSize = 2)
public long[] findPrimesInPrimitiveArray(long[] input);
/**
* Find prime numbers in iterator.
*
* @param input Input collection.
* @return Prime numbers.
*/
@GridifySetToSet(igniteInstanceName = "GridifySetToSetTarget", threshold = 2, splitSize = 2)
public Iterator<Long> findPrimesWithIterator(Iterator<Long> input);
/**
* Find prime numbers in enumeration.
*
* @param input Input collection.
* @return Prime numbers.
*/
@GridifySetToSet(igniteInstanceName = "GridifySetToSetTarget", threshold = 2, splitSize = 2)
public Enumeration<Long> findPrimesWithEnumeration(Enumeration<Long> input);
} | {
"content_hash": "6c679da76090780e7a594398d506a384",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 101,
"avg_line_length": 31.422680412371133,
"alnum_prop": 0.6902887139107612,
"repo_name": "vadopolski/ignite",
"id": "8af77317a84f4462d2b234a3d1570bb23be3d7b7",
"size": "3850",
"binary": false,
"copies": "22",
"ref": "refs/heads/master",
"path": "modules/aop/src/test/java/org/apache/ignite/gridify/GridifySetToSetTargetInterface.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "44742"
},
{
"name": "C",
"bytes": "5286"
},
{
"name": "C#",
"bytes": "5047092"
},
{
"name": "C++",
"bytes": "2704050"
},
{
"name": "CSS",
"bytes": "190878"
},
{
"name": "Groovy",
"bytes": "15092"
},
{
"name": "HTML",
"bytes": "607867"
},
{
"name": "Java",
"bytes": "30093401"
},
{
"name": "JavaScript",
"bytes": "1289274"
},
{
"name": "M4",
"bytes": "12456"
},
{
"name": "Makefile",
"bytes": "105854"
},
{
"name": "Nginx",
"bytes": "3468"
},
{
"name": "PHP",
"bytes": "11079"
},
{
"name": "PowerShell",
"bytes": "13357"
},
{
"name": "SQLPL",
"bytes": "307"
},
{
"name": "Scala",
"bytes": "685882"
},
{
"name": "Shell",
"bytes": "595975"
},
{
"name": "Smalltalk",
"bytes": "1908"
}
],
"symlink_target": ""
} |
package scheduler.da.dao;
import scheduler.model.Crew;
import scheduler.model.collections.Crews;
import scheduler.model.collections.Days;
import scheduler.model.collections.Members;
import scheduler.model.collections.Squads;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class CrewDAO {
public static Crews getCrews(Connection db, Squads squads, Days days) throws SQLException {
Crews crews = new Crews();
Statement st = db.createStatement();
ResultSet rs = st.executeQuery("SELECT ID,SquadID from Crews");
while (rs.next()) {
long id = rs.getLong("ID");
long squadId = rs.getLong("SquadID");
Crew crew = Crew.create(id, squads.get(squadId), new Members());
MemberDAO.populateMembers(db, crew, days);
crews.put(crew);
}
return crews;
}
}
| {
"content_hash": "a003cf9ecc1be81ca35fdf0e8bda44d6",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 95,
"avg_line_length": 33.10344827586207,
"alnum_prop": 0.6552083333333333,
"repo_name": "schana/scheduling-java",
"id": "522d241a9b211658279c9c7ee8660744b9419e74",
"size": "960",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/scheduler/da/dao/CrewDAO.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "58347"
}
],
"symlink_target": ""
} |
<!DOCTYPE SYSTEM [ <!ENTITY Financial SYSTEM "Financial.inc"> ]>
<txnmgr name="kdoTxn" logger="Q2"
class="org.jpos.transaction.TransactionManager">
<participant class="org.jpos.my.Switch" logger="Q2">
<property name="0200" value="Financial Response Log"
selectCriterion="incoming message 0200" />
<property name="0100" value="Authorization Response Log"
selectCriterion="incoming message 0100" />
<property name="0220" value="Notification Response Log"
selectCriterion="incoming message 0220" />
<property name="0221" value="Notification Response Log"
selectCriterion="incoming message 0221" />
<property name="0420" value="Reversal Response Log"
selectCriterion="incoming message 0420" />
<property name="0421" value="Reversal Response Log"
selectCriterion="incoming message 0421" />
<property name="0500" value="BatchManagement Response Log"
selectCriterion="incoming message 0500" />
<property name="0800" value="NetworkManagement Response Log"
selectCriterion="incoming message 0800" />
<property name="dummyProp1" value="dummyVal1"/>
<property name="dummyProp2" value="dummyVal2"/>
</participant>
&Financial;
</txnmgr> | {
"content_hash": "c1d73971597e1392397057a61f5e50a9",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 65,
"avg_line_length": 30.875,
"alnum_prop": 0.7044534412955465,
"repo_name": "dgrandemange/txnmgr-workflow-commons",
"id": "9020331dfcac962e17db66c9b864236601c42435",
"size": "1235",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/test/resources/fr/dgrandemange/txnmgrworkflow/service/support/FacadeImplTest_Res/testParseCase1/20_txnmgr.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "125648"
}
],
"symlink_target": ""
} |
layout: post
date: 2007-06-21 14:17:00
title: On the way to Nandi Hills...
tags: [archived-posts]
categories: archives
permalink: /:categories/:year/:month/:day/:title/
---
Do not miss that lovely curly tail! No, we didn't eat here...
<a href="http://www.flickr.com/photos/8533057@N07/579669319/" title="Photo Sharing"><img src="http://farm2.static.flickr.com/1127/579669319_78ee0a1b7f_o.jpg" width="396" height="480" alt="Manjunatha Pork Restarent" /></a>
This kind of thing is exactly what I got this S3IS for...! A few more "sighting shots" on the camera will follow...
| {
"content_hash": "13397347538d4d253fb79934f46cfe44",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 221,
"avg_line_length": 48,
"alnum_prop": 0.7239583333333334,
"repo_name": "deeyum/deeyum.github.io",
"id": "ba28ea73f48c8ad3f120c79ffc23427e20876e78",
"size": "580",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_posts/archives/2007-06-21-On-the-way-to-Nandi-Hills....md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "63687"
},
{
"name": "HTML",
"bytes": "9811"
},
{
"name": "Shell",
"bytes": "1339"
}
],
"symlink_target": ""
} |
package org.keycloak.adapters;
import org.jboss.logging.Logger;
import org.keycloak.adapters.spi.AuthOutcome;
import org.keycloak.adapters.spi.HttpFacade;
/**
* @author <a href="mailto:froehlich.ch@gmail.com">Christian Froehlich</a>
* @author <a href="mailto:brad.culley@spartasystems.com">Brad Culley</a>
* @author <a href="mailto:john.ament@spartasystems.com">John D. Ament</a>
* @version $Revision: 1 $
*/
public class QueryParamterTokenRequestAuthenticator extends BearerTokenRequestAuthenticator {
public static final String ACCESS_TOKEN = "access_token";
protected Logger log = Logger.getLogger(QueryParamterTokenRequestAuthenticator.class);
public QueryParamterTokenRequestAuthenticator(KeycloakDeployment deployment) {
super(deployment);
}
public AuthOutcome authenticate(HttpFacade exchange) {
if(!deployment.isOAuthQueryParameterEnabled()) {
return AuthOutcome.NOT_ATTEMPTED;
}
tokenString = null;
tokenString = getAccessTokenFromQueryParamter(exchange);
if (tokenString == null || tokenString.trim().isEmpty()) {
challenge = challengeResponse(exchange, OIDCAuthenticationError.Reason.NO_QUERY_PARAMETER_ACCESS_TOKEN, null, null);
return AuthOutcome.NOT_ATTEMPTED;
}
return (authenticateToken(exchange, tokenString));
}
String getAccessTokenFromQueryParamter(HttpFacade exchange) {
try {
if (exchange != null && exchange.getRequest() != null) {
return exchange.getRequest().getQueryParamValue(ACCESS_TOKEN);
}
} catch (Exception ignore) {
}
return null;
}
}
| {
"content_hash": "50000444dd88f1e33fd9fbd1c4e94f99",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 128,
"avg_line_length": 38.25,
"alnum_prop": 0.6945929887106358,
"repo_name": "almighty/keycloak",
"id": "d2cabb3d75f9dc7883480ca7306626ce417758c6",
"size": "2357",
"binary": false,
"copies": "22",
"ref": "refs/heads/master",
"path": "adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/QueryParamterTokenRequestAuthenticator.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "AMPL",
"bytes": "6208"
},
{
"name": "Batchfile",
"bytes": "5139"
},
{
"name": "CSS",
"bytes": "347760"
},
{
"name": "FreeMarker",
"bytes": "84082"
},
{
"name": "HTML",
"bytes": "692981"
},
{
"name": "Java",
"bytes": "16629185"
},
{
"name": "JavaScript",
"bytes": "2024159"
},
{
"name": "Shell",
"bytes": "9502"
},
{
"name": "XSLT",
"bytes": "72941"
}
],
"symlink_target": ""
} |
#pragma once
#include <aws/lightsail/Lightsail_EXPORTS.h>
#include <aws/lightsail/LightsailRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/lightsail/model/RegionName.h>
#include <utility>
namespace Aws
{
namespace Lightsail
{
namespace Model
{
/**
*/
class AWS_LIGHTSAIL_API CopySnapshotRequest : public LightsailRequest
{
public:
CopySnapshotRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "CopySnapshot"; }
Aws::String SerializePayload() const override;
Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
/**
* <p>The name of the source manual snapshot to copy.</p> <p>Constraint:</p> <ul>
* <li> <p>Define this parameter only when copying a manual snapshot as another
* manual snapshot.</p> </li> </ul>
*/
inline const Aws::String& GetSourceSnapshotName() const{ return m_sourceSnapshotName; }
/**
* <p>The name of the source manual snapshot to copy.</p> <p>Constraint:</p> <ul>
* <li> <p>Define this parameter only when copying a manual snapshot as another
* manual snapshot.</p> </li> </ul>
*/
inline bool SourceSnapshotNameHasBeenSet() const { return m_sourceSnapshotNameHasBeenSet; }
/**
* <p>The name of the source manual snapshot to copy.</p> <p>Constraint:</p> <ul>
* <li> <p>Define this parameter only when copying a manual snapshot as another
* manual snapshot.</p> </li> </ul>
*/
inline void SetSourceSnapshotName(const Aws::String& value) { m_sourceSnapshotNameHasBeenSet = true; m_sourceSnapshotName = value; }
/**
* <p>The name of the source manual snapshot to copy.</p> <p>Constraint:</p> <ul>
* <li> <p>Define this parameter only when copying a manual snapshot as another
* manual snapshot.</p> </li> </ul>
*/
inline void SetSourceSnapshotName(Aws::String&& value) { m_sourceSnapshotNameHasBeenSet = true; m_sourceSnapshotName = std::move(value); }
/**
* <p>The name of the source manual snapshot to copy.</p> <p>Constraint:</p> <ul>
* <li> <p>Define this parameter only when copying a manual snapshot as another
* manual snapshot.</p> </li> </ul>
*/
inline void SetSourceSnapshotName(const char* value) { m_sourceSnapshotNameHasBeenSet = true; m_sourceSnapshotName.assign(value); }
/**
* <p>The name of the source manual snapshot to copy.</p> <p>Constraint:</p> <ul>
* <li> <p>Define this parameter only when copying a manual snapshot as another
* manual snapshot.</p> </li> </ul>
*/
inline CopySnapshotRequest& WithSourceSnapshotName(const Aws::String& value) { SetSourceSnapshotName(value); return *this;}
/**
* <p>The name of the source manual snapshot to copy.</p> <p>Constraint:</p> <ul>
* <li> <p>Define this parameter only when copying a manual snapshot as another
* manual snapshot.</p> </li> </ul>
*/
inline CopySnapshotRequest& WithSourceSnapshotName(Aws::String&& value) { SetSourceSnapshotName(std::move(value)); return *this;}
/**
* <p>The name of the source manual snapshot to copy.</p> <p>Constraint:</p> <ul>
* <li> <p>Define this parameter only when copying a manual snapshot as another
* manual snapshot.</p> </li> </ul>
*/
inline CopySnapshotRequest& WithSourceSnapshotName(const char* value) { SetSourceSnapshotName(value); return *this;}
/**
* <p>The name of the source instance or disk from which the source automatic
* snapshot was created.</p> <p>Constraint:</p> <ul> <li> <p>Define this parameter
* only when copying an automatic snapshot as a manual snapshot. For more
* information, see the <a
* href="https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-keeping-automatic-snapshots">Amazon
* Lightsail Developer Guide</a>.</p> </li> </ul>
*/
inline const Aws::String& GetSourceResourceName() const{ return m_sourceResourceName; }
/**
* <p>The name of the source instance or disk from which the source automatic
* snapshot was created.</p> <p>Constraint:</p> <ul> <li> <p>Define this parameter
* only when copying an automatic snapshot as a manual snapshot. For more
* information, see the <a
* href="https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-keeping-automatic-snapshots">Amazon
* Lightsail Developer Guide</a>.</p> </li> </ul>
*/
inline bool SourceResourceNameHasBeenSet() const { return m_sourceResourceNameHasBeenSet; }
/**
* <p>The name of the source instance or disk from which the source automatic
* snapshot was created.</p> <p>Constraint:</p> <ul> <li> <p>Define this parameter
* only when copying an automatic snapshot as a manual snapshot. For more
* information, see the <a
* href="https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-keeping-automatic-snapshots">Amazon
* Lightsail Developer Guide</a>.</p> </li> </ul>
*/
inline void SetSourceResourceName(const Aws::String& value) { m_sourceResourceNameHasBeenSet = true; m_sourceResourceName = value; }
/**
* <p>The name of the source instance or disk from which the source automatic
* snapshot was created.</p> <p>Constraint:</p> <ul> <li> <p>Define this parameter
* only when copying an automatic snapshot as a manual snapshot. For more
* information, see the <a
* href="https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-keeping-automatic-snapshots">Amazon
* Lightsail Developer Guide</a>.</p> </li> </ul>
*/
inline void SetSourceResourceName(Aws::String&& value) { m_sourceResourceNameHasBeenSet = true; m_sourceResourceName = std::move(value); }
/**
* <p>The name of the source instance or disk from which the source automatic
* snapshot was created.</p> <p>Constraint:</p> <ul> <li> <p>Define this parameter
* only when copying an automatic snapshot as a manual snapshot. For more
* information, see the <a
* href="https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-keeping-automatic-snapshots">Amazon
* Lightsail Developer Guide</a>.</p> </li> </ul>
*/
inline void SetSourceResourceName(const char* value) { m_sourceResourceNameHasBeenSet = true; m_sourceResourceName.assign(value); }
/**
* <p>The name of the source instance or disk from which the source automatic
* snapshot was created.</p> <p>Constraint:</p> <ul> <li> <p>Define this parameter
* only when copying an automatic snapshot as a manual snapshot. For more
* information, see the <a
* href="https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-keeping-automatic-snapshots">Amazon
* Lightsail Developer Guide</a>.</p> </li> </ul>
*/
inline CopySnapshotRequest& WithSourceResourceName(const Aws::String& value) { SetSourceResourceName(value); return *this;}
/**
* <p>The name of the source instance or disk from which the source automatic
* snapshot was created.</p> <p>Constraint:</p> <ul> <li> <p>Define this parameter
* only when copying an automatic snapshot as a manual snapshot. For more
* information, see the <a
* href="https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-keeping-automatic-snapshots">Amazon
* Lightsail Developer Guide</a>.</p> </li> </ul>
*/
inline CopySnapshotRequest& WithSourceResourceName(Aws::String&& value) { SetSourceResourceName(std::move(value)); return *this;}
/**
* <p>The name of the source instance or disk from which the source automatic
* snapshot was created.</p> <p>Constraint:</p> <ul> <li> <p>Define this parameter
* only when copying an automatic snapshot as a manual snapshot. For more
* information, see the <a
* href="https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-keeping-automatic-snapshots">Amazon
* Lightsail Developer Guide</a>.</p> </li> </ul>
*/
inline CopySnapshotRequest& WithSourceResourceName(const char* value) { SetSourceResourceName(value); return *this;}
/**
* <p>The date of the source automatic snapshot to copy. Use the <code>get auto
* snapshots</code> operation to identify the dates of the available automatic
* snapshots.</p> <p>Constraints:</p> <ul> <li> <p>Must be specified in
* <code>YYYY-MM-DD</code> format.</p> </li> <li> <p>This parameter cannot be
* defined together with the <code>use latest restorable auto snapshot</code>
* parameter. The <code>restore date</code> and <code>use latest restorable auto
* snapshot</code> parameters are mutually exclusive.</p> </li> <li> <p>Define this
* parameter only when copying an automatic snapshot as a manual snapshot. For more
* information, see the <a
* href="https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-keeping-automatic-snapshots">Amazon
* Lightsail Developer Guide</a>.</p> </li> </ul>
*/
inline const Aws::String& GetRestoreDate() const{ return m_restoreDate; }
/**
* <p>The date of the source automatic snapshot to copy. Use the <code>get auto
* snapshots</code> operation to identify the dates of the available automatic
* snapshots.</p> <p>Constraints:</p> <ul> <li> <p>Must be specified in
* <code>YYYY-MM-DD</code> format.</p> </li> <li> <p>This parameter cannot be
* defined together with the <code>use latest restorable auto snapshot</code>
* parameter. The <code>restore date</code> and <code>use latest restorable auto
* snapshot</code> parameters are mutually exclusive.</p> </li> <li> <p>Define this
* parameter only when copying an automatic snapshot as a manual snapshot. For more
* information, see the <a
* href="https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-keeping-automatic-snapshots">Amazon
* Lightsail Developer Guide</a>.</p> </li> </ul>
*/
inline bool RestoreDateHasBeenSet() const { return m_restoreDateHasBeenSet; }
/**
* <p>The date of the source automatic snapshot to copy. Use the <code>get auto
* snapshots</code> operation to identify the dates of the available automatic
* snapshots.</p> <p>Constraints:</p> <ul> <li> <p>Must be specified in
* <code>YYYY-MM-DD</code> format.</p> </li> <li> <p>This parameter cannot be
* defined together with the <code>use latest restorable auto snapshot</code>
* parameter. The <code>restore date</code> and <code>use latest restorable auto
* snapshot</code> parameters are mutually exclusive.</p> </li> <li> <p>Define this
* parameter only when copying an automatic snapshot as a manual snapshot. For more
* information, see the <a
* href="https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-keeping-automatic-snapshots">Amazon
* Lightsail Developer Guide</a>.</p> </li> </ul>
*/
inline void SetRestoreDate(const Aws::String& value) { m_restoreDateHasBeenSet = true; m_restoreDate = value; }
/**
* <p>The date of the source automatic snapshot to copy. Use the <code>get auto
* snapshots</code> operation to identify the dates of the available automatic
* snapshots.</p> <p>Constraints:</p> <ul> <li> <p>Must be specified in
* <code>YYYY-MM-DD</code> format.</p> </li> <li> <p>This parameter cannot be
* defined together with the <code>use latest restorable auto snapshot</code>
* parameter. The <code>restore date</code> and <code>use latest restorable auto
* snapshot</code> parameters are mutually exclusive.</p> </li> <li> <p>Define this
* parameter only when copying an automatic snapshot as a manual snapshot. For more
* information, see the <a
* href="https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-keeping-automatic-snapshots">Amazon
* Lightsail Developer Guide</a>.</p> </li> </ul>
*/
inline void SetRestoreDate(Aws::String&& value) { m_restoreDateHasBeenSet = true; m_restoreDate = std::move(value); }
/**
* <p>The date of the source automatic snapshot to copy. Use the <code>get auto
* snapshots</code> operation to identify the dates of the available automatic
* snapshots.</p> <p>Constraints:</p> <ul> <li> <p>Must be specified in
* <code>YYYY-MM-DD</code> format.</p> </li> <li> <p>This parameter cannot be
* defined together with the <code>use latest restorable auto snapshot</code>
* parameter. The <code>restore date</code> and <code>use latest restorable auto
* snapshot</code> parameters are mutually exclusive.</p> </li> <li> <p>Define this
* parameter only when copying an automatic snapshot as a manual snapshot. For more
* information, see the <a
* href="https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-keeping-automatic-snapshots">Amazon
* Lightsail Developer Guide</a>.</p> </li> </ul>
*/
inline void SetRestoreDate(const char* value) { m_restoreDateHasBeenSet = true; m_restoreDate.assign(value); }
/**
* <p>The date of the source automatic snapshot to copy. Use the <code>get auto
* snapshots</code> operation to identify the dates of the available automatic
* snapshots.</p> <p>Constraints:</p> <ul> <li> <p>Must be specified in
* <code>YYYY-MM-DD</code> format.</p> </li> <li> <p>This parameter cannot be
* defined together with the <code>use latest restorable auto snapshot</code>
* parameter. The <code>restore date</code> and <code>use latest restorable auto
* snapshot</code> parameters are mutually exclusive.</p> </li> <li> <p>Define this
* parameter only when copying an automatic snapshot as a manual snapshot. For more
* information, see the <a
* href="https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-keeping-automatic-snapshots">Amazon
* Lightsail Developer Guide</a>.</p> </li> </ul>
*/
inline CopySnapshotRequest& WithRestoreDate(const Aws::String& value) { SetRestoreDate(value); return *this;}
/**
* <p>The date of the source automatic snapshot to copy. Use the <code>get auto
* snapshots</code> operation to identify the dates of the available automatic
* snapshots.</p> <p>Constraints:</p> <ul> <li> <p>Must be specified in
* <code>YYYY-MM-DD</code> format.</p> </li> <li> <p>This parameter cannot be
* defined together with the <code>use latest restorable auto snapshot</code>
* parameter. The <code>restore date</code> and <code>use latest restorable auto
* snapshot</code> parameters are mutually exclusive.</p> </li> <li> <p>Define this
* parameter only when copying an automatic snapshot as a manual snapshot. For more
* information, see the <a
* href="https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-keeping-automatic-snapshots">Amazon
* Lightsail Developer Guide</a>.</p> </li> </ul>
*/
inline CopySnapshotRequest& WithRestoreDate(Aws::String&& value) { SetRestoreDate(std::move(value)); return *this;}
/**
* <p>The date of the source automatic snapshot to copy. Use the <code>get auto
* snapshots</code> operation to identify the dates of the available automatic
* snapshots.</p> <p>Constraints:</p> <ul> <li> <p>Must be specified in
* <code>YYYY-MM-DD</code> format.</p> </li> <li> <p>This parameter cannot be
* defined together with the <code>use latest restorable auto snapshot</code>
* parameter. The <code>restore date</code> and <code>use latest restorable auto
* snapshot</code> parameters are mutually exclusive.</p> </li> <li> <p>Define this
* parameter only when copying an automatic snapshot as a manual snapshot. For more
* information, see the <a
* href="https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-keeping-automatic-snapshots">Amazon
* Lightsail Developer Guide</a>.</p> </li> </ul>
*/
inline CopySnapshotRequest& WithRestoreDate(const char* value) { SetRestoreDate(value); return *this;}
/**
* <p>A Boolean value to indicate whether to use the latest available automatic
* snapshot of the specified source instance or disk.</p> <p>Constraints:</p> <ul>
* <li> <p>This parameter cannot be defined together with the <code>restore
* date</code> parameter. The <code>use latest restorable auto snapshot</code> and
* <code>restore date</code> parameters are mutually exclusive.</p> </li> <li>
* <p>Define this parameter only when copying an automatic snapshot as a manual
* snapshot. For more information, see the <a
* href="https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-keeping-automatic-snapshots">Amazon
* Lightsail Developer Guide</a>.</p> </li> </ul>
*/
inline bool GetUseLatestRestorableAutoSnapshot() const{ return m_useLatestRestorableAutoSnapshot; }
/**
* <p>A Boolean value to indicate whether to use the latest available automatic
* snapshot of the specified source instance or disk.</p> <p>Constraints:</p> <ul>
* <li> <p>This parameter cannot be defined together with the <code>restore
* date</code> parameter. The <code>use latest restorable auto snapshot</code> and
* <code>restore date</code> parameters are mutually exclusive.</p> </li> <li>
* <p>Define this parameter only when copying an automatic snapshot as a manual
* snapshot. For more information, see the <a
* href="https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-keeping-automatic-snapshots">Amazon
* Lightsail Developer Guide</a>.</p> </li> </ul>
*/
inline bool UseLatestRestorableAutoSnapshotHasBeenSet() const { return m_useLatestRestorableAutoSnapshotHasBeenSet; }
/**
* <p>A Boolean value to indicate whether to use the latest available automatic
* snapshot of the specified source instance or disk.</p> <p>Constraints:</p> <ul>
* <li> <p>This parameter cannot be defined together with the <code>restore
* date</code> parameter. The <code>use latest restorable auto snapshot</code> and
* <code>restore date</code> parameters are mutually exclusive.</p> </li> <li>
* <p>Define this parameter only when copying an automatic snapshot as a manual
* snapshot. For more information, see the <a
* href="https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-keeping-automatic-snapshots">Amazon
* Lightsail Developer Guide</a>.</p> </li> </ul>
*/
inline void SetUseLatestRestorableAutoSnapshot(bool value) { m_useLatestRestorableAutoSnapshotHasBeenSet = true; m_useLatestRestorableAutoSnapshot = value; }
/**
* <p>A Boolean value to indicate whether to use the latest available automatic
* snapshot of the specified source instance or disk.</p> <p>Constraints:</p> <ul>
* <li> <p>This parameter cannot be defined together with the <code>restore
* date</code> parameter. The <code>use latest restorable auto snapshot</code> and
* <code>restore date</code> parameters are mutually exclusive.</p> </li> <li>
* <p>Define this parameter only when copying an automatic snapshot as a manual
* snapshot. For more information, see the <a
* href="https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-keeping-automatic-snapshots">Amazon
* Lightsail Developer Guide</a>.</p> </li> </ul>
*/
inline CopySnapshotRequest& WithUseLatestRestorableAutoSnapshot(bool value) { SetUseLatestRestorableAutoSnapshot(value); return *this;}
/**
* <p>The name of the new manual snapshot to be created as a copy.</p>
*/
inline const Aws::String& GetTargetSnapshotName() const{ return m_targetSnapshotName; }
/**
* <p>The name of the new manual snapshot to be created as a copy.</p>
*/
inline bool TargetSnapshotNameHasBeenSet() const { return m_targetSnapshotNameHasBeenSet; }
/**
* <p>The name of the new manual snapshot to be created as a copy.</p>
*/
inline void SetTargetSnapshotName(const Aws::String& value) { m_targetSnapshotNameHasBeenSet = true; m_targetSnapshotName = value; }
/**
* <p>The name of the new manual snapshot to be created as a copy.</p>
*/
inline void SetTargetSnapshotName(Aws::String&& value) { m_targetSnapshotNameHasBeenSet = true; m_targetSnapshotName = std::move(value); }
/**
* <p>The name of the new manual snapshot to be created as a copy.</p>
*/
inline void SetTargetSnapshotName(const char* value) { m_targetSnapshotNameHasBeenSet = true; m_targetSnapshotName.assign(value); }
/**
* <p>The name of the new manual snapshot to be created as a copy.</p>
*/
inline CopySnapshotRequest& WithTargetSnapshotName(const Aws::String& value) { SetTargetSnapshotName(value); return *this;}
/**
* <p>The name of the new manual snapshot to be created as a copy.</p>
*/
inline CopySnapshotRequest& WithTargetSnapshotName(Aws::String&& value) { SetTargetSnapshotName(std::move(value)); return *this;}
/**
* <p>The name of the new manual snapshot to be created as a copy.</p>
*/
inline CopySnapshotRequest& WithTargetSnapshotName(const char* value) { SetTargetSnapshotName(value); return *this;}
/**
* <p>The AWS Region where the source manual or automatic snapshot is located.</p>
*/
inline const RegionName& GetSourceRegion() const{ return m_sourceRegion; }
/**
* <p>The AWS Region where the source manual or automatic snapshot is located.</p>
*/
inline bool SourceRegionHasBeenSet() const { return m_sourceRegionHasBeenSet; }
/**
* <p>The AWS Region where the source manual or automatic snapshot is located.</p>
*/
inline void SetSourceRegion(const RegionName& value) { m_sourceRegionHasBeenSet = true; m_sourceRegion = value; }
/**
* <p>The AWS Region where the source manual or automatic snapshot is located.</p>
*/
inline void SetSourceRegion(RegionName&& value) { m_sourceRegionHasBeenSet = true; m_sourceRegion = std::move(value); }
/**
* <p>The AWS Region where the source manual or automatic snapshot is located.</p>
*/
inline CopySnapshotRequest& WithSourceRegion(const RegionName& value) { SetSourceRegion(value); return *this;}
/**
* <p>The AWS Region where the source manual or automatic snapshot is located.</p>
*/
inline CopySnapshotRequest& WithSourceRegion(RegionName&& value) { SetSourceRegion(std::move(value)); return *this;}
private:
Aws::String m_sourceSnapshotName;
bool m_sourceSnapshotNameHasBeenSet;
Aws::String m_sourceResourceName;
bool m_sourceResourceNameHasBeenSet;
Aws::String m_restoreDate;
bool m_restoreDateHasBeenSet;
bool m_useLatestRestorableAutoSnapshot;
bool m_useLatestRestorableAutoSnapshotHasBeenSet;
Aws::String m_targetSnapshotName;
bool m_targetSnapshotNameHasBeenSet;
RegionName m_sourceRegion;
bool m_sourceRegionHasBeenSet;
};
} // namespace Model
} // namespace Lightsail
} // namespace Aws
| {
"content_hash": "51946289cadddbb3eeed9847fe7fdb7c",
"timestamp": "",
"source": "github",
"line_count": 441,
"max_line_length": 161,
"avg_line_length": 53.50566893424036,
"alnum_prop": 0.6902017291066282,
"repo_name": "awslabs/aws-sdk-cpp",
"id": "1b043e2c2e31665f2751d5d6b1290a70423f81b2",
"size": "23715",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-cpp-sdk-lightsail/include/aws/lightsail/model/CopySnapshotRequest.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "7596"
},
{
"name": "C++",
"bytes": "61740540"
},
{
"name": "CMake",
"bytes": "337520"
},
{
"name": "Java",
"bytes": "223122"
},
{
"name": "Python",
"bytes": "47357"
}
],
"symlink_target": ""
} |
.localeToggle { display: inline-block; margin: 0 10px;}
.localeToggleList { display:block; margin: 0px;}
| {
"content_hash": "614fea06d911ee6e12aca16f3b14b225",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 55,
"avg_line_length": 52.5,
"alnum_prop": 0.7428571428571429,
"repo_name": "surzhik/coreola5",
"id": "9610ba49f4d54a14be5fc2333e2df0d5a2609661",
"size": "105",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/containers/LocaleToggle/styles.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "1526"
},
{
"name": "CSS",
"bytes": "52233"
},
{
"name": "HTML",
"bytes": "9858"
},
{
"name": "JavaScript",
"bytes": "241391"
}
],
"symlink_target": ""
} |
var _dec, _dec2, _class;
import { bindingMode } from 'aurelia-binding';
import { inject, Lazy } from 'aurelia-dependency-injection';
import { customAttribute } from 'aurelia-templating';
import { ValidationController } from './validation-controller';
import { validationRenderer } from './validation-renderer';
export let ValidationErrorsCustomAttribute = (_dec = customAttribute('validation-errors', bindingMode.twoWay), _dec2 = inject(Element, Lazy.of(ValidationController)), _dec(_class = _dec2(_class = validationRenderer(_class = class ValidationErrorsCustomAttribute {
constructor(boundaryElement, controllerAccessor) {
this.errors = [];
this.boundaryElement = boundaryElement;
this.controllerAccessor = controllerAccessor;
}
sort() {
this.errors.sort((a, b) => {
if (a.target === b.target) {
return 0;
}
return a.target.compareDocumentPosition(b.target) & 2 ? 1 : -1;
});
}
render(error, target) {
if (!target || !(this.boundaryElement === target || this.boundaryElement.contains(target))) {
return;
}
this.errors.push({ error, target });
this.sort();
this.value = this.errors;
}
unrender(error, target) {
const index = this.errors.findIndex(x => x.error === error);
if (index === -1) {
return;
}
this.errors.splice(index, 1);
this.value = this.errors;
}
bind() {
this.controllerAccessor().addRenderer(this);
this.value = this.errors;
}
unbind() {
this.controllerAccessor().removeRenderer(this);
}
}) || _class) || _class) || _class); | {
"content_hash": "36218b5a55b0401e80e9208bad8a9b95",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 263,
"avg_line_length": 29.35185185185185,
"alnum_prop": 0.6548895899053627,
"repo_name": "JeroenVinke/validation",
"id": "1a3341970c45461417945783f65ac75f94e4d912",
"size": "1585",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "dist/es2015/validation-errors-custom-attribute.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "1337"
},
{
"name": "JavaScript",
"bytes": "959638"
}
],
"symlink_target": ""
} |
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _createSvgIcon = _interopRequireDefault(require("./createSvgIcon"));
/**
* @ignore - internal component.
*/
var _default = (0, _createSvgIcon.default)(React.createElement("path", {
d: "M7 10l5 5 5-5z"
}), 'ArrowDropDown');
exports.default = _default; | {
"content_hash": "49295abce0e298cea4ec5e95cc723a6d",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 87,
"avg_line_length": 26.043478260869566,
"alnum_prop": 0.7278797996661102,
"repo_name": "cdnjs/cdnjs",
"id": "39598cb5f2e494898ea7ed2289a4b61b610ff5cd",
"size": "599",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "ajax/libs/material-ui/4.9.7/internal/svg-icons/ArrowDropDown.js",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
layout: post
author: Christoph Broschinski
author_lnk: https://github.com/cbroschinski
title: TU Wien reports its 2017 APC expenditures
date: 2018-05-14 08:00:00
summary:
categories: [general, openAPC]
comments: true
---
The [Technische Universität Wien](https://www.tuwien.ac.at/en/) has updated its APC expenditures. The recent contribution by [TU Wien's University Library](http://www.ub.tuwien.ac.at/eng) provides data for the 2017 period.
Contact person is [Magdalena Andrae](mailto:open-access@ub.tuwien.ac.at).
## Cost Data
The new dataset covers publication fees for 22 articles. Total expenditure amounts to 29 242€ and the average fee is 1 329€.
The following table shows the payments the University Library of TU Wien has made to publishers in 2017 (including taxes and discounts).
| | Articles| Fees paid in EURO| Mean Fee paid|
|:-----------------------------------------------|--------:|-----------------:|-------------:|
|Springer Nature | 10| 13698| 1370|
|MDPI AG | 4| 6058| 1515|
|Hindawi Publishing Corporation | 2| 4257| 2129|
|International Union of Crystallography (IUCr) | 2| 480| 240|
|AIP Publishing | 1| 2244| 2244|
|American Chemical Society (ACS) | 1| 591| 591|
|Institution of Engineering and Technology (IET) | 1| 1203| 1203|
|Royal Society of Chemistry (RSC) | 1| 711| 711|
With the recent contributions included, the overall APC data for TU Wien now looks as follows:
### Fees paid per publisher (in EURO)

### Average costs per year (in EURO)

### Average costs per publisher (in EURO)

| {
"content_hash": "f5b5d695d5c349916424544727d490e8",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 222,
"avg_line_length": 45.8,
"alnum_prop": 0.5633187772925764,
"repo_name": "OpenAPC/openapc.github.io",
"id": "78b5ae218b687170d890977f75e09120b1e6cd3e",
"size": "2299",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_posts/2018-05-14-tuwien.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "11254"
},
{
"name": "SCSS",
"bytes": "30504"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading;
using System.Web.Http;
using System.Web.Http.Controllers;
using System.Web.Http.ModelBinding;
using System.Web.Http.ModelBinding.Binders;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MvcCodeRouting.ParameterBinding;
namespace MvcCodeRouting.Web.Http.Tests.ParameterBinding {
[TestClass]
public class BinderPrecedenceBehavior {
readonly HttpConfiguration config;
readonly HttpRouteCollection routes;
public BinderPrecedenceBehavior() {
config = new HttpConfiguration();
routes = config.Routes;
}
void Run(Type controller, BinderPrecedence.BinderPrecedence expected, ParameterBinder globalBinder = null) {
var settings = new CodeRoutingSettings();
if (globalBinder != null) {
settings.ParameterBinders.Add(globalBinder);
}
config.MapCodeRoutes(controller, settings);
var request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/foo");
var routeData = routes.GetRouteData(request);
var controllerInstance = (ApiController)Activator.CreateInstance(controller);
var controllerContext = new HttpControllerContext(config, routeData, request) {
ControllerDescriptor = new HttpControllerDescriptor(config, (string)routeData.Values["controller"], controller),
Controller = controllerInstance
};
string value;
controllerInstance.ExecuteAsync(controllerContext, CancellationToken.None)
.Result
.TryGetContentValue(out value);
Assert.AreEqual(expected.ToString(), value);
}
[TestMethod]
public void TypeVsParameter_ParameterWins() {
var controller = typeof(BinderPrecedence.TypeVsParameter.BinderPrecedenceController);
Run(controller, BinderPrecedence.BinderPrecedence.Parameter);
}
[TestMethod]
public void TypeVsGlobal_GlobalWins() {
var controller = typeof(BinderPrecedence.TypeVsGlobal.BinderPrecedenceController);
Run(controller, BinderPrecedence.BinderPrecedence.Global, new BinderPrecedence.TypeVsGlobal.BinderPrecedenceGlobalBinder());
}
[TestMethod]
public void ParameterVsGlobal_ParameterWins() {
var controller = typeof(BinderPrecedence.ParameterVsGlobal.BinderPrecedenceController);
Run(controller, BinderPrecedence.BinderPrecedence.Parameter, new BinderPrecedence.TypeVsGlobal.BinderPrecedenceGlobalBinder());
}
[TestMethod]
public void ModelParameterVsGlobal_ModelWins() {
var controller = typeof(BinderPrecedence.ModelParameterVsGlobal.BinderPrecedenceController);
Run(controller, BinderPrecedence.BinderPrecedence.Model, new BinderPrecedence.ModelParameterVsGlobal.BinderPrecedenceGlobalBinder());
}
[TestMethod]
public void ModelParameterVsType_ModelWins() {
var controller = typeof(BinderPrecedence.ModelParameterVsType.BinderPrecedenceController);
Run(controller, BinderPrecedence.BinderPrecedence.Model);
}
[TestMethod]
public void ModelTypeVsParameter_ParameterWins() {
var controller = typeof(BinderPrecedence.ModelTypeVsParameter.BinderPrecedenceController);
Run(controller, BinderPrecedence.BinderPrecedence.Parameter);
}
[TestMethod]
public void ModelTypeVsGlobal_GlobalWins() {
var controller = typeof(BinderPrecedence.ModelTypeVsGlobal.BinderPrecedenceController);
Run(controller, BinderPrecedence.BinderPrecedence.Global, new BinderPrecedence.ModelTypeVsGlobal.BinderPrecedenceGlobalBinder());
}
[TestMethod]
public void ModelTypeVsType_TypeWins() {
var controller = typeof(BinderPrecedence.ModelTypeVsType.BinderPrecedenceController);
Run(controller, BinderPrecedence.BinderPrecedence.Type);
}
[TestMethod]
public void ModelGlobalVsParameter_ParameterWins() {
var controller = typeof(BinderPrecedence.ModelGlobalVsParameter.BinderPrecedenceController);
Run(controller, BinderPrecedence.BinderPrecedence.Parameter);
}
[TestMethod]
public void ModelGlobalVsGlobal_GlobalWins() {
var controller = typeof(BinderPrecedence.ModelGlobalVsGlobal.BinderPrecedenceController);
Run(controller, BinderPrecedence.BinderPrecedence.Global, new BinderPrecedence.ModelGlobalVsGlobal.BinderPrecedenceGlobalBinder());
}
[TestMethod]
public void ModelGlobalVsType_TypeWins() {
var controller = typeof(BinderPrecedence.ModelGlobalVsType.BinderPrecedenceController);
Run(controller, BinderPrecedence.BinderPrecedence.Type);
}
}
}
namespace MvcCodeRouting.Web.Http.Tests.ParameterBinding.BinderPrecedence {
public enum BinderPrecedence {
None = 0,
Parameter,
Type,
Global,
Model
}
}
namespace MvcCodeRouting.Web.Http.Tests.ParameterBinding.BinderPrecedence.TypeVsParameter {
[ParameterBinder(typeof(BinderPrecedenceTypeBinder))]
public class BinderPrecedenceModel {
public BinderPrecedence Precedence { get; set; }
}
class BinderPrecedenceParameterBinder : ParameterBinder {
public override Type ParameterType {
get { return typeof(BinderPrecedenceModel); }
}
public override bool TryBind(string value, IFormatProvider provider, out object result) {
result = new BinderPrecedenceModel {
Precedence = BinderPrecedence.Parameter
};
return true;
}
}
class BinderPrecedenceTypeBinder : ParameterBinder {
public override Type ParameterType {
get { return typeof(BinderPrecedenceModel); }
}
public override bool TryBind(string value, IFormatProvider provider, out object result) {
result = new BinderPrecedenceModel {
Precedence = BinderPrecedence.Type
};
return true;
}
}
public class BinderPrecedenceController : ApiController {
public string Get([FromRoute(BinderType = typeof(BinderPrecedenceParameterBinder))]BinderPrecedenceModel model) {
return model.Precedence.ToString();
}
}
}
namespace MvcCodeRouting.Web.Http.Tests.ParameterBinding.BinderPrecedence.TypeVsGlobal {
[ParameterBinder(typeof(BinderPrecedenceTypeBinder))]
public class BinderPrecedenceModel {
public BinderPrecedence Precedence { get; set; }
}
class BinderPrecedenceTypeBinder : ParameterBinder {
public override Type ParameterType {
get { return typeof(BinderPrecedenceModel); }
}
public override bool TryBind(string value, IFormatProvider provider, out object result) {
result = new BinderPrecedenceModel {
Precedence = BinderPrecedence.Type
};
return true;
}
}
class BinderPrecedenceGlobalBinder : ParameterBinder {
public override Type ParameterType {
get { return typeof(BinderPrecedenceModel); }
}
public override bool TryBind(string value, IFormatProvider provider, out object result) {
result = new BinderPrecedenceModel {
Precedence = BinderPrecedence.Global
};
return true;
}
}
public class BinderPrecedenceController : ApiController {
public string Get([FromRoute]BinderPrecedenceModel model) {
return model.Precedence.ToString();
}
}
}
namespace MvcCodeRouting.Web.Http.Tests.ParameterBinding.BinderPrecedence.ParameterVsGlobal {
public class BinderPrecedenceModel {
public BinderPrecedence Precedence { get; set; }
}
class BinderPrecedenceParameterBinder : ParameterBinder {
public override Type ParameterType {
get { return typeof(BinderPrecedenceModel); }
}
public override bool TryBind(string value, IFormatProvider provider, out object result) {
result = new BinderPrecedenceModel {
Precedence = BinderPrecedence.Parameter
};
return true;
}
}
class BinderPrecedenceGlobalBinder : ParameterBinder {
public override Type ParameterType {
get { return typeof(BinderPrecedenceModel); }
}
public override bool TryBind(string value, IFormatProvider provider, out object result) {
result = new BinderPrecedenceModel {
Precedence = BinderPrecedence.Global
};
return true;
}
}
public class BinderPrecedenceController : ApiController {
public string Get([FromRoute(BinderType = typeof(BinderPrecedenceParameterBinder))]BinderPrecedenceModel model) {
return model.Precedence.ToString();
}
}
}
namespace MvcCodeRouting.Web.Http.Tests.ParameterBinding.BinderPrecedence.ModelParameterVsGlobal {
public class BinderPrecedenceModel {
public BinderPrecedence Precedence { get; set; }
}
class BinderPrecedenceModelBinder : IModelBinder {
public bool BindModel(HttpActionContext actionContext, ModelBindingContext bindingContext) {
bindingContext.Model = new BinderPrecedenceModel {
Precedence = BinderPrecedence.Model
};
return true;
}
}
class BinderPrecedenceGlobalBinder : ParameterBinder {
public override Type ParameterType {
get { return typeof(BinderPrecedenceModel); }
}
public override bool TryBind(string value, IFormatProvider provider, out object result) {
result = new BinderPrecedenceModel {
Precedence = BinderPrecedence.Global
};
return true;
}
}
public class BinderPrecedenceController : ApiController {
public string Get([FromRoute(BinderType = typeof(BinderPrecedenceModelBinder))]BinderPrecedenceModel model) {
return model.Precedence.ToString();
}
}
}
namespace MvcCodeRouting.Web.Http.Tests.ParameterBinding.BinderPrecedence.ModelParameterVsType {
[ParameterBinder(typeof(BinderPrecedenceTypeBinder))]
public class BinderPrecedenceModel {
public BinderPrecedence Precedence { get; set; }
}
class BinderPrecedenceModelBinder : IModelBinder {
public bool BindModel(HttpActionContext actionContext, ModelBindingContext bindingContext) {
bindingContext.Model = new BinderPrecedenceModel {
Precedence = BinderPrecedence.Model
};
return true;
}
}
class BinderPrecedenceTypeBinder : ParameterBinder {
public override Type ParameterType {
get { return typeof(BinderPrecedenceModel); }
}
public override bool TryBind(string value, IFormatProvider provider, out object result) {
result = new BinderPrecedenceModel {
Precedence = BinderPrecedence.Type
};
return true;
}
}
public class BinderPrecedenceController : ApiController {
public string Get([FromRoute(BinderType = typeof(BinderPrecedenceModelBinder))]BinderPrecedenceModel model) {
return model.Precedence.ToString();
}
}
}
namespace MvcCodeRouting.Web.Http.Tests.ParameterBinding.BinderPrecedence.ModelTypeVsParameter {
[ModelBinder(typeof(BinderPrecedenceModelBinder))]
public class BinderPrecedenceModel {
public BinderPrecedence Precedence { get; set; }
}
class BinderPrecedenceModelBinder : IModelBinder {
public bool BindModel(HttpActionContext actionContext, ModelBindingContext bindingContext) {
bindingContext.Model = new BinderPrecedenceModel {
Precedence = BinderPrecedence.Model
};
return true;
}
}
class BinderPrecedenceParameterBinder : ParameterBinder {
public override Type ParameterType {
get { return typeof(BinderPrecedenceModel); }
}
public override bool TryBind(string value, IFormatProvider provider, out object result) {
result = new BinderPrecedenceModel {
Precedence = BinderPrecedence.Parameter
};
return true;
}
}
public class BinderPrecedenceController : ApiController {
public string Get([FromRoute(BinderType = typeof(BinderPrecedenceParameterBinder))]BinderPrecedenceModel model) {
return model.Precedence.ToString();
}
}
}
namespace MvcCodeRouting.Web.Http.Tests.ParameterBinding.BinderPrecedence.ModelTypeVsGlobal {
[ModelBinder(typeof(BinderPrecedenceModelBinder))]
public class BinderPrecedenceModel {
public BinderPrecedence Precedence { get; set; }
}
class BinderPrecedenceModelBinder : IModelBinder {
public bool BindModel(HttpActionContext actionContext, ModelBindingContext bindingContext) {
bindingContext.Model = new BinderPrecedenceModel {
Precedence = BinderPrecedence.Model
};
return true;
}
}
class BinderPrecedenceGlobalBinder : ParameterBinder {
public override Type ParameterType {
get { return typeof(BinderPrecedenceModel); }
}
public override bool TryBind(string value, IFormatProvider provider, out object result) {
result = new BinderPrecedenceModel {
Precedence = BinderPrecedence.Global
};
return true;
}
}
public class BinderPrecedenceController : ApiController {
public string Get([FromRoute]BinderPrecedenceModel model) {
return model.Precedence.ToString();
}
}
}
namespace MvcCodeRouting.Web.Http.Tests.ParameterBinding.BinderPrecedence.ModelTypeVsType {
[ModelBinder(typeof(BinderPrecedenceModelBinder))]
[ParameterBinder(typeof(BinderPrecedenceTypeBinder))]
public class BinderPrecedenceModel {
public BinderPrecedence Precedence { get; set; }
}
class BinderPrecedenceModelBinder : IModelBinder {
public bool BindModel(HttpActionContext actionContext, ModelBindingContext bindingContext) {
bindingContext.Model = new BinderPrecedenceModel {
Precedence = BinderPrecedence.Model
};
return true;
}
}
class BinderPrecedenceTypeBinder : ParameterBinder {
public override Type ParameterType {
get { return typeof(BinderPrecedenceModel); }
}
public override bool TryBind(string value, IFormatProvider provider, out object result) {
result = new BinderPrecedenceModel {
Precedence = BinderPrecedence.Type
};
return true;
}
}
public class BinderPrecedenceController : ApiController {
public string Get([FromRoute]BinderPrecedenceModel model) {
return model.Precedence.ToString();
}
}
}
namespace MvcCodeRouting.Web.Http.Tests.ParameterBinding.BinderPrecedence.ModelGlobalVsParameter {
public class BinderPrecedenceModel {
public BinderPrecedence Precedence { get; set; }
}
class BinderPrecedenceModelBinder : IModelBinder {
public bool BindModel(HttpActionContext actionContext, ModelBindingContext bindingContext) {
bindingContext.Model = new BinderPrecedenceModel {
Precedence = BinderPrecedence.Model
};
return true;
}
}
class BinderPrecedenceParameterBinder : ParameterBinder {
public override Type ParameterType {
get { return typeof(BinderPrecedenceModel); }
}
public override bool TryBind(string value, IFormatProvider provider, out object result) {
result = new BinderPrecedenceModel {
Precedence = BinderPrecedence.Parameter
};
return true;
}
}
public class BinderPrecedenceController : ApiController {
protected override void Initialize(HttpControllerContext controllerContext) {
base.Initialize(controllerContext);
this.Configuration.BindParameter(typeof(BinderPrecedenceModel), new BinderPrecedenceModelBinder());
}
public string Get([FromRoute(BinderType = typeof(BinderPrecedenceParameterBinder))]BinderPrecedenceModel model) {
return model.Precedence.ToString();
}
}
}
namespace MvcCodeRouting.Web.Http.Tests.ParameterBinding.BinderPrecedence.ModelGlobalVsGlobal {
public class BinderPrecedenceModel {
public BinderPrecedence Precedence { get; set; }
}
class BinderPrecedenceModelBinder : IModelBinder {
public bool BindModel(HttpActionContext actionContext, ModelBindingContext bindingContext) {
bindingContext.Model = new BinderPrecedenceModel {
Precedence = BinderPrecedence.Model
};
return true;
}
}
class BinderPrecedenceGlobalBinder : ParameterBinder {
public override Type ParameterType {
get { return typeof(BinderPrecedenceModel); }
}
public override bool TryBind(string value, IFormatProvider provider, out object result) {
result = new BinderPrecedenceModel {
Precedence = BinderPrecedence.Global
};
return true;
}
}
public class BinderPrecedenceController : ApiController {
protected override void Initialize(HttpControllerContext controllerContext) {
base.Initialize(controllerContext);
this.Configuration.BindParameter(typeof(BinderPrecedenceModel), new BinderPrecedenceModelBinder());
}
public string Get([FromRoute]BinderPrecedenceModel model) {
return model.Precedence.ToString();
}
}
}
namespace MvcCodeRouting.Web.Http.Tests.ParameterBinding.BinderPrecedence.ModelGlobalVsType {
[ParameterBinder(typeof(BinderPrecedenceTypeBinder))]
public class BinderPrecedenceModel {
public BinderPrecedence Precedence { get; set; }
}
class BinderPrecedenceModelBinder : IModelBinder {
public bool BindModel(HttpActionContext actionContext, ModelBindingContext bindingContext) {
bindingContext.Model = new BinderPrecedenceModel {
Precedence = BinderPrecedence.Model
};
return true;
}
}
class BinderPrecedenceTypeBinder : ParameterBinder {
public override Type ParameterType {
get { return typeof(BinderPrecedenceModel); }
}
public override bool TryBind(string value, IFormatProvider provider, out object result) {
result = new BinderPrecedenceModel {
Precedence = BinderPrecedence.Type
};
return true;
}
}
public class BinderPrecedenceController : ApiController {
protected override void Initialize(HttpControllerContext controllerContext) {
base.Initialize(controllerContext);
this.Configuration.BindParameter(typeof(BinderPrecedenceModel), new BinderPrecedenceModelBinder());
}
public string Get([FromRoute]BinderPrecedenceModel model) {
return model.Precedence.ToString();
}
}
} | {
"content_hash": "9c036727a321c2af0694d3693a0ac91c",
"timestamp": "",
"source": "github",
"line_count": 659,
"max_line_length": 142,
"avg_line_length": 28.83156297420334,
"alnum_prop": 0.7010526315789474,
"repo_name": "maxtoroq/MvcCodeRouting",
"id": "36ee511a56e6e3d7eae038883fe341d034d87510",
"size": "19002",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "tests/MvcCodeRouting.Web.Http.Tests/ParameterBinding/BinderPrecedenceBehavior.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "534"
},
{
"name": "C#",
"bytes": "470169"
},
{
"name": "PowerShell",
"bytes": "7898"
}
],
"symlink_target": ""
} |
/*
* QuickBlox JavaScript SDK / XMPP Chat plugin
*
* Chat module
*
*/
// Browserify dependencies
require('../libs/strophe');
require('../libs/strophe.muc');
var config = require('./config');
var QBChatHelpers = require('./qbChatHelpers');
window.QBChat = QBChat;
window.QBChatHelpers = QBChatHelpers;
// add extra namespaces for Strophe
Strophe.addNamespace('CHATSTATES', 'http://jabber.org/protocol/chatstates');
function QBChat(params) {
var self = this;
this.version = '0.9.0';
this.config = config;
this._autoPresence = true;
// Storage of joined rooms and user nicknames
this._rooms = {};
// create Strophe Connection object
this._connection = new Strophe.Connection(config.bosh);
if (params) {
if (params.debug) {
this._debug = params.debug;
this._connection.rawInput = function(data) {console.log('RECV: ' + data)};
this._connection.rawOutput = function(data) {console.log('SENT: ' + data)};
}
// set user callbacks
this._callbacks = {
onConnectFailed: params.onConnectFailed || null,
onConnectSuccess: params.onConnectSuccess || null,
onConnectClosed: params.onConnectClosed || null,
onChatMessage: params.onChatMessage || null,
onChatState: params.onChatState || null,
onMUCPresence: params.onMUCPresence || null,
onMUCRoster: params.onMUCRoster || null
};
}
this._onMessage = function(stanza) {
var from, type, body, extraParams, invite;
var senderID, message, extension = {};
from = $(stanza).attr('from');
type = $(stanza).attr('type');
body = $(stanza).find('body')[0];
extraParams = $(stanza).find('extraParams')[0];
invite = $(stanza).find('invite')[0];
if (params && params.debug) {
console.log(stanza);
trace(invite && 'Invite' || (body ? 'Message' : 'Chat state notification'));
}
senderID = invite && QBChatHelpers.getIDFromNode($(invite).attr('from')) ||
( (type === 'groupchat') ? QBChatHelpers.getIDFromResource(from) : QBChatHelpers.getIDFromNode(from) );
$(extraParams && extraParams.childNodes).each(function() {
extension[$(this).context.tagName] = $(this).context.textContent;
});
if (invite) {
message = {
room: from.split('@')[0].slice(from.indexOf('_') + 1),
type: 'invite',
};
} else if (body) {
message = {
body: $(body).context.textContent,
time: $(stanza).find('delay').attr('stamp') || new Date().toISOString(),
type: type,
extension: extension
};
} else {
message = {
state: $(stanza).context.firstChild.tagName,
type: type,
extension: extension
};
}
invite || body ? self._callbacks.onChatMessage && self._callbacks.onChatMessage(senderID, message) :
self._callbacks.onChatState && self._callbacks.onChatState(senderID, message);
return true;
};
this._onPresence = function(stanza, room) {
var from, type, senderID, presence;
from = $(stanza).attr('from');
type = $(stanza).attr('type');
if (params && params.debug) {
console.log(stanza);
trace('Presence');
}
senderID = QBChatHelpers.getIDFromResource(from);
presence = {
time: new Date().toISOString(),
type: type
};
if (senderID.indexOf('tigase') != 0)
self._callbacks.onMUCPresence(senderID, presence);
return true;
};
this._onRoster = function(users, room) {
self._callbacks.onMUCRoster && self._callbacks.onMUCRoster(users, room);
return true;
};
// JSON response for groupchat methods
this._IQResult = [];
this._onIQstanza = function(stanza) {
var query, item;
var childElem = $(stanza).find('item')[0] || $(stanza).find('identity')[0];
if (childElem) {
if (params && params.debug) {
console.log(stanza);
trace('IQ result');
}
query = $(stanza).find('query')[0];
$(query.childNodes).each(function() {
item = {};
$(this.attributes).each(function() {
item[this.name] = this.value;
});
self._IQResult.push(item);
});
}
return true;
};
}
function trace(text) {
console.log("[qb_chat]: " + text);
}
/* One to One chat methods
----------------------------------------------------------*/
QBChat.prototype.startAutoSendPresence = function(timeout) {
var self = this;
setTimeout(sendPresence, timeout * 1000);
function sendPresence() {
if (!self._autoPresence) return false;
self._connection.send($pres());
self.startAutoSendPresence(timeout);
}
};
QBChat.prototype.connect = function(user) {
var self = this;
var userJID = QBChatHelpers.getJID(user.id);
this._connection.connect(userJID, user.pass, function(status) {
switch (status) {
case Strophe.Status.ERROR:
trace('Error');
break;
case Strophe.Status.CONNECTING:
trace('Connecting');
break;
case Strophe.Status.CONNFAIL:
trace('Failed to connect');
self._callbacks.onConnectFailed();
break;
case Strophe.Status.AUTHENTICATING:
trace('Authenticating');
break;
case Strophe.Status.AUTHFAIL:
trace('Unauthorized');
self._callbacks.onConnectFailed();
break;
case Strophe.Status.CONNECTED:
trace('Connected');
self._connection.addHandler(self._onMessage, null, 'message', 'chat');
self._connection.addHandler(self._onMessage, null, 'message', 'groupchat');
self._connection.addHandler(self._onIQstanza, null, 'iq', 'result');
if (self._callbacks.onMUCPresence)
self._connection.addHandler(self._onPresence, null, 'presence');
self._callbacks.onConnectSuccess();
break;
case Strophe.Status.DISCONNECTING:
trace('Disconnecting');
self._autoPresence = false;
self._callbacks.onConnectClosed();
break;
case Strophe.Status.DISCONNECTED:
trace('Disconnected');
break;
case Strophe.Status.ATTACHED:
trace('Attached');
break;
}
});
};
QBChat.prototype.sendMessage = function(userID, message) {
var msg, jid;
jid = (message.type === 'groupchat') ? QBChatHelpers.getRoom(userID) : QBChatHelpers.getJID(userID);
msg = $msg({
to: jid,
type: message.type
});
if (message.body) {
msg.c('body', {
xmlns: Strophe.NS.CLIENT
}).t(message.body);
}
// Chat State Notifications (XEP 0085)
// http://xmpp.org/extensions/xep-0085.html
if (message.state) {
msg.c(message.state, {
xmlns: Strophe.NS.CHATSTATES
});
}
// custom parameters
if (message.extension) {
msg.up().c('extraParams', {
xmlns: Strophe.NS.CLIENT
});
$(Object.keys(message.extension)).each(function() {
msg.c(this).t(message.extension[this]).up();
});
}
this._connection.send(msg);
};
QBChat.prototype.disconnect = function() {
this._connection.send($pres());
this._connection.flush();
this._connection.disconnect();
};
/* MUC methods
----------------------------------------------------------*/
// Multi-User Chat (XEP 0045)
// http://xmpp.org/extensions/xep-0045.html
QBChat.prototype.join = function(roomName, nick) {
var roomJID = QBChatHelpers.getRoom(roomName);
this._rooms[roomName] = nick;
this._connection.muc.join(roomJID, nick, null, null, this._onRoster);
};
QBChat.prototype.leave = function(roomName) {
var roomJID = QBChatHelpers.getRoom(roomName);
var nick = this._rooms[roomName];
delete this._rooms[roomName];
this._connection.muc.leave(roomJID, nick);
};
QBChat.prototype.createRoom = function(params, callback) {
var nick, roomJID, pres, self = this;
nick = params.nick || QBChatHelpers.getIDFromNode(this._connection.jid);
roomJID = QBChatHelpers.getRoom(params.room);
pres = $pres({
to: roomJID + '/' + nick
}).c('x', {
xmlns: Strophe.NS.MUC
});
this._connection.send(pres);
setTimeout(createInstant, 1 * 1000);
function createInstant() {
self._connection.muc.createInstantRoom(roomJID,
function onSuccess() {
trace('Room created');
configure();
},
function onError() {
trace('Room created error');
callback('Room created error', null);
}
);
}
function configure() {
self._connection.muc.configure(roomJID,
function onSuccess(roomConfig) {
trace('Room config set');
console.log(roomConfig);
var data = [];
var roomname = $(roomConfig).find('field[var="muc#roomconfig_roomname"]');
var membersonly = $(roomConfig).find('field[var="muc#roomconfig_membersonly"]');
var persistentroom = $(roomConfig).find('field[var="muc#roomconfig_persistentroom"]');
roomname.find('value').text(params.room);
if (params.membersOnly) membersonly.find('value').text(1);
if (params.persistent) persistentroom.find('value').text(1);
data[0] = roomname[0];
data[1] = membersonly[0];
data[2] = persistentroom[0];
saveConfiguration(data);
},
function onError() {
trace('Room config error');
callback('Room config error', null);
}
);
}
function saveConfiguration(data) {
self._connection.muc.saveConfiguration(roomJID, data,
function onSuccess() {
trace('Saving of room config is completed');
self._rooms[params.room] = nick;
callback(null, true);
},
function onError() {
trace('Room created error');
callback('Room created error', null);
}
);
}
};
QBChat.prototype.addMembers = function(params, callback) {
var roomJID, iq, self = this;
roomJID = QBChatHelpers.getRoom(params.room);
iq = $iq({
to: roomJID,
type: 'set'
}).c('query', {
xmlns: Strophe.NS.MUC_ADMIN
});
$(params.users).each(function() {
iq.cnode($build('item', {jid: QBChatHelpers.getJID(this), affiliation: 'owner'}).node).up();
});
self._connection.sendIQ(iq.tree(),
function onSuccess() {
callback(null, true);
},
function onError() {
callback(true, null);
}
);
};
QBChat.prototype.deleteMembers = function(params, callback) {
console.log('deleteMembers');
var roomJID, iq, self = this;
roomJID = QBChatHelpers.getRoom(params.room);
iq = $iq({
to: roomJID,
type: 'set'
}).c('query', {
xmlns: Strophe.NS.MUC_ADMIN
});
$(params.users).each(function() {
iq.cnode($build('item', {jid: QBChatHelpers.getJID(this), affiliation: 'none'}).node).up();
});
self._connection.sendIQ(iq.tree(),
function onSuccess() {
callback(null, true);
},
function onError() {
callback(true, null);
}
);
};
// Owner Requests Owner List
// http://xmpp.org/extensions/xep-0045.html#modifyowner
QBChat.prototype.getRoomMembers = function(room, callback) {
console.log('getRoomMembers');
var roomJID, iq, self = this;
roomJID = QBChatHelpers.getRoom(room);
iq = $iq({
to: roomJID,
type: 'get'
}).c('query', {
xmlns: Strophe.NS.MUC_ADMIN
}).c('item', {
affiliation: 'owner'
});
self._connection.sendIQ(iq.tree(),
function onSuccess() {
var res = self._IQResult;
self._IQResult = [];
callback(null, res);
},
function onError() {
callback(true, null);
}
);
};
// Querying for Room Items
// http://xmpp.org/extensions/xep-0045.html#disco-roomitems
QBChat.prototype.getOnlineUsers = function(room, callback) {
console.log('getOnlineUsers');
var self = this;
var roomJID = QBChatHelpers.getRoom(room);
self._connection.muc.queryOccupants(roomJID,
function onSuccess() {
var res = self._IQResult;
self._IQResult = [];
callback(null, res);
},
function onError() {
callback(true, null);
}
);
};
// Querying for Room Information
// http://xmpp.org/extensions/xep-0045.html#disco-roominfo
QBChat.prototype.getRoomInfo = function(room, callback) {
console.log('getRoomInfo');
var roomJID, iq, self = this;
roomJID = QBChatHelpers.getRoom(room);
iq = $iq({
to: roomJID,
type: "get"
}).c("query", {
xmlns: Strophe.NS.DISCO_INFO
});
self._connection.sendIQ(iq.tree(),
function onSuccess() {
var res = self._IQResult;
self._IQResult = [];
callback(null, res);
},
function onError() {
callback(true, null);
}
);
};
// Discovering Rooms
// http://xmpp.org/extensions/xep-0045.html#disco-rooms
QBChat.prototype.listRooms = function(callback) {
console.log('listRooms');
var self = this;
self._connection.muc.listRooms(config.muc,
function onSuccess() {
var res = self._IQResult;
self._IQResult = [];
callback(null, res);
},
function onError() {
callback(true, null);
}
);
};
QBChat.prototype.destroy = function(roomName) {
console.log('destroy');
var roomJid = QB.service.qbInst.session.application_id + '_' + roomName + '@' + config.muc;
var iq = $iq({
to: roomJid,
type: 'set'
}).c('query', {xmlns: Strophe.NS.MUC_OWNER})
.c('destroy').c('reason').t('Sorry, this room was removed');
this._connection.send(iq);
};
| {
"content_hash": "71890adce36bdca7f29a17e95bc7f4e1",
"timestamp": "",
"source": "github",
"line_count": 524,
"max_line_length": 116,
"avg_line_length": 26.017175572519083,
"alnum_prop": 0.5951734761241106,
"repo_name": "alrodabaugh/sample",
"id": "d6a46d9234162bc809f713e9324adc8b33175112",
"size": "13633",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "plugins/chat/js/qbChat.js",
"mode": "33261",
"license": "bsd-2-clause",
"language": [
{
"name": "CSS",
"bytes": "6537"
},
{
"name": "HTML",
"bytes": "1533"
},
{
"name": "JavaScript",
"bytes": "1195321"
},
{
"name": "Ruby",
"bytes": "944"
}
],
"symlink_target": ""
} |
package edu.pacificu.cs493f15_1.paperorplasticapp;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest
{
@Test
public void addition_isCorrect() throws Exception
{
assertEquals(4, 2 + 2);
}
} | {
"content_hash": "71bb0b210853d7a5f63d24591709b72f",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 78,
"avg_line_length": 19.176470588235293,
"alnum_prop": 0.7208588957055214,
"repo_name": "eheydemann/PaperOrPlastic",
"id": "1ad3f8e307e7aceb8a2d625db5fa4d1fe434d507",
"size": "326",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "PaperOrPlasticApp/app/src/test/java/edu/pacificu/cs493f15_1/paperorplasticapp/ExampleUnitTest.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "176762"
}
],
"symlink_target": ""
} |
@interface CKCertificate()
@property (nonatomic) X509 * certificate;
@property (strong, nonatomic, readwrite) NSString * summary;
@property (strong, nonatomic) NSArray<NSString *> * subjectAltNames;
@property (strong, nonatomic) distributionPoints * crlCache;
@end
@implementation CKCertificate
static const int CERTIFICATE_SUBJECT_MAX_LENGTH = 150;
- (void) openSSLError {
const char * file;
int line;
ERR_peek_last_error_line(&file, &line);
NSLog(@"OpenSSL error in file: %s:%i", file, line);
}
+ (CKCertificate *) fromX509:(void *)cert {
CKCertificate * xcert = [CKCertificate new];
xcert.certificate = (X509 *)cert;
xcert.summary = [xcert generateSummary];
xcert.revoked = [CKCertificateRevoked new];
return xcert;
}
- (NSString *) getSubjectNID:(int)nid {
X509_NAME * name = X509_get_subject_name(self.certificate);
char * value = malloc(CERTIFICATE_SUBJECT_MAX_LENGTH);
int length = X509_NAME_get_text_by_NID(name, nid, value, CERTIFICATE_SUBJECT_MAX_LENGTH);
if (length < 0) {
return nil;
}
NSString * subject = [[NSString alloc] initWithBytes:value length:length encoding:NSUTF8StringEncoding];
free(value);
return subject;
}
- (NSString *) generateSummary {
return [self getSubjectNID:NID_commonName];
}
- (NSString *) SHA512Fingerprint {
return [self digestOfType:CKCertificateFingerprintTypeSHA512];
}
- (NSString *) SHA256Fingerprint {
return [self digestOfType:CKCertificateFingerprintTypeSHA256];
}
- (NSString *) MD5Fingerprint {
return [self digestOfType:CKCertificateFingerprintTypeMD5];
}
- (NSString *) SHA1Fingerprint {
return [self digestOfType:CKCertificateFingerprintTypeSHA1];
}
- (NSString *) digestOfType:(CKCertificateFingerprintType)type {
const EVP_MD * digest;
switch (type) {
case CKCertificateFingerprintTypeSHA512:
digest = EVP_sha512();
break;
case CKCertificateFingerprintTypeSHA256:
digest = EVP_sha256();
break;
case CKCertificateFingerprintTypeSHA1:
digest = EVP_sha1();
break;
case CKCertificateFingerprintTypeMD5:
digest = EVP_md5();
break;
}
unsigned char fingerprint[EVP_MAX_MD_SIZE];
unsigned int fingerprint_size = sizeof(fingerprint);
if (X509_digest(self.certificate, digest, fingerprint, &fingerprint_size) < 0) {
NSLog(@"Unable to generate certificate fingerprint");
return @"";
}
NSMutableString * fingerprintString = [NSMutableString new];
for (int i = 0; i < fingerprint_size && i < EVP_MAX_MD_SIZE; i++) {
[fingerprintString appendFormat:@"%02x", fingerprint[i]];
}
return fingerprintString;
}
- (BOOL) verifyFingerprint:(NSString *)fingerprint type:(CKCertificateFingerprintType)type {
NSString * actualFingerprint = [self digestOfType:type];
NSString * formattedFingerprint = [[fingerprint componentsSeparatedByCharactersInSet:[[NSCharacterSet
alphanumericCharacterSet]
invertedSet]]
componentsJoinedByString:@""];
return [[actualFingerprint lowercaseString] isEqualToString:[formattedFingerprint lowercaseString]];
}
- (NSString *) serialNumber {
const ASN1_INTEGER * serial = X509_get0_serialNumber(self.certificate);
long value = ASN1_INTEGER_get(serial);
if (value == -1) {
BIGNUM * bnser = ASN1_INTEGER_to_BN(serial, NULL);
char * asciiHex = BN_bn2hex(bnser);
return [NSString stringWithUTF8String:asciiHex];
} else {
return [[NSNumber numberWithLong:value] stringValue];
}
}
- (NSString *) signatureAlgorithm {
const X509_ALGOR * sigType = X509_get0_tbs_sigalg(self.certificate);
char buffer[128];
OBJ_obj2txt(buffer, sizeof(buffer), sigType->algorithm, 0);
return [NSString stringWithUTF8String:buffer];
}
- (NSString *) keyAlgorithm {
X509_PUBKEY * pubkey = X509_get_X509_PUBKEY(self.certificate);
X509_ALGOR * keyType;
int rv = X509_PUBKEY_get0_param(NULL, NULL, NULL, &keyType, pubkey);
if (rv < 0) {
return nil;
}
char buffer[128];
OBJ_obj2txt(buffer, sizeof(buffer), keyType->algorithm, 0);
return [NSString stringWithUTF8String:buffer];
}
- (NSDate *) notAfter {
return [NSDate fromASN1_TIME:X509_get0_notAfter(self.certificate)];
}
- (NSDate *) notBefore {
return [NSDate fromASN1_TIME:X509_get0_notBefore(self.certificate)];
}
- (BOOL) validIssueDate {
BOOL valid = YES;
if ([self.notBefore timeIntervalSinceNow] > 0) {
valid = NO;
}
if ([self.notAfter timeIntervalSinceNow] < 0) {
valid = NO;
}
return valid;
}
- (NSString *) issuer {
X509_NAME *issuerX509Name = X509_get_issuer_name(self.certificate);
if (issuerX509Name != NULL) {
int index = X509_NAME_get_index_by_NID(issuerX509Name, NID_organizationName, -1);
X509_NAME_ENTRY *issuerNameEntry = X509_NAME_get_entry(issuerX509Name, index);
if (issuerNameEntry) {
ASN1_STRING *issuerNameASN1 = X509_NAME_ENTRY_get_data(issuerNameEntry);
if (issuerNameASN1 != NULL) {
const unsigned char *issuerName = ASN1_STRING_get0_data(issuerNameASN1);
return [NSString stringWithUTF8String:(char *)issuerName];
}
}
}
return @"";
}
- (NSDictionary<NSString *, NSString *> *) names {
#define add_subject(k, nid) value = [self getSubjectNID:nid]; if (value != nil) { [names setObject:value forKey:k]; }
NSMutableDictionary<NSString *, NSString *> * names = [NSMutableDictionary new];
NSString * value;
add_subject(@"CN", NID_commonName);
add_subject(@"C", NID_countryName);
add_subject(@"S", NID_stateOrProvinceName);
add_subject(@"L", NID_localityName);
add_subject(@"O", NID_organizationName);
add_subject(@"OU", NID_organizationalUnitName);
add_subject(@"E", NID_pkcs9_emailAddress);
return names;
}
- (void *) X509Certificate {
return self.certificate;
}
- (NSData *) publicKeyAsPEM {
BIO * buffer = BIO_new(BIO_s_mem());
if (PEM_write_bio_X509(buffer, self.certificate)) {
BUF_MEM *buffer_pointer;
BIO_get_mem_ptr(buffer, &buffer_pointer);
char * pem_bytes = malloc(buffer_pointer->length);
memcpy(pem_bytes, buffer_pointer->data, buffer_pointer->length-1);
// Exclude the null terminator from the NSData object
NSData * pem = [NSData dataWithBytes:pem_bytes length:buffer_pointer->length -1];
free(pem_bytes);
free(buffer);
return pem;
}
free(buffer);
return nil;
}
- (NSArray<NSString *> *) subjectAlternativeNames {
// This will leak
GENERAL_NAMES * sans = X509_get_ext_d2i(self.certificate, NID_subject_alt_name, NULL, NULL);
int numberOfSans = sk_GENERAL_NAME_num(sans);
if (numberOfSans < 1) {
return @[];
}
if (self.subjectAltNames) {
return self.subjectAltNames;
}
NSMutableArray<NSString *> * names = [NSMutableArray new];
const GENERAL_NAME * name;
const unsigned char * domain;
for (int i = 0; i < numberOfSans; i++) {
name = sk_GENERAL_NAME_value(sans, i);
if (name->type == GEN_DNS) {
domain = ASN1_STRING_get0_data(name->d.dNSName);
[names addObject:[NSString stringWithUTF8String:(const char *)domain]];
}
}
self.subjectAltNames = names;
sk_GENERAL_NAME_free(sans);
return names;
}
- (NSString *) extendedValidationAuthority {
NSDictionary<NSString *, NSString *> * EV_MAP = @{
@"1.3.159.1.17.1": @"Actalis",
@"1.3.6.1.4.1.34697.2.1": @"AffirmTrust",
@"1.3.6.1.4.1.34697.2.2": @"AffirmTrust",
@"1.3.6.1.4.1.34697.2.3": @"AffirmTrust",
@"1.3.6.1.4.1.34697.2.4": @"AffirmTrust",
@"2.16.578.1.26.1.3.3": @"Buypass",
@"1.3.6.1.4.1.6449.1.2.1.5.1": @"Comodo Group",
@"2.16.840.1.114412.2.1": @"DigiCert",
@"2.16.840.1.114412.1.3.0.2": @"DigiCert",
@"2.16.792.3.0.4.1.1.4": @"E-Tugra",
@"2.16.840.1.114028.10.1.2": @"Entrust",
@"1.3.6.1.4.1.14370.1.6": @"GeoTrust",
@"1.3.6.1.4.1.4146.1.1": @"GlobalSign",
@"2.16.840.1.114413.1.7.23.3": @"Go Daddy",
@"1.3.6.1.4.1.14777.6.1.1": @"Izenpe",
@"1.3.6.1.4.1.782.1.2.1.8.1": @"Network Solutions",
@"1.3.6.1.4.1.22234.2.5.2.3.1": @"OpenTrust/DocuSign France",
@"1.3.6.1.4.1.8024.0.2.100.1.2": @"QuoVadis",
@"1.2.392.200091.100.721.1": @"SECOM Trust Systems",
@"2.16.840.1.114414.1.7.23.3": @"Starfield Technologies",
@"2.16.756.1.83.21.0": @"Swisscom",
@"2.16.756.1.89.1.2.1.1": @"SwissSign",
@"2.16.840.1.113733.1.7.48.1": @"Thawte",
@"2.16.840.1.114404.1.1.2.4.1": @"Trustwave",
@"2.16.840.1.113733.1.7.23.6": @"Symantec (VeriSign)",
@"1.3.6.1.4.1.6334.1.100.1": @"Verizon Business/Cybertrust",
@"2.16.840.1.114171.500.9": @"Wells Fargo"
};
CERTIFICATEPOLICIES * policies = X509_get_ext_d2i(self.certificate, NID_certificate_policies, NULL, NULL);
int numberOfPolicies = sk_POLICYINFO_num(policies);
const POLICYINFO * policy;
NSString * oid;
NSString * evAgency;
for (int i = 0; i < numberOfPolicies; i++) {
policy = sk_POLICYINFO_value(policies, i);
#define POLICY_BUFF_MAX 32
char buff[POLICY_BUFF_MAX];
OBJ_obj2txt(buff, POLICY_BUFF_MAX, policy->policyid, 0);
oid = [NSString stringWithUTF8String:buff];
evAgency = [EV_MAP objectForKey:oid];
if (evAgency) {
sk_POLICYINFO_free(policies);
return evAgency;
}
}
sk_POLICYINFO_free(policies);
return nil;
}
- (BOOL) isCA {
BASIC_CONSTRAINTS * constraints = X509_get_ext_d2i(self.certificate, NID_basic_constraints, NULL, NULL);
BOOL ret = constraints->ca > 0;
BASIC_CONSTRAINTS_free(constraints);
return ret;
}
- (distributionPoints *) crlDistributionPoints {
if (self.crlCache) {
return self.crlCache;
}
CRL_DIST_POINTS * points = X509_get_ext_d2i(self.certificate, NID_crl_distribution_points, NULL, NULL);
int numberOfPoints = sk_DIST_POINT_num(points);
if (numberOfPoints < 0) {
return @[];
}
DIST_POINT * point;
GENERAL_NAMES * fullNames;
GENERAL_NAME * fullName;
NSMutableArray<NSURL *> * urls = [NSMutableArray new];
for (int i = 0; i < numberOfPoints; i ++) {
point = sk_DIST_POINT_value(points, i);
fullNames = point->distpoint->name.fullname;
fullName = sk_GENERAL_NAME_value(fullNames, 0);
const unsigned char * url = ASN1_STRING_get0_data(fullName->d.uniformResourceIdentifier);
[urls addObject:[NSURL URLWithString:[NSString stringWithUTF8String:(const char *)url]]];
}
self.crlCache = urls;
return urls;
}
- (BOOL) extendedValidation {
return [self extendedValidationAuthority] != nil;
}
+ (NSString *) openSSLVersion {
NSString * version = [NSString stringWithUTF8String:OPENSSL_VERSION_TEXT]; // OpenSSL <version> ...
NSArray<NSString *> * versionComponents = [version componentsSeparatedByString:@" "];
return versionComponents[1];
}
@end
| {
"content_hash": "0249f80617a8c23b91958444e43100f4",
"timestamp": "",
"source": "github",
"line_count": 348,
"max_line_length": 117,
"avg_line_length": 33.382183908045974,
"alnum_prop": 0.6165102866488766,
"repo_name": "certificate-helper/CHCertificate",
"id": "cecee66c8392517bbb52e71fae7a5985dfb0b453",
"size": "13093",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "CertificateKit/CKCertificate.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "1049446"
},
{
"name": "C++",
"bytes": "197583"
},
{
"name": "Objective-C",
"bytes": "66469"
},
{
"name": "Shell",
"bytes": "322"
}
],
"symlink_target": ""
} |
package com.github.pagehelper.mapper;
import com.github.pagehelper.Page;
import com.github.pagehelper.model.*;
import com.github.pagehelper.test.basic.dynamic.Where;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.session.RowBounds;
import java.util.List;
import java.util.Map;
@SuppressWarnings("rawtypes")
public interface UserMapper {
@Select("select * from user order by ${order}")
List<User> selectByOrder(@Param("order") String order);
//增加Provider测试
@SelectProvider(type = ProviderMethod.class, method = "selectSimple")
Page<User> selectSimple(String str);
//增加Provider测试
@SelectProvider(type = ProviderMethod.class, method = "select")
List<User> selectByProvider(@Param("param") Map map);
@SelectProvider(type = ProviderMethod.class, method = "selectUser")
List<User> selectByUserProvider(User user);
@Select("Select * from user")
List<Map<String, Object>> selectBySelect();
List<User> selectByOrder2(@Param("order") String order);
List<User> selectAll();
//嵌套查询
List<User> selectCollectionMap();
List<User> selectGreterThanId(int id);
List<User> selectGreterThanIdAndNotEquelName(@Param("id") int id, @Param("name") String name);
List<User> selectAll(RowBounds rowBounds);
List<User> selectAllOrderby();
List<User> selectAllOrderByParams(@Param("order1") String order1, @Param("order2") String order2);
//下面是三种参数类型的测试方法
List<User> selectAllOrderByMap(Map orders);
List<User> selectAllOrderByList(List<Integer> params);
List<User> selectAllOrderByArray(Integer[] params);
//测试动态sql,where/if
List<User> selectIf(@Param("id") Integer id);
List<User> selectIf3(User user);
List<User> selectIf2(@Param("id1") Integer id1, @Param("id2") Integer id2);
List<User> selectIf2List(@Param("id1") List<Integer> id1, @Param("id2") List<Integer> id2);
List<User> selectIf2ListAndOrder(@Param("id1") List<Integer> id1, @Param("id2") List<Integer> id2, @Param("order") String order);
List<User> selectChoose(@Param("id1") Integer id1, @Param("id2") Integer id2);
List<User> selectLike(User user);
//特殊sql语句的测试 - 主要测试count查询
List<User> selectUnion();
List<User> selectLeftjoin();
List<User> selectWith();
//select column中包含参数时
List<User> selectColumns(@Param("columns") String... columns);
List<User> selectMULId(int mul);
//group by时
List<User> selectGroupBy();
//select Map
List<User> selectByWhereMap(Where where);
//Example
List<User> selectByExample(UserExample example);
List<User> selectDistinct();
List<User> selectExists();
List<User> selectByPageNumSize(@Param("pageNum") int pageNum, @Param("pageSize") int pageSize);
List<User> selectByPageNumSizeOrderBy(@Param("pageNum") int pageNum, @Param("pageSize") int pageSize, @Param("orderBy") String orderBy);
List<User> selectByOrderBy(@Param("orderBy") String orderBy);
List<User> selectByQueryModel(UserQueryModel queryModel);
List<User> selectByIdList(@Param("idList") List<Long> idList);
List<User> selectByIdList2(@Param("idList") List<Long> idList);
List<Map<String, Object>> execute(@Param("sql") String sql);
List<UserCode> selectByCode(Code code);
}
| {
"content_hash": "4e20db11b6d48a2163ba3788244b61e4",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 140,
"avg_line_length": 29.28448275862069,
"alnum_prop": 0.7065057403591404,
"repo_name": "pagehelper/Mybatis-PageHelper",
"id": "d8b6633764cea7be49196b13f13ad4defc555a0d",
"size": "4651",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/test/java/com/github/pagehelper/mapper/UserMapper.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "579341"
}
],
"symlink_target": ""
} |
var path = require("path");
var webpack = require("webpack");
var CopyWebpackPlugin = require("copy-webpack-plugin");
var modules_dir = path.join(__dirname, "/node_modules");
var src_dir = path.join(__dirname, "/src");
var templates_dir = path.join(__dirname, "/templates");
var dst_dir = path.join(__dirname, "/dist");
var config = {
// devtool: "cheap-module-eval-source-map",
context: __dirname,
entry: {
app: src_dir + "/creator.ts",
vendor: ["jquery", "lodash", "moment", "core-js", "fs-extra"]
},
target: "node",
output: {
path: dst_dir,
filename: "[name].js",
chunkFilename: "[name].js",
library: "react-project-creator",
libraryTarget: "umd"
},
resolve: {
extensions: [".ts", ".js"],
modules: [
path.resolve("./src"),
"node_modules"
]
},
module: {
loaders: [
{
test: /\.(tsx|ts)$/,
exclude: /node_modules/,
loader: "ts-loader"
}, {
test: /\.json$/,
loader: "json-loader"
}
]
},
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
new webpack.ProvidePlugin({
"$": "jquery",
"jQuery": "jquery"
}),
new CopyWebpackPlugin([
{
from: templates_dir + "/**/*"
}
], {
copyUnmodified: true
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: false,
mangle: false
})
]
// ,
// node: {
// console: true,
// fs: true,
// net: false,
// tls: false
// }
};
module.exports = config;
| {
"content_hash": "d9f14746970ff55b27900f6a3b8be788",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 69,
"avg_line_length": 24.929577464788732,
"alnum_prop": 0.4576271186440678,
"repo_name": "iulian-radu-at/react-project-creator",
"id": "421830c5ce4660530dfa7b616e8059df2c5ca51c",
"size": "1770",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "webpack.config.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "13239"
},
{
"name": "JavaScript",
"bytes": "8338"
},
{
"name": "TypeScript",
"bytes": "281250"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>infotheo: 18 m 32 s 🏆</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.15.1 / infotheo - 0.3.7</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
infotheo
<small>
0.3.7
<span class="label label-success">18 m 32 s 🏆</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-05-04 02:00:26 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-05-04 02:00:26 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-gmp 4 Virtual package relying on a GMP lib system installation
coq 8.15.1 Formal proof management system
dune 3.1.1 Fast, portable, and opinionated build system
ocaml 4.13.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.13.1 Official release 4.13.1
ocaml-config 2 OCaml Switch Configuration
ocaml-options-vanilla 1 Ensure that OCaml is compiled with no special options enabled
ocamlfind 1.9.3 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
maintainer: "Reynald Affeldt <reynald.affeldt@aist.go.jp>"
homepage: "https://github.com/affeldt-aist/infotheo"
dev-repo: "git+https://github.com/affeldt-aist/infotheo.git"
bug-reports: "https://github.com/affeldt-aist/infotheo/issues"
license: "LGPL-2.1-or-later"
synopsis: "Discrete probabilities and information theory for Coq"
description: """
Infotheo is a Coq library for reasoning about discrete probabilities,
information theory, and linear error-correcting codes."""
build: [
[make "-j%{jobs}%" ]
[make "-C" "extraction" "tests"] {with-test}
]
install: [make "install"]
depends: [
"coq" { (>= "8.14" & < "8.16~") | (= "dev") }
"coq-mathcomp-ssreflect" { (>= "1.13.0" & < "1.15~") | (= "dev") }
"coq-mathcomp-fingroup" { (>= "1.13.0" & < "1.15~") | (= "dev") }
"coq-mathcomp-algebra" { (>= "1.13.0" & < "1.15~") | (= "dev") }
"coq-mathcomp-solvable" { (>= "1.13.0" & < "1.15~") | (= "dev") }
"coq-mathcomp-field" { (>= "1.13.0" & < "1.15~") | (= "dev") }
"coq-mathcomp-analysis" { (>= "0.4.0") & (< "0.6~")}
]
tags: [
"keyword:information theory"
"keyword:probability"
"keyword:error-correcting codes"
"keyword:convexity"
"logpath:infotheo"
"date:2022-04-14"
]
authors: [
"Reynald Affeldt, AIST"
"Manabu Hagiwara, Chiba U. (previously AIST)"
"Jonas Senizergues, ENS Cachan (internship at AIST)"
"Jacques Garrigue, Nagoya U."
"Kazuhiko Sakaguchi, Tsukuba U."
"Taku Asai, Nagoya U. (M2)"
"Takafumi Saikawa, Nagoya U."
"Naruomi Obata, Titech (M2)"
]
url {
http: "https://github.com/affeldt-aist/infotheo/archive/0.3.7.tar.gz"
checksum: "sha512=5c49496ea6042c0cfed10c69f3d4ea8c6c6433c574b1d308174792213ed46e28c22d797f8eab5ef2a5e9ad1eeb4bd1fa9f3fc50e392c449a92395a77432a90cd"
}</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-infotheo.0.3.7 coq.8.15.1</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam list; echo; ulimit -Sv 4000000; timeout 4h opam install -y --deps-only coq-infotheo.0.3.7 coq.8.15.1</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>52 m 30 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam list; echo; ulimit -Sv 16000000; timeout 4h opam install -y -v coq-infotheo.0.3.7 coq.8.15.1</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>18 m 32 s</dd>
</dl>
<h2>Installation size</h2>
<p>Total: 37 M</p>
<ul>
<li>1 M <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/degree_profile.vo</code></li>
<li>1 M <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/degree_profile.glob</code></li>
<li>870 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/proba.glob</code></li>
<li>803 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/ldpc_algo_proof.vo</code></li>
<li>684 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/chap2.glob</code></li>
<li>633 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/proba.vo</code></li>
<li>631 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/convex.glob</code></li>
<li>628 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/jtypes.vo</code></li>
<li>544 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/convex.vo</code></li>
<li>516 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/channel_coding_direct.glob</code></li>
<li>501 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/subgraph_partition.vo</code></li>
<li>486 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/ldpc.glob</code></li>
<li>478 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/ldpc_algo_proof.glob</code></li>
<li>467 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/fsdist.vo</code></li>
<li>454 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/fdist.glob</code></li>
<li>444 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/chap2.vo</code></li>
<li>428 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/convex_stone.glob</code></li>
<li>420 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/jtypes.glob</code></li>
<li>418 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/source_coding_vl_converse.glob</code></li>
<li>398 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/channel_coding_direct.vo</code></li>
<li>394 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/subgraph_partition.glob</code></li>
<li>388 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/hamming_code.vo</code></li>
<li>386 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/jfdist.glob</code></li>
<li>386 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/tanner_partition.vo</code></li>
<li>377 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/fdist.vo</code></li>
<li>331 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/repcode.vo</code></li>
<li>330 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/reed_solomon.glob</code></li>
<li>330 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/jfdist.vo</code></li>
<li>328 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/linearcode.vo</code></li>
<li>325 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/bayes.vo</code></li>
<li>322 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/convex_stone.vo</code></li>
<li>319 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/fsdist.glob</code></li>
<li>316 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/linearcode.glob</code></li>
<li>314 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/hamming.glob</code></li>
<li>311 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/necset.vo</code></li>
<li>307 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/hamming.vo</code></li>
<li>307 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/hamming_code.glob</code></li>
<li>303 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/ldpc.vo</code></li>
<li>297 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/convex_equiv.vo</code></li>
<li>297 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/ldpc_erasure.vo</code></li>
<li>285 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/success_decode_bound.vo</code></li>
<li>284 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/ssr_ext.vo</code></li>
<li>278 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/tanner_partition.glob</code></li>
<li>276 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/summary_tanner.vo</code></li>
<li>274 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/kraft.glob</code></li>
<li>273 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/stopping_set.vo</code></li>
<li>263 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/necset.glob</code></li>
<li>257 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/ssr_ext.glob</code></li>
<li>256 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/euclid.glob</code></li>
<li>247 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/summary_tanner.glob</code></li>
<li>244 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/source_coding_vl_converse.vo</code></li>
<li>244 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/bch.vo</code></li>
<li>242 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/reed_solomon.vo</code></li>
<li>239 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/bayes.glob</code></li>
<li>235 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/Rbigop.glob</code></li>
<li>235 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/bch.glob</code></li>
<li>234 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/cyclic_code.vo</code></li>
<li>232 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/ldpc_erasure.glob</code></li>
<li>229 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/bigop_ext.glob</code></li>
<li>228 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/stopping_set.glob</code></li>
<li>227 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/Rbigop.vo</code></li>
<li>226 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/types.vo</code></li>
<li>222 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/convex_equiv.glob</code></li>
<li>217 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/convex_fdist.vo</code></li>
<li>208 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/pinsker.glob</code></li>
<li>207 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/num_occ.glob</code></li>
<li>206 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/kraft.vo</code></li>
<li>206 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/ssrR.glob</code></li>
<li>197 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/poly_decoding.glob</code></li>
<li>197 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/poly_decoding.vo</code></li>
<li>193 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/types.glob</code></li>
<li>184 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/vandermonde.glob</code></li>
<li>184 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/bigop_ext.vo</code></li>
<li>183 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/cyclic_code.glob</code></li>
<li>182 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/euclid.vo</code></li>
<li>179 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/vandermonde.vo</code></li>
<li>177 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/ssralg_ext.vo</code></li>
<li>172 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/pinsker.vo</code></li>
<li>159 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/graphoid.glob</code></li>
<li>158 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/ssrR.vo</code></li>
<li>157 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/Reals_ext.vo</code></li>
<li>157 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/toy_examples/conditional_entropy.vo</code></li>
<li>156 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/num_occ.vo</code></li>
<li>155 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/ssralg_ext.glob</code></li>
<li>155 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/success_decode_bound.glob</code></li>
<li>153 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/dft.glob</code></li>
<li>151 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/source_coding_vl_direct.glob</code></li>
<li>150 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/convex_fdist.glob</code></li>
<li>149 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/dft.vo</code></li>
<li>148 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/decoding.vo</code></li>
<li>141 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/summary.vo</code></li>
<li>140 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/degree_profile.v</code></li>
<li>139 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/Reals_ext.glob</code></li>
<li>137 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/natbin.vo</code></li>
<li>136 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/natbin.glob</code></li>
<li>136 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/conditional_divergence.glob</code></li>
<li>136 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/ln_facts.glob</code></li>
<li>136 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/grs.vo</code></li>
<li>134 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/conditional_divergence.vo</code></li>
<li>131 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/ln_facts.vo</code></li>
<li>131 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/ldpc_algo.vo</code></li>
<li>131 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/channel.vo</code></li>
<li>127 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/joint_typ_seq.glob</code></li>
<li>118 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/binary_symmetric_channel.glob</code></li>
<li>116 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/summary.glob</code></li>
<li>116 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/Ranalysis_ext.vo</code></li>
<li>116 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/decoding.glob</code></li>
<li>116 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/source_coding_vl_direct.vo</code></li>
<li>112 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/graphoid.vo</code></li>
<li>108 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/channel.glob</code></li>
<li>102 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/grs.glob</code></li>
<li>101 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/logb.vo</code></li>
<li>99 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/repcode.glob</code></li>
<li>99 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/binary_symmetric_channel.vo</code></li>
<li>97 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/error_exponent.glob</code></li>
<li>95 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/source_coding_fl_converse.glob</code></li>
<li>95 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/pproba.vo</code></li>
<li>95 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/string_entropy.vo</code></li>
<li>93 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/Ranalysis_ext.glob</code></li>
<li>93 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/log_sum.vo</code></li>
<li>90 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/tanner.vo</code></li>
<li>89 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/typ_seq.vo</code></li>
<li>88 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/ssrZ.glob</code></li>
<li>86 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/logb.glob</code></li>
<li>84 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/convex.v</code></li>
<li>84 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/checksum.vo</code></li>
<li>83 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/joint_typ_seq.vo</code></li>
<li>83 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/source_coding_fl_direct.vo</code></li>
<li>82 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/source_coding_fl_converse.vo</code></li>
<li>82 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/error_exponent.vo</code></li>
<li>81 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/partition_inequality.vo</code></li>
<li>80 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/typ_seq.glob</code></li>
<li>79 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/source_coding_fl_direct.glob</code></li>
<li>79 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/ssrZ.vo</code></li>
<li>79 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/proba.v</code></li>
<li>76 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/pproba.glob</code></li>
<li>75 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/string_entropy.glob</code></li>
<li>74 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/toy_examples/conditional_entropy.glob</code></li>
<li>73 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/entropy.vo</code></li>
<li>73 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/aep.vo</code></li>
<li>70 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/toy_examples/expected_value_variance.vo</code></li>
<li>69 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/shannon_fano.vo</code></li>
<li>69 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/channel_coding_converse.vo</code></li>
<li>67 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/checksum.glob</code></li>
<li>66 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/mceliece.vo</code></li>
<li>66 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/binary_entropy_function.vo</code></li>
<li>63 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/ldpc_algo_proof.v</code></li>
<li>63 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/jensen.vo</code></li>
<li>62 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/divergence.vo</code></li>
<li>61 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/log_sum.glob</code></li>
<li>61 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/channel_code.vo</code></li>
<li>59 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/toy_examples/expected_value_variance_ordn.vo</code></li>
<li>58 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/ldpc_algo.glob</code></li>
<li>56 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/toy_examples/expected_value_variance_tuple.vo</code></li>
<li>53 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/max_subset.vo</code></li>
<li>52 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/chap2.v</code></li>
<li>52 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/erasure_channel.vo</code></li>
<li>51 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/subgraph_partition.v</code></li>
<li>51 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/shannon_fano.glob</code></li>
<li>51 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/poly_ext.vo</code></li>
<li>50 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/binary_entropy_function.glob</code></li>
<li>49 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/alternant.vo</code></li>
<li>49 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/aep.glob</code></li>
<li>49 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/necset.v</code></li>
<li>48 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/fdist.v</code></li>
<li>48 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/tanner.glob</code></li>
<li>48 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/partition_inequality.glob</code></li>
<li>47 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/channel_coding_converse.glob</code></li>
<li>47 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/source_code.vo</code></li>
<li>47 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/variation_dist.vo</code></li>
<li>45 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/jtypes.v</code></li>
<li>44 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/f2.vo</code></li>
<li>42 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/convex_stone.v</code></li>
<li>41 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/fsdist.v</code></li>
<li>40 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/entropy.glob</code></li>
<li>38 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/tanner_partition.v</code></li>
<li>37 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/linearcode.v</code></li>
<li>37 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/jfdist.v</code></li>
<li>36 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/channel_coding_direct.v</code></li>
<li>35 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/hamming_code.v</code></li>
<li>34 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/max_subset.glob</code></li>
<li>34 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/source_coding_vl_converse.v</code></li>
<li>33 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/ssr_ext.v</code></li>
<li>33 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/ldpc.v</code></li>
<li>33 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/ssrR.v</code></li>
<li>32 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/divergence.glob</code></li>
<li>32 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/reed_solomon.v</code></li>
<li>30 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/jensen.glob</code></li>
<li>30 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/hamming.v</code></li>
<li>30 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/Rbigop.v</code></li>
<li>30 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/poly_ext.glob</code></li>
<li>30 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/stopping_set.v</code></li>
<li>29 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/euclid.v</code></li>
<li>29 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/bayes.v</code></li>
<li>29 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/kraft.v</code></li>
<li>28 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/ldpc_erasure.v</code></li>
<li>27 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/summary_tanner.v</code></li>
<li>26 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/f2.glob</code></li>
<li>26 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/toy_examples/expected_value_variance.glob</code></li>
<li>26 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/classical_sets_ext.vo</code></li>
<li>25 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/channel_code.glob</code></li>
<li>24 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/Reals_ext.v</code></li>
<li>24 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/cyclic_code.v</code></li>
<li>23 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/bch.v</code></li>
<li>23 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/convex_equiv.v</code></li>
<li>22 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/ln_facts.v</code></li>
<li>21 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/natbin.v</code></li>
<li>21 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/types.v</code></li>
<li>21 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/num_occ.v</code></li>
<li>20 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/mceliece.glob</code></li>
<li>20 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/alternant.glob</code></li>
<li>19 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/ssralg_ext.v</code></li>
<li>19 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/pinsker.v</code></li>
<li>19 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/bigop_ext.v</code></li>
<li>19 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/poly_decoding.v</code></li>
<li>18 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/convex_fdist.v</code></li>
<li>17 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/dft.v</code></li>
<li>16 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/vandermonde.v</code></li>
<li>16 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/source_coding_vl_direct.v</code></li>
<li>15 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/ssrZ.v</code></li>
<li>14 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/Ranalysis_ext.v</code></li>
<li>14 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/decoding.v</code></li>
<li>14 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/toy_examples/expected_value_variance_ordn.glob</code></li>
<li>14 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/channel.v</code></li>
<li>13 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/erasure_channel.glob</code></li>
<li>12 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/success_decode_bound.v</code></li>
<li>12 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/summary.v</code></li>
<li>12 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/logb.v</code></li>
<li>12 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/graphoid.v</code></li>
<li>12 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/joint_typ_seq.v</code></li>
<li>12 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/conditional_divergence.v</code></li>
<li>12 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/repcode.v</code></li>
<li>11 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/ldpc_algo.v</code></li>
<li>11 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/toy_examples/expected_value_variance_tuple.glob</code></li>
<li>11 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/source_code.glob</code></li>
<li>9 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/typ_seq.v</code></li>
<li>9 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/error_exponent.v</code></li>
<li>9 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/grs.v</code></li>
<li>9 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/string_entropy.v</code></li>
<li>9 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/source_coding_fl_direct.v</code></li>
<li>9 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/pproba.v</code></li>
<li>9 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/source_coding_fl_converse.v</code></li>
<li>8 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/classical_sets_ext.glob</code></li>
<li>8 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/variation_dist.glob</code></li>
<li>8 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/log_sum.v</code></li>
<li>8 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/binary_symmetric_channel.v</code></li>
<li>7 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/tanner.v</code></li>
<li>7 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/channel_coding_converse.v</code></li>
<li>7 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/checksum.v</code></li>
<li>6 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/entropy.v</code></li>
<li>6 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/partition_inequality.v</code></li>
<li>6 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/shannon_fano.v</code></li>
<li>5 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/aep.v</code></li>
<li>5 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_modern/max_subset.v</code></li>
<li>5 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/binary_entropy_function.v</code></li>
<li>5 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/divergence.v</code></li>
<li>5 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/f2.v</code></li>
<li>4 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/channel_code.v</code></li>
<li>4 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/alternant.v</code></li>
<li>4 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/ecc_classic/mceliece.v</code></li>
<li>4 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/jensen.v</code></li>
<li>4 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/poly_ext.v</code></li>
<li>3 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/toy_examples/expected_value_variance.v</code></li>
<li>3 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/toy_examples/conditional_entropy.v</code></li>
<li>2 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/source_code.v</code></li>
<li>2 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/information_theory/erasure_channel.v</code></li>
<li>2 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/probability/variation_dist.v</code></li>
<li>2 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/toy_examples/expected_value_variance_ordn.v</code></li>
<li>2 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/lib/classical_sets_ext.v</code></li>
<li>1 K <code>../ocaml-base-compiler.4.13.1/lib/coq/user-contrib/infotheo/toy_examples/expected_value_variance_tuple.v</code></li>
</ul>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq-infotheo.0.3.7</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "4981bf72f901c62096540be5d6afc966",
"timestamp": "",
"source": "github",
"line_count": 451,
"max_line_length": 159,
"avg_line_length": 95.0820399113082,
"alnum_prop": 0.6368406324331888,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "1c9069ca5129f0e104e6058eb9df344c41e00f32",
"size": "42907",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.13.1-2.0.10/released/8.15.1/infotheo/0.3.7.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
.class public Landroid/util/LruCache;
.super Ljava/lang/Object;
.source "LruCache.java"
# annotations
.annotation system Ldalvik/annotation/Signature;
value = {
"<K:",
"Ljava/lang/Object;",
"V:",
"Ljava/lang/Object;",
">",
"Ljava/lang/Object;"
}
.end annotation
# instance fields
.field private createCount:I
.field private evictionCount:I
.field private hitCount:I
.field private final map:Ljava/util/LinkedHashMap;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/LinkedHashMap",
"<TK;TV;>;"
}
.end annotation
.end field
.field private maxSize:I
.field private missCount:I
.field private putCount:I
.field private size:I
# direct methods
.method public constructor <init>(I)V
.locals 4
.parameter "maxSize"
.prologue
.line 80
.local p0, this:Landroid/util/LruCache;,"Landroid/util/LruCache<TK;TV;>;"
invoke-direct/range {p0 .. p0}, Ljava/lang/Object;-><init>()V
.line 81
if-gtz p1, :cond_0
.line 82
new-instance v0, Ljava/lang/IllegalArgumentException;
const-string v1, "maxSize <= 0"
invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw v0
.line 84
:cond_0
iput p1, p0, Landroid/util/LruCache;->maxSize:I
.line 85
new-instance v0, Ljava/util/LinkedHashMap;
const/4 v1, 0x0
const/high16 v2, 0x3f40
const/4 v3, 0x1
invoke-direct {v0, v1, v2, v3}, Ljava/util/LinkedHashMap;-><init>(IFZ)V
iput-object v0, p0, Landroid/util/LruCache;->map:Ljava/util/LinkedHashMap;
.line 86
return-void
.end method
.method private safeSizeOf(Ljava/lang/Object;Ljava/lang/Object;)I
.locals 4
.parameter
.parameter
.annotation system Ldalvik/annotation/Signature;
value = {
"(TK;TV;)I"
}
.end annotation
.prologue
.line 284
.local p0, this:Landroid/util/LruCache;,"Landroid/util/LruCache<TK;TV;>;"
.local p1, key:Ljava/lang/Object;,"TK;"
.local p2, value:Ljava/lang/Object;,"TV;"
invoke-virtual {p0, p1, p2}, Landroid/util/LruCache;->sizeOf(Ljava/lang/Object;Ljava/lang/Object;)I
move-result v0
.line 285
.local v0, result:I
if-gez v0, :cond_0
.line 286
new-instance v1, Ljava/lang/IllegalStateException;
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
const-string v3, "Negative size: "
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v2
const-string v3, "="
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v2
invoke-direct {v1, v2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v1
.line 288
:cond_0
return v0
.end method
.method private trimToSize(I)V
.locals 6
.parameter "maxSize"
.prologue
.line 196
.local p0, this:Landroid/util/LruCache;,"Landroid/util/LruCache<TK;TV;>;"
:goto_0
monitor-enter p0
.line 197
:try_start_0
iget v3, p0, Landroid/util/LruCache;->size:I
if-ltz v3, :cond_0
iget-object v3, p0, Landroid/util/LruCache;->map:Ljava/util/LinkedHashMap;
invoke-virtual {v3}, Ljava/util/LinkedHashMap;->isEmpty()Z
move-result v3
if-eqz v3, :cond_1
iget v3, p0, Landroid/util/LruCache;->size:I
if-eqz v3, :cond_1
.line 198
:cond_0
new-instance v3, Ljava/lang/IllegalStateException;
new-instance v4, Ljava/lang/StringBuilder;
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v5
invoke-virtual {v5}, Ljava/lang/Class;->getName()Ljava/lang/String;
move-result-object v5
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
const-string v5, ".sizeOf() is reporting inconsistent results!"
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v4
invoke-direct {v3, v4}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v3
.line 216
:catchall_0
move-exception v3
monitor-exit p0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw v3
.line 202
:cond_1
:try_start_1
iget v3, p0, Landroid/util/LruCache;->size:I
if-gt v3, p1, :cond_2
.line 203
monitor-exit p0
.line 220
:goto_1
return-void
.line 206
:cond_2
iget-object v3, p0, Landroid/util/LruCache;->map:Ljava/util/LinkedHashMap;
invoke-virtual {v3}, Ljava/util/LinkedHashMap;->eldest()Ljava/util/Map$Entry;
move-result-object v1
.line 207
.local v1, toEvict:Ljava/util/Map$Entry;,"Ljava/util/Map$Entry<TK;TV;>;"
if-nez v1, :cond_3
.line 208
monitor-exit p0
goto :goto_1
.line 211
:cond_3
invoke-interface {v1}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
move-result-object v0
.line 212
.local v0, key:Ljava/lang/Object;,"TK;"
invoke-interface {v1}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
move-result-object v2
.line 213
.local v2, value:Ljava/lang/Object;,"TV;"
iget-object v3, p0, Landroid/util/LruCache;->map:Ljava/util/LinkedHashMap;
invoke-virtual {v3, v0}, Ljava/util/LinkedHashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
.line 214
iget v3, p0, Landroid/util/LruCache;->size:I
invoke-direct {p0, v0, v2}, Landroid/util/LruCache;->safeSizeOf(Ljava/lang/Object;Ljava/lang/Object;)I
move-result v4
sub-int/2addr v3, v4
iput v3, p0, Landroid/util/LruCache;->size:I
.line 215
iget v3, p0, Landroid/util/LruCache;->evictionCount:I
add-int/lit8 v3, v3, 0x1
iput v3, p0, Landroid/util/LruCache;->evictionCount:I
.line 216
monitor-exit p0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
.line 218
const/4 v3, 0x1
const/4 v4, 0x0
invoke-virtual {p0, v3, v0, v2, v4}, Landroid/util/LruCache;->entryRemoved(ZLjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V
goto :goto_0
.end method
# virtual methods
.method protected create(Ljava/lang/Object;)Ljava/lang/Object;
.locals 1
.parameter
.annotation system Ldalvik/annotation/Signature;
value = {
"(TK;)TV;"
}
.end annotation
.prologue
.line 280
.local p0, this:Landroid/util/LruCache;,"Landroid/util/LruCache<TK;TV;>;"
.local p1, key:Ljava/lang/Object;,"TK;"
const/4 v0, 0x0
return-object v0
.end method
.method public final declared-synchronized createCount()I
.locals 1
.prologue
.line 347
.local p0, this:Landroid/util/LruCache;,"Landroid/util/LruCache<TK;TV;>;"
monitor-enter p0
:try_start_0
iget v0, p0, Landroid/util/LruCache;->createCount:I
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
monitor-exit p0
return v0
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.end method
.method protected entryRemoved(ZLjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V
.locals 0
.parameter "evicted"
.parameter
.parameter
.parameter
.annotation system Ldalvik/annotation/Signature;
value = {
"(ZTK;TV;TV;)V"
}
.end annotation
.prologue
.line 262
.local p0, this:Landroid/util/LruCache;,"Landroid/util/LruCache<TK;TV;>;"
.local p2, key:Ljava/lang/Object;,"TK;"
.local p3, oldValue:Ljava/lang/Object;,"TV;"
.local p4, newValue:Ljava/lang/Object;,"TV;"
return-void
.end method
.method public final evictAll()V
.locals 1
.prologue
.line 306
.local p0, this:Landroid/util/LruCache;,"Landroid/util/LruCache<TK;TV;>;"
const/4 v0, -0x1
invoke-direct {p0, v0}, Landroid/util/LruCache;->trimToSize(I)V
.line 307
return-void
.end method
.method public final declared-synchronized evictionCount()I
.locals 1
.prologue
.line 361
.local p0, this:Landroid/util/LruCache;,"Landroid/util/LruCache<TK;TV;>;"
monitor-enter p0
:try_start_0
iget v0, p0, Landroid/util/LruCache;->evictionCount:I
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
monitor-exit p0
return v0
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.end method
.method public final get(Ljava/lang/Object;)Ljava/lang/Object;
.locals 4
.parameter
.annotation system Ldalvik/annotation/Signature;
value = {
"(TK;)TV;"
}
.end annotation
.prologue
.line 112
.local p0, this:Landroid/util/LruCache;,"Landroid/util/LruCache<TK;TV;>;"
.local p1, key:Ljava/lang/Object;,"TK;"
if-nez p1, :cond_0
.line 113
new-instance v2, Ljava/lang/NullPointerException;
const-string v3, "key == null"
invoke-direct {v2, v3}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
throw v2
.line 117
:cond_0
monitor-enter p0
.line 118
:try_start_0
iget-object v2, p0, Landroid/util/LruCache;->map:Ljava/util/LinkedHashMap;
invoke-virtual {v2, p1}, Ljava/util/LinkedHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v1
.line 119
.local v1, mapValue:Ljava/lang/Object;,"TV;"
if-eqz v1, :cond_1
.line 120
iget v2, p0, Landroid/util/LruCache;->hitCount:I
add-int/lit8 v2, v2, 0x1
iput v2, p0, Landroid/util/LruCache;->hitCount:I
.line 121
monitor-exit p0
move-object v0, v1
.line 155
:goto_0
return-object v0
.line 123
:cond_1
iget v2, p0, Landroid/util/LruCache;->missCount:I
add-int/lit8 v2, v2, 0x1
iput v2, p0, Landroid/util/LruCache;->missCount:I
.line 124
monitor-exit p0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 133
invoke-virtual {p0, p1}, Landroid/util/LruCache;->create(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
.line 134
.local v0, createdValue:Ljava/lang/Object;,"TV;"
if-nez v0, :cond_2
.line 135
const/4 v0, 0x0
goto :goto_0
.line 124
.end local v0 #createdValue:Ljava/lang/Object;,"TV;"
.end local v1 #mapValue:Ljava/lang/Object;,"TV;"
:catchall_0
move-exception v2
:try_start_1
monitor-exit p0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
throw v2
.line 138
.restart local v0 #createdValue:Ljava/lang/Object;,"TV;"
.restart local v1 #mapValue:Ljava/lang/Object;,"TV;"
:cond_2
monitor-enter p0
.line 139
:try_start_2
iget v2, p0, Landroid/util/LruCache;->createCount:I
add-int/lit8 v2, v2, 0x1
iput v2, p0, Landroid/util/LruCache;->createCount:I
.line 140
iget-object v2, p0, Landroid/util/LruCache;->map:Ljava/util/LinkedHashMap;
invoke-virtual {v2, p1, v0}, Ljava/util/LinkedHashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v1
.line 142
if-eqz v1, :cond_3
.line 144
iget-object v2, p0, Landroid/util/LruCache;->map:Ljava/util/LinkedHashMap;
invoke-virtual {v2, p1, v1}, Ljava/util/LinkedHashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 148
:goto_1
monitor-exit p0
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_1
.line 150
if-eqz v1, :cond_4
.line 151
const/4 v2, 0x0
invoke-virtual {p0, v2, p1, v0, v1}, Landroid/util/LruCache;->entryRemoved(ZLjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V
move-object v0, v1
.line 152
goto :goto_0
.line 146
:cond_3
:try_start_3
iget v2, p0, Landroid/util/LruCache;->size:I
invoke-direct {p0, p1, v0}, Landroid/util/LruCache;->safeSizeOf(Ljava/lang/Object;Ljava/lang/Object;)I
move-result v3
add-int/2addr v2, v3
iput v2, p0, Landroid/util/LruCache;->size:I
goto :goto_1
.line 148
:catchall_1
move-exception v2
monitor-exit p0
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_1
throw v2
.line 154
:cond_4
iget v2, p0, Landroid/util/LruCache;->maxSize:I
invoke-direct {p0, v2}, Landroid/util/LruCache;->trimToSize(I)V
goto :goto_0
.end method
.method public final declared-synchronized hitCount()I
.locals 1
.prologue
.line 332
.local p0, this:Landroid/util/LruCache;,"Landroid/util/LruCache<TK;TV;>;"
monitor-enter p0
:try_start_0
iget v0, p0, Landroid/util/LruCache;->hitCount:I
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
monitor-exit p0
return v0
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.end method
.method public final declared-synchronized maxSize()I
.locals 1
.prologue
.line 324
.local p0, this:Landroid/util/LruCache;,"Landroid/util/LruCache<TK;TV;>;"
monitor-enter p0
:try_start_0
iget v0, p0, Landroid/util/LruCache;->maxSize:I
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
monitor-exit p0
return v0
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.end method
.method public final declared-synchronized missCount()I
.locals 1
.prologue
.line 340
.local p0, this:Landroid/util/LruCache;,"Landroid/util/LruCache<TK;TV;>;"
monitor-enter p0
:try_start_0
iget v0, p0, Landroid/util/LruCache;->missCount:I
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
monitor-exit p0
return v0
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.end method
.method public final put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.locals 3
.parameter
.parameter
.annotation system Ldalvik/annotation/Signature;
value = {
"(TK;TV;)TV;"
}
.end annotation
.prologue
.line 166
.local p0, this:Landroid/util/LruCache;,"Landroid/util/LruCache<TK;TV;>;"
.local p1, key:Ljava/lang/Object;,"TK;"
.local p2, value:Ljava/lang/Object;,"TV;"
if-eqz p1, :cond_0
if-nez p2, :cond_1
.line 167
:cond_0
new-instance v1, Ljava/lang/NullPointerException;
const-string v2, "key == null || value == null"
invoke-direct {v1, v2}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
throw v1
.line 171
:cond_1
monitor-enter p0
.line 172
:try_start_0
iget v1, p0, Landroid/util/LruCache;->putCount:I
add-int/lit8 v1, v1, 0x1
iput v1, p0, Landroid/util/LruCache;->putCount:I
.line 173
iget v1, p0, Landroid/util/LruCache;->size:I
invoke-direct {p0, p1, p2}, Landroid/util/LruCache;->safeSizeOf(Ljava/lang/Object;Ljava/lang/Object;)I
move-result v2
add-int/2addr v1, v2
iput v1, p0, Landroid/util/LruCache;->size:I
.line 174
iget-object v1, p0, Landroid/util/LruCache;->map:Ljava/util/LinkedHashMap;
invoke-virtual {v1, p1, p2}, Ljava/util/LinkedHashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
.line 175
.local v0, previous:Ljava/lang/Object;,"TV;"
if-eqz v0, :cond_2
.line 176
iget v1, p0, Landroid/util/LruCache;->size:I
invoke-direct {p0, p1, v0}, Landroid/util/LruCache;->safeSizeOf(Ljava/lang/Object;Ljava/lang/Object;)I
move-result v2
sub-int/2addr v1, v2
iput v1, p0, Landroid/util/LruCache;->size:I
.line 178
:cond_2
monitor-exit p0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 180
if-eqz v0, :cond_3
.line 181
const/4 v1, 0x0
invoke-virtual {p0, v1, p1, v0, p2}, Landroid/util/LruCache;->entryRemoved(ZLjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V
.line 184
:cond_3
iget v1, p0, Landroid/util/LruCache;->maxSize:I
invoke-direct {p0, v1}, Landroid/util/LruCache;->trimToSize(I)V
.line 185
return-object v0
.line 178
.end local v0 #previous:Ljava/lang/Object;,"TV;"
:catchall_0
move-exception v1
:try_start_1
monitor-exit p0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
throw v1
.end method
.method public final declared-synchronized putCount()I
.locals 1
.prologue
.line 354
.local p0, this:Landroid/util/LruCache;,"Landroid/util/LruCache<TK;TV;>;"
monitor-enter p0
:try_start_0
iget v0, p0, Landroid/util/LruCache;->putCount:I
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
monitor-exit p0
return v0
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.end method
.method public final remove(Ljava/lang/Object;)Ljava/lang/Object;
.locals 3
.parameter
.annotation system Ldalvik/annotation/Signature;
value = {
"(TK;)TV;"
}
.end annotation
.prologue
.line 228
.local p0, this:Landroid/util/LruCache;,"Landroid/util/LruCache<TK;TV;>;"
.local p1, key:Ljava/lang/Object;,"TK;"
if-nez p1, :cond_0
.line 229
new-instance v1, Ljava/lang/NullPointerException;
const-string v2, "key == null"
invoke-direct {v1, v2}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
throw v1
.line 233
:cond_0
monitor-enter p0
.line 234
:try_start_0
iget-object v1, p0, Landroid/util/LruCache;->map:Ljava/util/LinkedHashMap;
invoke-virtual {v1, p1}, Ljava/util/LinkedHashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
.line 235
.local v0, previous:Ljava/lang/Object;,"TV;"
if-eqz v0, :cond_1
.line 236
iget v1, p0, Landroid/util/LruCache;->size:I
invoke-direct {p0, p1, v0}, Landroid/util/LruCache;->safeSizeOf(Ljava/lang/Object;Ljava/lang/Object;)I
move-result v2
sub-int/2addr v1, v2
iput v1, p0, Landroid/util/LruCache;->size:I
.line 238
:cond_1
monitor-exit p0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 240
if-eqz v0, :cond_2
.line 241
const/4 v1, 0x0
const/4 v2, 0x0
invoke-virtual {p0, v1, p1, v0, v2}, Landroid/util/LruCache;->entryRemoved(ZLjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V
.line 244
:cond_2
return-object v0
.line 238
.end local v0 #previous:Ljava/lang/Object;,"TV;"
:catchall_0
move-exception v1
:try_start_1
monitor-exit p0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
throw v1
.end method
.method public resize(I)V
.locals 2
.parameter "maxSize"
.prologue
.line 95
.local p0, this:Landroid/util/LruCache;,"Landroid/util/LruCache<TK;TV;>;"
if-gtz p1, :cond_0
.line 96
new-instance v0, Ljava/lang/IllegalArgumentException;
const-string v1, "maxSize <= 0"
invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw v0
.line 99
:cond_0
monitor-enter p0
.line 100
:try_start_0
iput p1, p0, Landroid/util/LruCache;->maxSize:I
.line 101
monitor-exit p0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 102
invoke-direct {p0, p1}, Landroid/util/LruCache;->trimToSize(I)V
.line 103
return-void
.line 101
:catchall_0
move-exception v0
:try_start_1
monitor-exit p0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
throw v0
.end method
.method public final declared-synchronized size()I
.locals 1
.prologue
.line 315
.local p0, this:Landroid/util/LruCache;,"Landroid/util/LruCache<TK;TV;>;"
monitor-enter p0
:try_start_0
iget v0, p0, Landroid/util/LruCache;->size:I
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
monitor-exit p0
return v0
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.end method
.method protected sizeOf(Ljava/lang/Object;Ljava/lang/Object;)I
.locals 1
.parameter
.parameter
.annotation system Ldalvik/annotation/Signature;
value = {
"(TK;TV;)I"
}
.end annotation
.prologue
.line 299
.local p0, this:Landroid/util/LruCache;,"Landroid/util/LruCache<TK;TV;>;"
.local p1, key:Ljava/lang/Object;,"TK;"
.local p2, value:Ljava/lang/Object;,"TV;"
const/4 v0, 0x1
return v0
.end method
.method public final declared-synchronized snapshot()Ljava/util/Map;
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Ljava/util/Map",
"<TK;TV;>;"
}
.end annotation
.prologue
.line 369
.local p0, this:Landroid/util/LruCache;,"Landroid/util/LruCache<TK;TV;>;"
monitor-enter p0
:try_start_0
new-instance v0, Ljava/util/LinkedHashMap;
iget-object v1, p0, Landroid/util/LruCache;->map:Ljava/util/LinkedHashMap;
invoke-direct {v0, v1}, Ljava/util/LinkedHashMap;-><init>(Ljava/util/Map;)V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
monitor-exit p0
return-object v0
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.end method
.method public final declared-synchronized toString()Ljava/lang/String;
.locals 6
.prologue
.local p0, this:Landroid/util/LruCache;,"Landroid/util/LruCache<TK;TV;>;"
const/4 v1, 0x0
.line 373
monitor-enter p0
:try_start_0
iget v2, p0, Landroid/util/LruCache;->hitCount:I
iget v3, p0, Landroid/util/LruCache;->missCount:I
add-int v0, v2, v3
.line 374
.local v0, accesses:I
if-eqz v0, :cond_0
iget v2, p0, Landroid/util/LruCache;->hitCount:I
mul-int/lit8 v2, v2, 0x64
div-int v1, v2, v0
.line 375
.local v1, hitPercent:I
:cond_0
const-string v2, "LruCache[maxSize=%d,hits=%d,misses=%d,hitRate=%d%%]"
const/4 v3, 0x4
new-array v3, v3, [Ljava/lang/Object;
const/4 v4, 0x0
iget v5, p0, Landroid/util/LruCache;->maxSize:I
invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v5
aput-object v5, v3, v4
const/4 v4, 0x1
iget v5, p0, Landroid/util/LruCache;->hitCount:I
invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v5
aput-object v5, v3, v4
const/4 v4, 0x2
iget v5, p0, Landroid/util/LruCache;->missCount:I
invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v5
aput-object v5, v3, v4
const/4 v4, 0x3
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v5
aput-object v5, v3, v4
invoke-static {v2, v3}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
move-result-object v2
monitor-exit p0
return-object v2
.line 373
.end local v0 #accesses:I
.end local v1 #hitPercent:I
:catchall_0
move-exception v2
monitor-exit p0
throw v2
.end method
| {
"content_hash": "534b4905195c8b38fe286d8a1d0460b8",
"timestamp": "",
"source": "github",
"line_count": 1104,
"max_line_length": 136,
"avg_line_length": 21.85054347826087,
"alnum_prop": 0.6417941383741658,
"repo_name": "baidurom/devices-n7108",
"id": "acf095f27de6745202bb13b70dbfdb23efb08342",
"size": "24123",
"binary": false,
"copies": "2",
"ref": "refs/heads/coron-4.1",
"path": "framework.jar.out/smali/android/util/LruCache.smali",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Makefile",
"bytes": "12697"
},
{
"name": "Shell",
"bytes": "1974"
}
],
"symlink_target": ""
} |
Collocation
===========
.. doxygengroup:: harp_collocation
:project: libharp
:members:
| {
"content_hash": "fb4d1ab00fc127973e96555cccc3e174",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 34,
"avg_line_length": 13.571428571428571,
"alnum_prop": 0.6210526315789474,
"repo_name": "stcorp/harp",
"id": "28d0c1db51b7cee54e19dcb6c342ed886fcb3a98",
"size": "95",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "doc/libharp_collocation.rst",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "8034482"
},
{
"name": "C++",
"bytes": "49077"
},
{
"name": "CMake",
"bytes": "98451"
},
{
"name": "Lex",
"bytes": "17675"
},
{
"name": "M4",
"bytes": "26316"
},
{
"name": "MATLAB",
"bytes": "2379"
},
{
"name": "Makefile",
"bytes": "86352"
},
{
"name": "Python",
"bytes": "89089"
},
{
"name": "R",
"bytes": "520"
},
{
"name": "Shell",
"bytes": "2555"
},
{
"name": "Yacc",
"bytes": "77754"
}
],
"symlink_target": ""
} |
package com.hantsylabs.restexample.springmvc.api;
import com.hantsylabs.restexample.springmvc.ApiErrors;
import com.hantsylabs.restexample.springmvc.exception.InvalidRequestException;
import com.hantsylabs.restexample.springmvc.exception.ResourceNotFoundException;
import com.hantsylabs.restexample.springmvc.exception.UsernameAlreadyUsedException;
import com.hantsylabs.restexample.springmvc.model.ResponseMessage;
import java.util.List;
import javax.inject.Inject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.MessageSource;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.context.request.WebRequest;
/**
* Called when an exception occurs during request processing. Transforms exception message into JSON format.
*/
@RestControllerAdvice()
public class RestExceptionHandler {
private static final Logger log = LoggerFactory.getLogger(RestExceptionHandler.class);
@Inject
private MessageSource messageSource;
@ExceptionHandler(value = {Exception.class, RuntimeException.class})
//@ResponseBody
public ResponseEntity<ResponseMessage> handleGenericException(Exception ex, WebRequest request) {
if (log.isDebugEnabled()) {
log.debug("handling exception...");
}
return new ResponseEntity<>(new ResponseMessage(ResponseMessage.Type.danger, ex.getMessage()), HttpStatus.BAD_REQUEST);
}
@ExceptionHandler(value = {ResourceNotFoundException.class})
//@ResponseBody
public ResponseEntity<ResponseMessage> handleResourceNotFoundException(ResourceNotFoundException ex, WebRequest request) {
if (log.isDebugEnabled()) {
log.debug("handling ResourceNotFoundException...");
}
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
}
@ExceptionHandler(value = {UsernameAlreadyUsedException.class})
//@ResponseBody
public ResponseEntity<ResponseMessage> handleUsernameExistedException(UsernameAlreadyUsedException ex, WebRequest request) {
if (log.isDebugEnabled()) {
log.debug("handling UsernameExistedException...");
}
ResponseMessage error = ResponseMessage.danger("username existed.");
return new ResponseEntity<>(error, HttpStatus.BAD_REQUEST);
}
@ExceptionHandler(value = {InvalidRequestException.class})
//@ResponseBody
public ResponseEntity<ResponseMessage> handleInvalidRequestException(InvalidRequestException ex, WebRequest req) {
if (log.isDebugEnabled()) {
log.debug("handling InvalidRequestException...");
}
ResponseMessage alert = new ResponseMessage(
ResponseMessage.Type.danger,
ApiErrors.INVALID_REQUEST,
messageSource.getMessage(ApiErrors.INVALID_REQUEST, new String[]{}, null));
BindingResult result = ex.getErrors();
List<FieldError> fieldErrors = result.getFieldErrors();
if (!fieldErrors.isEmpty()) {
fieldErrors.stream().forEach((e) -> {
alert.addError(e.getField(), e.getCode(), e.getDefaultMessage());
});
}
return new ResponseEntity<>(alert, HttpStatus.UNPROCESSABLE_ENTITY);
}
}
| {
"content_hash": "8f7d09f809b7cd70f26e0360820d4914",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 128,
"avg_line_length": 41.160919540229884,
"alnum_prop": 0.7400167550963418,
"repo_name": "hantsy/angularjs-springmvc-sample-boot",
"id": "4e598d5357820a9d260a700d6e17150bb7dd2c04",
"size": "3581",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/hantsylabs/restexample/springmvc/api/RestExceptionHandler.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "517"
},
{
"name": "Dockerfile",
"bytes": "852"
},
{
"name": "HTML",
"bytes": "44598"
},
{
"name": "Java",
"bytes": "121071"
},
{
"name": "JavaScript",
"bytes": "36180"
}
],
"symlink_target": ""
} |
require "compadre/engine"
module Compadre
def self.configure
yield self
end
def self.resource_name
(@resource_name || "user").split("_").map(&:capitalize).join("")
end
def self.resource_name=(resource_name)
@resource_name = resource_name
end
end
| {
"content_hash": "3ba77e93778e3ecd4fedeb915ed805de",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 68,
"avg_line_length": 18.2,
"alnum_prop": 0.673992673992674,
"repo_name": "essn/compadre",
"id": "b011fb541feefce87f7cb4907d992970e1b9644b",
"size": "273",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/compadre.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1372"
},
{
"name": "HTML",
"bytes": "5135"
},
{
"name": "JavaScript",
"bytes": "1192"
},
{
"name": "Ruby",
"bytes": "33091"
}
],
"symlink_target": ""
} |
import nose
import nose.config
import sys
from nose.plugins.manager import DefaultPluginManager
c = nose.config.Config()
c.plugins=DefaultPluginManager()
c.srcDirs = ['package']
if not nose.run(config=c):
sys.exit(1)
| {
"content_hash": "f8ccf00ea1a479cf935c80c2c4799f85",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 53,
"avg_line_length": 24.555555555555557,
"alnum_prop": 0.7692307692307693,
"repo_name": "QualiSystems/Azure-Shell",
"id": "4603b5825375bef098ce51681e7fc427691dbcbc",
"size": "221",
"binary": false,
"copies": "5",
"ref": "refs/heads/develop",
"path": "runtests.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "906"
},
{
"name": "Python",
"bytes": "654779"
},
{
"name": "Shell",
"bytes": "616"
}
],
"symlink_target": ""
} |
<resources>
<string name="app_name">Fruity Slots Galaxy</string>
<!-- MAIN MENU SCREEN -->
<string name="main_game_title_part1">Fruity Slots</string>
<string name="main_game_title_part2">Galaxy</string>
<string name="main_begin">Start</string>
<string name="main_best_score">High Score</string>
<string name="main_credits">Credits</string>
<string name="main_exit">Exit</string>
<!-- CREDITS -->
<string name="credits_text">
Music:\n
Randall Jones and\nDave Dimes - Lousy Town\n
\n \n
Sounds:\n
www.littlerobotsoundfactory.com\n
\n \n
Game by:\n
Torin Dmitry\n
\n \n
For any question:\n
torindvl@gmail.com\n
</string>
<!-- BEST SCORE -->
<string name="best_screen_title">High score:</string>
<!-- GAME SCREEN -->
<string name="game_best_score">Best</string>
<string name="game_current_score">Cash</string>
<string name="game_bet_str">Your bet</string>
<!-- LOSE SCREEN -->
<string name="lose_blin_label_1">CASH 0</string>
<string name="lose_blin_label_2">INSERT</string>
<string name="lose_blin_label_3">COINS</string>
<string name="lose_best_cash">Best cash</string>
<string name="lose_retry">Retry?</string>
<!-- JACKPOT SCREEN -->
<string name="jackpot_string">JACKPOT</string>
</resources>
| {
"content_hash": "28a23b8f27bda42d7291514c9252ca8e",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 62,
"avg_line_length": 30,
"alnum_prop": 0.5888888888888889,
"repo_name": "torindev/games",
"id": "d478a443ea719e2b82ec2417b3287a47b01c4834",
"size": "1440",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "FruitSlots/app/src/main/res/values/strings.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "37770"
},
{
"name": "Java",
"bytes": "275369"
}
],
"symlink_target": ""
} |
package io.airlift.jmx;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.ImmutableSortedSet;
import com.google.common.collect.Iterators;
import com.google.common.collect.Multimap;
import com.google.inject.Inject;
import com.google.inject.Injector;
import org.weakref.jmx.Managed;
import javax.management.MBeanServer;
import javax.management.ObjectInstance;
import java.lang.management.ManagementFactory;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Collection;
import java.util.Iterator;
import java.util.Set;
public class JmxInspector
implements Iterable<JmxInspector.InspectorRecord>
{
private final ImmutableSortedSet<InspectorRecord> inspectorRecords;
public enum Types
{
ATTRIBUTE,
ACTION
}
public static class InspectorRecord implements Comparable<InspectorRecord>
{
public final String className;
public final String objectName;
public final String description;
public final Types type;
@Override
public boolean equals(Object o)
{
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
InspectorRecord that = (InspectorRecord) o;
if (className != null ? !className.equals(that.className) : that.className != null) {
return false;
}
if (objectName != null ? !objectName.equals(that.objectName) : that.objectName != null) {
return false;
}
return true;
}
@Override
public int hashCode()
{
return className.hashCode();
}
@Override
public int compareTo(InspectorRecord rhs)
{
int diff = objectName.compareTo(rhs.objectName);
return (diff != 0) ? diff : className.compareTo(rhs.className);
}
private InspectorRecord(String className, String objectName, String description, Types type)
{
this.className = className;
this.objectName = objectName;
this.description = description;
this.type = type;
}
}
@Inject
public JmxInspector(Injector injector)
throws Exception
{
MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
Set<ObjectInstance> instances = mBeanServer.queryMBeans(null, null);
Multimap<String, String> nameMap = ArrayListMultimap.create();
for (ObjectInstance i : instances) {
nameMap.put(i.getClassName(), i.getObjectName().getCanonicalName());
}
ImmutableSortedSet.Builder<InspectorRecord> builder = ImmutableSortedSet.naturalOrder();
GuiceInjectorIterator injectorIterator = new GuiceInjectorIterator(injector);
for (Class<?> clazz : injectorIterator) {
addConfig(nameMap, clazz, builder);
}
inspectorRecords = builder.build();
}
@Override
public Iterator<InspectorRecord> iterator()
{
return Iterators.unmodifiableIterator(inspectorRecords.iterator());
}
private void addConfig(Multimap<String, String> nameMap, Class<?> clazz, ImmutableSortedSet.Builder<InspectorRecord> builder)
throws InvocationTargetException, IllegalAccessException
{
Collection<String> thisNameList = nameMap.get(clazz.getName());
if (thisNameList != null) {
for (Method method : clazz.getMethods()) {
Managed configAnnotation = method.getAnnotation(Managed.class);
if (configAnnotation != null) {
for (String thisName : thisNameList) {
builder.add(new InspectorRecord(thisName, method.getName(), configAnnotation.description(), getType(method)));
}
}
}
}
}
private Types getType(Method method)
{
if (method.getReturnType() == Void.TYPE) {
return Types.ACTION;
}
if (method.getParameterTypes().length > 0) {
return Types.ACTION;
}
else {
return Types.ATTRIBUTE;
}
}
}
| {
"content_hash": "9db32d62b2d4e7d853477ba82960eb35",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 134,
"avg_line_length": 31.194244604316548,
"alnum_prop": 0.6199261992619927,
"repo_name": "cberner/airlift",
"id": "6de005dde6bc104b36bee652a1f10a6a8c6f5168",
"size": "4935",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "jmx/src/main/java/io/airlift/jmx/JmxInspector.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "27890"
},
{
"name": "Java",
"bytes": "2137999"
},
{
"name": "Python",
"bytes": "13762"
},
{
"name": "Shell",
"bytes": "1450"
}
],
"symlink_target": ""
} |
package org.apache.phoenix.jdbc;
import java.io.InputStream;
import java.io.Reader;
import java.math.BigDecimal;
import java.net.MalformedURLException;
import java.net.URL;
import java.sql.Array;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Date;
import java.sql.NClob;
import java.sql.Ref;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.RowId;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.sql.SQLWarning;
import java.sql.SQLXML;
import java.sql.Time;
import java.sql.Timestamp;
import java.text.Format;
import java.util.Calendar;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
import org.apache.phoenix.compile.ColumnProjector;
import org.apache.phoenix.compile.RowProjector;
import org.apache.phoenix.compile.StatementContext;
import org.apache.phoenix.exception.SQLExceptionCode;
import org.apache.phoenix.exception.SQLExceptionInfo;
import org.apache.phoenix.iterate.ResultIterator;
import org.apache.phoenix.monitoring.OverAllQueryMetrics;
import org.apache.phoenix.monitoring.ReadMetricQueue;
import org.apache.phoenix.schema.tuple.ResultTuple;
import org.apache.phoenix.schema.tuple.Tuple;
import org.apache.phoenix.schema.types.PBoolean;
import org.apache.phoenix.schema.types.PDataType;
import org.apache.phoenix.schema.types.PDate;
import org.apache.phoenix.schema.types.PDecimal;
import org.apache.phoenix.schema.types.PDouble;
import org.apache.phoenix.schema.types.PFloat;
import org.apache.phoenix.schema.types.PInteger;
import org.apache.phoenix.schema.types.PLong;
import org.apache.phoenix.schema.types.PSmallint;
import org.apache.phoenix.schema.types.PTime;
import org.apache.phoenix.schema.types.PTimestamp;
import org.apache.phoenix.schema.types.PTinyint;
import org.apache.phoenix.schema.types.PVarbinary;
import org.apache.phoenix.schema.types.PVarchar;
import org.apache.phoenix.util.SQLCloseable;
import com.google.common.annotations.VisibleForTesting;
/**
*
* JDBC ResultSet implementation of Phoenix.
* Currently only the following data types are supported:
* - String
* - Date
* - Time
* - Timestamp
* - BigDecimal
* - Double
* - Float
* - Int
* - Short
* - Long
* - Binary
* - Array - 1D
* None of the update or delete methods are supported.
* The ResultSet only supports the following options:
* - ResultSet.FETCH_FORWARD
* - ResultSet.CONCUR_READ_ONLY
* - ResultSet.TYPE_FORWARD_ONLY
* - ResultSet.CLOSE_CURSORS_AT_COMMIT
*
*
* @since 0.1
*/
public class PhoenixResultSet implements ResultSet, SQLCloseable, org.apache.phoenix.jdbc.Jdbc7Shim.ResultSet {
private static final Log LOG = LogFactory.getLog(PhoenixResultSet.class);
private final static String STRING_FALSE = "0";
private final static BigDecimal BIG_DECIMAL_FALSE = BigDecimal.valueOf(0);
private final static Integer INTEGER_FALSE = Integer.valueOf(0);
private final static Tuple BEFORE_FIRST = new ResultTuple();
private final ResultIterator scanner;
private final RowProjector rowProjector;
private final PhoenixStatement statement;
private final StatementContext context;
private final ReadMetricQueue readMetricsQueue;
private final OverAllQueryMetrics overAllQueryMetrics;
private final ImmutableBytesWritable ptr = new ImmutableBytesWritable();
private Tuple currentRow = BEFORE_FIRST;
private boolean isClosed = false;
private boolean wasNull = false;
private boolean firstRecordRead = false;
public PhoenixResultSet(ResultIterator resultIterator, RowProjector rowProjector, StatementContext ctx) throws SQLException {
this.rowProjector = rowProjector;
this.scanner = resultIterator;
this.context = ctx;
this.statement = context.getStatement();
this.readMetricsQueue = context.getReadMetricsQueue();
this.overAllQueryMetrics = context.getOverallQueryMetrics();
}
@Override
public boolean absolute(int row) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void afterLast() throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void beforeFirst() throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void cancelRowUpdates() throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void clearWarnings() throws SQLException {
}
@Override
public void close() throws SQLException {
if (isClosed) { return; }
try {
scanner.close();
} finally {
isClosed = true;
statement.getResultSets().remove(this);
overAllQueryMetrics.endQuery();
overAllQueryMetrics.stopResultSetWatch();
}
}
@Override
public void deleteRow() throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public int findColumn(String columnLabel) throws SQLException {
Integer index = rowProjector.getColumnIndex(columnLabel);
return index + 1;
}
@Override
public boolean first() throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public Array getArray(int columnIndex) throws SQLException {
checkCursorState();
// Get the value using the expected type instead of trying to coerce to VARCHAR.
// We can't coerce using our formatter because we don't have enough context in PDataType.
ColumnProjector projector = rowProjector.getColumnProjector(columnIndex-1);
Array value = (Array)projector.getValue(currentRow, projector.getExpression().getDataType(), ptr);
wasNull = (value == null);
return value;
}
@Override
public Array getArray(String columnLabel) throws SQLException {
return getArray(findColumn(columnLabel));
}
@Override
public InputStream getAsciiStream(int columnIndex) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public InputStream getAsciiStream(String columnLabel) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
private void checkOpen() throws SQLException {
if (isClosed) {
throw new SQLExceptionInfo.Builder(SQLExceptionCode.RESULTSET_CLOSED).build().buildException();
}
}
private void checkCursorState() throws SQLException {
checkOpen();
if (currentRow == BEFORE_FIRST) {
throw new SQLExceptionInfo.Builder(SQLExceptionCode.CURSOR_BEFORE_FIRST_ROW).build().buildException();
}else if (currentRow == null) {
throw new SQLExceptionInfo.Builder(SQLExceptionCode.CURSOR_PAST_LAST_ROW).build().buildException();
}
}
@Override
public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
checkCursorState();
BigDecimal value = (BigDecimal)rowProjector.getColumnProjector(columnIndex-1).getValue(currentRow,
PDecimal.INSTANCE, ptr);
wasNull = (value == null);
return value;
}
@Override
public BigDecimal getBigDecimal(String columnLabel) throws SQLException {
return getBigDecimal(findColumn(columnLabel));
}
@Override
public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
BigDecimal value = getBigDecimal(columnIndex);
if (wasNull) {
return null;
}
return value.setScale(scale);
}
@Override
public BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException {
return getBigDecimal(findColumn(columnLabel), scale);
}
@Override
public InputStream getBinaryStream(int columnIndex) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public InputStream getBinaryStream(String columnLabel) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public Blob getBlob(int columnIndex) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public Blob getBlob(String columnLabel) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public boolean getBoolean(int columnIndex) throws SQLException {
checkCursorState();
ColumnProjector colProjector = rowProjector.getColumnProjector(columnIndex-1);
PDataType type = colProjector.getExpression().getDataType();
Object value = colProjector.getValue(currentRow, type, ptr);
wasNull = (value == null);
if (value == null) {
return false;
}
if (type == PBoolean.INSTANCE) {
return Boolean.TRUE.equals(value);
} else if (type == PVarchar.INSTANCE) {
return !STRING_FALSE.equals(value);
} else if (type == PInteger.INSTANCE) {
return !INTEGER_FALSE.equals(value);
} else if (type == PDecimal.INSTANCE) {
return !BIG_DECIMAL_FALSE.equals(value);
} else {
throw new SQLExceptionInfo.Builder(SQLExceptionCode.CANNOT_CALL_METHOD_ON_TYPE)
.setMessage("Method: getBoolean; Type:" + type).build().buildException();
}
}
@Override
public boolean getBoolean(String columnLabel) throws SQLException {
return getBoolean(findColumn(columnLabel));
}
@Override
public byte[] getBytes(int columnIndex) throws SQLException {
checkCursorState();
byte[] value = (byte[])rowProjector.getColumnProjector(columnIndex-1).getValue(currentRow,
PVarbinary.INSTANCE, ptr);
wasNull = (value == null);
return value;
}
@Override
public byte[] getBytes(String columnLabel) throws SQLException {
return getBytes(findColumn(columnLabel));
}
@Override
public byte getByte(int columnIndex) throws SQLException {
// throw new SQLFeatureNotSupportedException();
checkCursorState();
Byte value = (Byte)rowProjector.getColumnProjector(columnIndex-1).getValue(currentRow,
PTinyint.INSTANCE, ptr);
wasNull = (value == null);
if (value == null) {
return 0;
}
return value;
}
@Override
public byte getByte(String columnLabel) throws SQLException {
return getByte(findColumn(columnLabel));
}
@Override
public Reader getCharacterStream(int columnIndex) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public Reader getCharacterStream(String columnLabel) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public Clob getClob(int columnIndex) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public Clob getClob(String columnLabel) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public int getConcurrency() throws SQLException {
return ResultSet.CONCUR_READ_ONLY;
}
@Override
public String getCursorName() throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public Date getDate(int columnIndex) throws SQLException {
checkCursorState();
Date value = (Date)rowProjector.getColumnProjector(columnIndex-1).getValue(currentRow,
PDate.INSTANCE, ptr);
wasNull = (value == null);
if (value == null) {
return null;
}
return value;
}
@Override
public Date getDate(String columnLabel) throws SQLException {
return getDate(findColumn(columnLabel));
}
@Override
public Date getDate(int columnIndex, Calendar cal) throws SQLException {
checkCursorState();
Date value = (Date)rowProjector.getColumnProjector(columnIndex-1).getValue(currentRow,
PDate.INSTANCE, ptr);
wasNull = (value == null);
if (wasNull) {
return null;
}
cal.setTime(value);
return new Date(cal.getTimeInMillis());
}
@Override
public Date getDate(String columnLabel, Calendar cal) throws SQLException {
return getDate(findColumn(columnLabel), cal);
}
@Override
public double getDouble(int columnIndex) throws SQLException {
checkCursorState();
Double value = (Double)rowProjector.getColumnProjector(columnIndex-1).getValue(currentRow,
PDouble.INSTANCE, ptr);
wasNull = (value == null);
if (value == null) {
return 0;
}
return value;
}
@Override
public double getDouble(String columnLabel) throws SQLException {
return getDouble(findColumn(columnLabel));
}
@Override
public int getFetchDirection() throws SQLException {
return ResultSet.FETCH_FORWARD;
}
@Override
public int getFetchSize() throws SQLException {
return statement.getFetchSize();
}
@Override
public float getFloat(int columnIndex) throws SQLException {
checkCursorState();
Float value = (Float)rowProjector.getColumnProjector(columnIndex-1).getValue(currentRow,
PFloat.INSTANCE, ptr);
wasNull = (value == null);
if (value == null) {
return 0;
}
return value;
}
@Override
public float getFloat(String columnLabel) throws SQLException {
return getFloat(findColumn(columnLabel));
}
@Override
public int getHoldability() throws SQLException {
return ResultSet.CLOSE_CURSORS_AT_COMMIT;
}
@Override
public int getInt(int columnIndex) throws SQLException {
checkCursorState();
Integer value = (Integer)rowProjector.getColumnProjector(columnIndex-1).getValue(currentRow,
PInteger.INSTANCE, ptr);
wasNull = (value == null);
if (value == null) {
return 0;
}
return value;
}
@Override
public int getInt(String columnLabel) throws SQLException {
return getInt(findColumn(columnLabel));
}
@Override
public long getLong(int columnIndex) throws SQLException {
checkCursorState();
Long value = (Long)rowProjector.getColumnProjector(columnIndex-1).getValue(currentRow,
PLong.INSTANCE, ptr);
wasNull = (value == null);
if (value == null) {
return 0;
}
return value;
}
@Override
public long getLong(String columnLabel) throws SQLException {
return getLong(findColumn(columnLabel));
}
@Override
public ResultSetMetaData getMetaData() throws SQLException {
return new PhoenixResultSetMetaData(statement.getConnection(), rowProjector);
}
@Override
public Reader getNCharacterStream(int columnIndex) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public Reader getNCharacterStream(String columnLabel) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public NClob getNClob(int columnIndex) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public NClob getNClob(String columnLabel) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public String getNString(int columnIndex) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public String getNString(String columnLabel) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public Object getObject(int columnIndex) throws SQLException {
checkCursorState();
ColumnProjector projector = rowProjector.getColumnProjector(columnIndex-1);
Object value = projector.getValue(currentRow, projector.getExpression().getDataType(), ptr);
wasNull = (value == null);
return value;
}
@Override
public Object getObject(String columnLabel) throws SQLException {
return getObject(findColumn(columnLabel));
}
@Override
public Object getObject(int columnIndex, Map<String, Class<?>> map) throws SQLException {
return getObject(columnIndex); // Just ignore map since we only support built-in types
}
@Override
public Object getObject(String columnLabel, Map<String, Class<?>> map) throws SQLException {
return getObject(findColumn(columnLabel), map);
}
@Override
public Ref getRef(int columnIndex) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public Ref getRef(String columnLabel) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public int getRow() throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public RowId getRowId(int columnIndex) throws SQLException {
// TODO: support?
throw new SQLFeatureNotSupportedException();
}
@Override
public RowId getRowId(String columnLabel) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public SQLXML getSQLXML(int columnIndex) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public SQLXML getSQLXML(String columnLabel) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public short getShort(int columnIndex) throws SQLException {
checkCursorState();
Short value = (Short)rowProjector.getColumnProjector(columnIndex-1).getValue(currentRow, PSmallint.INSTANCE, ptr);
wasNull = (value == null);
if (value == null) {
return 0;
}
return value;
}
@Override
public short getShort(String columnLabel) throws SQLException {
return getShort(findColumn(columnLabel));
}
@Override
public PhoenixStatement getStatement() throws SQLException {
return statement;
}
@Override
public String getString(int columnIndex) throws SQLException {
checkCursorState();
// Get the value using the expected type instead of trying to coerce to VARCHAR.
// We can't coerce using our formatter because we don't have enough context in PDataType.
ColumnProjector projector = rowProjector.getColumnProjector(columnIndex-1);
PDataType type = projector.getExpression().getDataType();
Object value = projector.getValue(currentRow,type, ptr);
if (wasNull = (value == null)) {
return null;
}
// Run Object through formatter to get String.
// This provides a simple way of getting a reasonable string representation
// for types like DATE and TIME
Format formatter = statement.getFormatter(type);
return formatter == null ? value.toString() : formatter.format(value);
}
@Override
public String getString(String columnLabel) throws SQLException {
return getString(findColumn(columnLabel));
}
@Override
public Time getTime(int columnIndex) throws SQLException {
checkCursorState();
Time value = (Time)rowProjector.getColumnProjector(columnIndex-1).getValue(currentRow,
PTime.INSTANCE, ptr);
wasNull = (value == null);
return value;
}
@Override
public Time getTime(String columnLabel) throws SQLException {
return getTime(findColumn(columnLabel));
}
@Override
public Time getTime(int columnIndex, Calendar cal) throws SQLException {
checkCursorState();
Time value = (Time)rowProjector.getColumnProjector(columnIndex-1).getValue(currentRow,
PTime.INSTANCE, ptr);
wasNull = (value == null);
if (value == null) {
return null;
}
cal.setTime(value);
value.setTime(cal.getTimeInMillis());
return value;
}
@Override
public Time getTime(String columnLabel, Calendar cal) throws SQLException {
return getTime(findColumn(columnLabel),cal);
}
@Override
public Timestamp getTimestamp(int columnIndex) throws SQLException {
checkCursorState();
Timestamp value = (Timestamp)rowProjector.getColumnProjector(columnIndex-1).getValue(currentRow,
PTimestamp.INSTANCE, ptr);
wasNull = (value == null);
return value;
}
@Override
public Timestamp getTimestamp(String columnLabel) throws SQLException {
return getTimestamp(findColumn(columnLabel));
}
@Override
public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException {
return getTimestamp(columnIndex);
}
@Override
public Timestamp getTimestamp(String columnLabel, Calendar cal) throws SQLException {
return getTimestamp(findColumn(columnLabel),cal);
}
@Override
public int getType() throws SQLException {
return ResultSet.TYPE_FORWARD_ONLY;
}
@Override
public URL getURL(int columnIndex) throws SQLException {
checkCursorState();
String value = (String)rowProjector.getColumnProjector(columnIndex-1).getValue(currentRow, PVarchar.INSTANCE, ptr);
wasNull = (value == null);
if (value == null) {
return null;
}
try {
return new URL(value);
} catch (MalformedURLException e) {
throw new SQLExceptionInfo.Builder(SQLExceptionCode.MALFORMED_URL).setRootCause(e).build().buildException();
}
}
@Override
public URL getURL(String columnLabel) throws SQLException {
return getURL(findColumn(columnLabel));
}
@Override
public InputStream getUnicodeStream(int columnIndex) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public InputStream getUnicodeStream(String columnLabel) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public SQLWarning getWarnings() throws SQLException {
return null;
}
@Override
public void insertRow() throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public boolean isAfterLast() throws SQLException {
return currentRow == null;
}
@Override
public boolean isBeforeFirst() throws SQLException {
return currentRow == BEFORE_FIRST;
}
@Override
public boolean isClosed() throws SQLException {
return isClosed;
}
@Override
public boolean isFirst() throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public boolean isLast() throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public boolean last() throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void moveToCurrentRow() throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void moveToInsertRow() throws SQLException {
throw new SQLFeatureNotSupportedException();
}
public Tuple getCurrentRow() {
return currentRow;
}
@Override
public boolean next() throws SQLException {
checkOpen();
try {
if (!firstRecordRead) {
firstRecordRead = true;
overAllQueryMetrics.startResultSetWatch();
}
currentRow = scanner.next();
rowProjector.reset();
} catch (RuntimeException e) {
// FIXME: Expression.evaluate does not throw SQLException
// so this will unwrap throws from that.
if (e.getCause() instanceof SQLException) {
throw (SQLException) e.getCause();
}
throw e;
}
if (currentRow == null) {
overAllQueryMetrics.endQuery();
overAllQueryMetrics.stopResultSetWatch();
}
return currentRow != null;
}
@Override
public boolean previous() throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void refreshRow() throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public boolean relative(int rows) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public boolean rowDeleted() throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public boolean rowInserted() throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public boolean rowUpdated() throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void setFetchDirection(int direction) throws SQLException {
if (direction != ResultSet.FETCH_FORWARD) {
throw new SQLFeatureNotSupportedException();
}
}
@Override
public void setFetchSize(int rows) throws SQLException {
LOG.warn("Ignoring setFetchSize(" + rows + ")");
}
@Override
public void updateArray(int columnIndex, Array x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateArray(String columnLabel, Array x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateAsciiStream(String columnLabel, InputStream x, int length) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateAsciiStream(String columnLabel, InputStream x, long length) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateBigDecimal(String columnLabel, BigDecimal x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateBinaryStream(String columnLabel, InputStream x, int length) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateBinaryStream(String columnLabel, InputStream x, long length) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateBlob(int columnIndex, Blob x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateBlob(String columnLabel, Blob x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateBoolean(int columnIndex, boolean x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateBoolean(String columnLabel, boolean x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateByte(int columnIndex, byte x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateByte(String columnLabel, byte x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateBytes(int columnIndex, byte[] x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateBytes(String columnLabel, byte[] x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateCharacterStream(int columnIndex, Reader x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateCharacterStream(String columnLabel, Reader reader, int length) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateClob(int columnIndex, Clob x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateClob(String columnLabel, Clob x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateClob(int columnIndex, Reader reader) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateClob(String columnLabel, Reader reader) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateClob(int columnIndex, Reader reader, long length) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateClob(String columnLabel, Reader reader, long length) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateDate(int columnIndex, Date x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateDate(String columnLabel, Date x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateDouble(int columnIndex, double x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateDouble(String columnLabel, double x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateFloat(int columnIndex, float x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateFloat(String columnLabel, float x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateInt(int columnIndex, int x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateInt(String columnLabel, int x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateLong(int columnIndex, long x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateLong(String columnLabel, long x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateNClob(int columnIndex, NClob nClob) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateNClob(String columnLabel, NClob nClob) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateNClob(int columnIndex, Reader reader) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateNClob(String columnLabel, Reader reader) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateNString(int columnIndex, String nString) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateNString(String columnLabel, String nString) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateNull(int columnIndex) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateNull(String columnLabel) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateObject(int columnIndex, Object x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateObject(String columnLabel, Object x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateObject(int columnIndex, Object x, int scaleOrLength) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateObject(String columnLabel, Object x, int scaleOrLength) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateRef(int columnIndex, Ref x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateRef(String columnLabel, Ref x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateRow() throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateRowId(int columnIndex, RowId x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateRowId(String columnLabel, RowId x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateShort(int columnIndex, short x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateShort(String columnLabel, short x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateString(int columnIndex, String x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateString(String columnLabel, String x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateTime(int columnIndex, Time x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateTime(String columnLabel, Time x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public void updateTimestamp(String columnLabel, Timestamp x) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
@Override
public boolean wasNull() throws SQLException {
return wasNull;
}
@Override
public boolean isWrapperFor(Class<?> iface) throws SQLException {
return iface.isInstance(this);
}
@SuppressWarnings("unchecked")
@Override
public <T> T unwrap(Class<T> iface) throws SQLException {
if (!iface.isInstance(this)) {
throw new SQLExceptionInfo.Builder(SQLExceptionCode.CLASS_NOT_UNWRAPPABLE)
.setMessage(this.getClass().getName() + " not unwrappable from " + iface.getName())
.build().buildException();
}
return (T)this;
}
@SuppressWarnings("unchecked")
@Override
public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
return (T) getObject(columnIndex); // Just ignore type since we only support built-in types
}
@SuppressWarnings("unchecked")
@Override
public <T> T getObject(String columnLabel, Class<T> type) throws SQLException {
return (T) getObject(columnLabel); // Just ignore type since we only support built-in types
}
@VisibleForTesting
public ResultIterator getUnderlyingIterator() {
return scanner;
}
public Map<String, Map<String, Long>> getReadMetrics() {
return readMetricsQueue.aggregate();
}
public Map<String, Long> getOverAllRequestReadMetrics() {
return overAllQueryMetrics.publish();
}
public void resetMetrics() {
readMetricsQueue.clearMetrics();
overAllQueryMetrics.reset();
}
public StatementContext getContext() {
return context;
}
}
| {
"content_hash": "cc54e0b56595476388f69e6ef79d446f",
"timestamp": "",
"source": "github",
"line_count": 1291,
"max_line_length": 129,
"avg_line_length": 31.440743609604958,
"alnum_prop": 0.6894555309189455,
"repo_name": "djh4230/Apache-Phoenix",
"id": "c1bbe81dc1044fd52569e740cad932024e47ef89",
"size": "41391",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixResultSet.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "GAP",
"bytes": "44989"
},
{
"name": "HTML",
"bytes": "18969"
},
{
"name": "Java",
"bytes": "11693296"
},
{
"name": "JavaScript",
"bytes": "203766"
},
{
"name": "Protocol Buffer",
"bytes": "13566"
},
{
"name": "Python",
"bytes": "81176"
},
{
"name": "Scala",
"bytes": "46902"
},
{
"name": "Shell",
"bytes": "62142"
}
],
"symlink_target": ""
} |
/**
* thrift - a lightweight cross-language rpc/serialization tool
*
* This file contains the main compiler engine for Thrift, which invokes the
* scanner/parser to build the thrift object tree. The interface generation
* code for each language lives in a file by the language name under the
* generate/ folder, and all parse structures live in parse/
*
*/
#include <cassert>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <time.h>
#include <string>
#include <algorithm>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <limits.h>
#ifdef _WIN32
#include <windows.h> /* for GetFullPathName */
#endif
// Careful: must include globals first for extern definitions
#include "thrift/common.h"
#include "thrift/globals.h"
#include "thrift/platform.h"
#include "thrift/main.h"
#include "thrift/parse/t_program.h"
#include "thrift/parse/t_scope.h"
#include "thrift/generate/t_generator.h"
#include "thrift/audit/t_audit.h"
#include "thrift/version.h"
using namespace std;
/**
* Global program tree
*/
t_program* g_program;
/**
* Global scope
*/
t_scope* g_scope;
/**
* Parent scope to also parse types
*/
t_scope* g_parent_scope;
/**
* Prefix for putting types in parent scope
*/
string g_parent_prefix;
/**
* Parsing pass
*/
PARSE_MODE g_parse_mode;
/**
* Current directory of file being parsed
*/
string g_curdir;
/**
* Current file being parsed
*/
string g_curpath;
/**
* Search path for inclusions
*/
vector<string> g_incl_searchpath;
/**
* Global debug state
*/
int g_debug = 0;
/**
* Strictness level
*/
int g_strict = 127;
/**
* Warning level
*/
int g_warn = 1;
/**
* Verbose output
*/
int g_verbose = 0;
/**
* Global time string
*/
char* g_time_str;
/**
* The last parsed doctext comment.
*/
char* g_doctext;
/**
* The First doctext comment
*/
char* g_program_doctext_candidate;
/**
* Whether or not negative field keys are accepted.
*/
int g_allow_neg_field_keys;
/**
* Whether or not 64-bit constants will generate a warning.
*/
int g_allow_64bit_consts = 0;
/**
* Flags to control code generation
*/
bool gen_recurse = false;
/**
* Flags to control thrift audit
*/
bool g_audit = false;
/**
* Flag to control return status
*/
bool g_return_failure = false;
bool g_audit_fatal = true;
bool g_generator_failure = false;
/**
* Win32 doesn't have realpath, so use fallback implementation in that case,
* otherwise this just calls through to realpath
*/
char* saferealpath(const char* path, char* resolved_path) {
#ifdef _WIN32
char buf[MAX_PATH];
char* basename;
DWORD len = GetFullPathNameA(path, MAX_PATH, buf, &basename);
if (len == 0 || len > MAX_PATH - 1) {
strcpy(resolved_path, path);
} else {
strcpy(resolved_path, buf);
}
// Replace backslashes with forward slashes so the
// rest of the code behaves correctly.
size_t resolved_len = strlen(resolved_path);
for (size_t i = 0; i < resolved_len; i++) {
if (resolved_path[i] == '\\') {
resolved_path[i] = '/';
}
}
return resolved_path;
#else
return realpath(path, resolved_path);
#endif
}
bool check_is_directory(const char* dir_name) {
#ifdef _WIN32
DWORD attributes = ::GetFileAttributesA(dir_name);
if (attributes == INVALID_FILE_ATTRIBUTES) {
fprintf(stderr,
"Output directory %s is unusable: GetLastError() = %ld\n",
dir_name,
GetLastError());
return false;
}
if ((attributes & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY) {
fprintf(stderr, "Output directory %s exists but is not a directory\n", dir_name);
return false;
}
return true;
#else
struct stat sb;
if (stat(dir_name, &sb) < 0) {
fprintf(stderr, "Output directory %s is unusable: %s\n", dir_name, strerror(errno));
return false;
}
if (!S_ISDIR(sb.st_mode)) {
fprintf(stderr, "Output directory %s exists but is not a directory\n", dir_name);
return false;
}
return true;
#endif
}
/**
* Report an error to the user. This is called yyerror for historical
* reasons (lex and yacc expect the error reporting routine to be called
* this). Call this function to report any errors to the user.
* yyerror takes printf style arguments.
*
* @param fmt C format string followed by additional arguments
*/
void yyerror(const char* fmt, ...) {
va_list args;
fprintf(stderr, "[ERROR:%s:%d] (last token was '%s')\n", g_curpath.c_str(), yylineno, yytext);
va_start(args, fmt);
vfprintf(stderr, fmt, args);
va_end(args);
fprintf(stderr, "\n");
}
/**
* Prints a debug message from the parser.
*
* @param fmt C format string followed by additional arguments
*/
void pdebug(const char* fmt, ...) {
if (g_debug == 0) {
return;
}
va_list args;
printf("[PARSE:%d] ", yylineno);
va_start(args, fmt);
vprintf(fmt, args);
va_end(args);
printf("\n");
}
/**
* Prints a verbose output mode message
*
* @param fmt C format string followed by additional arguments
*/
void pverbose(const char* fmt, ...) {
if (g_verbose == 0) {
return;
}
va_list args;
va_start(args, fmt);
vprintf(fmt, args);
va_end(args);
}
/**
* Prints a warning message
*
* @param fmt C format string followed by additional arguments
*/
void pwarning(int level, const char* fmt, ...) {
if (g_warn < level) {
return;
}
va_list args;
printf("[WARNING:%s:%d] ", g_curpath.c_str(), yylineno);
va_start(args, fmt);
vprintf(fmt, args);
va_end(args);
printf("\n");
}
/**
* Prints a failure message and exits
*
* @param fmt C format string followed by additional arguments
*/
void failure(const char* fmt, ...) {
va_list args;
fprintf(stderr, "[FAILURE:%s:%d] ", g_curpath.c_str(), yylineno);
va_start(args, fmt);
vfprintf(stderr, fmt, args);
va_end(args);
printf("\n");
exit(1);
}
/**
* Converts a string filename into a thrift program name
*/
string program_name(string filename) {
string::size_type slash = filename.rfind("/");
if (slash != string::npos) {
filename = filename.substr(slash + 1);
}
string::size_type dot = filename.rfind(".");
if (dot != string::npos) {
filename = filename.substr(0, dot);
}
return filename;
}
/**
* Gets the directory path of a filename
*/
string directory_name(string filename) {
string::size_type slash = filename.rfind("/");
// No slash, just use the current directory
if (slash == string::npos) {
return ".";
}
return filename.substr(0, slash);
}
/**
* Finds the appropriate file path for the given filename
*/
string include_file(string filename) {
// Absolute path? Just try that
if (filename[0] == '/') {
// Realpath!
char rp[THRIFT_PATH_MAX];
// cppcheck-suppress uninitvar
if (saferealpath(filename.c_str(), rp) == nullptr) {
pwarning(0, "Cannot open include file %s\n", filename.c_str());
return std::string();
}
// Stat this file
struct stat finfo;
if (stat(rp, &finfo) == 0) {
return rp;
}
} else { // relative path, start searching
// new search path with current dir global
vector<string> sp = g_incl_searchpath;
sp.insert(sp.begin(), g_curdir);
// iterate through paths
vector<string>::iterator it;
for (it = sp.begin(); it != sp.end(); it++) {
string sfilename = *(it) + "/" + filename;
// Realpath!
char rp[THRIFT_PATH_MAX];
// cppcheck-suppress uninitvar
if (saferealpath(sfilename.c_str(), rp) == nullptr) {
continue;
}
// Stat this files
struct stat finfo;
if (stat(rp, &finfo) == 0) {
return rp;
}
}
}
// Uh oh
pwarning(0, "Could not find include file %s\n", filename.c_str());
return std::string();
}
/**
* Clears any previously stored doctext string.
* Also prints a warning if we are discarding information.
*/
void clear_doctext() {
if (g_doctext != nullptr) {
pwarning(2, "Uncaptured doctext at on line %d.", g_doctext_lineno);
}
free(g_doctext);
g_doctext = nullptr;
}
/**
* Reset program doctext information after processing a file
*/
void reset_program_doctext_info() {
if (g_program_doctext_candidate != nullptr) {
free(g_program_doctext_candidate);
g_program_doctext_candidate = nullptr;
}
g_program_doctext_lineno = 0;
g_program_doctext_status = INVALID;
pdebug("%s", "program doctext set to INVALID");
}
/**
* We are sure the program doctext candidate is really the program doctext.
*/
void declare_valid_program_doctext() {
if ((g_program_doctext_candidate != nullptr) && (g_program_doctext_status == STILL_CANDIDATE)) {
g_program_doctext_status = ABSOLUTELY_SURE;
pdebug("%s", "program doctext set to ABSOLUTELY_SURE");
} else {
g_program_doctext_status = NO_PROGRAM_DOCTEXT;
pdebug("%s", "program doctext set to NO_PROGRAM_DOCTEXT");
}
}
/**
* Cleans up text commonly found in doxygen-like comments
*
* Warning: if you mix tabs and spaces in a non-uniform way,
* you will get what you deserve.
*/
char* clean_up_doctext(char* doctext) {
// Convert to C++ string, and remove Windows's carriage returns.
string docstring = doctext;
docstring.erase(remove(docstring.begin(), docstring.end(), '\r'), docstring.end());
// Separate into lines.
vector<string> lines;
string::size_type pos = string::npos;
string::size_type last;
while (true) {
last = (pos == string::npos) ? 0 : pos + 1;
pos = docstring.find('\n', last);
if (pos == string::npos) {
// First bit of cleaning. If the last line is only whitespace, drop it.
string::size_type nonwhite = docstring.find_first_not_of(" \t", last);
if (nonwhite != string::npos) {
lines.push_back(docstring.substr(last));
}
break;
}
lines.push_back(docstring.substr(last, pos - last));
}
// A very profound docstring.
if (lines.empty()) {
return nullptr;
}
// Clear leading whitespace from the first line.
pos = lines.front().find_first_not_of(" \t");
lines.front().erase(0, pos);
// If every nonblank line after the first has the same number of spaces/tabs,
// then a star, remove them.
bool have_prefix = true;
bool found_prefix = false;
string::size_type prefix_len = 0;
vector<string>::iterator l_iter;
for (l_iter = lines.begin() + 1; l_iter != lines.end(); ++l_iter) {
if (l_iter->empty()) {
continue;
}
pos = l_iter->find_first_not_of(" \t");
if (!found_prefix) {
if (pos != string::npos) {
if (l_iter->at(pos) == '*') {
found_prefix = true;
prefix_len = pos;
} else {
have_prefix = false;
break;
}
} else {
// Whitespace-only line. Truncate it.
l_iter->clear();
}
} else if (l_iter->size() > pos && l_iter->at(pos) == '*' && pos == prefix_len) {
// Business as usual.
} else if (pos == string::npos) {
// Whitespace-only line. Let's truncate it for them.
l_iter->clear();
} else {
// The pattern has been broken.
have_prefix = false;
break;
}
}
// If our prefix survived, delete it from every line.
if (have_prefix) {
// Get the star too.
prefix_len++;
for (l_iter = lines.begin() + 1; l_iter != lines.end(); ++l_iter) {
l_iter->erase(0, prefix_len);
}
}
// Now delete the minimum amount of leading whitespace from each line.
prefix_len = string::npos;
for (l_iter = lines.begin() + 1; l_iter != lines.end(); ++l_iter) {
if (l_iter->empty()) {
continue;
}
pos = l_iter->find_first_not_of(" \t");
if (pos != string::npos && (prefix_len == string::npos || pos < prefix_len)) {
prefix_len = pos;
}
}
// If our prefix survived, delete it from every line.
if (prefix_len != string::npos) {
for (l_iter = lines.begin() + 1; l_iter != lines.end(); ++l_iter) {
l_iter->erase(0, prefix_len);
}
}
// Remove trailing whitespace from every line.
for (l_iter = lines.begin(); l_iter != lines.end(); ++l_iter) {
pos = l_iter->find_last_not_of(" \t");
if (pos != string::npos && pos != l_iter->length() - 1) {
l_iter->erase(pos + 1);
}
}
// If the first line is empty, remove it.
// Don't do this earlier because a lot of steps skip the first line.
if (lines.front().empty()) {
lines.erase(lines.begin());
}
// Now rejoin the lines and copy them back into doctext.
docstring.clear();
for (l_iter = lines.begin(); l_iter != lines.end(); ++l_iter) {
docstring += *l_iter;
docstring += '\n';
}
// assert(docstring.length() <= strlen(doctext)); may happen, see THRIFT-1755
if (docstring.length() <= strlen(doctext)) {
strcpy(doctext, docstring.c_str());
} else {
free(doctext); // too short
doctext = strdup(docstring.c_str());
}
return doctext;
}
/** Set to true to debug docstring parsing */
static bool dump_docs = false;
/**
* Dumps docstrings to stdout
* Only works for top-level definitions and the whole program doc
* (i.e., not enum constants, struct fields, or functions.
*/
void dump_docstrings(t_program* program) {
string progdoc = program->get_doc();
if (!progdoc.empty()) {
printf("Whole program doc:\n%s\n", progdoc.c_str());
}
const vector<t_typedef*>& typedefs = program->get_typedefs();
vector<t_typedef*>::const_iterator t_iter;
for (t_iter = typedefs.begin(); t_iter != typedefs.end(); ++t_iter) {
t_typedef* td = *t_iter;
if (td->has_doc()) {
printf("typedef %s:\n%s\n", td->get_name().c_str(), td->get_doc().c_str());
}
}
const vector<t_enum*>& enums = program->get_enums();
vector<t_enum*>::const_iterator e_iter;
for (e_iter = enums.begin(); e_iter != enums.end(); ++e_iter) {
t_enum* en = *e_iter;
if (en->has_doc()) {
printf("enum %s:\n%s\n", en->get_name().c_str(), en->get_doc().c_str());
}
}
const vector<t_const*>& consts = program->get_consts();
vector<t_const*>::const_iterator c_iter;
for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
t_const* co = *c_iter;
if (co->has_doc()) {
printf("const %s:\n%s\n", co->get_name().c_str(), co->get_doc().c_str());
}
}
const vector<t_struct*>& structs = program->get_structs();
vector<t_struct*>::const_iterator s_iter;
for (s_iter = structs.begin(); s_iter != structs.end(); ++s_iter) {
t_struct* st = *s_iter;
if (st->has_doc()) {
printf("struct %s:\n%s\n", st->get_name().c_str(), st->get_doc().c_str());
}
}
const vector<t_struct*>& xceptions = program->get_xceptions();
vector<t_struct*>::const_iterator x_iter;
for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
t_struct* xn = *x_iter;
if (xn->has_doc()) {
printf("xception %s:\n%s\n", xn->get_name().c_str(), xn->get_doc().c_str());
}
}
const vector<t_service*>& services = program->get_services();
vector<t_service*>::const_iterator v_iter;
for (v_iter = services.begin(); v_iter != services.end(); ++v_iter) {
t_service* sv = *v_iter;
if (sv->has_doc()) {
printf("service %s:\n%s\n", sv->get_name().c_str(), sv->get_doc().c_str());
}
}
}
/**
* Emits a warning on list<byte>, binary type is typically a much better choice.
*/
void check_for_list_of_bytes(t_type* list_elem_type) {
if ((g_parse_mode == PROGRAM) && (list_elem_type != nullptr) && list_elem_type->is_base_type()) {
t_base_type* tbase = (t_base_type*)list_elem_type;
if (tbase->get_base() == t_base_type::TYPE_I8) {
pwarning(1, "Consider using the more efficient \"binary\" type instead of \"list<byte>\".");
}
}
}
static bool g_byte_warning_emitted = false;
/**
* Emits a one-time warning on byte type, promoting the new i8 type instead
*/
void emit_byte_type_warning() {
if (!g_byte_warning_emitted) {
pwarning(1,
"The \"byte\" type is a compatibility alias for \"i8\". Use \"i8\" to emphasize the "
"signedness of this type.\n");
g_byte_warning_emitted = true;
}
}
/**
* Prints deprecation notice for old NS declarations that are no longer supported
* If new_form is nullptr, old_form is assumed to be a language identifier, such as "cpp"
* If new_form is not nullptr, both arguments are used exactly as given
*/
void error_unsupported_namespace_decl(const char* old_form, const char* new_form) {
const char* remainder = "";
if( new_form == nullptr) {
new_form = old_form;
remainder = "_namespace";
}
failure("Unsupported declaration '%s%s'. Use 'namespace %s' instead.", old_form, remainder, new_form);
}
/**
* Prints the version number
*/
void version() {
printf("Thrift version %s\n", THRIFT_VERSION);
}
/**
* Display the usage message and then exit with an error code.
*/
void usage() {
fprintf(stderr, "Usage: thrift [options] file\n\n");
fprintf(stderr, "Use thrift -help for a list of options\n");
exit(1);
}
/**
* Diplays the help message and then exits with an error code.
*/
void help() {
fprintf(stderr, "Usage: thrift [options] file\n");
fprintf(stderr, "Options:\n");
fprintf(stderr, " -version Print the compiler version\n");
fprintf(stderr, " -o dir Set the output directory for gen-* packages\n");
fprintf(stderr, " (default: current directory)\n");
fprintf(stderr, " -out dir Set the ouput location for generated files.\n");
fprintf(stderr, " (no gen-* folder will be created)\n");
fprintf(stderr, " -I dir Add a directory to the list of directories\n");
fprintf(stderr, " searched for include directives\n");
fprintf(stderr, " -nowarn Suppress all compiler warnings (BAD!)\n");
fprintf(stderr, " -strict Strict compiler warnings on\n");
fprintf(stderr, " -v[erbose] Verbose mode\n");
fprintf(stderr, " -r[ecurse] Also generate included files\n");
fprintf(stderr, " -debug Parse debug trace to stdout\n");
fprintf(stderr,
" --allow-neg-keys Allow negative field keys (Used to "
"preserve protocol\n");
fprintf(stderr, " compatibility with older .thrift files)\n");
fprintf(stderr, " --allow-64bit-consts Do not print warnings about using 64-bit constants\n");
fprintf(stderr, " --gen STR Generate code with a dynamically-registered generator.\n");
fprintf(stderr, " STR has the form language[:key1=val1[,key2[,key3=val3]]].\n");
fprintf(stderr, " Keys and values are options passed to the generator.\n");
fprintf(stderr, " Many options will not require values.\n");
fprintf(stderr, "\n");
fprintf(stderr, "Options related to audit operation\n");
fprintf(stderr, " --audit OldFile Old Thrift file to be audited with 'file'\n");
fprintf(stderr, " -Iold dir Add a directory to the list of directories\n");
fprintf(stderr, " searched for include directives for old thrift file\n");
fprintf(stderr, " -Inew dir Add a directory to the list of directories\n");
fprintf(stderr, " searched for include directives for new thrift file\n");
fprintf(stderr, "\n");
fprintf(stderr, "Available generators (and options):\n");
t_generator_registry::gen_map_t gen_map = t_generator_registry::get_generator_map();
t_generator_registry::gen_map_t::iterator iter;
for (iter = gen_map.begin(); iter != gen_map.end(); ++iter) {
fprintf(stderr,
" %s (%s):\n",
iter->second->get_short_name().c_str(),
iter->second->get_long_name().c_str());
fprintf(stderr, "%s", iter->second->get_documentation().c_str());
}
exit(1);
}
/**
* You know, when I started working on Thrift I really thought it wasn't going
* to become a programming language because it was just a generator and it
* wouldn't need runtime type information and all that jazz. But then we
* decided to add constants, and all of a sudden that means runtime type
* validation and inference, except the "runtime" is the code generator
* runtime.
*/
void validate_const_rec(std::string name, t_type* type, t_const_value* value) {
if (type->is_void()) {
throw "type error: cannot declare a void const: " + name;
}
if (type->is_base_type()) {
t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
switch (tbase) {
case t_base_type::TYPE_STRING:
if (value->get_type() != t_const_value::CV_STRING) {
throw "type error: const \"" + name + "\" was declared as string";
}
break;
case t_base_type::TYPE_UUID:
if (value->get_type() != t_const_value::CV_STRING) {
throw "type error: const \"" + name + "\" was declared as uuid";
}
value->set_uuid(value->get_uuid()); // validates constant
break;
case t_base_type::TYPE_BOOL:
if (value->get_type() != t_const_value::CV_INTEGER) {
throw "type error: const \"" + name + "\" was declared as bool";
}
break;
case t_base_type::TYPE_I8:
if (value->get_type() != t_const_value::CV_INTEGER) {
throw "type error: const \"" + name + "\" was declared as byte";
}
break;
case t_base_type::TYPE_I16:
if (value->get_type() != t_const_value::CV_INTEGER) {
throw "type error: const \"" + name + "\" was declared as i16";
}
break;
case t_base_type::TYPE_I32:
if (value->get_type() != t_const_value::CV_INTEGER) {
throw "type error: const \"" + name + "\" was declared as i32";
}
break;
case t_base_type::TYPE_I64:
if (value->get_type() != t_const_value::CV_INTEGER) {
throw "type error: const \"" + name + "\" was declared as i64";
}
break;
case t_base_type::TYPE_DOUBLE:
if (value->get_type() != t_const_value::CV_INTEGER
&& value->get_type() != t_const_value::CV_DOUBLE) {
throw "type error: const \"" + name + "\" was declared as double";
}
break;
default:
throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase) + name;
}
} else if (type->is_enum()) {
if (value->get_type() != t_const_value::CV_IDENTIFIER) {
throw "type error: const \"" + name + "\" was declared as enum";
}
// see if there's a dot in the identifier
std::string name_portion = value->get_identifier_name();
const vector<t_enum_value*>& enum_values = ((t_enum*)type)->get_constants();
vector<t_enum_value*>::const_iterator c_iter;
bool found = false;
for (c_iter = enum_values.begin(); c_iter != enum_values.end(); ++c_iter) {
if ((*c_iter)->get_name() == name_portion) {
found = true;
break;
}
}
if (!found) {
throw "type error: const " + name + " was declared as type " + type->get_name()
+ " which is an enum, but " + value->get_identifier()
+ " is not a valid value for that enum";
}
} else if (type->is_struct() || type->is_xception()) {
if (value->get_type() != t_const_value::CV_MAP) {
throw "type error: const \"" + name + "\" was declared as struct/xception";
}
const vector<t_field*>& fields = ((t_struct*)type)->get_members();
vector<t_field*>::const_iterator f_iter;
const map<t_const_value*, t_const_value*, t_const_value::value_compare>& val = value->get_map();
map<t_const_value*, t_const_value*, t_const_value::value_compare>::const_iterator v_iter;
for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
if (v_iter->first->get_type() != t_const_value::CV_STRING) {
throw "type error: " + name + " struct key must be string";
}
t_type* field_type = nullptr;
for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
if ((*f_iter)->get_name() == v_iter->first->get_string()) {
field_type = (*f_iter)->get_type();
}
}
if (field_type == nullptr) {
throw "type error: " + type->get_name() + " has no field " + v_iter->first->get_string();
}
validate_const_rec(name + "." + v_iter->first->get_string(), field_type, v_iter->second);
}
} else if (type->is_map()) {
t_type* k_type = ((t_map*)type)->get_key_type();
t_type* v_type = ((t_map*)type)->get_val_type();
const map<t_const_value*, t_const_value*, t_const_value::value_compare>& val = value->get_map();
map<t_const_value*, t_const_value*, t_const_value::value_compare>::const_iterator v_iter;
for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
validate_const_rec(name + "<key>", k_type, v_iter->first);
validate_const_rec(name + "<val>", v_type, v_iter->second);
}
} else if (type->is_list() || type->is_set()) {
t_type* e_type;
if (type->is_list()) {
e_type = ((t_list*)type)->get_elem_type();
} else {
e_type = ((t_set*)type)->get_elem_type();
}
const vector<t_const_value*>& val = value->get_list();
vector<t_const_value*>::const_iterator v_iter;
for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
validate_const_rec(name + "<elem>", e_type, *v_iter);
}
}
}
/**
* Check simple identifier names
* It's easier to do it this way instead of rewriting the whole grammar etc.
*/
void validate_simple_identifier(const char* identifier) {
string name(identifier);
if (name.find(".") != string::npos) {
yyerror("Identifier %s can't have a dot.", identifier);
exit(1);
}
}
/**
* Check the type of the parsed const information against its declared type
*/
void validate_const_type(t_const* c) {
validate_const_rec(c->get_name(), c->get_type(), c->get_value());
}
/**
* Check the type of a default value assigned to a field.
*/
void validate_field_value(t_field* field, t_const_value* cv) {
validate_const_rec(field->get_name(), field->get_type(), cv);
}
/**
* Check that all the elements of a throws block are actually exceptions.
*/
bool validate_throws(t_struct* throws) {
const vector<t_field*>& members = throws->get_members();
vector<t_field*>::const_iterator m_iter;
for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
if (!t_generator::get_true_type((*m_iter)->get_type())->is_xception()) {
return false;
}
}
return true;
}
/**
* Skips UTF-8 BOM if there is one
*/
bool skip_utf8_bom(FILE* f) {
// pretty straightforward, but works
if (fgetc(f) == 0xEF) {
if (fgetc(f) == 0xBB) {
if (fgetc(f) == 0xBF) {
return true;
}
}
}
rewind(f);
return false;
}
/**
* Parses a program
*/
void parse(t_program* program, t_program* parent_program) {
// Get scope file path
string path = program->get_path();
// Set current dir global, which is used in the include_file function
g_curdir = directory_name(path);
g_curpath = path;
// Open the file
// skip UTF-8 BOM if there is one
yyin = fopen(path.c_str(), "r");
if (yyin == 0) {
failure("Could not open input file: \"%s\"", path.c_str());
}
if (skip_utf8_bom(yyin))
pverbose("Skipped UTF-8 BOM at %s\n", path.c_str());
// Create new scope and scan for includes
pverbose("Scanning %s for includes\n", path.c_str());
g_parse_mode = INCLUDES;
g_program = program;
g_scope = program->scope();
try {
yylineno = 1;
if (yyparse() != 0) {
failure("Parser error during include pass.");
}
} catch (string &x) {
failure(x.c_str());
}
fclose(yyin);
// Recursively parse all the include programs
vector<t_program*>& includes = program->get_includes();
vector<t_program*>::iterator iter;
for (iter = includes.begin(); iter != includes.end(); ++iter) {
parse(*iter, program);
}
// reset program doctext status before parsing a new file
reset_program_doctext_info();
// Parse the program file
g_parse_mode = PROGRAM;
g_program = program;
g_scope = program->scope();
g_parent_scope = (parent_program != nullptr) ? parent_program->scope() : nullptr;
g_parent_prefix = program->get_name() + ".";
g_curpath = path;
// Open the file
// skip UTF-8 BOM if there is one
yyin = fopen(path.c_str(), "r");
if (yyin == 0) {
failure("Could not open input file: \"%s\"", path.c_str());
}
if (skip_utf8_bom(yyin))
pverbose("Skipped UTF-8 BOM at %s\n", path.c_str());
pverbose("Parsing %s for types\n", path.c_str());
yylineno = 1;
try {
if (yyparse() != 0) {
failure("Parser error during types pass.");
}
} catch (string &x) {
failure(x.c_str());
}
fclose(yyin);
}
/**
* Generate code
*/
void generate(t_program* program, const vector<string>& generator_strings) {
// Oooohh, recursive code generation, hot!!
if (gen_recurse) {
program->set_recursive(true);
const vector<t_program*>& includes = program->get_includes();
for (auto include : includes) {
// Propagate output path from parent to child programs
include->set_out_path(program->get_out_path(), program->is_out_path_absolute());
generate(include, generator_strings);
}
}
// Generate code!
try {
pverbose("Program: %s\n", program->get_path().c_str());
if (dump_docs) {
dump_docstrings(program);
}
// make sure all symbolic constants are properly resolved
program->scope()->resolve_all_consts();
vector<string>::const_iterator iter;
for (iter = generator_strings.begin(); iter != generator_strings.end(); ++iter) {
t_generator* generator = t_generator_registry::get_generator(program, *iter);
if (generator == nullptr) {
pwarning(1, "Unable to get a generator for \"%s\".\n", iter->c_str());
g_generator_failure = true;
} else if (generator) {
generator->validate_input();
pverbose("Generating \"%s\"\n", iter->c_str());
generator->generate_program();
delete generator;
}
}
} catch (string &s) {
failure("Error: %s\n", s.c_str());
} catch (const char* exc) {
failure("Error: %s\n", exc);
} catch (const std::invalid_argument& invalid_argument_exception) {
failure("Error: %s\n", invalid_argument_exception.what());
}
}
void audit(t_program* new_program,
t_program* old_program,
string new_thrift_include_path,
string old_thrift_include_path) {
vector<string> temp_incl_searchpath = g_incl_searchpath;
if (!old_thrift_include_path.empty()) {
g_incl_searchpath.push_back(old_thrift_include_path);
}
parse(old_program, nullptr);
g_incl_searchpath = temp_incl_searchpath;
if (!new_thrift_include_path.empty()) {
g_incl_searchpath.push_back(new_thrift_include_path);
}
parse(new_program, nullptr);
compare_namespace(new_program, old_program);
compare_services(new_program->get_services(), old_program->get_services());
compare_enums(new_program->get_enums(), old_program->get_enums());
compare_structs(new_program->get_structs(), old_program->get_structs());
compare_structs(new_program->get_xceptions(), old_program->get_xceptions());
compare_consts(new_program->get_consts(), old_program->get_consts());
}
/**
* Parse it up.. then spit it back out, in pretty much every language. Alright
* not that many languages, but the cool ones that we care about.
*/
int main(int argc, char** argv) {
int i;
std::string out_path;
bool out_path_is_absolute = false;
// Setup time string
time_t now = time(nullptr);
g_time_str = ctime(&now);
// Check for necessary arguments, you gotta have at least a filename and
// an output language flag
if (argc < 2) {
usage();
}
vector<string> generator_strings;
string old_thrift_include_path;
string new_thrift_include_path;
string old_input_file;
// Set the current path to a dummy value to make warning messages clearer.
g_curpath = "arguments";
// Hacky parameter handling... I didn't feel like using a library sorry!
for (i = 1; i < argc - 1; i++) {
char* arg;
arg = strtok(argv[i], " ");
while (arg != nullptr) {
// Treat double dashes as single dashes
if (arg[0] == '-' && arg[1] == '-') {
++arg;
}
if (strcmp(arg, "-help") == 0) {
help();
} else if (strcmp(arg, "-version") == 0) {
version();
exit(0);
} else if (strcmp(arg, "-debug") == 0) {
g_debug = 1;
} else if (strcmp(arg, "-nowarn") == 0) {
g_warn = 0;
} else if (strcmp(arg, "-strict") == 0) {
g_strict = 255;
g_warn = 2;
} else if (strcmp(arg, "-v") == 0 || strcmp(arg, "-verbose") == 0) {
g_verbose = 1;
} else if (strcmp(arg, "-r") == 0 || strcmp(arg, "-recurse") == 0) {
gen_recurse = true;
} else if (strcmp(arg, "-allow-neg-keys") == 0) {
g_allow_neg_field_keys = true;
} else if (strcmp(arg, "-allow-64bit-consts") == 0) {
g_allow_64bit_consts = true;
} else if (strcmp(arg, "-gen") == 0) {
arg = argv[++i];
if (arg == nullptr) {
fprintf(stderr, "Missing generator specification\n");
usage();
}
generator_strings.emplace_back(arg);
} else if (strcmp(arg, "-I") == 0) {
// An argument of "-I\ asdf" is invalid and has unknown results
arg = argv[++i];
if (arg == nullptr) {
fprintf(stderr, "Missing Include directory\n");
usage();
}
g_incl_searchpath.emplace_back(arg);
} else if ((strcmp(arg, "-o") == 0) || (strcmp(arg, "-out") == 0)) {
out_path_is_absolute = (strcmp(arg, "-out") == 0) ? true : false;
arg = argv[++i];
if (arg == nullptr) {
fprintf(stderr, "-o: missing output directory\n");
usage();
}
out_path = arg;
#ifdef _WIN32
// strip out trailing \ on Windows
std::string::size_type last = out_path.length() - 1;
if (out_path[last] == '\\') {
out_path.erase(last);
}
#endif
if (!check_is_directory(out_path.c_str()))
return -1;
} else if (strcmp(arg, "-audit") == 0) {
g_audit = true;
arg = argv[++i];
if (arg == nullptr) {
fprintf(stderr, "Missing old thrift file name for audit operation\n");
usage();
}
char old_thrift_file_rp[THRIFT_PATH_MAX];
// cppcheck-suppress uninitvar
if (saferealpath(arg, old_thrift_file_rp) == nullptr) {
failure("Could not open input file with realpath: %s", arg);
}
old_input_file = string(old_thrift_file_rp);
} else if (strcmp(arg, "-audit-nofatal") == 0) {
g_audit_fatal = false;
} else if (strcmp(arg, "-Iold") == 0) {
arg = argv[++i];
if (arg == nullptr) {
fprintf(stderr, "Missing Include directory for old thrift file\n");
usage();
}
old_thrift_include_path = string(arg);
} else if (strcmp(arg, "-Inew") == 0) {
arg = argv[++i];
if (arg == nullptr) {
fprintf(stderr, "Missing Include directory for new thrift file\n");
usage();
}
new_thrift_include_path = string(arg);
} else {
fprintf(stderr, "Unrecognized option: %s\n", arg);
usage();
}
// Tokenize more
arg = strtok(nullptr, " ");
}
}
// display help
if ((strcmp(argv[argc - 1], "-help") == 0) || (strcmp(argv[argc - 1], "--help") == 0)) {
help();
}
// if you're asking for version, you have a right not to pass a file
if ((strcmp(argv[argc - 1], "-version") == 0) || (strcmp(argv[argc - 1], "--version") == 0)) {
version();
exit(0);
}
// Initialize global types
initGlobals();
if (g_audit) {
// Audit operation
if (old_input_file.empty()) {
fprintf(stderr, "Missing file name of old thrift file for audit\n");
usage();
}
char new_thrift_file_rp[THRIFT_PATH_MAX];
if (argv[i] == nullptr) {
fprintf(stderr, "Missing file name of new thrift file for audit\n");
usage();
}
// cppcheck-suppress uninitvar
if (saferealpath(argv[i], new_thrift_file_rp) == nullptr) {
failure("Could not open input file with realpath: %s", argv[i]);
}
string new_input_file(new_thrift_file_rp);
t_program new_program(new_input_file);
t_program old_program(old_input_file);
audit(&new_program, &old_program, new_thrift_include_path, old_thrift_include_path);
} else {
// Generate options
// You gotta generate something!
if (generator_strings.empty()) {
fprintf(stderr, "No output language(s) specified\n");
usage();
}
// Real-pathify it
char rp[THRIFT_PATH_MAX];
if (argv[i] == nullptr) {
fprintf(stderr, "Missing file name\n");
usage();
}
// cppcheck-suppress uninitvar
if (saferealpath(argv[i], rp) == nullptr) {
failure("Could not open input file with realpath: %s", argv[i]);
}
string input_file(rp);
// Instance of the global parse tree
t_program* program = new t_program(input_file);
if (out_path.size()) {
program->set_out_path(out_path, out_path_is_absolute);
}
// Compute the cpp include prefix.
// infer this from the filename passed in
string input_filename = argv[i];
string include_prefix;
string::size_type last_slash = string::npos;
if ((last_slash = input_filename.rfind("/")) != string::npos) {
include_prefix = input_filename.substr(0, last_slash);
}
program->set_include_prefix(include_prefix);
// Parse it!
parse(program, nullptr);
// The current path is not really relevant when we are doing generation.
// Reset the variable to make warning messages clearer.
g_curpath = "generation";
// Reset yylineno for the heck of it. Use 1 instead of 0 because
// That is what shows up during argument parsing.
yylineno = 1;
// Generate it!
generate(program, generator_strings);
delete program;
}
// Clean up. Who am I kidding... this program probably orphans heap memory
// all over the place, but who cares because it is about to exit and it is
// all referenced and used by this wacky parse tree up until now anyways.
clearGlobals();
// Finished
if (g_return_failure && g_audit_fatal) {
exit(2);
}
if (g_generator_failure) {
exit(3);
}
// Finished
return 0;
}
| {
"content_hash": "20e8263205aee7accc29de9b1b758295",
"timestamp": "",
"source": "github",
"line_count": 1282,
"max_line_length": 104,
"avg_line_length": 29.86349453978159,
"alnum_prop": 0.6044403813503983,
"repo_name": "apache/thrift",
"id": "485ec0022cb8087b323eb5c3a794f508f0903a0d",
"size": "39088",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "compiler/cpp/src/thrift/main.cc",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "34900"
},
{
"name": "C",
"bytes": "1068486"
},
{
"name": "C#",
"bytes": "549227"
},
{
"name": "C++",
"bytes": "4866785"
},
{
"name": "CMake",
"bytes": "131183"
},
{
"name": "CSS",
"bytes": "1070"
},
{
"name": "Common Lisp",
"bytes": "41010"
},
{
"name": "D",
"bytes": "662123"
},
{
"name": "Dart",
"bytes": "181474"
},
{
"name": "Dockerfile",
"bytes": "87660"
},
{
"name": "Emacs Lisp",
"bytes": "5361"
},
{
"name": "Erlang",
"bytes": "323926"
},
{
"name": "Go",
"bytes": "725380"
},
{
"name": "HTML",
"bytes": "36484"
},
{
"name": "Haxe",
"bytes": "324323"
},
{
"name": "Java",
"bytes": "1388967"
},
{
"name": "JavaScript",
"bytes": "457056"
},
{
"name": "Kotlin",
"bytes": "60884"
},
{
"name": "Lex",
"bytes": "9802"
},
{
"name": "Lua",
"bytes": "81630"
},
{
"name": "M4",
"bytes": "173381"
},
{
"name": "Makefile",
"bytes": "225939"
},
{
"name": "OCaml",
"bytes": "39269"
},
{
"name": "PHP",
"bytes": "353558"
},
{
"name": "Pascal",
"bytes": "610411"
},
{
"name": "Perl",
"bytes": "133070"
},
{
"name": "Python",
"bytes": "509097"
},
{
"name": "Ruby",
"bytes": "400251"
},
{
"name": "Rust",
"bytes": "361956"
},
{
"name": "Shell",
"bytes": "62247"
},
{
"name": "Smalltalk",
"bytes": "22944"
},
{
"name": "Swift",
"bytes": "213447"
},
{
"name": "Thrift",
"bytes": "494659"
},
{
"name": "TypeScript",
"bytes": "61760"
},
{
"name": "Vim Script",
"bytes": "2846"
},
{
"name": "Yacc",
"bytes": "30812"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "eb7d274d0f89c2ee81f28a1b5a446781",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "9a8f426aafcd3ac74b3909cc0c2fc75ff97e6e50",
"size": "187",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Saxifragales/Saxifragaceae/Chrysosplenium/Chrysosplenium vidalii/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
; var root = root || {};
root.Analytics = root.Analytics || {};
// the semi-colon before function invocation is a safety net against concatenated
// scripts and/or other plugins which may not be closed properly.
(function ($, window, document, undefined, ko) {
"use strict";
// undefined is used here as the undefined global variable in ECMAScript 3 is
// mutable (ie. it can be changed by someone else). undefined isn't really being
// passed in so we can ensure the value of it is truly undefined. In ES5, undefined
// can no longer be modified.
// window and document are passed through as local variables rather than globals
// as this (slightly) quickens the resolution process and can be more efficiently
// minified (especially when both are regularly referenced in your plugin).
//
// MetricViewModel Model
//
var MetricViewModel = this.MetricViewModel = function (controller) {
this._controller = controller;
this.values = ko.observable();
};
MetricViewModel.prototype = {
constructor: MetricViewModel,
_init: function() {
},
_getMetricData: function() {
var getStatsHandler = $.proxy(function (data) { this.values(data); }, this);
this._controller.getMetricViewData(getStatsHandler);
},
show: function() {
this._getMetricData();
}
};
//
// TimeLineViewModel
//
var TimeLineViewModel = this.TimeLineViewModel = function (controller, options) {
this.scales = new root.Enum([
{ key: 0, value: "unspecified" },
{ key: 1, value: "Day" },
{ key: 2, value: "Week" },
{ key: 3, value: "Month" },
{ key: 4, value: "Year" }]);
this.selectedScale = ko.observable(this.scales.Week);
this.isDayScale = ko.computed(this._isDayScale, this);
this.isWeekScale = ko.computed(this._isWeekScale, this);
this.isMonthScale = ko.computed(this._isMonthScale, this);
this.isYearScale = ko.computed(this._isYearScale, this);
this.source = ko.observableArray();
this.source.subscribe(this._onSourceChanged, this);
this._controller = controller;
this._options = options;
this._init();
};
TimeLineViewModel.prototype = {
constructor: TimeLineViewModel,
_init: function() {
var graphOptions = $.extend({}, {
tooltipTextFunction: function (datum) { return datum.key.format("dd-MMM-yyyy") + " : " + datum.value + " Pageviews"; }
}, this._options);
this._graph = new root.TimeLineGraph($("#" + this._options.containerId)[0], graphOptions);
this.source([]);
this.selectedScale.subscribe(this._scaleChanged, this);
},
_scaleChanged: function (newValue) {
this._getTimeLineViewData();
},
_getTimeLineViewData: function () {
var callback = $.proxy(this._onGetTimeLineViewData, this);
this._controller.getTimeLineViewData(this.selectedScale(), callback);
},
_onGetTimeLineViewData: function (data) {
this.source(data);
},
_onSourceChanged: function (newValue) {
this._show();
},
setScale: function (caller, evt) {
var clickedOption = evt.currentTarget;
var $clickedOption = $(clickedOption);
this.selectedScale(parseInt($clickedOption.attr("data"), 10));
},
_isDayScale: function () {
return this.selectedScale() === this.scales.Day;
},
_isWeekScale: function () {
return this.selectedScale() === this.scales.Week;
},
_isMonthScale: function () {
return this.selectedScale() === this.scales.Month;
},
_isYearScale: function () {
return this.selectedScale() === this.scales.Year;
},
_show: function () {
this._graph.draw(this.source(), this.scales.getEnumName(this.selectedScale()).toLowerCase());
},
show: function() {
this._getTimeLineViewData();
}
};
//
// GeoMapViewModel
//
var GeoMapViewModel = this.GeoMapViewModel = function (controller, options) {
this._controller = controller;
this._options = options;
this._init();
};
GeoMapViewModel.prototype = {
constructor: GeoMapViewModel,
_init: function() {
var options = $.extend({}, {
graphClass: "graph",
size: { width: 960, height: 400 }
}, this._options);
this._map = new root.Analytics.ChoroplethMap($("#" + this._options.containerId)[0], options);
var onSelectCountryHandler = $.proxy(this._onSelectCountry, this);
$(this._map).on("onselectcountry", onSelectCountryHandler);
var zoomOptions = {
horizontal: false,
vertical: true,
yPrecision: 800,
animationCallback: function(x, y) {
//alert(String(12 + x * 24) + 'px');
}
};
//this._zoom = new Dragdealer(this._options.zoomId, zoomOptions);
this.$this = $(this);
},
_onSelectCountry: function (eventObject, country) {
var callback = $.proxy(this._onGetCountryMapViewData, this, country);
this._controller.getCountryMapViewData(country, callback);
},
_onGetCountryMapViewData: function (country, data) {
this.showCountry(data);
this._getCountryChoroplethViewData(country);
},
_getCountryChoroplethViewData: function (country) {
var callback = $.proxy(this._onGetCountryChoroplethViewData, this);
this._controller.getCountryChoroplethViewData(country, callback);
},
_onGetCountryChoroplethViewData: function (data) {
this.showCountryChoropleth(data);
},
_getMapViewData: function () {
var callback = $.proxy(this._onGetMapViewData, this);
this._controller.getMapViewData(callback);
},
_onGetMapViewData: function (data) {
this.showWorld(data);
this._getChoroplethViewData();
},
_getChoroplethViewData: function () {
var callback = $.proxy(this._onGetChoroplethViewData, this);
this._controller.getChoroplethViewData(callback);
},
_onGetChoroplethViewData: function (data) {
this.showWorldChoropleth(data);
},
showCountry: function (data) {
this._map.showCountry(data);
},
showWorld: function(data) {
this._map.showWorld(data);
},
show: function () {
this._getMapViewData();
},
showWorldChoropleth: function (data) {
this._map.showWorldChoropleth(data);
},
showCountryChoropleth: function (data) {
this._map.showCountryChoropleth(data);
}
};
//
// SourcesViewModel
//
var SourcesViewModel = this.SourcesViewModel = function (controller, options) {
this._options = options;
this._controller = controller;
this.categories = ko.observableArray([]);
this.metric = ko.observable();
this.selectedCategory = ko.observable();
this.selectedCategoryDescription = ko.computed(this._selectedCategoryDescription, this);
this._init();
};
SourcesViewModel.prototype = {
constructor: SourcesViewModel,
_init: function () {
var options = $.extend({}, {
innerRadius: 60,
outerRadius: 80,
size: { width: 650, height: 400 },
textOffset: 24,
tweenDuration: 1050,
tooltipTextFunction: $.proxy(this._getSliceTooltip, this)
}, this._options);
this._chart = new root.Analytics.PieChart($("#" + this._options.containerId)[0], options);
var onSelectSliceHandler = $.proxy(this._onSelectSlice, this);
$(this._chart).on("onselectslice", onSelectSliceHandler);
this.$this = $(this);
},
_getSliceTooltip: function(d) {
var slicePageViews = d.data.value.pageViews;
var perecentage = (slicePageViews / this._getTotalViews()) * 100;
return d.data.key + ": " + d.data.value.pageViews + " views | " + perecentage.toFixed(0) + "%";
},
_getSourcesViewData: function() {
var callback = $.proxy(this._onGetSourcesViewData, this);
this._controller.getSourcesViewData(callback);
},
_onGetSourcesViewData: function (data) {
var sourceAccessor = {
getName: function(d) { return d.key; },
getValue: function(d) { return d.value.pageViews; },
getSlices: function(data) { return data.categories; },
getTotal: function(data) { return data.metric; },
getTotalName: function(d) { return d.key; },
getTotalValue: function(d) { return d.value.pageViews; }
};
this.categories(data.categories);
this.metric(data.metric);
this._chart.show(data, sourceAccessor);
var categories = data.categories;
var index = 0;
var size = categories.length;
if (size == 0) {
return;
}
if (size > 1) {
for (var i = 1; i < size; i++) {
if (categories[index].value.pageViews < categories[i].value.pageViews) {
index = i;
}
}
this._chart.selectSlice(index);
}
this.selectedCategory(data.categories[index]);
},
isSelected: function(category) {
return category === this.selectedCategory();
},
selectCategory: function(category) {
this.selectedCategory(category);
this._chart.selectSlice(category);
},
_selectedCategoryDescription: function () {
var selectedCategory = this.selectedCategory();
if (!selectedCategory) {
return "";
}
var total = this._getTotalViews();
if (isNaN(total)) {
return "";
}
var perecentage = (selectedCategory.value.pageViews / total) * 100;
return perecentage.toFixed(0) + "%" + " (" + total + ")";
},
_getTotalViews: function() {
var metric = this.metric();
if (!metric) {
return NaN;
}
return metric.value.pageViews;
},
_onSelectSlice: function (eventObject, slice) {
this.selectedCategory(slice);
},
show: function () {
this._getSourcesViewData();
}
};
var ViewModel = this.ViewModel = function (options) {
this._options = options;
var endDateValue = new Date();
var startDateValue = new Date(new Date().setDate(endDateValue.getDate() - 30));
this.endDate = ko.observable(endDateValue);
this.startDate = ko.observable(startDateValue);
this.startDate.subscribe(this._startDateChanged, this);
this.endDate.subscribe(this._endDateChanged, this);
this.stats = ko.observable();
this.metricTypes = ko.observableArray([]);
this.selectedMetricType = ko.observable();
this.init();
};
ViewModel.prototype = {
constructor: ViewModel,
init: function () {
this._controller = new root.Analytics.Controller(this._options.services);
this.metricTypes([
{ key: 0, value: "Pageviews" },
{ key: 1, value: "Unique Pageviews" },
{ key: 2, value: "Average Time" },
{ key: 3, value: "Entrances" },
{ key: 4, value: "Bounce Rate" },
{ key: 5, value: "Exit Rate" }
]);
this.selectedMetricType(root.KeyValueConverter.getKeyValuePairByKey(this.metricTypes(), 0));
this.metricView = new MetricViewModel(this._controller);
this.timeLineView = new TimeLineViewModel(this._controller, this._options.timeLineView);
this.geoMapView = new GeoMapViewModel(this._controller, this._options.geoMapView);
//this.sourcesView = new SourcesViewModel(this._controller, this._options.sourcesView);
this.show();
},
_startDateChanged: function (newValue) {
this.show();
},
_endDateChanged: function (newValue) {
this.show();
},
show: function () {
this._controller.setDateRange(this.startDate(), this.endDate());
this.metricView.show();
this.timeLineView.show();
this.geoMapView.show();
//this.sourcesView.show();
}
};
this.initialize = function (options) {
$(document).ready(function () {
var $element = $("#" + options.containerId);
// in case when control is excluded from rendering by server tags logic,
// a check on the html element existence is performed here:
if ($element.length === 0) {
return;
}
var element = $element[0];
var model = new ViewModel(options);
if (element.id) {
root[element.id] = model;
}
ko.applyBindings(model, element);
var datePickerOptions = {
format: "dd-mm-yyyy",
autoclose: true
};
$(".an-start-date").datepicker(datePickerOptions);
$(".an-end-date").datepicker(datePickerOptions);
});
};
}).apply(root.Analytics, [jQuery, window, document, undefined, ko]);
| {
"content_hash": "b5d7dcd7867b9b2f8cffef281916f8fb",
"timestamp": "",
"source": "github",
"line_count": 426,
"max_line_length": 134,
"avg_line_length": 33.40845070422535,
"alnum_prop": 0.551292861157954,
"repo_name": "kolotygin/RootPosition",
"id": "f6e524662a5a78fc41310efab44167961556919d",
"size": "14234",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Root.Analytics/Scripts/root.Analytics.ViewModel.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "213"
},
{
"name": "C#",
"bytes": "154318"
},
{
"name": "CSS",
"bytes": "94915"
},
{
"name": "HTML",
"bytes": "53"
},
{
"name": "JavaScript",
"bytes": "596348"
}
],
"symlink_target": ""
} |
package com.rtg.launcher;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
import com.rtg.jmx.LocalStats;
import com.rtg.util.cli.CommandLine;
import com.rtg.util.diagnostic.Diagnostic;
import com.rtg.util.diagnostic.DiagnosticListener;
import com.rtg.util.diagnostic.ErrorType;
import com.rtg.util.diagnostic.NoTalkbackSlimException;
import com.rtg.util.diagnostic.SlimException;
import com.rtg.util.diagnostic.Spy;
import com.rtg.util.io.FileUtils;
import com.rtg.util.io.LogFile;
import com.rtg.util.io.LogStream;
/**
* Basic handling of logged command line modules. This class assumes
* the modules have the concept of an output directory into which the
* log is written.
*
*/
public abstract class LoggedCli extends AbstractCli {
static final String LOG_EXT = ".log";
private File mDirectory = null;
private boolean mCleanDirectory = false;
/**
* Determine output directory from args
* @return output directory
*/
protected abstract File outputDirectory();
protected void createDirectory(File dir) {
if (!dir.exists()) {
mDirectory = dir;
}
if (!dir.isDirectory() && !dir.mkdirs()) {
throw new NoTalkbackSlimException(ErrorType.DIRECTORY_NOT_CREATED, dir.getPath());
}
}
protected void cleanDirectory() {
if (mDirectory != null) {
mCleanDirectory = true;
}
}
protected List<DiagnosticListener> initializeOtherListeners() {
return new ArrayList<>();
}
@Override
protected int mainExec(OutputStream out, PrintStream err) throws IOException {
mDirectory = null; // Resets state between multiple invocations
mCleanDirectory = false; // Resets state between multiple invocations
final File outputDir = outputDirectory();
createDirectory(outputDir);
if (LocalStats.MON_DEST_OUTDIR.equals(System.getProperty(LocalStats.MON_DEST))) {
System.setProperty(LocalStats.MON_DEST, new File(outputDir, "jmxmon.log").toString());
LocalStats.startRecording();
}
final String prefix = moduleName().length() > 0 ? moduleName() : applicationName();
final File logFile = new File(outputDir, prefix + LOG_EXT);
removePrevious(logFile);
final LogStream outputLog = new LogFile(logFile);
final long startTime = System.currentTimeMillis();
boolean successful = false;
try {
removePrevious(new File(outputDir, "done"));
removePrevious(new File(outputDir, "progress"));
initializeLogs(outputLog);
try {
final List<DiagnosticListener> listeners = initializeOtherListeners();
try {
final int ret = mainExec(out, outputLog);
if (ret == 0) {
successful = true;
final String time = "Finished successfully in " + timeDifference(System.currentTimeMillis(), startTime) + " s.";
try (PrintStream done = new PrintStream(new FileOutputStream(new File(outputDir, "done")))) {
done.println(time);
}
}
return ret;
} finally {
for (final DiagnosticListener list : listeners) {
Diagnostic.removeListener(list);
}
}
} catch (final SlimException e) {
e.logException();
throw e;
} catch (final IOException | RuntimeException | Error e) {
Diagnostic.userLog(e);
throw e;
}
} finally {
Spy.report();
final String time = getDuration(startTime, successful);
Diagnostic.userLog(time);
Diagnostic.progress(time);
Diagnostic.closeLog();
if (mCleanDirectory) {
FileUtils.deleteFiles(mDirectory);
}
}
}
private void removePrevious(File file) throws IOException {
if (file.exists()) {
if (!file.isFile()) {
throw new IOException("Previous file \"" + file.getPath() + "\" cannot be removed: not a file");
} else if (!file.delete()) {
throw new IOException("Previous file \"" + file.getPath() + "\" could not be removed");
}
}
}
/**
* Get the duration for a run.
* @param startTime start time in milliseconds
* @param successful true if the run was successful
* @return time description
*/
public static String getDuration(long startTime, boolean successful) {
return (successful ? "Finished successfully" : "Run failed") + " in " + timeDifference(System.currentTimeMillis(), startTime) + " s.";
}
/**
* Subclasses implement this method to do the work of the
* module. Modules can assume that logging has been set up, flags
* are configured, and that exceptions will be handled by the
* caller.
*
* @param out the <code>OutputStream</code> to be used for standard output.
* @param log a <code>LogStream</code> to be used for logging.
* @return main return code. 0 for usual operation, non-zero in the case of an error.
* @exception IOException if an error occurs.
*/
protected abstract int mainExec(OutputStream out, LogStream log) throws IOException;
/**
* Do common tasks for initializing logs.
* @param initLog where to send the inital logging.
*/
protected void initializeLogs(final LogStream initLog) {
if (initLog != null) {
Diagnostic.setLogStream(initLog);
Diagnostic.logEnvironment();
Diagnostic.progress("Started");
} else {
Diagnostic.setLogStream();
}
Diagnostic.userLog("Command line arguments: " + mFlags.getCommandLine());
Diagnostic.userLog("Run Id: " + CommandLine.getRunId());
}
protected static long timeDifference(long currentTime, long startTime) {
return (currentTime - startTime) / 1000;
}
}
| {
"content_hash": "54535871373d6a2c8d5dd39186d67990",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 138,
"avg_line_length": 33.25433526011561,
"alnum_prop": 0.6728663306101165,
"repo_name": "RealTimeGenomics/rtg-tools",
"id": "4f0d0c6bdc303eab453808f1e24a9c771c6ff842",
"size": "7154",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/com/rtg/launcher/LoggedCli.java",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Batchfile",
"bytes": "6360"
},
{
"name": "CSS",
"bytes": "26925"
},
{
"name": "HTML",
"bytes": "500647"
},
{
"name": "Java",
"bytes": "8289543"
},
{
"name": "JavaScript",
"bytes": "194293"
},
{
"name": "Shell",
"bytes": "40973"
},
{
"name": "XSLT",
"bytes": "39426"
}
],
"symlink_target": ""
} |
package com.appleframework.distributed.id.snowflake2;
import com.appleframework.distributed.id.IdentityGenerator;
public class EntityIdGeneratorTest {
public static void main(String[] args) throws Exception {
IdentityGenerator idGenerator = BasicEntityIdentityGenerator.getInstance();
for (int i = 0; i < 1000; i++) {
System.out.println(idGenerator.generateId());
}
}
}
| {
"content_hash": "5be8bd826778d7885b6fe811590d6071",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 77,
"avg_line_length": 30.53846153846154,
"alnum_prop": 0.743073047858942,
"repo_name": "sdgdsffdsfff/appleframework",
"id": "02bc46e4650f6370dc95e9cf52526352b37c2f1d",
"size": "397",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "apple-distributed/src/test/java/com/appleframework/distributed/id/snowflake2/EntityIdGeneratorTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "815409"
}
],
"symlink_target": ""
} |
package com.amazonaws.services.ec2.model;
/**
* <p>
*
* </p>
*/
public class VpcAttachment {
/**
*
*/
private String vpcId;
/**
*
*/
private String state;
/**
*
*
* @return
*/
public String getVpcId() {
return vpcId;
}
/**
*
*
* @param vpcId
*/
public void setVpcId(String vpcId) {
this.vpcId = vpcId;
}
/**
*
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param vpcId
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public VpcAttachment withVpcId(String vpcId) {
this.vpcId = vpcId;
return this;
}
/**
*
*
* @return
*/
public String getState() {
return state;
}
/**
*
*
* @param state
*/
public void setState(String state) {
this.state = state;
}
/**
*
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param state
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public VpcAttachment withState(String state) {
this.state = state;
return this;
}
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (vpcId != null) sb.append("VpcId: " + vpcId + ", ");
if (state != null) sb.append("State: " + state + ", ");
sb.append("}");
return sb.toString();
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getVpcId() == null) ? 0 : getVpcId().hashCode());
hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null) return false;
if (obj instanceof VpcAttachment == false) return false;
VpcAttachment other = (VpcAttachment)obj;
if (other.getVpcId() == null ^ this.getVpcId() == null) return false;
if (other.getVpcId() != null && other.getVpcId().equals(this.getVpcId()) == false) return false;
if (other.getState() == null ^ this.getState() == null) return false;
if (other.getState() != null && other.getState().equals(this.getState()) == false) return false;
return true;
}
}
| {
"content_hash": "1dee008af4400f461c26fd962f785299",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 105,
"avg_line_length": 22.44360902255639,
"alnum_prop": 0.5142378559463987,
"repo_name": "SaiNadh001/aws-sdk-for-java",
"id": "9d702e3b9f5143156e5a21443d3e2147fd8e049b",
"size": "3572",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "src/main/java/com/amazonaws/services/ec2/model/VpcAttachment.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "33064436"
}
],
"symlink_target": ""
} |
#ifndef POINTS_TYPES_HPP
#define POINTS_TYPES_HPP
#include <viennagrid/forwards.hpp>
#include <viennagrid/domain/element_creation.hpp>
#include <viennagrid/traits/point.hpp>
typedef viennagrid::point_t<double, viennagrid::cartesian_cs<1> > PointCartesian1D_t;
typedef viennagrid::point_t<double, viennagrid::cartesian_cs<2> > PointCartesian2D_t;
typedef viennagrid::point_t<double, viennagrid::cartesian_cs<3> > PointCartesian3D_t;
typedef viennagrid::point_t<double, viennagrid::cylindrical_cs> PointCylindrical_t;
typedef viennagrid::point_t<double, viennagrid::polar_cs> PointPolar_t;
typedef viennagrid::point_t<double, viennagrid::spherical_cs> PointSpherical_t;
#endif /* end of include guard: POINTS_TYPES_HPP */
| {
"content_hash": "2c9d82adcc4045111e0731f66a3e712d",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 88,
"avg_line_length": 44.529411764705884,
"alnum_prop": 0.7542932628797886,
"repo_name": "jonancm/viennagrid-python",
"id": "2960b8fe6086800e07073754a379e61f881e7a44",
"size": "998",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/points/types.hpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "1287098"
},
{
"name": "Python",
"bytes": "434735"
},
{
"name": "Shell",
"bytes": "1916"
}
],
"symlink_target": ""
} |
#ifndef QmitkDIAppFiberTractographyPerspective_H_
#define QmitkDIAppFiberTractographyPerspective_H_
#include <berryIPerspectiveFactory.h>
class QmitkDIAppFiberTractographyPerspective : public QObject, public berry::IPerspectiveFactory
{
Q_OBJECT
Q_INTERFACES(berry::IPerspectiveFactory)
public:
QmitkDIAppFiberTractographyPerspective() {}
~QmitkDIAppFiberTractographyPerspective() {}
void CreateInitialLayout(berry::IPageLayout::Pointer layout);
};
#endif /* QmitkDIAppFiberTractographyPerspective_H_ */
| {
"content_hash": "9d5f30514bf661ada684be4fe76826f2",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 96,
"avg_line_length": 23.772727272727273,
"alnum_prop": 0.8183556405353728,
"repo_name": "nocnokneo/MITK",
"id": "bd4611e7e6dfa2f6e9f3691420a570afccb8954c",
"size": "1021",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppFiberTractographyPerspective.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "5991982"
},
{
"name": "C++",
"bytes": "29934042"
},
{
"name": "CSS",
"bytes": "52056"
},
{
"name": "IDL",
"bytes": "5583"
},
{
"name": "Java",
"bytes": "350330"
},
{
"name": "JavaScript",
"bytes": "287054"
},
{
"name": "Objective-C",
"bytes": "606620"
},
{
"name": "Perl",
"bytes": "982"
},
{
"name": "Python",
"bytes": "7545"
},
{
"name": "Shell",
"bytes": "5438"
},
{
"name": "TeX",
"bytes": "1204"
},
{
"name": "XSLT",
"bytes": "30684"
}
],
"symlink_target": ""
} |
/**
* @author Ed Spencer
* @class Ext.data.Errors
* @extends Ext.util.MixedCollection
*
* <p>Wraps a collection of validation error responses and provides convenient functions for
* accessing and errors for specific fields.</p>
*
* <p>Usually this class does not need to be instantiated directly - instances are instead created
* automatically when {@link Ext.data.Model#validate validate} on a model instance:</p>
*
<pre><code>
//validate some existing model instance - in this case it returned 2 failures messages
var errors = myModel.validate();
errors.isValid(); //false
errors.length; //2
errors.getByField('name'); // [{field: 'name', message: 'must be present'}]
errors.getByField('title'); // [{field: 'title', message: 'is too short'}]
</code></pre>
*/
Ext.define('Ext.data.Errors', {
extend: 'Ext.util.MixedCollection',
/**
* Returns true if there are no errors in the collection
* @return {Boolean}
*/
isValid: function() {
return this.length === 0;
},
/**
* Returns all of the errors for the given field
* @param {String} fieldName The field to get errors for
* @return {Array} All errors for the given field
*/
getByField: function(fieldName) {
var errors = [],
error, field, i;
for (i = 0; i < this.length; i++) {
error = this.items[i];
if (error.field == fieldName) {
errors.push(error);
}
}
return errors;
}
});
| {
"content_hash": "af456df83d16c811f561eba78a6a7744",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 98,
"avg_line_length": 29.41509433962264,
"alnum_prop": 0.5997434252726106,
"repo_name": "Joppe-A/rce-checkers2",
"id": "47fe31e7116ef95b05b786df2232cde4240e798e",
"size": "1559",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "DocumentCheckerApp/Static/lib/ext/4.0.1/src/data/Errors.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "246"
},
{
"name": "ApacheConf",
"bytes": "40"
},
{
"name": "Batchfile",
"bytes": "292"
},
{
"name": "C#",
"bytes": "485872"
},
{
"name": "CSS",
"bytes": "284048"
},
{
"name": "HTML",
"bytes": "323072"
},
{
"name": "JavaScript",
"bytes": "22259129"
},
{
"name": "Ruby",
"bytes": "4713"
},
{
"name": "Shell",
"bytes": "2738"
},
{
"name": "XSLT",
"bytes": "18116"
}
],
"symlink_target": ""
} |
#pragma once
#include <aws/kafka/Kafka_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace Kafka
{
namespace Model
{
class AWS_KAFKA_API GetBootstrapBrokersResult
{
public:
GetBootstrapBrokersResult();
GetBootstrapBrokersResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
GetBootstrapBrokersResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
*
<p>A string containing one or more hostname:port pairs.</p>
*
*/
inline const Aws::String& GetBootstrapBrokerString() const{ return m_bootstrapBrokerString; }
/**
*
<p>A string containing one or more hostname:port pairs.</p>
*
*/
inline void SetBootstrapBrokerString(const Aws::String& value) { m_bootstrapBrokerString = value; }
/**
*
<p>A string containing one or more hostname:port pairs.</p>
*
*/
inline void SetBootstrapBrokerString(Aws::String&& value) { m_bootstrapBrokerString = std::move(value); }
/**
*
<p>A string containing one or more hostname:port pairs.</p>
*
*/
inline void SetBootstrapBrokerString(const char* value) { m_bootstrapBrokerString.assign(value); }
/**
*
<p>A string containing one or more hostname:port pairs.</p>
*
*/
inline GetBootstrapBrokersResult& WithBootstrapBrokerString(const Aws::String& value) { SetBootstrapBrokerString(value); return *this;}
/**
*
<p>A string containing one or more hostname:port pairs.</p>
*
*/
inline GetBootstrapBrokersResult& WithBootstrapBrokerString(Aws::String&& value) { SetBootstrapBrokerString(std::move(value)); return *this;}
/**
*
<p>A string containing one or more hostname:port pairs.</p>
*
*/
inline GetBootstrapBrokersResult& WithBootstrapBrokerString(const char* value) { SetBootstrapBrokerString(value); return *this;}
/**
*
<p>A string containing one or more DNS names (or IP) and TLS port
* pairs.</p>
*/
inline const Aws::String& GetBootstrapBrokerStringTls() const{ return m_bootstrapBrokerStringTls; }
/**
*
<p>A string containing one or more DNS names (or IP) and TLS port
* pairs.</p>
*/
inline void SetBootstrapBrokerStringTls(const Aws::String& value) { m_bootstrapBrokerStringTls = value; }
/**
*
<p>A string containing one or more DNS names (or IP) and TLS port
* pairs.</p>
*/
inline void SetBootstrapBrokerStringTls(Aws::String&& value) { m_bootstrapBrokerStringTls = std::move(value); }
/**
*
<p>A string containing one or more DNS names (or IP) and TLS port
* pairs.</p>
*/
inline void SetBootstrapBrokerStringTls(const char* value) { m_bootstrapBrokerStringTls.assign(value); }
/**
*
<p>A string containing one or more DNS names (or IP) and TLS port
* pairs.</p>
*/
inline GetBootstrapBrokersResult& WithBootstrapBrokerStringTls(const Aws::String& value) { SetBootstrapBrokerStringTls(value); return *this;}
/**
*
<p>A string containing one or more DNS names (or IP) and TLS port
* pairs.</p>
*/
inline GetBootstrapBrokersResult& WithBootstrapBrokerStringTls(Aws::String&& value) { SetBootstrapBrokerStringTls(std::move(value)); return *this;}
/**
*
<p>A string containing one or more DNS names (or IP) and TLS port
* pairs.</p>
*/
inline GetBootstrapBrokersResult& WithBootstrapBrokerStringTls(const char* value) { SetBootstrapBrokerStringTls(value); return *this;}
/**
*
<p>A string containing one or more DNS names (or IP) and Sasl Scram
* port pairs.</p>
*/
inline const Aws::String& GetBootstrapBrokerStringSaslScram() const{ return m_bootstrapBrokerStringSaslScram; }
/**
*
<p>A string containing one or more DNS names (or IP) and Sasl Scram
* port pairs.</p>
*/
inline void SetBootstrapBrokerStringSaslScram(const Aws::String& value) { m_bootstrapBrokerStringSaslScram = value; }
/**
*
<p>A string containing one or more DNS names (or IP) and Sasl Scram
* port pairs.</p>
*/
inline void SetBootstrapBrokerStringSaslScram(Aws::String&& value) { m_bootstrapBrokerStringSaslScram = std::move(value); }
/**
*
<p>A string containing one or more DNS names (or IP) and Sasl Scram
* port pairs.</p>
*/
inline void SetBootstrapBrokerStringSaslScram(const char* value) { m_bootstrapBrokerStringSaslScram.assign(value); }
/**
*
<p>A string containing one or more DNS names (or IP) and Sasl Scram
* port pairs.</p>
*/
inline GetBootstrapBrokersResult& WithBootstrapBrokerStringSaslScram(const Aws::String& value) { SetBootstrapBrokerStringSaslScram(value); return *this;}
/**
*
<p>A string containing one or more DNS names (or IP) and Sasl Scram
* port pairs.</p>
*/
inline GetBootstrapBrokersResult& WithBootstrapBrokerStringSaslScram(Aws::String&& value) { SetBootstrapBrokerStringSaslScram(std::move(value)); return *this;}
/**
*
<p>A string containing one or more DNS names (or IP) and Sasl Scram
* port pairs.</p>
*/
inline GetBootstrapBrokersResult& WithBootstrapBrokerStringSaslScram(const char* value) { SetBootstrapBrokerStringSaslScram(value); return *this;}
/**
*
<p>A string that contains one or more DNS names (or IP addresses)
* and SASL IAM port pairs.</p>
*/
inline const Aws::String& GetBootstrapBrokerStringSaslIam() const{ return m_bootstrapBrokerStringSaslIam; }
/**
*
<p>A string that contains one or more DNS names (or IP addresses)
* and SASL IAM port pairs.</p>
*/
inline void SetBootstrapBrokerStringSaslIam(const Aws::String& value) { m_bootstrapBrokerStringSaslIam = value; }
/**
*
<p>A string that contains one or more DNS names (or IP addresses)
* and SASL IAM port pairs.</p>
*/
inline void SetBootstrapBrokerStringSaslIam(Aws::String&& value) { m_bootstrapBrokerStringSaslIam = std::move(value); }
/**
*
<p>A string that contains one or more DNS names (or IP addresses)
* and SASL IAM port pairs.</p>
*/
inline void SetBootstrapBrokerStringSaslIam(const char* value) { m_bootstrapBrokerStringSaslIam.assign(value); }
/**
*
<p>A string that contains one or more DNS names (or IP addresses)
* and SASL IAM port pairs.</p>
*/
inline GetBootstrapBrokersResult& WithBootstrapBrokerStringSaslIam(const Aws::String& value) { SetBootstrapBrokerStringSaslIam(value); return *this;}
/**
*
<p>A string that contains one or more DNS names (or IP addresses)
* and SASL IAM port pairs.</p>
*/
inline GetBootstrapBrokersResult& WithBootstrapBrokerStringSaslIam(Aws::String&& value) { SetBootstrapBrokerStringSaslIam(std::move(value)); return *this;}
/**
*
<p>A string that contains one or more DNS names (or IP addresses)
* and SASL IAM port pairs.</p>
*/
inline GetBootstrapBrokersResult& WithBootstrapBrokerStringSaslIam(const char* value) { SetBootstrapBrokerStringSaslIam(value); return *this;}
/**
*
<p>A string containing one or more DNS names (or IP) and TLS port
* pairs.</p>
*/
inline const Aws::String& GetBootstrapBrokerStringPublicTls() const{ return m_bootstrapBrokerStringPublicTls; }
/**
*
<p>A string containing one or more DNS names (or IP) and TLS port
* pairs.</p>
*/
inline void SetBootstrapBrokerStringPublicTls(const Aws::String& value) { m_bootstrapBrokerStringPublicTls = value; }
/**
*
<p>A string containing one or more DNS names (or IP) and TLS port
* pairs.</p>
*/
inline void SetBootstrapBrokerStringPublicTls(Aws::String&& value) { m_bootstrapBrokerStringPublicTls = std::move(value); }
/**
*
<p>A string containing one or more DNS names (or IP) and TLS port
* pairs.</p>
*/
inline void SetBootstrapBrokerStringPublicTls(const char* value) { m_bootstrapBrokerStringPublicTls.assign(value); }
/**
*
<p>A string containing one or more DNS names (or IP) and TLS port
* pairs.</p>
*/
inline GetBootstrapBrokersResult& WithBootstrapBrokerStringPublicTls(const Aws::String& value) { SetBootstrapBrokerStringPublicTls(value); return *this;}
/**
*
<p>A string containing one or more DNS names (or IP) and TLS port
* pairs.</p>
*/
inline GetBootstrapBrokersResult& WithBootstrapBrokerStringPublicTls(Aws::String&& value) { SetBootstrapBrokerStringPublicTls(std::move(value)); return *this;}
/**
*
<p>A string containing one or more DNS names (or IP) and TLS port
* pairs.</p>
*/
inline GetBootstrapBrokersResult& WithBootstrapBrokerStringPublicTls(const char* value) { SetBootstrapBrokerStringPublicTls(value); return *this;}
/**
*
<p>A string containing one or more DNS names (or IP) and Sasl Scram
* port pairs.</p>
*/
inline const Aws::String& GetBootstrapBrokerStringPublicSaslScram() const{ return m_bootstrapBrokerStringPublicSaslScram; }
/**
*
<p>A string containing one or more DNS names (or IP) and Sasl Scram
* port pairs.</p>
*/
inline void SetBootstrapBrokerStringPublicSaslScram(const Aws::String& value) { m_bootstrapBrokerStringPublicSaslScram = value; }
/**
*
<p>A string containing one or more DNS names (or IP) and Sasl Scram
* port pairs.</p>
*/
inline void SetBootstrapBrokerStringPublicSaslScram(Aws::String&& value) { m_bootstrapBrokerStringPublicSaslScram = std::move(value); }
/**
*
<p>A string containing one or more DNS names (or IP) and Sasl Scram
* port pairs.</p>
*/
inline void SetBootstrapBrokerStringPublicSaslScram(const char* value) { m_bootstrapBrokerStringPublicSaslScram.assign(value); }
/**
*
<p>A string containing one or more DNS names (or IP) and Sasl Scram
* port pairs.</p>
*/
inline GetBootstrapBrokersResult& WithBootstrapBrokerStringPublicSaslScram(const Aws::String& value) { SetBootstrapBrokerStringPublicSaslScram(value); return *this;}
/**
*
<p>A string containing one or more DNS names (or IP) and Sasl Scram
* port pairs.</p>
*/
inline GetBootstrapBrokersResult& WithBootstrapBrokerStringPublicSaslScram(Aws::String&& value) { SetBootstrapBrokerStringPublicSaslScram(std::move(value)); return *this;}
/**
*
<p>A string containing one or more DNS names (or IP) and Sasl Scram
* port pairs.</p>
*/
inline GetBootstrapBrokersResult& WithBootstrapBrokerStringPublicSaslScram(const char* value) { SetBootstrapBrokerStringPublicSaslScram(value); return *this;}
/**
*
<p>A string that contains one or more DNS names (or IP addresses)
* and SASL IAM port pairs.</p>
*/
inline const Aws::String& GetBootstrapBrokerStringPublicSaslIam() const{ return m_bootstrapBrokerStringPublicSaslIam; }
/**
*
<p>A string that contains one or more DNS names (or IP addresses)
* and SASL IAM port pairs.</p>
*/
inline void SetBootstrapBrokerStringPublicSaslIam(const Aws::String& value) { m_bootstrapBrokerStringPublicSaslIam = value; }
/**
*
<p>A string that contains one or more DNS names (or IP addresses)
* and SASL IAM port pairs.</p>
*/
inline void SetBootstrapBrokerStringPublicSaslIam(Aws::String&& value) { m_bootstrapBrokerStringPublicSaslIam = std::move(value); }
/**
*
<p>A string that contains one or more DNS names (or IP addresses)
* and SASL IAM port pairs.</p>
*/
inline void SetBootstrapBrokerStringPublicSaslIam(const char* value) { m_bootstrapBrokerStringPublicSaslIam.assign(value); }
/**
*
<p>A string that contains one or more DNS names (or IP addresses)
* and SASL IAM port pairs.</p>
*/
inline GetBootstrapBrokersResult& WithBootstrapBrokerStringPublicSaslIam(const Aws::String& value) { SetBootstrapBrokerStringPublicSaslIam(value); return *this;}
/**
*
<p>A string that contains one or more DNS names (or IP addresses)
* and SASL IAM port pairs.</p>
*/
inline GetBootstrapBrokersResult& WithBootstrapBrokerStringPublicSaslIam(Aws::String&& value) { SetBootstrapBrokerStringPublicSaslIam(std::move(value)); return *this;}
/**
*
<p>A string that contains one or more DNS names (or IP addresses)
* and SASL IAM port pairs.</p>
*/
inline GetBootstrapBrokersResult& WithBootstrapBrokerStringPublicSaslIam(const char* value) { SetBootstrapBrokerStringPublicSaslIam(value); return *this;}
private:
Aws::String m_bootstrapBrokerString;
Aws::String m_bootstrapBrokerStringTls;
Aws::String m_bootstrapBrokerStringSaslScram;
Aws::String m_bootstrapBrokerStringSaslIam;
Aws::String m_bootstrapBrokerStringPublicTls;
Aws::String m_bootstrapBrokerStringPublicSaslScram;
Aws::String m_bootstrapBrokerStringPublicSaslIam;
};
} // namespace Model
} // namespace Kafka
} // namespace Aws
| {
"content_hash": "9fdedf05ea2a1a2248865d6f820d7c7b",
"timestamp": "",
"source": "github",
"line_count": 449,
"max_line_length": 175,
"avg_line_length": 31.962138084632517,
"alnum_prop": 0.6362622813741202,
"repo_name": "cedral/aws-sdk-cpp",
"id": "78cf813efaa9013ee0a1ecc1c322814a9301f132",
"size": "14470",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "aws-cpp-sdk-kafka/include/aws/kafka/model/GetBootstrapBrokersResult.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "294220"
},
{
"name": "C++",
"bytes": "428637022"
},
{
"name": "CMake",
"bytes": "862025"
},
{
"name": "Dockerfile",
"bytes": "11688"
},
{
"name": "HTML",
"bytes": "7904"
},
{
"name": "Java",
"bytes": "352201"
},
{
"name": "Python",
"bytes": "106761"
},
{
"name": "Shell",
"bytes": "10891"
}
],
"symlink_target": ""
} |
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_STRATEGIES_SPHERICAL_DISTANCE_CROSS_TRACK_HPP
#define BOOST_GEOMETRY_STRATEGIES_SPHERICAL_DISTANCE_CROSS_TRACK_HPP
#include <boost/config.hpp>
#include <boost/concept_check.hpp>
#include <boost/mpl/if.hpp>
#include <boost/type_traits.hpp>
#include <boost/geometry/core/cs.hpp>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/radian_access.hpp>
#include <boost/geometry/algorithms/detail/course.hpp>
#include <boost/geometry/strategies/distance.hpp>
#include <boost/geometry/strategies/concepts/distance_concept.hpp>
#include <boost/geometry/strategies/spherical/distance_haversine.hpp>
#include <boost/geometry/util/promote_floating_point.hpp>
#include <boost/geometry/util/math.hpp>
#ifdef BOOST_GEOMETRY_DEBUG_CROSS_TRACK
# include <boost/geometry/io/dsv/write.hpp>
#endif
namespace boost { namespace geometry
{
namespace strategy { namespace distance
{
/*!
\brief Strategy functor for distance point to segment calculation
\ingroup strategies
\details Class which calculates the distance of a point to a segment, for points on a sphere or globe
\see http://williams.best.vwh.net/avform.htm
\tparam CalculationType \tparam_calculation
\tparam Strategy underlying point-point distance strategy, defaults to haversine
\qbk{
[heading See also]
[link geometry.reference.algorithms.distance.distance_3_with_strategy distance (with strategy)]
}
*/
template
<
typename CalculationType = void,
typename Strategy = haversine<double, CalculationType>
>
class cross_track
{
public :
template <typename Point, typename PointOfSegment>
struct return_type
: promote_floating_point
<
typename select_calculation_type
<
Point,
PointOfSegment,
CalculationType
>::type
>
{};
inline cross_track()
{}
explicit inline cross_track(typename Strategy::radius_type const& r)
: m_strategy(r)
{}
inline cross_track(Strategy const& s)
: m_strategy(s)
{}
// It might be useful in the future
// to overload constructor with strategy info.
// crosstrack(...) {}
template <typename Point, typename PointOfSegment>
inline typename return_type<Point, PointOfSegment>::type
apply(Point const& p, PointOfSegment const& sp1, PointOfSegment const& sp2) const
{
#if !defined(BOOST_MSVC)
BOOST_CONCEPT_ASSERT
(
(concept::PointDistanceStrategy<Strategy, Point, PointOfSegment>)
);
#endif
typedef typename return_type<Point, PointOfSegment>::type return_type;
// http://williams.best.vwh.net/avform.htm#XTE
return_type d1 = m_strategy.apply(sp1, p);
return_type d3 = m_strategy.apply(sp1, sp2);
if (geometry::math::equals(d3, 0.0))
{
// "Degenerate" segment, return either d1 or d2
return d1;
}
return_type d2 = m_strategy.apply(sp2, p);
return_type crs_AD = geometry::detail::course<return_type>(sp1, p);
return_type crs_AB = geometry::detail::course<return_type>(sp1, sp2);
return_type crs_BA = crs_AB - geometry::math::pi<return_type>();
return_type crs_BD = geometry::detail::course<return_type>(sp2, p);
return_type d_crs1 = crs_AD - crs_AB;
return_type d_crs2 = crs_BD - crs_BA;
// d1, d2, d3 are in principle not needed, only the sign matters
return_type projection1 = cos( d_crs1 ) * d1 / d3;
return_type projection2 = cos( d_crs2 ) * d2 / d3;
#ifdef BOOST_GEOMETRY_DEBUG_CROSS_TRACK
std::cout << "Course " << dsv(sp1) << " to " << dsv(p) << " " << crs_AD * geometry::math::r2d << std::endl;
std::cout << "Course " << dsv(sp1) << " to " << dsv(sp2) << " " << crs_AB * geometry::math::r2d << std::endl;
std::cout << "Course " << dsv(sp2) << " to " << dsv(p) << " " << crs_BD * geometry::math::r2d << std::endl;
std::cout << "Projection AD-AB " << projection1 << " : " << d_crs1 * geometry::math::r2d << std::endl;
std::cout << "Projection BD-BA " << projection2 << " : " << d_crs2 * geometry::math::r2d << std::endl;
#endif
if(projection1 > 0.0 && projection2 > 0.0)
{
return_type XTD = radius() * geometry::math::abs( asin( sin( d1 / radius() ) * sin( d_crs1 ) ));
#ifdef BOOST_GEOMETRY_DEBUG_CROSS_TRACK
std::cout << "Projection ON the segment" << std::endl;
std::cout << "XTD: " << XTD << " d1: " << d1 << " d2: " << d2 << std::endl;
#endif
// Return shortest distance, projected point on segment sp1-sp2
return return_type(XTD);
}
else
{
#ifdef BOOST_GEOMETRY_DEBUG_CROSS_TRACK
std::cout << "Projection OUTSIDE the segment" << std::endl;
#endif
// Return shortest distance, project either on point sp1 or sp2
return return_type( (std::min)( d1 , d2 ) );
}
}
inline typename Strategy::radius_type radius() const
{ return m_strategy.radius(); }
private :
Strategy m_strategy;
};
#ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
namespace services
{
template <typename CalculationType, typename Strategy>
struct tag<cross_track<CalculationType, Strategy> >
{
typedef strategy_tag_distance_point_segment type;
};
template <typename CalculationType, typename Strategy, typename P, typename PS>
struct return_type<cross_track<CalculationType, Strategy>, P, PS>
: cross_track<CalculationType, Strategy>::template return_type<P, PS>
{};
template <typename CalculationType, typename Strategy>
struct comparable_type<cross_track<CalculationType, Strategy> >
{
// There is no shortcut, so the strategy itself is its comparable type
typedef cross_track<CalculationType, Strategy> type;
};
template
<
typename CalculationType,
typename Strategy
>
struct get_comparable<cross_track<CalculationType, Strategy> >
{
typedef typename comparable_type
<
cross_track<CalculationType, Strategy>
>::type comparable_type;
public :
static inline comparable_type apply(cross_track<CalculationType, Strategy> const& strategy)
{
return comparable_type(strategy.radius());
}
};
template
<
typename CalculationType,
typename Strategy,
typename P, typename PS
>
struct result_from_distance<cross_track<CalculationType, Strategy>, P, PS>
{
private :
typedef typename cross_track<CalculationType, Strategy>::template return_type<P, PS> return_type;
public :
template <typename T>
static inline return_type apply(cross_track<CalculationType, Strategy> const& , T const& distance)
{
return distance;
}
};
/*
TODO: spherical polar coordinate system requires "get_as_radian_equatorial<>"
template <typename Point, typename PointOfSegment, typename Strategy>
struct default_strategy
<
segment_tag, Point, PointOfSegment,
spherical_polar_tag, spherical_polar_tag,
Strategy
>
{
typedef cross_track
<
void,
typename boost::mpl::if_
<
boost::is_void<Strategy>,
typename default_strategy
<
point_tag, Point, PointOfSegment,
spherical_polar_tag, spherical_polar_tag
>::type,
Strategy
>::type
> type;
};
*/
template <typename Point, typename PointOfSegment, typename Strategy>
struct default_strategy
<
point_tag, segment_tag, Point, PointOfSegment,
spherical_equatorial_tag, spherical_equatorial_tag,
Strategy
>
{
typedef cross_track
<
void,
typename boost::mpl::if_
<
boost::is_void<Strategy>,
typename default_strategy
<
point_tag, point_tag, Point, PointOfSegment,
spherical_equatorial_tag, spherical_equatorial_tag
>::type,
Strategy
>::type
> type;
};
template <typename PointOfSegment, typename Point, typename Strategy>
struct default_strategy
<
segment_tag, point_tag, PointOfSegment, Point,
spherical_equatorial_tag, spherical_equatorial_tag,
Strategy
>
{
typedef typename default_strategy
<
point_tag, segment_tag, Point, PointOfSegment,
spherical_equatorial_tag, spherical_equatorial_tag,
Strategy
>::type type;
};
} // namespace services
#endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
}} // namespace strategy::distance
#ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS
#endif
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_STRATEGIES_SPHERICAL_DISTANCE_CROSS_TRACK_HPP
| {
"content_hash": "c49540c74e5074cc0cc1d2c12159cce2",
"timestamp": "",
"source": "github",
"line_count": 325,
"max_line_length": 117,
"avg_line_length": 28.716923076923077,
"alnum_prop": 0.6295939140683596,
"repo_name": "Ant-OS/android_packages_apps_OTAUpdates",
"id": "a40f03dbafd87575fee0886a4bf45ca0601206d6",
"size": "9333",
"binary": false,
"copies": "19",
"ref": "refs/heads/master",
"path": "jni/boost_1_57_0/boost/geometry/strategies/spherical/distance_cross_track.hpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "173932"
},
{
"name": "Batchfile",
"bytes": "31151"
},
{
"name": "C",
"bytes": "2920428"
},
{
"name": "C#",
"bytes": "40804"
},
{
"name": "C++",
"bytes": "156317088"
},
{
"name": "CMake",
"bytes": "13760"
},
{
"name": "CSS",
"bytes": "229619"
},
{
"name": "Cuda",
"bytes": "26521"
},
{
"name": "FORTRAN",
"bytes": "1387"
},
{
"name": "Gnuplot",
"bytes": "2361"
},
{
"name": "Groff",
"bytes": "8039"
},
{
"name": "HTML",
"bytes": "144391206"
},
{
"name": "IDL",
"bytes": "14"
},
{
"name": "Java",
"bytes": "160971"
},
{
"name": "JavaScript",
"bytes": "132031"
},
{
"name": "Lex",
"bytes": "1231"
},
{
"name": "Makefile",
"bytes": "1026404"
},
{
"name": "Max",
"bytes": "36857"
},
{
"name": "Objective-C",
"bytes": "3127"
},
{
"name": "Objective-C++",
"bytes": "207"
},
{
"name": "PHP",
"bytes": "59030"
},
{
"name": "Perl",
"bytes": "29502"
},
{
"name": "Perl6",
"bytes": "2053"
},
{
"name": "Python",
"bytes": "1859144"
},
{
"name": "QML",
"bytes": "593"
},
{
"name": "QMake",
"bytes": "6974"
},
{
"name": "Rebol",
"bytes": "354"
},
{
"name": "Shell",
"bytes": "365897"
},
{
"name": "Tcl",
"bytes": "1172"
},
{
"name": "TeX",
"bytes": "13404"
},
{
"name": "XSLT",
"bytes": "751497"
},
{
"name": "Yacc",
"bytes": "18910"
}
],
"symlink_target": ""
} |
<?php
namespace PHPMailer\PHPMailer;
/**
* PHPMailer RFC821 SMTP email transport class.
* Implements RFC 821 SMTP commands and provides some utility methods for sending mail to an SMTP server.
*
* @package PHPMailer
* @author Chris Ryan
* @author Marcus Bointon <phpmailer@synchromedia.co.uk>
*/
class SMTP
{
/**
* The PHPMailer SMTP version number.
*
* @var string
*/
const VERSION = '6.0.0';
/**
* SMTP line break constant.
*
* @var string
*/
const LE = "\r\n";
/**
* The SMTP port to use if one is not specified.
*
* @var integer
*/
const DEFAULT_PORT = 25;
/**
* The maximum line length allowed by RFC 2822 section 2.1.1
*
* @var integer
*/
const MAX_LINE_LENGTH = 998;
/**
* Debug level for no output
*/
const DEBUG_OFF = 0;
/**
* Debug level to show client -> server messages
*/
const DEBUG_CLIENT = 1;
/**
* Debug level to show client -> server and server -> client messages
*/
const DEBUG_SERVER = 2;
/**
* Debug level to show connection status, client -> server and server -> client messages
*/
const DEBUG_CONNECTION = 3;
/**
* Debug level to show all messages
*/
const DEBUG_LOWLEVEL = 4;
/**
* Debug output level.
* Options:
* * self::DEBUG_OFF (`0`) No debug output, default
* * self::DEBUG_CLIENT (`1`) Client commands
* * self::DEBUG_SERVER (`2`) Client commands and server responses
* * self::DEBUG_CONNECTION (`3`) As DEBUG_SERVER plus connection status
* * self::DEBUG_LOWLEVEL (`4`) Low-level data output, all messages
*
* @var integer
*/
public $do_debug = self::DEBUG_OFF;
/**
* How to handle debug output.
* Options:
* * `echo` Output plain-text as-is, appropriate for CLI
* * `html` Output escaped, line breaks converted to `<br>`, appropriate for browser output
* * `error_log` Output to error log as configured in php.ini
* Alternatively, you can provide a callable expecting two params: a message string and the debug level:
* <code>
* $smtp->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";};
* </code>
* Alternatively, you can pass in an instance of a PSR-3 compatible logger, though only `debug`
* level output is used:
* <code>
* $mail->Debugoutput = new myPsr3Logger;
* </code>
*
* @var string|callable|Psr\Log\LoggerInterface
*/
public $Debugoutput = 'echo';
/**
* Whether to use VERP.
*
* @see http://en.wikipedia.org/wiki/Variable_envelope_return_path
* @see http://www.postfix.org/VERP_README.html Info on VERP
* @var boolean
*/
public $do_verp = false;
/**
* The timeout value for connection, in seconds.
* Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
* This needs to be quite high to function correctly with hosts using greetdelay as an anti-spam measure.
*
* @see http://tools.ietf.org/html/rfc2821#section-4.5.3.2
* @var integer
*/
public $Timeout = 300;
/**
* How long to wait for commands to complete, in seconds.
* Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
*
* @var integer
*/
public $Timelimit = 300;
/**
* @var array Patterns to extract an SMTP transaction id from reply to a DATA command.
* The first capture group in each regex will be used as the ID.
* MS ESMTP returns the message ID, which may not be correct for internal tracking.
*/
protected $smtp_transaction_id_patterns = [
'exim' => '/[0-9]{3} OK id=(.*)/',
'sendmail' => '/[0-9]{3} 2.0.0 (.*) Message/',
'postfix' => '/[0-9]{3} 2.0.0 Ok: queued as (.*)/',
'Microsoft_ESMTP' => '/[0-9]{3} 2.[0-9].0 (.*)@(?:.*) Queued mail for delivery/'
];
/**
* @var string The last transaction ID issued in response to a DATA command,
* if one was detected
*/
protected $last_smtp_transaction_id;
/**
* The socket for the server connection.
*
* @var resource
*/
protected $smtp_conn;
/**
* Error information, if any, for the last SMTP command.
*
* @var array
*/
protected $error = [
'error' => '',
'detail' => '',
'smtp_code' => '',
'smtp_code_ex' => ''
];
/**
* The reply the server sent to us for HELO.
* If null, no HELO string has yet been received.
*
* @var string|null
*/
protected $helo_rply = null;
/**
* The set of SMTP extensions sent in reply to EHLO command.
* Indexes of the array are extension names.
* Value at index 'HELO' or 'EHLO' (according to command that was sent)
* represents the server name. In case of HELO it is the only element of the array.
* Other values can be boolean TRUE or an array containing extension options.
* If null, no HELO/EHLO string has yet been received.
*
* @var array|null
*/
protected $server_caps = null;
/**
* The most recent reply received from the server.
*
* @var string
*/
protected $last_reply = '';
/**
* Output debugging info via a user-selected method.
*
* @param string $str Debug string to output
* @param integer $level The debug level of this message; see DEBUG_* constants
*
* @see SMTP::$Debugoutput
* @see SMTP::$do_debug
*/
protected function edebug($str, $level = 0)
{
if ($level > $this->do_debug) {
return;
}
//Is this a PSR-3 logger?
if (is_a($this->Debugoutput, 'Psr\Log\LoggerInterface')) {
$this->Debugoutput->debug($str);
return;
}
//Avoid clash with built-in function names
if (!in_array($this->Debugoutput, ['error_log', 'html', 'echo']) and is_callable($this->Debugoutput)) {
call_user_func($this->Debugoutput, $str, $level);
return;
}
switch ($this->Debugoutput) {
case 'error_log':
//Don't output, just log
error_log($str);
break;
case 'html':
//Cleans up output a bit for a better looking, HTML-safe output
echo gmdate('Y-m-d H:i:s'), ' ', htmlentities(
preg_replace('/[\r\n]+/', '', $str),
ENT_QUOTES,
'UTF-8'
), "<br>\n";
break;
case 'echo':
default:
//Normalize line breaks
$str = preg_replace('/\r\n|\r/ms', "\n", $str);
echo gmdate('Y-m-d H:i:s'),
"\t",
//Trim trailing space
trim(
//Indent for readability, except for trailing break
str_replace(
"\n",
"\n \t ",
trim($str)
)
),
"\n";
}
}
/**
* Connect to an SMTP server.
*
* @param string $host SMTP server IP or host name
* @param integer $port The port number to connect to
* @param integer $timeout How long to wait for the connection to open
* @param array $options An array of options for stream_context_create()
*
* @return boolean
*/
public function connect($host, $port = null, $timeout = 30, $options = [])
{
static $streamok;
//This is enabled by default since 5.0.0 but some providers disable it
//Check this once and cache the result
if (is_null($streamok)) {
$streamok = function_exists('stream_socket_client');
}
// Clear errors to avoid confusion
$this->setError('');
// Make sure we are __not__ connected
if ($this->connected()) {
// Already connected, generate error
$this->setError('Already connected to a server');
return false;
}
if (empty($port)) {
$port = self::DEFAULT_PORT;
}
// Connect to the SMTP server
$this->edebug(
"Connection: opening to $host:$port, timeout=$timeout, options=" .
(count($options) > 0 ? var_export($options, true): 'array()'),
self::DEBUG_CONNECTION
);
$errno = 0;
$errstr = '';
if ($streamok) {
$socket_context = stream_context_create($options);
set_error_handler([$this, 'errorHandler']);
$this->smtp_conn = stream_socket_client(
$host . ":" . $port,
$errno,
$errstr,
$timeout,
STREAM_CLIENT_CONNECT,
$socket_context
);
restore_error_handler();
} else {
//Fall back to fsockopen which should work in more places, but is missing some features
$this->edebug(
"Connection: stream_socket_client not available, falling back to fsockopen",
self::DEBUG_CONNECTION
);
set_error_handler([$this, 'errorHandler']);
$this->smtp_conn = fsockopen(
$host,
$port,
$errno,
$errstr,
$timeout
);
restore_error_handler();
}
// Verify we connected properly
if (!is_resource($this->smtp_conn)) {
$this->setError(
'Failed to connect to server',
$errno,
$errstr
);
$this->edebug(
'SMTP ERROR: ' . $this->error['error']
. ": $errstr ($errno)",
self::DEBUG_CLIENT
);
return false;
}
$this->edebug('Connection: opened', self::DEBUG_CONNECTION);
// SMTP server can take longer to respond, give longer timeout for first read
// Windows does not have support for this timeout function
if (substr(PHP_OS, 0, 3) != 'WIN') {
$max = ini_get('max_execution_time');
// Don't bother if unlimited
if (0 != $max and $timeout > $max) {
@set_time_limit($timeout);
}
stream_set_timeout($this->smtp_conn, $timeout, 0);
}
// Get any announcement
$announce = $this->get_lines();
$this->edebug('SERVER -> CLIENT: ' . $announce, self::DEBUG_SERVER);
return true;
}
/**
* Initiate a TLS (encrypted) session.
*
* @return boolean
*/
public function startTLS()
{
if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) {
return false;
}
//Allow the best TLS version(s) we can
$crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT;
//PHP 5.6.7 dropped inclusion of TLS 1.1 and 1.2 in STREAM_CRYPTO_METHOD_TLS_CLIENT
//so add them back in manually if we can
if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
}
// Begin encrypted connection
set_error_handler([$this, 'errorHandler']);
$crypto_ok = stream_socket_enable_crypto(
$this->smtp_conn,
true,
$crypto_method
);
restore_error_handler();
return (boolean)$crypto_ok;
}
/**
* Perform SMTP authentication.
* Must be run after hello().
*
* @param string $username The user name
* @param string $password The password
* @param string $authtype The auth type (CRAM-MD5, PLAIN, LOGIN, XOAUTH2)
* @param OAuth $OAuth An optional OAuth instance for XOAUTH2 authentication
*
* @return boolean True if successfully authenticated.
* @see hello()
*/
public function authenticate(
$username,
$password,
$authtype = null,
$OAuth = null
) {
if (!$this->server_caps) {
$this->setError('Authentication is not allowed before HELO/EHLO');
return false;
}
if (array_key_exists('EHLO', $this->server_caps)) {
// SMTP extensions are available; try to find a proper authentication method
if (!array_key_exists('AUTH', $this->server_caps)) {
$this->setError('Authentication is not allowed at this stage');
// 'at this stage' means that auth may be allowed after the stage changes
// e.g. after STARTTLS
return false;
}
$this->edebug('Auth method requested: ' . ($authtype ? $authtype : 'UNKNOWN'), self::DEBUG_LOWLEVEL);
$this->edebug(
'Auth methods available on the server: ' . implode(',', $this->server_caps['AUTH']),
self::DEBUG_LOWLEVEL
);
//If we have requested a specific auth type, check the server supports it before trying others
if (!in_array($authtype, $this->server_caps['AUTH'])) {
$this->edebug('Requested auth method not available: ' . $authtype, self::DEBUG_LOWLEVEL);
$authtype = null;
}
if (empty($authtype)) {
//If no auth mechanism is specified, attempt to use these, in this order
//Try CRAM-MD5 first as it's more secure than the others
foreach (['CRAM-MD5', 'LOGIN', 'PLAIN', 'XOAUTH2'] as $method) {
if (in_array($method, $this->server_caps['AUTH'])) {
$authtype = $method;
break;
}
}
if (empty($authtype)) {
$this->setError('No supported authentication methods found');
return false;
}
self::edebug('Auth method selected: ' . $authtype, self::DEBUG_LOWLEVEL);
}
if (!in_array($authtype, $this->server_caps['AUTH'])) {
$this->setError("The requested authentication method \"$authtype\" is not supported by the server");
return false;
}
} elseif (empty($authtype)) {
$authtype = 'LOGIN';
}
switch ($authtype) {
case 'PLAIN':
// Start authentication
if (!$this->sendCommand('AUTH', 'AUTH PLAIN', 334)) {
return false;
}
// Send encoded username and password
if (!$this->sendCommand(
'User & Password',
base64_encode("\0" . $username . "\0" . $password),
235
)
) {
return false;
}
break;
case 'LOGIN':
// Start authentication
if (!$this->sendCommand('AUTH', 'AUTH LOGIN', 334)) {
return false;
}
if (!$this->sendCommand("Username", base64_encode($username), 334)) {
return false;
}
if (!$this->sendCommand("Password", base64_encode($password), 235)) {
return false;
}
break;
case 'CRAM-MD5':
// Start authentication
if (!$this->sendCommand('AUTH CRAM-MD5', 'AUTH CRAM-MD5', 334)) {
return false;
}
// Get the challenge
$challenge = base64_decode(substr($this->last_reply, 4));
// Build the response
$response = $username . ' ' . $this->hmac($challenge, $password);
// send encoded credentials
return $this->sendCommand('Username', base64_encode($response), 235);
case 'XOAUTH2':
//The OAuth instance must be set up prior to requesting auth.
if (is_null($OAuth)) {
return false;
}
$oauth = $OAuth->getOauth64();
// Start authentication
if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) {
return false;
}
break;
default:
$this->setError("Authentication method \"$authtype\" is not supported");
return false;
}
return true;
}
/**
* Calculate an MD5 HMAC hash.
* Works like hash_hmac('md5', $data, $key)
* in case that function is not available
*
* @param string $data The data to hash
* @param string $key The key to hash with
*
* @return string
*/
protected function hmac($data, $key)
{
if (function_exists('hash_hmac')) {
return hash_hmac('md5', $data, $key);
}
// The following borrowed from
// http://php.net/manual/en/function.mhash.php#27225
// RFC 2104 HMAC implementation for php.
// Creates an md5 HMAC.
// Eliminates the need to install mhash to compute a HMAC
// by Lance Rushing
$bytelen = 64; // byte length for md5
if (strlen($key) > $bytelen) {
$key = pack('H*', md5($key));
}
$key = str_pad($key, $bytelen, chr(0x00));
$ipad = str_pad('', $bytelen, chr(0x36));
$opad = str_pad('', $bytelen, chr(0x5c));
$k_ipad = $key ^ $ipad;
$k_opad = $key ^ $opad;
return md5($k_opad . pack('H*', md5($k_ipad . $data)));
}
/**
* Check connection state.
*
* @return boolean True if connected.
*/
public function connected()
{
if (is_resource($this->smtp_conn)) {
$sock_status = stream_get_meta_data($this->smtp_conn);
if ($sock_status['eof']) {
// The socket is valid but we are not connected
$this->edebug(
'SMTP NOTICE: EOF caught while checking if connected',
self::DEBUG_CLIENT
);
$this->close();
return false;
}
return true; // everything looks good
}
return false;
}
/**
* Close the socket and clean up the state of the class.
* Don't use this function without first trying to use QUIT.
*
* @see quit()
*/
public function close()
{
$this->setError('');
$this->server_caps = null;
$this->helo_rply = null;
if (is_resource($this->smtp_conn)) {
// close the connection and cleanup
fclose($this->smtp_conn);
$this->smtp_conn = null; //Makes for cleaner serialization
$this->edebug('Connection: closed', self::DEBUG_CONNECTION);
}
}
/**
* Send an SMTP DATA command.
* Issues a data command and sends the msg_data to the server,
* finializing the mail transaction. $msg_data is the message
* that is to be send with the headers. Each header needs to be
* on a single line followed by a <CRLF> with the message headers
* and the message body being separated by an additional <CRLF>.
* Implements RFC 821: DATA <CRLF>
*
* @param string $msg_data Message data to send
*
* @return boolean
*/
public function data($msg_data)
{
//This will use the standard timelimit
if (!$this->sendCommand('DATA', 'DATA', 354)) {
return false;
}
/* The server is ready to accept data!
* According to rfc821 we should not send more than 1000 characters on a single line (including the LE)
* so we will break the data up into lines by \r and/or \n then if needed we will break each of those into
* smaller lines to fit within the limit.
* We will also look for lines that start with a '.' and prepend an additional '.'.
* NOTE: this does not count towards line-length limit.
*/
// Normalize line breaks before exploding
$lines = explode("\n", str_replace(["\r\n", "\r"], "\n", $msg_data));
/* To distinguish between a complete RFC822 message and a plain message body, we check if the first field
* of the first line (':' separated) does not contain a space then it _should_ be a header and we will
* process all lines before a blank line as headers.
*/
$field = substr($lines[0], 0, strpos($lines[0], ':'));
$in_headers = false;
if (!empty($field) and strpos($field, ' ') === false) {
$in_headers = true;
}
foreach ($lines as $line) {
$lines_out = [];
if ($in_headers and $line == '') {
$in_headers = false;
}
//Break this line up into several smaller lines if it's too long
//Micro-optimisation: isset($str[$len]) is faster than (strlen($str) > $len),
while (isset($line[self::MAX_LINE_LENGTH])) {
//Working backwards, try to find a space within the last MAX_LINE_LENGTH chars of the line to break on
//so as to avoid breaking in the middle of a word
$pos = strrpos(substr($line, 0, self::MAX_LINE_LENGTH), ' ');
//Deliberately matches both false and 0
if (!$pos) {
//No nice break found, add a hard break
$pos = self::MAX_LINE_LENGTH - 1;
$lines_out[] = substr($line, 0, $pos);
$line = substr($line, $pos);
} else {
//Break at the found point
$lines_out[] = substr($line, 0, $pos);
//Move along by the amount we dealt with
$line = substr($line, $pos + 1);
}
//If processing headers add a LWSP-char to the front of new line RFC822 section 3.1.1
if ($in_headers) {
$line = "\t" . $line;
}
}
$lines_out[] = $line;
//Send the lines to the server
foreach ($lines_out as $line_out) {
//RFC2821 section 4.5.2
if (!empty($line_out) and $line_out[0] == '.') {
$line_out = '.' . $line_out;
}
$this->client_send($line_out . static::LE);
}
}
//Message data has been sent, complete the command
//Increase timelimit for end of DATA command
$savetimelimit = $this->Timelimit;
$this->Timelimit = $this->Timelimit * 2;
$result = $this->sendCommand('DATA END', '.', 250);
$this->recordLastTransactionID();
//Restore timelimit
$this->Timelimit = $savetimelimit;
return $result;
}
/**
* Send an SMTP HELO or EHLO command.
* Used to identify the sending server to the receiving server.
* This makes sure that client and server are in a known state.
* Implements RFC 821: HELO <SP> <domain> <CRLF>
* and RFC 2821 EHLO.
*
* @param string $host The host name or IP to connect to
*
* @return boolean
*/
public function hello($host = '')
{
//Try extended hello first (RFC 2821)
return (boolean)($this->sendHello('EHLO', $host) or $this->sendHello('HELO', $host));
}
/**
* Send an SMTP HELO or EHLO command.
* Low-level implementation used by hello()
*
* @param string $hello The HELO string
* @param string $host The hostname to say we are
*
* @return boolean
* @see hello()
*/
protected function sendHello($hello, $host)
{
$noerror = $this->sendCommand($hello, $hello . ' ' . $host, 250);
$this->helo_rply = $this->last_reply;
if ($noerror) {
$this->parseHelloFields($hello);
} else {
$this->server_caps = null;
}
return $noerror;
}
/**
* Parse a reply to HELO/EHLO command to discover server extensions.
* In case of HELO, the only parameter that can be discovered is a server name.
*
* @param string $type `HELO` or `EHLO`
*/
protected function parseHelloFields($type)
{
$this->server_caps = [];
$lines = explode("\n", $this->helo_rply);
foreach ($lines as $n => $s) {
//First 4 chars contain response code followed by - or space
$s = trim(substr($s, 4));
if (empty($s)) {
continue;
}
$fields = explode(' ', $s);
if (!empty($fields)) {
if (!$n) {
$name = $type;
$fields = $fields[0];
} else {
$name = array_shift($fields);
switch ($name) {
case 'SIZE':
$fields = ($fields ? $fields[0] : 0);
break;
case 'AUTH':
if (!is_array($fields)) {
$fields = [];
}
break;
default:
$fields = true;
}
}
$this->server_caps[$name] = $fields;
}
}
}
/**
* Send an SMTP MAIL command.
* Starts a mail transaction from the email address specified in
* $from. Returns true if successful or false otherwise. If True
* the mail transaction is started and then one or more recipient
* commands may be called followed by a data command.
* Implements RFC 821: MAIL <SP> FROM:<reverse-path> <CRLF>
*
* @param string $from Source address of this message
*
* @return boolean
*/
public function mail($from)
{
$useVerp = ($this->do_verp ? ' XVERP' : '');
return $this->sendCommand(
'MAIL FROM',
'MAIL FROM:<' . $from . '>' . $useVerp,
250
);
}
/**
* Send an SMTP QUIT command.
* Closes the socket if there is no error or the $close_on_error argument is true.
* Implements from RFC 821: QUIT <CRLF>
*
* @param boolean $close_on_error Should the connection close if an error occurs?
*
* @return boolean
*/
public function quit($close_on_error = true)
{
$noerror = $this->sendCommand('QUIT', 'QUIT', 221);
$err = $this->error; //Save any error
if ($noerror or $close_on_error) {
$this->close();
$this->error = $err; //Restore any error from the quit command
}
return $noerror;
}
/**
* Send an SMTP RCPT command.
* Sets the TO argument to $toaddr.
* Returns true if the recipient was accepted false if it was rejected.
* Implements from RFC 821: RCPT <SP> TO:<forward-path> <CRLF>
*
* @param string $address The address the message is being sent to
*
* @return boolean
*/
public function recipient($address)
{
return $this->sendCommand(
'RCPT TO',
'RCPT TO:<' . $address . '>',
[250, 251]
);
}
/**
* Send an SMTP RSET command.
* Abort any transaction that is currently in progress.
* Implements RFC 821: RSET <CRLF>
*
* @return boolean True on success.
*/
public function reset()
{
return $this->sendCommand('RSET', 'RSET', 250);
}
/**
* Send a command to an SMTP server and check its return code.
*
* @param string $command The command name - not sent to the server
* @param string $commandstring The actual command to send
* @param integer|array $expect One or more expected integer success codes
*
* @return boolean True on success.
*/
protected function sendCommand($command, $commandstring, $expect)
{
if (!$this->connected()) {
$this->setError("Called $command without being connected");
return false;
}
//Reject line breaks in all commands
if (strpos($commandstring, "\n") !== false or strpos($commandstring, "\r") !== false) {
$this->setError("Command '$command' contained line breaks");
return false;
}
$this->client_send($commandstring . static::LE);
$this->last_reply = $this->get_lines();
// Fetch SMTP code and possible error code explanation
$matches = [];
if (preg_match("/^([0-9]{3})[ -](?:([0-9]\\.[0-9]\\.[0-9]) )?/", $this->last_reply, $matches)) {
$code = $matches[1];
$code_ex = (count($matches) > 2 ? $matches[2] : null);
// Cut off error code from each response line
$detail = preg_replace(
"/{$code}[ -]" .
($code_ex ? str_replace('.', '\\.', $code_ex) . ' ' : '') . "/m",
'',
$this->last_reply
);
} else {
// Fall back to simple parsing if regex fails
$code = substr($this->last_reply, 0, 3);
$code_ex = null;
$detail = substr($this->last_reply, 4);
}
$this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER);
if (!in_array($code, (array)$expect)) {
$this->setError(
"$command command failed",
$detail,
$code,
$code_ex
);
$this->edebug(
'SMTP ERROR: ' . $this->error['error'] . ': ' . $this->last_reply,
self::DEBUG_CLIENT
);
return false;
}
$this->setError('');
return true;
}
/**
* Send an SMTP SAML command.
* Starts a mail transaction from the email address specified in $from.
* Returns true if successful or false otherwise. If True
* the mail transaction is started and then one or more recipient
* commands may be called followed by a data command. This command
* will send the message to the users terminal if they are logged
* in and send them an email.
* Implements RFC 821: SAML <SP> FROM:<reverse-path> <CRLF>
*
* @param string $from The address the message is from
*
* @return boolean
*/
public function sendAndMail($from)
{
return $this->sendCommand('SAML', "SAML FROM:$from", 250);
}
/**
* Send an SMTP VRFY command.
*
* @param string $name The name to verify
*
* @return boolean
*/
public function verify($name)
{
return $this->sendCommand('VRFY', "VRFY $name", [250, 251]);
}
/**
* Send an SMTP NOOP command.
* Used to keep keep-alives alive, doesn't actually do anything
*
* @return boolean
*/
public function noop()
{
return $this->sendCommand('NOOP', 'NOOP', 250);
}
/**
* Send an SMTP TURN command.
* This is an optional command for SMTP that this class does not support.
* This method is here to make the RFC821 Definition complete for this class
* and _may_ be implemented in future
* Implements from RFC 821: TURN <CRLF>
*
* @return boolean
*/
public function turn()
{
$this->setError('The SMTP TURN command is not implemented');
$this->edebug('SMTP NOTICE: ' . $this->error['error'], self::DEBUG_CLIENT);
return false;
}
/**
* Send raw data to the server.
*
* @param string $data The data to send
*
* @return integer|boolean The number of bytes sent to the server or false on error
*/
public function client_send($data)
{
$this->edebug("CLIENT -> SERVER: $data", self::DEBUG_CLIENT);
set_error_handler([$this, 'errorHandler']);
$result = fwrite($this->smtp_conn, $data);
restore_error_handler();
return $result;
}
/**
* Get the latest error.
*
* @return array
*/
public function getError()
{
return $this->error;
}
/**
* Get SMTP extensions available on the server
*
* @return array|null
*/
public function getServerExtList()
{
return $this->server_caps;
}
/**
* A multipurpose method
* The method works in three ways, dependent on argument value and current state
* 1. HELO/EHLO was not sent - returns null and set up $this->error
* 2. HELO was sent
* $name = 'HELO': returns server name
* $name = 'EHLO': returns boolean false
* $name = any string: returns null and set up $this->error
* 3. EHLO was sent
* $name = 'HELO'|'EHLO': returns server name
* $name = any string: if extension $name exists, returns boolean True
* or its options. Otherwise returns boolean False
* In other words, one can use this method to detect 3 conditions:
* - null returned: handshake was not or we don't know about ext (refer to $this->error)
* - false returned: the requested feature exactly not exists
* - positive value returned: the requested feature exists
*
* @param string $name Name of SMTP extension or 'HELO'|'EHLO'
*
* @return mixed
*/
public function getServerExt($name)
{
if (!$this->server_caps) {
$this->setError('No HELO/EHLO was sent');
return null;
}
// the tight logic knot ;)
if (!array_key_exists($name, $this->server_caps)) {
if ('HELO' == $name) {
return $this->server_caps['EHLO'];
}
if ('EHLO' == $name || array_key_exists('EHLO', $this->server_caps)) {
return false;
}
$this->setError('HELO handshake was used. Client knows nothing about server extensions');
return null;
}
return $this->server_caps[$name];
}
/**
* Get the last reply from the server.
*
* @return string
*/
public function getLastReply()
{
return $this->last_reply;
}
/**
* Read the SMTP server's response.
* Either before eof or socket timeout occurs on the operation.
* With SMTP we can tell if we have more lines to read if the
* 4th character is '-' symbol. If it is a space then we don't
* need to read anything else.
*
* @return string
*/
protected function get_lines()
{
// If the connection is bad, give up straight away
if (!is_resource($this->smtp_conn)) {
return '';
}
$data = '';
$endtime = 0;
stream_set_timeout($this->smtp_conn, $this->Timeout);
if ($this->Timelimit > 0) {
$endtime = time() + $this->Timelimit;
}
$selR = [$this->smtp_conn];
$selW = null;
while (is_resource($this->smtp_conn) and !feof($this->smtp_conn)) {
//Must pass vars in here as params are by reference
if (!stream_select($selR, $selW, $selW, $this->Timelimit)) {
$this->edebug(
'SMTP -> get_lines(): timed-out (' . $this->Timeout . ' sec)',
self::DEBUG_LOWLEVEL
);
break;
}
//Deliberate noise suppression - errors are handled afterwards
$str = @fgets($this->smtp_conn, 515);
$this->edebug("SMTP INBOUND: \"". trim($str).'"', self::DEBUG_LOWLEVEL);
$data .= $str;
// If response is only 3 chars (not valid, but RFC5321 S4.2 says it must be handled),
// or 4th character is a space, we are done reading, break the loop,
// string array access is a micro-optimisation over strlen
if (!isset($str[3]) or (isset($str[3]) and $str[3] == ' ')) {
break;
}
// Timed-out? Log and break
$info = stream_get_meta_data($this->smtp_conn);
if ($info['timed_out']) {
$this->edebug(
'SMTP -> get_lines(): timed-out (' . $this->Timeout . ' sec)',
self::DEBUG_LOWLEVEL
);
break;
}
// Now check if reads took too long
if ($endtime and time() > $endtime) {
$this->edebug(
'SMTP -> get_lines(): timelimit reached (' .
$this->Timelimit . ' sec)',
self::DEBUG_LOWLEVEL
);
break;
}
}
return $data;
}
/**
* Enable or disable VERP address generation.
*
* @param boolean $enabled
*/
public function setVerp($enabled = false)
{
$this->do_verp = $enabled;
}
/**
* Get VERP address generation mode.
*
* @return boolean
*/
public function getVerp()
{
return $this->do_verp;
}
/**
* Set error messages and codes.
*
* @param string $message The error message
* @param string $detail Further detail on the error
* @param string $smtp_code An associated SMTP error code
* @param string $smtp_code_ex Extended SMTP code
*/
protected function setError($message, $detail = '', $smtp_code = '', $smtp_code_ex = '')
{
$this->error = [
'error' => $message,
'detail' => $detail,
'smtp_code' => $smtp_code,
'smtp_code_ex' => $smtp_code_ex
];
}
/**
* Set debug output method.
*
* @param string|callable $method The name of the mechanism to use for debugging output, or a callable to handle it.
*/
public function setDebugOutput($method = 'echo')
{
$this->Debugoutput = $method;
}
/**
* Get debug output method.
*
* @return string
*/
public function getDebugOutput()
{
return $this->Debugoutput;
}
/**
* Set debug output level.
*
* @param integer $level
*/
public function setDebugLevel($level = 0)
{
$this->do_debug = $level;
}
/**
* Get debug output level.
*
* @return integer
*/
public function getDebugLevel()
{
return $this->do_debug;
}
/**
* Set SMTP timeout.
*
* @param integer $timeout
*/
public function setTimeout($timeout = 0)
{
$this->Timeout = $timeout;
}
/**
* Get SMTP timeout.
*
* @return integer
*/
public function getTimeout()
{
return $this->Timeout;
}
/**
* Reports an error number and string.
*
* @param integer $errno The error number returned by PHP.
* @param string $errmsg The error message returned by PHP.
* @param string $errfile The file the error occurred in
* @param integer $errline The line number the error occurred on
*/
protected function errorHandler($errno, $errmsg, $errfile = '', $errline = 0)
{
$notice = 'Connection failed.';
$this->setError(
$notice,
$errno,
$errmsg
);
$this->edebug(
$notice . ' Error #' . $errno . ': ' . $errmsg . " [$errfile line $errline]",
self::DEBUG_CONNECTION
);
}
/**
* Extract and return the ID of the last SMTP transaction based on
* a list of patterns provided in SMTP::$smtp_transaction_id_patterns.
* Relies on the host providing the ID in response to a DATA command.
* If no reply has been received yet, it will return null.
* If no pattern was matched, it will return false.
* @return bool|null|string
*/
protected function recordLastTransactionID()
{
$reply = $this->getLastReply();
if (empty($reply)) {
$this->last_smtp_transaction_id = null;
} else {
$this->last_smtp_transaction_id = false;
foreach ($this->smtp_transaction_id_patterns as $smtp_transaction_id_pattern) {
if (preg_match($smtp_transaction_id_pattern, $reply, $matches)) {
$this->last_smtp_transaction_id = $matches[1];
}
}
}
return $this->last_smtp_transaction_id;
}
/**
* Get the queue/transaction ID of the last SMTP transaction
* If no reply has been received yet, it will return null.
* If no pattern was matched, it will return false.
* @return bool|null|string
* @see recordLastTransactionID()
*/
public function getLastTransactionID()
{
return $this->last_smtp_transaction_id;
}
}
| {
"content_hash": "e123f9eb13c37672dd57f4c3871ca513",
"timestamp": "",
"source": "github",
"line_count": 1260,
"max_line_length": 120,
"avg_line_length": 32.83095238095238,
"alnum_prop": 0.5175381342616096,
"repo_name": "anstack/anstack.github.io",
"id": "8411b47602ead41e84c7afda65802f96be95d312",
"size": "42220",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "assets/server/vendor/phpmailer/phpmailer/src/SMTP.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "341156"
},
{
"name": "HTML",
"bytes": "82835"
},
{
"name": "JavaScript",
"bytes": "1539565"
},
{
"name": "PHP",
"bytes": "1727"
},
{
"name": "Ruby",
"bytes": "2793"
}
],
"symlink_target": ""
} |
from page_get.basic import get_page
from decorators.decorator import parse_decorator
import json
def get_followers_list_return(uid, page):
followers_wb_temp_url = 'https://m.weibo.cn/api/container/getIndex?containerid={}_-_followers_-_{}&luicode={}&lfid={}&featurecode={}&type=uid&value={}&page={}'
containerid = '231051'
luicode = '10000011'
lfid = '100505' + str(uid)
featurecode = '20000320'
value = str(uid)
url = followers_wb_temp_url.format(containerid, uid, luicode, lfid, featurecode, value, page)
html = get_page(url, user_verify=False, need_login=False)
return html
@parse_decorator(3)
def parse_json_to_dict(html):
cont = json.loads(html, encoding='utf-8')
return cont
# 如果在某一页中并没有收获到图片,也不应该判断为错误(None)
@parse_decorator(5)
def parse_dict_to_followers_list(wb_dict):
weibo_pic_list = []
cards = wb_dict['cards']
if cards:
for card in cards:
if 'title' in card:
# if card['title'] == '他的全部关注':
return 'yes!'
# if card['title'] == '他的全部关注' or card['title'] == '她的全部关注':
# one_wb_pic_list = mblog_to_db_handler(card['mblog'])
# if one_wb_pic_list:
# weibo_pic_list.extend(one_wb_pic_list)
# return weibo_pic_list
return 'no!'
def get_followers(uid):
page = 1
html = get_followers_list_return(uid, page)
json_dict = parse_json_to_dict(html)
follower_list = parse_dict_to_followers_list(json_dict)
return follower_list
| {
"content_hash": "684f173ad982360735506278618ae086",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 160,
"avg_line_length": 31.408163265306122,
"alnum_prop": 0.6185834957764782,
"repo_name": "KingOfBanana/SocialNetworkAI",
"id": "5fd328de0adac4465d7ad45c404c612df65d17d4",
"size": "1652",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "page_parse/followers.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "2240072"
},
{
"name": "Shell",
"bytes": "623"
}
],
"symlink_target": ""
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Arch Game Engine: Class Members - Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Arch Game Engine
 <span id="projectnumber">0.2</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
<li class="current"><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<div id="navrow3" class="tabs2">
<ul class="tablist">
<li><a href="functions.html"><span>All</span></a></li>
<li class="current"><a href="functions_func.html"><span>Functions</span></a></li>
<li><a href="functions_vars.html"><span>Variables</span></a></li>
</ul>
</div>
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li><a href="functions_func.html#index_a"><span>a</span></a></li>
<li><a href="functions_func_b.html#index_b"><span>b</span></a></li>
<li><a href="functions_func_c.html#index_c"><span>c</span></a></li>
<li><a href="functions_func_d.html#index_d"><span>d</span></a></li>
<li><a href="functions_func_f.html#index_f"><span>f</span></a></li>
<li><a href="functions_func_g.html#index_g"><span>g</span></a></li>
<li><a href="functions_func_h.html#index_h"><span>h</span></a></li>
<li><a href="functions_func_i.html#index_i"><span>i</span></a></li>
<li><a href="functions_func_k.html#index_k"><span>k</span></a></li>
<li><a href="functions_func_l.html#index_l"><span>l</span></a></li>
<li class="current"><a href="functions_func_m.html#index_m"><span>m</span></a></li>
<li><a href="functions_func_o.html#index_o"><span>o</span></a></li>
<li><a href="functions_func_r.html#index_r"><span>r</span></a></li>
<li><a href="functions_func_s.html#index_s"><span>s</span></a></li>
<li><a href="functions_func_u.html#index_u"><span>u</span></a></li>
<li><a href="functions_func_0x7e.html#index_0x7e"><span>~</span></a></li>
</ul>
</div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="contents">
 
<h3><a class="anchor" id="index_m"></a>- m -</h3><ul>
<li>move()
: <a class="el" href="classLevel.html#a9184b25173fbf468a63a633bd3510bd6">Level</a>
, <a class="el" href="classObject.html#af4133db64f4051294dc103a2f3553a6a">Object</a>
</li>
<li>moveTowards()
: <a class="el" href="classPhysics.html#a8e53f9bf088c0d4f208b3c2029d69ab2">Physics</a>
</li>
<li>moveX()
: <a class="el" href="classObject.html#a43f3220cb27a282c28afaea57ac9a098">Object</a>
</li>
<li>moveY()
: <a class="el" href="classObject.html#a58bab6e78efd8282996d742530c98034">Object</a>
</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
| {
"content_hash": "6d609a8ae85150b0d0ec24c54e903aa2",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 154,
"avg_line_length": 42.78260869565217,
"alnum_prop": 0.6321138211382114,
"repo_name": "jarreed0/ArchGE",
"id": "de8855bacfd51d6ab2de6ce2b10b6c15f14e1de5",
"size": "5904",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/html/functions_func_m.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C++",
"bytes": "232681"
},
{
"name": "Shell",
"bytes": "10667"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "dccc3a00d29f1e06c0726e7f686c6a0a",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.307692307692308,
"alnum_prop": 0.6940298507462687,
"repo_name": "mdoering/backbone",
"id": "ce8a4280d3e99b8dd2ff16f31e073eae87c416cf",
"size": "197",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Chromista/Ochrophyta/Chrysophyceae/Phaeothamniales/Phaeothamniaceae/Phaeothamnion/Phaeothamnion confervicola/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package org.apache.activemq.artemis.core.protocol.openwire.amq;
import org.apache.activemq.command.ActiveMQDestination;
import org.apache.activemq.command.MessageAck;
import org.apache.activemq.command.MessagePull;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AMQCompositeConsumerBrokerExchange extends AMQConsumerBrokerExchange {
private final Map<ActiveMQDestination, AMQConsumer> consumerMap;
public AMQCompositeConsumerBrokerExchange(AMQSession amqSession, List<AMQConsumer> consumerList) {
super(amqSession);
this.consumerMap = new HashMap<>();
for (AMQConsumer consumer : consumerList) {
consumerMap.put(consumer.getOpenwireDestination(), consumer);
}
}
@Override
public void processMessagePull(MessagePull messagePull) throws Exception {
AMQConsumer amqConsumer = consumerMap.get(messagePull.getDestination());
if (amqConsumer != null) {
amqConsumer.processMessagePull(messagePull);
}
}
@Override
public void acknowledge(MessageAck ack) throws Exception {
AMQConsumer amqConsumer = consumerMap.get(ack.getDestination());
if (amqConsumer != null) {
amqConsumer.acknowledge(ack);
}
}
@Override
public void removeConsumer() throws Exception {
for (AMQConsumer amqConsumer : consumerMap.values()) {
amqConsumer.removeConsumer();
}
}
@Override
public void updateConsumerPrefetchSize(int prefetch) {
for (AMQConsumer amqConsumer : consumerMap.values()) {
amqConsumer.setPrefetchSize(prefetch);
}
}
}
| {
"content_hash": "962ca7b90edd684fb47bb215e67cf18d",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 101,
"avg_line_length": 30.641509433962263,
"alnum_prop": 0.7229064039408867,
"repo_name": "lburgazzoli/apache-activemq-artemis",
"id": "5b9d72e4927675b57a6f740002b98428f89f9d4a",
"size": "2423",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQCompositeConsumerBrokerExchange.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "6452"
},
{
"name": "C",
"bytes": "26250"
},
{
"name": "C++",
"bytes": "1197"
},
{
"name": "CMake",
"bytes": "4260"
},
{
"name": "CSS",
"bytes": "11732"
},
{
"name": "HTML",
"bytes": "19117"
},
{
"name": "Java",
"bytes": "22193755"
},
{
"name": "Shell",
"bytes": "13568"
}
],
"symlink_target": ""
} |
<?php
class Google_Service_AdExchangeBuyerII_DayPart extends Google_Model
{
public $dayOfWeek;
protected $endTimeType = 'Google_Service_AdExchangeBuyerII_TimeOfDay';
protected $endTimeDataType = '';
protected $startTimeType = 'Google_Service_AdExchangeBuyerII_TimeOfDay';
protected $startTimeDataType = '';
public function setDayOfWeek($dayOfWeek)
{
$this->dayOfWeek = $dayOfWeek;
}
public function getDayOfWeek()
{
return $this->dayOfWeek;
}
/**
* @param Google_Service_AdExchangeBuyerII_TimeOfDay
*/
public function setEndTime(Google_Service_AdExchangeBuyerII_TimeOfDay $endTime)
{
$this->endTime = $endTime;
}
/**
* @return Google_Service_AdExchangeBuyerII_TimeOfDay
*/
public function getEndTime()
{
return $this->endTime;
}
/**
* @param Google_Service_AdExchangeBuyerII_TimeOfDay
*/
public function setStartTime(Google_Service_AdExchangeBuyerII_TimeOfDay $startTime)
{
$this->startTime = $startTime;
}
/**
* @return Google_Service_AdExchangeBuyerII_TimeOfDay
*/
public function getStartTime()
{
return $this->startTime;
}
}
| {
"content_hash": "473dff03d8d9e63ee35f2ecd54b0efbf",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 85,
"avg_line_length": 23.625,
"alnum_prop": 0.7037037037037037,
"repo_name": "reactexcel/ReactReduxHR",
"id": "1f81b754670bbfd2911b0a38b8ebed5adcbbe6c0",
"size": "1724",
"binary": false,
"copies": "17",
"ref": "refs/heads/master",
"path": "backend/attendance/sal_info/google-api/vendor/google/apiclient-services/src/Google/Service/AdExchangeBuyerII/DayPart.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "205756"
},
{
"name": "HTML",
"bytes": "1098124"
},
{
"name": "JavaScript",
"bytes": "1323356"
},
{
"name": "PHP",
"bytes": "3157401"
},
{
"name": "Shell",
"bytes": "8049"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<HTML>
<HEAD>
<meta name="generator" content="JDiff v1.0.9">
<!-- Generated by the JDiff Javadoc doclet -->
<!-- (http://www.jdiff.org) -->
<meta name="description" content="JDiff is a Javadoc doclet which generates an HTML report of all the packages, classes, constructors, methods, and fields which have been removed, added or changed in any way, including their documentation, when two APIs are compared.">
<meta name="keywords" content="diff, jdiff, javadiff, java diff, java difference, API difference, difference between two APIs, API diff, Javadoc, doclet">
<TITLE>
Field Differences Index
</TITLE>
<LINK REL="stylesheet" TYPE="text/css" HREF="../stylesheet-jdiff.css" TITLE="Style">
</HEAD>
<BODY>
<a NAME="topheader"></a>
<table summary="Index for Fields" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#FFFFCC">
<font size="+1"><a href="fields_index_all.html" class="staysblack">All Fields</a></font>
</td>
</tr>
<tr>
<td bgcolor="#FFFFFF">
<FONT SIZE="-1">
<A HREF="fields_index_removals.html" class="hiddenlink">Removals</A>
</FONT>
</td>
</tr>
<tr>
<td bgcolor="#FFFFFF">
<FONT SIZE="-1">
<A HREF="fields_index_additions.html"class="hiddenlink">Additions</A>
</FONT>
</td>
</tr>
<tr>
<td bgcolor="#FFFFFF">
<FONT SIZE="-1">
<A HREF="fields_index_changes.html"class="hiddenlink">Changes</A>
</FONT>
</td>
</tr>
<tr>
<td>
<font size="-2"><b>Bold</b> is New, <strike>strike</strike> is deleted</font>
</td>
</tr>
</table><br>
<A NAME="A"></A>
<br><font size="+2">A</font>
<a href="#C"><font size="-2">C</font></a>
<a href="#D"><font size="-2">D</font></a>
<a href="#G"><font size="-2">G</font></a>
<a href="#H"><font size="-2">H</font></a>
<a href="#M"><font size="-2">M</font></a>
<a href="#N"><font size="-2">N</font></a>
<a href="#P"><font size="-2">P</font></a>
<a href="#S"><font size="-2">S</font></a>
<a href="#Z"><font size="-2">Z</font></a>
<a href="#topheader"><font size="-2">TOP</font></a>
<br>
<nobr><A HREF="org.apache.zookeeper.Watcher.Event.KeeperState.html#org.apache.zookeeper.Watcher.Event.KeeperState.AuthFailed" class="hiddenlink" target="rightframe">AuthFailed</A>
</nobr><br>
<A NAME="C"></A>
<br><font size="+2">C</font>
<a href="#A"><font size="-2">A</font></a>
<a href="#D"><font size="-2">D</font></a>
<a href="#G"><font size="-2">G</font></a>
<a href="#H"><font size="-2">H</font></a>
<a href="#M"><font size="-2">M</font></a>
<a href="#N"><font size="-2">N</font></a>
<a href="#P"><font size="-2">P</font></a>
<a href="#S"><font size="-2">S</font></a>
<a href="#Z"><font size="-2">Z</font></a>
<a href="#topheader"><font size="-2">TOP</font></a>
<br>
<nobr><A HREF="org.apache.zookeeper.ZooDefs.OpCode.html#org.apache.zookeeper.ZooDefs.OpCode.check" class="hiddenlink" target="rightframe">check</A>
</nobr><br>
<nobr><A HREF="org.apache.zookeeper.ZooKeeperMain.html#org.apache.zookeeper.ZooKeeperMain.cl" class="hiddenlink" target="rightframe">cl</A>
</nobr><br>
<nobr><A HREF="org.apache.zookeeper.ZooKeeperMain.html#org.apache.zookeeper.ZooKeeperMain.commandCount" class="hiddenlink" target="rightframe">commandCount</A>
</nobr><br>
<nobr><A HREF="org.apache.zookeeper.ZooKeeperMain.html#org.apache.zookeeper.ZooKeeperMain.commandMap" class="hiddenlink" target="rightframe">commandMap</A>
</nobr><br>
<nobr><A HREF="org.apache.zookeeper.Watcher.Event.KeeperState.html#org.apache.zookeeper.Watcher.Event.KeeperState.ConnectedReadOnly" class="hiddenlink" target="rightframe">ConnectedReadOnly</A>
</nobr><br>
<nobr><A HREF="org.apache.zookeeper.ZooKeeper.States.html#org.apache.zookeeper.ZooKeeper.States.CONNECTEDREADONLY" class="hiddenlink" target="rightframe">CONNECTEDREADONLY</A>
</nobr><br>
<A NAME="D"></A>
<br><font size="+2">D</font>
<a href="#A"><font size="-2">A</font></a>
<a href="#C"><font size="-2">C</font></a>
<a href="#G"><font size="-2">G</font></a>
<a href="#H"><font size="-2">H</font></a>
<a href="#M"><font size="-2">M</font></a>
<a href="#N"><font size="-2">N</font></a>
<a href="#P"><font size="-2">P</font></a>
<a href="#S"><font size="-2">S</font></a>
<a href="#Z"><font size="-2">Z</font></a>
<a href="#topheader"><font size="-2">TOP</font></a>
<br>
<nobr><A HREF="org.apache.zookeeper.ClientCnxn.html#org.apache.zookeeper.ClientCnxn.disableAutoWatchReset" class="hiddenlink" target="rightframe"><strike>disableAutoWatchReset</strike></A>
</nobr><br>
<A NAME="G"></A>
<br><font size="+2">G</font>
<a href="#A"><font size="-2">A</font></a>
<a href="#C"><font size="-2">C</font></a>
<a href="#D"><font size="-2">D</font></a>
<a href="#H"><font size="-2">H</font></a>
<a href="#M"><font size="-2">M</font></a>
<a href="#N"><font size="-2">N</font></a>
<a href="#P"><font size="-2">P</font></a>
<a href="#S"><font size="-2">S</font></a>
<a href="#Z"><font size="-2">Z</font></a>
<a href="#topheader"><font size="-2">TOP</font></a>
<br>
<nobr><A HREF="org.apache.zookeeper.ZooDefs.OpCode.html#org.apache.zookeeper.ZooDefs.OpCode.getChildren2" class="hiddenlink" target="rightframe">getChildren2</A>
</nobr><br>
<A NAME="H"></A>
<br><font size="+2">H</font>
<a href="#A"><font size="-2">A</font></a>
<a href="#C"><font size="-2">C</font></a>
<a href="#D"><font size="-2">D</font></a>
<a href="#G"><font size="-2">G</font></a>
<a href="#M"><font size="-2">M</font></a>
<a href="#N"><font size="-2">N</font></a>
<a href="#P"><font size="-2">P</font></a>
<a href="#S"><font size="-2">S</font></a>
<a href="#Z"><font size="-2">Z</font></a>
<a href="#topheader"><font size="-2">TOP</font></a>
<br>
<nobr><A HREF="org.apache.zookeeper.ZooKeeperMain.html#org.apache.zookeeper.ZooKeeperMain.history" class="hiddenlink" target="rightframe">history</A>
</nobr><br>
<nobr><A HREF="org.apache.zookeeper.ZooKeeperMain.html#org.apache.zookeeper.ZooKeeperMain.host" class="hiddenlink" target="rightframe">host</A>
</nobr><br>
<A NAME="M"></A>
<br><font size="+2">M</font>
<a href="#A"><font size="-2">A</font></a>
<a href="#C"><font size="-2">C</font></a>
<a href="#D"><font size="-2">D</font></a>
<a href="#G"><font size="-2">G</font></a>
<a href="#H"><font size="-2">H</font></a>
<a href="#N"><font size="-2">N</font></a>
<a href="#P"><font size="-2">P</font></a>
<a href="#S"><font size="-2">S</font></a>
<a href="#Z"><font size="-2">Z</font></a>
<a href="#topheader"><font size="-2">TOP</font></a>
<br>
<nobr><A HREF="org.apache.zookeeper.ZooDefs.OpCode.html#org.apache.zookeeper.ZooDefs.OpCode.multi" class="hiddenlink" target="rightframe">multi</A>
</nobr><br>
<A NAME="N"></A>
<br><font size="+2">N</font>
<a href="#A"><font size="-2">A</font></a>
<a href="#C"><font size="-2">C</font></a>
<a href="#D"><font size="-2">D</font></a>
<a href="#G"><font size="-2">G</font></a>
<a href="#H"><font size="-2">H</font></a>
<a href="#M"><font size="-2">M</font></a>
<a href="#P"><font size="-2">P</font></a>
<a href="#S"><font size="-2">S</font></a>
<a href="#Z"><font size="-2">Z</font></a>
<a href="#topheader"><font size="-2">TOP</font></a>
<br>
<nobr><A HREF="org.apache.zookeeper.ZooKeeper.States.html#org.apache.zookeeper.ZooKeeper.States.NOT_CONNECTED" class="hiddenlink" target="rightframe">NOT_CONNECTED</A>
</nobr><br>
<nobr><A HREF="org.apache.zookeeper.KeeperException.Code.html#org.apache.zookeeper.KeeperException.Code.NOTREADONLY" class="hiddenlink" target="rightframe">NOTREADONLY</A>
</nobr><br>
<A NAME="P"></A>
<br><font size="+2">P</font>
<a href="#A"><font size="-2">A</font></a>
<a href="#C"><font size="-2">C</font></a>
<a href="#D"><font size="-2">D</font></a>
<a href="#G"><font size="-2">G</font></a>
<a href="#H"><font size="-2">H</font></a>
<a href="#M"><font size="-2">M</font></a>
<a href="#N"><font size="-2">N</font></a>
<a href="#S"><font size="-2">S</font></a>
<a href="#Z"><font size="-2">Z</font></a>
<a href="#topheader"><font size="-2">TOP</font></a>
<br>
<nobr><A HREF="org.apache.zookeeper.ClientCnxn.html#org.apache.zookeeper.ClientCnxn.packetLen" class="hiddenlink" target="rightframe">packetLen</A>
</nobr><br>
<nobr><A HREF="org.apache.zookeeper.ZooKeeperMain.html#org.apache.zookeeper.ZooKeeperMain.printWatches" class="hiddenlink" target="rightframe">printWatches</A>
</nobr><br>
<A NAME="S"></A>
<br><font size="+2">S</font>
<a href="#A"><font size="-2">A</font></a>
<a href="#C"><font size="-2">C</font></a>
<a href="#D"><font size="-2">D</font></a>
<a href="#G"><font size="-2">G</font></a>
<a href="#H"><font size="-2">H</font></a>
<a href="#M"><font size="-2">M</font></a>
<a href="#N"><font size="-2">N</font></a>
<a href="#P"><font size="-2">P</font></a>
<a href="#Z"><font size="-2">Z</font></a>
<a href="#topheader"><font size="-2">TOP</font></a>
<br>
<nobr><A HREF="org.apache.zookeeper.ZooDefs.OpCode.html#org.apache.zookeeper.ZooDefs.OpCode.sasl" class="hiddenlink" target="rightframe">sasl</A>
</nobr><br>
<nobr><A HREF="org.apache.zookeeper.Watcher.Event.KeeperState.html#org.apache.zookeeper.Watcher.Event.KeeperState.SaslAuthenticated" class="hiddenlink" target="rightframe">SaslAuthenticated</A>
</nobr><br>
<nobr><A HREF="org.apache.zookeeper.KeeperException.Code.html#org.apache.zookeeper.KeeperException.Code.SESSIONMOVED" class="hiddenlink" target="rightframe">SESSIONMOVED</A>
</nobr><br>
<A NAME="Z"></A>
<br><font size="+2">Z</font>
<a href="#A"><font size="-2">A</font></a>
<a href="#C"><font size="-2">C</font></a>
<a href="#D"><font size="-2">D</font></a>
<a href="#G"><font size="-2">G</font></a>
<a href="#H"><font size="-2">H</font></a>
<a href="#M"><font size="-2">M</font></a>
<a href="#N"><font size="-2">N</font></a>
<a href="#P"><font size="-2">P</font></a>
<a href="#S"><font size="-2">S</font></a>
<a href="#topheader"><font size="-2">TOP</font></a>
<br>
<nobr><A HREF="org.apache.zookeeper.ZooKeeperMain.html#org.apache.zookeeper.ZooKeeperMain.zk" class="hiddenlink" target="rightframe">zk</A>
</nobr><br>
<nobr><A HREF="org.apache.zookeeper.ZooKeeper.html#org.apache.zookeeper.ZooKeeper.ZOOKEEPER_CLIENT_CNXN_SOCKET" class="hiddenlink" target="rightframe">ZOOKEEPER_CLIENT_CNXN_SOCKET</A>
</nobr><br>
<nobr><A HREF="org.apache.zookeeper.ClientCnxn.html#org.apache.zookeeper.ClientCnxn.zooKeeperSaslClient" class="hiddenlink" target="rightframe">zooKeeperSaslClient</A>
</nobr><br>
</BODY>
</HTML>
| {
"content_hash": "19dfd13eff32f3a7f03b8a27ec8f99e1",
"timestamp": "",
"source": "github",
"line_count": 224,
"max_line_length": 269,
"avg_line_length": 46.861607142857146,
"alnum_prop": 0.6337048680575402,
"repo_name": "tausten/zookeeper",
"id": "fa3bd2ea525fc7d1596aff97cf12b7b9169f22ad",
"size": "10497",
"binary": false,
"copies": "6",
"ref": "refs/heads/trunk",
"path": "docs/jdiff/changes/fields_index_all.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "4458"
},
{
"name": "C",
"bytes": "448709"
},
{
"name": "C#",
"bytes": "430100"
},
{
"name": "C++",
"bytes": "605710"
},
{
"name": "CSS",
"bytes": "4016"
},
{
"name": "Groff",
"bytes": "807763"
},
{
"name": "HTML",
"bytes": "53298"
},
{
"name": "Java",
"bytes": "2721383"
},
{
"name": "JavaScript",
"bytes": "239387"
},
{
"name": "Makefile",
"bytes": "932"
},
{
"name": "Mako",
"bytes": "13678"
},
{
"name": "Perl",
"bytes": "46361"
},
{
"name": "Perl6",
"bytes": "102354"
},
{
"name": "Python",
"bytes": "126044"
},
{
"name": "Shell",
"bytes": "311196"
},
{
"name": "XS",
"bytes": "66448"
},
{
"name": "XSLT",
"bytes": "6024"
}
],
"symlink_target": ""
} |
<!DOCTYPE html >
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title></title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link href="../../../../../../lib/index.css" media="screen" type="text/css" rel="stylesheet" />
<link href="../../../../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
<link href="../../../../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />
<script type="text/javascript" src="../../../../../../lib/jquery.js"></script>
<script type="text/javascript" src="../../../../../../lib/jquery.panzoom.min.js"></script>
<script type="text/javascript" src="../../../../../../lib/jquery.mousewheel.min.js"></script>
<script type="text/javascript" src="../../../../../../lib/index.js"></script>
<script type="text/javascript" src="../../../../../../index.js"></script>
<script type="text/javascript" src="../../../../../../lib/scheduler.js"></script>
<script type="text/javascript" src="../../../../../../lib/template.js"></script>
<script type="text/javascript" src="../../../../../../lib/tools.tooltip.js"></script>
<script type="text/javascript">
/* this variable can be used by the JS to determine the path to the root document */
var toRoot = '../../../../../../';
</script>
</head>
<body>
<div id="search">
<span id="doc-title"><span id="doc-version"></span></span>
<span class="close-results"><span class="left"><</span> Back</span>
<div id="textfilter">
<span class="input">
<input autocapitalize="none" placeholder="Search" id="index-input" type="text" accesskey="/" />
<i class="clear material-icons"></i>
<i id="search-icon" class="material-icons"></i>
</span>
</div>
</div>
<div id="search-results">
<div id="search-progress">
<div id="progress-fill"></div>
</div>
<div id="results-content">
<div id="entity-results"></div>
<div id="member-results"></div>
</div>
</div>
<div id="content-scroll-container" style="-webkit-overflow-scrolling: touch;">
<div id="content-container" style="-webkit-overflow-scrolling: touch;">
<div id="subpackage-spacer">
<div id="packages">
<h1>Packages</h1>
<ul>
<li name="_root_.root" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="_root_"></a><a id="root:_root_"></a>
<span class="permalink">
<a href="index.html#_root_" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">package</span>
</span>
<span class="symbol">
<a title="" href="../../../../../../index.html"><span class="name">root</span></a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../../../../../../index.html" class="extype" name="_root_">root</a></dd></dl></div>
</li><li name="_root_.com" visbl="pub" class="indented1 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="com"></a><a id="com:com"></a>
<span class="permalink">
<a href="index.html#com" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">package</span>
</span>
<span class="symbol">
<a title="" href="../../../../../index.html"><span class="name">com</span></a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../../../../../../index.html" class="extype" name="_root_">root</a></dd></dl></div>
</li><li name="com.github" visbl="pub" class="indented2 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="github"></a><a id="github:github"></a>
<span class="permalink">
<a href="../com/index.html#github" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">package</span>
</span>
<span class="symbol">
<a title="" href="../../../../index.html"><span class="name">github</span></a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../../../../../index.html" class="extype" name="com">com</a></dd></dl></div>
</li><li name="com.github.illfaku" visbl="pub" class="indented3 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="illfaku"></a><a id="illfaku:illfaku"></a>
<span class="permalink">
<a href="../../com/github/index.html#illfaku" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">package</span>
</span>
<span class="symbol">
<a title="" href="../../../index.html"><span class="name">illfaku</span></a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../../../../index.html" class="extype" name="com.github">github</a></dd></dl></div>
</li><li name="com.github.illfaku.korro" visbl="pub" class="indented4 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="korro"></a><a id="korro:korro"></a>
<span class="permalink">
<a href="../../../com/github/illfaku/index.html#korro" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">package</span>
</span>
<span class="symbol">
<a title="" href="../../index.html"><span class="name">korro</span></a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../../../index.html" class="extype" name="com.github.illfaku">illfaku</a></dd></dl></div>
</li><li name="com.github.illfaku.korro.dto" visbl="pub" class="indented5 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="dto"></a><a id="dto:dto"></a>
<span class="permalink">
<a href="../../../../com/github/illfaku/korro/index.html#dto" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">package</span>
</span>
<span class="symbol">
<a title="" href="../index.html"><span class="name">dto</span></a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../../index.html" class="extype" name="com.github.illfaku.korro">korro</a></dd></dl></div>
</li><li name="com.github.illfaku.korro.dto.ws" visbl="pub" class="indented6 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="ws"></a><a id="ws:ws"></a>
<span class="permalink">
<a href="../../../../../com/github/illfaku/korro/dto/index.html#ws" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">package</span>
</span>
<span class="symbol">
<a title="" href="index.html"><span class="name">ws</span></a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../index.html" class="extype" name="com.github.illfaku.korro.dto">dto</a></dd></dl></div>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="class" href="BinaryWsFrame.html" title="WebSocket binary frame representation."></a>
<a href="BinaryWsFrame.html" title="WebSocket binary frame representation.">BinaryWsFrame</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="class" href="CloseWsFrame.html" title="WebSocket close frame representations."></a>
<a href="CloseWsFrame.html" title="WebSocket close frame representations.">CloseWsFrame</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="trait" href="ControlWsFrame.html" title="Marker trait for WebSocket control frame representations."></a>
<a href="ControlWsFrame.html" title="Marker trait for WebSocket control frame representations.">ControlWsFrame</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="trait" href="DataWsFrame.html" title="Marker trait for WebSocket data frame representations."></a>
<a href="DataWsFrame.html" title="Marker trait for WebSocket data frame representations.">DataWsFrame</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="class" href="" title="WebSocket ping frame representations."></a>
<a href="" title="WebSocket ping frame representations.">PingWsFrame</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="class" href="PongWsFrame.html" title="WebSocket pong frame representations."></a>
<a href="PongWsFrame.html" title="WebSocket pong frame representations.">PongWsFrame</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="class" href="TextWsFrame.html" title="WebSocket text frame representation."></a>
<a href="TextWsFrame.html" title="WebSocket text frame representation.">TextWsFrame</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="trait" href="WsFrame.html" title="Marker trait for WebSocket frame representations."></a>
<a href="WsFrame.html" title="Marker trait for WebSocket frame representations.">WsFrame</a>
</li><li class="current-entities indented6">
<a class="object" href="WsHandshakeRequest$.html" title=""></a>
<a class="class" href="WsHandshakeRequest.html" title="Request for a WebSocket handshake."></a>
<a href="WsHandshakeRequest.html" title="Request for a WebSocket handshake.">WsHandshakeRequest</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="class" href="WsHandshakeResponse.html" title="Response for WebSocket handshake request."></a>
<a href="WsHandshakeResponse.html" title="Response for WebSocket handshake request.">WsHandshakeResponse</a>
</li>
</ul>
</div>
</div>
<div id="content">
<body class="class type">
<div id="definition">
<div class="big-circle class">c</div>
<p id="owner"><a href="../../../../../index.html" class="extype" name="com">com</a>.<a href="../../../../index.html" class="extype" name="com.github">github</a>.<a href="../../../index.html" class="extype" name="com.github.illfaku">illfaku</a>.<a href="../../index.html" class="extype" name="com.github.illfaku.korro">korro</a>.<a href="../index.html" class="extype" name="com.github.illfaku.korro.dto">dto</a>.<a href="index.html" class="extype" name="com.github.illfaku.korro.dto.ws">ws</a></p>
<h1>PingWsFrame<span class="permalink">
<a href="../../../../../../com/github/illfaku/korro/dto/ws/PingWsFrame.html" title="Permalink">
<i class="material-icons"></i>
</a>
</span></h1>
<h3><span class="morelinks"></span></h3>
</div>
<h4 id="signature" class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">case class</span>
</span>
<span class="symbol">
<span class="name">PingWsFrame</span><span class="params">(<span name="bytes">bytes: <span class="extype" name="scala.Array">Array</span>[<span class="extype" name="scala.Byte">Byte</span>]</span>)</span><span class="result"> extends <a href="ControlWsFrame.html" class="extype" name="com.github.illfaku.korro.dto.ws.ControlWsFrame">ControlWsFrame</a> with <span class="extype" name="scala.Product">Product</span> with <span class="extype" name="scala.Serializable">Serializable</span></span>
</span>
</h4>
<div id="comment" class="fullcommenttop"><div class="comment cmt"><p>WebSocket ping frame representations.
</p></div><dl class="attributes block"> <dt>See also</dt><dd><span class="cmt"><p>https://tools.ietf.org/html/rfc6455#section-5.5.2</p></span></dd></dl><div class="toggleContainer block">
<span class="toggle">
Linear Supertypes
</span>
<div class="superTypes hiddenContent"><span class="extype" name="scala.Serializable">Serializable</span>, <span class="extype" name="java.io.Serializable">Serializable</span>, <span class="extype" name="scala.Product">Product</span>, <span class="extype" name="scala.Equals">Equals</span>, <a href="ControlWsFrame.html" class="extype" name="com.github.illfaku.korro.dto.ws.ControlWsFrame">ControlWsFrame</a>, <a href="WsFrame.html" class="extype" name="com.github.illfaku.korro.dto.ws.WsFrame">WsFrame</a>, <span class="extype" name="scala.AnyRef">AnyRef</span>, <span class="extype" name="scala.Any">Any</span></div>
</div></div>
<div id="mbrsel">
<div class="toggle"></div>
<div id="memberfilter">
<i class="material-icons arrow"></i>
<span class="input">
<input id="mbrsel-input" placeholder="Filter all members" type="text" accesskey="/" />
</span>
<i class="clear material-icons"></i>
</div>
<div id="filterby">
<div id="order">
<span class="filtertype">Ordering</span>
<ol>
<li class="alpha in"><span>Alphabetic</span></li>
<li class="inherit out"><span>By Inheritance</span></li>
</ol>
</div>
<div class="ancestors">
<span class="filtertype">Inherited<br />
</span>
<ol id="linearization">
<li class="in" name="com.github.illfaku.korro.dto.ws.PingWsFrame"><span>PingWsFrame</span></li><li class="in" name="scala.Serializable"><span>Serializable</span></li><li class="in" name="java.io.Serializable"><span>Serializable</span></li><li class="in" name="scala.Product"><span>Product</span></li><li class="in" name="scala.Equals"><span>Equals</span></li><li class="in" name="com.github.illfaku.korro.dto.ws.ControlWsFrame"><span>ControlWsFrame</span></li><li class="in" name="com.github.illfaku.korro.dto.ws.WsFrame"><span>WsFrame</span></li><li class="in" name="scala.AnyRef"><span>AnyRef</span></li><li class="in" name="scala.Any"><span>Any</span></li>
</ol>
</div><div class="ancestors">
<span class="filtertype">Implicitly<br />
</span>
<ol id="implicits"> <li class="in" name="scala.Predef.any2stringadd" data-hidden="true"><span>by any2stringadd</span></li><li class="in" name="scala.Predef.StringFormat" data-hidden="true"><span>by StringFormat</span></li><li class="in" name="scala.Predef.Ensuring" data-hidden="true"><span>by Ensuring</span></li><li class="in" name="scala.Predef.ArrowAssoc" data-hidden="true"><span>by ArrowAssoc</span></li>
</ol>
</div><div class="ancestors">
<span class="filtertype"></span>
<ol>
<li class="hideall out"><span>Hide All</span></li>
<li class="showall in"><span>Show All</span></li>
</ol>
</div>
<div id="visbl">
<span class="filtertype">Visibility</span>
<ol><li class="public in"><span>Public</span></li><li class="all out"><span>All</span></li></ol>
</div>
</div>
</div>
<div id="template">
<div id="allMembers">
<div id="constructors" class="members">
<h3>Instance Constructors</h3>
<ol><li name="com.github.illfaku.korro.dto.ws.PingWsFrame#<init>" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped">
<a id="<init>(bytes:Array[Byte]):com.github.illfaku.korro.dto.ws.PingWsFrame"></a><a id="<init>:PingWsFrame"></a>
<span class="permalink">
<a href="../../../../../../com/github/illfaku/korro/dto/ws/PingWsFrame.html#<init>(bytes:Array[Byte]):com.github.illfaku.korro.dto.ws.PingWsFrame" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">new</span>
</span>
<span class="symbol">
<span class="name">PingWsFrame</span><span class="params">(<span name="bytes">bytes: <span class="extype" name="scala.Array">Array</span>[<span class="extype" name="scala.Byte">Byte</span>]</span>)</span>
</span>
</li></ol>
</div>
<div class="values members">
<h3>Value Members</h3>
<ol>
<li name="scala.AnyRef#!=" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="!=(x$1:Any):Boolean"></a><a id="!=(Any):Boolean"></a>
<span class="permalink">
<a href="../../../../../../com/github/illfaku/korro/dto/ws/PingWsFrame.html#!=(x$1:Any):Boolean" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $bang$eq" class="name">!=</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef###" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="##():Int"></a>
<span class="permalink">
<a href="../../../../../../com/github/illfaku/korro/dto/ws/PingWsFrame.html###():Int" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $hash$hash" class="name">##</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.Predef.any2stringadd#+" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="+(other:String):String"></a><a id="+(String):String"></a>
<span class="permalink">
<a href="../../../../../../com/github/illfaku/korro/dto/ws/PingWsFrame.html#+(other:String):String" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $plus" class="implicit">+</span><span class="params">(<span name="other">other: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="result">: <span class="extype" name="scala.Predef.String">String</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt class="implicit">Implicit</dt><dd>
This member is added by an implicit conversion from <a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a> to
<span class="extype" name="scala.Predef.any2stringadd">any2stringadd</span>[<a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a>] performed by method any2stringadd in scala.Predef.
</dd><dt>Definition Classes</dt><dd>any2stringadd</dd></dl></div>
</li><li name="scala.Predef.ArrowAssoc#->" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="->[B](y:B):(A,B)"></a><a id="->[B](B):(PingWsFrame,B)"></a>
<span class="permalink">
<a href="../../../../../../com/github/illfaku/korro/dto/ws/PingWsFrame.html#->[B](y:B):(A,B)" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $minus$greater" class="implicit">-></span><span class="tparams">[<span name="B">B</span>]</span><span class="params">(<span name="y">y: <span class="extype" name="scala.Predef.ArrowAssoc.->.B">B</span></span>)</span><span class="result">: (<a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a>, <span class="extype" name="scala.Predef.ArrowAssoc.->.B">B</span>)</span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt class="implicit">Implicit</dt><dd>
This member is added by an implicit conversion from <a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a> to
<span class="extype" name="scala.Predef.ArrowAssoc">ArrowAssoc</span>[<a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a>] performed by method ArrowAssoc in scala.Predef.
</dd><dt>Definition Classes</dt><dd>ArrowAssoc</dd><dt>Annotations</dt><dd>
<span class="name">@inline</span><span class="args">()</span>
</dd></dl></div>
</li><li name="scala.AnyRef#==" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="==(x$1:Any):Boolean"></a><a id="==(Any):Boolean"></a>
<span class="permalink">
<a href="../../../../../../com/github/illfaku/korro/dto/ws/PingWsFrame.html#==(x$1:Any):Boolean" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $eq$eq" class="name">==</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.Any#asInstanceOf" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="asInstanceOf[T0]:T0"></a>
<span class="permalink">
<a href="../../../../../../com/github/illfaku/korro/dto/ws/PingWsFrame.html#asInstanceOf[T0]:T0" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">asInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Any.asInstanceOf.T0">T0</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div>
</li><li name="com.github.illfaku.korro.dto.ws.PingWsFrame#bytes" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped">
<a id="bytes:Array[Byte]"></a>
<span class="permalink">
<a href="../../../../../../com/github/illfaku/korro/dto/ws/PingWsFrame.html#bytes:Array[Byte]" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">val</span>
</span>
<span class="symbol">
<span class="name">bytes</span><span class="result">: <span class="extype" name="scala.Array">Array</span>[<span class="extype" name="scala.Byte">Byte</span>]</span>
</span>
</li><li name="scala.AnyRef#clone" visbl="prt" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="clone():Object"></a><a id="clone():AnyRef"></a>
<span class="permalink">
<a href="../../../../../../com/github/illfaku/korro/dto/ws/PingWsFrame.html#clone():Object" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">clone</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.AnyRef">AnyRef</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<a href="../../../../../../java/lang/index.html" class="extype" name="java.lang">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@native</span><span class="args">()</span>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.CloneNotSupportedException]">...</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.Predef.Ensuring#ensuring" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="ensuring(cond:A=>Boolean,msg:=>Any):A"></a><a id="ensuring((PingWsFrame)⇒Boolean,⇒Any):PingWsFrame"></a>
<span class="permalink">
<a href="../../../../../../com/github/illfaku/korro/dto/ws/PingWsFrame.html#ensuring(cond:A=>Boolean,msg:=>Any):A" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="implicit">ensuring</span><span class="params">(<span name="cond">cond: (<a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a>) ⇒ <span class="extype" name="scala.Boolean">Boolean</span></span>, <span name="msg">msg: ⇒ <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt class="implicit">Implicit</dt><dd>
This member is added by an implicit conversion from <a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a> to
<span class="extype" name="scala.Predef.Ensuring">Ensuring</span>[<a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a>] performed by method Ensuring in scala.Predef.
</dd><dt>Definition Classes</dt><dd>Ensuring</dd></dl></div>
</li><li name="scala.Predef.Ensuring#ensuring" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="ensuring(cond:A=>Boolean):A"></a><a id="ensuring((PingWsFrame)⇒Boolean):PingWsFrame"></a>
<span class="permalink">
<a href="../../../../../../com/github/illfaku/korro/dto/ws/PingWsFrame.html#ensuring(cond:A=>Boolean):A" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="implicit">ensuring</span><span class="params">(<span name="cond">cond: (<a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a>) ⇒ <span class="extype" name="scala.Boolean">Boolean</span></span>)</span><span class="result">: <a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt class="implicit">Implicit</dt><dd>
This member is added by an implicit conversion from <a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a> to
<span class="extype" name="scala.Predef.Ensuring">Ensuring</span>[<a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a>] performed by method Ensuring in scala.Predef.
</dd><dt>Definition Classes</dt><dd>Ensuring</dd></dl></div>
</li><li name="scala.Predef.Ensuring#ensuring" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="ensuring(cond:Boolean,msg:=>Any):A"></a><a id="ensuring(Boolean,⇒Any):PingWsFrame"></a>
<span class="permalink">
<a href="../../../../../../com/github/illfaku/korro/dto/ws/PingWsFrame.html#ensuring(cond:Boolean,msg:=>Any):A" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="implicit">ensuring</span><span class="params">(<span name="cond">cond: <span class="extype" name="scala.Boolean">Boolean</span></span>, <span name="msg">msg: ⇒ <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt class="implicit">Implicit</dt><dd>
This member is added by an implicit conversion from <a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a> to
<span class="extype" name="scala.Predef.Ensuring">Ensuring</span>[<a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a>] performed by method Ensuring in scala.Predef.
</dd><dt>Definition Classes</dt><dd>Ensuring</dd></dl></div>
</li><li name="scala.Predef.Ensuring#ensuring" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="ensuring(cond:Boolean):A"></a><a id="ensuring(Boolean):PingWsFrame"></a>
<span class="permalink">
<a href="../../../../../../com/github/illfaku/korro/dto/ws/PingWsFrame.html#ensuring(cond:Boolean):A" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="implicit">ensuring</span><span class="params">(<span name="cond">cond: <span class="extype" name="scala.Boolean">Boolean</span></span>)</span><span class="result">: <a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt class="implicit">Implicit</dt><dd>
This member is added by an implicit conversion from <a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a> to
<span class="extype" name="scala.Predef.Ensuring">Ensuring</span>[<a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a>] performed by method Ensuring in scala.Predef.
</dd><dt>Definition Classes</dt><dd>Ensuring</dd></dl></div>
</li><li name="scala.AnyRef#eq" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="eq(x$1:AnyRef):Boolean"></a><a id="eq(AnyRef):Boolean"></a>
<span class="permalink">
<a href="../../../../../../com/github/illfaku/korro/dto/ws/PingWsFrame.html#eq(x$1:AnyRef):Boolean" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">eq</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#finalize" visbl="prt" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="finalize():Unit"></a>
<span class="permalink">
<a href="../../../../../../com/github/illfaku/korro/dto/ws/PingWsFrame.html#finalize():Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">finalize</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<a href="../../../../../../java/lang/index.html" class="extype" name="java.lang">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="symbol">classOf[java.lang.Throwable]</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.Predef.StringFormat#formatted" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="formatted(fmtstr:String):String"></a><a id="formatted(String):String"></a>
<span class="permalink">
<a href="../../../../../../com/github/illfaku/korro/dto/ws/PingWsFrame.html#formatted(fmtstr:String):String" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="implicit">formatted</span><span class="params">(<span name="fmtstr">fmtstr: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="result">: <span class="extype" name="scala.Predef.String">String</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt class="implicit">Implicit</dt><dd>
This member is added by an implicit conversion from <a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a> to
<span class="extype" name="scala.Predef.StringFormat">StringFormat</span>[<a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a>] performed by method StringFormat in scala.Predef.
</dd><dt>Definition Classes</dt><dd>StringFormat</dd><dt>Annotations</dt><dd>
<span class="name">@inline</span><span class="args">()</span>
</dd></dl></div>
</li><li name="scala.AnyRef#getClass" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="getClass():Class[_]"></a>
<span class="permalink">
<a href="../../../../../../com/github/illfaku/korro/dto/ws/PingWsFrame.html#getClass():Class[_]" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">getClass</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.Class">Class</span>[_]</span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd><dt>Annotations</dt><dd>
<span class="name">@native</span><span class="args">()</span>
</dd></dl></div>
</li><li name="scala.Any#isInstanceOf" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="isInstanceOf[T0]:Boolean"></a>
<span class="permalink">
<a href="../../../../../../com/github/illfaku/korro/dto/ws/PingWsFrame.html#isInstanceOf[T0]:Boolean" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">isInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div>
</li><li name="scala.AnyRef#ne" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="ne(x$1:AnyRef):Boolean"></a><a id="ne(AnyRef):Boolean"></a>
<span class="permalink">
<a href="../../../../../../com/github/illfaku/korro/dto/ws/PingWsFrame.html#ne(x$1:AnyRef):Boolean" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">ne</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#notify" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="notify():Unit"></a>
<span class="permalink">
<a href="../../../../../../com/github/illfaku/korro/dto/ws/PingWsFrame.html#notify():Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">notify</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@native</span><span class="args">()</span>
</dd></dl></div>
</li><li name="scala.AnyRef#notifyAll" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="notifyAll():Unit"></a>
<span class="permalink">
<a href="../../../../../../com/github/illfaku/korro/dto/ws/PingWsFrame.html#notifyAll():Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">notifyAll</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@native</span><span class="args">()</span>
</dd></dl></div>
</li><li name="scala.AnyRef#synchronized" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="synchronized[T0](x$1:=>T0):T0"></a><a id="synchronized[T0](⇒T0):T0"></a>
<span class="permalink">
<a href="../../../../../../com/github/illfaku/korro/dto/ws/PingWsFrame.html#synchronized[T0](x$1:=>T0):T0" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">synchronized</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="params">(<span name="arg0">arg0: ⇒ <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span>)</span><span class="result">: <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="com.github.illfaku.korro.dto.ws.PingWsFrame#toString" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped">
<a id="toString:String"></a>
<span class="permalink">
<a href="../../../../../../com/github/illfaku/korro/dto/ws/PingWsFrame.html#toString:String" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">val</span>
</span>
<span class="symbol">
<span class="name">toString</span><span class="result">: <span class="extype" name="scala.Predef.String">String</span></span>
</span>
</li><li name="scala.AnyRef#wait" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait():Unit"></a>
<span class="permalink">
<a href="../../../../../../com/github/illfaku/korro/dto/ws/PingWsFrame.html#wait():Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.InterruptedException]">...</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.AnyRef#wait" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait(x$1:Long,x$2:Int):Unit"></a><a id="wait(Long,Int):Unit"></a>
<span class="permalink">
<a href="../../../../../../com/github/illfaku/korro/dto/ws/PingWsFrame.html#wait(x$1:Long,x$2:Int):Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>, <span name="arg1">arg1: <span class="extype" name="scala.Int">Int</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.InterruptedException]">...</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.AnyRef#wait" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait(x$1:Long):Unit"></a><a id="wait(Long):Unit"></a>
<span class="permalink">
<a href="../../../../../../com/github/illfaku/korro/dto/ws/PingWsFrame.html#wait(x$1:Long):Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@native</span><span class="args">()</span>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.InterruptedException]">...</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.Predef.ArrowAssoc#→" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="→[B](y:B):(A,B)"></a><a id="→[B](B):(PingWsFrame,B)"></a>
<span class="permalink">
<a href="../../../../../../com/github/illfaku/korro/dto/ws/PingWsFrame.html#→[B](y:B):(A,B)" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $u2192" class="implicit">→</span><span class="tparams">[<span name="B">B</span>]</span><span class="params">(<span name="y">y: <span class="extype" name="scala.Predef.ArrowAssoc.→.B">B</span></span>)</span><span class="result">: (<a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a>, <span class="extype" name="scala.Predef.ArrowAssoc.→.B">B</span>)</span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt class="implicit">Implicit</dt><dd>
This member is added by an implicit conversion from <a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a> to
<span class="extype" name="scala.Predef.ArrowAssoc">ArrowAssoc</span>[<a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a>] performed by method ArrowAssoc in scala.Predef.
</dd><dt>Definition Classes</dt><dd>ArrowAssoc</dd></dl></div>
</li>
</ol>
</div>
</div>
<div id="inheritedMembers">
<div class="parent" name="scala.Serializable">
<h3>Inherited from <span class="extype" name="scala.Serializable">Serializable</span></h3>
</div><div class="parent" name="java.io.Serializable">
<h3>Inherited from <span class="extype" name="java.io.Serializable">Serializable</span></h3>
</div><div class="parent" name="scala.Product">
<h3>Inherited from <span class="extype" name="scala.Product">Product</span></h3>
</div><div class="parent" name="scala.Equals">
<h3>Inherited from <span class="extype" name="scala.Equals">Equals</span></h3>
</div><div class="parent" name="com.github.illfaku.korro.dto.ws.ControlWsFrame">
<h3>Inherited from <a href="ControlWsFrame.html" class="extype" name="com.github.illfaku.korro.dto.ws.ControlWsFrame">ControlWsFrame</a></h3>
</div><div class="parent" name="com.github.illfaku.korro.dto.ws.WsFrame">
<h3>Inherited from <a href="WsFrame.html" class="extype" name="com.github.illfaku.korro.dto.ws.WsFrame">WsFrame</a></h3>
</div><div class="parent" name="scala.AnyRef">
<h3>Inherited from <span class="extype" name="scala.AnyRef">AnyRef</span></h3>
</div><div class="parent" name="scala.Any">
<h3>Inherited from <span class="extype" name="scala.Any">Any</span></h3>
</div>
<div class="conversion" name="scala.Predef.any2stringadd">
<h3>Inherited by implicit conversion any2stringadd from
<a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a> to <span class="extype" name="scala.Predef.any2stringadd">any2stringadd</span>[<a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a>]
</h3>
</div><div class="conversion" name="scala.Predef.StringFormat">
<h3>Inherited by implicit conversion StringFormat from
<a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a> to <span class="extype" name="scala.Predef.StringFormat">StringFormat</span>[<a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a>]
</h3>
</div><div class="conversion" name="scala.Predef.Ensuring">
<h3>Inherited by implicit conversion Ensuring from
<a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a> to <span class="extype" name="scala.Predef.Ensuring">Ensuring</span>[<a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a>]
</h3>
</div><div class="conversion" name="scala.Predef.ArrowAssoc">
<h3>Inherited by implicit conversion ArrowAssoc from
<a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a> to <span class="extype" name="scala.Predef.ArrowAssoc">ArrowAssoc</span>[<a href="" class="extype" name="com.github.illfaku.korro.dto.ws.PingWsFrame">PingWsFrame</a>]
</h3>
</div>
</div>
<div id="groupedMembers">
<div class="group" name="Ungrouped">
<h3>Ungrouped</h3>
</div>
</div>
</div>
<div id="tooltip"></div>
<div id="footer"> </div>
</body>
</div>
</div>
</div>
</body>
</html>
| {
"content_hash": "555720b27d5db1f171a316805b7bd6b1",
"timestamp": "",
"source": "github",
"line_count": 878,
"max_line_length": 679,
"avg_line_length": 60.33940774487471,
"alnum_prop": 0.5894333496923251,
"repo_name": "oxy-development/korro",
"id": "a8cd5f378cdf221abfc76913201adf82e28abc73",
"size": "53098",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "docs/api/com/github/illfaku/korro/dto/ws/PingWsFrame.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Scala",
"bytes": "218592"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "792bb2d621cd5d191c31bd0e3f40c75e",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "3118cdd839a15592c0ad2803a37f279e44c2494f",
"size": "167",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Liliopsida/Liliales/Liliaceae/Gagea/Gagea dyris/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
''' Dummy NFC Provider to be used on desktops in case no other provider is found
'''
from . import NFCBase
from kivy.clock import Clock
from kivy.logger import Logger
class ScannerDummy(NFCBase):
'''This is the dummy interface that gets selected in case any other
hardware interface to NFC is not available.
'''
_initialised = False
name = 'NFCDummy'
def nfc_init(self):
# print 'nfc_init()'
Logger.debug('NFC: configure nfc')
self._initialised = True
self.nfc_enable()
return True
def on_new_intent(self, dt):
tag_info = {'type': 'dymmy',
'message': 'dummy',
'extra details': None}
# let Main app know that a tag has been detected
app = App.get_running_app()
app.tag_discovered(tag_info)
app.show_info('New tag detected.', duration=2)
Logger.debug('NFC: got new dummy tag')
def nfc_enable(self):
Logger.debug('NFC: enable')
if self._initialised:
Clock.schedule_interval(self.on_new_intent, 22)
def nfc_disable(self):
# print 'nfc_enable()'
Clock.unschedule(self.on_new_intent)
def nfc_enable_exchange(self, data):
''' Start sending data
'''
Logger.debug('NFC: sending data {}'.format(data))
def nfc_disable_exchange(self):
''' Disable/Stop ndef exchange
'''
Logger.debug('NFC: disable nfc exchange')
| {
"content_hash": "2bb9b41de14902b3e508b98930b3f9e9",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 80,
"avg_line_length": 28.384615384615383,
"alnum_prop": 0.5962059620596206,
"repo_name": "asfin/electrum",
"id": "a0d3e2643ecfa1bb0cf1b96d1eb57ee4b32e4ba9",
"size": "1476",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "electrum/gui/kivy/nfc_scanner/scanner_dummy.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "1118"
},
{
"name": "GLSL",
"bytes": "289"
},
{
"name": "Java",
"bytes": "1574"
},
{
"name": "Makefile",
"bytes": "874"
},
{
"name": "NSIS",
"bytes": "7316"
},
{
"name": "Python",
"bytes": "2187670"
},
{
"name": "Shell",
"bytes": "21268"
}
],
"symlink_target": ""
} |
package williams.mathew.gradle.demo.converter;
import williams.mathew.gradle.demo.data.model.Status;
import williams.mathew.gradle.demo.web.model.PayloadStatus;
public class StatusConverter {
public PayloadStatus toPayload(Status status) {
return new PayloadStatus(status.getStatusCode(), status.getStatusMessage());
}
}
| {
"content_hash": "e2d6cf00db0e5e9cf48be3e02d214c49",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 84,
"avg_line_length": 28.416666666666668,
"alnum_prop": 0.7771260997067448,
"repo_name": "williamsmathew91/sudoku",
"id": "c0a1be6908e4955f683a952f29e21935e189548e",
"size": "341",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "service/src/main/java/williams/mathew/gradle/demo/converter/StatusConverter.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "13207"
},
{
"name": "Groovy",
"bytes": "4015"
},
{
"name": "Java",
"bytes": "8448"
},
{
"name": "JavaScript",
"bytes": "5866"
},
{
"name": "Ruby",
"bytes": "290"
},
{
"name": "Shell",
"bytes": "7484"
}
],
"symlink_target": ""
} |
class DevToolsUI : public content::WebUIController {
public:
static GURL GetProxyURL(const std::string& frontend_url);
static GURL GetRemoteBaseURL();
static bool IsFrontendResourceURL(const GURL& url);
explicit DevToolsUI(content::WebUI* web_ui);
DevToolsUI(const DevToolsUI&) = delete;
DevToolsUI& operator=(const DevToolsUI&) = delete;
~DevToolsUI() override;
private:
DevToolsUIBindings bindings_;
};
#endif // CHROME_BROWSER_UI_WEBUI_DEVTOOLS_UI_H_
| {
"content_hash": "ba097fa88bf640a211a7b670b917a80f",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 59,
"avg_line_length": 26.555555555555557,
"alnum_prop": 0.7447698744769874,
"repo_name": "scheib/chromium",
"id": "b398bb5fde7900b30d5723ec7f3348790096faf7",
"size": "856",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "chrome/browser/ui/webui/devtools_ui.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
package de.chandre.admintool;
import java.util.HashMap;
import java.util.Map;
import org.quartz.JobDetail;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.quartz.CronTriggerFactoryBean;
import org.springframework.scheduling.quartz.JobDetailFactoryBean;
import org.springframework.scheduling.quartz.SimpleTriggerFactoryBean;
import de.chandre.admintool.jobs.InterruptableSampleJob;
import de.chandre.admintool.jobs.SimpleCronJob;
import de.chandre.admintool.jobs.SimpleJob;
import de.chandre.quartz.spring.QuartzUtils;
/**
* Using https://github.com/andrehertwig/spring-boot-starter-quartz for scheduler config
* @author André Hertwig
*/
@Configuration
public class QuartzConfig
{
@Bean
public JobDetailFactoryBean simpleJobDetail() {
return QuartzUtils.createJobDetail(SimpleJob.class, null, null, "Just a Simple Job", null);
}
@Bean
public JobDetailFactoryBean simpleJobDetail3() {
return QuartzUtils.createJobDetail(SimpleJob.class, null, "Simple" , null, null);
}
@Bean
public JobDetailFactoryBean simpleJobDetail4() {
Map<String, Object> jobData = new HashMap<>();
jobData.put("detail1", "anotherStringValue");
jobData.put("detail2", Boolean.FALSE);
jobData.put("detail3", Integer.valueOf(21));
return QuartzUtils.createJobDetail(InterruptableSampleJob.class, null, "Simple", "Interruptable job to demonstrate the functionality", jobData);
}
@Bean
public JobDetailFactoryBean simpleCronJobDetail() {
Map<String, Object> jobData = new HashMap<>();
jobData.put("detail1", "stringValue");
jobData.put("detail2", Boolean.TRUE);
jobData.put("detail3", Integer.valueOf(42));
return QuartzUtils.createJobDetail(SimpleCronJob.class, null, "Cron", "Cron job example job detail", jobData);
}
@Bean(name="simpleJobTrigger1")
public SimpleTriggerFactoryBean createSimpleTrigger(@Qualifier("simpleJobDetail") JobDetail jobDetail) {
return QuartzUtils.createSimpleTrigger(jobDetail, null, null, "Simple trigger 1", 5000L, 60000L, null);
}
@Bean(name="simpleJobTrigger2")
public SimpleTriggerFactoryBean createSimpleTrigger2(@Qualifier("simpleJobDetail") JobDetail jobDetail) {
return QuartzUtils.createSimpleTrigger(jobDetail, null, null, "Simple trigger 2", 5000L, 85000L, null);
}
@Bean(name="simpleJobTrigger3")
public SimpleTriggerFactoryBean createSimpleTrigger3(@Qualifier("simpleJobDetail3") JobDetail jobDetail) {
return QuartzUtils.createSimpleTrigger(jobDetail, null, "Simple", "Simple trigger 3", 5000L, 150000L, null);
}
@Bean(name="simpleJobTrigger4")
public SimpleTriggerFactoryBean createSimpleTrigger4(@Qualifier("simpleJobDetail4") JobDetail jobDetail) {
return QuartzUtils.createSimpleTrigger(jobDetail, null, "Simple", null, 5000L, 300000L, null);
}
@Bean(name="simpleCronTrigger1")
public CronTriggerFactoryBean createSimpleCronTrigger(@Qualifier("simpleCronJobDetail") JobDetail jobDetail) {
Map<String, Object> jobData = new HashMap<>();
jobData.put("key1", "stringValue");
jobData.put("key2", Boolean.TRUE);
jobData.put("key3", Integer.valueOf(42));
return QuartzUtils.createCronTrigger(jobDetail, null, "Cron", "SimpleCronTrigger 1", "0 0/5 * 1/1 * ? *", 5000L, jobData);
}
@Bean(name="simpleCronTrigger2")
public CronTriggerFactoryBean createSimpleCronTrigger2(@Qualifier("simpleCronJobDetail") JobDetail jobDetail) {
return QuartzUtils.createCronTrigger(jobDetail, null, "Cron", null, "0 0 0/1 1/1 * ? *", 5000L, null);
}
}
| {
"content_hash": "44f4a098381d4ac16753e153a51a3495",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 146,
"avg_line_length": 43.926829268292686,
"alnum_prop": 0.7795669072737368,
"repo_name": "andrehertwig/admintool",
"id": "ec1a60a39ea45e082391e3dfb8a1fabc9467a917",
"size": "3603",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "admin-tools-demo-core/src/main/java/de/chandre/admintool/QuartzConfig.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "22852"
},
{
"name": "HTML",
"bytes": "239786"
},
{
"name": "Java",
"bytes": "727066"
},
{
"name": "JavaScript",
"bytes": "485234"
},
{
"name": "PLSQL",
"bytes": "3026"
},
{
"name": "TSQL",
"bytes": "9771"
}
],
"symlink_target": ""
} |
class Application
include ApplicationComponents
include ApplicationParser
include ApplicationProcessor
include ApplicationResponder
include ActiveModel::Conversion
extend ActiveModel::Naming
def persisted?
false
end
attr_reader :error
XML_NAMESPACES = {
"exch" => "http://at.dsh.cms.gov/exchange/1.0",
"s" => "http://niem.gov/niem/structures/2.0",
"ext" => "http://at.dsh.cms.gov/extension/1.0",
"hix-core" => "http://hix.cms.gov/0.1/hix-core",
"hix-ee" => "http://hix.cms.gov/0.1/hix-ee",
"nc" => "http://niem.gov/niem/niem-core/2.0",
"hix-pm" => "http://hix.cms.gov/0.1/hix-pm",
"scr" => "http://niem.gov/niem/domains/screening/2.1"
}
def initialize(raw_application, content_type)
@determination_date = Date.today
@error = nil
begin
if content_type == 'application/json'
@json_application = JSON.parse(raw_application)
read_json!
elsif content_type == 'application/xml'
@xml_application = Nokogiri::XML(raw_application) do |config|
config.default_xml.noblanks
end
read_xml!
elsif content_type
raise "Invalid content type #{content_type}"
else
raise "Missing content type"
end
read_configs!
compute_values!
process_rules!
rescue Exception => e
Rails.logger.error e
Rails.logger.error e.backtrace.join("\n")
@error = e
end
end
private
def return_application?
true
end
end
| {
"content_hash": "cd94cf8c1147d2d8f0b38976fa4c72e1",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 69,
"avg_line_length": 26.06779661016949,
"alnum_prop": 0.611183355006502,
"repo_name": "dchealthlink/MITC",
"id": "eb3d2d82be9d77b66becbb20e0c0e71b9936e6dd",
"size": "1538",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/models/application.rb",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "23563"
},
{
"name": "HTML",
"bytes": "78273"
},
{
"name": "JavaScript",
"bytes": "135930"
},
{
"name": "Perl",
"bytes": "38636"
},
{
"name": "Ruby",
"bytes": "202980"
}
],
"symlink_target": ""
} |
;'use strict';
let sourceId = 0,
parentId = 0,
sourceName = "",
sourceModified = "",
arr = [];
$('.modal').on('show.bs.modal', function (event) {
let button = $(event.relatedTarget);
let modal = $(this);
let template = `<i class="${$(button).children().attr('class')}"></i> ${$(button).text().trim()}`;
modal.find('.modal-title').html(template);
});
const init = async () => {
let i = 0;
let url = new URL(window.location.href);
sourceId = url.searchParams.get("folderId");
arr = [
{url: "/folders/"+sourceId, callback: setFoldersById},
{url: "/folders/parent/"+sourceId, callback: setFoldersByParent},
{url: "/files/folder/"+sourceId, callback: setFilesByParent}
];
setData(arr[0].url, arr[0].callback);
}
let setData = (url, callback) => {
fetch(url).then(response => {
return response.text();
}).then(data => {
callback(JSON.parse(data));
});
};
let setFoldersById = (data) => {
sourceName = data.name;
sourceModified = data.modified;
sourceId = data.id;
if(data.parent){
parentId = data.parent.id;
}
appSetBreadcrumb(data);
setData(arr[1].url, arr[1].callback);
};
let setFoldersByParent = (data) =>{
if(data){
for(let i=0; i<data.length; i++){
let tr = `<tr>
<td scope="col" class="col-4">
<a href="/source.html?folderId=${data[i].id}">
<i class="fa fa-folder" aria-hidden="true"></i> ${data[i].name}
</a>
</td>
<td scope="col" class="col-2 txt-r"></td>
<td scope="col" class="col-2">${data[i].modified}</td>
<td scope="col" class="col-4"></td>
</tr>`
$('#tableSource tbody').append(tr);
}
}
setData(arr[2].url, arr[2].callback);
};
let setFilesByParent = (data) =>{
if(data){
for(let i=0; i<data.length; i++){
let tr = `<tr>
<td scope="col" class="col-4">
<a href="/htmlVisualEditor.html?fileId=${data[i].id}">
<i class="fa fa-file-text-o" aria-hidden="true"></i> ${data[i].name}
</a>
</td>
<td scope="col" class="col-2 txt-r">${data[i].size} KB</td>
<td scope="col" class="col-2">${data[i].modified}</td>
<td scope="col" class="col-4"></td>
</tr>`
$('#tableSource tbody').append(tr);
}
}
};
$('#btnModalCreate').on('click', function(event){
//debugger;
if($(this).parents('.modal-content').find('.modal-title').text().indexOf('Folder') > 0){
createFolder();
}else{
createFile();
}
});
function createFolder(){
let newFolderName = $('#newFolderFileName').val();
if(!newFolderName){
alert('Nome é requerido!');
return false;
}
let json = {
"name": newFolderName,
"parent": {
"id": sourceId
}
};
fetch("/folders", {
method: 'POST',
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(json)
}).then(response => {
return response.json();
}).then(response => {
$('#modalCreateFolderFile').modal('hide');
$('#tableSource > tbody').html('');
init();
//location.href = 'source.html?folderId='+sourceId;
}).catch(function(error) {
console.log('There has been a problem with your fetch operation[loading createFolder]: ' + error.message);
});
}
function createFile(){
let newFileName = $('#newFolderFileName').val();
if(!newFileName){
alert('Nome é requerido!');
return false;
}
let json = {
"name": newFileName,
"folder": {
"id": sourceId
}
};
fetch("/files", {
method: 'POST',
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(json)
}).then(response => {
return response.json();
}).then(data => {
//let data = JSON.parse(response);
$('#modalCreateFolderFile').modal('hide');
location.href = 'htmlVisualEditor.html?fileId='+data.id;
}).catch(function(error) {
console.log('There has been a problem with your fetch operation[loading createFile]: ' + error.message);
});
}
(function(){
init();
})(); | {
"content_hash": "a172ef2affabbd9fef215bf1f6ca1779",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 114,
"avg_line_length": 28.179640718562876,
"alnum_prop": 0.4876753081172971,
"repo_name": "sandroe2000/woolaweaver",
"id": "3d2b2c4201ea86e70dbf26224acc230f20d75522",
"size": "4708",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "source/js/source.js",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "663512"
},
{
"name": "HTML",
"bytes": "79541"
},
{
"name": "JavaScript",
"bytes": "29965175"
}
],
"symlink_target": ""
} |
package hudson.util;
import com.google.common.annotations.Beta;
import com.google.common.base.Predicates;
import com.google.common.collect.ImmutableList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.ListIterator;
import java.util.AbstractList;
import java.util.Arrays;
import java.util.Set;
import java.util.HashSet;
import javax.annotation.Nonnull;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
/**
* Varios {@link Iterator} implementations.
*
* @author Kohsuke Kawaguchi
* @see AdaptedIterator
*/
public class Iterators {
/**
* Returns the empty iterator.
*/
public static <T> Iterator<T> empty() {
return Collections.<T>emptyList().iterator();
}
/**
* Produces {A,B,C,D,E,F} from {{A,B},{C},{},{D,E,F}}.
*/
public static abstract class FlattenIterator<U,T> implements Iterator<U> {
private final Iterator<? extends T> core;
private Iterator<U> cur;
protected FlattenIterator(Iterator<? extends T> core) {
this.core = core;
cur = Collections.<U>emptyList().iterator();
}
protected FlattenIterator(Iterable<? extends T> core) {
this(core.iterator());
}
protected abstract Iterator<U> expand(T t);
public boolean hasNext() {
while(!cur.hasNext()) {
if(!core.hasNext())
return false;
cur = expand(core.next());
}
return true;
}
public U next() {
if(!hasNext()) throw new NoSuchElementException();
return cur.next();
}
public void remove() {
throw new UnsupportedOperationException();
}
}
/**
* Creates a filtered view of another iterator.
*
* @since 1.150
*/
public static abstract class FilterIterator<T> implements Iterator<T> {
private final Iterator<? extends T> core;
private T next;
private boolean fetched;
protected FilterIterator(Iterator<? extends T> core) {
this.core = core;
}
protected FilterIterator(Iterable<? extends T> core) {
this(core.iterator());
}
private void fetch() {
while(!fetched && core.hasNext()) {
T n = core.next();
if(filter(n)) {
next = n;
fetched = true;
}
}
}
/**
* Filter out items in the original collection.
*
* @return
* true to leave this item and return this item from this iterator.
* false to hide this item.
*/
protected abstract boolean filter(T t);
public boolean hasNext() {
fetch();
return fetched;
}
public T next() {
fetch();
if(!fetched) throw new NoSuchElementException();
fetched = false;
return next;
}
public void remove() {
core.remove();
}
}
/**
* Remove duplicates from another iterator.
*/
public static final class DuplicateFilterIterator<T> extends FilterIterator<T> {
private final Set<T> seen = new HashSet<T>();
public DuplicateFilterIterator(Iterator<? extends T> core) {
super(core);
}
public DuplicateFilterIterator(Iterable<? extends T> core) {
super(core);
}
protected boolean filter(T t) {
return seen.add(t);
}
}
/**
* Returns the {@link Iterable} that lists items in the reverse order.
*
* @since 1.150
*/
public static <T> Iterable<T> reverse(final List<T> lst) {
return new Iterable<T>() {
public Iterator<T> iterator() {
final ListIterator<T> itr = lst.listIterator(lst.size());
return new Iterator<T>() {
public boolean hasNext() {
return itr.hasPrevious();
}
public T next() {
return itr.previous();
}
public void remove() {
itr.remove();
}
};
}
};
}
/**
* Returns an {@link Iterable} that lists items in the normal order
* but which hides the base iterator implementation details.
*
* @since 1.492
*/
public static <T> Iterable<T> wrap(final Iterable<T> base) {
return new Iterable<T>() {
public Iterator<T> iterator() {
final Iterator<T> itr = base.iterator();
return new Iterator<T>() {
public boolean hasNext() {
return itr.hasNext();
}
public T next() {
return itr.next();
}
public void remove() {
itr.remove();
}
};
}
};
}
/**
* Returns a list that represents [start,end).
*
* For example sequence(1,5,1)={1,2,3,4}, and sequence(7,1,-2)={7.5,3}
*
* @since 1.150
*/
public static List<Integer> sequence(final int start, int end, final int step) {
final int size = (end-start)/step;
if(size<0) throw new IllegalArgumentException("List size is negative");
return new AbstractList<Integer>() {
public Integer get(int index) {
if(index<0 || index>=size)
throw new IndexOutOfBoundsException();
return start+index*step;
}
public int size() {
return size;
}
};
}
public static List<Integer> sequence(int start, int end) {
return sequence(start,end,1);
}
/**
* The short cut for {@code reverse(sequence(start,end,step))}.
*
* @since 1.150
*/
public static List<Integer> reverseSequence(int start, int end, int step) {
return sequence(end-1,start-1,-step);
}
public static List<Integer> reverseSequence(int start, int end) {
return reverseSequence(start,end,1);
}
/**
* Casts {@link Iterator} by taking advantage of its covariant-ness.
*/
@SuppressWarnings({"unchecked"})
public static <T> Iterator<T> cast(Iterator<? extends T> itr) {
return (Iterator)itr;
}
/**
* Casts {@link Iterable} by taking advantage of its covariant-ness.
*/
@SuppressWarnings({"unchecked"})
public static <T> Iterable<T> cast(Iterable<? extends T> itr) {
return (Iterable)itr;
}
/**
* Returns an {@link Iterator} that only returns items of the given subtype.
*/
@SuppressWarnings({"unchecked"})
public static <U,T extends U> Iterator<T> subType(Iterator<U> itr, final Class<T> type) {
return (Iterator)new FilterIterator<U>(itr) {
protected boolean filter(U u) {
return type.isInstance(u);
}
};
}
/**
* Creates a read-only mutator that disallows {@link Iterator#remove()}.
*/
public static <T> Iterator<T> readOnly(final Iterator<T> itr) {
return new Iterator<T>() {
public boolean hasNext() {
return itr.hasNext();
}
public T next() {
return itr.next();
}
public void remove() {
throw new UnsupportedOperationException();
}
};
}
/**
* Wraps another iterator and throws away nulls.
*/
public static <T> Iterator<T> removeNull(final Iterator<T> itr) {
return com.google.common.collect.Iterators.filter(itr, Predicates.notNull());
}
/**
* Returns an {@link Iterable} that iterates over all the given {@link Iterable}s.
*
* <p>
* That is, this creates {A,B,C,D} from {A,B},{C,D}.
*/
@SafeVarargs
public static <T> Iterable<T> sequence( final Iterable<? extends T>... iterables ) {
return new Iterable<T>() {
public Iterator<T> iterator() {
return new FlattenIterator<T,Iterable<? extends T>>(ImmutableList.copyOf(iterables)) {
protected Iterator<T> expand(Iterable<? extends T> iterable) {
return Iterators.<T>cast(iterable).iterator();
}
};
}
};
}
/**
* Filters another iterator by eliminating duplicates.
*/
public static <T> Iterator<T> removeDups(Iterator<T> iterator) {
return new FilterIterator<T>(iterator) {
final Set<T> found = new HashSet<T>();
@Override
protected boolean filter(T t) {
return found.add(t);
}
};
}
/**
* Filters another iterator by eliminating duplicates.
*/
public static <T> Iterable<T> removeDups(final Iterable<T> base) {
return new Iterable<T>() {
public Iterator<T> iterator() {
return removeDups(base.iterator());
}
};
}
@SafeVarargs
public static <T> Iterator<T> sequence(Iterator<? extends T>... iterators) {
return com.google.common.collect.Iterators.<T>concat(iterators);
}
/**
* Returns the elements in the base iterator until it hits any element that doesn't satisfy the filter.
* Then the rest of the elements in the base iterator gets ignored.
*
* @since 1.485
*/
public static <T> Iterator<T> limit(final Iterator<? extends T> base, final CountingPredicate<? super T> filter) {
return new Iterator<T>() {
private T next;
private boolean end;
private int index=0;
public boolean hasNext() {
fetch();
return next!=null;
}
public T next() {
fetch();
T r = next;
next = null;
return r;
}
private void fetch() {
if (next==null && !end) {
if (base.hasNext()) {
next = base.next();
if (!filter.apply(index++,next)) {
next = null;
end = true;
}
} else {
end = true;
}
}
}
public void remove() {
throw new UnsupportedOperationException();
}
};
}
public interface CountingPredicate<T> {
boolean apply(int index, T input);
}
/**
* Similar to {@link com.google.common.collect.Iterators#skip} except not {@link Beta}.
* @param iterator some iterator
* @param count a nonnegative count
*/
@Restricted(NoExternalUse.class)
public static void skip(@Nonnull Iterator<?> iterator, int count) {
if (count < 0) {
throw new IllegalArgumentException();
}
while (iterator.hasNext() && count-- > 0) {
iterator.next();
}
}
}
| {
"content_hash": "bcde2e4e28946becd27a7cfb8bbdb537",
"timestamp": "",
"source": "github",
"line_count": 404,
"max_line_length": 118,
"avg_line_length": 28.532178217821784,
"alnum_prop": 0.5160058991931986,
"repo_name": "aldaris/jenkins",
"id": "8d93d7226212ef01aba818caf5beb60050914ffb",
"size": "12704",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "core/src/main/java/hudson/util/Iterators.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "2091"
},
{
"name": "CSS",
"bytes": "303175"
},
{
"name": "GAP",
"bytes": "6289"
},
{
"name": "Groovy",
"bytes": "60104"
},
{
"name": "HTML",
"bytes": "1030570"
},
{
"name": "Java",
"bytes": "9616842"
},
{
"name": "JavaScript",
"bytes": "357959"
},
{
"name": "Perl",
"bytes": "14402"
},
{
"name": "Ruby",
"bytes": "19375"
},
{
"name": "Shell",
"bytes": "8998"
}
],
"symlink_target": ""
} |
function foo();
function foo(foo:string);
function foo(foo?:any){ return '' }
//// [functionOverloads8.js]
function foo(foo) {
return '';
}
| {
"content_hash": "afaa1d7ee45fb71c463941304fb1ffff",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 35,
"avg_line_length": 16.88888888888889,
"alnum_prop": 0.618421052631579,
"repo_name": "yukulele/TypeScript",
"id": "08c2c0b65a1b132288ba3c47c1fb770a1ef5d1a4",
"size": "182",
"binary": false,
"copies": "9",
"ref": "refs/heads/master",
"path": "tests/baselines/reference/functionOverloads8.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "JavaScript",
"bytes": "7972226"
},
{
"name": "Shell",
"bytes": "945"
},
{
"name": "TypeScript",
"bytes": "7767590"
}
],
"symlink_target": ""
} |
"""
Utility functions for the random forest classifier.
@copyright: The Broad Institute of MIT and Harvard 2015
"""
import numpy as np
import pandas as pd
import pickle
"""Return a function that gives a prediction from a design matrix row
"""
def gen_predictor(params_filename="./models/test/scikit_randf-params"):
clf = pickle.load(open(params_filename, "rb" ) )
def predictor(X):
scores = clf.predict_proba(X)
probs = [x[1] for x in scores]
return probs
return predictor | {
"content_hash": "64abc86f6ae3f8c3210c446d370c09b0",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 71,
"avg_line_length": 24.428571428571427,
"alnum_prop": 0.6939571150097466,
"repo_name": "broadinstitute/ebola-predictor",
"id": "fddaf290dfd65572262aecbb7f977fbe9ce7b774",
"size": "513",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "scikit_randf/utils.py",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Python",
"bytes": "273299"
},
{
"name": "R",
"bytes": "3987"
}
],
"symlink_target": ""
} |
package com.github.maven_nar.cpptasks.gcc.cross.sparc_sun_solaris2;
import com.github.maven_nar.cpptasks.CCTask;
import com.github.maven_nar.cpptasks.CUtil;
import com.github.maven_nar.cpptasks.compiler.LinkType;
import com.github.maven_nar.cpptasks.compiler.Linker;
import com.github.maven_nar.cpptasks.gcc.AbstractLdLinker;
import java.io.File;
import java.util.Vector;
/**
* Adapter for the GCC linker
*
* @author Adam Murdoch
*/
public class GccLinker extends AbstractLdLinker {
private static final String[] discardFiles = new String[0];
private static final String[] objFiles = new String[]{".o", ".a", ".lib",
".dll", ".so", ".sl"};
private static final String[] libtoolObjFiles = new String[]{".fo", ".a",
".lib", ".dll", ".so", ".sl"};
private static String[] linkerOptions = new String[]{"-bundle",
"-dynamiclib", "-nostartfiles", "-nostdlib", "-prebind", "-s",
"-static", "-shared", "-symbolic", "-Xlinker",
"--export-all-symbols", "-static-libgcc",};
private static final GccLinker dllLinker = new GccLinker(
GccCCompiler.CMD_PREFIX + "gcc", objFiles, discardFiles, "lib",
".so", false, new GccLinker(GccCCompiler.CMD_PREFIX + "gcc",
objFiles, discardFiles, "lib", ".so", true, null));
private static final GccLinker instance = new GccLinker(
GccCCompiler.CMD_PREFIX + "gcc", objFiles, discardFiles, "", "",
false, null);
private static final GccLinker machBundleLinker = new GccLinker(
GccCCompiler.CMD_PREFIX + "gcc", objFiles, discardFiles, "lib",
".bundle", false, null);
private static final GccLinker machDllLinker = new GccLinker(
GccCCompiler.CMD_PREFIX + "gcc", objFiles, discardFiles, "lib",
".dylib", false, null);
public static GccLinker getInstance() {
return instance;
}
private File[] libDirs;
protected GccLinker(String command, String[] extensions,
String[] ignoredExtensions, String outputPrefix,
String outputSuffix, boolean isLibtool, GccLinker libtoolLinker) {
super(command, "-dumpversion", extensions, ignoredExtensions,
outputPrefix, outputSuffix, isLibtool, libtoolLinker);
}
protected void addImpliedArgs(CCTask task, boolean debug, LinkType linkType, Vector args) {
super.addImpliedArgs(task, debug, linkType, args);
if (getIdentifier().indexOf("mingw") >= 0) {
if (linkType.isSubsystemConsole()) {
args.addElement("-mconsole");
}
if (linkType.isSubsystemGUI()) {
args.addElement("-mwindows");
}
}
}
/**
* Allows drived linker to decorate linker option. Override by GccLinker to
* prepend a "-Wl," to pass option to through gcc to linker.
*
* @param buf
* buffer that may be used and abused in the decoration process,
* must not be null.
* @param arg
* linker argument
*/
public String decorateLinkerOption(StringBuffer buf, String arg) {
String decoratedArg = arg;
if (arg.length() > 1 && arg.charAt(0) == '-') {
switch (arg.charAt(1)) {
//
// passed automatically by GCC
//
case 'g' :
case 'f' :
case 'F' :
/* Darwin */
case 'm' :
case 'O' :
case 'W' :
case 'l' :
case 'L' :
case 'u' :
case 'v' :
break;
default :
boolean known = false;
for (int i = 0; i < linkerOptions.length; i++) {
if (linkerOptions[i].equals(arg)) {
known = true;
break;
}
}
if (!known) {
buf.setLength(0);
buf.append("-Wl,");
buf.append(arg);
decoratedArg = buf.toString();
}
break;
}
}
return decoratedArg;
}
/**
* Returns library path.
*
*/
public File[] getLibraryPath() {
if (libDirs == null) {
//
// construct gcc lib path from machine and version
//
StringBuffer buf = new StringBuffer("/lib/gcc-lib/");
buf.append(GccProcessor.getMachine());
buf.append('/');
buf.append(GccProcessor.getVersion());
//
// build default path from gcc and system /lib and /lib/w32api
//
String[] impliedLibPath = new String[]{buf.toString(),
"/lib/w32api", "/lib"};
//
// read gcc specs file for other library paths
//
String[] specs = GccProcessor.getSpecs();
String[][] libpaths = GccProcessor.parseSpecs(specs, "*link:",
new String[]{"%q"});
String[] libpath;
if (libpaths[0].length > 0) {
libpath = new String[libpaths[0].length + 3];
int i = 0;
for (; i < libpaths[0].length; i++) {
libpath[i] = libpaths[0][i];
}
libpath[i++] = buf.toString();
libpath[i++] = "/lib/w32api";
libpath[i++] = "/lib";
} else {
//
// if a failure to find any matches then
// use some default values for lib path entries
libpath = new String[]{"/usr/local/lib/mingw",
"/usr/local/lib", "/usr/lib/w32api", "/usr/lib/mingw",
"/usr/lib", buf.toString(), "/lib/w32api", "/lib"};
}
for (int i = 0; i < libpath.length; i++) {
if (libpath[i].indexOf("mingw") >= 0) {
libpath[i] = null;
}
}
//
// if cygwin then
// we have to prepend location of gcc32
// and .. to start of absolute filenames to
// have something that will exist in the
// windows filesystem
if (GccProcessor.isCygwin()) {
GccProcessor.convertCygwinFilenames(libpath);
}
//
// check that remaining entries are actual directories
//
int count = CUtil.checkDirectoryArray(libpath);
//
// populate return array with remaining entries
//
libDirs = new File[count];
int index = 0;
for (int i = 0; i < libpath.length; i++) {
if (libpath[i] != null) {
libDirs[index++] = new File(libpath[i]);
}
}
}
return libDirs;
}
public Linker getLinker(LinkType type) {
if (type.isStaticLibrary()) {
return GccLibrarian.getInstance();
}
if (type.isPluginModule()) {
if (isDarwin()) {
return machBundleLinker;
} else {
return dllLinker;
}
}
if (type.isSharedLibrary()) {
if (isDarwin()) {
return machDllLinker;
} else {
return dllLinker;
}
}
return instance;
}
}
| {
"content_hash": "008bd0ebaa225d740dcbb9dc12a22ebb",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 95,
"avg_line_length": 38.227722772277225,
"alnum_prop": 0.48717948717948717,
"repo_name": "maven-nar/cpptasks-parallel",
"id": "127787614f1ffe4563069067a867477b1141b52b",
"size": "8346",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/github/maven_nar/cpptasks/gcc/cross/sparc_sun_solaris2/GccLinker.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "881"
},
{
"name": "CSS",
"bytes": "8320"
},
{
"name": "Java",
"bytes": "1240599"
},
{
"name": "XSLT",
"bytes": "8491"
}
],
"symlink_target": ""
} |
package se.l4.dust.api.expression;
/**
* Exception thrown on expression errors.
*
* @author Andreas Holstenson
*
*/
public class ExpressionException
extends RuntimeException
{
private final boolean source;
public ExpressionException(String message)
{
super(message);
source = false;
}
public ExpressionException(String source, int line, int position, String message)
{
super(constructError(source, line, position, message));
this.source = true;
}
public ExpressionException(String source, int line, int position, String message, Throwable cause)
{
super(constructError(source, line, position, message), cause);
this.source = true;
}
public boolean hasSource()
{
return source;
}
private static String constructError(String source, int line, int position, String message)
{
StringBuilder result = new StringBuilder();
result.append("Error on line ")
.append(line)
.append(", column ")
.append(position+1)
.append(":\n");
String[] lines = source.split("(\n|\r)");
for(int i=0, n=lines.length; i<n; i++)
{
result.append(" ")
.append(i+1)
.append(": ")
.append(lines[i].replace('\t', ' '))
.append('\n');
if(i == line-1)
{
result.append(" ");
for(int j=0, m=position; j<m; j++)
{
result.append(' ');
}
result.append('^');
result.append("\n");
break;
}
}
result.append("\n ").append(message);
return result.toString();
}
}
| {
"content_hash": "d33082f069f1bdb40e805db0fbc66571",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 99,
"avg_line_length": 18.556962025316455,
"alnum_prop": 0.6371077762619373,
"repo_name": "LevelFourAB/dust",
"id": "27983e1283d8d4ea0edf33686e31dd85cc23ca4c",
"size": "1466",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dust-core/src/main/java/se/l4/dust/api/expression/ExpressionException.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "3398"
},
{
"name": "Java",
"bytes": "654727"
}
],
"symlink_target": ""
} |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SimplesE.Data")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SimplesE.Data")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("3c953a78-5a9f-4279-b9bf-7a88f8d2ae7c")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| {
"content_hash": "541167e430e07338c6787a4d02f49390",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 84,
"avg_line_length": 38.861111111111114,
"alnum_prop": 0.7441029306647605,
"repo_name": "SimplesE/Projeto",
"id": "f9348de8b3e339da7b2d8ef0176d6017d0e88ffa",
"size": "1402",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Simples-e/Data/SimplesE.Data/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "107"
},
{
"name": "C#",
"bytes": "102082"
},
{
"name": "CSS",
"bytes": "15457"
},
{
"name": "JavaScript",
"bytes": "757484"
},
{
"name": "PowerShell",
"bytes": "134421"
},
{
"name": "Puppet",
"bytes": "81828"
}
],
"symlink_target": ""
} |
<?php
namespace Enlighter;
class SettingsUtil{
// local config storage
private $_config = array();
// stores options prefix
private $_optionsPrefix;
// initialize global plugin config
public function __construct($prefix, $defaultConfig=array()){
// store settings prefix
$this->_optionsPrefix = $prefix;
// load plugin config
foreach ($defaultConfig as $key=>$value){
// get option by key
$this->_config[$key] = get_option($this->_optionsPrefix.$key, $value);
}
}
// register settings
public function registerSettings(){
// register settings
foreach ($this->_config as $key=>$value){
register_setting($this->_optionsPrefix.'settings-group', $this->_optionsPrefix.$key);
}
}
// update option
public function setOption($key, $value){
update_option($this->_optionsPrefix.$key, $value);
$this->_config[$key] = $value;
}
// fetch option by key
public function getOption($key){
return $this->_config[$key];
}
// fetch all plugin options as array
public function getOptions(){
return $this->_config;
}
/**
* Generates a checkbox based on the settings-name
* @param unknown_type $title
* @param unknown_type $optionName
*/
public function displayCheckbox($title, $optionName, $description=''){
?>
<!-- SETTING [<?php echo $optionName ?>] -->
<div class="EnlighterSetting">
<div class="EnlighterSettingTitle"><?php echo esc_html($title); ?></div>
<div class="EnlighterSettingItem">
<?php
$checked = '';
if ($this->_config[$optionName]){
$checked = ' checked="checked" ';
}
echo '<input '.$checked.' name="'.$this->_optionsPrefix.$optionName.'" type="checkbox" value="1" title="', esc_attr($description),'" />';
?>
</div>
<div class="EnlighterSettingClear"></div>
</div>
<?php
}
/**
* Generates a selectform based on settings-name
* @param String $title
* @param String $optionName
* @param Array $values
*/
public function displaySelect($title, $optionName, $values){
?>
<!-- SETTING [<?php echo $optionName ?>] -->
<div class="EnlighterSetting">
<div class="EnlighterSettingTitle"><?php echo esc_html($title); ?></div>
<div class="EnlighterSettingItem">
<select name="<?php echo $this->_optionsPrefix.$optionName ?>" id="<?php echo $this->_optionsPrefix.$optionName ?>">
<?php
foreach ($values as $key=>$value){
$selected = ($this->_config[$optionName] == $value) ? 'selected="selected"' : '';
echo '<option value="'.$value.'" '.$selected.'>'. esc_html($key).'</option>';
}
?>
</select>
</div>
<div class="EnlighterSettingClear"></div>
</div>
<?php
}
/**
* Generates a input-form
* @param String $title
* @param String $optionName
* @param String $label
*/
public function displayInput($title, $optionName, $label, $cssClass=''){
?>
<div class="EnlighterSetting">
<div class="EnlighterSettingTitle"><?php echo esc_html($title); ?></div>
<div class="EnlighterSettingItem">
<input id="<?php echo $this->_optionsPrefix.$optionName; ?>" name="<?php echo $this->_optionsPrefix.$optionName;?>" type="text" value="<?php echo esc_attr($this->_config[$optionName]); ?>" class="text <?php echo $cssClass; ?>" />
<label for="<?php echo $this->_optionsPrefix.$optionName; ?>"><?php echo esc_html($label); ?></label>
</div>
<div class="EnlighterSettingClear"></div>
</div>
<?php
}
}
?> | {
"content_hash": "1c986582f3af03526cc25630a1781b7f",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 232,
"avg_line_length": 28.641666666666666,
"alnum_prop": 0.6307826592958976,
"repo_name": "Pyknic/WordPress.Enlighter",
"id": "4ab6fe8ec327976a2923fda7ecd5c49281ec05e0",
"size": "4694",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "class/SettingsUtil.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "36583"
},
{
"name": "HTML",
"bytes": "39792"
},
{
"name": "JavaScript",
"bytes": "22566"
},
{
"name": "PHP",
"bytes": "209029"
},
{
"name": "Shell",
"bytes": "790"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "efe5ba22524903262418df7c48ddfc7e",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "5c0a6e9563ccf21acf245c507f4d530490c7f92b",
"size": "174",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Rosales/Urticaceae/Dendrocnide/Dendrocnide peltata/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>mathcomp-zify: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.8.1 / mathcomp-zify - 1.1.0+1.12+8.13</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
mathcomp-zify
<small>
1.1.0+1.12+8.13
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-09-19 15:43:35 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-09-19 15:43:35 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 2 Virtual package relying on perl
coq 8.8.1 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.04.2 The OCaml compiler (virtual package)
ocaml-base-compiler 4.04.2 Official 4.04.2 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.5 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "sakaguchi@coins.tsukuba.ac.jp"
homepage: "https://github.com/math-comp/mczify"
dev-repo: "git+https://github.com/math-comp/mczify.git"
bug-reports: "https://github.com/math-comp/mczify/issues"
license: "CECILL-B"
synopsis: "Micromega tactics for Mathematical Components"
description: """
This small library enables the use of the Micromega arithmetic solvers of Coq
for goals stated with the definitions of the Mathematical Components library
by extending the zify tactic."""
build: [make "-j%{jobs}%" ]
install: [make "install"]
depends: [
"coq" {(>= "8.13" & < "8.16~")}
"coq-mathcomp-algebra" {(>= "1.12" & < "1.14~")}
]
tags: [
"logpath:mathcomp.zify"
]
authors: [
"Kazuhiko Sakaguchi"
]
url {
src: "https://github.com/math-comp/mczify/archive/1.1.0+1.12+8.13.tar.gz"
checksum: "sha256=0b650960a5d6b708f6224e8946297ced8f042169c2e3c36c34c4fb38dcfb462e"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-mathcomp-zify.1.1.0+1.12+8.13 coq.8.8.1</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.8.1).
The following dependencies couldn't be met:
- coq-mathcomp-zify -> coq >= 8.13 -> ocaml >= 4.05.0
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-mathcomp-zify.1.1.0+1.12+8.13</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "d287a97b17f469ba89697280ca99583c",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 159,
"avg_line_length": 41.357142857142854,
"alnum_prop": 0.5400115141047783,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "56bb482760ae9c85f883c86afb0b045b56d69bb3",
"size": "6973",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.04.2-2.0.5/released/8.8.1/mathcomp-zify/1.1.0+1.12+8.13.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.viewcode']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u"dtool-create"
copyright = u"2017, Tjelvar Olsson"
author = u"Tjelvar Olsson"
repo_name = u"dtool-create"
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = u"0.23.4"
# The full version, including alpha/beta/rc tags.
release = version
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = []
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'default'
# Set the readthedocs theme.
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if not on_rtd: # only import and set the theme if we're building docs locally
print('using readthedocs theme...')
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# otherwise, readthedocs.org uses their theme by default, so no need to specify
# it
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = '{}doc'.format(repo_name)
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, '{}.tex'.format(repo_name),
u'{} Documentation'.format(repo_name),
author, 'manual'),
]
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, repo_name, u'{} Documentation'.format(repo_name),
[author], 1)
]
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, repo_name, u'{} Documentation'.format(repo_name),
author, repo_name, u'Dtool plugin for creating datasets and collections',
'Miscellaneous'),
]
| {
"content_hash": "d08d30d9bcd102d6e6337cb6c6972880",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 79,
"avg_line_length": 30.576158940397352,
"alnum_prop": 0.6647173489278753,
"repo_name": "jic-dtool/dtool-create",
"id": "13b3a695694e95a60da400ead0e0379607f5e93c",
"size": "5165",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/source/conf.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "29926"
}
],
"symlink_target": ""
} |
<?php
class Ess_M2ePro_Model_Amazon_Listing_Product_Action_DataBuilder_Price_Business
extends Ess_M2ePro_Model_Amazon_Listing_Product_Action_DataBuilder_Abstract
{
const BUSINESS_DISCOUNTS_TYPE_FIXED = 'fixed';
//########################################
/**
* @return array
*/
public function getData()
{
$data = array();
if (!isset($this->_cachedData['business_price'])) {
$this->_cachedData['business_price'] = $this->getAmazonListingProduct()->getBusinessPrice();
}
if (!isset($this->_cachedData['business_discounts'])) {
$this->_cachedData['business_discounts'] = $this->getAmazonListingProduct()->getBusinessDiscounts();
}
$data['business_price'] = $this->_cachedData['business_price'];
if ($businessDiscounts = $this->_cachedData['business_discounts']) {
ksort($businessDiscounts);
$data['business_discounts'] = array(
'type' => self::BUSINESS_DISCOUNTS_TYPE_FIXED,
'values' => $businessDiscounts
);
}
return $data;
}
//########################################
}
| {
"content_hash": "122b448cd67754f76a898722cfcba4cb",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 112,
"avg_line_length": 28.30952380952381,
"alnum_prop": 0.5416316232127838,
"repo_name": "portchris/NaturalRemedyCompany",
"id": "aebffe9d56ba73e0765911c684887d84dfb7e2ff",
"size": "1319",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/app/code/community/Ess/M2ePro/Model/Amazon/Listing/Product/Action/DataBuilder/Price/Business.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ActionScript",
"bytes": "20009"
},
{
"name": "Batchfile",
"bytes": "1036"
},
{
"name": "CSS",
"bytes": "2584823"
},
{
"name": "Dockerfile",
"bytes": "828"
},
{
"name": "HTML",
"bytes": "8762252"
},
{
"name": "JavaScript",
"bytes": "2932806"
},
{
"name": "PHP",
"bytes": "66466458"
},
{
"name": "PowerShell",
"bytes": "1028"
},
{
"name": "Ruby",
"bytes": "576"
},
{
"name": "Shell",
"bytes": "40066"
},
{
"name": "XSLT",
"bytes": "2135"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>hardware: Not compatible</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / extra-dev</a></li>
<li class="active"><a href="">dev / hardware - 8.10.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
hardware
<small>
8.10.0
<span class="label label-info">Not compatible</span>
</small>
</h1>
<p><em><script>document.write(moment("2020-04-14 10:21:03 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-04-14 10:21:03 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-m4 1 Virtual package relying on m4
coq dev Formal proof management system
num 1.3 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.10.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.10.0 Official release 4.10.0
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.8.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "Hugo.Herbelin@inria.fr"
homepage: "https://github.com/coq-contribs/hardware"
license: "LGPL 2.1"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/Hardware"]
depends: [
"ocaml"
"coq" {>= "8.10" & < "8.11~"}
]
tags: [
"keyword: hardware verification"
"keyword: comparator circuit"
"category: Computer Science/Architecture"
"category: Miscellaneous/Extracted Programs/Hardware"
]
authors: [
"Solange Coupet-Grimal & Line Jakubiec"
]
bug-reports: "https://github.com/coq-contribs/hardware/issues"
dev-repo: "git+https://github.com/coq-contribs/hardware.git"
synopsis: "Verification and synthesis of hardware linear arithmetic structures"
description: """
Verification and synthesis of hardware linear arithmetic
structures. Example of a left-to-right comparator.
Three approaches are tackled :
- the usual verification of a circuit, consisting in proving that the
description satisfies the specification,
- the synthesis of a circuit from its specification using the Coq extractor,
- the same approach as above but using the Program tactic."""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/hardware/archive/v8.10.0.tar.gz"
checksum: "md5=bc21aceb0c787bf1e321debeef025cf2"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-hardware.8.10.0 coq.dev</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is dev).
The following dependencies couldn't be met:
- coq-hardware -> coq < 8.11~ -> ocaml < 4.10
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-hardware.8.10.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
<small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small>
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "e5783327ca3b0c48163204a00f613504",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 157,
"avg_line_length": 40.954802259887,
"alnum_prop": 0.557870051041523,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "d882c9391e832dadf5a104cd61356aebfffcc184",
"size": "7251",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.10.0-2.0.6/extra-dev/dev/hardware/8.10.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
package org.wso2.msf4j.util.client.websocket;
import io.netty.bootstrap.Bootstrap;
import io.netty.buffer.Unpooled;
import io.netty.channel.Channel;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.handler.codec.http.DefaultHttpHeaders;
import io.netty.handler.codec.http.HttpClientCodec;
import io.netty.handler.codec.http.HttpObjectAggregator;
import io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame;
import io.netty.handler.codec.http.websocketx.CloseWebSocketFrame;
import io.netty.handler.codec.http.websocketx.PingWebSocketFrame;
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;
import io.netty.handler.codec.http.websocketx.WebSocketClientHandshakerFactory;
import io.netty.handler.codec.http.websocketx.WebSocketVersion;
import io.netty.handler.codec.http.websocketx.extensions.compression.WebSocketClientCompressionHandler;
import io.netty.handler.ssl.SslContext;
import io.netty.handler.ssl.SslContextBuilder;
import io.netty.handler.ssl.util.InsecureTrustManagerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.ByteBuffer;
import javax.net.ssl.SSLException;
/**
* WebSocket client class for test
*/
public class WebSocketClient {
private static final Logger log = LoggerFactory.getLogger(WebSocketClient.class);
private final String url;
private Channel channel = null;
private WebSocketClientHandler handler;
EventLoopGroup group;
/**
* @param url the URL which the client should connect.
*/
public WebSocketClient(String url) {
this.url = System.getProperty("url", url);
}
/**
* Do the handshake for the given url and return the state of the handshake.
*
* @return true if the handshake is done properly.
* @throws URISyntaxException throws if there is an error in the URI syntax.
* @throws InterruptedException throws if the connecting the server is interrupted.
*/
public boolean handhshake() throws InterruptedException, URISyntaxException, SSLException {
boolean isDone;
URI uri = new URI(url);
String scheme = uri.getScheme() == null ? "ws" : uri.getScheme();
final String host = uri.getHost() == null ? "127.0.0.1" : uri.getHost();
final int port;
if (uri.getPort() == -1) {
if ("ws".equalsIgnoreCase(scheme)) {
port = 80;
} else if ("wss".equalsIgnoreCase(scheme)) {
port = 443;
} else {
port = -1;
}
} else {
port = uri.getPort();
}
if (!"ws".equalsIgnoreCase(scheme) && !"wss".equalsIgnoreCase(scheme)) {
log.error("Only WS and WSS protocols are supported.");
return false;
}
final boolean ssl = "wss".equalsIgnoreCase(scheme);
final SslContext sslCtx;
if (ssl) {
sslCtx = SslContextBuilder.forClient()
.trustManager(InsecureTrustManagerFactory.INSTANCE).build();
} else {
sslCtx = null;
}
group = new NioEventLoopGroup();
try {
// Connect with V13 (RFC 6455 aka HyBi-17). You can change it to V08 or V00.
// If you change it to V00, ping is not supported and remember to change
// HttpResponseDecoder to WebSocketHttpResponseDecoder in the pipeline.
handler =
new WebSocketClientHandler(
WebSocketClientHandshakerFactory.newHandshaker(
uri, WebSocketVersion.V13, null,
true, new DefaultHttpHeaders()));
Bootstrap b = new Bootstrap();
b.group(group)
.channel(NioSocketChannel.class)
.handler(new ChannelInitializer<SocketChannel>() {
@Override
protected void initChannel(SocketChannel ch) {
ChannelPipeline p = ch.pipeline();
if (sslCtx != null) {
p.addLast(sslCtx.newHandler(ch.alloc(), host, port));
}
p.addLast(
new HttpClientCodec(),
new HttpObjectAggregator(8192),
WebSocketClientCompressionHandler.INSTANCE,
handler);
}
});
channel = b.connect(uri.getHost(), port).sync().channel();
isDone = handler.handshakeFuture().sync().isSuccess();
} catch (Exception e) {
log.error("Handshake unsuccessful: " + e.getMessage(), e);
return false;
}
log.info("WebSocket Handshake successful: " + isDone);
Thread.sleep(5000);
return isDone;
}
/**
* Send text to the server.
*
* @param text text need to be sent.
*/
public void sendText(String text) {
if (channel == null) {
log.error("Channel is null, cannot write data.");
throw new NullPointerException("Cannot find the channel to write");
}
channel.writeAndFlush(new TextWebSocketFrame(text));
}
/**
* Send binary data to server.
*
* @param buf buffer containing the data need to be sent.
*/
public void sendBinary(ByteBuffer buf) {
if (channel == null) {
log.error("Channel is null, cannot write data.");
throw new NullPointerException("Cannot find the channel to write");
}
channel.writeAndFlush(new BinaryWebSocketFrame(Unpooled.wrappedBuffer(buf)));
}
/**
* Send a pong message to the server.
*
* @param buf content of the pong message to be sent.
*/
public void sendPing(ByteBuffer buf) {
if (channel == null) {
log.error("Channel is null, cannot write data.");
throw new NullPointerException("Cannot find the channel to write");
}
channel.writeAndFlush(new PingWebSocketFrame(Unpooled.wrappedBuffer(buf)));
}
/**
* Extract the text data received from the server.
*
* @return the text received from the server.
*/
public String getTextReceived() {
return handler.getTextReceived();
}
/**
* Extract the binary data received from the server.
*
* @return the binary data received from the server.
*/
public ByteBuffer getBufferReceived() {
return handler.getBufferReceived();
}
/**
* Shutdown the WebSocket Client.
*
* @throws InterruptedException throws if interruption happened when closing the connection.
*/
public void shutDown() throws InterruptedException {
channel.writeAndFlush(new CloseWebSocketFrame());
channel.closeFuture().sync();
group.shutdownGracefully();
}
}
| {
"content_hash": "c482776170a2575ce850d8d74f3ac57b",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 103,
"avg_line_length": 36.343283582089555,
"alnum_prop": 0.6136892539356605,
"repo_name": "thusithathilina/msf4j",
"id": "53f22c4573a1ef2e552b71ae12b888a7290eafeb",
"size": "7987",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "core/src/test/java/org/wso2/msf4j/util/client/websocket/WebSocketClient.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "4051"
},
{
"name": "HTML",
"bytes": "10821"
},
{
"name": "Java",
"bytes": "1229608"
},
{
"name": "JavaScript",
"bytes": "25624"
},
{
"name": "Shell",
"bytes": "21368"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_24) on Mon Apr 01 21:58:39 EDT 2013 -->
<TITLE>
atg.scenario.userprofiling (ATG Java API)
</TITLE>
<META NAME="date" CONTENT="2013-04-01">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<FONT size="+1" CLASS="FrameTitleFont">
<A HREF="../../../atg/scenario/userprofiling/package-summary.html" target="classFrame">atg.scenario.userprofiling</A></FONT>
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
<TR>
<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont">
Classes</FONT>
<FONT CLASS="FrameItemFont">
<BR>
<A HREF="ScenarioProfileFormHandler.html" title="class in atg.scenario.userprofiling" target="classFrame">ScenarioProfileFormHandler</A>
<BR>
<A HREF="ScenarioPropertyManager.html" title="class in atg.scenario.userprofiling" target="classFrame">ScenarioPropertyManager</A></FONT></TD>
</TR>
</TABLE>
</BODY>
</HTML>
| {
"content_hash": "aee6e39b24700a3ceb5f1cad64855d70",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 142,
"avg_line_length": 31.5,
"alnum_prop": 0.704014939309057,
"repo_name": "Smolations/more-dash-docsets",
"id": "a18cee9c02adffda4a95436196731b3e0165a443",
"size": "1071",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docsets/ATG 10.2.docset/Contents/Resources/Documents/atg/scenario/userprofiling/package-frame.html",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1456655"
},
{
"name": "Emacs Lisp",
"bytes": "3680"
},
{
"name": "JavaScript",
"bytes": "139712"
},
{
"name": "Puppet",
"bytes": "15851"
},
{
"name": "Ruby",
"bytes": "66500"
},
{
"name": "Shell",
"bytes": "11437"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EFCore.Bencher;
using EFCore.Bencher.EntityClasses;
using EFCore.Dtos.DtoClasses;
using EFCore.Dtos.DtoClasses.SalesOrderHeaderDtoTypes;
using EFCore.Dtos.Persistence;
using Microsoft.EntityFrameworkCore;
namespace RawBencher.Benchers
{
/// <summary>
/// Specific bencher for Entity Framework Core, doing a DTO Graph fetch
/// </summary>
public class EntityFrameworkCoreDTOBencher : FetchOnlyBencherBase<SalesOrderHeaderDto>
{
/// <summary>
/// Initializes a new instance of the <see cref="EntityFrameworkCoreDTOBencher"/> class.
/// </summary>
public EntityFrameworkCoreDTOBencher()
: base(e => e.SalesOrderId, usesChangeTracking:false, usesCaching:false, supportsAsync:true, supportsEagerLoading:true, supportsIndividualFetch:false, supportsSetFetch:false)
{
}
/// <summary>
/// Fetches the complete graph using eager loading and returns this as an IEnumerable.
/// </summary>
/// <returns>the graph fetched</returns>
public override IEnumerable<SalesOrderHeaderDto> FetchGraph()
{
using(var ctx = new AWDataContext(this.ConnectionStringToUse))
{
return (from soh in ctx.SalesOrderHeaders
where soh.SalesOrderId > 50000 && soh.SalesOrderId <= 51000
select soh)
.ProjectToSalesOrderHeaderDto().ToList();
}
}
/// <summary>
/// Async variant of FetchGraph(). Fetches the complete graph using eager loading and returns this as an IEnumerable.
/// </summary>
/// <returns>the graph fetched</returns>
public override async Task<IEnumerable<SalesOrderHeaderDto>> FetchGraphAsync()
{
using(var ctx = new AWDataContext(this.ConnectionStringToUse))
{
return await (from soh in ctx.SalesOrderHeaders
where soh.SalesOrderId > 50000 && soh.SalesOrderId <= 51000
select soh).ProjectToSalesOrderHeaderDto().ToListAsync();
}
}
/// <summary>
/// Verifies the graph element's children. The parent should contain 2 sets of related elements: SalesOrderDetail and Customer. Both have to be counted and
/// the count has to stored in the resultContainer, under the particular type. Implementers have to check whether the related elements are actually materialized objects.
/// </summary>
/// <param name="parent">The parent.</param>
/// <param name="resultContainer">The result container.</param>
public override void VerifyGraphElementChildren(SalesOrderHeaderDto parent, BenchResult resultContainer)
{
int amount = 0;
foreach(var sod in parent.SalesOrderDetails)
{
if(sod.SalesOrderId > 0)
{
amount++;
}
else
{
return;
}
}
resultContainer.IncNumberOfRowsForType(typeof(SalesOrderDetailDto), amount);
if((parent.Customer == null) || (parent.Customer.CustomerId <= 0))
{
return;
}
resultContainer.IncNumberOfRowsForType(typeof(CustomerDto), 1);
}
/// <summary>
/// Creates the name of the framework this bencher is for. Use the overload which accepts a format string and a type to create a name based on a
/// specific version
/// </summary>
/// <returns>the framework name.</returns>
protected override string CreateFrameworkNameImpl()
{
return CreateFrameworkName("Entity Framework Core v{0} (v{1}) Poco DTO Graph", typeof(Microsoft.EntityFrameworkCore.DbContext));
}
#region Properties
/// <summary>
/// Gets or sets the connection string to use
/// </summary>
public string ConnectionStringToUse { get; set; }
#endregion
}
}
| {
"content_hash": "294c99223694c7e6cc528c3e9be760f6",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 177,
"avg_line_length": 33.38317757009346,
"alnum_prop": 0.7236842105263158,
"repo_name": "jonnybee/RawDataAccessBencher",
"id": "15e9f97335a8d5b3000315f08445b7fc05ae8616",
"size": "3574",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "RawBencher/Benchers/EntityFrameworkCoreDTOBencher.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "3435845"
}
],
"symlink_target": ""
} |
import sys
import time
from websocket import create_connection
from json import *
if(len(sys.argv)< 2):
print "test requires sitename: python testWebSocketOperations_server.py <url>"
sys.exit(2)
site = sys.argv[1]
ws = create_connection("ws://"+site)
#----------------------------------------------------------------------------------------------------
def runTests():
test_serverVersion();
test_getDataFrame();
test_getUserID();
test_getDataSetNames();
test_getGeneSets();
# test_getSampleCategorizations();
test_getManifest();
test_specifyCurrentDataset()
test_getPatientHistoryTable()
test_survivalCurves()
#userDataStoreTests() # need environment variable, lost within emacs/ess
test_getPatientHistoryDxAndSurvivalMinMax()
test_getDrugGeneInteractions()
# TODO: recent changes to DEMOdz include expression matrices far too large, breaking these
# TODO: data-specific tests. fix this! (pshannon 14aug2015)
test_getMarkersNetwork()
test_getPathway();
#test_pca() # contains 3 more granular tests
#test_plsr() # contains 3 more granular tests
print "OK: all python websocket json tests passed"
#----------------------------------------------------------------------------------------------------
def userDataStoreTests():
# these are all defined in pkg/R/wsUserDataStore.R
# environment variable ONCOSCAPE_USER_DATA_STORE must point to, eg,
# export ONCOSCAPE_USER_DATA_STORE=file:///Users/pshannon/oncoUserData
test_initUserDataStore()
test_getUserDataStoreSummary()
test_addDataToUserDataStore_1_item()
test_getDataItem()
test_deleteDataStoreItem()
#----------------------------------------------------------------------------------------------------
def test_ping():
"sends the 'ping' command, payload ignored, expects the current date in return"
print "--- test_ping"
payload = "datasets/wsJsonTests/test.py"
msg = dumps({"cmd": "ping", "status":"request", "callback":"", "payload": payload})
ws.send(msg)
result = loads(ws.recv())
payload2 = result["payload"]
assert(payload2.find(payload) >= 0)
assert(len(payload2) > len(payload))
#------------------------------------------------------------------------------------------------------------------------
def test_serverVersion():
"sends the 'serverVersion' command, payload ignored, expects current x.y.z R package version in return"
print "--- test_serverVersion"
msg = dumps({"cmd": "getServerVersion", "status":"request", "callback":"", "payload": ""})
ws.send(msg)
result = loads(ws.recv())
version = result["payload"]
assert version.index("1.4") == 0
#------------------------------------------------------------------------------------------------------------------------
def test_getDataFrame():
"sends the 'getDataFrame' command, payload ignored, expects a small mixed-type json-encoding in return"
print "--- test_getDataFrame"
msg = dumps({"cmd": "getSampleDataFrame", "status":"request", "callback":"", "payload": ""})
ws.send(msg)
result = loads(ws.recv())
payload = result["payload"]
# the dataframe has been transformed in R to a matrix of type character
# columnames are shipped separately in the payload
# the contents of the matrix come as a list of lists, one row per list
assert payload.keys() == ["colnames", "tbl"]
columnNames = payload["colnames"]
assert columnNames == ['integers', 'strings', 'floats']
tbl = payload["tbl"]
assert tbl == [['1', 'ABC', '3.140'], ['2', 'def', '2.718']]
#------------------------------------------------------------------------------------------------------------------------
def test_getUserID():
"get the current value"
print "--- test_getUserId"
payload = "";
msg = dumps({"cmd": "getUserId", "status": "request", "callback": "", "payload": payload})
ws.send(msg)
result = loads(ws.recv())
# in test mode, which is enforced by runWsTestOnco.R assignments in the current directory
# userID <- "test@nowhere.net"
# current.datasets <- c("DEMOdz;TCGAgbm")
assert(result["payload"] == "test@nowhere.org");
#------------------------------------------------------------------------------------------------------------------------
def test_getDataSetNames():
"get a list of the names"
print "--- test_getDataSetNames"
payload = "";
msg = dumps({"cmd": "getDataSetNames", "status": "request", "callback": "", "payload": payload})
ws.send(msg)
result = loads(ws.recv())
# in test mode, which is enforced by runDevel.R assignments in the parent directory
# userID <- "test@nowhere.net"
# current.datasets <- c("DEMOdz;TCGAgbm")
# we expect only DEMOdz
payload = result["payload"]
assert(result["payload"]["datasets"] == ["DEMOdz","TCGAgbm"])
assert(result["payload"]["passwordProtected"] == False)
#------------------------------------------------------------------------------------------------------------------------
def test_getManifest():
"get the full data.frame for DEMOdz"
print "--- test_getManifest"
payload = "DEMOdz";
msg = dumps({"cmd": "getDataManifest", "status": "request", "callback": "", "payload": payload})
ws.send(msg)
result = loads(ws.recv())
payload = result["payload"]
fieldNames = payload.keys()
fieldNames.sort()
assert fieldNames == ["colnames", "datasetName", "mtx", "rownames"]
# in test mode, which is enforced by runDevel.R assignments in the parent directory
# userID <- "test@nowhere.net"
# current.datasets <- c("DEMOdz")
# we expect only DEMOdz
colnames = payload["colnames"]
assert(len(colnames) == 9)
assert(colnames[0:3] == ["category", "subcategory", "rows"])
# the matrix (it's all strings right now) comes across the wire as
# as a list of lists, which in javascript will appears as an array of arrays
mtx = payload["mtx"]
assert type(mtx) is list
assert type(mtx[0]) is list
assert len(mtx) >= 9
assert len(mtx[0]) == 9
# each row is actually a row
#assert mtx[0][0:4] == [u'mRNA expression', u'Z scores', u' 20', u' 64']
#------------------------------------------------------------------------------------------------------------------------
def test_histogramCoordinatesIntentionalError():
"demonstrate error tryCatch, returning explanatory standard json message"
print "--- test_histogramCoordinatesIntentionalError"
dataset = "DEMOdz";
dataItem = "mtx.mRNA";
cmd = "calculateHistogramCoordinates"
callback = "handleHistogramCoordinates"
# elicit a representative error, make sure it is trapped and returned as a bona fide json message
# with enough error detail for us to figure out
payload = "intentional error"
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
# we expect this reply
# {cmd: 'handleHistogramCoordinates'
# status: 'error',
# callback: '',
# payload: 'OncoDev13 (version 1.3.8) exception!
# Error in payload$dataset: $ operator is invalid for atomic vectors\n.
# incoming msg: request; handleHistogramCoordinates; calculateHistogramCoordinates; intentional error'}
assert(result["status"] == "error")
assert(result["payload"].find("exception!") >= 0)
assert(result["payload"].find("(version") >= 0)
assert(result["payload"].find(callback) >= 0)
assert(result["payload"].find(payload) >= 0)
# testHistogramCoordinatesIntentionalError
#------------------------------------------------------------------------------------------------------------------------
def test_histogramCoordinatesDEMOdz_mrna():
"demonstrate error tryCatch, returning explanatory standard json message"
print "--- test_histogramCoordinatesDEMOdz_mrna"
dataset = "DEMOdz";
dataItem = "mtx.mrna";
cmd = "calculateHistogramCoordinates"
callback = "handleHistogramCoordinates"
payload = {"dataset": dataset, "dataItem": dataItem}
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
payload = result["payload"]
breaks = payload["breaks"]
counts = payload["counts"]
mids = payload["mids"]
assert(breaks == [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6])
assert(counts == [1, 2, 25, 196, 421, 409, 181, 38, 5, 1, 1])
assert(mids == [-4.5, -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 3.5, 4.5, 5.5])
# testHistogramCoordinatesDEMOdz_mrna
#------------------------------------------------------------------------------------------------------------------------
def test_specifyCurrentDataset():
"set current dataset, with legal value, with a nonsensical one"
print "--- test_specifyCurrentDataset"
cmd = "specifyCurrentDataset"
callback = "datasetSpecified"
dataset = "DEMOdz";
payload = dataset
# set a legitimate dataset
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
payload = result["payload"]
assert(payload.keys() == ['datasetName', 'mtx', 'rownames', 'colnames'])
assert(payload["rownames"][0:2] == ['mtx.mrna.ueArray.RData', 'mtx.mrna.bc.RData'])
assert(result["cmd"] == callback)
# set another legitimate dataset
dataset = "TCGAgbm";
payload = dataset
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert(result["payload"]["datasetName"] == dataset);
assert(result["cmd"] == callback)
# now one which should fail
dataset = "hocus-pocus";
payload = dataset
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert result["status"] == "error"
assert result["payload"].find("exception!") >= 0
assert result["payload"].find("not TRUE") >= 0
#------------------------------------------------------------------------------------------------------------------------
def test_specifyCurrentDataset():
"set current dataset, with legal value, with a nonsensical one"
print "--- test_specifyCurrentDataset"
cmd = "specifyCurrentDataset"
callback = "datasetSpecified"
dataset = "DEMOdz";
payload = dataset
# set a legitimate dataset
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
payload = result["payload"]
fields = payload.keys()
assert fields == ["datasetName", "mtx", "rownames", "colnames"];
assert payload["datasetName"] == "DEMOdz"
mtx = payload["mtx"]
colnames = payload["colnames"]
rownames = payload["rownames"]
datasetName = payload["datasetName"]
assert datasetName == "DEMOdz"
assert colnames == ['category', 'subcategory', 'rows', 'cols', 'row type', 'column type', 'minValue', 'maxValue', 'provenance']
# we might get more rows in the manifest matrix than the 9 we now have, but the column count should be pretty constant
assert len(mtx[0]) == 9
# check just one row's name
assert(rownames.index("mtx.mut.RData") >= 0)
#------------------------------------------------------------------------------------------------------------------------
def test_getPatientHistoryTable():
"set current dataset, ask for patient history"
print "--- test_getPatientHistoryTable"
#------------------------------------------------------------
# first specify currentDataSet
#------------------------------------------------------------
cmd = "specifyCurrentDataset"
callback = "datasetSpecified"
dataset = "DEMOdz";
payload = dataset
# set a legitimate dataset
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert result["payload"]["datasetName"] == dataset;
assert result["cmd"] == callback
assert result["status"] == "success"
#------------------------------------------------------------------------------------------
# ask for the history table. duration formats (Survival, AgeDx, TimeFirstProgression)
# default to the native storage type, "byDay"
#------------------------------------------------------------------------------------------
cmd = "getPatientHistoryTable"
callback = "displayPatientHistory"
payload = "" # equivalent to {"durationFormat": "byDay"} - the default
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
fields = result.keys()
fields.sort()
assert fields == ["callback", "cmd", "payload", "status"]
assert result["status"] == "success"
assert result["callback"] == ""
assert result["cmd"], "displayPatientHistory"
payload = result["payload"]
assert payload.keys() == ["colnames", "tbl"]
columnNames = payload["colnames"]
# current column names will likely change. but for now:
assert columnNames == ['ptID', 'study', 'Birth.gender', 'Survival', 'AgeDx',
'TimeFirstProgression', 'Status.status']
tbl = payload["tbl"]
assert len(tbl) == 20 # 20 rows in the DEMOdz patient history table
assert len(tbl[0]) == 7 # 7 columns extracted from possibly many more
# this will become a dataPackage-specific list
# todo: find out where the whitespace comes from,
# todo: e.g. ' 9369'
assert(tbl[0][3].strip() == "2512")
assert(tbl[0][4].strip() == "9369")
assert(tbl[0][5].strip() == "2243")
#------------------------------------------------------------------------------------------
# ask for the history table, now with duration format "byYear"
#------------------------------------------------------------------------------------------
cmd = "getPatientHistoryTable"
callback = "displayPatientHistory"
payload = {"durationFormat": "byYear"}
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
fields = result.keys()
fields.sort()
assert fields == ["callback", "cmd", "payload", "status"]
assert result["status"] == "success"
assert result["callback"] == ""
assert result["cmd"], "displayPatientHistory"
payload = result["payload"]
assert payload.keys() == ["colnames", "tbl"]
columnNames = payload["colnames"]
# current column names will likely change. but for now:
assert columnNames == ['ptID', 'study', 'Birth.gender', 'Survival', 'AgeDx',
'TimeFirstProgression', 'Status.status']
tbl = payload["tbl"]
assert len(tbl) == 20 # 20 rows in the DEMOdz patient history table
assert len(tbl[0]) == 7 # 7 columns extracted from possibly many more
# this will become a dataPackage-specific list
assert(tbl[0][3] == "6.877")
assert(tbl[0][4] == "25.651")
assert(tbl[0][5] == "6.141")
#----------------------------------------------------------------------------------------------------
def test_getPatientHistoryDxAndSurvivalMinMax():
print "--- test_getPatientHistoryDxAndSurvivalMinMax"
#------------------------------------------------------------
# first specify currentDataSet
#------------------------------------------------------------
cmd = "specifyCurrentDataset"
callback = "datasetSpecified"
dataset = "TCGAgbm";
payload = dataset
# set a legitimate dataset
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert result["payload"]["datasetName"] == dataset;
assert result["cmd"] == callback
assert result["status"] == "success"
#------------------------------------------------------------
# now ask for ageAtDx and survival mins and maxes
#------------------------------------------------------------
cmd = "getPatientHistoryDxAndSurvivalMinMax"
callback = "handleAgeAtDxAndSurvivalRanges"
status = "request"
payload = ""
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert result["cmd"] == callback
assert result["status"] == "success"
assert(result["payload"].keys() == ['ageAtDxLow', 'ageAtDxHigh', 'survivalHigh', 'survivalLow'])
assert(result["payload"]["ageAtDxLow"] == 3982)
assert(result["payload"]["ageAtDxHigh"] == 32612)
assert(result["payload"]["survivalLow"] == 3)
assert(result["payload"]["survivalHigh"] == 3881)
#----------------------------------------------------------------------------------------------------
# we typically find "history.RData", a list of lists, in a data package. but this caisis-derived
# data is not always available. the alternative is a tsv file (data.frame) hand-crafted from
# relevant patient or sample hsitory. client code will supply the name, and this
def test_getPrebuiltPatientHistoryTable():
"set current dataset, ask for prebuilt patient history"
print "--- test_getPrebuiltPatientHistoryTable"
#------------------------------------------------------------
# first specify currentDataSet
#------------------------------------------------------------
cmd = "specifyCurrentDataset"
callback = "datasetSpecified"
dataset = "DEMOdz";
payload = dataset
# set a legitimate dataset
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert result["payload"]["datasetName"] == dataset;
assert result["cmd"] == callback
assert result["status"] == "success"
#------------------------------------------------------------
# now ask for the history table
#------------------------------------------------------------
cmd = "getPatientHistoryTable"
callback = "displayPatientHistory"
payload = ""
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
fields = result.keys()
fields.sort()
assert fields == ["callback", "cmd", "payload", "status"]
assert result["status"] == "success"
assert result["callback"] == ""
assert result["cmd"], "displayPatientHistory"
payload = result["payload"]
assert payload.keys() == ["colnames", "tbl"]
columnNames = payload["colnames"]
# current column names will likely change. but for now:
assert columnNames == ['ptID', 'study', 'Birth.gender', 'Survival', 'AgeDx',
'TimeFirstProgression', 'Status.status']
tbl = payload["tbl"]
assert len(tbl) == 20 # 20 rows in the DEMOdz patient history table
assert len(tbl[0]) == 7 # will evolve to be configurable for each data package
assert(tbl[0][3] == "2512")
assert(tbl[0][4] == "25.651")
assert(tbl[0][5] == "6.141")
#----------------------------------------------------------------------------------------------------
def test_getGeneSets():
"set current dataset, ask for geneset names, then the genes in one set"
print "--- test_getGeneSets"
#------------------------------------------------------------
# first specify currentDataSet
#------------------------------------------------------------
cmd = "specifyCurrentDataset"
callback = "datasetSpecified"
dataset = "DEMOdz";
payload = dataset
# set a legitimate dataset
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert result["payload"]["datasetName"] == dataset;
assert result["cmd"] == callback
assert result["status"] == "success"
#------------------------------------------------------------
# now ask for the geneset names
#------------------------------------------------------------
cmd = "getGeneSetNames"
callback = "handleGeneSetNames"
payload = ""
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
fields = result.keys()
fields.sort()
assert fields == ["callback", "cmd", "payload", "status"]
assert result["status"] == "success"
assert result["callback"] == ""
assert result["cmd"], callback
payload = result["payload"]
payload.sort()
assert payload == ["random.24", "random.40", "test4"]
cmd = "getGeneSetGenes"
payload = "random.24"
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
genes = result["payload"]
genes.sort()
assert len(genes) == 24
assert genes[0:5] == ['EFEMP2', 'ELAVL1', 'ELAVL2', 'ELL', 'ELN']
#----------------------------------------------------------------------------------------------------
def test_getSampleCategorizations():
"set current dataset, ask for the names of the categorizations, then the actual datat"
print "--- test_getSampleCategorizations"
payload = "";
msg = dumps({"cmd": "getDataSetNames", "status": "request", "callback": "", "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert(result["payload"]["datasets"].index("DEMOdz") >= 0)
cmd = "specifyCurrentDataset"
callback = "datasetSpecified"
dataset = "DEMOdz";
payload = dataset
# set a legitimate dataset
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert result["payload"]["datasetName"] == dataset;
assert result["cmd"] == callback
assert result["status"] == "success"
#------------------------------------------------------------
# now ask for the sample categorization names
#------------------------------------------------------------
cmd = "getSampleCategorizationNames"
callback = "handleSampleCategorizationNames"
payload = ""
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert(result["payload"].index("tbl.glioma8") >= 0)
assert(result["payload"].index("tbl.verhaakPlus1") >= 0)
#------------------------------------------------------------
# now ask for the sample categorization data
#------------------------------------------------------------
cmd = "getSampleCategorization"
payload = "tbl.verhaakPlus1"
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
colnames = result["payload"]["colnames"]
rownames = result["payload"]["rownames"]
tbl = result["payload"]["tbl"]
assert(colnames == [u'cluster', u'color'])
assert(len(rownames) == 548)
assert(len(tbl) == 548)
assert(len(tbl[0]) == 2)
payload = "tbl.glioma8"
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
colnames = result["payload"]["colnames"]
rownames = result["payload"]["rownames"]
tbl = result["payload"]["tbl"]
assert(colnames == [u'cluster', u'color'])
assert(len(rownames) == 704)
assert(len(tbl) == 704)
assert(len(tbl[0]) == 2)
#----------------------------------------------------------------------------------------------------
def test_getMarkersNetwork():
"set current dataset, ask for markers network"
print "--- test_getMarkersNetwork"
#------------------------------------------------------------
# first specify currentDataSet
#------------------------------------------------------------
cmd = "specifyCurrentDataset"
callback = "datasetSpecified"
dataset = "DEMOdz";
payload = dataset
# set a legitimate dataset
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert result["payload"]["datasetName"] == dataset;
assert result["cmd"] == callback
assert result["status"] == "success"
#------------------------------------------------------------
# now ask for the geneset names
#------------------------------------------------------------
cmd = "getMarkersNetwork"
callback = "displayMarkersNetwork"
payload = ""
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert result["cmd"] == callback
assert result["status"] == "success"
assert len(result["payload"]) > 50000 # 67263 on (14 aug 2015)
#----------------------------------------------------------------------------------------------------
def test_getPathway():
"set current dataset, ask for pi3kAkt pathway"
print "--- test_getPathway"
#------------------------------------------------------------
# first specify currentDataSet
#------------------------------------------------------------
cmd = "specifyCurrentDataset"
callback = "datasetSpecified"
dataset = "DEMOdz";
payload = dataset
# set a legitimate dataset
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert result["payload"]["datasetName"] == dataset;
assert result["cmd"] == callback
assert result["status"] == "success"
#------------------------------------------------------------
# now ask for the geneset names
#------------------------------------------------------------
cmd = "getPathway"
callback = "displayMarkersNetwork"
payload = "g.pi3kAkt.json"
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert result["cmd"] == callback
assert result["status"] == "success"
assert len(result["payload"]) > 150000 # 1670299 on (14 aug 2015)
#----------------------------------------------------------------------------------------------------
def test_initUserDataStore():
"connect to (and possibly create) a user data store"
print "--- test_initUserDataStore"
cmd = "initUserDataStore"
callback = "userDataStoreInitialized"
payload = {"userID": "test@nowhere.net", "userGroups": ["public", "test"]};
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
fields = result.keys()
fields.sort()
assert fields == ["callback", "cmd", "payload", "status"]
assert result["status"] == "success"
assert result["callback"] == ""
assert result["cmd"], "userDataStoreInitialized"
# the datastore may have been created previously, and may have some data items in it.
# the payload is the data item count
assert result["payload"] >= 0
#------------------------------------------------------------------------------------------------------------------------
def test_getUserDataStoreSummary():
print "--- test_getUserDataStoreSummary"
"connect to a user data store, get a table describing contents"
#--------------------------------------------------------------------------------
# first initialize, guaranteeing that the datastore exists (even if empty)
#--------------------------------------------------------------------------------
cmd = "initUserDataStore"
callback = "userDataStoreInitialized"
payload = {"userID": "test@nowhere.net", "userGroups": ["public", "test"]};
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert result["status"] == "success"
itemCount = result["payload"]
assert itemCount >= 0
cmd = "getUserDataStoreSummary"
callback = "handleUserDataStoreSummary"
payload = {"userID": "test@nowhere.net", "userGroups": ["public", "test"]};
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert result["status"] == "success"
payload = result["payload"]
fields = result["payload"].keys()
fields.sort()
assert fields == ["colnames", "tbl"]
colnames = payload["colnames"]
colnames.sort()
assert colnames == ['created', 'file', 'group', 'name', 'permissions', 'tags', 'user']
tbl = payload["tbl"]
assert len(tbl) == itemCount
#------------------------------------------------------------------------------------------------------------------------
def test_addDataToUserDataStore_1_item():
print "--- test_getUserDataStoreSummary_1_item, a list of the first 10 integers"
"connect to a user data store, get a table describing contents"
#--------------------------------------------------------------------------------
# first initialize, guaranteeing that the datastore exists (even if empty)
#--------------------------------------------------------------------------------
cmd = "initUserDataStore"
callback = "userDataStoreInitialized"
payload = {"userID": "test@nowhere.net", "userGroups": ["public", "test"]};
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert result["status"] == "success"
itemCount = result["payload"]
assert itemCount >= 0
#--------------------------------------------------------------------------------
# now add a sequence of integers
#--------------------------------------------------------------------------------
cmd = "userDataStoreAddData"
callback = "userDataStoreDataAdded"
userID = "test@nowhere.net"
payload = {"userID": userID,
"userGroups": ["public", "test"],
"dataItem": range(1,10),
"name": "oneToTen",
"group": "public",
"permissions": 444,
"tags": ["numbers", "test data"]};
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert result["status"] == "success"
newItemCount = result["payload"]
assert newItemCount > itemCount
displayUserDataStoreSummary(userID)
# test_addDataToUserDataStore_1_item
#------------------------------------------------------------------------------------------------------------------------
def displayUserDataStoreSummary(userID):
print "--- test_displayUserDataStoreSummary"
cmd = "getUserDataStoreSummary"
callback = "handleUserDataStoreSummary"
payload = {"userID": userID, "userGroups": ["public", "test"]}
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert result["status"] == "success"
payload = result["payload"]
#------------------------------------------------------------------------------------------------------------------------
# get the summary table, pick out a dataItemID (currently in the "file" column of the table),
# retrieve it, make sure it is a reasonable value
#
def test_getDataItem():
print "--- test_getDataItem"
#----------------------------------------------------------------
# load the summary table. at least one item should be there
# as long as this test is run after test_addDataToUserDataStore_1_item
# with no intervening delete
#----------------------------------------------------------------
userID = "test@nowhere.net"
cmd = "getUserDataStoreSummary"
callback = ""
payload = {"userID": userID, "userGroups": ["public", "test"]}
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert result["status"] == "success"
payload = result["payload"]
# make sure that the item added in a prior test is indeed present
tbl = payload["tbl"]
assert len(tbl) > 0;
#----------------------------------------------------------------
# get the target
#----------------------------------------------------------------
ids = map(lambda x: x[0], tbl)
assert len(ids) > 0
target = ids[0]
#----------------------------------------------------------------
# get the target's data
#----------------------------------------------------------------
cmd = "userDataStoreGetDataItem"
callback = "do nothing";
payload = {"userID": userID, "userGroups": ["public", "test"], "dataItemName": target}
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert result["status"] == "success"
payload = result["payload"]
# TODO: this test could (should) go further:
# setup a deterministic state in the datastore, get a specific
# dataItem, check for equality
# further, a wide variety of data types should be stored, and
# all retrieved reliably
# test_getDataItem
#------------------------------------------------------------------------------------------------------------------------
# get the summary table, pick out a dataItemID (currently in the "file" column of the table), delete it, check that it
# is gone
def test_deleteDataStoreItem():
print "--- test_deleteDataStoreItem"
#----------------------------------------------------------------
# first get a valid dataItemID, for a data item placed there
# by a preceeding "add" test.
#----------------------------------------------------------------
userID = "test@nowhere.net"
cmd = "getUserDataStoreSummary"
callback = ""
payload = {"userID": userID, "userGroups": ["public", "test"]}
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert result["status"] == "success"
payload = result["payload"]
# make sure that at least one item added in a prior test is present
tbl = payload["tbl"]
ids = map(lambda x: x[0], tbl)
assert len(ids) > 0
target = ids[0]
#----------------------------------------------------------------
# delete the target
#----------------------------------------------------------------
cmd = "userDataStoreDeleteDataItem";
callback = "userDataStoreDataItemDeleted"
payload = {"userID": userID, "userGroups": ["public", "test"], "dataItemName": target}
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert result["status"] == "success"
payload = result["payload"]
assert payload == "'%s' deleted" % target
#----------------------------------------------------------------
# make sure the target id is gone
#----------------------------------------------------------------
userID = "test@nowhere.net"
cmd = "getUserDataStoreSummary"
callback = ""
payload = {"userID": userID, "userGroups": ["public", "test"]}
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert result["status"] == "success"
payload = result["payload"]
tbl = payload["tbl"]
ids = map(lambda x: x[0], tbl)
assert not target in ids
#----------------------------------------------------------------
# try to delete a bogus target
#----------------------------------------------------------------
target = "bogusTarget"
cmd = "userDataStoreDeleteDataItem";
callback = "userDataStoreDataItemDeleted"
payload = {"userID": userID, "userGroups": ["public", "test"], "dataItemName": target}
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert result["status"] == "error"
payload = result["payload"]
assert payload == "wsUserDataStore, no item named '%s' to delete" % target
# test_deleteDataStoreItem
#------------------------------------------------------------------------------------------------------------------------
def test_survivalCurves():
print "--- test_survivalCurves"
#----------------------------------------
# use TCGAgbm
#----------------------------------------
cmd = "specifyCurrentDataset"
callback = "datasetSpecified"
dataset = "TCGAgbm";
payload = dataset
# set a legitimate dataset
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload});
ws.send(msg)
result = loads(ws.recv())
assert result["payload"]["datasetName"] == dataset;
assert result["cmd"] == callback
assert result["status"] == "success"
#-------------------------------------------------------------------------------------------------------
# choose 5 long survivors: see test_survival: ids <- subset(tbl, Survival > 2800)$ptID[1:sampleCount]
#-------------------------------------------------------------------------------------------------------
longSurvivors = ["TCGA.06.6693", "TCGA.12.1088", "TCGA.02.0113", "TCGA.02.0114", "TCGA.08.0344"]
cmd = "calculateSurvivalCurves"
callback = "displaySurvivalCurves"
payload = {"sampleIDs": longSurvivors, "title": "testWebSocketOperations.py"}
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload});
ws.send(msg)
result = loads(ws.recv())
assert result["status"] == "success"
assert result["cmd"] == callback
payload = result["payload"]
assert len(payload) > 10000 # base64 encoded image, coming in as characters
#------------------------------------------------------------------------------------------------------------------------
def test_getDrugGeneInteractions():
print "--- test_getDrugGeneInteractions"
cmd = "getDrugGeneInteractions"
geneSymbols = ["HDAC10", "GABRE", "SLC5A4", "MDM2", "OAZ2", "PGR"]
payload = {"genes": geneSymbols};
callback = "handleDrugGeneInteractions"
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload});
ws.send(msg)
result = loads(ws.recv())
payload = result["payload"]
fields = payload.keys()
assert fields == ['colnames', 'tbl']
colnames = payload["colnames"]
assert (colnames == ["gene", "drug", "drugID", "interaction", "source"])
tbl = payload["tbl"]
assert(len(tbl) > 10) # actually 186 on (24 jul 2015)
assert(len(tbl[0]) == len(colnames))
# make sure the geneSymbols returned are actually in the input list
assert(tbl[0][0] in geneSymbols)
# now try bogus geneSymbols which will never be matched
geneSymbols = ["moeBogus", "curlyBogus", "", "harpoBogus"]
payload = {"genes": geneSymbols};
callback = "handleDrugGeneInteractions"
msg = dumps({"cmd": cmd, "status": "request", "callback": callback, "payload": payload});
ws.send(msg)
result = loads(ws.recv())
payload = result["payload"]
fields = payload.keys()
assert fields == ['colnames', 'tbl']
colnames = payload["colnames"]
assert (colnames == ["gene", "drug", "drugID", "interaction", "source"])
tbl = payload["tbl"]
assert(len(tbl) == 0)
#------------------------------------------------------------------------------------------------------------------------
def test_pca():
print "--- test_pca"
test_pcaCreateWithDataSet()
test_pcaCalculate()
#------------------------------------------------------------------------------------------------------------------------
def test_pcaCreateWithDataSet():
print ("--- test_pcaCreateWithDataSet");
# two mRNA expression matrices in DEMOdz:
# "mtx.mrna.ueArray" "mtx.mrna.bc"
payload = {"dataPackage": "DEMOdz", "matrixName": "mtx.mrna.ueArray"}
msg = dumps({"cmd": "createPCA", "status":"request",
"callback": "pcaCreatedHandler", "payload": payload})
ws.send(msg)
result = loads(ws.recv())
payload = result["payload"];
assert(payload.find("PCA package, matrices:") >= 0)
#------------------------------------------------------------------------------------------------------------------------
def test_pcaCalculate():
"calculates pca on DEMOdz, the full mrna matrix, using pca object created above"
print "--- test_pcaCalculate"
msg = dumps({"cmd": "calculatePCA", "status":"request",
"callback":"handlePcaResult", "payload": ""})
ws.send(msg)
result = loads(ws.recv())
assert(result["cmd"] == "handlePcaResult")
assert(result["status"] == "success")
payload = result["payload"]
keys = payload.keys()
keys.sort()
assert(keys == ['ids', 'importance.PC1', 'importance.PC2', 'maxValue', 'scores'])
ids = payload["ids"]
assert(len(ids) >= 20)
assert(ids.index('TCGA.02.0003.01') >= 0)
assert(payload["maxValue"] > 10)
assert(payload["importance.PC1"] > 0.0)
assert(payload["importance.PC2"] > 0.0)
#------------------------------------------------------------------------------------------------------------------------
def test_plsr():
print "--- test_plsr"
test_plsrCreateWithDataSet()
test_plsrSummarizePLSRPatientAttributes()
test_plsrCalculateSmallOneFactor()
test_plsrCalculateSmallTwoFactors()
#------------------------------------------------------------------------------------------------------------------------
def test_plsrCreateWithDataSet():
"sends dataset as a named string, gets back show method's version of the dataset object"
print "--- testCreateWithDataSet"
# two mRNA expression matrices in DEMOdz:
# "mtx.mrna.ueArray" "mtx.mrna.bc"
payload = {"dataPackage": "DEMOdz", "matrixName": "mtx.mrna.ueArray"}
msg = dumps({"cmd": "createPLSR", "status":"request",
"callback":"PLSRcreatedHandler", "payload": payload})
ws.send(msg)
result = loads(ws.recv())
payload = result["payload"];
assert(payload.find("PLSR package, matrices:") >= 0)
#------------------------------------------------------------------------------------------------------------------------
def test_plsrSummarizePLSRPatientAttributes():
"gets five-number summary of any numerical attribute in the patient history table"
print "--- testSummarizePLSRPatientAttributes"
payload = ["AgeDx"]
msg = dumps({"cmd": "summarizePLSRPatientAttributes", "status":"request",
"callback":"handlePlsrClincialAttributeSummary", "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert(result["status"] == "to be examined element by element")
assert(result["cmd"] == "handlePlsrClincialAttributeSummary")
assert(result["payload"]["AgeDx"] == [9369, 15163.5, 19153, 25736, 31566])
# send a second reqauest, but one guaranteed to fail
payload = "bogus"
msg = dumps({"cmd": "summarizePLSRPatientAttributes", "status":"request",
"callback":"handlePlsrClincialAttributeSummary", "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert(result["payload"]["bogus"] == None)
#----------------------------------------------------------------------------------------------------
def test_plsrCalculateSmallOneFactor():
"calculates plsr on DEMOdz, with two patient groups, low and high AgeDx (age at diagnosis)"
print "--- testCalculateSmallOneFactor"
# in R: sample(colnames(matrices(getDataPackage(myplsr))$mtx.mrna), size=10)
genesOfInterest = ["ELL","EIF4A2","ELAVL2","UPF1","EGFR","PRPSAP2","TTPA","PIGP","TTN","UNC45A"]
factor = {"name": "AgeDx", "low": 12000, "high": 2800}
payload = {"genes": genesOfInterest, "factorCount": 1, "factors": [factor]};
msg = dumps({"cmd": "calculatePLSR", "status":"request",
"callback":"handlePlsrResult", "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert(result["cmd"] == "handlePlsrResult")
assert(result["status"] == "success")
payload = result["payload"]
fieldNames = payload.keys()
fieldNames.sort()
assert(fieldNames == ['loadingNames', 'loadings', 'maxValue', 'vectorNames', 'vectors'])
vectors = payload["vectors"]
assert(len(vectors) == 2)
vectorNames = payload["vectorNames"]
assert(vectorNames == ['AgeDx.lo', 'AgeDx.hi'])
loadings = payload["loadings"]
loadingNames = payload["loadingNames"]
assert(loadingNames == genesOfInterest)
assert(len(loadings) == 10)
maxValue = payload["maxValue"]
assert(maxValue == 0.8195)
#----------------------------------------------------------------------------------------------------
def test_plsrCalculateSmallTwoFactors():
"calculates plsr on DEMOdz, with two patient groups, low and high AgeDx (age at diagnosis)"
print "--- test_plsrCalculateSmallTwoFactors"
# in R: sample(colnames(matrices(getDataPackage(myplsr))$mtx.mrna), size=10)
genesOfInterest = ["ELL","EIF4A2","ELAVL2","UPF1","EGFR","PRPSAP2","TTPA","PIGP","TTN","UNC45A"]
factor1 = {"name": "AgeDx", "low": 12000, "high": 2800}
factor2 = {"name": "Survival", "low": 20, "high": 3000}
payload = {"genes": genesOfInterest, "factorCount": 2, "factors": [factor1, factor2]};
msg = dumps({"cmd": "calculatePLSR", "status":"request",
"callback":"handlePlsrResult", "payload": payload})
ws.send(msg)
result = loads(ws.recv())
assert(result["cmd"] == "handlePlsrResult")
assert(result["status"] == "success")
payload = result["payload"]
fieldNames = payload.keys()
fieldNames.sort()
assert(fieldNames == ['loadingNames', 'loadings', 'maxValue', 'vectorNames', 'vectors'])
vectors = payload["vectors"]
vectorNames = payload["vectorNames"]
assert(vectorNames == ['AgeDx.lo', 'AgeDx.hi', 'Survival.lo', 'Survival.hi'])
loadings = payload["loadings"]
loadingNames = payload["loadingNames"]
assert(loadingNames == genesOfInterest)
assert(len(vectors) == 4)
assert(len(loadings) == 10)
maxValue = payload["maxValue"]
assert(maxValue == 0.8822)
#------------------------------------------------------------------------------------------------------------------------
interactive = (sys.argv[0] != "testWebSocketOperations_server.py")
if(not(interactive)):
runTests()
| {
"content_hash": "6a34e3bc82ebfd85d9bcf1eec0b081e4",
"timestamp": "",
"source": "github",
"line_count": 1275,
"max_line_length": 129,
"avg_line_length": 36.199215686274506,
"alnum_prop": 0.5418598604671317,
"repo_name": "oncoscape/Oncoscape",
"id": "ebfef96c68a609c1e0b4294a8243ccb5dc8ef923",
"size": "46285",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Oncoscape/inst/unitTests/testWebSocketOperations_server.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "477"
},
{
"name": "HTML",
"bytes": "1470640"
},
{
"name": "JavaScript",
"bytes": "4566496"
},
{
"name": "Makefile",
"bytes": "13241"
},
{
"name": "Python",
"bytes": "159722"
},
{
"name": "R",
"bytes": "1699435"
},
{
"name": "Shell",
"bytes": "1608"
},
{
"name": "TeX",
"bytes": "8554"
}
],
"symlink_target": ""
} |
module SensuPluginsElasticsearch
module Version
MAJOR = 0
MINOR = 5
PATCH = 3
VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
end
end
| {
"content_hash": "fa45d7dd221f25d8ef8f1f3fb97ab4ec",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 56,
"avg_line_length": 17.77777777777778,
"alnum_prop": 0.64375,
"repo_name": "majormoses/sensu-plugins-elasticsearch",
"id": "5f3ad4992b8f0afe0f10cd6f31566fa53b9f33c7",
"size": "160",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/sensu-plugins-elasticsearch/version.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "78217"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.