text stringlengths 2 1.04M | meta dict |
|---|---|
module.exports = function(grunt) {
grunt.config.set('ngtemplates', {
taxApp: {
src: 'assets/templates/**/*.html',
dest: 'assets/js/templates.js',
options: {
htmlmin: {
collapseBooleanAttributes: true,
collapseWhitespace: true
}
}
}
});
grunt.loadNpmTasks('grunt-angular-templates');
};
| {
"content_hash": "9f8f1077194fb7c5c7825169d7a56c85",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 48,
"avg_line_length": 21.294117647058822,
"alnum_prop": 0.5662983425414365,
"repo_name": "hermantran/taxgraphs",
"id": "b026d0a9b2458544224ad24108e8e4a7fffa34de",
"size": "362",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tasks/config/ngtemplates.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "5958"
},
{
"name": "HTML",
"bytes": "10704"
},
{
"name": "JavaScript",
"bytes": "97230"
}
],
"symlink_target": ""
} |
order: 20
zh-CN:
title: 订阅表单值更新
name: 姓名
address: 地址
stature: 身高
weight: 体重
height: 身高
hobbies: 爱好
reading: 看书
add: 增加爱好
en-US:
title: Subscribe Observable Value
name: Name
address: Address
stature: Stature
weight: Weight
height: Height
hobbies: Hobbies
reading: Reading
add: Add Hobby
---
```jsx
import {
Form,
FormError,
FormStrategy,
FormControl,
Input,
Validators,
FieldSet,
FormInputField,
Button,
Notify,
Icon,
} from 'zent';
const { useState, useEffect, useCallback } = React;
const { useForm, useFieldArray, useFormValue } = Form;
function App() {
const form = useForm(FormStrategy.View);
return (
<Form form={form} layout="vertical">
<FormInputField required name="name" label="{i18n.name}" />
<FormInputField name="address" label="{i18n.address}" />
<FieldSet name="stature">
<FormInputField name="weight" label="{i18n.weight}" />
<FormInputField name="height" label="{i18n.height}" />
</FieldSet>
<FieldArray />
<Preview form={form} />
</Form>
);
}
function FieldArray() {
const model = useFieldArray('hobbies', [], ['{i18n.reading}']);
model.destroyOnUnmount = true;
return (
<FormControl label="{i18n.hobbies}">
{model.children.map((child, index) => {
return (
<div key={child.id}>
<FormInputField
withoutLabel
model={child}
props={{
addonAfter: (
<Icon
type="close"
style={{ cursor: 'pointer' }}
onClick={() => model.splice(index, 1)}
/>
),
}}
/>
</div>
);
})}
<Button type="primary" onClick={() => model.push('')}>
{i18n.add}
</Button>
</FormControl>
);
}
function Preview({ form }) {
// You will see a warning about performance issues in console.
// Only do this if you know what you are doing.
const value = useFormValue(form);
return (
<>
<div>Form Value</div>
<pre>{JSON.stringify(value, null, 2)}</pre>
</>
);
}
ReactDOM.render(<App />, mountNode);
```
| {
"content_hash": "65125618177cafe4a5cc9cd065308c22",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 64,
"avg_line_length": 19.095238095238095,
"alnum_prop": 0.6134663341645885,
"repo_name": "youzan/zent",
"id": "5dee836e0bf48424450a03369786ad735e20dda5",
"size": "2059",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "packages/zent/src/form/demos/20.reactive-value.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "5039"
},
{
"name": "JavaScript",
"bytes": "530597"
},
{
"name": "SCSS",
"bytes": "226215"
},
{
"name": "Shell",
"bytes": "7632"
},
{
"name": "TypeScript",
"bytes": "1414003"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
namespace Hamburger_Heaven.Pages
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class Food : Page
{
public Food()
{
this.InitializeComponent();
}
}
}
| {
"content_hash": "17956dc5ff82b4ec37909c820502e926",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 94,
"avg_line_length": 27.033333333333335,
"alnum_prop": 0.7213316892725031,
"repo_name": "o0rebelious0o/Beginners-Guide-to-Windows-10",
"id": "4213f24555158bb520627c794b5f55019ee5c1af",
"size": "813",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Hamburger Heaven/Pages/Food.xaml.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "73192"
}
],
"symlink_target": ""
} |
require "iuplua"
timer = iup.timer{time=500}
btn = iup.button {title = "Stop",expand="YES"}
function btn:action ()
if btn.title == "Stop" then
timer.run = "NO"
btn.title = "Start"
else
timer.run = "YES"
btn.title = "Stop"
end
end
function timer:action_cb()
print 'timer!'
end
timer.run = "YES"
dlg = iup.dialog{btn; title="Timer!"}
dlg:show()
iup.MainLoop()
| {
"content_hash": "9dc79657a9c96d3eef245d5808546d8a",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 46,
"avg_line_length": 14,
"alnum_prop": 0.6402116402116402,
"repo_name": "ArcherSys/ArcherSys",
"id": "0c52686cfccb8171a7322d963a290b324d6803c2",
"size": "378",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "Lua/examples/iup/misc/timer1.lua",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
//
// ido_ios-Bridging-Header.h
// ido_ios
//
// Created by qimuyunduan on 16/5/25.
// Copyright © 2016年 qimuyunduan. All rights reserved.
//
#ifndef ido_ios_Bridging_Header_h
#define ido_ios_Bridging_Header_h
#import <UMMobClick/MobClick.h>
#import <SMS_SDK/SMSSDK.h>
#import <MJRefresh/MJRefresh.h>
#endif /* ido_ios_Bridging_Header_h */
| {
"content_hash": "221737db79ff5594d91347ca045b6f90",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 55,
"avg_line_length": 23.066666666666666,
"alnum_prop": 0.708092485549133,
"repo_name": "qimuyunduan/ido_ios",
"id": "b19825395607e980aa12a0428e0b69a4617a06c7",
"size": "349",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ido_ios/ido_ios-Bridging-Header.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "349"
},
{
"name": "Swift",
"bytes": "50198"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="robots" content="index,follow"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Developer : DocumentCodeConflict</title>
<meta name="description" content="">
<meta property="og:title" content="Home"/>
<meta property="og:type" content="article"/>
<meta property="og:url" content="http://developer.avalara.com/"/>
<meta property="og:site_name" content="Avalara Developer Network"/>
<meta property="og:description" content="Avalara AvaTax Accurate and easy sales tax calculation Automatically tie your non-taxable transactions directly to the correct exemption or reseller certificate. Determine accurate taxability & duties for millions of products and services in over 100 countries."/>
<link rel="apple-touch-icon" sizes="57x57" href="/public/images/favicon/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/public/images/favicon/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/public/images/favicon/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/public/images/favicon/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/public/images/favicon/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/public/images/favicon/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/public/images/favicon/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/public/images/favicon/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/public/images/favicon/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/public/images/favicon/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/public/images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/public/images/favicon/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/public/images/favicon/favicon-16x16.png">
<link rel="manifest" href="/public/images/favicon/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff ">
<meta name="msapplication-TileImage" content="/public/images/favicon/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff ">
<link rel="stylesheet" href="/public/css/style.css">
</head>
<body id="top" data-spy="scroll" data-target="#bootstrap-scrollspy" data-product=>
<header>
<div class="pageTitle">
<a href="/">
<img src="/public/images/Avalara_logo.svg" alt="Avalara Developer Network">
<span>Developer</span>
</a>
</div>
<nav class="navbar navbar-default navbar-static">
<div class="navbar-header">
<button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target=".js-navbar-collapse">
<span>Menu</span>
</button>
</div>
<div class="collapse navbar-collapse js-navbar-collapse">
<ul class="nav navbar-nav ">
<li class="home"><a href="/"><span class="text-uppercase">Welcome</span></a></li>
<li class="apis visible-xs-block"><a href="/avalara-apis"><span class="text-uppercase">API</span>s</a></li>
<li class="apis dropdown dropdown-large hidden-xs">
<a class="dropdown-toggle" data-toggle="dropdown"><span class="text-uppercase">API</span>s <i class="caret"></i></a>
<div class="dropdown-menu dropdown-menu-large">
<div class="row">
<div class="col-md-12"><a href="/avalara-apis">APIs overview</a></div>
</div>
<div class="row">
<div class="col-sm-8">
<h2>Tax calculation</h2>
<h4>Avalara AvaTax</h4>
<ul class="pipe">
<li><a href="/avatax">Overview</a></li>
<li><a href="/avatax/use-cases">Use cases</a></li>
<li><a href="/avatax/api-reference/tax/v1">API references</a></li>
<li><a href="/avatax/get-started">Set up your sandbox</a></li>
<li><a href="/avatax/testing-your-integration">Test your integration</a></li>
<li><a href="/avatax/certification">Integration checklists</a></li>
</ul>
<h4>Avalara Communications</h4>
<ul class="pipe">
<li><a href="/communications">Overview</a></li>
<li><a href="/communications/api-reference/saas/soap">API references</a></li>
<li><a href="/communications/certification">Integration checklists</a></li>
</ul>
<h4>Avalara Excise</h4>
<ul class="pipe">
<li><a href="/excise">Overview</a></li>
<li><a href="/excise/api-reference/tax-determination/v5_18_0">API references</a></li>
<li><a href="/excise/certification">Integration checklists</a></li>
</ul>
<h4>Avalara LandedCost</h4>
<ul class="pipe">
<li><a href="/landedcost">Overview</a></li>
<li><a href="/landedcost/api-reference/v3">API references</a></li>
</ul>
</div>
<div class="col-sm-4">
<h2>Compliance document management</h2>
<h4>Avalara CertCapture</h4>
<ul class="pipe">
<li><a href="/certcapture">Overview</a></li>
<li><a href="http://docs.certcapture6xrest.apiary.io/">API references</a></li>
<li><a href="/certcapture/certification">Integration checklists</a></li>
</ul>
<h2>Returns & filing</h2>
<h4>Avalara TrustFile</h4>
<ul class="pipe">
<li><a href="/trustfile">Overview</a></li>
<li><a href="/trustfile/api-reference/core/v3">API references</a></li>
</ul>
</div>
</div>
</div>
</li>
<li class="certification"><a href="/certification"><span class="text-uppercase">Become Certified</span></a></li>
<li class="resources dropdown dropdown-large hidden-xs">
<a class="dropdown-toggle" data-toggle="dropdown"><span class="text-uppercase">Resources</span> <b class="caret"></b></a>
<ul class="dropdown-menu dropdown-menu-large">
<li><a href="/blog">Developer Blog</a></li>
<li><a href="/resources/preferred-developers">Preferred developers</a></li>
<li><a href="https://community.avalara.com/avalara/category_sets/developers">Help Forum</a></li>
</ul>
</li>
<li class="resources visible-xs-block"><a href="/blog"><span class="text-uppercase">Developer Blog</span></a></li>
<li class="resources visible-xs-block"><a href="/resources/preferred-developers"><span class="text-uppercase">Preferred developers</span></a></li>
<li class="resources visible-xs-block"><a href="https://community.avalara.com/avalara/category_sets/developers"><span class="text-uppercase">Help Forum</span></a></li>
<li class="resources visible-xs-block"><a href="/search"><span class="text-uppercase">Search</span></a></li>
<li class="hdr-search-icon hidden-xs">
<i class="mouse glyphicon glyphicon-search mouse"></i>
</li>
<form class="hdr-search-form horizontal hidden-xs hidden">
<div class="row">
<div class="col-md-12">
<button type="button" class="close" aria-label="Close"><span>×</span></button>
</div>
</div>
<div class="row">
<div class="form-group col-md-9">
<input class="form-control" type="search" placeholder="Search" >
<span class="form-control-feedback">!</span>
</div>
<div class="form-group col-md-3">
<input type="submit" class="btn btn-primary" value="Search">
</div>
</div>
</form>
</ul>
</div>
</nav>
</header>
<div class="container-fluid ">
<section class="row padding-sides">
<main class="col-md-12">
<h1>DocumentCodeConflict
</h1>
<h2 id="summary">Summary</h2>
<p>You attempted to create a document with a code that matches an existing transaction.</p>
<h2 id="example">Example</h2>
<div class="highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="w">
</span><span class="nt">"code"</span><span class="p">:</span><span class="w"> </span><span class="s2">"DocumentCodeConflict"</span><span class="p">,</span><span class="w">
</span><span class="nt">"target"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Unknown"</span><span class="p">,</span><span class="w">
</span><span class="nt">"details"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="nt">"code"</span><span class="p">:</span><span class="w"> </span><span class="s2">"DocumentCodeConflict"</span><span class="p">,</span><span class="w">
</span><span class="nt">"number"</span><span class="p">:</span><span class="w"> </span><span class="mi">303</span><span class="p">,</span><span class="w">
</span><span class="nt">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Two documents exist for the company '-0-' with the document code '-1-'. Please void one of them using its ID number."</span><span class="p">,</span><span class="w">
</span><span class="nt">"faultCode"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Client"</span><span class="p">,</span><span class="w">
</span><span class="nt">"helpLink"</span><span class="p">:</span><span class="w"> </span><span class="s2">"http://developer.avalara.com/avatax/errors/DocumentCodeConflict"</span><span class="p">,</span><span class="w">
</span><span class="nt">"severity"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Error"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre>
</div>
<h2 id="explanation">Explanation</h2>
<p>In AvaTax, a committed transaction is considered “finalized,” and its transaction code is reserved and may not be reused.</p>
<p>If a transaction is not yet committed, you may continue to update it by re-creating a document with the same code as many times as required.</p>
<p>Once a transaction has been committed, you may either adjust it by calling the POST “/api/v2/companies/(code)/transaction/(code)/adjust” endpoint or you may void it by calling the POST “/api/v2/companies/(code)/transaction/(code)/void” endpoint.</p>
<p>Transactions that have been reported to a tax authority may not be adjusted, voided, or altered in any way. To modify a transaction that has been reported to a tax authority, create a reverse transaction with amounts opposite the original transaction.</p>
</main>
</section>
</div>
<footer class="navbar navbar-default">
<ul class="social">
<li class="twitter"><a href="https://twitter.com/Avalara">Twitter</a></li>
<li class="facebook"><a href="https://www.facebook.com/avalara">Facebook</a></li>
<li class="linkedin"><a href="https://www.linkedin.com/company/avalara">LinkedIn</a></li>
<li class="youtube"><a href="https://www.youtube.com/user/Avalara1">Youtube</a></li>
</ul>
<ul class="github">
<li><a href="https://github.com/Avalara/developer-dot/edit/master/avatax/errors/DocumentCodeConflict.md">Edit this page on GitHub</a></li>
</ul>
<ul class="global">
<li><a href="https://www.avalara.com/"><span class="icon-sphere"></span>Avalara.com</a></li>
<li><a href="https://help.avalara.com/"><span class="icon-help"></span>Help Center</a></li>
</ul>
<ul class="legal">
<li>© Avalara, Inc. All rights reserved</li>
<li><a href="https://www.avalara.com/site-terms/">Terms of use</a></li>
<li><a href="https://www.avalara.com/privacy-policy/">Privacy Policy</a></li>
</ul>
</footer>
<script src="/public/js/vendor/jquery-2.2.4.min.js"></script>
<script src="/public/js/vendor/bootstrap.min.js"></script>
<script src="/public/js/site.js"></script>
<script src='/public/js/vendor/aws-sdk-2.5.3.min.js'></script>
<script>AWS.config.region = 'us-west-2';</script>
<!-- Google Tag Manager -->
<noscript>
<iframe src="//www.googletagmanager.com/ns.html?id=GTM-MKB5LP" height="0" width="0" style="display:none;visibility:hidden"></iframe>
</noscript>
<script>(function(w, d, s, l, i) {
w[l] = w[l] || [];
w[l].push({
'gtm.start': new Date().getTime(), event: 'gtm.js'
});
var f = d.getElementsByTagName(s)[0],
j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : '';
j.async = true;
j.src =
'//www.googletagmanager.com/gtm.js?id=' + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'dataLayer', 'GTM-MKB5LP');</script>
<!-- End Google Tag Manager -->
</body>
</html>
| {
"content_hash": "a6819872aac2ba3d2988e777fdcdf25c",
"timestamp": "",
"source": "github",
"line_count": 293,
"max_line_length": 309,
"avg_line_length": 55.341296928327644,
"alnum_prop": 0.5104532839962997,
"repo_name": "JoeSava/developer-dot",
"id": "e840de359ee7f7340a9055245cde67eedc596376",
"size": "16227",
"binary": false,
"copies": "3",
"ref": "refs/heads/newMaster",
"path": "_test/jekyll/expected/avatax/errors/DocumentCodeConflict/index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "106"
},
{
"name": "C#",
"bytes": "37584"
},
{
"name": "CSS",
"bytes": "233277"
},
{
"name": "HTML",
"bytes": "13122077"
},
{
"name": "JavaScript",
"bytes": "10801083"
},
{
"name": "PowerShell",
"bytes": "112345"
},
{
"name": "Ruby",
"bytes": "2425"
},
{
"name": "Shell",
"bytes": "1242"
}
],
"symlink_target": ""
} |
using System;
using System.IO;
using SharpDX.IO;
namespace SharpDX.Toolkit.Graphics
{
using System.Drawing;
using System.Drawing.Imaging;
// Writes the output sprite font binary file.
internal static class SpriteFontWriter
{
const string spriteFontMagic = "DXTKfont";
const int DXGI_FORMAT_R8G8B8A8_UNORM = 28;
const int DXGI_FORMAT_B4G4R4A4_UNORM = 115;
const int DXGI_FORMAT_BC2_UNORM = 74;
public static void WriteSpriteFont(FontDescription options, string outputFilename, Glyph[] glyphs, float lineSpacing, Bitmap bitmap)
{
using (var stream = new NativeFileStream(outputFilename, NativeFileMode.Create, NativeFileAccess.Write))
{
WriteSpriteFont(options, stream, glyphs, lineSpacing, bitmap);
}
}
public static void WriteSpriteFont(FontDescription options, Stream outputStream, Glyph[] glyphs, float lineSpacing, Bitmap bitmap)
{
var writer = new BinaryWriter(outputStream);
WriteMagic(writer);
writer.Write(SpriteFontData.Version);
WriteGlyphs(writer, glyphs);
writer.Write(lineSpacing);
writer.Write(options.DefaultCharacter);
WriteBitmap(writer, options, bitmap);
writer.Flush();
}
static void WriteMagic(BinaryWriter writer)
{
foreach (char magic in spriteFontMagic)
{
writer.Write((byte)magic);
}
}
static void WriteGlyphs(BinaryWriter writer, Glyph[] glyphs)
{
writer.Write(glyphs.Length);
foreach (Glyph glyph in glyphs)
{
writer.Write((int)glyph.Character);
writer.Write(glyph.Subrect.Left);
writer.Write(glyph.Subrect.Top);
writer.Write(glyph.Subrect.Right);
writer.Write(glyph.Subrect.Bottom);
writer.Write(glyph.XOffset);
writer.Write(glyph.YOffset);
writer.Write(glyph.XAdvance);
}
}
static void WriteBitmap(BinaryWriter writer, FontDescription options, Bitmap bitmap)
{
writer.Write(bitmap.Width);
writer.Write(bitmap.Height);
switch (options.Format)
{
case FontTextureFormat.Rgba32:
WriteRgba32(writer, bitmap);
break;
case FontTextureFormat.Bgra4444:
WriteBgra4444(writer, bitmap);
break;
case FontTextureFormat.CompressedMono:
WriteCompressedMono(writer, bitmap, options);
break;
default:
throw new NotSupportedException();
}
}
// Writes an uncompressed 32 bit font texture.
static void WriteRgba32(BinaryWriter writer, Bitmap bitmap)
{
writer.Write(DXGI_FORMAT_R8G8B8A8_UNORM);
writer.Write(bitmap.Width * 4);
writer.Write(bitmap.Height);
using (var bitmapData = new BitmapUtils.PixelAccessor(bitmap, ImageLockMode.ReadOnly))
{
for (int y = 0; y < bitmap.Height; y++)
{
for (int x = 0; x < bitmap.Width; x++)
{
Color color = bitmapData[x, y];
writer.Write(color.R);
writer.Write(color.G);
writer.Write(color.B);
writer.Write(color.A);
}
}
}
}
// Writes a 16 bit font texture.
static void WriteBgra4444(BinaryWriter writer, Bitmap bitmap)
{
writer.Write(DXGI_FORMAT_B4G4R4A4_UNORM);
writer.Write(bitmap.Width * sizeof(ushort));
writer.Write(bitmap.Height);
using (var bitmapData = new BitmapUtils.PixelAccessor(bitmap, ImageLockMode.ReadOnly))
{
for (int y = 0; y < bitmap.Height; y++)
{
for (int x = 0; x < bitmap.Width; x++)
{
Color color = bitmapData[x, y];
int r = color.R >> 4;
int g = color.G >> 4;
int b = color.B >> 4;
int a = color.A >> 4;
int packed = b | (g << 4) | (r << 8) | (a << 12);
writer.Write((ushort)packed);
}
}
}
}
// Writes a block compressed monochromatic font texture.
static void WriteCompressedMono(BinaryWriter writer, Bitmap bitmap, FontDescription options)
{
if ((bitmap.Width & 3) != 0 ||
(bitmap.Height & 3) != 0)
{
throw new ArgumentException("Block compression requires texture size to be a multiple of 4.");
}
writer.Write(DXGI_FORMAT_BC2_UNORM);
writer.Write(bitmap.Width * 4);
writer.Write(bitmap.Height / 4);
using (var bitmapData = new BitmapUtils.PixelAccessor(bitmap, ImageLockMode.ReadOnly))
{
for (int y = 0; y < bitmap.Height; y += 4)
{
for (int x = 0; x < bitmap.Width; x += 4)
{
CompressBlock(writer, bitmapData, x, y, options);
}
}
}
}
// We want to compress our font textures, because, like, smaller is better,
// right? But a standard DXT compressor doesn't do a great job with fonts that
// are in premultiplied alpha format. Our font data is greyscale, so all of the
// RGBA channels have the same value. If one channel is compressed differently
// to another, this causes an ugly variation in brightness of the rendered text.
// Also, fonts are mostly either black or white, with grey values only used for
// antialiasing along their edges. It is very important that the black and white
// areas be accurately represented, while the precise value of grey is less
// important.
//
// Trouble is, your average DXT compressor knows nothing about these
// requirements. It will optimize to minimize a generic error metric such as
// RMS, but this will often sacrifice crisp black and white in exchange for
// needless accuracy of the antialiasing pixels, or encode RGB differently to
// alpha. UGLY!
//
// Fortunately, encoding monochrome fonts turns out to be trivial. Using DXT3,
// we can fix the end colors as black and white, which gives guaranteed exact
// encoding of the font inside and outside, plus two fractional values for edge
// antialiasing. Also, these RGB values (0, 1/3, 2/3, 1) map exactly to four of
// the possible 16 alpha values available in DXT3, so we can ensure the RGB and
// alpha channels always exactly match.
static void CompressBlock(BinaryWriter writer, BitmapUtils.PixelAccessor bitmapData, int blockX, int blockY, FontDescription options)
{
long alphaBits = 0;
int rgbBits = 0;
int pixelCount = 0;
for (int y = 0; y < 4; y++)
{
for (int x = 0; x < 4; x++)
{
long alpha;
int rgb;
int value = bitmapData[blockX + x, blockY + y].A;
if (options.NoPremultiply)
{
// If we are not premultiplied, RGB is always white and we have 4 bit alpha.
alpha = value >> 4;
rgb = 0;
}
else
{
// For premultiplied encoding, quantize the source value to 2 bit precision.
if (value < 256 / 6)
{
alpha = 0;
rgb = 1;
}
else if (value < 256 / 2)
{
alpha = 5;
rgb = 3;
}
else if (value < 256 * 5 / 6)
{
alpha = 10;
rgb = 2;
}
else
{
alpha = 15;
rgb = 0;
}
}
// Add this pixel to the alpha and RGB bit masks.
alphaBits |= alpha << (pixelCount * 4);
rgbBits |= rgb << (pixelCount * 2);
pixelCount++;
}
}
// Output the alpha bit mask.
writer.Write(alphaBits);
// Output the two endpoint colors (black and white in 5.6.5 format).
writer.Write((ushort)0xFFFF);
writer.Write((ushort)0);
// Output the RGB bit mask.
writer.Write(rgbBits);
}
}
}
| {
"content_hash": "d2cf6248b021e20c80afcaf46684ee4d",
"timestamp": "",
"source": "github",
"line_count": 269,
"max_line_length": 141,
"avg_line_length": 35.267657992565056,
"alnum_prop": 0.49214714872984083,
"repo_name": "VirusFree/SharpDX",
"id": "2a9ac49356398f45c6bfc6fa1d5dbf19feb6f458",
"size": "13746",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "Source/Toolkit/SharpDX.Toolkit.Compiler/Font/SpriteFontWriter.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "4638"
},
{
"name": "C",
"bytes": "2654709"
},
{
"name": "C#",
"bytes": "11352604"
},
{
"name": "C++",
"bytes": "7503921"
},
{
"name": "HLSL",
"bytes": "106438"
},
{
"name": "HTML",
"bytes": "14471"
},
{
"name": "PowerShell",
"bytes": "2255"
},
{
"name": "Roff",
"bytes": "15315"
}
],
"symlink_target": ""
} |
package com.sessionm.smp_fcm;
import android.app.Application;
import com.sessionm.core.api.SessionM;
import com.sessionm.core.api.SessionMError;
import com.sessionm.core.api.StartupListener;
import com.sessionm.message.api.MessagesManager;
public class SEApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
//Callback is optional but highly recommended
SessionM.start(this, new StartupListener() {
@Override
public void onStarted(SessionMError sessionMError) {
//If sessionMError is not null, something is wrong(Networking, config, etc.)
}
});
//Enables SessionM to receive push notifications, generates and sends a token to the server so the device can receive push notifications
if (!MessagesManager.getInstance().isPushNotificationEnabled())
MessagesManager.getInstance().setPushNotificationEnabled(true);
}
}
| {
"content_hash": "68628435044805a99ad482f2a9aacef8",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 144,
"avg_line_length": 34.92857142857143,
"alnum_prop": 0.7044989775051125,
"repo_name": "sessionm/android-smp-example",
"id": "ff9d2925b8611ffc3db4556fd4a70cd98f4fd52a",
"size": "1037",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "SMP_FCM/src/main/java/com/sessionm/smp_fcm/SEApplication.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "5293"
},
{
"name": "Java",
"bytes": "376907"
},
{
"name": "Kotlin",
"bytes": "14031"
}
],
"symlink_target": ""
} |
/* Asciidoctor default stylesheet | MIT License | https://asciidoctor.org */
/* Remove comment around @import statement below when using as a custom stylesheet */
@import "https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700";
article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}
audio,canvas,video{display:inline-block}
audio:not([controls]){display:none;height:0}
[hidden],template{display:none}
script{display:none!important}
html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}
a{background:transparent}
a:focus{outline:thin dotted}
a:active,a:hover{outline:0}
h1{font-size:2em;margin:.67em 0}
abbr[title]{border-bottom:1px dotted}
b,strong{font-weight:bold}
dfn{font-style:italic}
hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}
mark{background:#ff0;color:#000}
code,kbd,pre,samp{font-family:monospace;font-size:1em}
pre{white-space:pre-wrap}
q{quotes:"\201C" "\201D" "\2018" "\2019"}
small{font-size:80%}
sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}
sup{top:-.5em}
sub{bottom:-.25em}
img{border:0}
svg:not(:root){overflow:hidden}
figure{margin:0}
fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}
legend{border:0;padding:0}
button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}
button,input{line-height:normal}
button,select{text-transform:none}
button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}
button[disabled],html input[disabled]{cursor:default}
input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}
input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}
input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}
button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}
textarea{overflow:auto;vertical-align:top}
table{border-collapse:collapse;border-spacing:0}
*,*:before,*:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}
html,body{font-size:100%}
body{background:#fff;color:rgba(0,0,0,.8);padding:0;margin:0;font-family:"Noto Serif","DejaVu Serif",serif;font-weight:400;font-style:normal;line-height:1;position:relative;cursor:auto;tab-size:4;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}
a:hover{cursor:pointer}
img,object,embed{max-width:100%;height:auto}
object,embed{height:100%}
img{-ms-interpolation-mode:bicubic}
.left{float:left!important}
.right{float:right!important}
.text-left{text-align:left!important}
.text-right{text-align:right!important}
.text-center{text-align:center!important}
.text-justify{text-align:justify!important}
.hide{display:none}
img,object,svg{display:inline-block;vertical-align:middle}
textarea{height:auto;min-height:50px}
select{width:100%}
.center{margin-left:auto;margin-right:auto}
.spread{width:100%}
p.lead,.paragraph.lead>p,#preamble>.sectionbody>.paragraph:first-of-type p{font-size:1.21875em;line-height:1.6}
.subheader,.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{line-height:1.45;color:#7a2518;font-weight:400;margin-top:0;margin-bottom:.25em}
div,dl,dt,dd,ul,ol,li,h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6,pre,form,p,blockquote,th,td{margin:0;padding:0;direction:ltr}
a{color:#2156a5;text-decoration:underline;line-height:inherit}
a:hover,a:focus{color:#1d4b8f}
a img{border:none}
p{font-family:inherit;font-weight:400;font-size:1em;line-height:1.6;margin-bottom:1.25em;text-rendering:optimizeLegibility}
p aside{font-size:.875em;line-height:1.35;font-style:italic}
h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{font-family:"Open Sans","DejaVu Sans",sans-serif;font-weight:300;font-style:normal;color:#ba3925;text-rendering:optimizeLegibility;margin-top:1em;margin-bottom:.5em;line-height:1.0125em}
h1 small,h2 small,h3 small,#toctitle small,.sidebarblock>.content>.title small,h4 small,h5 small,h6 small{font-size:60%;color:#e99b8f;line-height:0}
h1{font-size:2.125em}
h2{font-size:1.6875em}
h3,#toctitle,.sidebarblock>.content>.title{font-size:1.375em}
h4,h5{font-size:1.125em}
h6{font-size:1em}
hr{border:solid #ddddd8;border-width:1px 0 0;clear:both;margin:1.25em 0 1.1875em;height:0}
em,i{font-style:italic;line-height:inherit}
strong,b{font-weight:bold;line-height:inherit}
small{font-size:60%;line-height:inherit}
code{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;font-weight:400;color:rgba(0,0,0,.9)}
ul,ol,dl{font-size:1em;line-height:1.6;margin-bottom:1.25em;list-style-position:outside;font-family:inherit}
ul,ol{margin-left:1.5em}
ul li ul,ul li ol{margin-left:1.25em;margin-bottom:0;font-size:1em}
ul.square li ul,ul.circle li ul,ul.disc li ul{list-style:inherit}
ul.square{list-style-type:square}
ul.circle{list-style-type:circle}
ul.disc{list-style-type:disc}
ol li ul,ol li ol{margin-left:1.25em;margin-bottom:0}
dl dt{margin-bottom:.3125em;font-weight:bold}
dl dd{margin-bottom:1.25em}
abbr,acronym{text-transform:uppercase;font-size:90%;color:rgba(0,0,0,.8);border-bottom:1px dotted #ddd;cursor:help}
abbr{text-transform:none}
blockquote{margin:0 0 1.25em;padding:.5625em 1.25em 0 1.1875em;border-left:1px solid #ddd}
blockquote cite{display:block;font-size:.9375em;color:rgba(0,0,0,.6)}
blockquote cite:before{content:"\2014 \0020"}
blockquote cite a,blockquote cite a:visited{color:rgba(0,0,0,.6)}
blockquote,blockquote p{line-height:1.6;color:rgba(0,0,0,.85)}
@media only screen and (min-width:768px){h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2}
h1{font-size:2.75em}
h2{font-size:2.3125em}
h3,#toctitle,.sidebarblock>.content>.title{font-size:1.6875em}
h4{font-size:1.4375em}}
table{background:#fff;margin-bottom:1.25em;border:solid 1px #dedede}
table thead,table tfoot{background:#f7f8f7;font-weight:bold}
table thead tr th,table thead tr td,table tfoot tr th,table tfoot tr td{padding:.5em .625em .625em;font-size:inherit;color:rgba(0,0,0,.8);text-align:left}
table tr th,table tr td{padding:.5625em .625em;font-size:inherit;color:rgba(0,0,0,.8)}
table tr.even,table tr.alt,table tr:nth-of-type(even){background:#f8f8f7}
table thead tr th,table tfoot tr th,table tbody tr td,table tr td,table tfoot tr td{display:table-cell;line-height:1.6}
h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2;word-spacing:-.05em}
h1 strong,h2 strong,h3 strong,#toctitle strong,.sidebarblock>.content>.title strong,h4 strong,h5 strong,h6 strong{font-weight:400}
.clearfix:before,.clearfix:after,.float-group:before,.float-group:after{content:" ";display:table}
.clearfix:after,.float-group:after{clear:both}
*:not(pre)>code{font-size:.9375em;font-style:normal!important;letter-spacing:0;padding:.1em .5ex;word-spacing:-.15em;background-color:#f7f7f8;-webkit-border-radius:4px;border-radius:4px;line-height:1.45;text-rendering:optimizeSpeed;word-wrap:break-word}
*:not(pre)>code.nobreak{word-wrap:normal}
*:not(pre)>code.nowrap{white-space:nowrap}
pre,pre>code{line-height:1.45;color:rgba(0,0,0,.9);font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;font-weight:400;text-rendering:optimizeSpeed}
em em{font-style:normal}
strong strong{font-weight:400}
.keyseq{color:rgba(51,51,51,.8)}
kbd{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;display:inline-block;color:rgba(0,0,0,.8);font-size:.65em;line-height:1.45;background-color:#f7f7f7;border:1px solid #ccc;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,.2),0 0 0 .1em white inset;box-shadow:0 1px 0 rgba(0,0,0,.2),0 0 0 .1em #fff inset;margin:0 .15em;padding:.2em .5em;vertical-align:middle;position:relative;top:-.1em;white-space:nowrap}
.keyseq kbd:first-child{margin-left:0}
.keyseq kbd:last-child{margin-right:0}
.menuseq,.menuref{color:#000}
.menuseq b:not(.caret),.menuref{font-weight:inherit}
.menuseq{word-spacing:-.02em}
.menuseq b.caret{font-size:1.25em;line-height:.8}
.menuseq i.caret{font-weight:bold;text-align:center;width:.45em}
b.button:before,b.button:after{position:relative;top:-1px;font-weight:400}
b.button:before{content:"[";padding:0 3px 0 2px}
b.button:after{content:"]";padding:0 2px 0 3px}
p a>code:hover{color:rgba(0,0,0,.9)}
#header,#content,#footnotes,#footer{width:100%;margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0;max-width:62.5em;*zoom:1;position:relative;padding-left:.9375em;padding-right:.9375em}
#header:before,#header:after,#content:before,#content:after,#footnotes:before,#footnotes:after,#footer:before,#footer:after{content:" ";display:table}
#header:after,#content:after,#footnotes:after,#footer:after{clear:both}
#content{margin-top:1.25em}
#content:before{content:none}
#header>h1:first-child{color:rgba(0,0,0,.85);margin-top:2.25rem;margin-bottom:0}
#header>h1:first-child+#toc{margin-top:8px;border-top:1px solid #ddddd8}
#header>h1:only-child,body.toc2 #header>h1:nth-last-child(2){border-bottom:1px solid #ddddd8;padding-bottom:8px}
#header .details{border-bottom:1px solid #ddddd8;line-height:1.45;padding-top:.25em;padding-bottom:.25em;padding-left:.25em;color:rgba(0,0,0,.6);display:-ms-flexbox;display:-webkit-flex;display:flex;-ms-flex-flow:row wrap;-webkit-flex-flow:row wrap;flex-flow:row wrap}
#header .details span:first-child{margin-left:-.125em}
#header .details span.email a{color:rgba(0,0,0,.85)}
#header .details br{display:none}
#header .details br+span:before{content:"\00a0\2013\00a0"}
#header .details br+span.author:before{content:"\00a0\22c5\00a0";color:rgba(0,0,0,.85)}
#header .details br+span#revremark:before{content:"\00a0|\00a0"}
#header #revnumber{text-transform:capitalize}
#header #revnumber:after{content:"\00a0"}
#content>h1:first-child:not([class]){color:rgba(0,0,0,.85);border-bottom:1px solid #ddddd8;padding-bottom:8px;margin-top:0;padding-top:1rem;margin-bottom:1.25rem}
#toc{border-bottom:1px solid #efefed;padding-bottom:.5em}
#toc>ul{margin-left:.125em}
#toc ul.sectlevel0>li>a{font-style:italic}
#toc ul.sectlevel0 ul.sectlevel1{margin:.5em 0}
#toc ul{font-family:"Open Sans","DejaVu Sans",sans-serif;list-style-type:none}
#toc li{line-height:1.3334;margin-top:.3334em}
#toc a{text-decoration:none}
#toc a:active{text-decoration:underline}
#toctitle{color:#7a2518;font-size:1.2em}
@media only screen and (min-width:768px){#toctitle{font-size:1.375em}
body.toc2{padding-left:15em;padding-right:0}
#toc.toc2{margin-top:0!important;background-color:#f8f8f7;position:fixed;width:15em;left:0;top:0;border-right:1px solid #efefed;border-top-width:0!important;border-bottom-width:0!important;z-index:1000;padding:1.25em 1em;height:100%;overflow:auto}
#toc.toc2 #toctitle{margin-top:0;margin-bottom:.8rem;font-size:1.2em}
#toc.toc2>ul{font-size:.9em;margin-bottom:0}
#toc.toc2 ul ul{margin-left:0;padding-left:1em}
#toc.toc2 ul.sectlevel0 ul.sectlevel1{padding-left:0;margin-top:.5em;margin-bottom:.5em}
body.toc2.toc-right{padding-left:0;padding-right:15em}
body.toc2.toc-right #toc.toc2{border-right-width:0;border-left:1px solid #efefed;left:auto;right:0}}
@media only screen and (min-width:1280px){body.toc2{padding-left:20em;padding-right:0}
#toc.toc2{width:20em}
#toc.toc2 #toctitle{font-size:1.375em}
#toc.toc2>ul{font-size:.95em}
#toc.toc2 ul ul{padding-left:1.25em}
body.toc2.toc-right{padding-left:0;padding-right:20em}}
#content #toc{border-style:solid;border-width:1px;border-color:#e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;-webkit-border-radius:4px;border-radius:4px}
#content #toc>:first-child{margin-top:0}
#content #toc>:last-child{margin-bottom:0}
#footer{max-width:100%;background-color:rgba(0,0,0,.8);padding:1.25em}
#footer-text{color:rgba(255,255,255,.8);line-height:1.44}
.sect1{padding-bottom:.625em}
@media only screen and (min-width:768px){.sect1{padding-bottom:1.25em}}
.sect1+.sect1{border-top:1px solid #efefed}
#content h1>a.anchor,h2>a.anchor,h3>a.anchor,#toctitle>a.anchor,.sidebarblock>.content>.title>a.anchor,h4>a.anchor,h5>a.anchor,h6>a.anchor{position:absolute;z-index:1001;width:1.5ex;margin-left:-1.5ex;display:block;text-decoration:none!important;visibility:hidden;text-align:center;font-weight:400}
#content h1>a.anchor:before,h2>a.anchor:before,h3>a.anchor:before,#toctitle>a.anchor:before,.sidebarblock>.content>.title>a.anchor:before,h4>a.anchor:before,h5>a.anchor:before,h6>a.anchor:before{content:"\00A7";font-size:.85em;display:block;padding-top:.1em}
#content h1:hover>a.anchor,#content h1>a.anchor:hover,h2:hover>a.anchor,h2>a.anchor:hover,h3:hover>a.anchor,#toctitle:hover>a.anchor,.sidebarblock>.content>.title:hover>a.anchor,h3>a.anchor:hover,#toctitle>a.anchor:hover,.sidebarblock>.content>.title>a.anchor:hover,h4:hover>a.anchor,h4>a.anchor:hover,h5:hover>a.anchor,h5>a.anchor:hover,h6:hover>a.anchor,h6>a.anchor:hover{visibility:visible}
#content h1>a.link,h2>a.link,h3>a.link,#toctitle>a.link,.sidebarblock>.content>.title>a.link,h4>a.link,h5>a.link,h6>a.link{color:#ba3925;text-decoration:none}
#content h1>a.link:hover,h2>a.link:hover,h3>a.link:hover,#toctitle>a.link:hover,.sidebarblock>.content>.title>a.link:hover,h4>a.link:hover,h5>a.link:hover,h6>a.link:hover{color:#a53221}
.audioblock,.imageblock,.literalblock,.listingblock,.stemblock,.videoblock{margin-bottom:1.25em}
.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{text-rendering:optimizeLegibility;text-align:left;font-family:"Noto Serif","DejaVu Serif",serif;font-size:1rem;font-style:italic}
table.tableblock>caption.title{white-space:nowrap;overflow:visible;max-width:0}
.paragraph.lead>p,#preamble>.sectionbody>.paragraph:first-of-type p{color:rgba(0,0,0,.85)}
table.tableblock #preamble>.sectionbody>.paragraph:first-of-type p{font-size:inherit}
.admonitionblock>table{border-collapse:separate;border:0;background:none;width:100%}
.admonitionblock>table td.icon{text-align:center;width:80px}
.admonitionblock>table td.icon img{max-width:initial}
.admonitionblock>table td.icon .title{font-weight:bold;font-family:"Open Sans","DejaVu Sans",sans-serif;text-transform:uppercase}
.admonitionblock>table td.content{padding-left:1.125em;padding-right:1.25em;border-left:1px solid #ddddd8;color:rgba(0,0,0,.6)}
.admonitionblock>table td.content>:last-child>:last-child{margin-bottom:0}
.exampleblock>.content{border-style:solid;border-width:1px;border-color:#e6e6e6;margin-bottom:1.25em;padding:1.25em;background:#fff;-webkit-border-radius:4px;border-radius:4px}
.exampleblock>.content>:first-child{margin-top:0}
.exampleblock>.content>:last-child{margin-bottom:0}
.sidebarblock{border-style:solid;border-width:1px;border-color:#e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;-webkit-border-radius:4px;border-radius:4px}
.sidebarblock>:first-child{margin-top:0}
.sidebarblock>:last-child{margin-bottom:0}
.sidebarblock>.content>.title{color:#7a2518;margin-top:0;text-align:center}
.exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0}
.literalblock pre,.listingblock pre:not(.highlight),.listingblock pre[class="highlight"],.listingblock pre[class^="highlight "],.listingblock pre.CodeRay,.listingblock pre.prettyprint{background:#f7f7f8}
.sidebarblock .literalblock pre,.sidebarblock .listingblock pre:not(.highlight),.sidebarblock .listingblock pre[class="highlight"],.sidebarblock .listingblock pre[class^="highlight "],.sidebarblock .listingblock pre.CodeRay,.sidebarblock .listingblock pre.prettyprint{background:#f2f1f1}
.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{-webkit-border-radius:4px;border-radius:4px;word-wrap:break-word;padding:1em;font-size:.8125em}
.literalblock pre.nowrap,.literalblock pre[class].nowrap,.listingblock pre.nowrap,.listingblock pre[class].nowrap{overflow-x:auto;white-space:pre;word-wrap:normal}
@media only screen and (min-width:768px){.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{font-size:.90625em}}
@media only screen and (min-width:1280px){.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{font-size:1em}}
.literalblock.output pre{color:#f7f7f8;background-color:rgba(0,0,0,.9)}
.listingblock pre.highlightjs{padding:0}
.listingblock pre.highlightjs>code{padding:1em;-webkit-border-radius:4px;border-radius:4px}
.listingblock pre.prettyprint{border-width:0}
.listingblock>.content{position:relative}
.listingblock code[data-lang]:before{display:none;content:attr(data-lang);position:absolute;font-size:.75em;top:.425rem;right:.5rem;line-height:1;text-transform:uppercase;color:#999}
.listingblock:hover code[data-lang]:before{display:block}
.listingblock.terminal pre .command:before{content:attr(data-prompt);padding-right:.5em;color:#999}
.listingblock.terminal pre .command:not([data-prompt]):before{content:"$"}
table.pyhltable{border-collapse:separate;border:0;margin-bottom:0;background:none}
table.pyhltable td{vertical-align:top;padding-top:0;padding-bottom:0;line-height:1.45}
table.pyhltable td.code{padding-left:.75em;padding-right:0}
pre.pygments .lineno,table.pyhltable td:not(.code){color:#999;padding-left:0;padding-right:.5em;border-right:1px solid #ddddd8}
pre.pygments .lineno{display:inline-block;margin-right:.25em}
table.pyhltable .linenodiv{background:none!important;padding-right:0!important}
.quoteblock{margin:0 1em 1.25em 1.5em;display:table}
.quoteblock>.title{margin-left:-1.5em;margin-bottom:.75em}
.quoteblock blockquote,.quoteblock blockquote p{color:rgba(0,0,0,.85);font-size:1.15rem;line-height:1.75;word-spacing:.1em;letter-spacing:0;font-style:italic;text-align:justify}
.quoteblock blockquote{margin:0;padding:0;border:0}
.quoteblock blockquote:before{content:"\201c";float:left;font-size:2.75em;font-weight:bold;line-height:.6em;margin-left:-.6em;color:#7a2518;text-shadow:0 1px 2px rgba(0,0,0,.1)}
.quoteblock blockquote>.paragraph:last-child p{margin-bottom:0}
.quoteblock .attribution{margin-top:.5em;margin-right:.5ex;text-align:right}
.quoteblock .quoteblock{margin-left:0;margin-right:0;padding:.5em 0;border-left:3px solid rgba(0,0,0,.6)}
.quoteblock .quoteblock blockquote{padding:0 0 0 .75em}
.quoteblock .quoteblock blockquote:before{display:none}
.verseblock{margin:0 1em 1.25em 1em}
.verseblock pre{font-family:"Open Sans","DejaVu Sans",sans;font-size:1.15rem;color:rgba(0,0,0,.85);font-weight:300;text-rendering:optimizeLegibility}
.verseblock pre strong{font-weight:400}
.verseblock .attribution{margin-top:1.25rem;margin-left:.5ex}
.quoteblock .attribution,.verseblock .attribution{font-size:.9375em;line-height:1.45;font-style:italic}
.quoteblock .attribution br,.verseblock .attribution br{display:none}
.quoteblock .attribution cite,.verseblock .attribution cite{display:block;letter-spacing:-.025em;color:rgba(0,0,0,.6)}
.quoteblock.abstract{margin:0 0 1.25em 0;display:block}
.quoteblock.abstract blockquote,.quoteblock.abstract blockquote p{text-align:left;word-spacing:0}
.quoteblock.abstract blockquote:before,.quoteblock.abstract blockquote p:first-of-type:before{display:none}
table.tableblock{max-width:100%;border-collapse:separate}
table.tableblock td>.paragraph:last-child p>p:last-child,table.tableblock th>p:last-child,table.tableblock td>p:last-child{margin-bottom:0}
table.tableblock,th.tableblock,td.tableblock{border:0 solid #dedede}
table.grid-all>thead>tr>.tableblock,table.grid-all>tbody>tr>.tableblock{border-width:0 1px 1px 0}
table.grid-all>tfoot>tr>.tableblock{border-width:1px 1px 0 0}
table.grid-cols>*>tr>.tableblock{border-width:0 1px 0 0}
table.grid-rows>thead>tr>.tableblock,table.grid-rows>tbody>tr>.tableblock{border-width:0 0 1px 0}
table.grid-rows>tfoot>tr>.tableblock{border-width:1px 0 0 0}
table.grid-all>*>tr>.tableblock:last-child,table.grid-cols>*>tr>.tableblock:last-child{border-right-width:0}
table.grid-all>tbody>tr:last-child>.tableblock,table.grid-all>thead:last-child>tr>.tableblock,table.grid-rows>tbody>tr:last-child>.tableblock,table.grid-rows>thead:last-child>tr>.tableblock{border-bottom-width:0}
table.frame-all{border-width:1px}
table.frame-sides{border-width:0 1px}
table.frame-topbot{border-width:1px 0}
th.halign-left,td.halign-left{text-align:left}
th.halign-right,td.halign-right{text-align:right}
th.halign-center,td.halign-center{text-align:center}
th.valign-top,td.valign-top{vertical-align:top}
th.valign-bottom,td.valign-bottom{vertical-align:bottom}
th.valign-middle,td.valign-middle{vertical-align:middle}
table thead th,table tfoot th{font-weight:bold}
tbody tr th{display:table-cell;line-height:1.6;background:#f7f8f7}
tbody tr th,tbody tr th p,tfoot tr th,tfoot tr th p{color:rgba(0,0,0,.8);font-weight:bold}
p.tableblock>code:only-child{background:none;padding:0}
p.tableblock{font-size:1em}
td>div.verse{white-space:pre}
ol{margin-left:1.75em}
ul li ol{margin-left:1.5em}
dl dd{margin-left:1.125em}
dl dd:last-child,dl dd:last-child>:last-child{margin-bottom:0}
ol>li p,ul>li p,ul dd,ol dd,.olist .olist,.ulist .ulist,.ulist .olist,.olist .ulist{margin-bottom:.625em}
ul.checklist,ul.none,ol.none,ul.no-bullet,ol.no-bullet,ol.unnumbered,ul.unstyled,ol.unstyled{list-style-type:none}
ul.no-bullet,ol.no-bullet,ol.unnumbered{margin-left:.625em}
ul.unstyled,ol.unstyled{margin-left:0}
ul.checklist{margin-left:.625em}
ul.checklist li>p:first-child>.fa-square-o:first-child,ul.checklist li>p:first-child>.fa-check-square-o:first-child{width:1.25em;font-size:.8em;position:relative;bottom:.125em}
ul.checklist li>p:first-child>input[type="checkbox"]:first-child{margin-right:.25em}
ul.inline{margin:0 auto .625em auto;margin-left:-1.375em;margin-right:0;padding:0;list-style:none;overflow:hidden}
ul.inline>li{list-style:none;float:left;margin-left:1.375em;display:block}
ul.inline>li>*{display:block}
.unstyled dl dt{font-weight:400;font-style:normal}
ol.arabic{list-style-type:decimal}
ol.decimal{list-style-type:decimal-leading-zero}
ol.loweralpha{list-style-type:lower-alpha}
ol.upperalpha{list-style-type:upper-alpha}
ol.lowerroman{list-style-type:lower-roman}
ol.upperroman{list-style-type:upper-roman}
ol.lowergreek{list-style-type:lower-greek}
.hdlist>table,.colist>table{border:0;background:none}
.hdlist>table>tbody>tr,.colist>table>tbody>tr{background:none}
td.hdlist1,td.hdlist2{vertical-align:top;padding:0 .625em}
td.hdlist1{font-weight:bold;padding-bottom:1.25em}
.literalblock+.colist,.listingblock+.colist{margin-top:-.5em}
.colist>table tr>td:first-of-type{padding:.4em .75em 0 .75em;line-height:1;vertical-align:top}
.colist>table tr>td:first-of-type img{max-width:initial}
.colist>table tr>td:last-of-type{padding:.25em 0}
.thumb,.th{line-height:0;display:inline-block;border:solid 4px #fff;-webkit-box-shadow:0 0 0 1px #ddd;box-shadow:0 0 0 1px #ddd}
.imageblock.left,.imageblock[style*="float: left"]{margin:.25em .625em 1.25em 0}
.imageblock.right,.imageblock[style*="float: right"]{margin:.25em 0 1.25em .625em}
.imageblock>.title{margin-bottom:0}
.imageblock.thumb,.imageblock.th{border-width:6px}
.imageblock.thumb>.title,.imageblock.th>.title{padding:0 .125em}
.image.left,.image.right{margin-top:.25em;margin-bottom:.25em;display:inline-block;line-height:0}
.image.left{margin-right:.625em}
.image.right{margin-left:.625em}
a.image{text-decoration:none;display:inline-block}
a.image object{pointer-events:none}
sup.footnote,sup.footnoteref{font-size:.875em;position:static;vertical-align:super}
sup.footnote a,sup.footnoteref a{text-decoration:none}
sup.footnote a:active,sup.footnoteref a:active{text-decoration:underline}
#footnotes{padding-top:.75em;padding-bottom:.75em;margin-bottom:.625em}
#footnotes hr{width:20%;min-width:6.25em;margin:-.25em 0 .75em 0;border-width:1px 0 0 0}
#footnotes .footnote{padding:0 .375em 0 .225em;line-height:1.3334;font-size:.875em;margin-left:1.2em;text-indent:-1.05em;margin-bottom:.2em}
#footnotes .footnote a:first-of-type{font-weight:bold;text-decoration:none}
#footnotes .footnote:last-of-type{margin-bottom:0}
#content #footnotes{margin-top:-.625em;margin-bottom:0;padding:.75em 0}
.gist .file-data>table{border:0;background:#fff;width:100%;margin-bottom:0}
.gist .file-data>table td.line-data{width:99%}
div.unbreakable{page-break-inside:avoid}
.big{font-size:larger}
.small{font-size:smaller}
.underline{text-decoration:underline}
.overline{text-decoration:overline}
.line-through{text-decoration:line-through}
.aqua{color:#00bfbf}
.aqua-background{background-color:#00fafa}
.black{color:#000}
.black-background{background-color:#000}
.blue{color:#0000bf}
.blue-background{background-color:#0000fa}
.fuchsia{color:#bf00bf}
.fuchsia-background{background-color:#fa00fa}
.gray{color:#606060}
.gray-background{background-color:#7d7d7d}
.green{color:#006000}
.green-background{background-color:#007d00}
.lime{color:#00bf00}
.lime-background{background-color:#00fa00}
.maroon{color:#600000}
.maroon-background{background-color:#7d0000}
.navy{color:#000060}
.navy-background{background-color:#00007d}
.olive{color:#606000}
.olive-background{background-color:#7d7d00}
.purple{color:#600060}
.purple-background{background-color:#7d007d}
.red{color:#bf0000}
.red-background{background-color:#fa0000}
.silver{color:#909090}
.silver-background{background-color:#bcbcbc}
.teal{color:#006060}
.teal-background{background-color:#007d7d}
.white{color:#bfbfbf}
.white-background{background-color:#fafafa}
.yellow{color:#bfbf00}
.yellow-background{background-color:#fafa00}
span.icon>.fa{cursor:default}
a span.icon>.fa{cursor:inherit}
.admonitionblock td.icon [class^="fa icon-"]{font-size:2.5em;text-shadow:1px 1px 2px rgba(0,0,0,.5);cursor:default}
.admonitionblock td.icon .icon-note:before{content:"\f05a";color:#19407c}
.admonitionblock td.icon .icon-tip:before{content:"\f0eb";text-shadow:1px 1px 2px rgba(155,155,0,.8);color:#111}
.admonitionblock td.icon .icon-warning:before{content:"\f071";color:#bf6900}
.admonitionblock td.icon .icon-caution:before{content:"\f06d";color:#bf3400}
.admonitionblock td.icon .icon-important:before{content:"\f06a";color:#bf0000}
.conum[data-value]{display:inline-block;color:#fff!important;background-color:rgba(0,0,0,.8);-webkit-border-radius:100px;border-radius:100px;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold}
.conum[data-value] *{color:#fff!important}
.conum[data-value]+b{display:none}
.conum[data-value]:after{content:attr(data-value)}
pre .conum[data-value]{position:relative;top:-.125em}
b.conum *{color:inherit!important}
.conum:not([data-value]):empty{display:none}
dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility}
h1,h2,p,td.content,span.alt{letter-spacing:-.01em}
p strong,td.content strong,div.footnote strong{letter-spacing:-.005em}
p,blockquote,dt,td.content,span.alt{font-size:1.0625rem}
p{margin-bottom:1.25rem}
.sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em}
.exampleblock>.content{background-color:#fffef7;border-color:#e0e0dc;-webkit-box-shadow:0 1px 4px #e0e0dc;box-shadow:0 1px 4px #e0e0dc}
.print-only{display:none!important}
@media print{@page{margin:1.25cm .75cm}
*{-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:none!important}
a{color:inherit!important;text-decoration:underline!important}
a.bare,a[href^="#"],a[href^="mailto:"]{text-decoration:none!important}
a[href^="http:"]:not(.bare):after,a[href^="https:"]:not(.bare):after{content:"(" attr(href) ")";display:inline-block;font-size:.875em;padding-left:.25em}
abbr[title]:after{content:" (" attr(title) ")"}
pre,blockquote,tr,img,object,svg{page-break-inside:avoid}
thead{display:table-header-group}
svg{max-width:100%}
p,blockquote,dt,td.content{font-size:1em;orphans:3;widows:3}
h2,h3,#toctitle,.sidebarblock>.content>.title{page-break-after:avoid}
#toc,.sidebarblock,.exampleblock>.content{background:none!important}
#toc{border-bottom:1px solid #ddddd8!important;padding-bottom:0!important}
.sect1{padding-bottom:0!important}
.sect1+.sect1{border:0!important}
#header>h1:first-child{margin-top:1.25rem}
body.book #header{text-align:center}
body.book #header>h1:first-child{border:0!important;margin:2.5em 0 1em 0}
body.book #header .details{border:0!important;display:block;padding:0!important}
body.book #header .details span:first-child{margin-left:0!important}
body.book #header .details br{display:block}
body.book #header .details br+span:before{content:none!important}
body.book #toc{border:0!important;text-align:left!important;padding:0!important;margin:0!important}
body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-break-before:always}
.listingblock code[data-lang]:before{display:block}
#footer{background:none!important;padding:0 .9375em}
#footer-text{color:rgba(0,0,0,.6)!important;font-size:.9em}
.hide-on-print{display:none!important}
.print-only{display:block!important}
.hide-for-print{display:none!important}
.show-for-print{display:inherit!important}}
pre {
white-space: pre;
overflow: auto;
} | {
"content_hash": "c10d22f1df94e4541a19e56e23c9c435",
"timestamp": "",
"source": "github",
"line_count": 422,
"max_line_length": 471,
"avg_line_length": 71.17061611374407,
"alnum_prop": 0.7812479190251049,
"repo_name": "larsgrefer/joinfaces",
"id": "142f5ef506459720ec52655fefbc2de2c2f4e38b",
"size": "30655",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/docs/asciidoc/asciidoctor.css",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "30655"
},
{
"name": "HTML",
"bytes": "2112"
},
{
"name": "Java",
"bytes": "634223"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_25) on Mon Feb 02 11:00:53 CET 2015 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<title>S-Index</title>
<meta name="date" content="2015-02-02">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
<script type="text/javascript" src="../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="S-Index";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../overview-summary.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li>Use</li>
<li><a href="../overview-tree.html">Tree</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li class="navBarCell1Rev">Index</li>
<li><a href="../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="index-14.html">Prev Letter</a></li>
<li><a href="index-16.html">Next Letter</a></li>
</ul>
<ul class="navList">
<li><a href="../index.html?index-files/index-15.html" target="_top">Frames</a></li>
<li><a href="index-15.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="contentContainer"><a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">D</a> <a href="index-5.html">E</a> <a href="index-6.html">F</a> <a href="index-7.html">G</a> <a href="index-8.html">H</a> <a href="index-9.html">I</a> <a href="index-10.html">L</a> <a href="index-11.html">M</a> <a href="index-12.html">N</a> <a href="index-13.html">P</a> <a href="index-14.html">R</a> <a href="index-15.html">S</a> <a href="index-16.html">T</a> <a href="index-17.html">U</a> <a href="index-18.html">W</a> <a name="I:S">
<!-- -->
</a>
<h2 class="title">S</h2>
<dl>
<dt><span class="memberNameLink"><a href="../springapp/groupe/GroupeManager.html#save-springapp.groupe.Groupe-">save(Groupe)</a></span> - Method in class springapp.groupe.<a href="../springapp/groupe/GroupeManager.html" title="class in springapp.groupe">GroupeManager</a></dt>
<dd>
<div class="block">Redéfinition de la méthode save</div>
</dd>
<dt><span class="memberNameLink"><a href="../springapp/groupe/IGroupeManager.html#save-springapp.groupe.Groupe-">save(Groupe)</a></span> - Method in interface springapp.groupe.<a href="../springapp/groupe/IGroupeManager.html" title="interface in springapp.groupe">IGroupeManager</a></dt>
<dd>
<div class="block">Modification ou ajout d'une nouvelle personne</div>
</dd>
<dt><span class="memberNameLink"><a href="../springapp/persons/IPersonManager.html#save-springapp.persons.Person-">save(Person)</a></span> - Method in interface springapp.persons.<a href="../springapp/persons/IPersonManager.html" title="interface in springapp.persons">IPersonManager</a></dt>
<dd>
<div class="block">Modification ou ajout d'une nouvelle personne</div>
</dd>
<dt><span class="memberNameLink"><a href="../springapp/persons/PersonManager.html#save-springapp.persons.Person-">save(Person)</a></span> - Method in class springapp.persons.<a href="../springapp/persons/PersonManager.html" title="class in springapp.persons">PersonManager</a></dt>
<dd> </dd>
<dt><span class="memberNameLink"><a href="../springapp/web/AnnuaireController.html#saveGroupe-java.lang.String-java.lang.String-javax.servlet.http.HttpSession-">saveGroupe(String, String, HttpSession)</a></span> - Method in class springapp.web.<a href="../springapp/web/AnnuaireController.html" title="class in springapp.web">AnnuaireController</a></dt>
<dd>
<div class="block">Fonction permettant de mapper vers save_groupe</div>
</dd>
<dt><span class="memberNameLink"><a href="../springapp/web/AnnuaireController.html#savePerson-java.lang.String-java.lang.String-java.lang.String-java.lang.String-java.lang.String-java.lang.String-java.lang.String-java.lang.String-java.lang.String-javax.servlet.http.HttpSession-">savePerson(String, String, String, String, String, String, String, String, String, HttpSession)</a></span> - Method in class springapp.web.<a href="../springapp/web/AnnuaireController.html" title="class in springapp.web">AnnuaireController</a></dt>
<dd>
<div class="block">Fonction permettant de mapper vers save_person</div>
</dd>
<dt><span class="memberNameLink"><a href="../springapp/util/Email.html#send-java.lang.String-java.lang.String-java.lang.String-">send(String, String, String)</a></span> - Method in class springapp.util.<a href="../springapp/util/Email.html" title="class in springapp.util">Email</a></dt>
<dd>
<div class="block">Méthode permettant d'envoyer un email</div>
</dd>
<dt><span class="memberNameLink"><a href="../springapp/persons/Person.html#setBirthDate-java.util.Date-">setBirthDate(Date)</a></span> - Method in class springapp.persons.<a href="../springapp/persons/Person.html" title="class in springapp.persons">Person</a></dt>
<dd>
<div class="block">Mise à jour de la date de naissance</div>
</dd>
<dt><span class="memberNameLink"><a href="../springapp/persons/Person.html#setFirstName-java.lang.String-">setFirstName(String)</a></span> - Method in class springapp.persons.<a href="../springapp/persons/Person.html" title="class in springapp.persons">Person</a></dt>
<dd>
<div class="block">Mise à jour du prénom</div>
</dd>
<dt><span class="memberNameLink"><a href="../springapp/persons/Person.html#setGroupe-springapp.groupe.Groupe-">setGroupe(Groupe)</a></span> - Method in class springapp.persons.<a href="../springapp/persons/Person.html" title="class in springapp.persons">Person</a></dt>
<dd>
<div class="block">Mise à jour du groupe de la personne</div>
</dd>
<dt><span class="memberNameLink"><a href="../springapp/groupe/Groupe.html#setId-java.lang.String-">setId(String)</a></span> - Method in class springapp.groupe.<a href="../springapp/groupe/Groupe.html" title="class in springapp.groupe">Groupe</a></dt>
<dd>
<div class="block">Met à jour l'ID du groupe</div>
</dd>
<dt><span class="memberNameLink"><a href="../springapp/persons/Person.html#setId-java.lang.String-">setId(String)</a></span> - Method in class springapp.persons.<a href="../springapp/persons/Person.html" title="class in springapp.persons">Person</a></dt>
<dd>
<div class="block">Mise à jour de l'id de la personne</div>
</dd>
<dt><span class="memberNameLink"><a href="../springapp/persons/Person.html#setLastName-java.lang.String-">setLastName(String)</a></span> - Method in class springapp.persons.<a href="../springapp/persons/Person.html" title="class in springapp.persons">Person</a></dt>
<dd>
<div class="block">Mise à jour du nom de famille</div>
</dd>
<dt><span class="memberNameLink"><a href="../springapp/persons/Person.html#setMail-java.lang.String-">setMail(String)</a></span> - Method in class springapp.persons.<a href="../springapp/persons/Person.html" title="class in springapp.persons">Person</a></dt>
<dd>
<div class="block">Mise à jour du mail</div>
</dd>
<dt><span class="memberNameLink"><a href="../springapp/groupe/Groupe.html#setName-java.lang.String-">setName(String)</a></span> - Method in class springapp.groupe.<a href="../springapp/groupe/Groupe.html" title="class in springapp.groupe">Groupe</a></dt>
<dd>
<div class="block">Met à jour le nom du groupe</div>
</dd>
<dt><span class="memberNameLink"><a href="../springapp/persons/Person.html#setPassword-java.lang.String-">setPassword(String)</a></span> - Method in class springapp.persons.<a href="../springapp/persons/Person.html" title="class in springapp.persons">Person</a></dt>
<dd>
<div class="block">Mise à jour du mot de passe</div>
</dd>
<dt><span class="memberNameLink"><a href="../springapp/util/PasswordUtils.html#setPassword-java.lang.String-">setPassword(String)</a></span> - Method in class springapp.util.<a href="../springapp/util/PasswordUtils.html" title="class in springapp.util">PasswordUtils</a></dt>
<dd>
<div class="block">Met à jour le mot de passe</div>
</dd>
<dt><span class="memberNameLink"><a href="../springapp/groupe/Groupe.html#setPersons-java.util.Set-">setPersons(Set<Person>)</a></span> - Method in class springapp.groupe.<a href="../springapp/groupe/Groupe.html" title="class in springapp.groupe">Groupe</a></dt>
<dd>
<div class="block">Met à jour la liste des personnes appartenant au groupe</div>
</dd>
<dt><span class="memberNameLink"><a href="../springapp/persons/Person.html#setWebsite-java.lang.String-">setWebsite(String)</a></span> - Method in class springapp.persons.<a href="../springapp/persons/Person.html" title="class in springapp.persons">Person</a></dt>
<dd>
<div class="block">Mise à jour du site internet d'une personne</div>
</dd>
<dt><a href="../springapp/groupe/package-summary.html">springapp.groupe</a> - package springapp.groupe</dt>
<dd> </dd>
<dt><a href="../springapp/persons/package-summary.html">springapp.persons</a> - package springapp.persons</dt>
<dd> </dd>
<dt><a href="../springapp/util/package-summary.html">springapp.util</a> - package springapp.util</dt>
<dd> </dd>
<dt><a href="../springapp/web/package-summary.html">springapp.web</a> - package springapp.web</dt>
<dd> </dd>
</dl>
<a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">D</a> <a href="index-5.html">E</a> <a href="index-6.html">F</a> <a href="index-7.html">G</a> <a href="index-8.html">H</a> <a href="index-9.html">I</a> <a href="index-10.html">L</a> <a href="index-11.html">M</a> <a href="index-12.html">N</a> <a href="index-13.html">P</a> <a href="index-14.html">R</a> <a href="index-15.html">S</a> <a href="index-16.html">T</a> <a href="index-17.html">U</a> <a href="index-18.html">W</a> </div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../overview-summary.html">Overview</a></li>
<li>Package</li>
<li>Class</li>
<li>Use</li>
<li><a href="../overview-tree.html">Tree</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li class="navBarCell1Rev">Index</li>
<li><a href="../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="index-14.html">Prev Letter</a></li>
<li><a href="index-16.html">Next Letter</a></li>
</ul>
<ul class="navList">
<li><a href="../index.html?index-files/index-15.html" target="_top">Frames</a></li>
<li><a href="index-15.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| {
"content_hash": "b6f704894949d5d5ac96ddd2774f2605",
"timestamp": "",
"source": "github",
"line_count": 210,
"max_line_length": 665,
"avg_line_length": 58.357142857142854,
"alnum_prop": 0.6878008975928193,
"repo_name": "Kotylive13/Annuaire",
"id": "212606ff1510281057bba95b05fd50a26456c438",
"size": "12271",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Annuaire/javadocs/index-files/index-15.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "22134"
},
{
"name": "HTML",
"bytes": "571958"
},
{
"name": "Java",
"bytes": "61783"
},
{
"name": "JavaScript",
"bytes": "5887"
}
],
"symlink_target": ""
} |
package com.ss.dw.mrshell.log;
import com.ss.dw.mrshell.annotation.AKVLog;
import com.ss.dw.mrshell.log.ILog;
@AKVLog
public class KVLog implements ILog {
public boolean isValid()
{
return true;
}
public String getSeperator()
{
return "&";
}
}
| {
"content_hash": "386eb1e7881753a05004c809cfcbb324",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 43,
"avg_line_length": 15.38888888888889,
"alnum_prop": 0.6606498194945848,
"repo_name": "nonggia/mrshell",
"id": "055f97a532a00a67d02da53094566b9e0f566e76",
"size": "277",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/ss/dw/mrshell/log/KVLog.java",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "134117"
}
],
"symlink_target": ""
} |
Before deploying the template you must have the following
1. **Data Factory.** The gateway is created in the data factory. If you don't have a data factory, see the [Create data factory](https://docs.microsoft.com/en-us/azure/data-factory/data-factory-move-data-between-onprem-and-cloud#create-data-factory) for steps to create one.
2. **Virtual Network.** The virtual machine will join this VNET. If you don't have one, use this tutorial, see [Create virtual network](https://docs.microsoft.com/en-us/azure/virtual-network/virtual-networks-create-vnet-arm-pportal#create-a-virtual-network) to create one.
<a href="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FxiaoyingLJ%2Fazure-quickstart-templates%2Fmaster%2F101-vm-with-data-management-gateway%2Fazuredeploy.json" target="_blank">
<img src="http://azuredeploy.net/deploybutton.png"/>
</a>
<a href="http://armviz.io/#/?load=https%3A%2F%2Fraw.githubusercontent.com%2FxiaoyingLJ%2Fazure-quickstart-templates%2Fmaster%2F101-vm-with-data-management-gateway%2Fazuredeploy.json" target="_blank">
<img src="http://armviz.io/visualizebutton.png"/>
</a>
When you deploy this Azure Resource Template, you will create a logical gateway in your data factory and the following resources
- Azure Virtual Machine
- Azure Storage (for VM system image and boot diagnostic)
- Public IP Address
- Network Interface
- Network Sercurity Group
This template can help you create a gateway and make it workable in azure VM. The VM must join in an exsiting VNET. You will see the new gateway is online after successful deployment.

```
NOTE
This template must be deployed in the same resource group with data factory.
```
## Sample

| {
"content_hash": "7928bb83dc5c85c1b246f5d1b4a74c3d",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 275,
"avg_line_length": 56.34375,
"alnum_prop": 0.776483638380477,
"repo_name": "cerdmann-pivotal/azure-quickstart-templates",
"id": "680046fe931148b7d8eebb0e2c233813d33d1372",
"size": "1876",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "101-vm-with-data-management-gateway/README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "1561"
},
{
"name": "CSS",
"bytes": "11452"
},
{
"name": "Groovy",
"bytes": "1692"
},
{
"name": "HTML",
"bytes": "2259"
},
{
"name": "JavaScript",
"bytes": "35720"
},
{
"name": "PHP",
"bytes": "645"
},
{
"name": "Perl",
"bytes": "19078"
},
{
"name": "PowerShell",
"bytes": "687507"
},
{
"name": "Python",
"bytes": "256946"
},
{
"name": "Shell",
"bytes": "1004487"
},
{
"name": "XSLT",
"bytes": "4424"
}
],
"symlink_target": ""
} |
typedef struct {
double x, y, z;
} vector3;
void
v3_initialize (vector3 *dest, const double x, const double y, const double z);
void
v3_sum (vector3 *dest, const vector3 *v1, const vector3 *v2);
void
v3_difference (vector3 *dest, const vector3 *v1, const vector3 *v2);
void
v3_scaled (vector3 *dest, const double s, const vector3 *src);
void
v3_add (vector3 *dest, const vector3 *v);
void
v3_subtract (vector3 *dest, const vector3 *v);
void
v3_scale (vector3 *dest, const double s);
void
v3_invert (vector3 *v);
void
v3_reverse (vector3 *v);
void
v3_sum_scaled (vector3 *dest, const vector3 *v1,
const double s, const vector3 *v2);
void
v3_add_scaled (vector3 *dest, const double s, const vector3 *v);
double
v3_length (const vector3 *v);
double
v3_angle (const vector3 *v1, const vector3 *v2);
double
v3_angle_points (const vector3 *p1, const vector3 *p2, const vector3 *p3);
double
v3_torsion (const vector3 *p1, const vector3 *v1,
const vector3 *p2, const vector3 *v2);
double
v3_torsion_points (const vector3 *p1, const vector3 *p2,
const vector3 *p3, const vector3 *p4);
double
v3_dot_product (const vector3 *v1, const vector3 *v2);
void
v3_cross_product (vector3 *vz, const vector3 *vx, const vector3 *vy);
void
v3_triangle_normal (vector3 *n,
const vector3 *p1, const vector3 *p2, const vector3 *p3);
double
v3_sqdistance (const vector3 *p1, const vector3 *p2);
double
v3_distance (const vector3 *p1, const vector3 *p2);
boolean
v3_close (const vector3 *v1, const vector3 *v2, const double sqdistance);
void
v3_normalize (vector3 *v);
void
v3_middle (vector3 *dest, const vector3 *p1, const vector3 *p2);
void
v3_between (vector3 *dest,
const vector3 *p1, const vector3 *p2, const double fraction);
int
v3_different (const vector3 *v1, const vector3 *v2);
#endif
| {
"content_hash": "e585b31b1566c6568e01503d1cbcb236",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 78,
"avg_line_length": 20.772727272727273,
"alnum_prop": 0.7117067833698031,
"repo_name": "pekrau/MolScript",
"id": "aba970e6e9583cecb482154821610fe7a86bbf94",
"size": "1889",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "code/clib/vector3.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "800256"
},
{
"name": "Makefile",
"bytes": "2087"
},
{
"name": "Yacc",
"bytes": "17099"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<entity name="Neikeq\ClubsBundle\Entity\ClubMembers" repository-class="Neikeq\ClubsBundle\Entity\ClubMembersRepository" table="club_members">
<id name="id" type="integer" column="id"></id>
<field name="clubId" type="integer" column="club_id" nullable="false"/>
<field name="role" type="string" column="role" nullable="false"/>
<field name="backNumber" type="smallint" column="back_number" nullable="true"/>
</entity>
</doctrine-mapping>
| {
"content_hash": "aa0628ef6504da98c7a6c6891f4c0029",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 276,
"avg_line_length": 85.88888888888889,
"alnum_prop": 0.7386804657179818,
"repo_name": "neikeq/KicksClubs",
"id": "f7f09a4937c028ee4ca7507c30ab34f63f7a9c85",
"size": "773",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Neikeq/ClubsBundle/Resources/config/doctrine/ClubMembers.orm.xml",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "3297"
},
{
"name": "CSS",
"bytes": "22611"
},
{
"name": "JavaScript",
"bytes": "63864"
},
{
"name": "PHP",
"bytes": "238453"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace MCTuristic_Centro_Historico.MasterPage
{
public partial class PaginaPrincipal : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
} | {
"content_hash": "91d07b1a4fbb4d6b30962dc9c72bf336",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 67,
"avg_line_length": 20.88235294117647,
"alnum_prop": 0.7126760563380282,
"repo_name": "JoseLuisPucChan/Proyecto4Cuatrimestre",
"id": "57f737e1aacc780d56b91e94a1e91d300e987600",
"size": "357",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Prácticas/MCTuristic_Centro_Historico/MCTuristic_Centro_Historico/MasterPage/PaginaPrincipal.Master.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "586832"
},
{
"name": "C#",
"bytes": "812479"
},
{
"name": "CSS",
"bytes": "1237225"
},
{
"name": "HTML",
"bytes": "6193174"
},
{
"name": "JavaScript",
"bytes": "3865649"
},
{
"name": "SQLPL",
"bytes": "4339"
}
],
"symlink_target": ""
} |
#ifndef __Lib_RandomBuffer_System_H
#define __Lib_RandomBuffer_System_H
#if defined(__cplusplus)
extern "C" {
#endif
#include "libintvector.h"
#include "kremlin/internal/types.h"
#include "kremlin/lowstar_endianness.h"
#include <string.h>
#include "kremlin/internal/target.h"
KRML_DEPRECATED("random_crypto")
extern bool Lib_RandomBuffer_System_randombytes(u8 *buf, u32 len);
extern void *Lib_RandomBuffer_System_entropy_p;
extern void Lib_RandomBuffer_System_crypto_random(u8 *buf, u32 len);
#if defined(__cplusplus)
}
#endif
#define __Lib_RandomBuffer_System_H_DEFINED
#endif
| {
"content_hash": "a055bb56f47d694a53924c687a328156",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 68,
"avg_line_length": 17.939393939393938,
"alnum_prop": 0.75,
"repo_name": "mitls/hacl-star",
"id": "447435deb17a6ff560795fb42b20810b61e4b291",
"size": "1752",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dist/linux/Lib_RandomBuffer_System.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "12015304"
},
{
"name": "C",
"bytes": "9460410"
},
{
"name": "C++",
"bytes": "3423390"
},
{
"name": "CMake",
"bytes": "8882"
},
{
"name": "Coq",
"bytes": "117156"
},
{
"name": "Emacs Lisp",
"bytes": "13769"
},
{
"name": "Fortran",
"bytes": "2267"
},
{
"name": "GDB",
"bytes": "1201"
},
{
"name": "HTML",
"bytes": "75321"
},
{
"name": "HiveQL",
"bytes": "189959"
},
{
"name": "Lex",
"bytes": "2858"
},
{
"name": "M4",
"bytes": "419732"
},
{
"name": "Makefile",
"bytes": "1006434"
},
{
"name": "OCaml",
"bytes": "341155"
},
{
"name": "Objective-C",
"bytes": "118915"
},
{
"name": "PHP",
"bytes": "1696"
},
{
"name": "Perl",
"bytes": "125238"
},
{
"name": "Perl 6",
"bytes": "33053"
},
{
"name": "Python",
"bytes": "21514"
},
{
"name": "Rust",
"bytes": "14704"
},
{
"name": "SMT",
"bytes": "28402"
},
{
"name": "Shell",
"bytes": "544938"
},
{
"name": "Standard ML",
"bytes": "29676"
},
{
"name": "TeX",
"bytes": "323102"
},
{
"name": "XS",
"bytes": "72638"
},
{
"name": "Yacc",
"bytes": "11479"
},
{
"name": "q",
"bytes": "146050"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%-5level] %logger{15} - %msg%n%rEx</pattern>
</encoder>
<immediateFlush>false</immediateFlush>
</appender>
<!-- Uncomment for logging ALL HTTP request and responses -->
<!-- <logger name="io.gatling.http.ahc" level="TRACE" /> -->
<!-- <logger name="io.gatling.http.response" level="TRACE" /> -->
<!-- Uncomment for logging ONLY FAILED HTTP request and responses -->
<logger name="io.gatling.http.ahc" level="DEBUG"/>
<logger name="io.gatling.http.response" level="DEBUG"/>
<root level="WARN">
<appender-ref ref="CONSOLE"/>
</root>
</configuration>
| {
"content_hash": "8de25aaab660df70a4dafb8bd1d755ec",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 77,
"avg_line_length": 34.54545454545455,
"alnum_prop": 0.65,
"repo_name": "danveloper/clouddriver",
"id": "627deed75ca5648dc08b9bb4ea3c82133fb9b8c2",
"size": "760",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "clouddriver-loadtest/src/main/resources/logback.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Groovy",
"bytes": "7866063"
},
{
"name": "HTML",
"bytes": "627"
},
{
"name": "Java",
"bytes": "711790"
},
{
"name": "Scala",
"bytes": "8386"
},
{
"name": "Shell",
"bytes": "2762"
}
],
"symlink_target": ""
} |
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.psi.formatter;
import com.intellij.codeInsight.CodeInsightBundle;
import com.intellij.codeInsight.actions.ReformatCodeProcessor;
import com.intellij.lang.ASTFactory;
import com.intellij.lang.ASTNode;
import com.intellij.lang.Language;
import com.intellij.openapi.command.CommandProcessor;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.PsiElement;
import com.intellij.psi.TokenType;
import com.intellij.psi.impl.source.SourceTreeToPsiMap;
import com.intellij.psi.impl.source.tree.*;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.tree.TokenSet;
import com.intellij.util.CharTable;
import com.intellij.util.containers.ContainerUtilRt;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collection;
import java.util.Collections;
public class FormatterUtil {
public static final String REFORMAT_BEFORE_COMMIT_COMMAND_NAME = CodeInsightBundle.message("process.reformat.code.before.commit");
public static final Collection<String> FORMATTER_ACTION_NAMES = Collections.unmodifiableCollection(ContainerUtilRt.newHashSet(
ReformatCodeProcessor.COMMAND_NAME, REFORMAT_BEFORE_COMMIT_COMMAND_NAME
));
private FormatterUtil() {
}
public static boolean isWhitespaceOrEmpty(@Nullable ASTNode node) {
if (node == null) return false;
IElementType type = node.getElementType();
return type == TokenType.WHITE_SPACE || (type != TokenType.ERROR_ELEMENT && node.getTextLength() == 0);
}
public static boolean isOneOf(@Nullable ASTNode node, @NotNull IElementType... types) {
if (node == null) return false;
IElementType elementType = node.getElementType();
for (IElementType each : types) {
if (elementType == each) return true;
}
return false;
}
@Nullable
public static ASTNode getPrevious(@Nullable ASTNode node, @NotNull IElementType... typesToIgnore) {
return getNextOrPrevious(node, false, typesToIgnore);
}
@Nullable
public static ASTNode getNext(@Nullable ASTNode node, @NotNull IElementType... typesToIgnore) {
return getNextOrPrevious(node, true, typesToIgnore);
}
@Nullable
private static ASTNode getNextOrPrevious(@Nullable ASTNode node, boolean isNext, @NotNull IElementType... typesToIgnore) {
if (node == null) return null;
ASTNode each = isNext ? node.getTreeNext() : node.getTreePrev();
ASTNode parent = node.getTreeParent();
while (each == null && parent != null) {
each = isNext ? parent.getTreeNext() : parent.getTreePrev();
parent = parent.getTreeParent();
}
if (each == null) {
return null;
}
for (IElementType type : typesToIgnore) {
if (each.getElementType() == type) {
return getNextOrPrevious(each, isNext, typesToIgnore);
}
}
return each;
}
@Nullable
public static ASTNode getPreviousLeaf(@Nullable ASTNode node, @NotNull IElementType... typesToIgnore) {
ASTNode prev = getPrevious(node, typesToIgnore);
if (prev == null) {
return null;
}
ASTNode result = prev;
ASTNode lastChild = prev.getLastChildNode();
while (lastChild != null) {
result = lastChild;
lastChild = lastChild.getLastChildNode();
}
for (IElementType type : typesToIgnore) {
if (result.getElementType() == type) {
return getPreviousLeaf(result, typesToIgnore);
}
}
return result;
}
@Nullable
public static ASTNode getPreviousNonWhitespaceLeaf(@Nullable ASTNode node) {
if (node == null) return null;
ASTNode treePrev = node.getTreePrev();
if (treePrev != null) {
ASTNode candidate = TreeUtil.getLastChild(treePrev);
if (candidate != null && !isWhitespaceOrEmpty(candidate)) {
return candidate;
}
else {
return getPreviousNonWhitespaceLeaf(candidate);
}
}
final ASTNode treeParent = node.getTreeParent();
if (treeParent == null || treeParent.getTreeParent() == null) {
return null;
}
else {
return getPreviousNonWhitespaceLeaf(treeParent);
}
}
@Nullable
public static ASTNode getNextNonWhitespaceLeaf(@Nullable ASTNode node) {
if (node == null) return null;
ASTNode treeNext = node.getTreeNext();
if (treeNext != null) {
ASTNode candidate = TreeUtil.findFirstLeaf(treeNext);
if (candidate != null && !isWhitespaceOrEmpty(candidate)) {
return candidate;
}
else {
return getNextNonWhitespaceLeaf(candidate);
}
}
final ASTNode treeParent = node.getTreeParent();
if (treeParent == null || treeParent.getTreeParent() == null) {
return null;
}
else {
return getNextNonWhitespaceLeaf(treeParent);
}
}
@Nullable
public static ASTNode getPreviousNonWhitespaceSibling(@Nullable ASTNode node) {
ASTNode prevNode = node == null ? null : node.getTreePrev();
while (prevNode != null && isWhitespaceOrEmpty(prevNode)) {
prevNode = prevNode.getTreePrev();
}
return prevNode;
}
@Nullable
public static ASTNode getNextNonWhitespaceSibling(@Nullable ASTNode node) {
ASTNode next = node == null ? null : node.getTreeNext();
while (next != null && isWhitespaceOrEmpty(next)) {
next = next.getTreeNext();
}
return next;
}
public static boolean isPrecededBy(@Nullable ASTNode node, IElementType expectedType) {
return isPrecededBy(node, expectedType, IElementType.EMPTY_ARRAY);
}
public static boolean isPrecededBy(@Nullable ASTNode node, IElementType expectedType, TokenSet skipTypes) {
return isPrecededBy(node, expectedType, skipTypes.getTypes());
}
public static boolean isPrecededBy(@Nullable ASTNode node, IElementType expectedType, IElementType... skipTypes) {
ASTNode prevNode = node == null ? null : node.getTreePrev();
while (prevNode != null && (isWhitespaceOrEmpty(prevNode) || isOneOf(prevNode, skipTypes))) {
prevNode = prevNode.getTreePrev();
}
if (prevNode == null) return false;
return prevNode.getElementType() == expectedType;
}
public static boolean isPrecededBy(@Nullable ASTNode node, TokenSet expectedTypes) {
return isPrecededBy(node, expectedTypes, IElementType.EMPTY_ARRAY);
}
public static boolean isPrecededBy(@Nullable ASTNode node, TokenSet expectedTypes, TokenSet skipTypes) {
return isPrecededBy(node, expectedTypes, skipTypes.getTypes());
}
public static boolean isPrecededBy(@Nullable ASTNode node, TokenSet expectedTypes, IElementType... skipTypes) {
ASTNode prevNode = node == null ? null : node.getTreePrev();
while (prevNode != null && (isWhitespaceOrEmpty(prevNode) || isOneOf(prevNode, skipTypes))) {
prevNode = prevNode.getTreePrev();
}
if (prevNode == null) return false;
return expectedTypes.contains(prevNode.getElementType());
}
public static boolean hasPrecedingSiblingOfType(@Nullable ASTNode node, IElementType expectedSiblingType, IElementType... skipTypes) {
for (ASTNode prevNode = node == null ? null : node.getTreePrev(); prevNode != null; prevNode = prevNode.getTreePrev()) {
if (isWhitespaceOrEmpty(prevNode) || isOneOf(prevNode, skipTypes)) continue;
if (prevNode.getElementType() == expectedSiblingType) return true;
}
return false;
}
public static boolean isFollowedBy(@Nullable ASTNode node, IElementType expectedType) {
return isFollowedBy(node, expectedType, IElementType.EMPTY_ARRAY);
}
public static boolean isFollowedBy(@Nullable ASTNode node, IElementType expectedType, TokenSet skipTypes) {
return isFollowedBy(node, expectedType, skipTypes.getTypes());
}
public static boolean isFollowedBy(@Nullable ASTNode node, IElementType expectedType, IElementType... skipTypes) {
ASTNode nextNode = node == null ? null : node.getTreeNext();
while (nextNode != null && (isWhitespaceOrEmpty(nextNode) || isOneOf(nextNode, skipTypes))) {
nextNode = nextNode.getTreeNext();
}
if (nextNode == null) return false;
return nextNode.getElementType() == expectedType;
}
public static boolean isFollowedBy(@Nullable ASTNode node, @NotNull TokenSet expectedTypes, TokenSet skipTypes) {
return isFollowedBy(node, expectedTypes, skipTypes.getTypes());
}
public static boolean isFollowedBy(@Nullable ASTNode node, @NotNull TokenSet expectedTypes, IElementType... skipTypes) {
ASTNode nextNode = node == null ? null : node.getTreeNext();
while (nextNode != null && (isWhitespaceOrEmpty(nextNode) || isOneOf(nextNode, skipTypes))) {
nextNode = nextNode.getTreeNext();
}
if (nextNode == null) return false;
return expectedTypes.contains(nextNode.getElementType());
}
public static boolean isIncomplete(@Nullable ASTNode node) {
ASTNode lastChild = node == null ? null : node.getLastChildNode();
while (lastChild != null && lastChild.getElementType() == TokenType.WHITE_SPACE) {
lastChild = lastChild.getTreePrev();
}
if (lastChild == null) return false;
if (lastChild.getElementType() == TokenType.ERROR_ELEMENT) return true;
return isIncomplete(lastChild);
}
public static boolean containsWhiteSpacesOnly(@Nullable ASTNode node) {
if (node == null) return false;
final boolean[] spacesOnly = {true};
((TreeElement)node).acceptTree(new RecursiveTreeElementWalkingVisitor() {
@Override
public void visitComposite(CompositeElement composite) {
if (!spacesOnly(composite)) {
super.visitComposite(composite);
}
}
@Override
public void visitLeaf(LeafElement leaf) {
if (!spacesOnly(leaf)) {
spacesOnly[0] = false;
stopWalking();
}
}
});
return spacesOnly[0];
}
private static boolean spacesOnly(@Nullable TreeElement node) {
if (node == null) return false;
if (isWhitespaceOrEmpty(node)) return true;
PsiElement psi = node.getPsi();
if (psi == null) {
return false;
}
Language language = psi.getLanguage();
return WhiteSpaceFormattingStrategyFactory.getStrategy(language).containsWhitespacesOnly(node);
}
/**
* There is a possible case that we want to adjust white space which is not represented at the AST/PSI tree, e.g.
* we might have a multiline comment which uses tabs for inner lines indents and want to replace them by spaces.
* There is no white space element then, the only leaf is the comment itself.
* <p/>
* This method allows such 'inner element modifications', i.e. it receives information on what new text should be used
* at the target inner element range and performs corresponding replacement by generating new leaf with adjusted text
* and replacing the old one by it.
*
* @param newWhiteSpaceText new text to use at the target inner element range
* @param holder target range holder
* @param whiteSpaceRange target range which text should be replaced by the given one
*/
public static void replaceInnerWhiteSpace(@NotNull final String newWhiteSpaceText,
@NotNull final ASTNode holder,
@NotNull final TextRange whiteSpaceRange)
{
final CharTable charTable = SharedImplUtil.findCharTableByTree(holder);
StringBuilder newText = createNewLeafChars(holder, whiteSpaceRange, newWhiteSpaceText);
LeafElement newElement =
Factory.createSingleLeafElement(holder.getElementType(), newText, charTable, holder.getPsi().getManager());
holder.getTreeParent().replaceChild(holder, newElement);
}
public static void replaceWhiteSpace(final String whiteSpace,
final ASTNode leafElement,
final IElementType whiteSpaceToken,
@Nullable final TextRange textRange) {
final CharTable charTable = SharedImplUtil.findCharTableByTree(leafElement);
if (textRange != null && textRange.getStartOffset() > leafElement.getTextRange().getStartOffset() &&
textRange.getEndOffset() < leafElement.getTextRange().getEndOffset()) {
replaceInnerWhiteSpace(whiteSpace, leafElement, textRange);
return;
}
ASTNode treePrev = findPreviousWhiteSpace(leafElement, whiteSpaceToken);
if (treePrev == null) {
treePrev = getWsCandidate(leafElement);
}
if (treePrev != null &&
treePrev.getText().trim().isEmpty() &&
treePrev.getElementType() != whiteSpaceToken &&
treePrev.getTextLength() > 0 &&
!whiteSpace.isEmpty()) {
LeafElement whiteSpaceElement =
Factory.createSingleLeafElement(treePrev.getElementType(), whiteSpace, charTable, SharedImplUtil.getManagerByTree(leafElement));
ASTNode treeParent = treePrev.getTreeParent();
treeParent.replaceChild(treePrev, whiteSpaceElement);
}
else {
LeafElement whiteSpaceElement =
Factory.createSingleLeafElement(whiteSpaceToken, whiteSpace, charTable, SharedImplUtil.getManagerByTree(leafElement));
if (treePrev == null) {
if (!whiteSpace.isEmpty()) {
addWhiteSpace(leafElement, whiteSpaceElement);
}
}
else {
if (!(treePrev.getElementType() == whiteSpaceToken)) {
if (!whiteSpace.isEmpty()) {
addWhiteSpace(treePrev, whiteSpaceElement);
}
}
else {
if (treePrev.getElementType() == whiteSpaceToken) {
final CompositeElement treeParent = (CompositeElement)treePrev.getTreeParent();
if (!whiteSpace.isEmpty()) {
// LOG.assertTrue(textRange == null || treeParent.getTextRange().equals(textRange));
treeParent.replaceChild(treePrev, whiteSpaceElement);
}
else {
treeParent.removeChild(treePrev);
}
// There is a possible case that more than one PSI element is matched by the target text range.
// That is the case, for example, for Python's multi-line expression. It may looks like below:
// import contextlib,\
// math, decimal
// Here single range contains two blocks: '\' & '\n '. So, we may want to replace that range to another text, hence,
// we replace last element located there with it ('\n ') and want to remove any remaining elements ('\').
ASTNode removeCandidate = findPreviousWhiteSpace(whiteSpaceElement, whiteSpaceToken);
while (textRange != null && removeCandidate != null && removeCandidate.getStartOffset() >= textRange.getStartOffset()) {
treePrev = findPreviousWhiteSpace(removeCandidate, whiteSpaceToken);
removeCandidate.getTreeParent().removeChild(removeCandidate);
removeCandidate = treePrev;
}
//treeParent.subtreeChanged();
}
}
}
}
}
@Nullable
private static ASTNode findPreviousWhiteSpace(final ASTNode leafElement, final IElementType whiteSpaceTokenType) {
final int offset = leafElement.getTextRange().getStartOffset() - 1;
if (offset < 0) return null;
final PsiElement psiElement = SourceTreeToPsiMap.treeElementToPsi(leafElement);
if (psiElement == null) {
return null;
}
final PsiElement found = psiElement.getContainingFile().findElementAt(offset);
if (found == null) return null;
final ASTNode treeElement = found.getNode();
if (treeElement != null && treeElement.getElementType() == whiteSpaceTokenType) return treeElement;
return null;
}
@Nullable
private static ASTNode getWsCandidate(@Nullable ASTNode node) {
if (node == null) return null;
ASTNode treePrev = node.getTreePrev();
if (treePrev != null) {
if (treePrev.getElementType() == TokenType.WHITE_SPACE) {
return treePrev;
}
else if (treePrev.getTextLength() == 0 && isSpaceBeforeEmptyElement(treePrev)) {
return getWsCandidate(treePrev);
}
else {
return node;
}
}
final ASTNode treeParent = node.getTreeParent();
if (treeParent == null || treeParent.getTreeParent() == null) {
return node;
}
else {
return getWsCandidate(treeParent);
}
}
private static boolean isSpaceBeforeEmptyElement(ASTNode node) {
if (node.getElementType().isLeftBound()) {
final ASTNode parent = node.getTreeParent();
return parent != null && parent.getFirstChildNode() == node;
}
return true;
}
private static StringBuilder createNewLeafChars(final ASTNode leafElement, final TextRange textRange, final String whiteSpace) {
final TextRange elementRange = leafElement.getTextRange();
final String elementText = leafElement.getText();
final StringBuilder result = new StringBuilder();
if (elementRange.getStartOffset() < textRange.getStartOffset()) {
result.append(elementText, 0, textRange.getStartOffset() - elementRange.getStartOffset());
}
result.append(whiteSpace);
if (elementRange.getEndOffset() > textRange.getEndOffset()) {
result.append(elementText.substring(textRange.getEndOffset() - elementRange.getStartOffset()));
}
return result;
}
private static void addWhiteSpace(final ASTNode treePrev, final LeafElement whiteSpaceElement) {
for (WhiteSpaceFormattingStrategy strategy : WhiteSpaceFormattingStrategyFactory.getAllStrategies()) {
if (strategy.addWhitespace(treePrev, whiteSpaceElement)) {
return;
}
}
final ASTNode treeParent = treePrev.getTreeParent();
treeParent.addChild(whiteSpaceElement, treePrev);
}
public static void replaceLastWhiteSpace(final ASTNode astNode, final String whiteSpace, final TextRange textRange) {
ASTNode lastWS = TreeUtil.findLastLeaf(astNode);
if (lastWS == null) {
return;
}
if (lastWS.getElementType() != TokenType.WHITE_SPACE) {
lastWS = null;
}
if (lastWS != null && !lastWS.getTextRange().equals(textRange)) {
return;
}
if (whiteSpace.isEmpty() && lastWS == null) {
return;
}
if (lastWS != null && whiteSpace.isEmpty()) {
lastWS.getTreeParent().removeRange(lastWS, null);
return;
}
LeafElement whiteSpaceElement = ASTFactory.whitespace(whiteSpace);
if (lastWS == null) {
astNode.addChild(whiteSpaceElement, null);
}
else {
ASTNode treeParent = lastWS.getTreeParent();
treeParent.replaceChild(lastWS, whiteSpaceElement);
}
}
/**
* @return {@code true} explicitly called 'reformat' is in progress at the moment; {@code false} otherwise
*/
public static boolean isFormatterCalledExplicitly() {
return FORMATTER_ACTION_NAMES.contains(CommandProcessor.getInstance().getCurrentCommandName());
}
}
| {
"content_hash": "ab833726e3d9b616e01fec864c87edf5",
"timestamp": "",
"source": "github",
"line_count": 501,
"max_line_length": 140,
"avg_line_length": 37.93213572854292,
"alnum_prop": 0.6867501578615028,
"repo_name": "paplorinc/intellij-community",
"id": "a5be125d704fd15f2fcf99de0c05d897beb58ff1",
"size": "19004",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "platform/lang-impl/src/com/intellij/psi/formatter/FormatterUtil.java",
"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>rsa: 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.9.0 / rsa - 8.7.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
rsa
<small>
8.7.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-11-25 09:17:08 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-11-25 09:17:08 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-ocamlbuild base OCamlbuild binary and libraries 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.9.0 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.02.3 The OCaml compiler (virtual package)
ocaml-base-compiler 4.02.3 Official 4.02.3 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.5 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "Hugo.Herbelin@inria.fr"
homepage: "https://github.com/coq-contribs/rsa"
license: "LGPL 2.1"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/RSA"]
depends: [
"ocaml"
"coq" {>= "8.7" & < "8.8~"}
]
tags: [ "keyword: RSA" "keyword: Chinese remainder" "keyword: Fermat's little theorem" "category: Computer Science/Decision Procedures and Certified Algorithms/Correctness proofs of algorithms" "date: 1999" ]
authors: [ "Jose C. Almeida" "Laurent Théry" ]
bug-reports: "https://github.com/coq-contribs/rsa/issues"
dev-repo: "git+https://github.com/coq-contribs/rsa.git"
synopsis: "Correctness of RSA algorithm"
description: """
This directory contains the proof of correctness
of RSA algorithm. It contains a proof of Fermat's little theorem"""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/rsa/archive/v8.7.0.tar.gz"
checksum: "md5=7ab030c21927c577c7e18a1b4bb54943"
}
</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-rsa.8.7.0 coq.8.9.0</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.9.0).
The following dependencies couldn't be met:
- coq-rsa -> coq < 8.8~ -> ocaml < 4.02.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-rsa.8.7.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "7aec55b174df68e9e4f49318c63b19f8",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 262,
"avg_line_length": 42.69047619047619,
"alnum_prop": 0.5465699944227551,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "d571de2177a6b4701fa4af7b783f33394d835123",
"size": "7198",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.02.3-2.0.6/released/8.9.0/rsa/8.7.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
{% extends "registration/base.html" %}
{% block title %}Password change completed - {{ block.super }}{% endblock title %}
{% block section_title %}
Change password
{% endblock section_title %}
{% block section %}
<p>Your password has been updated.</p>
{% endblock section %}
| {
"content_hash": "83fc823a0a14564bb97cde3341e2e23e",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 82,
"avg_line_length": 21.53846153846154,
"alnum_prop": 0.675,
"repo_name": "us-ignite/us_ignite",
"id": "c9e4177fad21901283d2fbef5ae8b59c01ae1c48",
"size": "280",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "us_ignite/templates/registration/password_change_done.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "590320"
},
{
"name": "HTML",
"bytes": "920235"
},
{
"name": "JavaScript",
"bytes": "109759"
},
{
"name": "Nginx",
"bytes": "3047"
},
{
"name": "Pascal",
"bytes": "48"
},
{
"name": "Puppet",
"bytes": "53455"
},
{
"name": "Python",
"bytes": "1321882"
},
{
"name": "Ruby",
"bytes": "370509"
},
{
"name": "Shell",
"bytes": "63"
}
],
"symlink_target": ""
} |
// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @fileoverview A drop-down menu in the ChromeVox panel.
*/
import {BackgroundBridge} from '../common/background_bridge.js';
import {BridgeCallbackManager} from '../common/bridge_callback_manager.js';
import {Msgs} from '../common/msgs.js';
import {PanelNodeMenuItemData} from '../common/panel_menu_data.js';
import {PanelMenuItem} from './panel_menu_item.js';
export class PanelMenu {
/**
* @param {string} menuMsg The msg id of the menu.
*/
constructor(menuMsg) {
/** @type {string} */
this.menuMsg = menuMsg;
// The item in the menu bar containing the menu's title.
this.menuBarItemElement = document.createElement('div');
this.menuBarItemElement.className = 'menu-bar-item';
this.menuBarItemElement.setAttribute('role', 'menu');
const menuTitle = Msgs.getMsg(menuMsg);
this.menuBarItemElement.textContent = menuTitle;
// The container for the menu. This part is fixed and scrolls its
// contents if necessary.
this.menuContainerElement = document.createElement('div');
this.menuContainerElement.className = 'menu-container';
this.menuContainerElement.style.visibility = 'hidden';
// The menu itself. It contains all of the items, and it scrolls within
// its container.
this.menuElement = document.createElement('table');
this.menuElement.className = 'menu';
this.menuElement.setAttribute('role', 'menu');
this.menuElement.setAttribute('aria-label', menuTitle);
this.menuContainerElement.appendChild(this.menuElement);
/**
* The items in the menu.
* @type {Array<PanelMenuItem>}
* @private
*/
this.items_ = [];
/**
* The return value from setTimeout for a function to update the
* scroll bars after an item has been added to a menu. Used so that we
* don't re-layout too many times.
* @type {?number}
* @private
*/
this.updateScrollbarsTimeout_ = null;
/**
* The current active menu item index, or -1 if none.
* @type {number}
* @private
*/
this.activeIndex_ = -1;
this.menuElement.addEventListener(
'keypress', this.onKeyPress_.bind(this), true);
/** @private {boolean} */
this.enabled_ = true;
}
/**
* @param {string} menuItemTitle The title of the menu item.
* @param {string} menuItemShortcut The keystrokes to select this item.
* @param {string} menuItemBraille
* @param {string} gesture
* @param {function() : !Promise} callback The function to call if this item
* is selected.
* @param {string=} opt_id An optional id for the menu item element.
* @return {!PanelMenuItem} The menu item just created.
*/
addMenuItem(
menuItemTitle, menuItemShortcut, menuItemBraille, gesture, callback,
opt_id) {
const menuItem = new PanelMenuItem(
menuItemTitle, menuItemShortcut, menuItemBraille, gesture, callback,
opt_id);
this.items_.push(menuItem);
this.menuElement.appendChild(menuItem.element);
// Sync the active index with focus.
menuItem.element.addEventListener(
'focus', (function(index, event) {
this.activeIndex_ = index;
}).bind(this, this.items_.length - 1),
false);
// Update the container height, adding a scroll bar if necessary - but
// to avoid excessive layout, schedule this once per batch of adding
// menu items rather than after each add.
if (!this.updateScrollbarsTimeout_) {
this.updateScrollbarsTimeout_ = setTimeout(
(function() {
const menuBounds = this.menuElement.getBoundingClientRect();
const maxHeight = window.innerHeight - menuBounds.top;
this.menuContainerElement.style.maxHeight = maxHeight + 'px';
this.updateScrollbarsTimeout_ = null;
}).bind(this),
0);
}
return menuItem;
}
/**
* Activate this menu, which means showing it and positioning it on the
* screen underneath its title in the menu bar.
* @param {boolean} activateFirstItem Whether or not we should activate the
* menu's
* first item.
*/
activate(activateFirstItem) {
if (!this.enabled_) {
this.menuBarItemElement.focus();
return;
}
this.menuContainerElement.style.visibility = 'visible';
this.menuContainerElement.style.opacity = 1;
this.menuBarItemElement.classList.add('active');
const barBounds =
this.menuBarItemElement.parentElement.getBoundingClientRect();
const titleBounds = this.menuBarItemElement.getBoundingClientRect();
const menuBounds = this.menuElement.getBoundingClientRect();
this.menuElement.style.minWidth = titleBounds.width + 'px';
this.menuContainerElement.style.minWidth = titleBounds.width + 'px';
if (titleBounds.left + menuBounds.width < barBounds.width) {
this.menuContainerElement.style.left = titleBounds.left + 'px';
} else {
this.menuContainerElement.style.left =
(titleBounds.right - menuBounds.width) + 'px';
}
// Make the first item active.
if (activateFirstItem) {
this.activateItem(0);
}
}
/**
* Disables this menu. When disabled, menu contents cannot be analyzed.
* When activated, focus gets placed on the menuBarItem (title element)
* instead of the first menu item.
*/
disable() {
this.enabled_ = false;
this.menuBarItemElement.classList.add('disabled');
this.menuBarItemElement.setAttribute('aria-disabled', true);
this.menuBarItemElement.setAttribute('tabindex', 0);
this.menuBarItemElement.setAttribute(
'aria-label', this.menuBarItemElement.textContent);
this.activeIndex_ = -1;
}
/**
* Hide this menu. Make it invisible first to minimize spurious
* accessibility events before the next menu activates.
*/
deactivate() {
this.menuContainerElement.style.opacity = 0.001;
this.menuBarItemElement.classList.remove('active');
this.activeIndex_ = -1;
setTimeout(
(function() {
this.menuContainerElement.style.visibility = 'hidden';
}).bind(this),
0);
}
/**
* Make a specific menu item index active.
* @param {number} itemIndex The index of the menu item.
*/
activateItem(itemIndex) {
this.activeIndex_ = itemIndex;
if (this.activeIndex_ >= 0 && this.activeIndex_ < this.items_.length) {
this.items_[this.activeIndex_].element.focus();
}
}
/**
* Advanced the active menu item index by a given number.
* @param {number} delta The number to add to the active menu item index.
*/
advanceItemBy(delta) {
if (!this.enabled_) {
return;
}
if (this.activeIndex_ >= 0) {
this.activeIndex_ += delta;
this.activeIndex_ =
(this.activeIndex_ + this.items_.length) % this.items_.length;
} else {
if (delta >= 0) {
this.activeIndex_ = 0;
} else {
this.activeIndex_ = this.items_.length - 1;
}
}
this.activeIndex_ = this.findEnabledItemIndex_(
this.activeIndex_, delta > 0 ? 1 : -1 /* delta */);
if (this.activeIndex_ === -1) {
return;
}
this.items_[this.activeIndex_].element.focus();
}
/**
* Sets the active menu item index to be 0.
*/
scrollToTop() {
this.activeIndex_ = 0;
this.items_[this.activeIndex_].element.focus();
}
/**
* Sets the active menu item index to be the last index.
*/
scrollToBottom() {
this.activeIndex_ = this.items_.length - 1;
this.items_[this.activeIndex_].element.focus();
}
/**
* Get the callback for the active menu item.
* @return {?function() : !Promise} The callback.
*/
getCallbackForCurrentItem() {
if (this.activeIndex_ >= 0 && this.activeIndex_ < this.items_.length) {
return this.items_[this.activeIndex_].callback;
}
return null;
}
/**
* Get the callback for a menu item given its DOM element.
* @param {Element} element The DOM element.
* @return {?function() : !Promise} The callback.
*/
getCallbackForElement(element) {
for (let i = 0; i < this.items_.length; i++) {
if (element === this.items_[i].element) {
return this.items_[i].callback;
}
}
return null;
}
/**
* Handles key presses for first letter accelerators.
*/
onKeyPress_(evt) {
if (!this.items_.length) {
return;
}
const query = String.fromCharCode(evt.charCode).toLowerCase();
for (let i = this.activeIndex_ + 1; i !== this.activeIndex_;
i = (i + 1) % this.items_.length) {
if (this.items_[i].text.toLowerCase().indexOf(query) === 0) {
this.activateItem(i);
break;
}
}
}
/**
* @return {boolean} The enabled state of this menu.
*/
get enabled() {
return this.enabled_;
}
/**
* @return {Array<PanelMenuItem>}
*/
get items() {
return this.items_;
}
/**
* Starting at |startIndex|, looks for an enabled menu item.
* @param {number} startIndex
* @param {number} delta
* @return {number} The index of the enabled item. -1 if not found.
* @private
*/
findEnabledItemIndex_(startIndex, delta) {
const endIndex = (delta > 0) ? this.items_.length : -1;
while (startIndex !== endIndex) {
if (this.items_[startIndex].enabled) {
return startIndex;
}
startIndex += delta;
}
return -1;
}
}
export class PanelNodeMenu extends PanelMenu {
/** @override */
activate(activateFirstItem) {
super.activate(false);
if (activateFirstItem) {
// The active index might have been set prior to this call in
// |findMoreNodes|. We want to start the menu there.
const index = this.activeIndex_ === -1 ? 0 : this.activeIndex_;
this.activateItem(index);
}
}
/** @param {!PanelNodeMenuItemData} data */
addItemFromData(data) {
this.addMenuItem(data.title, '', '', '', async () => {
if (data.callbackId) {
BridgeCallbackManager.performCallback(data.callbackId);
}
});
if (data.isActive) {
this.activeIndex_ = this.items_.length - 1;
}
}
}
/**
* Implements a menu that allows users to dynamically search the contents of the
* ChromeVox menus.
*/
export class PanelSearchMenu extends PanelMenu {
/**
* @param {!string} menuMsg The msg id of the menu.
*/
constructor(menuMsg) {
super(menuMsg);
this.searchResultCounter_ = 0;
// Add id attribute to the menu so we can associate it with search bar.
this.menuElement.setAttribute('id', 'search-results');
// Create the search bar.
this.searchBar = document.createElement('input');
this.searchBar.setAttribute('id', 'menus-search-bar');
this.searchBar.setAttribute('type', 'search');
this.searchBar.setAttribute('aria-controls', 'search-results');
this.searchBar.setAttribute('aria-activedescendant', '');
this.searchBar.setAttribute(
'placeholder', Msgs.getMsg('search_chromevox_menus_placeholder'));
this.searchBar.setAttribute(
'aria-description', Msgs.getMsg('search_chromevox_menus_description'));
this.searchBar.setAttribute('role', 'searchbox');
// Create menu item to own search bar.
const menuItem = document.createElement('tr');
menuItem.tabIndex = -1;
menuItem.setAttribute('role', 'menuitem');
menuItem.appendChild(this.searchBar);
// Add the search bar above the menu.
this.menuContainerElement.insertBefore(menuItem, this.menuElement);
}
/** @override */
activate(activateFirstItem) {
PanelMenu.prototype.activate.call(this, false);
if (this.searchBar.value === '') {
this.clear();
}
if (this.items_.length > 0) {
this.activateItem(this.activeIndex_);
}
this.searchBar.focus();
}
/** @override */
activateItem(index) {
this.resetItemAtActiveIndex();
if (this.items_.length === 0) {
return;
}
if (index >= 0) {
index = (index + this.items_.length) % this.items_.length;
} else {
if (index >= this.activeIndex_) {
index = 0;
} else {
index = this.items_.length - 1;
}
}
this.activeIndex_ = index;
const item = this.items_[this.activeIndex_];
this.searchBar.setAttribute('aria-activedescendant', item.element.id);
item.element.classList.add('active');
// Scroll item into view, if necessary. Only check y-axis.
const itemBounds = item.element.getBoundingClientRect();
const menuBarBounds = this.menuBarItemElement.getBoundingClientRect();
const topThreshold = menuBarBounds.bottom;
const bottomThreshold = window.innerHeight;
if (itemBounds.bottom > bottomThreshold) {
// Item is too far down, so align to top.
item.element.scrollIntoView(true /* alignToTop */);
} else if (itemBounds.top < topThreshold) {
// Item is too far up, so align to bottom.
item.element.scrollIntoView(false /* alignToTop */);
}
}
/** @override */
addMenuItem(
menuItemTitle, menuItemShortcut, menuItemBraille, gesture, callback,
opt_id) {
this.searchResultCounter_ += 1;
const item = PanelMenu.prototype.addMenuItem.call(
this, menuItemTitle, menuItemShortcut, menuItemBraille, gesture,
callback, 'result-number-' + this.searchResultCounter_.toString());
// Ensure that item styling is updated on mouse hovers.
item.element.addEventListener('mouseover', event => {
this.resetItemAtActiveIndex();
}, true);
return item;
}
/** @override */
advanceItemBy(delta) {
this.activateItem(this.activeIndex_ + delta);
}
/**
* Clears this menu's contents.
*/
clear() {
this.items_ = [];
this.activeIndex_ = -1;
while (this.menuElement.children.length !== 0) {
this.menuElement.removeChild(this.menuElement.firstChild);
}
this.searchBar.setAttribute('aria-activedescendant', '');
}
/**
* A convenience method to add a copy of an existing PanelMenuItem.
* @param {!PanelMenuItem} item The item we want to copy.
* @return {!PanelMenuItem} The menu item that was just created.
*/
copyAndAddMenuItem(item) {
return this.addMenuItem(
item.menuItemTitle, item.menuItemShortcut, item.menuItemBraille,
item.gesture, item.callback);
}
/** @override */
deactivate() {
this.resetItemAtActiveIndex();
PanelMenu.prototype.deactivate.call(this);
}
/**
* Resets the item at this.activeIndex_.
*/
resetItemAtActiveIndex() {
// Sanity check.
if (this.activeIndex_ < 0 || this.activeIndex_ >= this.items.length) {
return;
}
this.items_[this.activeIndex_].element.classList.remove('active');
}
/** @override */
scrollToTop() {
this.activateItem(0);
}
/** @override */
scrollToBottom() {
this.activateItem(this.items_.length - 1);
}
}
| {
"content_hash": "eed94b03959b5bc412d037f4032d523d",
"timestamp": "",
"source": "github",
"line_count": 497,
"max_line_length": 80,
"avg_line_length": 30.17907444668008,
"alnum_prop": 0.6429761984132275,
"repo_name": "nwjs/chromium.src",
"id": "1a7bbd06e509d89f693464066ae6d235826079b5",
"size": "14999",
"binary": false,
"copies": "8",
"ref": "refs/heads/nw70",
"path": "chrome/browser/resources/chromeos/accessibility/chromevox/panel/panel_menu.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
package org.basex.query.util.list;
import static org.basex.query.QueryError.*;
import org.basex.query.*;
import org.basex.query.ann.*;
import org.basex.util.list.*;
/**
* List of annotations.
*
* @author BaseX Team 2005-22, BSD License
* @author Christian Gruen
*/
public final class AnnList extends ObjectList<Ann, AnnList> {
/**
* Checks if the specified signature is found in the list.
* @param def signature to be found
* @return result of check
*/
public boolean contains(final Annotation def) {
return get(def) != null;
}
/**
* Returns an annotation with the specified signature.
* @param def annotation to be found
* @return annotation or {@code null}
*/
public Ann get(final Annotation def) {
for(final Ann ann : this) {
if(ann.definition == def) return ann;
}
return null;
}
/**
* Returns the intersection of these annotations and the given ones.
* @param anns other annotations
* @return a new instance with all annotations, or {@code null} if intersection is not possible
*/
public AnnList intersect(final AnnList anns) {
final AnnList tmp = new AnnList();
boolean pub = false, priv = false, up = false;
for(final Ann ann : this) {
final Annotation def = ann.definition;
if(def == Annotation.PUBLIC) pub = true;
else if(def == Annotation.PRIVATE) priv = true;
else if(def == Annotation.UPDATING) up = true;
tmp.add(ann);
}
for(final Ann ann : anns) {
final Annotation def = ann.definition;
if(def == Annotation.PUBLIC) {
if(pub) continue;
if(priv) return null;
} else if(def == Annotation.PRIVATE) {
if(pub) return null;
if(priv) continue;
} else if(def == Annotation.UPDATING && up) {
continue;
}
tmp.add(ann);
}
return tmp;
}
/**
* Returns the unions of these annotations and the given ones.
* @param anns annotations
* @return a new instance with annotations that are present in both lists
*/
public AnnList union(final AnnList anns) {
final AnnList tmp = new AnnList();
for(final Ann ann : this) {
for(final Ann ann2 : anns) {
if(ann.equals(ann2)) tmp.add(ann);
}
}
return tmp;
}
/**
* Checks all annotations for parsing errors.
* @param variable variable flag (triggers different error codes)
* @param visible check visibility annotations
* @return self reference
* @throws QueryException query exception
*/
public AnnList check(final boolean variable, final boolean visible) throws QueryException {
boolean up = false, vis = false;
for(final Ann ann : this) {
final Annotation def = ann.definition;
if(def == Annotation.UPDATING) {
if(up) throw DUPLUPD.get(ann.info);
up = true;
} else if(visible && (def == Annotation.PUBLIC || def == Annotation.PRIVATE)) {
// only one visibility modifier allowed
if(vis) throw (variable ? DUPLVARVIS : DUPLFUNVIS).get(ann.info);
vis = true;
}
}
return this;
}
@Override
protected Ann[] newArray(final int s) {
return new Ann[s];
}
/**
* Adds the annotations to a query string.
* @param qs query string builder
*/
public void toString(final QueryString qs) {
for(final Ann ann : this) ann.toString(qs);
}
}
| {
"content_hash": "92b9b90d9cbe66a983a5eafc4abf308c",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 97,
"avg_line_length": 28.327731092436974,
"alnum_prop": 0.6351231088697716,
"repo_name": "BaseXdb/basex",
"id": "f250cdb1f72318b5c0fe9b24a303496fe66a729b",
"size": "3371",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "basex-core/src/main/java/org/basex/query/util/list/AnnList.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ActionScript",
"bytes": "9374"
},
{
"name": "Batchfile",
"bytes": "2082"
},
{
"name": "C",
"bytes": "18636"
},
{
"name": "C#",
"bytes": "13450"
},
{
"name": "C++",
"bytes": "7796"
},
{
"name": "CSS",
"bytes": "4002"
},
{
"name": "Common Lisp",
"bytes": "3213"
},
{
"name": "Haskell",
"bytes": "4066"
},
{
"name": "Java",
"bytes": "8102078"
},
{
"name": "JavaScript",
"bytes": "15505"
},
{
"name": "Makefile",
"bytes": "1249"
},
{
"name": "PHP",
"bytes": "12135"
},
{
"name": "Perl",
"bytes": "7807"
},
{
"name": "Python",
"bytes": "15214"
},
{
"name": "QMake",
"bytes": "377"
},
{
"name": "R",
"bytes": "14374"
},
{
"name": "Raku",
"bytes": "10718"
},
{
"name": "Rebol",
"bytes": "4736"
},
{
"name": "Ruby",
"bytes": "7365"
},
{
"name": "Scala",
"bytes": "11698"
},
{
"name": "Shell",
"bytes": "3658"
},
{
"name": "Visual Basic .NET",
"bytes": "11963"
},
{
"name": "XQuery",
"bytes": "254128"
},
{
"name": "XSLT",
"bytes": "381"
}
],
"symlink_target": ""
} |
<?php
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'org\\bovigo\\vfs' => array($vendorDir . '/mikey179/vfsStream/src/main/php'),
'Psr\\Log\\' => array($vendorDir . '/psr/log'),
);
| {
"content_hash": "39767896a54eba64fcca54c455982037",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 81,
"avg_line_length": 25.727272727272727,
"alnum_prop": 0.6466431095406361,
"repo_name": "leobelini/guiapet",
"id": "6492194e572c780396f3e02c78cf1019df01797f",
"size": "283",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "vendor/composer/autoload_namespaces.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "240"
},
{
"name": "CSS",
"bytes": "433602"
},
{
"name": "HTML",
"bytes": "9968069"
},
{
"name": "JavaScript",
"bytes": "2301529"
},
{
"name": "PHP",
"bytes": "2107119"
}
],
"symlink_target": ""
} |
package Google::Ads::GoogleAds::V10::Services::BatchJobService::BatchJobResult;
use strict;
use warnings;
use base qw(Google::Ads::GoogleAds::BaseEntity);
use Google::Ads::GoogleAds::Utils::GoogleAdsHelper;
sub new {
my ($class, $args) = @_;
my $self = {
mutateOperationResponse => $args->{mutateOperationResponse},
operationIndex => $args->{operationIndex},
status => $args->{status}};
# Delete the unassigned fields in this object for a more concise JSON payload
remove_unassigned_fields($self, $args);
bless $self, $class;
return $self;
}
1;
| {
"content_hash": "03db856bbce8fb9b122d256696e172f8",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 79,
"avg_line_length": 26.130434782608695,
"alnum_prop": 0.6688851913477537,
"repo_name": "googleads/google-ads-perl",
"id": "5b7c73b9d5aa9dfd2abb7291464b1419065aac0b",
"size": "1177",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "lib/Google/Ads/GoogleAds/V10/Services/BatchJobService/BatchJobResult.pm",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "73"
},
{
"name": "Perl",
"bytes": "5866064"
}
],
"symlink_target": ""
} |
'use strict';
/* http://docs.angularjs.org/guide/dev_guide.e2e-testing */
describe('cloud playground app', function() {
beforeEach(function() {
browser().navigateTo('/');
});
afterEach(function() {
//sleep(1.5);
//pause();
});
it('should perform html5Mode redirect with trailing slash', function() {
expect(browser().window().path()).toBe('/playground/');
});
it('should automatically redirect to /playground/', function() {
expect(browser().location().url()).toBe('/playground/');
});
describe('login behavior', function() {
var current_url = 'http://localhost:7070/playground/';
function logout() {
expect(browser().window().href()).toBe(current_url);
browser().navigateTo('/_ah/login?action=Logout&continue=' + current_url);
expect(browser().window().href()).toBe(current_url);
}
function login(admin) {
expect(browser().window().href()).toBe(current_url);
browser().navigateTo('/_ah/login?email=test@example.com&admin=' +
(admin ? 'True' : 'False') +
'&action=Login&continue=' + current_url);
expect(browser().window().href()).toBe(current_url);
}
it('should only provide login button when the user is not logged in',
function() {
logout();
expect(element('button:contains("login")').count()).toEqual(1);
expect(element('button:contains("login")').css('display'))
.toEqual('inline-block');
expect(element('button:contains("login")').height()).toBeGreaterThan(0);
login(true);
expect(element('button:contains("login")').count()).toEqual(1);
expect(element('button:contains("login")').css('display'))
.toEqual('none');
// TODO: figure out why this fails:
//expect(element('button:contains("login")').height()).toEqual(0);
});
it('should only provide logout button when the user is logged in',
function() {
login(true);
expect(element('button:contains("logout")').count()).toEqual(1);
expect(element('button:contains("logout")').css('display'))
.toEqual('inline-block');
expect(element('button:contains("logout")').height()).toBeGreaterThan(0);
logout();
expect(element('button:contains("logout")').count()).toEqual(1);
expect(element('button:contains("logout")').css('display'))
.toEqual('none');
// TODO: figure out why this fails:
//expect(element('button:contains("logout")').height()).toEqual(0);
});
// commented out since we always show admin links in the dev_appserver
xit('should only provide admin links when user is logged in as an admin',
function() {
login(false);
expect(element('[ng-click="big_red_button()"]').height()).toEqual(0);
expect(element('[ng-click="datastore_admin()"]').height()).toEqual(0);
expect(element('[ng-click="memcache_admin()"]').height()).toEqual(0);
login(true);
expect(element('[ng-click="big_red_button()"]').height())
.toBeGreaterThan(0);
expect(element('[ng-click="datastore_admin()"]').height())
.toBeGreaterThan(0);
expect(element('[ng-click="memcache_admin()"]').height())
.toBeGreaterThan(0);
});
});
describe('main page', function() {
beforeEach(function() {
browser().navigateTo('/playground/');
});
it('should render main view', function() {
expect(element('[ng-view]').text()).toMatch(/My Projects/);
});
it('should show warning', function() {
expect(element('body').text())
.toMatch(/Anyone can read, modify or delete your projects/);
});
it('should have login/logout buttons', function() {
expect(element('body').text()).toMatch(/login/);
expect(element('body').text()).toMatch(/logout/);
});
});
describe('project', function() {
beforeEach(function() {
browser().navigateTo('/playground/p/42/');
});
it('should render project view', function() {
expect(element('[ng-view]').text()).toMatch(/\+ new file/);
});
});
});
| {
"content_hash": "6534d3e5854931f73148bf27e01a2c87",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 79,
"avg_line_length": 30.57037037037037,
"alnum_prop": 0.5970438575236249,
"repo_name": "jackpunt/playground",
"id": "e29c69325a7f480318acf4bee5d7e1cd0454169f",
"size": "4127",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "test/e2e/scenarios.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "19373"
},
{
"name": "JavaScript",
"bytes": "2880549"
},
{
"name": "Python",
"bytes": "104454"
},
{
"name": "Shell",
"bytes": "5011"
}
],
"symlink_target": ""
} |
(function() {
(function($) {
return $.widget('IKS.blockQuoteButton', {
options: {
uuid: '',
editable: null
},
populateToolbar: function(toolbar) {
var button, widget;
widget = this;
button = $('<span></span>');
button.hallobutton({
uuid: this.options.uuid,
editable: this.options.editable,
label: 'Blockquote',
icon: 'fa fa-quote-left',
command: null
});
toolbar.append(button);
button.on('click', function(event) {
return widget.options.editable.execute('formatBlock',
'blockquote');
});
}
});
})(jQuery);
}).call(this);
/*
raw html edit button based on the original code by https://github.com/ejucovy
https://gist.github.com/ejucovy/5c5370dc73b80b8896c8
*/
(function() {
(function($) {
return $.widget('IKS.editHtmlButton', {
options: {
uuid: '',
editable: null
},
populateToolbar: function(toolbar) {
var button, widget;
var getEnclosing = function(tag) {
var node;
node = widget.options.editable.getSelection().commonAncestorContainer;
return $(node).parents(tag).get(0);
};
widget = this;
button = $('<span></span>');
button.hallobutton({
uuid: this.options.uuid,
editable: this.options.editable,
label: 'Edit HTML',
icon: 'fa fa-file-code-o',
command: null
});
toolbar.append(button);
button.on('click', function(event) {
$('body > .modal').remove();
var container = $('<div class="modal fade editor" tabindex="-1" role="dialog" aria-hidden="true">\n <div class="modal-dialog">\n <div class="modal-content"\
>\n <button type="button" class="close text-replace" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times fa-lg"></i></button>\n <div class="modal-body"><hea\
der class="nice-padding hasform"><div class="row"><div class="left"><div class="col"><h1><i class="fa fa-file-code-o"></i> Edit HTML Code</h1></div></header><div class="modal-bo\
dy-body"></div></div>\n </div><!-- /.modal-content -->\n </div><!-- /.modal-dialog -->\n</div>');
// add container to body and hide it, so content can be added to it before display
$('body').append(container);
container.modal('hide');
var modalBody = container.find('.modal-body-body');
modalBody.html('<textarea style="height: 400px; width: 92%; font: 14px/21px monospace; border: 1px solid #d8d8d8; background: #f4f4f4; margin: 2% 4%;" id="wagtail-edit-html-content">'+widget.options.editable.element.html()+'</textarea><button i\
d="wagtail-edit-html-save" type="button" style="margin: 0 4%; float: right;">Save</button>');
$("#wagtail-edit-html-save").on("click", function() {
widget.options.editable.setContents($("#wagtail-edit-html-content").val());
widget.options.editable.setModified();
container.modal('hide');
});
container.modal('show');
});
}
});
})(jQuery);
}).call(this); | {
"content_hash": "e5c96aabf9413b54989f2e277a064fe9",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 265,
"avg_line_length": 42,
"alnum_prop": 0.47959183673469385,
"repo_name": "kingsdigitallab/dprr-django",
"id": "8f97a980a3d72c04f56e74ed98fc4c1d4dd72c78",
"size": "3822",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "assets/javascripts/hallo.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "788"
},
{
"name": "HTML",
"bytes": "99560"
},
{
"name": "JavaScript",
"bytes": "10628"
},
{
"name": "Jinja",
"bytes": "220"
},
{
"name": "Python",
"bytes": "668975"
},
{
"name": "SCSS",
"bytes": "73040"
},
{
"name": "Shell",
"bytes": "6209"
}
],
"symlink_target": ""
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.5"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Vulkan Memory Allocator: VmaDetailedStatistics Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<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 id="projectrow">
<td id="projectalign">
<div id="projectname">Vulkan Memory Allocator
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.5 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-attribs">Public Attributes</a> |
<a href="struct_vma_detailed_statistics-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">VmaDetailedStatistics Struct Reference<div class="ingroups"><a class="el" href="group__group__stats.html">Statistics</a></div></div></div>
</div><!--header-->
<div class="contents">
<p>More detailed statistics than <a class="el" href="struct_vma_statistics.html" title="Calculated statistics of memory usage e.g. in a specific memory type, heap, custom pool,...">VmaStatistics</a>.
<a href="struct_vma_detailed_statistics.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-attribs" name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a13efbdb35bd1291191d275f43e96d360"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_vma_statistics.html">VmaStatistics</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_vma_detailed_statistics.html#a13efbdb35bd1291191d275f43e96d360">statistics</a></td></tr>
<tr class="memdesc:a13efbdb35bd1291191d275f43e96d360"><td class="mdescLeft"> </td><td class="mdescRight">Basic statistics. <a href="struct_vma_detailed_statistics.html#a13efbdb35bd1291191d275f43e96d360">More...</a><br /></td></tr>
<tr class="separator:a13efbdb35bd1291191d275f43e96d360"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab721bf04892e8b67802d4ddb7734638a"><td class="memItemLeft" align="right" valign="top">uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_vma_detailed_statistics.html#ab721bf04892e8b67802d4ddb7734638a">unusedRangeCount</a></td></tr>
<tr class="memdesc:ab721bf04892e8b67802d4ddb7734638a"><td class="mdescLeft"> </td><td class="mdescRight">Number of free ranges of memory between allocations. <a href="struct_vma_detailed_statistics.html#ab721bf04892e8b67802d4ddb7734638a">More...</a><br /></td></tr>
<tr class="separator:ab721bf04892e8b67802d4ddb7734638a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6fb397e7487e10f2a52e241577d2a2b8"><td class="memItemLeft" align="right" valign="top">VkDeviceSize </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_vma_detailed_statistics.html#a6fb397e7487e10f2a52e241577d2a2b8">allocationSizeMin</a></td></tr>
<tr class="memdesc:a6fb397e7487e10f2a52e241577d2a2b8"><td class="mdescLeft"> </td><td class="mdescRight">Smallest allocation size. <code>VK_WHOLE_SIZE</code> if there are 0 allocations. <a href="struct_vma_detailed_statistics.html#a6fb397e7487e10f2a52e241577d2a2b8">More...</a><br /></td></tr>
<tr class="separator:a6fb397e7487e10f2a52e241577d2a2b8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a06b2add24eed3449a66ff151979a0201"><td class="memItemLeft" align="right" valign="top">VkDeviceSize </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_vma_detailed_statistics.html#a06b2add24eed3449a66ff151979a0201">allocationSizeMax</a></td></tr>
<tr class="memdesc:a06b2add24eed3449a66ff151979a0201"><td class="mdescLeft"> </td><td class="mdescRight">Largest allocation size. 0 if there are 0 allocations. <a href="struct_vma_detailed_statistics.html#a06b2add24eed3449a66ff151979a0201">More...</a><br /></td></tr>
<tr class="separator:a06b2add24eed3449a66ff151979a0201"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a830eda847ed735d0e91da25cfcf797a4"><td class="memItemLeft" align="right" valign="top">VkDeviceSize </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_vma_detailed_statistics.html#a830eda847ed735d0e91da25cfcf797a4">unusedRangeSizeMin</a></td></tr>
<tr class="memdesc:a830eda847ed735d0e91da25cfcf797a4"><td class="mdescLeft"> </td><td class="mdescRight">Smallest empty range size. <code>VK_WHOLE_SIZE</code> if there are 0 empty ranges. <a href="struct_vma_detailed_statistics.html#a830eda847ed735d0e91da25cfcf797a4">More...</a><br /></td></tr>
<tr class="separator:a830eda847ed735d0e91da25cfcf797a4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af98943b5da98cf441ffa04b67914c78c"><td class="memItemLeft" align="right" valign="top">VkDeviceSize </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_vma_detailed_statistics.html#af98943b5da98cf441ffa04b67914c78c">unusedRangeSizeMax</a></td></tr>
<tr class="memdesc:af98943b5da98cf441ffa04b67914c78c"><td class="mdescLeft"> </td><td class="mdescRight">Largest empty range size. 0 if there are 0 empty ranges. <a href="struct_vma_detailed_statistics.html#af98943b5da98cf441ffa04b67914c78c">More...</a><br /></td></tr>
<tr class="separator:af98943b5da98cf441ffa04b67914c78c"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >More detailed statistics than <a class="el" href="struct_vma_statistics.html" title="Calculated statistics of memory usage e.g. in a specific memory type, heap, custom pool,...">VmaStatistics</a>. </p>
<p >These are slower to calculate. Use for debugging purposes. See functions: <a class="el" href="group__group__stats.html#ga36f3484de7aa6cd6edc4de9edfa0ff59" title="Retrieves statistics from current state of the Allocator.">vmaCalculateStatistics()</a>, <a class="el" href="group__group__stats.html#ga50ba0eb25d2b363b792be4645ca7a380" title="Retrieves detailed statistics of existing VmaPool object.">vmaCalculatePoolStatistics()</a>.</p>
<p >Previous version of the statistics API provided averages, but they have been removed because they can be easily calculated as:</p>
<div class="fragment"><div class="line">VkDeviceSize allocationSizeAvg = detailedStats.statistics.allocationBytes / detailedStats.statistics.allocationCount;</div>
<div class="line">VkDeviceSize unusedBytes = detailedStats.statistics.blockBytes - detailedStats.statistics.allocationBytes;</div>
<div class="line">VkDeviceSize unusedRangeSizeAvg = unusedBytes / detailedStats.unusedRangeCount;</div>
</div><!-- fragment --> </div><h2 class="groupheader">Member Data Documentation</h2>
<a id="a06b2add24eed3449a66ff151979a0201" name="a06b2add24eed3449a66ff151979a0201"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a06b2add24eed3449a66ff151979a0201">◆ </a></span>allocationSizeMax</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">VkDeviceSize VmaDetailedStatistics::allocationSizeMax</td>
</tr>
</table>
</div><div class="memdoc">
<p>Largest allocation size. 0 if there are 0 allocations. </p>
</div>
</div>
<a id="a6fb397e7487e10f2a52e241577d2a2b8" name="a6fb397e7487e10f2a52e241577d2a2b8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6fb397e7487e10f2a52e241577d2a2b8">◆ </a></span>allocationSizeMin</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">VkDeviceSize VmaDetailedStatistics::allocationSizeMin</td>
</tr>
</table>
</div><div class="memdoc">
<p>Smallest allocation size. <code>VK_WHOLE_SIZE</code> if there are 0 allocations. </p>
</div>
</div>
<a id="a13efbdb35bd1291191d275f43e96d360" name="a13efbdb35bd1291191d275f43e96d360"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a13efbdb35bd1291191d275f43e96d360">◆ </a></span>statistics</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="struct_vma_statistics.html">VmaStatistics</a> VmaDetailedStatistics::statistics</td>
</tr>
</table>
</div><div class="memdoc">
<p>Basic statistics. </p>
</div>
</div>
<a id="ab721bf04892e8b67802d4ddb7734638a" name="ab721bf04892e8b67802d4ddb7734638a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab721bf04892e8b67802d4ddb7734638a">◆ </a></span>unusedRangeCount</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint32_t VmaDetailedStatistics::unusedRangeCount</td>
</tr>
</table>
</div><div class="memdoc">
<p>Number of free ranges of memory between allocations. </p>
</div>
</div>
<a id="af98943b5da98cf441ffa04b67914c78c" name="af98943b5da98cf441ffa04b67914c78c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af98943b5da98cf441ffa04b67914c78c">◆ </a></span>unusedRangeSizeMax</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">VkDeviceSize VmaDetailedStatistics::unusedRangeSizeMax</td>
</tr>
</table>
</div><div class="memdoc">
<p>Largest empty range size. 0 if there are 0 empty ranges. </p>
</div>
</div>
<a id="a830eda847ed735d0e91da25cfcf797a4" name="a830eda847ed735d0e91da25cfcf797a4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a830eda847ed735d0e91da25cfcf797a4">◆ </a></span>unusedRangeSizeMin</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">VkDeviceSize VmaDetailedStatistics::unusedRangeSizeMin</td>
</tr>
</table>
</div><div class="memdoc">
<p>Smallest empty range size. <code>VK_WHOLE_SIZE</code> if there are 0 empty ranges. </p>
</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>D:/PROJECTS/Vulkan Memory Allocator/REPO/include/<a class="el" href="vk__mem__alloc_8h.html">vk_mem_alloc.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5
</small></address>
</body>
</html>
| {
"content_hash": "7aa9daf8714f2f0e4c07b14103658ae8",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 439,
"avg_line_length": 58.916666666666664,
"alnum_prop": 0.724972497249725,
"repo_name": "GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator",
"id": "25502c431fbe295c5d52cd7217e44353a4748a45",
"size": "12726",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/html/struct_vma_detailed_statistics.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "284"
},
{
"name": "C",
"bytes": "741911"
},
{
"name": "C++",
"bytes": "464522"
},
{
"name": "CMake",
"bytes": "8393"
},
{
"name": "GLSL",
"bytes": "3135"
},
{
"name": "Python",
"bytes": "14737"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using AutoMapper;
using Integer.Web.ViewModels;
using Integer.Domain.Acesso;
namespace Integer.Web.Infra.AutoMapper.Profiles
{
public class UsuarioProfile : Profile
{
protected override void Configure()
{
Mapper.CreateMap<UsuarioCriarViewModel, Usuario>()
.ForMember(x => x.Email, o => o.Ignore())
.ForMember(x => x.Senha, o => o.Ignore())
.ConstructUsing(m => new Usuario(m.Email, m.Senha));
}
}
} | {
"content_hash": "e10f5ae4a951cc2f25a1b47a94f1f2d4",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 68,
"avg_line_length": 27.666666666666668,
"alnum_prop": 0.6282271944922547,
"repo_name": "danielsilva/--Integer--",
"id": "e6c63ff7c5d4c98e1734305b34367544a3e4f495",
"size": "583",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Backup/Integer.Web/Infra/AutoMapper/Profiles/UsuarioProfile.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "395"
},
{
"name": "C#",
"bytes": "447710"
},
{
"name": "C++",
"bytes": "26887"
},
{
"name": "JavaScript",
"bytes": "16903745"
},
{
"name": "Objective-C",
"bytes": "1539"
},
{
"name": "Visual Basic",
"bytes": "48110"
}
],
"symlink_target": ""
} |
/**
* This module defines the Client class, simplifying interaction with Ambrose http server endpoints.
*/
define(['lib/jquery', 'lib/uri', './core'], function($, URI, Ambrose) {
// Client ctor
var Client = Ambrose.Client = function(baseUri) {
return new Ambrose.Client.fn.init(baseUri);
};
/**
* Client prototype.
*/
Client.fn = Client.prototype = {
/**
* Constructs a new Client.
*
* @param baseUri base URI of Ambrose server to communicate with. If null, the current page's
* url is inspected for param 'localdata'. If defined, local demo data is used. If the value of
* 'localdata' is "small", then the small job graph and associated events data is
* used. Otherwise the "large" demo data is used. is used.
*/
init: function(baseUri) {
// default endpoint paths
var clustersUri = 'clusters';
var workflowsUri = 'workflows';
var jobsUri = 'dag';
var eventsUri = 'events';
if (baseUri == null) {
// look for 'localdata' param in current href
var uri = new URI(window.location.href);
var params = uri.search(true);
if (params.localdata) {
clustersUri = 'data/clusters.json';
workflowsUri = 'data/workflows.json';
jobsUri = 'data/jobs.json';
eventsUri = 'data/events.json';
}
} else {
// resolve relative paths given base uri
var uri = new URI(baseUri);
clustersUri = new URI(clustersUri).absoluteTo(uri);
workflowsUri = new URI(workflowsUri).absoluteTo(uri);
jobsUri = new URI(jobsUri).absoluteTo(uri);
eventsUri = new URI(eventsUri).absoluteTo(uri);
}
this.clustersUri = new URI(clustersUri);
this.workflowsUri = new URI(workflowsUri);
this.jobsUri = new URI(jobsUri);
this.eventsUri = new URI(eventsUri);
},
/**
* Sends asynch request to server.
*/
sendRequest: function(uri, params) {
var self = this;
return $.getJSON(new URI(uri).addSearch(params).unicode())
.error(function(jqXHR, textStatus, errorThrown) {
console.error('Request failed:', self, textStatus, errorThrown);
})
.success(function(data, textStatus, jqXHR) {
console.debug('Request succeeded:', textStatus, data);
});
},
/**
* Retrieves cluster configuration from server.
*/
getClusters: function() {
return this.sendRequest(this.clustersUri, {});
},
/**
* Submits asynchronous request for workflow summaries from server.
*
* @param cluster
* @param user
* @param status
* @param startKey
* @return a jQuery Promise on which success and error callbacks may be registered.
*/
getWorkflows: function(cluster, user, status, startKey) {
return this.sendRequest(this.workflowsUri, {
cluster: cluster,
user: user,
status: status,
startKey: startKey
});
},
/**
* Submits asynchronous request for workflow jobs from server.
*
* @param workflowId id of workflow for which to retrieve jobs.
* @return a jQuery Promise on which success and error callbacks may be registered.
*/
getJobs: function(workflowId) {
return this.sendRequest(this.jobsUri, { workflowId: workflowId });
},
/**
* Submits asynchronous request for workflow events from server.
*
* @param workflowId id of workflow for which to retrieve events.
* @param lastEventId retrieve events which occurred after the event associated with this id. If
* null, defaults to -1.
* @return a jQuery Promise on which success and error callbacks may be registered.
*/
getEvents: function(workflowId, lastEventId, maxEvents) {
if (lastEventId == null) lastEventId = -1;
return this.sendRequest(this.eventsUri, {
workflowId: workflowId,
lastEventId: lastEventId,
maxEvents: maxEvents
});
},
};
// Bind prototype to ctor
Client.fn.init.prototype = Client.fn;
return Client;
});
| {
"content_hash": "bfac4632b4082445738ac021a83d5d05",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 100,
"avg_line_length": 32.67460317460318,
"alnum_prop": 0.624483847461744,
"repo_name": "tim777z/ambrose",
"id": "36a859d043232caa3dd54451701290ef2bb2b4ac",
"size": "4672",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "common/src/main/resources/com/twitter/ambrose/server/web/js/modules/ambrose/client.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "3539"
},
{
"name": "HTML",
"bytes": "7927"
},
{
"name": "Java",
"bytes": "241921"
},
{
"name": "JavaScript",
"bytes": "119752"
},
{
"name": "PigLatin",
"bytes": "4787"
},
{
"name": "Python",
"bytes": "1013"
},
{
"name": "Scala",
"bytes": "1412"
},
{
"name": "Shell",
"bytes": "6012"
}
],
"symlink_target": ""
} |
<?php
namespace Omnimessage\Service;
/**
* Base class for all Services
*
* @author Christopher Tombleson <chris@cribznetwork.com>
*/
abstract class AbstractService
{
/**
* Send a message via the service
*
* @param array $data
* @return mixed
*/
abstract public function send($data);
}
| {
"content_hash": "2e98975ecacc4bad534933a160264705",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 57,
"avg_line_length": 17.944444444444443,
"alnum_prop": 0.6408668730650154,
"repo_name": "chtombleson/omnimessage",
"id": "d224737c9d3e097466a0edcf89f87f251b5efc6a",
"size": "323",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Service/AbstractService.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "55690"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="pt">
<head>
<!-- Generated by javadoc (version 1.7.0_71) on Tue Jun 16 10:36:59 BRT 2015 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Uses of Class opennlp.tools.util.ext.ExtensionNotLoadedException (Apache OpenNLP Tools 1.6.0 API)</title>
<meta name="date" content="2015-06-16">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class opennlp.tools.util.ext.ExtensionNotLoadedException (Apache OpenNLP Tools 1.6.0 API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../opennlp/tools/util/ext/ExtensionNotLoadedException.html" title="class in opennlp.tools.util.ext">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?opennlp/tools/util/ext/class-use/ExtensionNotLoadedException.html" target="_top">Frames</a></li>
<li><a href="ExtensionNotLoadedException.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class opennlp.tools.util.ext.ExtensionNotLoadedException" class="title">Uses of Class<br>opennlp.tools.util.ext.ExtensionNotLoadedException</h2>
</div>
<div class="classUseContainer">No usage of opennlp.tools.util.ext.ExtensionNotLoadedException</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../opennlp/tools/util/ext/ExtensionNotLoadedException.html" title="class in opennlp.tools.util.ext">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?opennlp/tools/util/ext/class-use/ExtensionNotLoadedException.html" target="_top">Frames</a></li>
<li><a href="ExtensionNotLoadedException.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2015 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>
| {
"content_hash": "03859201421c5b7a377a541183ab4840",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 163,
"avg_line_length": 38.99145299145299,
"alnum_prop": 0.6306444541867602,
"repo_name": "ericmguimaraes/COMP0378",
"id": "1ba0fbd2b920702ededfc0ea9901dfc07f19c49e",
"size": "4562",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "references/opennlp-docs/apidocs/opennlp-tools/opennlp/tools/util/ext/class-use/ExtensionNotLoadedException.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "25409"
},
{
"name": "HTML",
"bytes": "18627652"
},
{
"name": "Java",
"bytes": "70525"
},
{
"name": "TeX",
"bytes": "3753"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using RiotSharp.Endpoints.MatchEndpoint.Enums;
namespace RiotSharp.Test
{
[TestClass]
public class RiotApiTest : CommonTestBase
{
private static readonly RiotApi Api = RiotApi.GetDevelopmentInstance(ApiKey);
// The maximum time range allowed is one week, otherwise a 400 error code is returned.
private static readonly DateTime BeginTime = DateTime.Now.AddDays(-6);
private static DateTime EndTime => DateTime.Now;
#region Account Tests
[TestMethod]
[TestCategory("RiotApi"), TestCategory("Async")]
public void GetAccountByPuuidAsync_ExistingPuuid_ReturnAccount()
{
EnsureCredibility(() =>
{
var accountFromRid = Api.Account.GetAccountByRiotIdAsync(RiotSharp.Misc.Region.Americas, AccountGameName, AccountTagLine).Result;
var accountFromPuuid = Api.Account.GetAccountByPuuidAsync(RiotSharp.Misc.Region.Americas, accountFromRid.Puuid).Result;
Assert.AreEqual(accountFromRid.Puuid, accountFromPuuid.Puuid);
});
}
[TestMethod]
[TestCategory("RiotApi"), TestCategory("Async")]
public void GetAccounBytRiotIdAsync_ExistingAccount_ReturnAccount()
{
EnsureCredibility(() =>
{
var account = Api.Account.GetAccountByRiotIdAsync(RiotSharp.Misc.Region.Americas, AccountGameName, AccountTagLine).Result;
Assert.IsNotNull(account.Puuid);
Assert.IsNotNull(account.GameName);
Assert.IsNotNull(account.TagLine);
});
}
[TestMethod]
[TestCategory("RiotApi"), TestCategory("Async")]
public void GetActiveShardByPuuidAsync_LoR_ExistingPuuid_ReturnActiveShard()
{
EnsureCredibility(() =>
{
var accountFromRid = Api.Account.GetAccountByRiotIdAsync(RiotSharp.Misc.Region.Americas, AccountGameName, AccountTagLine).Result;
var activeShard = Api.Account.GetActiveShardByPuuidAsync(RiotSharp.Misc.Region.Americas, Endpoints.AccountEndpoint.Enums.Game.LoR, accountFromRid.Puuid).Result;
Assert.AreEqual(activeShard.Puuid, accountFromRid.Puuid);
});
}
#endregion
#region Summoner Tests
[TestMethod]
[TestCategory("RiotApi"), TestCategory("Async")]
public void GetSummonerBySummonerIdAsync_ExistingId_ReturnSummoner()
{
EnsureCredibility(() =>
{
var summonerFromName = Api.Summoner.GetSummonerByNameAsync(Summoner1Platform, Summoner1Name).Result;
var summoner = Api.Summoner.GetSummonerBySummonerIdAsync(Summoner1Platform, summonerFromName.Id);
Assert.AreEqual(Summoner1Name, summoner.Result.Name);
});
}
[TestMethod]
[TestCategory("RiotApi"), TestCategory("Async")]
public void GetSummonerByAccountIdAsync_ExistingAccountId_ReturnSummoner()
{
EnsureCredibility(() =>
{
var summonerFromName = Api.Summoner.GetSummonerByNameAsync(Summoner1Platform, Summoner1Name).Result;
var summoner = Api.Summoner.GetSummonerByAccountIdAsync(Summoner1Platform, summonerFromName.AccountId);
Assert.AreEqual(Summoner1Name, summoner.Result.Name);
});
}
[TestMethod]
[TestCategory("RiotApi"), TestCategory("Async")]
public void GetSummonerByNameAsync_ExistingName_ReturnSummoner()
{
EnsureCredibility(() =>
{
var summoner = Api.Summoner.GetSummonerByNameAsync(Summoner1Platform, Summoner1Name);
Assert.AreEqual(Summoner1Name, summoner.Result.Name);
});
}
[TestMethod]
[TestCategory("RiotApi"), TestCategory("Async")]
public void GetSummonerBySummonerPuuidAsync_ExistingId_ReturnSummoner()
{
EnsureCredibility(() =>
{
var accountFromRid = Api.Account.GetAccountByRiotIdAsync(RiotSharp.Misc.Region.Americas, AccountGameName, AccountTagLine).Result;
var summoner = Api.Summoner.GetSummonerByPuuidAsync(Summoner1Platform, accountFromRid.Puuid);
Assert.AreEqual(Summoner1Name, summoner.Result.Name);
});
}
#endregion
#region Champion Tests
[TestMethod]
[TestCategory("RiotApi"), TestCategory("Async")]
public void GetChampionRotationAsync_TestChampionRotationValues_ReturnAnChampionRotation()
{
EnsureCredibility(() =>
{
var championRotation = Api.Champion.GetChampionRotationAsync(Summoner1Platform).Result;
Assert.IsTrue(championRotation.FreeChampionIds.Count() >= 14);
Assert.IsTrue(championRotation.FreeChampionIdsForNewPlayers.Count() >= 10);
Assert.IsTrue(championRotation.MaxNewPlayerLevel > 0);
});
}
#endregion
#region League Tests
[TestMethod]
[TestCategory("RiotApi"), TestCategory("Async")]
public void GetLeagueEntriesBySummonerAsync_ProperlyImplementEncryptedSummonerId_ReturnTrue()
{
EnsureCredibility(() =>
{
// TODO: Properly implement encrypted SummonerId tests
return;
var leagues = Api.League.GetLeagueEntriesBySummonerAsync(RiotApiTestBase.SummonersPlatform, RiotApiTestBase.SummonerIds.FirstOrDefault());
Assert.IsTrue(leagues.Result.Count > 0);
});
}
[TestMethod]
[TestCategory("RiotApi"), TestCategory("Async")]
public void GetLeagueByIdAsync_ProperlyImplementLeagueId_ReturnTrue()
{
EnsureCredibility(() =>
{
// TODO: Properly implement League id test
return;
var leagues = Api.League.GetLeagueByIdAsync(RiotApiTestBase.SummonersPlatform, "LEAGUE-ID-HERE");
Assert.IsTrue(leagues.Result.Queue != null);
});
}
[TestMethod]
[TestCategory("RiotApi"), TestCategory("Async")]
public void GetLeagueEntriesAsync_GetLeagueEntries_ReturnLeagueEntries()
{
EnsureCredibility(() =>
{
var leagues = Api.League.GetLeagueEntriesAsync(RiotApiTestBase.SummonersPlatform,
Endpoints.LeagueEndpoint.Enums.Division.I,
Endpoints.LeagueEndpoint.Enums.Tier.Bronze,
RiotSharp.Misc.Queue.RankedSolo5x5);
Assert.IsTrue(leagues.Result.Count > 0);
});
}
[TestMethod]
[TestCategory("RiotApi"), TestCategory("Async")]
public void GetLeagueGrandmastersByQueueAsync_GetLeagueGrandmastersByQueue_ReturnLeagueGrandmastersByQueue()
{
EnsureCredibility(() =>
{
var leagues = Api.League.GetLeagueGrandmastersByQueueAsync(RiotApiTestBase.SummonersPlatform, RiotSharp.Misc.Queue.RankedSolo5x5);
Assert.IsTrue(leagues.Result.Queue != null);
});
}
[TestMethod]
[TestCategory("RiotApi"), TestCategory("Async")]
public void GetChallengerLeagueAsync_GetsAChallengerLeague_ReturnChallengerLeague()
{
EnsureCredibility(() =>
{
var league = Api.League.GetChallengerLeagueAsync(Summoner1Platform, RiotApiTestBase.Queue);
Assert.IsTrue(league.Result.Entries.Count > 0);
});
}
[TestMethod]
[TestCategory("RiotApi"), TestCategory("Async")]
public void GetMasterLeagueAsync_GetsAMasterLeague_ReturnMasterLeague()
{
EnsureCredibility(() =>
{
var league = Api.League.GetMasterLeagueAsync(Summoner1Platform, RiotApiTestBase.Queue);
Assert.IsTrue(league.Result.Entries.Count > 0);
});
}
#endregion
#region Match Tests
[TestMethod]
[TestCategory("RiotApi"), TestCategory("Async")]
public void GetMatchAsync_GetMatchPerks_ReturnMatchPerks()
{
EnsureCredibility(() =>
{
var match = Api.Match.GetMatchAsync(RiotSharp.Misc.Region.Americas, RiotApiTestBase.GameId).Result;
Assert.IsNotNull(match);
Assert.IsNotNull(match.Metadata);
Assert.AreEqual(RiotApiTestBase.GameId, match.Metadata.MatchId);
Assert.IsNotNull(match.Info);
Assert.IsNotNull(match.Info.Participants);
Assert.IsNotNull(match.Info.Teams);
foreach (var participant in match.Info.Participants)
{
Assert.IsNotNull(participant.Perks);
Assert.IsNotNull(participant.Perks.StatPerks);
Assert.IsNotNull(participant.Perks.Styles);
Assert.AreEqual(2, participant.Perks.Styles.Count);
foreach (var style in participant.Perks.Styles)
{
Assert.IsNotNull(style);
foreach (var selection in style.Selections)
{
Assert.IsTrue(selection.Perk != 0);
}
}
}
});
}
[TestMethod]
[TestCategory("RiotApi"), TestCategory("Async")]
public void GetMatchTimelineAsync_GetMatchTimeline_ReturnMatchTimeline()
{
EnsureCredibility(() =>
{
var matchTimeline = Api.Match.GetMatchTimelineAsync(RiotApiTestBase.SummonersRegion, RiotApiTestBase.GameId).Result;
Assert.IsNotNull(matchTimeline);
Assert.IsNotNull(matchTimeline.Info);
Assert.IsNotNull(matchTimeline.Info.Frames);
Assert.AreEqual(TimeSpan.FromMilliseconds(0), matchTimeline.Info.Frames.First().Timestamp);
Assert.AreEqual(TimeSpan.FromMilliseconds(60000), matchTimeline.Info.FrameInterval);
});
}
[TestMethod]
[TestCategory("RiotApi"), TestCategory("Async")]
public void GetMatchListAsync_GetMatchList_ReturnMatchList()
{
EnsureCredibility(() =>
{
var summonerFromName = Api.Summoner.GetSummonerByNameAsync(Summoner1Platform, Summoner1Name).Result;
var matches = Api.Match.GetMatchListAsync(Summoner1Region, summonerFromName.Puuid).Result;
Assert.IsTrue(matches.Any());
});
}
[TestMethod]
[Ignore] // TODO: Unstable IDs
[TestCategory("RiotApi"), TestCategory("Async")]
public void GetMatchListAsync_GetMatchListQueues_ReturnMatchList()
{
EnsureData(() =>
{
EnsureCredibility(() =>
{
var matches = Api.Match.GetMatchListAsync(RiotApiTestBase.SummonersRegion,
RiotApiTestBase.AccountIds.First(), null,
RiotApiTestBase.QueueId).Result;
Assert.IsTrue(matches.Any());
});
}, "No Matches found fot the test summoner (404).");
}
// TODO
//[TestMethod]
//[TestCategory("RiotApi"), TestCategory("Async")]
//public void GetMatchListAsync_GetMatchListDateTimes_ReturnMatchList()
//{
// EnsureCredibility(() =>
// {
// var matches = Api.Match.GetMatchListAsync(RiotApiTestBase.SummonersRegion,
// RiotApiTestBase.AccountIds.First(), null, null, null, BeginTime, EndTime).Result.Matches;
// foreach (var match in matches)
// {
// Assert.IsTrue(DateTime.Compare(match.Timestamp, BeginTime) >= 0);
// Assert.IsTrue(DateTime.Compare(match.Timestamp, EndTime) <= 0);
// }
// });
//}
// TODO
//[TestMethod]
//[TestCategory("RiotApi"), TestCategory("Async")]
//public void GetMatchListAsync_UseTheIndexToTest_ReturnMatches()
//{
// EnsureCredibility(() =>
// {
// const int beginIndex = 0;
// const int endIndex = 32;
// var matches = Api.Match.GetMatchListAsync(RiotApiTestBase.SummonersRegion,
// RiotApiTestBase.Summoner1AccountId, null, null, null, null, null, beginIndex, endIndex).Result.Matches;
// Assert.IsTrue(matches.Count <= endIndex - beginIndex);
// });
//}
#endregion
#region Spectator Tests
[Ignore] // Needs to be manually adjusted for testing
[TestMethod]
[TestCategory("RiotApi"), TestCategory("Async")]
public void GetCurrentGameAsync_GetCurrentGame_ReturnGetCurrentGame()
{
EnsureCredibility(() =>
{
var currentGame = Api.Spectator.GetCurrentGameAsync(RiotSharp.Misc.Region.Euw, "w1_k11kGq3N2zydfKN5xc7XcGwv-4jrnJJGsuQfHJmDFVFs").Result;
Assert.IsNotNull(currentGame);
Assert.IsTrue(currentGame.GameId != 0);
Assert.IsNotNull(currentGame.Participants);
Assert.IsNotNull(currentGame.GameStartTime);
Assert.IsNotNull(currentGame.GameQueueType);
Assert.IsNotNull(currentGame.Observers);
foreach (var participant in currentGame.Participants)
{
Assert.IsNotNull(participant.Perks);
Assert.IsNotNull(participant.GameCustomizationObjects);
}
});
}
[TestMethod]
[TestCategory("RiotApi"), TestCategory("Async")]
public void GetFeaturedGamesAsync_GetFeaturedGames_ReturnGetFeaturedGames()
{
EnsureCredibility(() =>
{
var games = Api.Spectator.GetFeaturedGamesAsync(Summoner1Platform).Result;
Assert.IsNotNull(games);
Assert.IsNotNull(games.GameList);
foreach (var game in games.GameList)
{
Assert.IsNotNull(game);
Assert.IsTrue(game.GameId != 0);
Assert.IsNotNull(game.Participants);
Assert.IsNotNull(game.GameStartTime);
Assert.IsNotNull(game.GameQueueType);
Assert.IsNotNull(game.Observers);
}
});
}
#endregion
#region Champion Mastery Tests
[TestMethod]
[TestCategory("RiotApi"), TestCategory("Async")]
public void GetChampionMasteryAsync_GetAChampionMastery_ReturnChampionMastery()
{
EnsureCredibility(() =>
{
var summonerFromName = Api.Summoner.GetSummonerByNameAsync(Summoner1Platform, Summoner1Name).Result;
var championMastery = Api.ChampionMastery.GetChampionMasteryAsync(Summoner1Platform,
summonerFromName.Id, RiotApiTestBase.Summoner1MasteryChampionId).Result;
Assert.AreEqual(RiotApiTestBase.Summoner1MasteryChampionId,
championMastery.ChampionId);
Assert.AreEqual(RiotApiTestBase.Summoner1MasteryChampionLevel,
championMastery.ChampionLevel);
});
}
[TestMethod]
[TestCategory("RiotApi"), TestCategory("Async")]
public void GetChampionsMasteriesAsync_GetsChampionMasteries_ReturnChampionMasteries()
{
EnsureCredibility(() =>
{
var summonerFromName = Api.Summoner.GetSummonerByNameAsync(Summoner1Platform, Summoner1Name).Result;
var allChampionsMastery = Api.ChampionMastery.GetChampionMasteriesAsync(
Summoner1Platform, summonerFromName.Id).Result;
Assert.IsNotNull(allChampionsMastery.Find(championMastery =>
championMastery.ChampionId == RiotApiTestBase.Summoner1MasteryChampionId));
});
}
[TestMethod]
[TestCategory("RiotApi"), TestCategory("Async")]
public void GetTotalChampionMasteryScoreAsync_GetsTheTotalChampionMasteryScore_ReturnTotalChampionMasteryScore()
{
EnsureCredibility(() =>
{
var summonerFromName = Api.Summoner.GetSummonerByNameAsync(Summoner1Platform, Summoner1Name).Result;
var totalChampionMasteryScore = Api.ChampionMastery.GetTotalChampionMasteryScoreAsync(
Summoner1Platform, summonerFromName.Id).Result;
Assert.IsTrue(totalChampionMasteryScore > -1);
});
}
#endregion
#region Third Party Tests
[TestMethod]
[TestCategory("RiotApi")]
public void GetThirdPartyCodeBySummonerIdAsync_GetThirdPartyCodeBySummonerId_ReturnThirdPartyCodeBySummonerIdResult()
{
EnsureData(() =>
{
EnsureCredibility(() =>
{
var summonerFromName = Api.Summoner.GetSummonerByNameAsync(Summoner3Platform, Summoner3Name).Result;
var code = Api.ThirdParty.GetThirdPartyCodeBySummonerIdAsync(Summoner3Platform, summonerFromName.Id).Result;
Assert.AreEqual(RiotApiTestBase.ThirdPartyCode, code);
});
}, "Third party code was not found for the summoner. (404)");
}
[TestMethod]
[TestCategory("RiotApi"), TestCategory("Async")]
public void GetThirdPartyCodeBySummonerIdAsync_GetThirdPartyCodeBySummonerId_ReturnThirdPartyCodeBySummonerId()
{
EnsureData(() =>
{
EnsureCredibility(() =>
{
var summonerFromName = Api.Summoner.GetSummonerByNameAsync(Summoner3Platform, Summoner3Name).Result;
var code = Api.ThirdParty.GetThirdPartyCodeBySummonerIdAsync(Summoner3Platform, summonerFromName.Id);
Assert.AreEqual(RiotApiTestBase.ThirdPartyCode, code.Result);
});
}, "Third party code was not found for the summoner. (404)");
}
#endregion
}
}
| {
"content_hash": "0558485a1274a7cc90cc983bc4bc1486",
"timestamp": "",
"source": "github",
"line_count": 463,
"max_line_length": 176,
"avg_line_length": 40.388768898488124,
"alnum_prop": 0.5981818181818181,
"repo_name": "BenFradet/RiotSharp",
"id": "d8e457484c4e7fa766761815f782ccaa869208f3",
"size": "18702",
"binary": false,
"copies": "2",
"ref": "refs/heads/develop",
"path": "RiotSharp.Test/RiotApiTest.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "485835"
}
],
"symlink_target": ""
} |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ceph</groupId>
<artifactId>rados</artifactId>
<packaging>jar</packaging>
<version>0.6.0-SNAPSHOT</version>
<name>rados java bindings</name>
<description>Java API for the RADOS C library</description>
<url>http://www.ceph.com</url>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<scm>
<url>http://www.github.com/ceph/rados-java</url>
<developerConnection>scm:git:https://github.com/ceph/rados-java</developerConnection>
<connection>scm:git:https://github.com/ceph/rados-java</connection>
</scm>
<developers>
<developer>
<id>wido</id>
<name>Wido den Hollander</name>
<email>wido@denhollander.io</email>
<url>https://blog.widodh.nl/</url>
</developer>
</developers>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<com.ceph.rados.skipTests>false</com.ceph.rados.skipTests>
</properties>
<build>
<defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/dependencies</outputDirectory>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<skipTests>${com.ceph.rados.skipTests}</skipTests>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>4.5.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.19</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
| {
"content_hash": "73fb608cb292913e3cad2d94f08ff859",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 212,
"avg_line_length": 33.234234234234236,
"alnum_prop": 0.5673624288425048,
"repo_name": "ceph/rados-java",
"id": "d3d994207ffe33d5f1d3786927a3edb4be00b9ac",
"size": "3689",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "629"
},
{
"name": "Java",
"bytes": "204639"
},
{
"name": "Shell",
"bytes": "11516"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
Index Fungorum
#### Published in
null
#### Original name
Lecidea piperis var. circuncincta Nyl.
### Remarks
null | {
"content_hash": "a223eabb4155c092d006787dd68353ef",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 38,
"avg_line_length": 11,
"alnum_prop": 0.7132867132867133,
"repo_name": "mdoering/backbone",
"id": "242fc4a884d4d80696bb36d6aff85d493112ff77",
"size": "205",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Fungi/Ascomycota/Lecanoromycetes/Lecanorales/Malmideaceae/Malmidea/Malmidea piperis/Lecidea piperis circuncincta/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
using System;
using System.Linq;
using System.Collections.Generic;
using System.Data.Entity;
using FinishLinePics.App_Architecture.Activators;
using FinishLinePics.App_Architecture.Services.Data;
using Highway.Data;
using FinishLinePics.Models.Entities;
using FinishLinePics.DataAccessLayer.Configs;
using FinishLinePics.DataAccessLayer;
[assembly: WebActivatorEx.PostApplicationStartMethod(
typeof(DatabaseInitializerActivator),
"PostStartup")]
namespace FinishLinePics.App_Architecture.Activators
{
public static class DatabaseInitializerActivator
{
public static void PostStartup()
{
#pragma warning disable 618
var initializer = IoC.Container.Resolve<IDatabaseInitializer<DomainContext<Domain>>>();
#pragma warning restore 618
Database.SetInitializer(initializer);
}
}
} | {
"content_hash": "d770065162c1aab4eb95f75b62fe6ff9",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 99,
"avg_line_length": 31.25925925925926,
"alnum_prop": 0.7748815165876777,
"repo_name": "daveh551/finishlinepics",
"id": "365477b0bc6c7ef0289c6470c5680c236cfeb472",
"size": "875",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "FinishLinePics/App_Architecture/Activators/DatabaseInitializerActivator.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "216"
},
{
"name": "C#",
"bytes": "368048"
},
{
"name": "CSS",
"bytes": "3139"
},
{
"name": "HTML",
"bytes": "10196"
},
{
"name": "JavaScript",
"bytes": "267218"
}
],
"symlink_target": ""
} |
import { expect } from 'chai'
import { it, describe } from 'mocha'
import { setupTest } from 'ember-mocha'
describe('Unit | Service | current challenge', function(hooks) {
setupTest(hooks)
// Replace this with your real tests.
it('exists', function() {
let service = this.owner.lookup('service:current-challenge')
expect(service).to.be.ok
})
})
| {
"content_hash": "6a155bbb90fc8aa52096e9813a36f2ff",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 64,
"avg_line_length": 27.923076923076923,
"alnum_prop": 0.6804407713498623,
"repo_name": "opensource-challenge/opensource-challenge-client",
"id": "c340a7ab59440615cd3ecdc22f2472d1c874835c",
"size": "363",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/unit/current-challenge/service-test-test.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "580"
},
{
"name": "Dockerfile",
"bytes": "2317"
},
{
"name": "HTML",
"bytes": "2558"
},
{
"name": "Handlebars",
"bytes": "27115"
},
{
"name": "JavaScript",
"bytes": "154146"
},
{
"name": "SCSS",
"bytes": "17492"
}
],
"symlink_target": ""
} |
FROM balenalib/etcher-pro-ubuntu:cosmic-build
ENV GO_VERSION 1.15.6
RUN mkdir -p /usr/local/go \
&& curl -SLO "https://storage.googleapis.com/golang/go$GO_VERSION.linux-arm64.tar.gz" \
&& echo "f87515b9744154ffe31182da9341d0a61eb0795551173d242c8cad209239e492 go$GO_VERSION.linux-arm64.tar.gz" | sha256sum -c - \
&& tar -xzf "go$GO_VERSION.linux-arm64.tar.gz" -C /usr/local/go --strip-components=1 \
&& rm -f go$GO_VERSION.linux-arm64.tar.gz
ENV GOROOT /usr/local/go
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
WORKDIR $GOPATH
CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"]
RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@golang.sh" \
&& echo "Running test-stack@golang" \
&& chmod +x test-stack@golang.sh \
&& bash test-stack@golang.sh \
&& rm -rf test-stack@golang.sh
RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v8 \nOS: Ubuntu cosmic \nVariant: build variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nGo v1.15.6 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info
RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \
&& chmod +x /bin/sh-shim \
&& cp /bin/sh /bin/sh.real \
&& mv /bin/sh-shim /bin/sh | {
"content_hash": "8926c09b8a5d66667e07c7abd437bbee",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 674,
"avg_line_length": 63.806451612903224,
"alnum_prop": 0.7259858442871587,
"repo_name": "nghiant2710/base-images",
"id": "1988a4d58b0cf6aed13aab2c938bced05a802b01",
"size": "1999",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "balena-base-images/golang/etcher-pro/ubuntu/cosmic/1.15.6/build/Dockerfile",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "144558581"
},
{
"name": "JavaScript",
"bytes": "16316"
},
{
"name": "Shell",
"bytes": "368690"
}
],
"symlink_target": ""
} |
import * as React from "react";
import { t } from "i18next";
import { WeedDetectorConfig } from "./config";
import { WidgetHeader } from "../../ui/index";
import { WD_ENV } from "./remote_env/interfaces";
import { envSave } from "./remote_env/actions";
import { Popover } from "@blueprintjs/core";
type ClickHandler = React.EventHandler<React.MouseEvent<HTMLButtonElement>>;
interface Props {
onSave?: ClickHandler;
onTest?: ClickHandler;
onDeletionClick?: ClickHandler;
onCalibrate?: ClickHandler;
deletionProgress?: string | undefined;
title: string;
help: string;
env?: Partial<WD_ENV>;
}
export function TitleBar({
onSave,
onTest,
deletionProgress,
onDeletionClick,
onCalibrate,
env,
title,
help
}: Props) {
return (
<WidgetHeader helpText={help} title={title}>
<button
hidden={!onSave}
onClick={onSave}
className="fb-button green" >
{t("SAVE")}
</button>
<button
hidden={!onTest}
onClick={onTest}
className="fb-button yellow" >
{t("TEST")}
</button>
<button
hidden={!onDeletionClick}
onClick={onDeletionClick}
className="fb-button red" >
{deletionProgress || t("CLEAR WEEDS")}
</button>
<button
hidden={!onCalibrate}
onClick={onCalibrate}
className="fb-button green" >
{t("Calibrate")}
</button>
<div hidden={!env}>
<Popover>
<i className="fa fa-cog" />
{(env && <WeedDetectorConfig
values={env}
onChange={envSave} />)}
</Popover>
</div>
</WidgetHeader>
);
}
| {
"content_hash": "e0782e287d5d6c06a299dc60f123c553",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 76,
"avg_line_length": 24.397058823529413,
"alnum_prop": 0.5907172995780591,
"repo_name": "MrChristofferson/Farmbot-Web-API",
"id": "1050afbf2cd3bc5ca9c1c141baf05642c5682cfa",
"size": "1659",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "webpack/farmware/weed_detector/title.tsx",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "54414"
},
{
"name": "HTML",
"bytes": "34344"
},
{
"name": "JavaScript",
"bytes": "104062"
},
{
"name": "Ruby",
"bytes": "270903"
},
{
"name": "TypeScript",
"bytes": "735777"
}
],
"symlink_target": ""
} |
<div id="" class="field formio-component formio-component-form formio-component-label-hidden" ref="component">
<div class="formio-form formio-read-only ui form" ref="webform" novalidate>
<div id="checkbox" class="field form-group has-feedback formio-component formio-component-checkbox formio-component-checkbox " ref="component">
<div class="ui checkbox">
<input ref="input" id="checkbox" name="data[checkbox]" type="checkbox" class="form-check-input" lang="en" disabled="disabled" value="0">
</input>
<label class="" for="checkbox">
<span>Checkbox</span>
</label>
</div>
<div ref="messageContainer"></div>
</div>
<div id="form" class="field form-group has-feedback formio-component formio-component-form formio-hidden" ref="component">
</div>
<div id="submit" class="field form-group has-feedback formio-component formio-component-button formio-component-submit form-group" ref="component">
<button ref="button" class="ui button primary " name="data[submit]" type="submit" class="btn btn-primary btn-md" lang="en" disabled="disabled">
Submit
</button>
<div ref="buttonMessageContainer">
<span class="help-block" ref="buttonMessage"></span>
</div>
<div ref="messageContainer"></div>
</div>
</div>
<div ref="messageContainer"></div>
</div> | {
"content_hash": "995a33ff65629664c4843aafd5615b7d",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 152,
"avg_line_length": 53,
"alnum_prop": 0.6661828737300436,
"repo_name": "formio/formio.js",
"id": "39c61243388debd8f701a994c1691999700d3f45",
"size": "1378",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/renders/form-semantic-readOnly-formComponentWithConditionalRenderingForm.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "3607"
},
{
"name": "EJS",
"bytes": "61493"
},
{
"name": "HTML",
"bytes": "1990204"
},
{
"name": "JavaScript",
"bytes": "3152153"
},
{
"name": "Less",
"bytes": "517387"
},
{
"name": "Ruby",
"bytes": "465"
},
{
"name": "SCSS",
"bytes": "614566"
}
],
"symlink_target": ""
} |
package org.asynchttpclient.request.body.multipart;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.asynchttpclient.Dsl.*;
import static org.asynchttpclient.test.TestUtils.*;
import static org.testng.Assert.*;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import java.util.zip.GZIPInputStream;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.fileupload.FileItemIterator;
import org.apache.commons.fileupload.FileItemStream;
import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.apache.commons.fileupload.util.Streams;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.asynchttpclient.AbstractBasicTest;
import org.asynchttpclient.AsyncHttpClient;
import org.asynchttpclient.Request;
import org.asynchttpclient.RequestBuilder;
import org.asynchttpclient.Response;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
/**
* @author dominict
*/
public class MultipartUploadTest extends AbstractBasicTest {
public static byte GZIPTEXT[] = new byte[] { 31, -117, 8, 8, 11, 43, 79, 75, 0, 3, 104, 101, 108, 108, 111, 46, 116, 120, 116, 0, -53, 72, -51, -55, -55, -25, 2, 0, 32, 48,
58, 54, 6, 0, 0, 0 };
@BeforeClass
public void setUp() throws Exception {
port1 = findFreePort();
server = newJettyHttpServer(port1);
ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
context.addServlet(new ServletHolder(new MockMultipartUploadServlet()), "/upload/*");
server.setHandler(context);
server.start();
}
/**
* Tests that the streaming of a file works.
* @throws IOException
*/
@Test
public void testSendingSmallFilesAndByteArray() throws IOException {
String expectedContents = "filecontent: hello";
String expectedContents2 = "gzipcontent: hello";
String expectedContents3 = "filecontent: hello2";
String testResource1 = "textfile.txt";
String testResource2 = "gzip.txt.gz";
String testResource3 = "textfile2.txt";
File testResource1File = null;
try {
testResource1File = getClasspathFile(testResource1);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
fail("unable to find " + testResource1);
}
File testResource2File = null;
try {
testResource2File = getClasspathFile(testResource2);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
fail("unable to find " + testResource2);
}
File testResource3File = null;
try {
testResource3File = getClasspathFile(testResource3);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
fail("unable to find " + testResource3);
}
List<File> testFiles = new ArrayList<>();
testFiles.add(testResource1File);
testFiles.add(testResource2File);
testFiles.add(testResource3File);
List<String> expected = new ArrayList<>();
expected.add(expectedContents);
expected.add(expectedContents2);
expected.add(expectedContents3);
List<Boolean> gzipped = new ArrayList<>();
gzipped.add(false);
gzipped.add(true);
gzipped.add(false);
boolean tmpFileCreated = false;
File tmpFile = File.createTempFile("textbytearray", ".txt");
try (FileOutputStream os = new FileOutputStream(tmpFile)) {
IOUtils.write(expectedContents.getBytes(UTF_8), os);
tmpFileCreated = true;
testFiles.add(tmpFile);
expected.add(expectedContents);
gzipped.add(false);
} catch (FileNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
if (!tmpFileCreated) {
fail("Unable to test ByteArrayMultiPart, as unable to write to filesystem the tmp test content");
}
try (AsyncHttpClient c = asyncHttpClient(config().setFollowRedirect(true))) {
RequestBuilder builder = post("http://localhost" + ":" + port1 + "/upload/bob");
builder.addBodyPart(new FilePart("file1", testResource1File, "text/plain", UTF_8));
builder.addBodyPart(new FilePart("file2", testResource2File, "application/x-gzip", null));
builder.addBodyPart(new StringPart("Name", "Dominic"));
builder.addBodyPart(new FilePart("file3", testResource3File, "text/plain", UTF_8));
builder.addBodyPart(new StringPart("Age", "3"));
builder.addBodyPart(new StringPart("Height", "shrimplike"));
builder.addBodyPart(new StringPart("Hair", "ridiculous"));
builder.addBodyPart(new ByteArrayPart("file4", expectedContents.getBytes(UTF_8), "text/plain", UTF_8, "bytearray.txt"));
Request r = builder.build();
Response res = c.executeRequest(r).get();
assertEquals(res.getStatusCode(), 200);
testSentFile(expected, testFiles, res, gzipped);
} catch (Exception e) {
e.printStackTrace();
fail("Download Exception");
} finally {
FileUtils.deleteQuietly(tmpFile);
}
}
/**
* Test that the files were sent, based on the response from the servlet
*
* @param expectedContents
* @param sourceFiles
* @param r
* @param deflate
*/
private void testSentFile(List<String> expectedContents, List<File> sourceFiles, Response r, List<Boolean> deflate) {
String content = r.getResponseBody();
assertNotNull("===>" + content);
logger.debug(content);
String[] contentArray = content.split("\\|\\|");
// TODO: this fail on win32
assertEquals(contentArray.length, 2);
String tmpFiles = contentArray[1];
assertNotNull(tmpFiles);
assertTrue(tmpFiles.trim().length() > 2);
tmpFiles = tmpFiles.substring(1, tmpFiles.length() - 1);
String[] responseFiles = tmpFiles.split(",");
assertNotNull(responseFiles);
assertEquals(responseFiles.length, sourceFiles.size());
logger.debug(Arrays.toString(responseFiles));
int i = 0;
for (File sourceFile : sourceFiles) {
File tmp = null;
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] sourceBytes = null;
try (FileInputStream instream = new FileInputStream(sourceFile)) {
byte[] buf = new byte[8092];
int len = 0;
while ((len = instream.read(buf)) > 0) {
baos.write(buf, 0, len);
}
logger.debug("================");
logger.debug("Length of file: " + baos.toByteArray().length);
logger.debug("Contents: " + Arrays.toString(baos.toByteArray()));
logger.debug("================");
System.out.flush();
sourceBytes = baos.toByteArray();
}
tmp = new File(responseFiles[i].trim());
logger.debug("==============================");
logger.debug(tmp.getAbsolutePath());
logger.debug("==============================");
System.out.flush();
assertTrue(tmp.exists());
byte[] bytes;
try (FileInputStream instream = new FileInputStream(tmp)) {
ByteArrayOutputStream baos2 = new ByteArrayOutputStream();
byte[] buf = new byte[8092];
int len = 0;
while ((len = instream.read(buf)) > 0) {
baos2.write(buf, 0, len);
}
bytes = baos2.toByteArray();
assertEquals(bytes, sourceBytes);
}
if (!deflate.get(i)) {
String helloString = new String(bytes);
assertEquals(helloString, expectedContents.get(i));
} else {
try (FileInputStream instream = new FileInputStream(tmp)) {
ByteArrayOutputStream baos3 = new ByteArrayOutputStream();
GZIPInputStream deflater = new GZIPInputStream(instream);
try {
byte[] buf3 = new byte[8092];
int len3 = 0;
while ((len3 = deflater.read(buf3)) > 0) {
baos3.write(buf3, 0, len3);
}
} finally {
deflater.close();
}
String helloString = new String(baos3.toByteArray());
assertEquals(expectedContents.get(i), helloString);
}
}
} catch (Exception e) {
e.printStackTrace();
fail("Download Exception");
} finally {
if (tmp != null)
FileUtils.deleteQuietly(tmp);
i++;
}
}
}
/**
* Takes the content that is being passed to it, and streams to a file on disk
*
* @author dominict
*/
public static class MockMultipartUploadServlet extends HttpServlet {
private static final Logger LOGGER = LoggerFactory.getLogger(MockMultipartUploadServlet.class);
private static final long serialVersionUID = 1L;
private int filesProcessed = 0;
private int stringsProcessed = 0;
public MockMultipartUploadServlet() {
}
public synchronized void resetFilesProcessed() {
filesProcessed = 0;
}
private synchronized int incrementFilesProcessed() {
return ++filesProcessed;
}
public int getFilesProcessed() {
return filesProcessed;
}
public synchronized void resetStringsProcessed() {
stringsProcessed = 0;
}
private synchronized int incrementStringsProcessed() {
return ++stringsProcessed;
}
public int getStringsProcessed() {
return stringsProcessed;
}
@Override
public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// Check that we have a file upload request
boolean isMultipart = ServletFileUpload.isMultipartContent(request);
if (isMultipart) {
List<String> files = new ArrayList<>();
ServletFileUpload upload = new ServletFileUpload();
// Parse the request
FileItemIterator iter = null;
try {
iter = upload.getItemIterator(request);
while (iter.hasNext()) {
FileItemStream item = iter.next();
String name = item.getFieldName();
try (InputStream stream = item.openStream()) {
if (item.isFormField()) {
LOGGER.debug("Form field " + name + " with value " + Streams.asString(stream) + " detected.");
incrementStringsProcessed();
} else {
LOGGER.debug("File field " + name + " with file name " + item.getName() + " detected.");
// Process the input stream
File tmpFile = File.createTempFile(UUID.randomUUID().toString() + "_MockUploadServlet", ".tmp");
tmpFile.deleteOnExit();
try (OutputStream os = new FileOutputStream(tmpFile)) {
byte[] buffer = new byte[4096];
int bytesRead;
while ((bytesRead = stream.read(buffer)) != -1) {
os.write(buffer, 0, bytesRead);
}
incrementFilesProcessed();
files.add(tmpFile.getAbsolutePath());
}
}
}
}
} catch (FileUploadException e) {
}
try (Writer w = response.getWriter()) {
w.write(Integer.toString(getFilesProcessed()));
resetFilesProcessed();
resetStringsProcessed();
w.write("||");
w.write(files.toString());
}
} else {
try (Writer w = response.getWriter()) {
w.write(Integer.toString(getFilesProcessed()));
resetFilesProcessed();
resetStringsProcessed();
w.write("||");
}
}
}
}
}
| {
"content_hash": "428e9236854cd2bd905ae92193b1e045",
"timestamp": "",
"source": "github",
"line_count": 373,
"max_line_length": 176,
"avg_line_length": 38.06970509383378,
"alnum_prop": 0.5544366197183098,
"repo_name": "dotta/async-http-client",
"id": "4c481c0d181170499fc20a2f69bfdf45f7b256cf",
"size": "14895",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "client/src/test/java/org/asynchttpclient/request/body/multipart/MultipartUploadTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "1433087"
}
],
"symlink_target": ""
} |
from __future__ import unicode_literals
"""This file is part of the django ERP project.
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.
"""
from django.test import TestCase
from . import *
from ..utils import get_dashboard_for
from ..signals import *
__author__ = 'Emanuele Bertoldi <emanuele.bertoldi@gmail.com>'
__copyright__ = 'Copyright (c) 2013-2015, django ERP Team'
__version__ = '0.0.1'
class SignalTestCase(TestCase):
def test_dashboard_auto_creation_for_users(self):
"""Tests a dashboard must be auto-created for new users.
"""
self.assertEqual(Region.objects.filter(slug="user_1_dashboard").count(), 0)
u1, n = get_user_model().objects.get_or_create(username="u1")
self.assertTrue(n)
self.assertEqual(Region.objects.filter(slug="user_1_dashboard").count(), 1)
def test_manage_author_permissions_on_dashboard(self):
"""Tests that "manage_author_permissions" auto-generate perms for author.
"""
u1, n = get_user_model().objects.get_or_create(username="u1")
dashboard = get_dashboard_for(u1.username)
self.assertTrue(ob.has_perm(u1, "pluggets.view_region", dashboard))
self.assertTrue(ob.has_perm(u1, "pluggets.change_region", dashboard))
self.assertTrue(ob.has_perm(u1, "pluggets.delete_region", dashboard))
def test_manage_author_permissions_on_plugget(self):
"""Tests that "manage_author_permissions" auto-generate perms for author.
"""
u2, n = get_user_model().objects.get_or_create(username="u2")
u3, n = get_user_model().objects.get_or_create(username="u3")
prev_user = logged_cache.user
# The current author ("logged" user) is now u2.
logged_cache.user = u2
p1, n = Plugget.objects.get_or_create(region=get_dashboard_for(u2.username), title="p1",
source="djangoerp.pluggets.base.dummy",
template="pluggets/base_plugget.html")
self.assertTrue(ob.has_perm(u2, "pluggets.view_plugget", p1))
self.assertTrue(ob.has_perm(u2, "pluggets.change_plugget", p1))
self.assertTrue(ob.has_perm(u2, "pluggets.delete_plugget", p1))
self.assertFalse(ob.has_perm(u3, "pluggets.view_plugget", p1))
self.assertFalse(ob.has_perm(u3, "pluggets.change_plugget", p1))
self.assertFalse(ob.has_perm(u3, "pluggets.delete_plugget", p1))
# Restores previous cached user.
logged_cache.user = prev_user
def test_dashboard_auto_deletion(self):
"""Tests automatic deletion of dashboards when their owners are deleted.
"""
d = None
try:
d = get_dashboard_for("u4")
except:
pass
self.assertEqual(d, None)
u4, n = get_user_model().objects.get_or_create(username="u4")
try:
d = get_dashboard_for("u4")
except:
pass
self.assertNotEqual(d, None)
u4.delete()
try:
d = get_dashboard_for("u4")
except:
d = None
self.assertEqual(d, None)
def test_dashboard_auto_deletion_fails_silently(self):
"""Tests silent failure of deletion when no dashboard is attached.
"""
u5, n = get_user_model().objects.get_or_create(username="u5")
d = get_dashboard_for("u5")
d.delete()
self.assertRaises(Region.DoesNotExist, lambda: get_dashboard_for(u5.username))
u5.delete()
| {
"content_hash": "bc2d229ea4b0d1578e9752d601641bc7",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 96,
"avg_line_length": 35.648648648648646,
"alnum_prop": 0.6345716451857468,
"repo_name": "mobb-io/django-erp",
"id": "bb7764a63f0c883110554e180294c610911762dc",
"size": "4003",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "djangoerp/pluggets/tests/test_signals.py",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "11442"
},
{
"name": "HTML",
"bytes": "37278"
},
{
"name": "JavaScript",
"bytes": "1666"
},
{
"name": "Python",
"bytes": "511749"
}
],
"symlink_target": ""
} |
import java.util.Random;
public class MinFirst implements PhilosopherHands {
public Fork[] selectForkOrder(Fork forkLeft, Fork forkRight) {
Fork[] returnVal = new Fork[2];
if (forkLeft.getID() < forkRight.getID()) {
returnVal[0] = forkLeft;
returnVal[1] = forkRight;
} else {
returnVal[0] = forkRight;
returnVal[1] = forkLeft;
}
return returnVal;
}
}
| {
"content_hash": "a48dfe1239684c9e4e6e3f900f29ca75",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 64,
"avg_line_length": 27,
"alnum_prop": 0.6370370370370371,
"repo_name": "flaviovdf/SO-2017-1",
"id": "5b6802f7c49196a51685f2d3076a3a27526dde92",
"size": "405",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "examples/problemssync/philosopher/MinFirst.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "18920"
},
{
"name": "Jupyter Notebook",
"bytes": "42714"
},
{
"name": "Makefile",
"bytes": "440"
},
{
"name": "Python",
"bytes": "5814"
},
{
"name": "Shell",
"bytes": "368"
}
],
"symlink_target": ""
} |
<?php
namespace Tests\Unit;
use App\Ratings\XFrameOptionsRating;
use GuzzleHttp\Client;
use GuzzleHttp\Handler\MockHandler;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Psr7\Response;
use Tests\TestCase;
class XFrameOptionsRatingTest extends TestCase
{
/** @test */
public function xFrameOptionsRating_rates_c_for_a_missing_header()
{
$client = $this->getMockedGuzzleClient([
new Response(200),
]);
$rating = new XFrameOptionsRating("http://testdomain", $client);
$this->assertEquals("C", $rating->getRating());
$this->assertEquals("The header is not set.", $rating->getComment());
}
/** @test */
public function xFrameOptionsRating_rates_c_when_wildcards_are_used()
{
$client = $this->getMockedGuzzleClient([
new Response(200, [
"X-Frame-Options" => "allow-from *"
]),
]);
$rating = new XFrameOptionsRating("http://testdomain", $client);
$this->assertEquals("C", $rating->getRating());
$this->assertEquals("The header contains wildcards and is thereby useless.", $rating->getComment());
}
/** @test */
public function xFrameOptionsRating_rates_a_when_set_and_no_wildcards_are_used()
{
$client = $this->getMockedGuzzleClient([
new Response(200, [
"X-Frame-Options" => "deny"
]),
]);
$rating = new XFrameOptionsRating("http://testdomain", $client);
$this->assertEquals("A", $rating->getRating());
$this->assertEquals("The header is set and does not contain any wildcard.", $rating->getComment());
}
/**
* This method sets and activates the GuzzleHttp Mocking functionality.
* @param array $responses
* @return Client
*/
protected function getMockedGuzzleClient(array $responses)
{
$mock = new MockHandler($responses);
$handler = HandlerStack::create($mock);
return (new Client(["handler" => $handler])) ;
}
}
| {
"content_hash": "6e02603b341050dea45980596b69bcff",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 108,
"avg_line_length": 31.323076923076922,
"alnum_prop": 0.612475442043222,
"repo_name": "Hackmanit/HTTP-Secure-Header-Scanner",
"id": "3685db9526be86731459d54b46b3d065e60a2959",
"size": "2036",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/Unit/Ratings/XFrameOptionsRatingTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "553"
},
{
"name": "HTML",
"bytes": "28556"
},
{
"name": "JavaScript",
"bytes": "19879"
},
{
"name": "PHP",
"bytes": "127279"
}
],
"symlink_target": ""
} |
#region << 版 本 注 释 >>
#endregion
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.Common;
using System.Data;
using Dos.ORM;
namespace Dos.ORM
{
/// <summary>
/// 执行存储过程
/// </summary>
public class ProcSection : Section
{
/// <summary>
///
/// </summary>
/// <param name="dbSession"></param>
/// <param name="procName"></param>
public ProcSection(DbSession dbSession, string procName)
: base(dbSession)
{
Check.Require(procName, "procName", Check.NotNullOrEmpty);
this.cmd = dbSession.Db.GetStoredProcCommand(procName);
}
/// <summary>
/// 返回的参数
/// </summary>
private List<string> outParameters = new List<string>();
/// <summary>
/// 设置事务
/// </summary>
/// <param name="tran"></param>
/// <returns></returns>
public ProcSection SetDbTransaction(DbTransaction tran)
{
this.tran = tran;
return this;
}
/// <summary>
/// 存储过程参数不要加前缀
/// </summary>
protected bool isParameterSpecial
{
get
{
return !(dbSession.Db.DbProvider is SqlServer.SqlServerProvider
|| dbSession.Db.DbProvider is SqlServer9.SqlServer9Provider
|| dbSession.Db.DbProvider is MsAccess.MsAccessProvider);
}
}
/// <summary>
/// 获取参数名字
/// </summary>
/// <param name="parameterName"></param>
/// <returns></returns>
protected string getParameterName(string parameterName)
{
Check.Require(parameterName, "parameterName", Check.NotNullOrEmpty);
if (!isParameterSpecial)
{
return dbSession.Db.DbProvider.BuildParameterName(parameterName);
}
else
{
return parameterName.TrimStart(dbSession.Db.DbProvider.ParamPrefix);
}
}
/// <summary>
/// 返回存储过程返回值
/// </summary>
/// <returns></returns>
public Dictionary<string, object> GetReturnValues()
{
Dictionary<string, object> returnValues = new Dictionary<string, object>();
foreach (string outParameter in outParameters)
{
returnValues.Add(outParameter, cmd.Parameters[getParameterName(outParameter)].Value);
}
return returnValues;
}
#region 添加参数
/// <summary>
/// 添加参数
/// </summary>
public ProcSection AddParameter(params DbParameter[] parameters)
{
dbSession.Db.AddParameter(this.cmd, parameters);
return this;
}
/// <summary>
/// 添加参数
/// </summary>
/// <param name="parameterName"></param>
/// <param name="value"></param>
/// <param name="dbType"></param>
/// <returns></returns>
public ProcSection AddInParameter(string parameterName, DbType dbType, object value)
{
return AddInParameter(parameterName, dbType, 0, value);
}
/// <summary>
/// 添加输入参数
/// </summary>
/// <param name="parameterName"></param>
/// <param name="value"></param>
/// <param name="dbType"></param>
/// <returns></returns>
public ProcSection AddInParameter(string parameterName, DbType dbType, int size, object value)
{
Check.Require(parameterName, "parameterName", Check.NotNullOrEmpty);
Check.Require(dbType, "dbType", Check.NotNullOrEmpty);
dbSession.Db.AddInParameter(this.cmd, parameterName, dbType, size, value);
return this;
}
/// <summary>
/// 添加输出参数
/// </summary>
/// <param name="parameterName"></param>
/// <param name="dbType"></param>
/// <returns></returns>
public ProcSection AddOutParameter(string parameterName, DbType dbType)
{
return AddOutParameter(parameterName, dbType, 0);
}
/// <summary>
/// 添加输出参数
/// </summary>
/// <param name="parameterName"></param>
/// <param name="dbType"></param>
/// <param name="size"></param>
/// <returns></returns>
public ProcSection AddOutParameter(string parameterName, DbType dbType, int size)
{
Check.Require(parameterName, "parameterName", Check.NotNullOrEmpty);
Check.Require(dbType, "dbType", Check.NotNullOrEmpty);
dbSession.Db.AddOutParameter(this.cmd, parameterName, dbType, size);
outParameters.Add(parameterName);
return this;
}
/// <summary>
/// 添加输入输出参数
/// </summary>
/// <param name="parameterName"></param>
/// <param name="dbType"></param>
/// <param name="value"></param>
/// <returns></returns>
public ProcSection AddInputOutputParameter(string parameterName, DbType dbType, object value)
{
return AddInputOutputParameter(parameterName, dbType, 0, value);
}
/// <summary>
/// 添加输入输出参数
/// </summary>
/// <param name="parameterName"></param>
/// <param name="dbType"></param>
/// <param name="value"></param>
/// <param name="size"></param>
/// <returns></returns>
public ProcSection AddInputOutputParameter(string parameterName, DbType dbType, int size, object value)
{
Check.Require(parameterName, "parameterName", Check.NotNullOrEmpty);
Check.Require(dbType, "dbType", Check.NotNullOrEmpty);
dbSession.Db.AddInputOutputParameter(this.cmd, parameterName, dbType, size, value);
outParameters.Add(parameterName);
return this;
}
/// <summary>
/// 添加返回参数
/// </summary>
/// <param name="parameterName"></param>
/// <param name="dbType"></param>
/// <returns></returns>
public ProcSection AddReturnValueParameter(string parameterName, DbType dbType)
{
return AddReturnValueParameter(parameterName, dbType, 0);
}
/// <summary>
/// 添加返回参数
/// </summary>
/// <param name="parameterName"></param>
/// <param name="dbType"></param>
/// <param name="size"></param>
/// <returns></returns>
public ProcSection AddReturnValueParameter(string parameterName, DbType dbType, int size)
{
Check.Require(parameterName, "parameterName", Check.NotNullOrEmpty);
Check.Require(dbType, "dbType", Check.NotNullOrEmpty);
dbSession.Db.AddReturnValueParameter(this.cmd, parameterName, dbType, size);
outParameters.Add(parameterName);
return this;
}
#endregion
#region 执行
/// <summary>
/// 操作参数名称
/// </summary>
protected void executeBefore()
{
if (isParameterSpecial)
{
if (cmd.Parameters != null && cmd.Parameters.Count > 0)
{
foreach (DbParameter dbpara in cmd.Parameters)
{
if (!string.IsNullOrEmpty(dbpara.ParameterName))
{
dbpara.ParameterName = dbpara.ParameterName.TrimStart(dbSession.Db.DbProvider.ParamPrefix);
}
}
}
}
}
/// <summary>
/// 返回单个值
/// </summary>
/// <returns></returns>
public override object ToScalar()
{
executeBefore();
return base.ToScalar();
}
/// <summary>
/// 返回DataReader
/// </summary>
/// <returns></returns>
public override IDataReader ToDataReader()
{
executeBefore();
return base.ToDataReader();
}
/// <summary>
/// 返回DataSet
/// </summary>
/// <returns></returns>
public override DataSet ToDataSet()
{
executeBefore();
return base.ToDataSet();
}
/// <summary>
/// 执行ExecuteNonQuery
/// </summary>
/// <returns></returns>
public override int ExecuteNonQuery()
{
executeBefore();
return base.ExecuteNonQuery();
}
#endregion
}
}
| {
"content_hash": "983eacc56fbc3ca1ae4df60faf7bfd32",
"timestamp": "",
"source": "github",
"line_count": 301,
"max_line_length": 119,
"avg_line_length": 28.953488372093023,
"alnum_prop": 0.5239242685025818,
"repo_name": "windygu/Dos.ORM",
"id": "cf71941a9a9244a80090cbcd0e29737744ed7b5b",
"size": "9372",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Section/ProcSection.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "186"
},
{
"name": "C#",
"bytes": "1802760"
},
{
"name": "CSS",
"bytes": "3708"
},
{
"name": "HTML",
"bytes": "1405786"
},
{
"name": "JavaScript",
"bytes": "24582"
}
],
"symlink_target": ""
} |
/* Code generated by IfcQuery EXPRESS generator, www.ifcquery.com */
#pragma once
#include <iostream>
#include <sstream>
#include <map>
#include "ifcpp/model/BasicTypes.h"
#include "ifcpp/model/BuildingObject.h"
// TYPE IfcClassificationReferenceSelect = SELECT (IfcClassification ,IfcClassificationReference);
class IFCQUERY_EXPORT IfcClassificationReferenceSelect : virtual public BuildingObject
{
public:
virtual shared_ptr<BuildingObject> getDeepCopy( BuildingCopyOptions& options ) = 0;
virtual void getStepParameter( std::stringstream& stream, bool is_select_type = false ) const = 0;
virtual const std::wstring toString() const = 0;
static shared_ptr<IfcClassificationReferenceSelect> createObjectFromSTEP( const std::wstring& arg, const std::map<int,shared_ptr<BuildingEntity> >& map );
};
| {
"content_hash": "c5bfa898f00ec7d1011cc751a8fb7b2a",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 155,
"avg_line_length": 43.36842105263158,
"alnum_prop": 0.7706310679611651,
"repo_name": "berndhahnebach/IfcPlusPlus",
"id": "577c312241298f749c7595f668b9fd74d3ed2ee7",
"size": "824",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "IfcPlusPlus/src/ifcpp/IFC4/include/IfcClassificationReferenceSelect.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "1370"
},
{
"name": "C",
"bytes": "4453"
},
{
"name": "C++",
"bytes": "11543025"
},
{
"name": "CMake",
"bytes": "12189"
},
{
"name": "CSS",
"bytes": "4880"
},
{
"name": "Makefile",
"bytes": "2305"
},
{
"name": "Objective-C",
"bytes": "92"
}
],
"symlink_target": ""
} |
using System.Web;
using System.Web.Optimization;
namespace MinistryPlatform.Translation
{
public class BundleConfig
{
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js",
"~/Scripts/respond.js"));
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/site.css"));
}
}
}
| {
"content_hash": "bd24a6a5596eeaeb6d62d3c60f1739b6",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 112,
"avg_line_length": 40.25,
"alnum_prop": 0.5838509316770186,
"repo_name": "crdschurch/mp-translation",
"id": "9fadb120096e6553b6367fb297f27db607e87186",
"size": "1129",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "MinistryPlatform.Translation/App_Start/BundleConfig.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "122"
},
{
"name": "C#",
"bytes": "848033"
},
{
"name": "CSS",
"bytes": "2626"
},
{
"name": "JavaScript",
"bytes": "10714"
}
],
"symlink_target": ""
} |
@implementation ArchiveEditCellViewController
@synthesize bibField;
@synthesize timePicker;
@synthesize timeHintLabel;
@synthesize timeLabel;
@synthesize placeHintLabel;
@synthesize placeLabel;
@synthesize saveButton;
@synthesize time;
@synthesize place;
@synthesize bib;
@synthesize delegate;
@synthesize index;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil type:(int)t{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
type = t;
self.title = @"Edit Data";
didChangeTime = NO;
}
return self;
}
- (void)viewDidLoad{
[super viewDidLoad];
if([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0)
[self setEdgesForExtendedLayout: UIRectEdgeNone];
UIImage *redButtonImage = [UIImage imageNamed:@"RedButton.png"];
UIImage *stretchedRedButton = [redButtonImage stretchableImageWithLeftCapWidth:12 topCapHeight:12];
UIImage *redButtonTapImage = [UIImage imageNamed:@"RedButtonTap.png"];
UIImage *stretchedRedButtonTap = [redButtonTapImage stretchableImageWithLeftCapWidth:12 topCapHeight:12];
UIImage *grayButtonImage = [UIImage imageNamed:@"GrayButton.png"];
UIImage *stretchedGrayButton = [grayButtonImage stretchableImageWithLeftCapWidth:12 topCapHeight:12];
[saveButton setBackgroundImage:stretchedRedButton forState:UIControlStateNormal];
[saveButton setBackgroundImage:stretchedRedButtonTap forState:UIControlStateHighlighted];
[saveButton setBackgroundImage:stretchedGrayButton forState:UIControlStateDisabled];
if(type == 0){ //Place + Time
[bibField setHidden:YES];
NSDate *timerDate = [NSDate dateWithTimeIntervalSince1970:time];
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setTimeZone: [NSTimeZone timeZoneForSecondsFromGMT:0.0]];
[formatter setDateFormat:@"HH:mm:ss.SS"];
NSString *timeString = [formatter stringFromDate:timerDate];
[timeLabel setText:timeString];
[placeLabel setText:place];
[self setPickerGivenTime];
}else if(type == 1){ // Bib + Time
[placeLabel setHidden:YES];
[placeHintLabel setHidden:YES];
NSDate *timerDate = [NSDate dateWithTimeIntervalSince1970:time];
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setTimeZone: [NSTimeZone timeZoneForSecondsFromGMT:0.0]];
[formatter setDateFormat:@"HH:mm:ss.SS"];
NSString *timeString = [formatter stringFromDate:timerDate];
[timeLabel setText:timeString];
[bibField setText:bib];
[self setPickerGivenTime];
}else{ // Place + Bib
[timeLabel setHidden:YES];
[timeHintLabel setHidden: YES];
[timePicker setHidden:YES];
[bibField setText: bib];
[placeLabel setText:place];
[bibField becomeFirstResponder];
}
}
- (void)setPickerGivenTime{
int hours = (int)time / 3600;
int minutes = (int)time / 60;
int seconds = (int)time % 60;
int centiseconds = round((double)(time - (int)time) * 100.0);
[timePicker selectRow:hours inComponent:0 animated:NO];
[timePicker selectRow:minutes inComponent:1 animated:NO];
[timePicker selectRow:seconds inComponent:2 animated:NO];
[timePicker selectRow:centiseconds inComponent:3 animated:NO];
}
- (void)actuallySaveChanges{
if(type == 0){
NSMutableDictionary *updateDict = [[NSMutableDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithDouble:time],@"Time",[timeLabel text],@"FTime",[placeLabel text],@"Place",nil];
[delegate updateRow:index withDict:updateDict];
}else if(type == 1){
NSMutableDictionary *updateDict = [[NSMutableDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithDouble:time],@"Time",[timeLabel text],@"FTime",[bibField text],@"Bib",nil];
[delegate updateRow:index withDict:updateDict];
}else{
NSMutableDictionary *updateDict = [[NSMutableDictionary alloc] initWithObjectsAndKeys:[bibField text],@"Bib",[placeLabel text],@"Place", nil];
[delegate updateRow:index withDict:updateDict];
}
[saveButton setEnabled: NO];
didChangeTime = NO;
}
- (IBAction)saveChanges:(id)sender{
if(didChangeTime){
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Time Changed" message:@"You have changed this runner's time. Updating this will reorder the entire list. Are you sure you wish to continue?" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Yes", nil];
[alert show];
[alert release];
}else{
[self actuallySaveChanges];
}
}
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex{
if(buttonIndex == 1){
[self actuallySaveChanges];
}
}
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView{
return 4; // Hours, minutes, seconds, centiseconds
}
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{
int hours = [pickerView selectedRowInComponent: 0];
int minutes = [pickerView selectedRowInComponent: 1];
int seconds = [pickerView selectedRowInComponent: 2];
int centiseconds = [pickerView selectedRowInComponent: 3];
[timeLabel setText: [NSString stringWithFormat:@"%.2i:%.2i:%.2i.%.2i", hours, minutes, seconds, centiseconds]];
self.time = (hours * 3600.0) + (minutes * 60.0) + (seconds * 1.0) + (centiseconds / 100.0);
if(type == 0){
[saveButton setEnabled: YES];
}else if(type == 1 && [[bibField text] length] > 0){
[saveButton setEnabled: YES];
}
didChangeTime = YES;
}
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component{
if(component == 0 || component == 3){
return 100;
}else{
return 60;
}
}
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component{
return [NSString stringWithFormat:@"%.2i", row];
}
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
if([string length] == 1){
if(textField.text.length < 5 && strchr("1234567890", [string characterAtIndex: 0])){
[saveButton setEnabled: YES];
return YES;
}else{
return NO;
}
}else if([string length] == 0){
[saveButton setEnabled: YES];
return YES;
}
return NO;
}
- (NSUInteger)supportedInterfaceOrientations{
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
return UIInterfaceOrientationMaskPortrait;
else
return UIInterfaceOrientationMaskLandscape;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
return UIInterfaceOrientationPortrait;
else
return UIInterfaceOrientationLandscapeLeft;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
return (interfaceOrientation == UIInterfaceOrientationPortrait);
else
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
@end
| {
"content_hash": "809b137aad89b3a31a00397f22c64941",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 280,
"avg_line_length": 38.604166666666664,
"alnum_prop": 0.6984619535887749,
"repo_name": "RunSignUp-Team/RunSignUp-Mobile",
"id": "7251bcd6f1d059f814b4ea480287f4a213a45316",
"size": "8134",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "RunSignup/ArchiveEditCellViewController.m",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "53744"
},
{
"name": "C++",
"bytes": "54452"
},
{
"name": "Objective-C",
"bytes": "479033"
},
{
"name": "Perl",
"bytes": "778"
}
],
"symlink_target": ""
} |
<?php
namespace app\test\core\logger;
use \app\test\TestCase;
class LoggerProviderTest extends TestCase
{
} | {
"content_hash": "bdc91f7e10e4bc22b8aaf4bfeb75983c",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 41,
"avg_line_length": 11.4,
"alnum_prop": 0.7456140350877193,
"repo_name": "daviscai/xhprof-viewer",
"id": "f75927618df685f8254d693c5ca0fb5faecf2338",
"size": "114",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "app/test/core/logger/LoggerProviderTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "3032"
},
{
"name": "JavaScript",
"bytes": "33623"
},
{
"name": "PHP",
"bytes": "127596"
}
],
"symlink_target": ""
} |
layout: page
title: Spring Networks Executive Retreat
date: 2016-05-24
author: Jeremy Humphrey
tags: weekly links, java
status: published
summary: Ut arcu metus, commodo at egestas ac.
banner: images/banner/leisure-02.jpg
booking:
startDate: 07/20/2016
endDate: 07/23/2016
ctyhocn: LAXVLHX
groupCode: SNER
published: true
---
Integer sapien lectus, cursus in nulla a, tempus dapibus turpis. Vivamus porta aliquam nisl, eu laoreet urna fringilla in. Phasellus facilisis dui at congue laoreet. Aenean ut quam in sapien dapibus mollis vitae ut lacus. Sed porta ex nibh. Mauris pharetra risus orci, non egestas mi lobortis at. Praesent eget facilisis sapien.
* Duis eget velit vel urna pulvinar scelerisque
* Donec euismod tortor nec sapien blandit blandit
* Sed egestas nisl id augue facilisis commodo non quis massa
* Aliquam venenatis velit vel consequat finibus
* Suspendisse sit amet felis sed libero dictum tempus nec nec massa.
Mauris ultricies luctus magna, in ultricies libero dictum ut. Sed sollicitudin lorem finibus, vulputate nunc et, convallis sapien. Sed sed vulputate ipsum. Cras risus nunc, dictum at euismod ac, dignissim eget nisl. Nullam lacinia, est sagittis pellentesque laoreet, tortor nunc sodales nisi, vitae mollis nunc mauris ut dolor. Integer pulvinar lorem turpis, vel placerat augue sollicitudin non. Cras pretium odio ipsum, gravida sollicitudin nulla sollicitudin a. Nullam et tortor est. Mauris at ullamcorper est, vitae eleifend orci. Vestibulum ultrices aliquet elit in tincidunt. In at aliquet diam. Donec sollicitudin mauris sit amet viverra ullamcorper. Vivamus tincidunt viverra lacus tempus pulvinar. Integer id mattis lorem. Vestibulum interdum hendrerit feugiat.
| {
"content_hash": "9f5d9ec1b0f43de25ede358d74b1a5dc",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 769,
"avg_line_length": 71.29166666666667,
"alnum_prop": 0.8077147866744594,
"repo_name": "KlishGroup/prose-pogs",
"id": "e7d506e682a8994f4e8f15e60f1057c8190d46b0",
"size": "1715",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "pogs/L/LAXVLHX/SNER/index.md",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
var debug = require('debug')('internal-client')
, bluebird = require('bluebird');
function normalizeArray(parts, allowAboveRoot) {
// if the path tries to go above the root, `up` ends up > 0
var up = 0;
for (var i = parts.length - 1; i >= 0; i--) {
var last = parts[i];
if (last == '.') {
parts.splice(i, 1);
} else if (last === '..') {
parts.splice(i, 1);
up++;
} else if (up) {
parts.splice(i, 1);
up--;
}
}
// if the path is allowed to go above the root, restore leading ..s
if (allowAboveRoot) {
for (; up--; up) {
parts.unshift('..');
}
}
return parts;
}
var normalizePath = function(path) {
var isAbsolute = path.charAt(0) === '/',
trailingSlash = path.slice(-1) === '/';
// Normalize the path
path = normalizeArray(path.split('/').filter(function(p) {
return !!p;
}), !isAbsolute).join('/');
if (!path && !isAbsolute) {
path = '.';
}
if (path && trailingSlash) {
path += '/';
}
return (isAbsolute ? '/' : '') + path;
};
function joinPath() {
var paths = Array.prototype.slice.call(arguments, 0);
return normalizePath(paths.filter(function(p, index) {
return p && typeof p === 'string';
}).join('/'));
}
exports.build = function(server, session, stack) {
var baseMethods
, dpd = {};
baseMethods = {
request: function(method, options, fn) {
var req
, res
, urlKey
, recursions
, recursionLimit
, deferred = bluebird.defer();
req = {
url: joinPath('/', options.path)
, method: method
, query: options.query
, body: options.body
, session: session
, isRoot: session && session.isRoot
, internal: true
, headers: {}
, on: function() {}
};
var callback = function(data, error) {
if (typeof fn === 'function') {
// call our callback
deferred.promise
.then(function () {
fn(data, error);
}, function () {
fn(data, error);
});
}
// resolve or reject promise
if (error) {
deferred.reject(error);
} else {
deferred.resolve(data);
}
};
urlKey = req.method + ' ' + req.url;
req.stack = stack || [];
debug("Stack: %j", stack);
recursions = req.stack.filter(function(s) { return s === urlKey; }).length;
recursionLimit = (stack && stack.recursionLimit) || 2;
if (recursions < recursionLimit) {
req.stack.push(urlKey);
debug("Putting %s on stack", urlKey);
res = {
setHeader: function() {},
end: function(data) {
if (res.statusCode === 200 || res.statusCode === 204) {
try {
callback(JSON.parse(data), null);
} catch (ex) {
callback(data, null);
}
} else {
callback(null, data);
}
},
internal: true,
headers: {},
on: function() {}
};
server.router.route(req, res);
} else {
debug("Recursive call detected - aborting");
callback(null, "Recursive call to " + urlKey + " detected");
}
return deferred.promise.bind(this);
}
};
baseMethods.get = function(options, fn) {
return baseMethods.request.call(this, "GET", options, fn);
};
baseMethods.post = function(options, fn) {
return baseMethods.request.call(this, "POST", options, fn);
};
baseMethods.put = function(options, fn) {
return baseMethods.request.call(this, "PUT", options, fn);
};
baseMethods.del = function(options, fn) {
return baseMethods.request.call(this, "DELETE", options, fn);
};
if (server.resources) {
server.resources.forEach(function(r) {
if (r.clientGeneration) {
var jsName = r.path.replace(/[^A-Za-z0-9]/g, '');
dpd[jsName] = createResourceClient(r, baseMethods);
}
});
}
return dpd;
};
function createResourceClient(resource, baseMethods) {
var r = {
get: function(func, p, query, fn) {
var settings = parseGetSignature(arguments);
settings.path = joinPath(resource.path, settings.path);
return baseMethods.get.call(this, settings, settings.fn);
}
, post: function(p, query, body, fn) {
var settings = parsePostSignature(arguments);
settings.path = joinPath(resource.path, settings.path);
return baseMethods.post.call(this, settings, settings.fn);
}
, put: function(p, query, body, fn) {
var settings = parsePostSignature(arguments);
settings.path = joinPath(resource.path, settings.path);
return baseMethods.put.call(this, settings, settings.fn);
}
, del: function(p, query, fn) {
var settings = parseGetSignature(arguments);
settings.path = joinPath(resource.path, settings.path);
return baseMethods.del.call(this, settings, settings.fn);
}
};
r.exec = function(func, path, body, fn) {
var settings = {}
, i = 0;
settings.func = arguments[i];
i++;
// path
if (typeof arguments[i] === 'string') {
settings.path = arguments[i];
i++;
}
// body
if (typeof arguments[i] === 'object') {
settings.body = arguments[i];
i++;
}
fn = arguments[i];
settings.path = joinPath(resource.path, settings.func, settings.path);
return baseMethods.post(settings, fn);
};
resource.clientGenerationGet.forEach(function(func) {
r[func] = function(path, query, fn) {
r.get(func, path, query, fn);
};
});
resource.clientGenerationExec.forEach(function(func) {
r[func] = function(path, query, fn) {
r.exec(func, path, query, fn);
};
});
return r;
}
function isString(arg) {
return typeof arg === 'string' || typeof arg === 'number';
}
function toString(arg) {
return arg ? arg.toString() : null;
}
function parseGetSignature(args) {
var settings = {}
, i = 0;
// path/func
if (isString(args[i]) || !args[i]) {
settings.path = toString(args[i]);
i++;
}
// join path to func
if (isString(args[i]) || !args[i]) {
settings.path = joinPath(settings.path, toString(args[i]));
i++;
}
// query
if (typeof args[i] === 'object' || !args[i]) {
settings.query = args[i];
i++;
}
if (typeof args[i] === 'function') {
settings.fn = args[i];
}
return settings;
}
function parsePostSignature(args) {
var settings = {}
, i = 0;
//path
if (isString(args[i]) || !args[i]) {
settings.path = toString(args[i]);
i++;
}
// body
if (typeof args[i] === 'object' || !args[i]) {
settings.body = args[i];
i++;
}
// query - if this exists the LAST obj was query and the new one is body
if (typeof args[i] === 'object') {
settings.query = settings.body;
settings.body = args[i];
i++;
}
if (typeof args[i] === 'function') {
settings.fn = args[i];
}
return settings;
} | {
"content_hash": "99af8999913cac119400b63ebb9a4129",
"timestamp": "",
"source": "github",
"line_count": 308,
"max_line_length": 81,
"avg_line_length": 23.035714285714285,
"alnum_prop": 0.5502466525722339,
"repo_name": "ipepe/nodejs-dpd-ejs-express",
"id": "a0bcea978dcc2ef86ecb2f6684e419f89f351c6c",
"size": "7095",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "node_modules/deployd/lib/internal-client.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "12411"
},
{
"name": "HTML",
"bytes": "5328"
},
{
"name": "JavaScript",
"bytes": "26641"
}
],
"symlink_target": ""
} |
import React, {Component, PropTypes} from 'react';
import Remarkable from 'remarkable';
export default class Comment extends Component {
static propTypes = {
children: PropTypes.node.isRequired,
author: PropTypes.string.isRequired
}
_getRawMarkup() {
let md = new Remarkable();
let rawMarkup = md.render(this.props.children.toString());
return {__html: rawMarkup};
}
render() {
return (
<div className="comment">
<h2 className="commentAuthor">
{this.props.author}
</h2>
<span dangerouslySetInnerHTML={this._getRawMarkup()} />
</div>
);
}
}
| {
"content_hash": "be4e07fdba19aea074306559a29cc3b9",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 71,
"avg_line_length": 27.5,
"alnum_prop": 0.5566433566433566,
"repo_name": "benmvp/react-esnext",
"id": "d557cfcb4b6aafe1aa4d08d830a63ec6975194ae",
"size": "794",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "03-block-scoping/src/components/Comment.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "8558"
},
{
"name": "HTML",
"bytes": "4324"
},
{
"name": "JavaScript",
"bytes": "113467"
}
],
"symlink_target": ""
} |
class SkMatrix;
class SkPath;
namespace skia {
class PlatformDevice;
class ScopedPlatformPaint;
// The following routines provide accessor points for the functionality
// exported by the various PlatformDevice ports.
// All calls to PlatformDevice::* should be routed through these
// helper functions.
// DEPRECATED
// Bind a PlatformDevice instance, |platform_device|, to |device|.
SK_API void SetPlatformDevice(SkBaseDevice* device, PlatformDevice* platform_device);
// DEPRECATED
// Retrieve the previous argument to SetPlatformDevice().
SK_API PlatformDevice* GetPlatformDevice(SkBaseDevice* device);
// A SkBitmapDevice is basically a wrapper around SkBitmap that provides a
// surface for SkCanvas to draw into. PlatformDevice provides a surface
// Windows can also write to. It also provides functionality to play well
// with GDI drawing functions. This class is abstract and must be subclassed.
// It provides the basic interface to implement it either with or without
// a bitmap backend.
//
// PlatformDevice provides an interface which sub-classes of SkBaseDevice can
// also provide to allow for drawing by the native platform into the device.
// TODO(robertphillips): Once the bitmap-specific entry points are removed
// from SkBaseDevice it might make sense for PlatformDevice to be derived
// from it.
class SK_API PlatformDevice {
public:
virtual ~PlatformDevice() {}
#if defined(OS_MACOSX)
// The CGContext that corresponds to the bitmap, used for CoreGraphics
// operations drawing into the bitmap. This is possibly heavyweight, so it
// should exist only during one pass of rendering.
virtual CGContextRef GetBitmapContext(const SkMatrix& transform,
const SkIRect& clip_bounds) = 0;
#endif
private:
// The DC that corresponds to the bitmap, used for GDI operations drawing
// into the bitmap. This is possibly heavyweight, so it should be existant
// only during one pass of rendering.
virtual NativeDrawingContext BeginPlatformPaint(const SkMatrix& transform,
const SkIRect& clip_bounds);
friend class ScopedPlatformPaint;
};
} // namespace skia
#endif // SKIA_EXT_PLATFORM_DEVICE_H_
| {
"content_hash": "df0b97f54a8a2332af2290feaffc25c8",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 85,
"avg_line_length": 38.62068965517241,
"alnum_prop": 0.7433035714285714,
"repo_name": "Samsung/ChromiumGStreamerBackend",
"id": "a32caabe33befc2e32050c0fe32c8230be683877",
"size": "2738",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "skia/ext/platform_device.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_21) on Sat May 11 22:08:46 BST 2013 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>com.hp.hpl.jena.sparql.expr.aggregate (Apache Jena ARQ)</title>
<meta name="date" content="2013-05-11">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
</head>
<body>
<h1 class="bar"><a href="../../../../../../../com/hp/hpl/jena/sparql/expr/aggregate/package-summary.html" target="classFrame">com.hp.hpl.jena.sparql.expr.aggregate</a></h1>
<div class="indexContainer">
<h2 title="Interfaces">Interfaces</h2>
<ul title="Interfaces">
<li><a href="Accumulator.html" title="interface in com.hp.hpl.jena.sparql.expr.aggregate" target="classFrame"><i>Accumulator</i></a></li>
<li><a href="Aggregator.html" title="interface in com.hp.hpl.jena.sparql.expr.aggregate" target="classFrame"><i>Aggregator</i></a></li>
</ul>
<h2 title="Classes">Classes</h2>
<ul title="Classes">
<li><a href="AggAvg.html" title="class in com.hp.hpl.jena.sparql.expr.aggregate" target="classFrame">AggAvg</a></li>
<li><a href="AggAvgDistinct.html" title="class in com.hp.hpl.jena.sparql.expr.aggregate" target="classFrame">AggAvgDistinct</a></li>
<li><a href="AggCount.html" title="class in com.hp.hpl.jena.sparql.expr.aggregate" target="classFrame">AggCount</a></li>
<li><a href="AggCountDistinct.html" title="class in com.hp.hpl.jena.sparql.expr.aggregate" target="classFrame">AggCountDistinct</a></li>
<li><a href="AggCountVar.html" title="class in com.hp.hpl.jena.sparql.expr.aggregate" target="classFrame">AggCountVar</a></li>
<li><a href="AggCountVarDistinct.html" title="class in com.hp.hpl.jena.sparql.expr.aggregate" target="classFrame">AggCountVarDistinct</a></li>
<li><a href="AggGroupConcat.html" title="class in com.hp.hpl.jena.sparql.expr.aggregate" target="classFrame">AggGroupConcat</a></li>
<li><a href="AggGroupConcatDistinct.html" title="class in com.hp.hpl.jena.sparql.expr.aggregate" target="classFrame">AggGroupConcatDistinct</a></li>
<li><a href="AggMax.html" title="class in com.hp.hpl.jena.sparql.expr.aggregate" target="classFrame">AggMax</a></li>
<li><a href="AggMaxDistinct.html" title="class in com.hp.hpl.jena.sparql.expr.aggregate" target="classFrame">AggMaxDistinct</a></li>
<li><a href="AggMin.html" title="class in com.hp.hpl.jena.sparql.expr.aggregate" target="classFrame">AggMin</a></li>
<li><a href="AggMinDistinct.html" title="class in com.hp.hpl.jena.sparql.expr.aggregate" target="classFrame">AggMinDistinct</a></li>
<li><a href="AggNull.html" title="class in com.hp.hpl.jena.sparql.expr.aggregate" target="classFrame">AggNull</a></li>
<li><a href="AggregatorBase.html" title="class in com.hp.hpl.jena.sparql.expr.aggregate" target="classFrame">AggregatorBase</a></li>
<li><a href="AggregatorFactory.html" title="class in com.hp.hpl.jena.sparql.expr.aggregate" target="classFrame">AggregatorFactory</a></li>
<li><a href="AggSample.html" title="class in com.hp.hpl.jena.sparql.expr.aggregate" target="classFrame">AggSample</a></li>
<li><a href="AggSampleDistinct.html" title="class in com.hp.hpl.jena.sparql.expr.aggregate" target="classFrame">AggSampleDistinct</a></li>
<li><a href="AggSum.html" title="class in com.hp.hpl.jena.sparql.expr.aggregate" target="classFrame">AggSum</a></li>
<li><a href="AggSumDistinct.html" title="class in com.hp.hpl.jena.sparql.expr.aggregate" target="classFrame">AggSumDistinct</a></li>
</ul>
</div>
</body>
</html>
| {
"content_hash": "04a879b5edb2940a8afeb673b3a35ff8",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 172,
"avg_line_length": 83.90697674418605,
"alnum_prop": 0.7283813747228381,
"repo_name": "chinhnc/floodlight",
"id": "9133d0591804985d8880110082ab629772202549",
"size": "3608",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "lib/apache-jena-2.10.1/javadoc-arq/com/hp/hpl/jena/sparql/expr/aggregate/package-frame.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "13627"
},
{
"name": "CSS",
"bytes": "46037"
},
{
"name": "HTML",
"bytes": "72657495"
},
{
"name": "Java",
"bytes": "4271196"
},
{
"name": "JavaScript",
"bytes": "115520"
},
{
"name": "Python",
"bytes": "32743"
},
{
"name": "Shell",
"bytes": "44561"
},
{
"name": "Thrift",
"bytes": "7114"
},
{
"name": "Web Ontology Language",
"bytes": "20094"
}
],
"symlink_target": ""
} |
Variables can be declared at any point in JavaScript code using `var`, `let`, or `const`. There are many styles and preferences related to the declaration of variables, and one of those is deciding on how many variable declarations should be allowed in a single function.
There are two schools of thought in this regard:
1. There should be just one variable declaration for all variables in the function. That declaration typically appears at the top of the function.
2. You should use one variable declaration for each variable you want to define.
For instance:
```js
// one variable declaration per function
function foo() {
var bar, baz;
}
// multiple variable declarations per function
function foo() {
var bar;
var baz;
}
```
The single-declaration school of thought is based in pre-ECMAScript 6 behaviors, where there was no such thing as block scope, only function scope. Since all `var` statements are hoisted to the top of the function anyway, some believe that declaring all variables in a single declaration at the top of the function removes confusion around scoping rules.
## Rule Details
This rule is aimed at enforcing the use of either one variable declaration or multiple declarations per function (for `var`) or block (for `let` and `const`) scope. As such, it will warn when it encounters an unexpected number of variable declarations.
### Options
There are two ways to configure this rule. The first is by using one string specified as `"always"` (the default) to enforce one variable declaration per scope or `"never"` to enforce multiple variable declarations per scope. If you declare variables in your code with `let` and `const`, then `"always"` and `"never"` will apply to the block scope for those declarations, not the function scope.
The second way to configure this rule is with an object. The keys are any of:
* `var`
* `let`
* `const`
or:
* `uninitialized`
* `initialized`
and the values are either `"always"` or `"never"`. This allows you to set behavior differently for each type of declaration, or whether variables are initialized during declaration.
You can configure the rule as follows:
```javascript
{
// (default) Exactly one variable declaration per type per function (var) or block (let or const)
"one-var": [2, "always"],
// Exactly one declarator per declaration per function (var) or block (let or const)
"one-var": [2, "never"],
// Configure each declaration type individually. Defaults to "always" if key not present.
"one-var": [2, {
"var": "always", // Exactly one var declaration per function
"let": "always", // Exactly one let declaration per block
"const", "never" // Exactly one declarator per const declaration per block
}]
// Configure uninitialized and initialized seperately. Defaults to "always" if key not present.
"one-var": [2, {
"uninitialized": "always", // Exactly one declaration for uninitialized variables per function (var) or block (let or const)
"initialized": "never" // Exactly one declarator per initialized variable declaration per function (var) or block (let or const)
}]
}
```
When configured with `"always"` as the first option (the default), the following patterns are considered warnings:
```js
function foo() {
var bar;
var baz;
let qux;
let norf;
}
function foo(){
const bar = false;
const baz = true;
let qux;
let norf;
}
function foo() {
var bar;
if (baz) {
var qux = true;
}
}
```
The following patterns are not considered warnings:
```js
function foo() {
var bar,
baz;
let qux,
norf;
}
function foo(){
const bar = true,
baz = false;
let qux,
norf;
}
function foo() {
var bar,
qux;
if (baz) {
qux = true;
}
}
function foo(){
let bar;
if (baz) {
let qux;
}
}
```
When configured with `"never"` as the first option, the following patterns are considered warnings:
```js
function foo() {
var bar,
baz;
const bar = true,
baz = false;
}
function foo() {
var bar,
qux;
if (baz) {
qux = true;
}
}
function foo(){
let bar = true,
baz = false;
}
```
The following patterns are not considered warnings:
```js
function foo() {
var bar;
var baz;
}
function foo() {
var bar;
if (baz) {
var qux = true;
}
}
function foo() {
let bar;
if (baz) {
let qux = true;
}
}
```
When configured with an object as the first option, you can individually control how `var`, `let`, and `const` are handled, or alternatively how `uninitialized` and `initialized` variables are handled (which if used will override `var`, `let`, and `const`).
The following patterns are not considered warnings when the first option is `{ var: "always", let: "never", const: "never" }`
```js
function foo() {
var bar,
baz;
let qux;
let norf;
}
function foo() {
const bar;
const baz;
let qux;
let norf;
}
```
The following patterns are not considered warnings when the first option is `{ uninitialized: "always", initialized: "never" }`
```js
function foo() {
var a, b, c;
var foo = true;
var bar = false;
}
```
If you are configuring the rule with an object, by default, if you didn't specify declaration type it will not be checked. So the following patten is not considered warning when options are set to: `{ var: 'always', let: 'always }`
```js
function foo() {
var a, b;
const foo = true;
const bar = true;
let c, d;
}
```
## Compatibility
* **JSHint** - This rule maps to the `onevar` JSHint rule, but allows `let` and `const` to be configured separately.
* **JSCS** - This rule roughly maps to `"disallowMultipleVarDecl"`
## Further Reading
[JSLint Errors - Combine this with the previous 'var' statement](http://jslinterrors.com/combine-this-with-the-previous-var-statement/)
| {
"content_hash": "2e05d4f83e02ec194e05737d06b8e1ba",
"timestamp": "",
"source": "github",
"line_count": 231,
"max_line_length": 396,
"avg_line_length": 25.956709956709958,
"alnum_prop": 0.6697798532354903,
"repo_name": "hzoo/eslint",
"id": "229de9fef6c492e0c241215d056678ff87c2266f",
"size": "6064",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/rules/one-var.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "818"
},
{
"name": "JavaScript",
"bytes": "2909462"
},
{
"name": "Shell",
"bytes": "928"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Text;
namespace ExcelLibrary.CompoundDocumentFormat
{
public class CompoundFileHeader : FileHeader
{
public new static readonly byte[] FileTypeIdentifier = new byte[8] { 0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1 };
/// <summary>
/// Create a CompoundFileHeader with default values.
/// </summary>
public CompoundFileHeader()
{
base.FileTypeIdentifier = FileTypeIdentifier;
FileIdentifier = Guid.NewGuid();
RevisionNumber = 0x3E;
VersionNumber = 0x03;
ByteOrderMark = ByteOrderMarks.LittleEndian;
SectorSizeInPot = 9;
ShortSectorSizeInPot = 6;
UnUsed10 = new byte[10];
UnUsed4 = new byte[4];
MinimumStreamSize = 4096;
FirstSectorIDofShortSectorAllocationTable = SID.EOC;
FirstSectorIDofMasterSectorAllocationTable = SID.EOC;
FirstSectorIDofDirectoryStream = SID.EOC;
MasterSectorAllocationTable = new Int32[109];
for (int i = 0; i < MasterSectorAllocationTable.Length; i++)
{
MasterSectorAllocationTable[i] = SID.Free;
}
}
}
}
| {
"content_hash": "4ce1094578773de65f21dd38a4fb9999",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 126,
"avg_line_length": 36.6,
"alnum_prop": 0.6073380171740828,
"repo_name": "RH-Code/GAPP",
"id": "4cc21e11013c15564c83bbea75a2d876742a29e8",
"size": "1281",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "ExcelLibrary/Office/CompoundDocumentFormat/CompoundFileHeader.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "356"
},
{
"name": "C#",
"bytes": "27428180"
},
{
"name": "HTML",
"bytes": "1064161"
},
{
"name": "JavaScript",
"bytes": "28729"
}
],
"symlink_target": ""
} |
IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
SET(CMAKE_INSTALL_PREFIX "/usr/local")
ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
IF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
IF(BUILD_TYPE)
STRING(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
ELSE(BUILD_TYPE)
SET(CMAKE_INSTALL_CONFIG_NAME "Release")
ENDIF(BUILD_TYPE)
MESSAGE(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
ENDIF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
# Set the component getting installed.
IF(NOT CMAKE_INSTALL_COMPONENT)
IF(COMPONENT)
MESSAGE(STATUS "Install component: \"${COMPONENT}\"")
SET(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
ELSE(COMPONENT)
SET(CMAKE_INSTALL_COMPONENT)
ENDIF(COMPONENT)
ENDIF(NOT CMAKE_INSTALL_COMPONENT)
# Install shared libraries without execute permission?
IF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
SET(CMAKE_INSTALL_SO_NO_EXE "0")
ENDIF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
| {
"content_hash": "6bff76d6028f67ae830739d334e24fc1",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 76,
"avg_line_length": 34.58064516129032,
"alnum_prop": 0.7276119402985075,
"repo_name": "LiZimo/FuncFlow",
"id": "f577ce9cb6555565365b56b7c8d02df34f74b41e",
"size": "1211",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "external/gop_1.3/build/lib/learning/cmake_install.cmake",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Matlab",
"bytes": "115858"
}
],
"symlink_target": ""
} |
<?php
declare(strict_types=1);
namespace Gedmo\Tests\Uploadable\Fixture\Entity;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity
* @Gedmo\Uploadable(pathMethod="getPath")
*/
#[ORM\Entity]
#[Gedmo\Uploadable(pathMethod: 'getPath')]
class ImageWithTypedProperties
{
/**
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
* @ORM\Column(type="integer")
*/
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
#[ORM\Column(type: Types::INTEGER)]
private ?int $id = null;
/**
* @ORM\Column(name="title", type="string")
*/
#[ORM\Column(name: 'title', type: Types::STRING)]
private ?string $title = null;
/**
* @ORM\Column(name="path", type="string", nullable=true)
* @Gedmo\UploadableFilePath
*/
#[ORM\Column(name: 'path', type: Types::STRING, nullable: true)]
#[Gedmo\UploadableFilePath]
private ?string $filePath = null;
/**
* @ORM\Column(name="size", type="decimal", nullable=true)
* @Gedmo\UploadableFileSize
*/
#[ORM\Column(name: 'size', type: Types::DECIMAL, nullable: true)]
#[Gedmo\UploadableFileSize]
private ?string $size = null;
/**
* @ORM\Column(name="mime_type", type="string", nullable=true)
* @Gedmo\UploadableFileMimeType
*/
#[ORM\Column(name: 'mime_type', type: Types::STRING, nullable: true)]
#[Gedmo\UploadableFileMimeType]
private ?string $mime = null;
private bool $useBasePath = false;
public function getId(): ?int
{
return $this->id;
}
public function setTitle(?string $title): void
{
$this->title = $title;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setFilePath(?string $filePath): void
{
$this->filePath = $filePath;
}
public function getFilePath(): ?string
{
return $this->filePath;
}
public function getPath(?string $basePath = null): string
{
if ($this->useBasePath) {
return $basePath.'/abc/def';
}
return TESTS_TEMP_DIR.'/uploadable';
}
public function setMime(?string $mime): void
{
$this->mime = $mime;
}
public function getMime(): ?string
{
return $this->mime;
}
public function setSize(?string $size): void
{
$this->size = $size;
}
public function getSize(): ?string
{
return $this->size;
}
public function setUseBasePath(bool $useBasePath): void
{
$this->useBasePath = $useBasePath;
}
}
| {
"content_hash": "84d0c9d56b3b3e2290d9931bf5f79133",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 73,
"avg_line_length": 21.983471074380166,
"alnum_prop": 0.5924812030075188,
"repo_name": "pmishev/DoctrineExtensions",
"id": "6919de6077da944147f995e9cecd09f026d75dd7",
"size": "2950",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "tests/Gedmo/Uploadable/Fixture/Entity/ImageWithTypedProperties.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "444"
},
{
"name": "Makefile",
"bytes": "1038"
},
{
"name": "PHP",
"bytes": "2410982"
}
],
"symlink_target": ""
} |
set -e
SCRIPT_LOCATION=$(cd "$(dirname "$0")"; pwd)
. ${SCRIPT_LOCATION}/common.sh
if [ $# -lt 2 ]; then
echo "Usage: $0 <CernVM-FS source directory> <build result location> [<nightly build number>]"
echo "This script builds CernVM-FS debian packages"
exit 1
fi
CVMFS_SOURCE_LOCATION="$1"
CVMFS_RESULT_LOCATION="$2"
CVMFS_NIGHTLY_BUILD_NUMBER="${3-0}"
CVMFS_CONFIG_PACKAGE="cvmfs-config-default_1.1-1_all.deb"
# sanity checks
[ ! -d ${CVMFS_SOURCE_LOCATION}/debian ] || die "source directory seemed to be built before (${CVMFS_SOURCE_LOCATION}/debian exists)"
# retrieve the upstream version string from CVMFS
cvmfs_version="$(get_cvmfs_version_from_cmake $CVMFS_SOURCE_LOCATION)"
echo "detected upstream version: $cvmfs_version"
# generate the release tag for either a nightly build or a release
if [ $CVMFS_NIGHTLY_BUILD_NUMBER -gt 0 ]; then
git_hash="$(get_cvmfs_git_revision $CVMFS_SOURCE_LOCATION)"
cvmfs_version="${cvmfs_version}.${CVMFS_NIGHTLY_BUILD_NUMBER}git${git_hash}"
echo "creating nightly build '$cvmfs_version'"
else
echo "creating release: $cvmfs_version"
fi
# produce the debian package
echo "copy packaging meta information and get in place..."
cp -r ${CVMFS_SOURCE_LOCATION}/packaging/debian/cvmfs ${CVMFS_SOURCE_LOCATION}/debian
mkdir -p $CVMFS_RESULT_LOCATION
cd ${CVMFS_SOURCE_LOCATION}
echo "do the build..."
dch -v $cvmfs_version -M "bumped upstream version number"
cd debian
pdebuild --buildresult $CVMFS_RESULT_LOCATION
cd ${CVMFS_RESULT_LOCATION}
# generating package map section for specific platform
if [ ! -z $CVMFS_CI_PLATFORM_LABEL ]; then
echo "generating package map section for ${CVMFS_CI_PLATFORM_LABEL}..."
generate_package_map "$CVMFS_CI_PLATFORM_LABEL" \
"$(basename $(find . -name 'cvmfs_*.deb'))" \
"$(basename $(find . -name 'cvmfs-server*.deb'))" \
"$(basename $(find . -name 'cvmfs-unittests*.deb'))" \
"$CVMFS_CONFIG_PACKAGE"
fi
# clean up the source tree
echo "cleaning up..."
rm -fR ${CVMFS_SOURCE_LOCATION}/debian
| {
"content_hash": "3c8d3fe3153a1d07e08f664a1223ffdd",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 133,
"avg_line_length": 36.58620689655172,
"alnum_prop": 0.676248821866164,
"repo_name": "MicBrain/GSoC_CernVM-FS",
"id": "82fe1b8e8ccd479b8dfa49a562287175d60472a8",
"size": "2193",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ci/build_cvmfs_deb.sh",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Ada",
"bytes": "89080"
},
{
"name": "Assembly",
"bytes": "281694"
},
{
"name": "Awk",
"bytes": "15566"
},
{
"name": "Batchfile",
"bytes": "49721"
},
{
"name": "C",
"bytes": "36521229"
},
{
"name": "C#",
"bytes": "54012"
},
{
"name": "C++",
"bytes": "14740097"
},
{
"name": "CLIPS",
"bytes": "5291"
},
{
"name": "CMake",
"bytes": "617862"
},
{
"name": "CSS",
"bytes": "45299"
},
{
"name": "DIGITAL Command Language",
"bytes": "724191"
},
{
"name": "Groff",
"bytes": "3189617"
},
{
"name": "HTML",
"bytes": "7015666"
},
{
"name": "Java",
"bytes": "30236"
},
{
"name": "JavaScript",
"bytes": "16953"
},
{
"name": "Makefile",
"bytes": "6733464"
},
{
"name": "Module Management System",
"bytes": "1545"
},
{
"name": "Objective-C",
"bytes": "13678"
},
{
"name": "PHP",
"bytes": "54394"
},
{
"name": "Pascal",
"bytes": "70297"
},
{
"name": "Perl",
"bytes": "1738754"
},
{
"name": "Perl6",
"bytes": "23592"
},
{
"name": "Python",
"bytes": "448603"
},
{
"name": "SAS",
"bytes": "1847"
},
{
"name": "Shell",
"bytes": "7532721"
},
{
"name": "SourcePawn",
"bytes": "4814"
},
{
"name": "Visual Basic",
"bytes": "33853"
}
],
"symlink_target": ""
} |
<form name="closeForm" os-form-validator="closeForm" novalidate>
<div class="os-modal">
<div class="os-modal-header">
<span translate="specimens.close">Close</span>
</div>
<div class="os-modal-body">
<div class="form-horizontal">
<div class="form-group">
<label class="col-xs-3 control-label">
<span translate="specimens.event_user">User</span>
</label>
<div class="col-xs-9">
<os-users ng-model="closeSpec.user" default-current-user placeholder="{{'specimens.event_user' | translate}}">
</os-users>
</div>
</div>
<div class="form-group">
<label class="col-xs-3 control-label">
<span translate="specimens.event_time">Date and Time</span>
</label>
<div class="col-xs-9">
<div class="os-date-time clearfix">
<div class="os-col-70 input os-no-padding">
<os-date-picker date="closeSpec.date" placeholder="{{'specimens.event_time' | translate}}">
</os-date-picker>
</div>
<div class="os-col-30">
<timepicker ng-model="closeSpec.date" class="os-time-no-wheels" show-meridian="false">
</timepicker>
</div>
</div>
</div>
</div>
<div class="form-group">
<label class="col-xs-3 control-label">
<span translate="specimens.reason_for_closing">Comments</span>
</label>
<div class="col-xs-9">
<textarea class="form-control" ng-model="closeSpec.reason" rows="2"
placeholder="{{'specimens.reason_for_closing' | translate}}">
</textarea>
</div>
</div>
</div>
</div>
<div class="os-modal-footer">
<button class="btn os-btn-text" ng-click="cancel()">
<span translate="common.buttons.cancel">Cancel</span>
</button>
<button class="btn btn-primary" ng-click="close()">
<span translate="specimens.buttons.close">Close</span>
</button>
</div>
</div>
</form>
| {
"content_hash": "abbdda2cc8871f83a014cb124439e550",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 122,
"avg_line_length": 38.74545454545454,
"alnum_prop": 0.5387142186766776,
"repo_name": "krishagni/openspecimen",
"id": "8f0a5103b4dd6a9a9dafa9e55f336f1a50fc22d2",
"size": "2131",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "www/app/modules/biospecimen/participant/specimen/close.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "106704"
},
{
"name": "HTML",
"bytes": "1089677"
},
{
"name": "Java",
"bytes": "5324932"
},
{
"name": "JavaScript",
"bytes": "2990486"
},
{
"name": "PLSQL",
"bytes": "5253"
},
{
"name": "Roff",
"bytes": "3349"
},
{
"name": "Vue",
"bytes": "661942"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<mets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:MODS="http://www.loc.gov/mods/v3" PROFILE="urn:library-of-congress:mets:profiles:ndnp:issue:v1.5" xmlns:xlink="http://www.w3.org/1999/xlink" TYPE="urn:library-of-congress:ndnp:mets:newspaper:issue" LABEL="Baltimore daily commercial (Baltimore, Md.), 1865-10-04" xmlns:mix="http://www.loc.gov/mix/" xmlns:ndnp="http://www.loc.gov/ndnp" xmlns:premis="http://www.loc.gov/standards/premis" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns="http://www.loc.gov/METS/">
<metsHdr CREATEDATE="2014-04-22T12:47:30" RECORDSTATUS="">
<agent ROLE="CREATOR" TYPE="ORGANIZATION">
<name>University of Maryland; College Park, MD</name>
</agent>
</metsHdr>
<dmdSec ID="issueModsBib">
<mdWrap MDTYPE="MODS" LABEL="Issue metadata">
<xmlData>
<MODS:mods>
<MODS:relatedItem type="host">
<MODS:identifier type="lccn">sn83009569</MODS:identifier>
<MODS:part>
<MODS:detail type="volume">
<MODS:number>1</MODS:number>
</MODS:detail>
<MODS:detail type="issue">
<MODS:number>3</MODS:number>
</MODS:detail>
<MODS:detail type="edition">
<MODS:number>1</MODS:number>
</MODS:detail>
</MODS:part>
</MODS:relatedItem>
<MODS:originInfo>
<MODS:dateIssued encoding="iso8601">1865-10-04</MODS:dateIssued>
</MODS:originInfo>
<MODS:note type="noteAboutReproduction">Present</MODS:note>
</MODS:mods>
</xmlData>
</mdWrap>
</dmdSec>
<dmdSec ID="pageModsBib1">
<mdWrap MDTYPE="MODS" LABEL="Page metadata">
<xmlData>
<MODS:mods>
<MODS:part>
<MODS:extent unit="pages">
<MODS:start>1</MODS:start>
</MODS:extent>
</MODS:part>
<MODS:relatedItem type="original">
<MODS:physicalDescription>
<MODS:form type="microfilm"/>
</MODS:physicalDescription>
<MODS:identifier type="reel number">00296026165</MODS:identifier>
<MODS:identifier type="reel sequence number">13</MODS:identifier>
<MODS:location>
<MODS:physicalLocation authority="marcorg" displayLabel="Library of Congress; Washington, DC">dlc</MODS:physicalLocation>
</MODS:location>
</MODS:relatedItem>
<MODS:note type="agencyResponsibleForReproduction" displayLabel="University of Maryland; College Park, MD">mdu</MODS:note>
<MODS:note type="noteAboutReproduction" displayLabel="">Present</MODS:note>
</MODS:mods>
</xmlData>
</mdWrap>
</dmdSec>
<dmdSec ID="pageModsBib2">
<mdWrap MDTYPE="MODS" LABEL="Page metadata">
<xmlData>
<MODS:mods>
<MODS:part>
<MODS:extent unit="pages">
<MODS:start>2</MODS:start>
</MODS:extent>
</MODS:part>
<MODS:relatedItem type="original">
<MODS:physicalDescription>
<MODS:form type="microfilm"/>
</MODS:physicalDescription>
<MODS:identifier type="reel number">00296026165</MODS:identifier>
<MODS:identifier type="reel sequence number">14</MODS:identifier>
<MODS:location>
<MODS:physicalLocation authority="marcorg" displayLabel="Library of Congress; Washington, DC">dlc</MODS:physicalLocation>
</MODS:location>
</MODS:relatedItem>
<MODS:note type="agencyResponsibleForReproduction" displayLabel="University of Maryland; College Park, MD">mdu</MODS:note>
<MODS:note type="noteAboutReproduction" displayLabel="">Present</MODS:note>
</MODS:mods>
</xmlData>
</mdWrap>
</dmdSec>
<dmdSec ID="pageModsBib3">
<mdWrap MDTYPE="MODS" LABEL="Page metadata">
<xmlData>
<MODS:mods>
<MODS:part>
<MODS:extent unit="pages">
<MODS:start>3</MODS:start>
</MODS:extent>
</MODS:part>
<MODS:relatedItem type="original">
<MODS:physicalDescription>
<MODS:form type="microfilm"/>
</MODS:physicalDescription>
<MODS:identifier type="reel number">00296026165</MODS:identifier>
<MODS:identifier type="reel sequence number">15</MODS:identifier>
<MODS:location>
<MODS:physicalLocation authority="marcorg" displayLabel="Library of Congress; Washington, DC">dlc</MODS:physicalLocation>
</MODS:location>
</MODS:relatedItem>
<MODS:note type="agencyResponsibleForReproduction" displayLabel="University of Maryland; College Park, MD">mdu</MODS:note>
<MODS:note type="noteAboutReproduction" displayLabel="">Present</MODS:note>
</MODS:mods>
</xmlData>
</mdWrap>
</dmdSec>
<dmdSec ID="pageModsBib4">
<mdWrap MDTYPE="MODS" LABEL="Page metadata">
<xmlData>
<MODS:mods>
<MODS:part>
<MODS:extent unit="pages">
<MODS:start>4</MODS:start>
</MODS:extent>
</MODS:part>
<MODS:relatedItem type="original">
<MODS:physicalDescription>
<MODS:form type="microfilm"/>
</MODS:physicalDescription>
<MODS:identifier type="reel number">00296026165</MODS:identifier>
<MODS:identifier type="reel sequence number">16</MODS:identifier>
<MODS:location>
<MODS:physicalLocation authority="marcorg" displayLabel="Library of Congress; Washington, DC">dlc</MODS:physicalLocation>
</MODS:location>
</MODS:relatedItem>
<MODS:note type="agencyResponsibleForReproduction" displayLabel="University of Maryland; College Park, MD">mdu</MODS:note>
<MODS:note type="noteAboutReproduction" displayLabel="">Present</MODS:note>
</MODS:mods>
</xmlData>
</mdWrap>
</dmdSec>
<fileSec>
<fileGrp ID="pageFileGrp1">
<file ID="masterFile1" USE="master">
<FLocat LOCTYPE="OTHER" OTHERLOCTYPE="file" xlink:href="./0013.tif"/>
</file>
<file ID="serviceFile1" USE="service">
<FLocat LOCTYPE="OTHER" OTHERLOCTYPE="file" xlink:href="./0013.jp2"/>
</file>
<file ID="otherDerivativeFile1" USE="derivative">
<FLocat LOCTYPE="OTHER" OTHERLOCTYPE="file" xlink:href="./0013.pdf"/>
</file>
<file ID="ocrFile1" USE="ocr">
<FLocat LOCTYPE="OTHER" OTHERLOCTYPE="file" xlink:href="./0013.xml"/>
</file>
</fileGrp>
<fileGrp ID="pageFileGrp2">
<file ID="masterFile2" USE="master">
<FLocat LOCTYPE="OTHER" OTHERLOCTYPE="file" xlink:href="./0014.tif"/>
</file>
<file ID="serviceFile2" USE="service">
<FLocat LOCTYPE="OTHER" OTHERLOCTYPE="file" xlink:href="./0014.jp2"/>
</file>
<file ID="otherDerivativeFile2" USE="derivative">
<FLocat LOCTYPE="OTHER" OTHERLOCTYPE="file" xlink:href="./0014.pdf"/>
</file>
<file ID="ocrFile2" USE="ocr">
<FLocat LOCTYPE="OTHER" OTHERLOCTYPE="file" xlink:href="./0014.xml"/>
</file>
</fileGrp>
<fileGrp ID="pageFileGrp3">
<file ID="masterFile3" USE="master">
<FLocat LOCTYPE="OTHER" OTHERLOCTYPE="file" xlink:href="./0015.tif"/>
</file>
<file ID="serviceFile3" USE="service">
<FLocat LOCTYPE="OTHER" OTHERLOCTYPE="file" xlink:href="./0015.jp2"/>
</file>
<file ID="otherDerivativeFile3" USE="derivative">
<FLocat LOCTYPE="OTHER" OTHERLOCTYPE="file" xlink:href="./0015.pdf"/>
</file>
<file ID="ocrFile3" USE="ocr">
<FLocat LOCTYPE="OTHER" OTHERLOCTYPE="file" xlink:href="./0015.xml"/>
</file>
</fileGrp>
<fileGrp ID="pageFileGrp4">
<file ID="masterFile4" USE="master">
<FLocat LOCTYPE="OTHER" OTHERLOCTYPE="file" xlink:href="./0016.tif"/>
</file>
<file ID="serviceFile4" USE="service">
<FLocat LOCTYPE="OTHER" OTHERLOCTYPE="file" xlink:href="./0016.jp2"/>
</file>
<file ID="otherDerivativeFile4" USE="derivative">
<FLocat LOCTYPE="OTHER" OTHERLOCTYPE="file" xlink:href="./0016.pdf"/>
</file>
<file ID="ocrFile4" USE="ocr">
<FLocat LOCTYPE="OTHER" OTHERLOCTYPE="file" xlink:href="./0016.xml"/>
</file>
</fileGrp>
</fileSec>
<structMap xmlns:np="urn:library-of-congress:ndnp:mets:newspaper">
<div TYPE="np:issue" DMDID="issueModsBib">
<div TYPE="np:page" DMDID="pageModsBib1">
<fptr FILEID="masterFile1"/>
<fptr FILEID="serviceFile1"/>
<fptr FILEID="otherDerivativeFile1"/>
<fptr FILEID="ocrFile1"/>
</div>
<div TYPE="np:page" DMDID="pageModsBib2">
<fptr FILEID="masterFile2"/>
<fptr FILEID="serviceFile2"/>
<fptr FILEID="otherDerivativeFile2"/>
<fptr FILEID="ocrFile2"/>
</div>
<div TYPE="np:page" DMDID="pageModsBib3">
<fptr FILEID="masterFile3"/>
<fptr FILEID="serviceFile3"/>
<fptr FILEID="otherDerivativeFile3"/>
<fptr FILEID="ocrFile3"/>
</div>
<div TYPE="np:page" DMDID="pageModsBib4">
<fptr FILEID="masterFile4"/>
<fptr FILEID="serviceFile4"/>
<fptr FILEID="otherDerivativeFile4"/>
<fptr FILEID="ocrFile4"/>
</div>
</div>
</structMap>
</mets>
| {
"content_hash": "bc6aa40a4e95c10a1db465e73c57d28c",
"timestamp": "",
"source": "github",
"line_count": 220,
"max_line_length": 533,
"avg_line_length": 40.10454545454545,
"alnum_prop": 0.6447920208545846,
"repo_name": "umd-mith/ndnp_iiif",
"id": "2645c3b08ad396f948df546eb90deee186e17bd9",
"size": "8823",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test-data/batch_mdu_kale/sn83009569/00296026165/1865100401/1865100401.xml",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "115141"
},
{
"name": "HTML",
"bytes": "1778"
},
{
"name": "JavaScript",
"bytes": "516702"
},
{
"name": "Python",
"bytes": "15001"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>regexp: 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.11.1 / regexp - 8.6.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
regexp
<small>
8.6.0
<span class="label label-info">Not compatible</span>
</small>
</h1>
<p><em><script>document.write(moment("2020-09-07 08:18:39 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-09-07 08:18:39 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
conf-findutils 1 Virtual package relying on findutils
conf-m4 1 Virtual package relying on m4
coq 8.11.1 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.05.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.05.0 Official 4.05.0 release
ocaml-config 1 OCaml Switch Configuration
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/regexp"
license: "LGPL"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/RegExp"]
depends: [
"ocaml"
"coq" {>= "8.6" & < "8.7~"}
]
tags: [ "keyword: Regular Expression" "keyword: Kleene Algebra" "category: Computer Science/Formal Languages Theory and Automata" ]
authors: [ "Takashi Miyamoto <tmiya@bu.iij4u.or.jp> [http://study-func-prog.blogspot.com/]" ]
bug-reports: "https://github.com/coq-contribs/regexp/issues"
dev-repo: "git+https://github.com/coq-contribs/regexp.git"
synopsis: "Regular Expression"
description: """
The Library RegExp is a Coq library for regular expression. The implementation is based on the Janusz Brzozowski's algorithm ("Derivatives of Regular Expressions", Journal of the ACM 1964).
The RegExp library satisfies the axioms of Kleene Algebra. The proofs are shown in the library."""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/regexp/archive/v8.6.0.tar.gz"
checksum: "md5=1504590c0ff7dfc943a2ebf97e2c1975"
}
</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-regexp.8.6.0 coq.8.11.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.11.1).
The following dependencies couldn't be met:
- coq-regexp -> coq < 8.7~ -> ocaml < 4.03.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-regexp.8.6.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": "687eb2db33b76bbf6c74b15ea410c17b",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 203,
"avg_line_length": 43.066265060240966,
"alnum_prop": 0.5501468736886278,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "d052345a08c941cad3235642a247335d0d1df687",
"size": "7151",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.05.0-2.0.6/released/8.11.1/regexp/8.6.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Web.Mvc;
namespace NorthwindStore.WebUI.Extensions
{
public static class AreaRegistrationContextExtensions
{
public static void MapRouteWithNamespaces<TRootType>(this AreaRegistrationContext context,
string routeName,
string format,
object defaults)
where TRootType : class
{
var namespaces = GetControllersNamespace<TRootType>().ToArray();
context.MapRoute(routeName, format, defaults, namespaces);
}
private static IEnumerable<string> GetControllersNamespace<TRootType>()
{
var type = typeof (TRootType);
var @namespace = type.Namespace;
var q = Assembly.GetExecutingAssembly().GetTypes()
.Where(t => t.IsClass
&& t.Namespace != null
&& t.Namespace.StartsWith(@namespace)
&& typeof(Controller).IsAssignableFrom(t))
.Select(c => c.Namespace)
.ToList();
return q;
}
}
} | {
"content_hash": "d32059da23d41b356f7474212c56e331",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 98,
"avg_line_length": 32.94285714285714,
"alnum_prop": 0.5897658282740676,
"repo_name": "aburok/NorthwindStore",
"id": "5ab5ff5be79f37b90ffecfdd7bb20bad2f9e82a7",
"size": "1155",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "WebUI/Extensions/AreaRegistrationContextExtensions.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "236"
},
{
"name": "C#",
"bytes": "174827"
},
{
"name": "CSS",
"bytes": "513"
},
{
"name": "HTML",
"bytes": "5127"
},
{
"name": "JavaScript",
"bytes": "2437"
},
{
"name": "TypeScript",
"bytes": "14892"
}
],
"symlink_target": ""
} |
package de.invation.code.toval.graphic.component;
import java.awt.Rectangle;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.swing.SwingUtilities;
import javax.swing.table.AbstractTableModel;
import de.invation.code.toval.graphic.dialog.ExceptionDialog;
import de.invation.code.toval.misc.ArrayUtils;
import de.invation.code.toval.types.ElementWithTypedProperties;
import de.invation.code.toval.validate.Validate;
public abstract class AbstractPropertyBasedTable<E extends Enum<E>, O extends ElementWithTypedProperties<E>> extends AbstractRowSelectionTable<AbstractTableModel> {
private static final long serialVersionUID = -3891196745792785590L;
private static final DateFormat DEFAULT_DATE_FORMAT = new SimpleDateFormat("dd.MM.yyyy");
private Map<Integer,Boolean> lastSortMode = new HashMap<>();
public AbstractPropertyBasedTable() {
super();
getTableHeader().addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
try {
int column = columnAtPoint(e.getPoint());
if(column == -1)
return;
if(!lastSortMode.containsKey(column)){
lastSortMode.put(column, false);
} else {
lastSortMode.put(column, !lastSortMode.get(column));
}
((PropertyBasedTableModel) getModel()).sort(columnAtPoint(e.getPoint()), lastSortMode.get(column));
} catch (Exception e1) {
ExceptionDialog.showException(SwingUtilities.getWindowAncestor(AbstractPropertyBasedTable.this), "Exception during column sort", e1, true, true);
}
}
});
}
protected abstract E[] getPropertiesOfInterest();
protected E[] getEditableProperties() {
return null;
}
protected abstract List<O> getElements();
@Override
protected AbstractTableModel createNewTableModel(){
return new PropertyBasedTableModel(getElements());
}
public void removeSelectedElement(){
int selectedRow = getSelectedRow();
if(selectedRow == -1)
return;
((PropertyBasedTableModel) getModel()).removeElementAt(selectedRow);
}
public void removeSelectedElements(){
for(int selectedRow: getSelectedRows())
((PropertyBasedTableModel) getModel()).removeElementAt(selectedRow);
}
public O getSelectedElement(){
if(getSelectedRow() == -1)
return null;
return ((PropertyBasedTableModel) getModel()).getElementAt(getSelectedRow());
}
public List<O> getSelectedElements(){
List<O> result = new ArrayList<O>();
for(int selectedRow: getSelectedRows())
result.add(((PropertyBasedTableModel) getModel()).getElementAt(selectedRow));
return result;
}
public void selectElement(O review){
int index = ((PropertyBasedTableModel) getModel()).indexOf(review);
if(index == -1)
return;
setRowSelectionInterval(index, index);
scrollRectToVisible(new Rectangle(getCellRect(index, 0, true)));
}
public int indexOf(O element){
return ((PropertyBasedTableModel) getModel()).indexOf(element);
}
public O getElementAt(int rowIndex){
return ((PropertyBasedTableModel) getModel()).getElementAt(rowIndex);
}
public void sort(E property, boolean descending) throws Exception{
try {
((PropertyBasedTableModel) getModel()).sort(property, descending);
} catch (Exception e) {
throw new Exception("Sorting operation for property \"" + property + "\" failed.", e);
}
}
public String getPropertyValueOfSelectedRow(E property){
if(getSelectedRow() == -1)
return null;
return ((PropertyBasedTableModel) getModel()).getPropertyValueOfElementInRowAsString(property, getSelectedRow());
}
public E getPropertyOfColumn(int columnIndex){
return getPropertiesOfInterest()[columnIndex];
}
public int getColumnIndexOfProperty(E property){
for(int i=0; i<getPropertiesOfInterest().length; i++)
if(getPropertyOfColumn(i).equals(property))
return i;
return -1;
}
protected String convertPropertyValueToString(O element, E property, Object propertyValue) {
if(propertyValue == null)
return "";
if(propertyValue instanceof Date)
return getDefaultDateFormat().format((Date) propertyValue);
if(propertyValue instanceof String)
return (String) propertyValue;
return propertyValue.toString();
}
protected DateFormat getDefaultDateFormat() {
return DEFAULT_DATE_FORMAT;
}
@Override
public void loadTableData() throws Exception {
List<O> previouslySelectedElements = getSelectedElements();
super.loadTableData();
if(!previouslySelectedElements.isEmpty() && PropertyBasedTableModel.class.isAssignableFrom(getModel().getClass())){
for(O selectedElement: previouslySelectedElements){
int indexOfElement = indexOf(selectedElement);
if(indexOfElement > -1)
addRowSelectionInterval(indexOfElement, indexOfElement);
}
} else {
if(getRowCount() > 0)
setRowSelectionInterval(0, 0);
}
}
public class PropertyBasedTableModel extends AbstractTableModel {
private static final long serialVersionUID = 4620848935486253765L;
private static final String EXCEPTION_DURING_PROPERTY_EXTRACTION = "! Property Value Extraction Exception !";
private List<O> modelElements = null;
public PropertyBasedTableModel(List<O> elements) {
super();
Validate.notNull(elements);
this.modelElements = elements;
}
public void sort(E property, boolean descending) throws Exception{
sort(colIndexOfProperty(property), descending);
}
public void sort(int column, boolean descending) throws Exception{
if(modelElements.isEmpty() || column < 0 || column > getPropertiesOfInterest().length)
return;
Comparator comparator = modelElements.get(0).getComparator(getPropertiesOfInterest()[column], descending);
if(comparator == null)
return;
try {
Collections.sort(modelElements, comparator);
} catch (Exception e) {
throw new Exception("Sorting operation failed.", e);
}
fireTableDataChanged();
}
private int colIndexOfProperty(E property){
for(int i=0;i<getPropertiesOfInterest().length;i++){
if(getPropertiesOfInterest()[i].equals(property))
return i;
}
return -1;
}
@Override
public String getColumnName(int column) {
return getPropertiesOfInterest()[column].toString();
}
@Override
public int getRowCount() {
return modelElements.size();
}
@Override
public int getColumnCount() {
return getPropertiesOfInterest().length;
}
public String getPropertyValueOfElementInRowAsString(E property, int rowIndex){
return getValueAt(rowIndex, colIndexOfProperty(property));
}
public O getElementAt(int rowIndex){
return modelElements.get(rowIndex);
}
public int indexOf(O element){
for(int index=0; index<modelElements.size(); index++){
if(modelElements.get(index).equals(element))
return index;
}
return -1;
}
@Override
public String getValueAt(int rowIndex, int columnIndex) {
O element = modelElements.get(rowIndex);
E propertyOfInterest = getPropertiesOfInterest()[columnIndex];
try {
return convertPropertyValueToString(element, propertyOfInterest, element.getProperty(propertyOfInterest));
} catch (Exception e) {
return EXCEPTION_DURING_PROPERTY_EXTRACTION;
}
}
public boolean isCellEditable(int row, int column) {
if(getEditableProperties() == null)
return false;
return ArrayUtils.contains(getEditableProperties(), getPropertiesOfInterest()[column]);
}
@Override
public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
if(!isCellEditable(rowIndex, columnIndex))
return;
E colProperty = getPropertiesOfInterest()[columnIndex];
O element = getElementAt(rowIndex);
if(element == null)
return;
try {
element.setProperty(colProperty, aValue);
fireTableCellUpdated(rowIndex, columnIndex);
} catch (Exception e) {
e.printStackTrace();
}
}
public void removeElementAt(int index){
modelElements.remove(index);
fireTableDataChanged();
}
}
}
| {
"content_hash": "4df2f050843994149bef8bf7b6cb0340",
"timestamp": "",
"source": "github",
"line_count": 275,
"max_line_length": 164,
"avg_line_length": 31,
"alnum_prop": 0.7058064516129032,
"repo_name": "GerdHolz/TOVAL",
"id": "c1c3912146ae40b3a7cc95866ab5fae260e1f648",
"size": "8525",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/de/invation/code/toval/graphic/component/AbstractPropertyBasedTable.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Java",
"bytes": "1083324"
}
],
"symlink_target": ""
} |
from __future__ import print_function
from wmp import *
import os
import configuration
import time
import utils
# names of all platforms the web interface supports.
# TODO: populate this from Makefiles?
supportedPlatforms = ["telosb", "testbed", "testbed2", "sm3", "xm1000"]
MAX_TIME_WAIT_FOR_REPLY = 0.1 # max time to wait for a single reply, seconds
MAX_RETRIES = 3 # send 3 times before giving up
def isFatCharacterAcceptable(c):
if c.isalnum(): return True
if c == ' ': return True
if c >= 128: return True
if c == '!' or c == '#' \
or c == '$' or c == '%' \
or c == '&' or c == '\'' \
or c == '(' or c == ')' \
or c == '-' or c == '@' \
or c == '^' or c == '_' \
or c == '`' or c == '{' \
or c == '}' or c == '~':
return True
return False
def isValidFatFilename(filename):
baseLen = 0
extLen = 0
numDots = 0
for c in filename:
if c == '.' and numDots == 0:
numDots += 1
continue
if numDots == 0:
baseLen += 1
else:
extLen += 1
if not isFatCharacterAcceptable(c):
return False
return baseLen >= 1 and baseLen <= 8 and extLen <= 3
def fatFilenamePrettify(filename):
result = ""
for c in filename:
if c != ' ' and isFatCharacterAcceptable(c):
result += c
return result
class Platform(object):
def __init__(self, name, sensors, outputs, leds):
self.name = name
self.sensors = sensors
self.outputs = outputs
self.leds = leds
def wmpSendCommand(ser, command, args):
print("send cmd=" + str(command) + " args=" + str(map(hex, args)))
txFrame = "%c%c%c" % (WMP_START_CHARACTER, command, len(args))
for a in args:
txFrame += chr(a)
crc = 0
for c in txFrame:
crc ^= ord(c)
ser.write(bytearray([ord(c)]))
ser.write(bytearray([crc]))
class SerialPacket(object):
def __init__(self):
self.command = 0 # WMP command
self.argLen = 0 # promised argument length
self.arguments = [] # variable length arguments
self.crc = 0 # XOR of packet fields
def wmpCrc(self):
result = ord(WMP_START_CHARACTER)
result ^= self.command
result ^= self.argLen
for a in self.arguments:
result ^= a
return result
#
# Class that manages configuration getting and setting
#
class MoteConfig(object):
READ_START_CHARACTER = 0
READ_COMMAND = 1
READ_ARG_LEN = 2
READ_ARGS = 3
READ_CRC = 4
def __init__(self):
self.configMode = False
self.mote = None
self.activePlatform = None
self.platforms = {}
self.state = self.READ_START_CHARACTER
self.currentSp = SerialPacket()
self.lastSp = None
self.filenameOnMote = configuration.c.getCfgValue("saveToFilenameOnMote")
for platform in supportedPlatforms:
try:
module = __import__("sensorlist_" + platform)
except:
module = None
if module:
self.platforms[platform] = Platform(platform,
module.sensors, module.outputs, module.leds)
def wmpProcessCommand(self):
print("rcdv command=" + str(self.currentSp.command & ~WMP_CMD_REPLY_FLAG) +\
" args=" + str(map(hex, self.currentSp.arguments)))
if not (self.currentSp.command & WMP_CMD_REPLY_FLAG):
print("not a reply, ignoring")
return
if self.lastSp:
print("previous reply not processed, ignoring")
return
self.lastSp = self.currentSp
self.lastSp.command &= ~WMP_CMD_REPLY_FLAG
def byteRead(self, x):
assert self.configMode
if self.state == self.READ_START_CHARACTER:
if x == WMP_START_CHARACTER:
self.state = self.READ_COMMAND
elif self.state == self.READ_COMMAND:
self.currentSp.command = ord(x)
self.state = self.READ_ARG_LEN
elif self.state == self.READ_ARG_LEN:
self.currentSp.argLen = ord(x)
if self.currentSp.argLen:
self.state = self.READ_ARGS
else:
self.state = self.READ_CRC
elif self.state == self.READ_ARGS:
self.currentSp.arguments.append(ord(x))
if len(self.currentSp.arguments) == self.currentSp.argLen:
self.state = self.READ_CRC
elif self.state == self.READ_CRC:
self.currentSp.crc = ord(x)
if self.currentSp.wmpCrc() == self.currentSp.crc:
self.wmpProcessCommand()
else:
print("bad crc {:x}\n".format(sp.crc))
self.currentSp = SerialPacket()
self.state = self.READ_START_CHARACTER
def checkValid(self):
if not self.mote:
return ("mote not present!", False)
if not self.mote.port:
return ("serial port " + self.mote.getFullName() + " not opened!", False)
if not self.activePlatform:
return ("platform not selected!", False)
return (None, True)
def wmpExchangeCommand(self, command, arguments):
returnArguments = [] # default
ok = False
try:
for i in range(MAX_RETRIES):
iterEndTime = time.time() + MAX_TIME_WAIT_FOR_REPLY
self.lastSp = None
wmpSendCommand(self.mote.port, command, arguments)
time.sleep(0.01)
while time.time() < iterEndTime:
if self.lastSp:
if self.lastSp.command == command:
# print(" command OK")
returnArguments = self.lastSp.arguments
ok = True
else:
# print(" wrong/unexpected command")
pass
self.lastSp = None
break
# print("waiting...")
time.sleep(0.01)
if ok: break
except Exception as e:
pass
if not ok: print("reply NOT received!")
return (returnArguments, ok)
def wmpGetSensorConfig(self, sensorCode):
(args, ok) = self.wmpExchangeCommand(WMP_CMD_GET_SENSOR, [sensorCode])
if not ok or len(args) < 5:
return 0 # default
return utils.le32read(args[1:])
def wmpGetOutputConfig(self, sensorCode):
(args, ok) = self.wmpExchangeCommand(WMP_CMD_GET_OUTPUT, [sensorCode])
if not ok or len(args) < 2:
return False # default
return bool(args[1])
def wmpGetLedConfig(self, ledCode):
(args, ok) = self.wmpExchangeCommand(WMP_CMD_GET_LED, [ledCode])
if not ok or len(args) < 2:
return False # default
return bool(args[1])
def updateConfigValues(self, qs):
if "set" not in qs:
return (None, True)
for s in self.activePlatform.sensors:
if s.varname in qs:
try:
t = int(qs[s.varname][0], 0)
s.period = t
except:
pass
for s in self.activePlatform.outputs:
if s.varname in qs:
try:
t = qs[s.varname][0] == "on"
s.isSelected = t
except:
pass
else:
s.isSelected = False
for s in self.activePlatform.leds:
if s.varname in qs:
try:
t = qs[s.varname][0] == "on"
s.isOn = t
except:
pass
else:
s.isOn = False
if "filename" in qs:
newFilename = qs["filename"][0]
if len(newFilename) and newFilename.find(".") == -1:
# add default extension
newFilename += ".csv"
if len(newFilename) == 0 or isValidFatFilename(newFilename):
self.filenameOnMote = newFilename
else:
return ("The filename specified is not a valid FAT file name!", False)
else:
self.filenameOnMote = ""
configuration.c.setCfgValue("saveToFilenameOnMote", self.filenameOnMote)
configuration.c.save()
return (None, True)
def getConfigValues(self):
(errstr, ok) = self.checkValid()
if not ok:
return "<strong>Get failed: " + errstr + "</strong><br/>"
self.configMode = True
for s in self.activePlatform.sensors:
s.period = self.wmpGetSensorConfig(s.code)
for s in self.activePlatform.outputs:
s.isSelected = self.wmpGetOutputConfig(s.code)
for s in self.activePlatform.leds:
s.isOn = self.wmpGetLedConfig(s.code)
(args, ok) = self.wmpExchangeCommand(WMP_CMD_GET_FILENAME, [])
newFilename = "".join(args)
if ok and newFilename != self.filenameOnMote:
self.filenameOnMote = newFilename
configuration.c.setCfgValue("saveToFilenameOnMote", self.filenameOnMote)
configuration.c.save()
self.configMode = False
return "<strong>Configuration values read!</strong><br/>"
def setConfigValues(self):
(errstr, ok) = self.checkValid()
if not ok:
return "<strong>Get failed: " + errstr + "</strong><br/>"
self.configMode = True
for s in self.activePlatform.sensors:
args = [s.code]
args += utils.le32write(s.period)
self.wmpExchangeCommand(WMP_CMD_SET_SENSOR, args)
for s in self.activePlatform.outputs:
args = [s.code, int(s.isSelected)]
self.wmpExchangeCommand(WMP_CMD_SET_OUTPUT, args)
for s in self.activePlatform.leds:
args = [s.code, int(s.isOn)]
self.wmpExchangeCommand(WMP_CMD_SET_LED, args)
args = bytearray(self.filenameOnMote)
self.wmpExchangeCommand(WMP_CMD_SET_FILENAME, args)
self.configMode = False
return "<strong>Configuration values written!</strong><br/>"
def setMote(self, mote, platform):
if self.mote and self.mote != mote:
self.mote.ensureSerialIsClosed()
time.sleep(0.1)
self.mote = mote
self.activePlatform = self.platforms.get(platform, None)
if not self.activePlatform:
print("platform not supported or sensorlist file not present!")
self.mote = None
return
self.mote.platform = platform
if not self.mote.port:
self.mote.tryToOpenSerial(True)
time.sleep(2)
if not self.mote.port:
# self.mote = None
return
def getFileContentsHTML(self, qs):
(errst, ok) = self.checkValid()
if not ok:
return (errst, False)
if "filename" not in qs:
errst = "file name no specified!"
return (errst, False)
filename = qs["filename"][0]
if not isValidFatFilename(filename):
errst = 'file name "' + filename + '" is not valid!'
return (errst, False)
self.configMode = True
(args, ok) = self.wmpExchangeCommand(WMP_CMD_GET_FILE, bytearray(filename))
self.configMode = False
if not ok:
errst = 'communication failed!'
return (errst, False)
contents = str(bytearray(args))
text = '<em>File ' + filename + ' contents:</em><br/>\n'
text += contents
text += '\n<br/>\n'
return (text, True)
def getFileListHTML(self, motename):
(errst, ok) = self.checkValid()
if not ok:
return (errst, False)
self.configMode = True
(args, ok) = self.wmpExchangeCommand(WMP_CMD_GET_FILELIST, [])
self.configMode = False
if not ok:
errst = 'communication failed!'
return (errst, False)
namelist = str(bytearray(args)).split('\n')
motename = "mote" + motename
if len(namelist) == 0 or len(namelist[0]) == 0:
text = "The SD card is empty!"
else:
text = '<strong>Files:</strong><br/>\n'
text += '<div class="files">'
for filename in namelist:
text += '<div class="entry"><span class="column1">'
filename = fatFilenamePrettify(filename)
text += filename
text += '</span><span class="column2">'
text += ' <a href="config?filename=' + filename + '&' \
+ motename + '_files=1&sel_' + motename + '=' + self.activePlatform.name \
+ '">File contents</a>'
text += "</span></div>\n"
text += "</div>"
return (text, True)
def getConfigHTML(self):
(errst, ok) = self.checkValid()
if not ok:
return (errst, False)
# start of form
text = '<form action="config" id="configForm"><div class="form">\n'
# mote
text += '<strong>Mote:</strong><br/>\n'
text += '<div class="subcontents">\n'
text += 'Port: <em>' + self.mote.getFullName() + '</em><br/>\n'
text += 'Platform: <em>' + self.activePlatform.name + '</em><br/>\n'
text += '</div>\n'
# sensors
text += "<table class='table'><thead><tr style='background-color: #f5f5f5;'><th> </th>"
for s in self.activePlatform.sensors:
text += "<th>" + utils.toTitleCase(s.name) + "</th>"
text += "</thead></tr><tbody>"
text += "<tr><th valign='middle'>Period</th>"
for s in self.activePlatform.sensors:
text += "<td>"
text += '<input type="text" title="Sensor reading periods (in milliseconds, \'0\' means disabled)" name="' + s.varname + '" value="' + str(s.period) + '" style="width: 50px"/><br/></div>\n'
text += "</td>"
text += "</tr>"
text += "<tr><th valign='middle'>Actions</th>"
for s in self.activePlatform.sensors:
text += "<td>"
text += "<input type='checkbox' name='graph_" + s.varname + "' %graph_" + s.varname + "%> <a href='javascript:void(0)'>graph</a></input>"
#text += "<br/>"
#text += "<input type='checkbox' name='store_" + s.varname + "'> <a href='javascript:void(0)'>store</a></input>"
text += "</td>"
text += "</tr>"
text += "</tbody></table>"
# outputs
text += "<table><tr><td valign='top'>"
text += '<strong>System outputs:</strong><br/>\n'
text += '<div class="subcontents">\n'
for s in self.activePlatform.outputs:
text += '<div class="entry">'
text += '<input type="checkbox" name="' + s.varname + '"'
if s.isSelected: text += ' checked="checked"'
text += '/> Write to ' + utils.toCamelCase(s.name)
if s.varname == "file":
text += '<br/><label for="filename">Filename: </label>'
text += '<input type="input" name="filename" value="' + self.filenameOnMote + '"'
text += ' title="The file will be created on mote\'s SD card" />\n'
text += '<br/></div>\n'
text += '</div>\n'
text += "</td><td width='40px'></td><td valign='top'>"
# leds
text += '<strong>LED:</strong><br/>\n'
text += '<div class="subcontents">\n'
for s in self.activePlatform.leds:
text += '<div class="entry">'
text += '<input type="checkbox" name="' + s.varname + '"'
if s.isOn: text += ' checked="checked"'
text += '/> ' + s.name + " LED on"
text += '<br/></div>\n'
text += '</div>\n'
text += "</td></tr></table>"
# end of form
motename = "mote" + self.mote.getFullBasename()
text += '<input type="hidden" name="' + motename + '_cfg" value="1"/>\n'
text += '<input type="hidden" name="sel_' + motename \
+ '" value="' + self.activePlatform.name + '" />\n'
text += '</div></form>\n'
return (text, True)
# global variable
instance = MoteConfig()
| {
"content_hash": "a60b6807e8b9c3c9d22355f57aa71186",
"timestamp": "",
"source": "github",
"line_count": 494,
"max_line_length": 201,
"avg_line_length": 33.621457489878544,
"alnum_prop": 0.5209825997952917,
"repo_name": "IECS/MansOS",
"id": "792f9f7568d9fc749c927e3530d918c85cf50ab8",
"size": "16655",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tools/web/moteconfig.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "2207767"
},
{
"name": "C++",
"bytes": "105213"
},
{
"name": "EmberScript",
"bytes": "22"
},
{
"name": "HTML",
"bytes": "2485"
},
{
"name": "Makefile",
"bytes": "338645"
},
{
"name": "Objective-C",
"bytes": "23658"
},
{
"name": "PHP",
"bytes": "31840"
},
{
"name": "Perl",
"bytes": "17357"
},
{
"name": "Python",
"bytes": "208619"
},
{
"name": "Slash",
"bytes": "3318"
}
],
"symlink_target": ""
} |
[](https://crates.io/crates/nexus)
[](https://travis-ci.org/crhino/nexus)
| {
"content_hash": "78cadfc48f0e9c323ebf4f214396116c",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 107,
"avg_line_length": 97,
"alnum_prop": 0.7371134020618557,
"repo_name": "crhino/nexus",
"id": "70558ab9d3690d040c130ad07fe5bec2f314b31a",
"size": "241",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Rust",
"bytes": "59576"
}
],
"symlink_target": ""
} |
require "sandthorn_driver_sequel/access/aggregate_access"
require "sandthorn_driver_sequel/access/event_access"
require "sandthorn_driver_sequel/storage"
module SandthornDriverSequel
class EventStore
include EventStoreContext
attr_reader :driver, :context
def initialize connection, configuration, context = nil
@driver = connection
@context = context
@event_serializer = configuration.event_serializer
@event_deserializer = configuration.event_deserializer
end
def self.from_url url, configuration, context = nil
new(SequelDriver.new(url: url), configuration, context)
end
#save methods
def save_events events, aggregate_id, class_name
driver.execute_in_transaction do |db|
aggregates = get_aggregate_access(db)
event_access = get_event_access(db)
aggregate = aggregates.find_or_register(aggregate_id, class_name)
event_access.store_events(aggregate, events)
end
end
#get methods
def all aggregate_type
return get_aggregate_ids(aggregate_type: aggregate_type).map do |id|
aggregate_events(id)
end
end
def find aggregate_id, aggregate_type, after_aggregate_version = 0
aggregate_events(aggregate_id, after_aggregate_version)
end
def get_events(*args)
driver.execute do |db|
event_access = get_event_access(db)
event_access.get_events(*args)
end
end
private
def aggregate_events(aggregate_id, after_aggregate_version = 0)
driver.execute do |db|
event_access = get_event_access(db)
event_access.find_events_by_aggregate_id(aggregate_id, after_aggregate_version)
end
end
def get_aggregate_ids(aggregate_type: nil)
driver.execute do |db|
access = get_aggregate_access(db)
access.aggregate_ids(aggregate_type: aggregate_type)
end
end
def get_aggregate_access(db)
@aggregate_access ||= AggregateAccess.new(storage(db))
end
def get_event_access(db)
@event_access ||= EventAccess.new(storage(db), @event_serializer, @event_deserializer)
end
def storage(db)
@storage ||= Storage.new(db, @context)
end
end
end | {
"content_hash": "9987ae02729fba48f5df4619fe7ff84f",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 92,
"avg_line_length": 28.20253164556962,
"alnum_prop": 0.677737881508079,
"repo_name": "Sandthorn/sandthorn_driver_sequel",
"id": "7b64c3385e7589968c030a0a789eabe89df38709",
"size": "2228",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/sandthorn_driver_sequel/event_store.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "48683"
}
],
"symlink_target": ""
} |
<!doctype html>
<html class="no-js" lang="en">
<head><!-- PageID 13951 - published by OpenText Web Site Management 10.1 - 10.1.2.391 -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0; maximum-scale=1.0"/>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="robots" content="noindex">
<meta name="googlebot" content="noindex">
<link href="favicon.ico" rel="shortcut icon" />
<title>Brooklyn College | Brooklyn College Foundation</title>
<link rel="stylesheet" href="css/app.css" /> <!-- Compiled Sass CSS -->
<script src="js/vendor/modernizr.js"></script> <!-- Modernizr -->
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body data-responsejs='{"create" : {"mode" : "src", "prefix" : "src"}}'>
<script type="text/javascript">
headline_parent = "The Annual Fund";
</script>
<!--BC-->
<div id="sidebar">
<ul id="subnav" class="subpage">
<li><a href="http://www.brooklyn.cuny.edu/web/academics/schools.php">Schools</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/academics/departments.php">Academic Departments</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/academics/majors.php">Majors, Minors and Concentrations</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/academics/graduate.php">Graduate Programs</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/academics/doctoral.php">Doctoral Programs</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/academics/fieldsofstudy.php">Fields of Study</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/academics/inter_programs.php">Interdisciplinary Programs</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/academics/general.php">General Education</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/academics/honors.php">Honors and Special Programs</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/academics/international.php">International Education</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/academics/resources.php">Academic Resources</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/academics/library.php">Library</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/academics/centers.php">Centers and Institutes</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/academics/research.php">Research</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/academics/faculty.php">Faculty</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/academics/bulletins.php">Course Schedules and Bulletins</a></li>
</ul>
<ul class="subnav_secondary subpage">
<li><a href="http://www.brooklyn.cuny.edu/web/academics/faculty/development.php">Faculty and Staff Development Opportunities (CUNY)</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/academics/faculty/wac.php">Writing Across the Curriculum</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/academics/faculty/allfaculty.jsp">Brooklyn College Faculty</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/academics/faculty/profiles.php">Search Faculty Profiles</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/academics/faculty/authors.php">Faculty Book Authors</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/academics/faculty/awards.php">Honors, Awards and Grants</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/academics/faculty/facultycouncil.php">Faculty Council</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/academics/faculty/facultyday.php">Faculty Day</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/academics/faculty/handbook.php">Faculty Handbook</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/academics/faculty/newsletter.php">Faculty Newsletter</a></li>
</ul>
</div>
<!--BCF-->
<div class="aside-wrapper">
<div id="sidebar">
<div class="sidebar-header all-caps">Giving Opportunities</div>
<ul id="subnav" class="subpage">
<li><a href="http://www.brooklyn.cuny.edu/web/support/foundation2/giving/annual.php">The Annual Fund</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/support/foundation2/giving/restricted.php">Restricted Funds</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/support/foundation2/giving/foundations.php">Foundations and Corporations</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/support/foundation2/giving/planned.php">Planned Gifts</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/support/foundation2/giving/brick.php">Buy a Brick</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/support/foundation2/giving/bench.php">Purchase a Bench</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/support/foundation2/giving/classroom.php">Name a Classroom</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/support/foundation2/giving/matching.php">Matching Gifts</a></li>
<li><a href="http://www.brooklyn.cuny.edu/web/support/foundation2/giving/memorial.php">Memorial Gifts</a></li>
</ul>
<ul class="subnav_secondary subpage">
<li><a href="http://www.brooklyn.cuny.edu/web/support/foundation2/giving/annual/boylan.php">Boylan Society</a></li>
</ul>
</div>
</div>
<!-- js loads -->
<script src="js/vendor/jquery.js"></script> <!-- jQuery -->
<!--<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>-->
<!--<script src="http://www.brooklyn.cuny.edu/web/js/jquery.js"></script>--> <!-- jQuery -->
<script src="js/foundation/foundation.js"></script> <!-- Foundation -->
<script src="js/foundation/foundation.topbar.js"></script> <!-- topbar -->
<script src="js/foundation/foundation.orbit.js"></script> <!-- orbit -->
<!--<script src="http://www.brooklyn.cuny.edu/web/js/foundation/foundation.topbar.js"></script>--> <!-- top-bar menu -->
<script src="http://www.brooklyn.cuny.edu/web/js/response.js"></script> <!--// responsive content images//-->
<script src="http://www.brooklyn.cuny.edu/web/js/ga-eventtracker.js"></script> <!-- eventTracker (eventually will not use)-->
<script>
$(document).foundation();
</script>
<!--script-->
<script type="text/javascript">
$(document).ready(function(){
var headline = headline_parent; // see above
$("#sidebar ul.subpage a").each(function(){
if ($(this).text()== headline) {
$(this).addClass("selected");
}
});
if ($('#sidebar ul.subpage').length > 1) {
var item_found = false;
$('#sidebar ul.subpage').each(function() {
$selected_item = $(this).find('li a.selected');
if ($selected_item.text() == '' && item_found == true) {
// sub list item
item_found = false;
$(this).insertAfter('#sidebar #subnav.subpage li a.selected');
} else if ($selected_item.text() == '') {
// empty item
$(this).attr('id','').css('display','none');
} else {
// selected list item
$(this).attr('id','subnav');
item_found = true;
}
});
}
});
</script> | {
"content_hash": "f3b2fbf747fb2d81f2110e94c79ba2e6",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 142,
"avg_line_length": 54.32592592592592,
"alnum_prop": 0.6450777202072538,
"repo_name": "clthompson/BCF-5",
"id": "bfdd5221f4c84f1502f931d1fe470a42706f0c10",
"size": "7334",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sidenav.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "793353"
},
{
"name": "JavaScript",
"bytes": "148918"
},
{
"name": "Ruby",
"bytes": "913"
}
],
"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.10"/>
<title>Labyrinttipeli: Julkinen::Logiikkavirhe Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Labyrinttipeli
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<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="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespace_julkinen.html">Julkinen</a></li><li class="navelem"><a class="el" href="class_julkinen_1_1_logiikkavirhe.html">Logiikkavirhe</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-types">Public Types</a> |
<a href="#pub-methods">Public Member Functions</a> |
<a href="class_julkinen_1_1_logiikkavirhe-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">Julkinen::Logiikkavirhe Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><a class="el" href="class_julkinen_1_1_virhe.html" title="Labyrintin poikkeusten kantaluokka. ">Virhe</a> toimintalogiikka virhetilanteita varten.
<a href="class_julkinen_1_1_logiikkavirhe.html#details">More...</a></p>
<p><code>#include <<a class="el" href="logiikkavirhe_8hh_source.html">logiikkavirhe.hh</a>></code></p>
<div class="dynheader">
Inheritance diagram for Julkinen::Logiikkavirhe:</div>
<div class="dyncontent">
<div class="center">
<img src="class_julkinen_1_1_logiikkavirhe.png" usemap="#Julkinen::Logiikkavirhe_map" alt=""/>
<map id="Julkinen::Logiikkavirhe_map" name="Julkinen::Logiikkavirhe_map">
<area href="class_julkinen_1_1_virhe.html" title="Labyrintin poikkeusten kantaluokka. " alt="Julkinen::Virhe" shape="rect" coords="0,0,140,24"/>
</map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:afbf716c9c72439df3d8638576942d14d"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="class_julkinen_1_1_logiikkavirhe.html#afbf716c9c72439df3d8638576942d14d">Virhekoodi</a> { <a class="el" href="class_julkinen_1_1_logiikkavirhe.html#afbf716c9c72439df3d8638576942d14da327478ab895f92a6e547db21b050ab8f">VIRHE_TUNNISTAMATON</a>
}<tr class="memdesc:afbf716c9c72439df3d8638576942d14d"><td class="mdescLeft"> </td><td class="mdescRight">Tunnisteet esimääritellyille virhetilanteille käyttäjän antamissa komennoissa. <a href="class_julkinen_1_1_logiikkavirhe.html#afbf716c9c72439df3d8638576942d14d">More...</a><br /></td></tr>
<tr class="separator:afbf716c9c72439df3d8638576942d14d"><td class="memSeparator" colspan="2"> </td></tr>
</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a95b0e31452062d57a34d5ee1e7b1545b"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_julkinen_1_1_logiikkavirhe.html#a95b0e31452062d57a34d5ee1e7b1545b">Logiikkavirhe</a> (std::string const &virheviesti)</td></tr>
<tr class="memdesc:a95b0e31452062d57a34d5ee1e7b1545b"><td class="mdescLeft"> </td><td class="mdescRight">Tunnistamaton virhetilanne kopioidulla viestillä. <a href="#a95b0e31452062d57a34d5ee1e7b1545b">More...</a><br /></td></tr>
<tr class="separator:a95b0e31452062d57a34d5ee1e7b1545b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a82c17b4ae69d3701def7dee519b69024"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_julkinen_1_1_logiikkavirhe.html#a82c17b4ae69d3701def7dee519b69024">Logiikkavirhe</a> (<a class="el" href="class_julkinen_1_1_logiikkavirhe.html#afbf716c9c72439df3d8638576942d14d">Virhekoodi</a> virhekoodi)</td></tr>
<tr class="memdesc:a82c17b4ae69d3701def7dee519b69024"><td class="mdescLeft"> </td><td class="mdescRight">Esimääritelty virhetilanne. <a href="#a82c17b4ae69d3701def7dee519b69024">More...</a><br /></td></tr>
<tr class="separator:a82c17b4ae69d3701def7dee519b69024"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2ff42b2fc57b19638aebc7b8aa6f62d8"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_julkinen_1_1_logiikkavirhe.html#a2ff42b2fc57b19638aebc7b8aa6f62d8">Logiikkavirhe</a> (<a class="el" href="class_julkinen_1_1_logiikkavirhe.html">Logiikkavirhe</a> const &toinen)</td></tr>
<tr class="memdesc:a2ff42b2fc57b19638aebc7b8aa6f62d8"><td class="mdescLeft"> </td><td class="mdescRight">Kopiorakentaja. <a href="#a2ff42b2fc57b19638aebc7b8aa6f62d8">More...</a><br /></td></tr>
<tr class="separator:a2ff42b2fc57b19638aebc7b8aa6f62d8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9e680776140205960612e4b3b3be8e28"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_julkinen_1_1_logiikkavirhe.html">Logiikkavirhe</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_julkinen_1_1_logiikkavirhe.html#a9e680776140205960612e4b3b3be8e28">operator=</a> (<a class="el" href="class_julkinen_1_1_logiikkavirhe.html">Logiikkavirhe</a> const &toinen)</td></tr>
<tr class="memdesc:a9e680776140205960612e4b3b3be8e28"><td class="mdescLeft"> </td><td class="mdescRight">Sijoitusoperaattori. <a href="#a9e680776140205960612e4b3b3be8e28">More...</a><br /></td></tr>
<tr class="separator:a9e680776140205960612e4b3b3be8e28"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a453d06482aa51a80b27ab043d9efffaa"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_julkinen_1_1_logiikkavirhe.html#afbf716c9c72439df3d8638576942d14d">Virhekoodi</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_julkinen_1_1_logiikkavirhe.html#a453d06482aa51a80b27ab043d9efffaa">virhe</a> () const </td></tr>
<tr class="memdesc:a453d06482aa51a80b27ab043d9efffaa"><td class="mdescLeft"> </td><td class="mdescRight">Sattuneen virhetilanteen virhekoodi. <a href="#a453d06482aa51a80b27ab043d9efffaa">More...</a><br /></td></tr>
<tr class="separator:a453d06482aa51a80b27ab043d9efffaa"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a298ce4b9c3d1887d5be431bea89645da"><td class="memItemLeft" align="right" valign="top">virtual std::basic_ostream< char > & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_julkinen_1_1_logiikkavirhe.html#a298ce4b9c3d1887d5be431bea89645da">tulosta</a> (std::basic_ostream< char > &tuloste) const </td></tr>
<tr class="memdesc:a298ce4b9c3d1887d5be431bea89645da"><td class="mdescLeft"> </td><td class="mdescRight">Tulosta virheen viesti virtaan. <a href="#a298ce4b9c3d1887d5be431bea89645da">More...</a><br /></td></tr>
<tr class="separator:a298ce4b9c3d1887d5be431bea89645da"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="inherit_header pub_methods_class_julkinen_1_1_virhe"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_julkinen_1_1_virhe')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="class_julkinen_1_1_virhe.html">Julkinen::Virhe</a></td></tr>
<tr class="memitem:a5a745aa6f700e7ea3a9b7f09e9ca5455 inherit pub_methods_class_julkinen_1_1_virhe"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_julkinen_1_1_virhe.html#a5a745aa6f700e7ea3a9b7f09e9ca5455">Virhe</a> (std::string const &virheviesti)</td></tr>
<tr class="memdesc:a5a745aa6f700e7ea3a9b7f09e9ca5455 inherit pub_methods_class_julkinen_1_1_virhe"><td class="mdescLeft"> </td><td class="mdescRight">Kopioidulla viestillä. <a href="#a5a745aa6f700e7ea3a9b7f09e9ca5455">More...</a><br /></td></tr>
<tr class="separator:a5a745aa6f700e7ea3a9b7f09e9ca5455 inherit pub_methods_class_julkinen_1_1_virhe"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a019192eb91000290fd9a36999532fb4b inherit pub_methods_class_julkinen_1_1_virhe"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_julkinen_1_1_virhe.html#a019192eb91000290fd9a36999532fb4b">Virhe</a> (char const *virheviesti)</td></tr>
<tr class="memdesc:a019192eb91000290fd9a36999532fb4b inherit pub_methods_class_julkinen_1_1_virhe"><td class="mdescLeft"> </td><td class="mdescRight">Muualla tallessa olevalla viestillä. <a href="#a019192eb91000290fd9a36999532fb4b">More...</a><br /></td></tr>
<tr class="separator:a019192eb91000290fd9a36999532fb4b inherit pub_methods_class_julkinen_1_1_virhe"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aba36e3156c54aa1281dc5be29b76af0a inherit pub_methods_class_julkinen_1_1_virhe"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_julkinen_1_1_virhe.html#aba36e3156c54aa1281dc5be29b76af0a">Virhe</a> (<a class="el" href="class_julkinen_1_1_virhe.html">Virhe</a> const &toinen)</td></tr>
<tr class="memdesc:aba36e3156c54aa1281dc5be29b76af0a inherit pub_methods_class_julkinen_1_1_virhe"><td class="mdescLeft"> </td><td class="mdescRight">Kopiorakentaja. <a href="#aba36e3156c54aa1281dc5be29b76af0a">More...</a><br /></td></tr>
<tr class="separator:aba36e3156c54aa1281dc5be29b76af0a inherit pub_methods_class_julkinen_1_1_virhe"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab71f7f303930ccd1b48bda352412d625 inherit pub_methods_class_julkinen_1_1_virhe"><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="class_julkinen_1_1_virhe.html#ab71f7f303930ccd1b48bda352412d625">~Virhe</a> ()</td></tr>
<tr class="memdesc:ab71f7f303930ccd1b48bda352412d625 inherit pub_methods_class_julkinen_1_1_virhe"><td class="mdescLeft"> </td><td class="mdescRight">Purkaja. <a href="#ab71f7f303930ccd1b48bda352412d625">More...</a><br /></td></tr>
<tr class="separator:ab71f7f303930ccd1b48bda352412d625 inherit pub_methods_class_julkinen_1_1_virhe"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad5ee9d8d642c20d464c6188088722492 inherit pub_methods_class_julkinen_1_1_virhe"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_julkinen_1_1_virhe.html">Virhe</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_julkinen_1_1_virhe.html#ad5ee9d8d642c20d464c6188088722492">operator=</a> (<a class="el" href="class_julkinen_1_1_virhe.html">Virhe</a> const &toinen)</td></tr>
<tr class="memdesc:ad5ee9d8d642c20d464c6188088722492 inherit pub_methods_class_julkinen_1_1_virhe"><td class="mdescLeft"> </td><td class="mdescRight">Sijoitusoperaattori. <a href="#ad5ee9d8d642c20d464c6188088722492">More...</a><br /></td></tr>
<tr class="separator:ad5ee9d8d642c20d464c6188088722492 inherit pub_methods_class_julkinen_1_1_virhe"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a14738e633b74fce18efbaf1086403013 inherit pub_methods_class_julkinen_1_1_virhe"><td class="memItemLeft" align="right" valign="top">char const * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_julkinen_1_1_virhe.html#a14738e633b74fce18efbaf1086403013">viesti</a> () const </td></tr>
<tr class="memdesc:a14738e633b74fce18efbaf1086403013 inherit pub_methods_class_julkinen_1_1_virhe"><td class="mdescLeft"> </td><td class="mdescRight">Virheeseen liittyva ilmoitus. <a href="#a14738e633b74fce18efbaf1086403013">More...</a><br /></td></tr>
<tr class="separator:a14738e633b74fce18efbaf1086403013 inherit pub_methods_class_julkinen_1_1_virhe"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header related_class_julkinen_1_1_virhe"><td colspan="2" onclick="javascript:toggleInherit('related_class_julkinen_1_1_virhe')"><img src="closed.png" alt="-"/> Related Functions inherited from <a class="el" href="class_julkinen_1_1_virhe.html">Julkinen::Virhe</a></td></tr>
<tr class="memitem:acc4933b244f9606f5349e6eb8ce37433 inherit related_class_julkinen_1_1_virhe"><td class="memItemLeft" align="right" valign="top">basic_ostream< char > & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_julkinen_1_1_virhe.html#acc4933b244f9606f5349e6eb8ce37433">operator<<</a> (basic_ostream< char > &tuloste, <a class="el" href="class_julkinen_1_1_virhe.html">Virhe</a> const &virhe)</td></tr>
<tr class="memdesc:acc4933b244f9606f5349e6eb8ce37433 inherit related_class_julkinen_1_1_virhe"><td class="mdescLeft"> </td><td class="mdescRight">Tulosta virhe. <a href="#acc4933b244f9606f5349e6eb8ce37433">More...</a><br /></td></tr>
<tr class="separator:acc4933b244f9606f5349e6eb8ce37433 inherit related_class_julkinen_1_1_virhe"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a41b6619bca23ba8db922973fdba25fc1 inherit related_class_julkinen_1_1_virhe"><td class="memItemLeft" align="right" valign="top">std::basic_ostream< char > & </td><td class="memItemRight" valign="bottom"><a class="el" href="class_julkinen_1_1_virhe.html#a41b6619bca23ba8db922973fdba25fc1">operator<<</a> (std::basic_ostream< char > &tuloste, <a class="el" href="class_julkinen_1_1_virhe.html">Virhe</a> const &virhe)</td></tr>
<tr class="memdesc:a41b6619bca23ba8db922973fdba25fc1 inherit related_class_julkinen_1_1_virhe"><td class="mdescLeft"> </td><td class="mdescRight">Tulosta virhe. <a href="#a41b6619bca23ba8db922973fdba25fc1">More...</a><br /></td></tr>
<tr class="separator:a41b6619bca23ba8db922973fdba25fc1 inherit related_class_julkinen_1_1_virhe"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="el" href="class_julkinen_1_1_virhe.html" title="Labyrintin poikkeusten kantaluokka. ">Virhe</a> toimintalogiikka virhetilanteita varten. </p>
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a class="anchor" id="afbf716c9c72439df3d8638576942d14d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="class_julkinen_1_1_logiikkavirhe.html#afbf716c9c72439df3d8638576942d14d">Julkinen::Logiikkavirhe::Virhekoodi</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Tunnisteet esimääritellyille virhetilanteille käyttäjän antamissa komennoissa. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="afbf716c9c72439df3d8638576942d14da327478ab895f92a6e547db21b050ab8f"></a>VIRHE_TUNNISTAMATON </td><td class="fielddoc">
<p>Tunnistamaton virhe. </p>
</td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a class="anchor" id="a95b0e31452062d57a34d5ee1e7b1545b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">Logiikkavirhe::Logiikkavirhe </td>
<td>(</td>
<td class="paramtype">std::string const & </td>
<td class="paramname"><em>virheviesti</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Tunnistamaton virhetilanne kopioidulla viestillä. </p>
<p>Käytä tätä vain, jos kyseessä ei ole mikään esimääritellyistä virheistä.</p>
<dl class="section post"><dt>Postcondition</dt><dd>Perustakuu poikkeuksen sattuessa. </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">virheviesti</td><td>Merkkijono, joka kopioidaan poikkeuksen viestiksi. </td></tr>
</table>
</dd>
</dl>
<dl class="exception"><dt>Exceptions</dt><dd>
<table class="exception">
<tr><td class="paramname">std::bad_alloc</td><td>Ei saatu varattua muistia viestiä varten. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a82c17b4ae69d3701def7dee519b69024"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">Logiikkavirhe::Logiikkavirhe </td>
<td>(</td>
<td class="paramtype"><a class="el" href="class_julkinen_1_1_logiikkavirhe.html#afbf716c9c72439df3d8638576942d14d">Virhekoodi</a> </td>
<td class="paramname"><em>virhekoodi</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Esimääritelty virhetilanne. </p>
<dl class="section post"><dt>Postcondition</dt><dd>No-throw -takuu. </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">virhekoodi</td><td>Virhetilanteen tunniste. Mikäli koodi on VIRHE_TUNNISTAMATON, tulee viestiksi "Tunnistamaton virhe.". </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a2ff42b2fc57b19638aebc7b8aa6f62d8"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Logiikkavirhe::Logiikkavirhe </td>
<td>(</td>
<td class="paramtype"><a class="el" href="class_julkinen_1_1_logiikkavirhe.html">Logiikkavirhe</a> const & </td>
<td class="paramname"><em>toinen</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Kopiorakentaja. </p>
<dl class="section post"><dt>Postcondition</dt><dd>No-throw -takuu. </dd></dl>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a9e680776140205960612e4b3b3be8e28"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="class_julkinen_1_1_logiikkavirhe.html">Logiikkavirhe</a> & Logiikkavirhe::operator= </td>
<td>(</td>
<td class="paramtype"><a class="el" href="class_julkinen_1_1_logiikkavirhe.html">Logiikkavirhe</a> const & </td>
<td class="paramname"><em>toinen</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sijoitusoperaattori. </p>
<dl class="section post"><dt>Postcondition</dt><dd>No-throw -takuu. </dd></dl>
</div>
</div>
<a class="anchor" id="a298ce4b9c3d1887d5be431bea89645da"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">basic_ostream< char > & Logiikkavirhe::tulosta </td>
<td>(</td>
<td class="paramtype">std::basic_ostream< char > & </td>
<td class="paramname"><em>tuloste</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Tulosta virheen viesti virtaan. </p>
<p>Tulostaa virheen viestin virtaan, eikä tee muuta.</p>
<dl class="section post"><dt>Postcondition</dt><dd>Vahva poikkeustakuu. </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">tuloste</td><td>Virta, jonne viesti tulostetaan. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>tuloste</code> </dd></dl>
<p>Reimplemented from <a class="el" href="class_julkinen_1_1_virhe.html#a36a2644943038f9760b5d76a1960b00d">Julkinen::Virhe</a>.</p>
</div>
</div>
<a class="anchor" id="a453d06482aa51a80b27ab043d9efffaa"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="class_julkinen_1_1_logiikkavirhe.html#afbf716c9c72439df3d8638576942d14d">Logiikkavirhe::Virhekoodi</a> Logiikkavirhe::virhe </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Sattuneen virhetilanteen virhekoodi. </p>
<dl class="section return"><dt>Returns</dt><dd>Palauttaa virheen <code>Virhekoodi</code>. </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="logiikkavirhe_8hh_source.html">logiikkavirhe.hh</a></li>
<li>valmiiden_toteutus/<a class="el" href="logiikkavirhe_8cc.html">logiikkavirhe.cc</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.10
</small></address>
</body>
</html>
| {
"content_hash": "9a84011fecc582c07759e5a8082fd157",
"timestamp": "",
"source": "github",
"line_count": 372,
"max_line_length": 478,
"avg_line_length": 66.74193548387096,
"alnum_prop": 0.7034799420009666,
"repo_name": "WhiteDeathFIN/Labyrinttipeli",
"id": "048befd56c1e500751c2a48a7774f88aa9da319c",
"size": "24860",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "html/class_julkinen_1_1_logiikkavirhe.html",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Sets_Of_Elements
{
public class SetsOfElements
{
public static void Main(string[] args)
{
var input = Console.ReadLine()
.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries)
.Select(int.Parse)
.ToArray();
var n = input[0];
var m = input[1];
var nSet=new HashSet<int>();
var mSet=new HashSet<int>();
for (int i = 0; i < n+m; i++)
{
var inputNumber = int.Parse(Console.ReadLine());
if (i<n)
{
nSet.Add(inputNumber);
}
else
{
mSet.Add(inputNumber);
}
}
var repeatedNumbers=new SortedSet<int>();
foreach (var number in nSet)
{
if (mSet.Contains(number))
{
repeatedNumbers.Add(number);
}
}
foreach (var num in repeatedNumbers)
{
Console.WriteLine(num);
}
}
}
}
| {
"content_hash": "3b36ba8f144a48727862f6a4c2c2ee73",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 74,
"avg_line_length": 25.372549019607842,
"alnum_prop": 0.43431221020092736,
"repo_name": "mkpetrov/CSharpAdvanced",
"id": "6f71541e24cb2712188168b1494de9592f898816",
"size": "1296",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "SetsAndDictionaries/Sets Of Elements/SetsOfElements.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "359141"
}
],
"symlink_target": ""
} |
@interface FOAddressTableViewController : UITableViewController
@property (nonatomic, strong) NSArray *addresses;
@end
| {
"content_hash": "058b8c92989a9a56f3b7acc25aa52d2a",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 63,
"avg_line_length": 20.333333333333332,
"alnum_prop": 0.819672131147541,
"repo_name": "myusuf3/fortune-for-bitcoin",
"id": "51de11d187e66246ee05cc99c619c174960bbddb",
"size": "361",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Fortune for Bitcoin/Controllers/FOAddressTableViewController.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "94943"
},
{
"name": "Ruby",
"bytes": "191"
}
],
"symlink_target": ""
} |
<html lang="en">
<head>
<title>i960-Chars - Using as</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Using as">
<meta name="generator" content="makeinfo 4.11">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Syntax-of-i960.html#Syntax-of-i960" title="Syntax of i960">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
This file documents the GNU Assembler "as".
Copyright (C) 1991-2013 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, with no Front-Cover Texts, and with no
Back-Cover Texts. A copy of the license is included in the
section entitled ``GNU Free Documentation License''.
-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<p>
<a name="i960-Chars"></a>
<a name="i960_002dChars"></a>
Up: <a rel="up" accesskey="u" href="Syntax-of-i960.html#Syntax-of-i960">Syntax of i960</a>
<hr>
</div>
<h5 class="subsubsection">9.17.5.1 Special Characters</h5>
<p><a name="index-line-comment-character_002c-i960-1117"></a><a name="index-i960-line-comment-character-1118"></a>The presence of a ‘<samp><span class="samp">#</span></samp>’ on a line indicates the start of a comment
that extends to the end of the current line.
<p>If a ‘<samp><span class="samp">#</span></samp>’ appears as the first character of a line, the whole line
is treated as a comment, but in this case the line can also be a
logical line number directive (see <a href="Comments.html#Comments">Comments</a>) or a
preprocessor control command (see <a href="Preprocessing.html#Preprocessing">Preprocessing</a>).
<p><a name="index-line-separator_002c-i960-1119"></a><a name="index-statement-separator_002c-i960-1120"></a><a name="index-i960-line-separator-1121"></a>The ‘<samp><span class="samp">;</span></samp>’ character can be used to separate statements on the same
line.
<!-- Copyright 2002, 2003, 2005 -->
<!-- Free Software Foundation, Inc. -->
<!-- Contributed by David Mosberger-Tang <davidm@hpl.hp.com> -->
<!-- This is part of the GAS manual. -->
<!-- For copying conditions, see the file as.texinfo. -->
</body></html>
| {
"content_hash": "a6a8e6bf7c57e166f02db07b81460c68",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 271,
"avg_line_length": 45.6875,
"alnum_prop": 0.7137482900136799,
"repo_name": "trfiladelfo/tdk",
"id": "8a31d9baef964f4d396b49f0b39c1081b0910457",
"size": "2924",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "gcc-arm-none-eabi/share/doc/gcc-arm-none-eabi/html/as.html/i960_002dChars.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "614531"
},
{
"name": "Batchfile",
"bytes": "101839"
},
{
"name": "C",
"bytes": "12540389"
},
{
"name": "C++",
"bytes": "13332391"
},
{
"name": "CSS",
"bytes": "140569"
},
{
"name": "HTML",
"bytes": "23954553"
},
{
"name": "Logos",
"bytes": "8877"
},
{
"name": "Makefile",
"bytes": "129672"
},
{
"name": "Perl",
"bytes": "9844"
},
{
"name": "Python",
"bytes": "180880"
},
{
"name": "Scheme",
"bytes": "3970"
},
{
"name": "Shell",
"bytes": "10777"
},
{
"name": "Tcl",
"bytes": "128365"
},
{
"name": "XC",
"bytes": "8384"
},
{
"name": "XS",
"bytes": "8334"
},
{
"name": "XSLT",
"bytes": "221100"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_75) on Wed Jun 10 23:21:21 IST 2015 -->
<meta http-equiv="Content-Type" content="text/html" charset="utf-8">
<title>org.apache.solr.hadoop Class Hierarchy (Solr 5.2.1 API)</title>
<meta name="date" content="2015-06-10">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="org.apache.solr.hadoop Class Hierarchy (Solr 5.2.1 API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li>Class</li>
<li>Use</li>
<li class="navBarCell1Rev">Tree</li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li><a href="../../../../org/apache/solr/hadoop/dedup/package-tree.html">Next</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/solr/hadoop/package-tree.html" target="_top">Frames</a></li>
<li><a href="package-tree.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 class="title">Hierarchy For Package org.apache.solr.hadoop</h1>
<span class="strong">Package Hierarchies:</span>
<ul class="horizontal">
<li><a href="../../../../overview-tree.html">All Packages</a></li>
</ul>
</div>
<div class="contentContainer">
<h2 title="Class Hierarchy">Class Hierarchy</h2>
<ul>
<li type="circle">java.lang.<a href="http://download.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang"><span class="strong">Object</span></a>
<ul>
<li type="circle">org.apache.hadoop.conf.Configured (implements org.apache.hadoop.conf.Configurable)
<ul>
<li type="circle">org.apache.solr.hadoop.<a href="../../../../org/apache/solr/hadoop/MapReduceIndexerTool.html" title="class in org.apache.solr.hadoop"><span class="strong">MapReduceIndexerTool</span></a> (implements org.apache.hadoop.util.Tool)</li>
</ul>
</li>
<li type="circle">java.io.<a href="http://download.oracle.com/javase/7/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io"><span class="strong">InputStream</span></a> (implements java.io.<a href="http://download.oracle.com/javase/7/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</a>)
<ul>
<li type="circle">org.apache.solr.common.util.<a href="../../../../../solr-solrj/org/apache/solr/common/util/DataInputInputStream.html?is-external=true" title="class or interface in org.apache.solr.common.util"><span class="strong">DataInputInputStream</span></a> (implements java.io.<a href="http://download.oracle.com/javase/7/docs/api/java/io/DataInput.html?is-external=true" title="class or interface in java.io">DataInput</a>)
<ul>
<li type="circle">org.apache.solr.hadoop.<a href="../../../../org/apache/solr/hadoop/UnbufferedDataInputInputStream.html" title="class in org.apache.solr.hadoop"><span class="strong">UnbufferedDataInputInputStream</span></a></li>
</ul>
</li>
<li type="circle">org.apache.solr.hadoop.<a href="../../../../org/apache/solr/hadoop/DataInputInputStream.html" title="class in org.apache.solr.hadoop"><span class="strong">DataInputInputStream</span></a></li>
</ul>
</li>
<li type="circle">org.apache.hadoop.mapreduce.Mapper<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
<ul>
<li type="circle">org.apache.solr.hadoop.<a href="../../../../org/apache/solr/hadoop/LineRandomizerMapper.html" title="class in org.apache.solr.hadoop"><span class="strong">LineRandomizerMapper</span></a></li>
<li type="circle">org.apache.solr.hadoop.<a href="../../../../org/apache/solr/hadoop/SolrMapper.html" title="class in org.apache.solr.hadoop"><span class="strong">SolrMapper</span></a><KEYIN,VALUEIN></li>
<li type="circle">org.apache.solr.hadoop.<a href="../../../../org/apache/solr/hadoop/TreeMergeMapper.html" title="class in org.apache.solr.hadoop"><span class="strong">TreeMergeMapper</span></a></li>
</ul>
</li>
<li type="circle">org.apache.hadoop.mapreduce.OutputFormat<K,V>
<ul>
<li type="circle">org.apache.hadoop.mapreduce.lib.output.FileOutputFormat<K,V>
<ul>
<li type="circle">org.apache.solr.hadoop.<a href="../../../../org/apache/solr/hadoop/SolrOutputFormat.html" title="class in org.apache.solr.hadoop"><span class="strong">SolrOutputFormat</span></a><K,V></li>
<li type="circle">org.apache.solr.hadoop.<a href="../../../../org/apache/solr/hadoop/TreeMergeOutputFormat.html" title="class in org.apache.solr.hadoop"><span class="strong">TreeMergeOutputFormat</span></a></li>
</ul>
</li>
</ul>
</li>
<li type="circle">java.io.<a href="http://download.oracle.com/javase/7/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io"><span class="strong">OutputStream</span></a> (implements java.io.<a href="http://download.oracle.com/javase/7/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</a>, java.io.<a href="http://download.oracle.com/javase/7/docs/api/java/io/Flushable.html?is-external=true" title="class or interface in java.io">Flushable</a>)
<ul>
<li type="circle">org.apache.solr.hadoop.<a href="../../../../org/apache/solr/hadoop/DataOutputOutputStream.html" title="class in org.apache.solr.hadoop"><span class="strong">DataOutputOutputStream</span></a></li>
</ul>
</li>
<li type="circle">org.apache.hadoop.mapreduce.Partitioner<KEY,VALUE>
<ul>
<li type="circle">org.apache.solr.hadoop.<a href="../../../../org/apache/solr/hadoop/SolrCloudPartitioner.html" title="class in org.apache.solr.hadoop"><span class="strong">SolrCloudPartitioner</span></a> (implements org.apache.hadoop.conf.Configurable)</li>
</ul>
</li>
<li type="circle">org.apache.solr.hadoop.<a href="../../../../org/apache/solr/hadoop/PathArgumentType.html" title="class in org.apache.solr.hadoop"><span class="strong">PathArgumentType</span></a> (implements net.sourceforge.argparse4j.inf.ArgumentType<T>)</li>
<li type="circle">org.apache.solr.hadoop.<a href="../../../../org/apache/solr/hadoop/PathParts.html" title="class in org.apache.solr.hadoop"><span class="strong">PathParts</span></a></li>
<li type="circle">org.apache.hadoop.mapreduce.Reducer<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
<ul>
<li type="circle">org.apache.solr.hadoop.<a href="../../../../org/apache/solr/hadoop/LineRandomizerReducer.html" title="class in org.apache.solr.hadoop"><span class="strong">LineRandomizerReducer</span></a></li>
<li type="circle">org.apache.solr.hadoop.<a href="../../../../org/apache/solr/hadoop/SolrReducer.html" title="class in org.apache.solr.hadoop"><span class="strong">SolrReducer</span></a></li>
</ul>
</li>
<li type="circle">org.apache.solr.hadoop.<a href="../../../../org/apache/solr/hadoop/SolrInputDocumentWritable.html" title="class in org.apache.solr.hadoop"><span class="strong">SolrInputDocumentWritable</span></a> (implements org.apache.hadoop.io.Writable)</li>
<li type="circle">java.lang.<a href="http://download.oracle.com/javase/7/docs/api/java/lang/Thread.html?is-external=true" title="class or interface in java.lang"><span class="strong">Thread</span></a> (implements java.lang.<a href="http://download.oracle.com/javase/7/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a>)
<ul>
<li type="circle">org.apache.solr.hadoop.<a href="../../../../org/apache/solr/hadoop/HeartBeater.html" title="class in org.apache.solr.hadoop"><span class="strong">HeartBeater</span></a></li>
</ul>
</li>
<li type="circle">org.apache.solr.hadoop.<a href="../../../../org/apache/solr/hadoop/Utils.html" title="class in org.apache.solr.hadoop"><span class="strong">Utils</span></a></li>
</ul>
</li>
</ul>
<h2 title="Interface Hierarchy">Interface Hierarchy</h2>
<ul>
<li type="circle">org.apache.solr.hadoop.<a href="../../../../org/apache/solr/hadoop/HdfsFileFieldNames.html" title="interface in org.apache.solr.hadoop"><span class="strong">HdfsFileFieldNames</span></a></li>
</ul>
<h2 title="Enum Hierarchy">Enum Hierarchy</h2>
<ul>
<li type="circle">java.lang.<a href="http://download.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang"><span class="strong">Object</span></a>
<ul>
<li type="circle">java.lang.<a href="http://download.oracle.com/javase/7/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang"><span class="strong">Enum</span></a><E> (implements java.lang.<a href="http://download.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><T>, java.io.<a href="http://download.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a>)
<ul>
<li type="circle">org.apache.solr.hadoop.<a href="../../../../org/apache/solr/hadoop/SolrCounters.html" title="enum in org.apache.solr.hadoop"><span class="strong">SolrCounters</span></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li>Class</li>
<li>Use</li>
<li class="navBarCell1Rev">Tree</li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li><a href="../../../../org/apache/solr/hadoop/dedup/package-tree.html">Next</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/solr/hadoop/package-tree.html" target="_top">Frames</a></li>
<li><a href="package-tree.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>
<i>Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.</i>
<script src='../../../../prettify.js' type='text/javascript'></script>
<script type='text/javascript'>
(function(){
var oldonload = window.onload;
if (typeof oldonload != 'function') {
window.onload = prettyPrint;
} else {
window.onload = function() {
oldonload();
prettyPrint();
}
}
})();
</script>
</small></p>
</body>
</html>
| {
"content_hash": "9b7ff38f31a5fbf58b14c159b098917e",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 552,
"avg_line_length": 56.629629629629626,
"alnum_prop": 0.6742969260954872,
"repo_name": "freakimkaefig/melodicsimilarity-solr",
"id": "cd9d870bc3acb3fc88120c1133dff43b55ec82cd",
"size": "12232",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/solr-map-reduce/org/apache/solr/hadoop/package-tree.html",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "AMPL",
"bytes": "291"
},
{
"name": "Batchfile",
"bytes": "53286"
},
{
"name": "CSS",
"bytes": "218719"
},
{
"name": "HTML",
"bytes": "176275"
},
{
"name": "JavaScript",
"bytes": "1131599"
},
{
"name": "Shell",
"bytes": "84180"
},
{
"name": "XSLT",
"bytes": "24929"
}
],
"symlink_target": ""
} |
/*
* HomePage Messages
*
* This contains all the text for the HomePage component.
*/
import { defineMessages } from 'react-intl';
export default defineMessages({
title: {
id: 'components.Supper.title',
defaultMessage: 'Ærnæringsrik kraftaftens',
},
description: {
id: 'components.Supper.description',
defaultMessage: 'med søt avslutning',
},
priceDescription: {
id: 'components.Supper.priceDescription',
defaultMessage: '{price, number} kr',
},
order: {
id: 'components.Supper.order',
defaultMessage: 'Ærnæringsrik kraftaftens {guestCount, plural, one {for 1 gjest} other {for # gjester}} i {nightCount, plural, one {1 natt} other {# netter}}',
},
});
| {
"content_hash": "56c1bbd1cd7eca172b99366be82944a2",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 163,
"avg_line_length": 28.2,
"alnum_prop": 0.676595744680851,
"repo_name": "torvalde/mjolfjell-homepage",
"id": "365efa0d5d313a57900355ea984600c12acf4dce",
"size": "710",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/components/Supper/messages.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "24533"
},
{
"name": "JavaScript",
"bytes": "108893"
}
],
"symlink_target": ""
} |
using namespace std;
using namespace ZL::Util;
using namespace ZL::Thread;
bool g_bExitFlag = false;
void programExit(int arg) {
g_bExitFlag = true;
}
int main() {
signal(SIGINT, programExit);
Logger::Instance().add(std::make_shared<ConsoleChannel> ("stdout", LTrace));
Logger::Instance().setWriter(std::make_shared<AsyncLogWriter>());
Ticker timeTicker;
TraceL << "主线程id:" << this_thread::get_id();
DebugL << "开始异步操作"<< endl;
timeTicker.resetTime();
ThreadPool::Instance().async([](){
sleep(1);
DebugL << "异步操作:" << this_thread::get_id() << endl;
});
DebugL << "异步操作消耗时间:" << timeTicker.elapsedTime() << "ms" << endl;
InfoL << "开始同步操作"<< endl;
timeTicker.resetTime();
ThreadPool::Instance().sync([](){
sleep(1);
InfoL << "同步操作:" << this_thread::get_id()<< endl;
});
InfoL << "同步操作消耗时间:" << timeTicker.elapsedTime() << "ms" << endl;
while(!g_bExitFlag){
sleep(1);
}
ThreadPool::Instance().wait();
Logger::Destory();
return 0;
}
| {
"content_hash": "88232d57bb0a3f7aa3bf86a173640755",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 77,
"avg_line_length": 24.76923076923077,
"alnum_prop": 0.639751552795031,
"repo_name": "xsmart/opencvr",
"id": "8a9d1e4aca6a82c608763e185d6a99afa552b678",
"size": "1511",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "vecvr/src/ZLToolKit/tests/test_threadPool.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "22997"
},
{
"name": "C",
"bytes": "52278"
},
{
"name": "C++",
"bytes": "2433166"
},
{
"name": "CSS",
"bytes": "1156"
},
{
"name": "JavaScript",
"bytes": "13654"
},
{
"name": "Makefile",
"bytes": "3705541"
},
{
"name": "Objective-C",
"bytes": "1821"
},
{
"name": "Prolog",
"bytes": "2697"
},
{
"name": "Protocol Buffer",
"bytes": "5494"
},
{
"name": "Python",
"bytes": "18441"
},
{
"name": "QMake",
"bytes": "12789"
},
{
"name": "Shell",
"bytes": "4704"
}
],
"symlink_target": ""
} |
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>reveal.js - The HTML Presentation Framework</title>
<meta name="description" content="A framework for easily creating beautiful presentations using HTML">
<meta name="author" content="Hakim El Hattab">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<link rel="stylesheet" href="js/vendor/reveal/css/reveal.css">
<link rel="stylesheet" href="js/vendor/reveal/css/theme/black.css" id="theme">
<!-- Code syntax highlighting -->
<link rel="stylesheet" href="js/vendor/reveal/lib/css/zenburn.css">
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
<style>
.title {
display:flex;
justify-content: flex-end;
align-items: center;
float:right;
padding:.2em !important;
}
.title img{
height: 1.0em;
margin-right: .3em;
}
.title h3 {
margin-bottom: 0;
font-size: .6em !important;
}
[class^=grid] {
display:flex;
align-items: center;
justify-content: space-between;
width: 86%;
}
.grid-2 [class^=col-] {
width:48%;
}
.grid-2 .col-a{
margin-right:1.5%;
}
.no-deco-img {
border: 0 solid #000 !important;
background: rgba(0,0,0,0) !important;
}
.subtitle {
font-family: monospace !important;
font-size: .9em !important;
margin-top: 40px !important;
text-align: center;
text-shadow: 2px 2px 0 #000 !important;
width: 100%;
font-weight: normal !important;
padding: 1em .5em !important;
background: rgba(200, 200, 200, .2);
}
</style>
</head>
<body>
<div class="reveal">
<div class="title">
<img src="./svg/react.svg" alt="">
<h3>React</h3>
</div>
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section>
<h2>React</h2>
</section>
<section>
<h2>What is React?</h2>
<ul>
<li class="fragment">Open Source JavaScript Library,</li>
<li class="fragment">from the Facebook dev team,</li>
<li class="fragment">for building dynamic user interfaces.</li>
</ul>
</section>
<section>
<h2>There's more than just React...</h2>
<p class="subtitle">Let's take a moment to talk about frameworks.</p>
</section>
<section>
<h2>The JavaScript Framework landscape moves fast...</h2>
<img src="./presentation-img/2fast.jpg" alt="">
</section>
<section>
<h2>Frameworks</h2>
<ul>
<li class="fragment">Design (style and layout)</li>
<li class="fragment">Data Binding (Views)</li>
<li class="fragment">Full MVC App</li>
</ul>
</section>
<section>
<h2>Design Frameworks</h2>
<ul>
<li class="fragment"><a href="http://getbootstrap.com/">Bootstrap</a></li>
<li class="fragment"><a href="http://foundation.zurb.com/">Foundation</a></li>
<li class="fragment">
<a href="https://www.google.com/design/spec/material-design/introduction.html#">Material Design:</a>
<ul>
<li><a href="http://www.material-ui.com/#/">Material UI</a></li>
<li><a href="http://materializecss.com/">Materialize</a></li>
<li><a href="https://www.muicss.com/">MUI</a></li>
</ul>
</li>
</ul>
</section>
<section>
<h2>Data Binding</h2>
<ul>
<li class="fragment"><a href="http://backbonejs.org/">Backbone</a></li>
<li class="fragment"><a href="http://knockoutjs.com/">Knockout</a></li>
<li class="fragment"><a href="https://vuejs.org/">Vuejs</a></li>
<li class="fragment"><a href="https://facebook.github.io/react/index.html">React</a></li>
</ul>
</section>
<section>
<h2>Full Javascript App</h2>
<ul>
<li class="fragment"><a href="https://angularjs.org/">Angular</a> (with Polymer*)</li>
<li class="fragment"><a href="http://emberjs.com/">Ember</a></li>
<li class="fragment"><a href="https://www.meteor.com/">Meteor</a></li>
<li class="fragment">React and <a href="https://facebook.github.io/flux/">Flux</a></li>
</ul>
</section>
<section>
<h2>Need More?</h2>
<p><a href="http://todomvc.com/">ToDo MVC</a> - "...the same Todo application implemented using MV* concepts in most of the popular JavaScript MV* frameworks of today."</p>
</section>
<section>
<h2>Back to React</h2>
<p>React is our example because:</p>
<div class="grid-2 fragment">
<div class="col-a">
<img src="./presentation-img/ChuckNorris.jpg" alt="">
</div>
<div class="col-b">
<ul>
<!--<li >the cool kids are using it,</li>-->
<li class="">requires a build step,</li>
<li class="">and has a unique tech perspective.</li>
</ul>
</div>
</div>
</section>
<section>
<h2>What makes React different?</h2>
<ul>
<li class="fragment">"React's one-way data flow (also called one-way binding)",</li>
<li class="fragment">"React abstracts away the DOM from you",</li>
<li class="fragment">and "...<a href="https://facebook.github.io/react/docs/reconciliation.html" target="_blank">key design decision</a href=""> is to make the API seem like it re-renders the whole app on every update."</li>
</ul>
</section>
<section>
<h2>Demo</h2>
<p>Inspecting the dom vs the html markup</p>
</section>
<section>
<h2>Demo</h2>
<p>look at the <code>.jsx</code> vs. the actual compiled <code>.js</code>.</p>
</section>
<section>
<h2>End Section.</h2>
</section>
</div>
</div>
<script src="js/vendor/reveal/lib/js/head.min.js"></script>
<script src="js/vendor/reveal/js/reveal.js"></script>
<script>
// Full list of configuration options available at:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
transition: 'slide', // none/fade/slide/convex/concave/zoom
// Optional reveal.js plugins
dependencies: [
{ src: 'js/vendor/reveal/lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'js/vendor/reveal/plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'js/vendor/reveal/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'js/vendor/reveal/plugin/highlight/highlight.js', async: true, condition: function() { return !!document.querySelector( 'pre code' ); }, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'js/vendor/reveal/plugin/zoom-js/zoom.js', async: true },
{ src: 'js/vendor/reveal/plugin/notes/notes.js', async: true }
]
});
</script>
</body>
</html>
| {
"content_hash": "2f9ddb7e4a23cac67dd2c5b85738953e",
"timestamp": "",
"source": "github",
"line_count": 229,
"max_line_length": 230,
"avg_line_length": 31.358078602620086,
"alnum_prop": 0.6014482662581813,
"repo_name": "aljachimiak/front-end-cli",
"id": "c61ceca2d0bb09f10bfd1dbe4423e0d8782333a6",
"size": "7181",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "front-end/react-presentation.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "1342"
},
{
"name": "CSS",
"bytes": "105826"
},
{
"name": "HTML",
"bytes": "78044"
},
{
"name": "JavaScript",
"bytes": "689536"
},
{
"name": "Shell",
"bytes": "4244"
}
],
"symlink_target": ""
} |
#ifndef BOOST_NETWORK_UTILS_THREAD_POOL_HPP_20101020
#define BOOST_NETWORK_UTILS_THREAD_POOL_HPP_20101020
// Copyright 2010 Dean Michael Berris.
// 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 <cstddef>
#include <memory>
#include <functional>
#include <asio/io_service.hpp>
#include <boost/function.hpp>
#include <boost/network/tags.hpp>
#include <boost/scope_exit.hpp>
#include <boost/network/utils/thread_group.hpp>
namespace boost {
namespace network {
namespace utils {
typedef std::shared_ptr<asio::io_service> io_service_ptr;
typedef std::shared_ptr<utils::thread_group> worker_threads_ptr;
typedef std::shared_ptr<asio::io_service::work> sentinel_ptr;
template <class Tag>
struct basic_thread_pool {
basic_thread_pool(basic_thread_pool const &) = delete;
basic_thread_pool &operator=(basic_thread_pool) = delete;
basic_thread_pool(basic_thread_pool&&) noexcept = default;
basic_thread_pool &operator=(basic_thread_pool&&) = default;
basic_thread_pool() : basic_thread_pool(1) {}
explicit basic_thread_pool(std::size_t threads,
io_service_ptr io_service = io_service_ptr(),
worker_threads_ptr worker_threads = worker_threads_ptr())
: threads_(threads),
io_service_(std::move(io_service)),
worker_threads_(std::move(worker_threads)),
sentinel_() {
bool commit = false;
BOOST_SCOPE_EXIT_TPL(
(&commit)(&io_service_)(&worker_threads_)(&sentinel_)) {
if (!commit) {
sentinel_.reset();
io_service_.reset();
if (worker_threads_.get()) {
// worker_threads_->interrupt_all();
worker_threads_->join_all();
}
worker_threads_.reset();
}
}
BOOST_SCOPE_EXIT_END
if (!io_service_.get()) {
io_service_.reset(new asio::io_service);
}
if (!worker_threads_.get()) {
worker_threads_.reset(new utils::thread_group);
}
if (!sentinel_.get()) {
sentinel_.reset(new asio::io_service::work(*io_service_));
}
for (std::size_t counter = 0; counter < threads_; ++counter) {
worker_threads_->create_thread([=] () { io_service_->run(); });
}
commit = true;
}
std::size_t thread_count() const { return threads_; }
void post(std::function<void()> f) { io_service_->post(f); }
~basic_thread_pool() throw() {
sentinel_.reset();
try {
worker_threads_->join_all();
}
catch (...) {
BOOST_ASSERT(false &&
"A handler was not supposed to throw, but one did.");
}
}
void swap(basic_thread_pool &other) {
using std::swap;
swap(other.threads_, threads_);
swap(other.io_service_, io_service_);
swap(other.worker_threads_, worker_threads_);
swap(other.sentinel_, sentinel_);
}
protected:
std::size_t threads_;
io_service_ptr io_service_;
worker_threads_ptr worker_threads_;
sentinel_ptr sentinel_;
};
template <class T>
void swap(basic_thread_pool<T> &a, basic_thread_pool<T> &b) {
a.swap(b);
}
typedef basic_thread_pool<tags::default_> thread_pool;
} // namespace utils
} // namespace network
} // namespace boost
#endif /* BOOST_NETWORK_UTILS_THREAD_POOL_HPP_20101020 */
| {
"content_hash": "6df11aa12218f0b4d4a29badffbe867b",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 77,
"avg_line_length": 28.050847457627118,
"alnum_prop": 0.6350453172205438,
"repo_name": "medsouz/AnvilClient",
"id": "bea9ab5ad2d505d3cdcbba05caf0c87af44e1fa4",
"size": "3310",
"binary": false,
"copies": "2",
"ref": "refs/heads/development",
"path": "AnvilEldorado/Depends/Include/boost/network/utils/thread_pool.hpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "268"
},
{
"name": "C",
"bytes": "12892"
},
{
"name": "C++",
"bytes": "464467"
}
],
"symlink_target": ""
} |
using content::BrowserThread;
using content::DownloadItem;
namespace {
const base::FilePath::CharType kCrdownloadSuffix[] =
FILE_PATH_LITERAL(".crdownload");
// Condenses the results from HistoryService::GetVisibleVisitCountToHost() to a
// single bool. A host is considered visited before if prior visible visits were
// found in history and the first such visit was earlier than the most recent
// midnight.
void VisitCountsToVisitedBefore(
const base::Callback<void(bool)>& callback,
bool found_visits,
int count,
base::Time first_visit) {
callback.Run(
found_visits && count > 0 &&
(first_visit.LocalMidnight() < base::Time::Now().LocalMidnight()));
}
#if defined(OS_WIN)
// Keeps track of whether Adobe Reader is up to date.
bool g_is_adobe_reader_up_to_date_ = false;
#endif
} // namespace
DownloadTargetInfo::DownloadTargetInfo()
: target_disposition(DownloadItem::TARGET_DISPOSITION_OVERWRITE),
danger_type(content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS),
danger_level(download_util::NOT_DANGEROUS),
is_filetype_handled_safely(false) {}
DownloadTargetInfo::~DownloadTargetInfo() {}
DownloadTargetDeterminerDelegate::~DownloadTargetDeterminerDelegate() {
}
DownloadTargetDeterminer::DownloadTargetDeterminer(
DownloadItem* download,
const base::FilePath& initial_virtual_path,
DownloadPrefs* download_prefs,
DownloadTargetDeterminerDelegate* delegate,
const CompletionCallback& callback)
: next_state_(STATE_GENERATE_TARGET_PATH),
should_prompt_(false),
should_notify_extensions_(false),
create_target_directory_(false),
conflict_action_(DownloadPathReservationTracker::OVERWRITE),
danger_type_(download->GetDangerType()),
danger_level_(download_util::NOT_DANGEROUS),
virtual_path_(initial_virtual_path),
is_filetype_handled_safely_(false),
download_(download),
is_resumption_(download_->GetLastReason() !=
content::DOWNLOAD_INTERRUPT_REASON_NONE &&
!initial_virtual_path.empty()),
download_prefs_(download_prefs),
delegate_(delegate),
completion_callback_(callback),
weak_ptr_factory_(this) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(download_);
DCHECK(delegate);
download_->AddObserver(this);
DoLoop();
}
DownloadTargetDeterminer::~DownloadTargetDeterminer() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(download_);
DCHECK(completion_callback_.is_null());
download_->RemoveObserver(this);
}
void DownloadTargetDeterminer::DoLoop() {
Result result = CONTINUE;
do {
State current_state = next_state_;
next_state_ = STATE_NONE;
switch (current_state) {
case STATE_GENERATE_TARGET_PATH:
result = DoGenerateTargetPath();
break;
case STATE_NOTIFY_EXTENSIONS:
result = DoNotifyExtensions();
break;
case STATE_RESERVE_VIRTUAL_PATH:
result = DoReserveVirtualPath();
break;
case STATE_PROMPT_USER_FOR_DOWNLOAD_PATH:
result = DoPromptUserForDownloadPath();
break;
case STATE_DETERMINE_LOCAL_PATH:
result = DoDetermineLocalPath();
break;
case STATE_DETERMINE_MIME_TYPE:
result = DoDetermineMimeType();
break;
case STATE_DETERMINE_IF_HANDLED_SAFELY_BY_BROWSER:
result = DoDetermineIfHandledSafely();
break;
case STATE_DETERMINE_IF_ADOBE_READER_UP_TO_DATE:
result = DoDetermineIfAdobeReaderUpToDate();
break;
case STATE_CHECK_DOWNLOAD_URL:
result = DoCheckDownloadUrl();
break;
case STATE_DETERMINE_INTERMEDIATE_PATH:
result = DoDetermineIntermediatePath();
break;
case STATE_CHECK_VISITED_REFERRER_BEFORE:
result = DoCheckVisitedReferrerBefore();
break;
case STATE_NONE:
NOTREACHED();
return;
}
} while (result == CONTINUE);
// Note that if a callback completes synchronously, the handler will still
// return QUIT_DOLOOP. In this case, an inner DoLoop() may complete the target
// determination and delete |this|.
if (result == COMPLETE)
ScheduleCallbackAndDeleteSelf();
}
DownloadTargetDeterminer::Result
DownloadTargetDeterminer::DoGenerateTargetPath() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(local_path_.empty());
DCHECK(!should_prompt_);
DCHECK(!should_notify_extensions_);
DCHECK_EQ(DownloadPathReservationTracker::OVERWRITE, conflict_action_);
bool is_forced_path = !download_->GetForcedFilePath().empty();
next_state_ = STATE_NOTIFY_EXTENSIONS;
if (!virtual_path_.empty() && HasPromptedForPath() && !is_forced_path) {
// The download is being resumed and the user has already been prompted for
// a path. Assume that it's okay to overwrite the file if there's a conflict
// and reuse the selection.
should_prompt_ = ShouldPromptForDownload(virtual_path_);
} else if (!is_forced_path) {
// If we don't have a forced path, we should construct a path for the
// download. Forced paths are only specified for programmatic downloads
// (WebStore, Drag&Drop). Treat the path as a virtual path. We will
// eventually determine whether this is a local path and if not, figure out
// a local path.
std::string default_filename(
l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME));
base::FilePath generated_filename = net::GenerateFileName(
download_->GetURL(),
download_->GetContentDisposition(),
GetProfile()->GetPrefs()->GetString(prefs::kDefaultCharset),
download_->GetSuggestedFilename(),
download_->GetMimeType(),
default_filename);
should_prompt_ = ShouldPromptForDownload(generated_filename);
base::FilePath target_directory;
if (should_prompt_) {
DCHECK(!download_prefs_->IsDownloadPathManaged());
// If the user is going to be prompted and the user has been prompted
// before, then always prefer the last directory that the user selected.
target_directory = download_prefs_->SaveFilePath();
} else {
target_directory = download_prefs_->DownloadPath();
}
virtual_path_ = target_directory.Append(generated_filename);
#if defined(OS_ANDROID)
conflict_action_ = DownloadPathReservationTracker::PROMPT;
#else
conflict_action_ = DownloadPathReservationTracker::UNIQUIFY;
#endif
should_notify_extensions_ = true;
} else {
virtual_path_ = download_->GetForcedFilePath();
// If this is a resumed download which was previously interrupted due to an
// issue with the forced path, the user is still not prompted. If the path
// supplied to a programmatic download is invalid, then the caller needs to
// intervene.
}
DCHECK(virtual_path_.IsAbsolute());
DVLOG(20) << "Generated virtual path: " << virtual_path_.AsUTF8Unsafe();
// If the download is DOA, don't bother going any further. This would be the
// case for a download that failed to initialize (e.g. the initial temporary
// file couldn't be created because both the downloads directory and the
// temporary directory are unwriteable).
//
// A virtual path is determined for DOA downloads for display purposes. This
// is why this check is performed here instead of at the start.
if (download_->GetState() != DownloadItem::IN_PROGRESS)
return COMPLETE;
return CONTINUE;
}
DownloadTargetDeterminer::Result
DownloadTargetDeterminer::DoNotifyExtensions() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!virtual_path_.empty());
next_state_ = STATE_RESERVE_VIRTUAL_PATH;
if (!should_notify_extensions_)
return CONTINUE;
delegate_->NotifyExtensions(download_, virtual_path_,
base::Bind(&DownloadTargetDeterminer::NotifyExtensionsDone,
weak_ptr_factory_.GetWeakPtr()));
return QUIT_DOLOOP;
}
void DownloadTargetDeterminer::NotifyExtensionsDone(
const base::FilePath& suggested_path,
DownloadPathReservationTracker::FilenameConflictAction conflict_action) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DVLOG(20) << "Extension suggested path: " << suggested_path.AsUTF8Unsafe();
// Extensions should not call back here more than once.
DCHECK_EQ(STATE_RESERVE_VIRTUAL_PATH, next_state_);
if (!suggested_path.empty()) {
// If an extension overrides the filename, then the target directory will be
// forced to download_prefs_->DownloadPath() since extensions cannot place
// downloaded files anywhere except there. This prevents subdirectories from
// accumulating: if an extension is allowed to say that a file should go in
// last_download_path/music/foo.mp3, then last_download_path will accumulate
// the subdirectory /music/ so that the next download may end up in
// Downloads/music/music/music/bar.mp3.
base::FilePath new_path(download_prefs_->DownloadPath().Append(
suggested_path).NormalizePathSeparators());
// Do not pass a mime type to GenerateSafeFileName so that it does not force
// the filename to have an extension if the (Chrome) extension does not
// suggest it.
net::GenerateSafeFileName(std::string(), false, &new_path);
virtual_path_ = new_path;
create_target_directory_ = true;
}
// An extension may set conflictAction without setting filename.
if (conflict_action != DownloadPathReservationTracker::UNIQUIFY)
conflict_action_ = conflict_action;
DoLoop();
}
DownloadTargetDeterminer::Result
DownloadTargetDeterminer::DoReserveVirtualPath() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!virtual_path_.empty());
next_state_ = STATE_PROMPT_USER_FOR_DOWNLOAD_PATH;
delegate_->ReserveVirtualPath(
download_, virtual_path_, create_target_directory_, conflict_action_,
base::Bind(&DownloadTargetDeterminer::ReserveVirtualPathDone,
weak_ptr_factory_.GetWeakPtr()));
return QUIT_DOLOOP;
}
void DownloadTargetDeterminer::ReserveVirtualPathDone(
const base::FilePath& path, bool verified) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DVLOG(20) << "Reserved path: " << path.AsUTF8Unsafe()
<< " Verified:" << verified;
DCHECK_EQ(STATE_PROMPT_USER_FOR_DOWNLOAD_PATH, next_state_);
should_prompt_ = (should_prompt_ || !verified);
virtual_path_ = path;
DoLoop();
}
DownloadTargetDeterminer::Result
DownloadTargetDeterminer::DoPromptUserForDownloadPath() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!virtual_path_.empty());
next_state_ = STATE_DETERMINE_LOCAL_PATH;
if (should_prompt_) {
delegate_->PromptUserForDownloadPath(
download_,
virtual_path_,
base::Bind(&DownloadTargetDeterminer::PromptUserForDownloadPathDone,
weak_ptr_factory_.GetWeakPtr()));
return QUIT_DOLOOP;
}
return CONTINUE;
}
void DownloadTargetDeterminer::PromptUserForDownloadPathDone(
const base::FilePath& virtual_path) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DVLOG(20) << "User selected path:" << virtual_path.AsUTF8Unsafe();
if (virtual_path.empty()) {
CancelOnFailureAndDeleteSelf();
return;
}
DCHECK_EQ(STATE_DETERMINE_LOCAL_PATH, next_state_);
virtual_path_ = virtual_path;
download_prefs_->SetSaveFilePath(virtual_path_.DirName());
DoLoop();
}
DownloadTargetDeterminer::Result
DownloadTargetDeterminer::DoDetermineLocalPath() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!virtual_path_.empty());
DCHECK(local_path_.empty());
next_state_ = STATE_DETERMINE_MIME_TYPE;
delegate_->DetermineLocalPath(
download_,
virtual_path_,
base::Bind(&DownloadTargetDeterminer::DetermineLocalPathDone,
weak_ptr_factory_.GetWeakPtr()));
return QUIT_DOLOOP;
}
void DownloadTargetDeterminer::DetermineLocalPathDone(
const base::FilePath& local_path) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DVLOG(20) << "Local path: " << local_path.AsUTF8Unsafe();
if (local_path.empty()) {
// Path subsitution failed.
CancelOnFailureAndDeleteSelf();
return;
}
DCHECK_EQ(STATE_DETERMINE_MIME_TYPE, next_state_);
local_path_ = local_path;
DoLoop();
}
DownloadTargetDeterminer::Result
DownloadTargetDeterminer::DoDetermineMimeType() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!virtual_path_.empty());
DCHECK(!local_path_.empty());
DCHECK(mime_type_.empty());
next_state_ = STATE_DETERMINE_IF_HANDLED_SAFELY_BY_BROWSER;
if (virtual_path_ == local_path_) {
delegate_->GetFileMimeType(
local_path_,
base::Bind(&DownloadTargetDeterminer::DetermineMimeTypeDone,
weak_ptr_factory_.GetWeakPtr()));
return QUIT_DOLOOP;
}
return CONTINUE;
}
void DownloadTargetDeterminer::DetermineMimeTypeDone(
const std::string& mime_type) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DVLOG(20) << "MIME type: " << mime_type;
DCHECK_EQ(STATE_DETERMINE_IF_HANDLED_SAFELY_BY_BROWSER, next_state_);
mime_type_ = mime_type;
DoLoop();
}
#if defined(ENABLE_PLUGINS)
// The code below is used by DoDetermineIfHandledSafely to determine if the
// file type is handled by a sandboxed plugin.
namespace {
void InvokeClosureAfterGetPluginCallback(
const base::Closure& closure,
const std::vector<content::WebPluginInfo>& unused) {
closure.Run();
}
enum ActionOnStalePluginList {
RETRY_IF_STALE_PLUGIN_LIST,
IGNORE_IF_STALE_PLUGIN_LIST
};
void IsHandledBySafePlugin(content::ResourceContext* resource_context,
const GURL& url,
const std::string& mime_type,
ActionOnStalePluginList stale_plugin_action,
const base::Callback<void(bool)>& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(!mime_type.empty());
using content::WebPluginInfo;
std::string actual_mime_type;
bool is_stale = false;
WebPluginInfo plugin_info;
content::PluginService* plugin_service =
content::PluginService::GetInstance();
bool plugin_found = plugin_service->GetPluginInfo(-1, -1, resource_context,
url, GURL(), mime_type,
false, &is_stale,
&plugin_info,
&actual_mime_type);
if (is_stale && stale_plugin_action == RETRY_IF_STALE_PLUGIN_LIST) {
// The GetPlugins call causes the plugin list to be refreshed. Once that's
// done we can retry the GetPluginInfo call. We break out of this cycle
// after a single retry in order to avoid retrying indefinitely.
plugin_service->GetPlugins(
base::Bind(&InvokeClosureAfterGetPluginCallback,
base::Bind(&IsHandledBySafePlugin,
resource_context,
url,
mime_type,
IGNORE_IF_STALE_PLUGIN_LIST,
callback)));
return;
}
// In practice, we assume that retrying once is enough.
DCHECK(!is_stale);
bool is_handled_safely =
plugin_found &&
(plugin_info.type == WebPluginInfo::PLUGIN_TYPE_PEPPER_IN_PROCESS ||
plugin_info.type == WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS ||
plugin_info.type == WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN);
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE, base::Bind(callback, is_handled_safely));
}
} // namespace
#endif // defined(ENABLE_PLUGINS)
DownloadTargetDeterminer::Result
DownloadTargetDeterminer::DoDetermineIfHandledSafely() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!virtual_path_.empty());
DCHECK(!local_path_.empty());
DCHECK(!is_filetype_handled_safely_);
next_state_ = STATE_DETERMINE_IF_ADOBE_READER_UP_TO_DATE;
if (mime_type_.empty())
return CONTINUE;
if (mime_util::IsSupportedMimeType(mime_type_)) {
is_filetype_handled_safely_ = true;
return CONTINUE;
}
#if defined(ENABLE_PLUGINS)
BrowserThread::PostTask(
BrowserThread::IO,
FROM_HERE,
base::Bind(
&IsHandledBySafePlugin,
GetProfile()->GetResourceContext(),
net::FilePathToFileURL(local_path_),
mime_type_,
RETRY_IF_STALE_PLUGIN_LIST,
base::Bind(&DownloadTargetDeterminer::DetermineIfHandledSafelyDone,
weak_ptr_factory_.GetWeakPtr())));
return QUIT_DOLOOP;
#else
return CONTINUE;
#endif
}
#if defined(ENABLE_PLUGINS)
void DownloadTargetDeterminer::DetermineIfHandledSafelyDone(
bool is_handled_safely) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DVLOG(20) << "Is file type handled safely: " << is_filetype_handled_safely_;
DCHECK_EQ(STATE_DETERMINE_IF_ADOBE_READER_UP_TO_DATE, next_state_);
is_filetype_handled_safely_ = is_handled_safely;
DoLoop();
}
#endif
DownloadTargetDeterminer::Result
DownloadTargetDeterminer::DoDetermineIfAdobeReaderUpToDate() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
next_state_ = STATE_CHECK_DOWNLOAD_URL;
#if defined(OS_WIN)
if (!local_path_.MatchesExtension(FILE_PATH_LITERAL(".pdf")))
return CONTINUE;
if (!IsAdobeReaderDefaultPDFViewer()) {
g_is_adobe_reader_up_to_date_ = false;
return CONTINUE;
}
base::PostTaskAndReplyWithResult(
BrowserThread::GetBlockingPool(),
FROM_HERE,
base::Bind(&::IsAdobeReaderUpToDate),
base::Bind(&DownloadTargetDeterminer::DetermineIfAdobeReaderUpToDateDone,
weak_ptr_factory_.GetWeakPtr()));
return QUIT_DOLOOP;
#else
return CONTINUE;
#endif
}
#if defined(OS_WIN)
void DownloadTargetDeterminer::DetermineIfAdobeReaderUpToDateDone(
bool adobe_reader_up_to_date) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DVLOG(20) << "Is Adobe Reader Up To Date: " << adobe_reader_up_to_date;
DCHECK_EQ(STATE_CHECK_DOWNLOAD_URL, next_state_);
g_is_adobe_reader_up_to_date_ = adobe_reader_up_to_date;
DoLoop();
}
#endif
DownloadTargetDeterminer::Result
DownloadTargetDeterminer::DoCheckDownloadUrl() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!virtual_path_.empty());
next_state_ = STATE_CHECK_VISITED_REFERRER_BEFORE;
delegate_->CheckDownloadUrl(
download_,
virtual_path_,
base::Bind(&DownloadTargetDeterminer::CheckDownloadUrlDone,
weak_ptr_factory_.GetWeakPtr()));
return QUIT_DOLOOP;
}
void DownloadTargetDeterminer::CheckDownloadUrlDone(
content::DownloadDangerType danger_type) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DVLOG(20) << "URL Check Result:" << danger_type;
DCHECK_EQ(STATE_CHECK_VISITED_REFERRER_BEFORE, next_state_);
danger_type_ = danger_type;
DoLoop();
}
DownloadTargetDeterminer::Result
DownloadTargetDeterminer::DoCheckVisitedReferrerBefore() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
next_state_ = STATE_DETERMINE_INTERMEDIATE_PATH;
// Checking if there are prior visits to the referrer is only necessary if the
// danger level of the download depends on the file type.
if (danger_type_ != content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS &&
danger_type_ != content::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT)
return CONTINUE;
// First determine the danger level assuming that the user doesn't have any
// prior visits to the referrer recoreded in history. The resulting danger
// level would be ALLOW_ON_USER_GESTURE if the level depends on the visit
// history. In the latter case, we can query the history DB to determine if
// there were prior reqeusts and determine the danger level again once the
// result is available.
danger_level_ = GetDangerLevel(NO_VISITS_TO_REFERRER);
if (danger_level_ == download_util::NOT_DANGEROUS)
return CONTINUE;
if (danger_level_ == download_util::ALLOW_ON_USER_GESTURE) {
// HistoryServiceFactory redirects incognito profiles to on-record profiles.
// There's no history for on-record profiles in unit_tests.
history::HistoryService* history_service =
HistoryServiceFactory::GetForProfile(
GetProfile(), ServiceAccessType::EXPLICIT_ACCESS);
if (history_service && download_->GetReferrerUrl().is_valid()) {
history_service->GetVisibleVisitCountToHost(
download_->GetReferrerUrl(),
base::Bind(
&VisitCountsToVisitedBefore,
base::Bind(
&DownloadTargetDeterminer::CheckVisitedReferrerBeforeDone,
weak_ptr_factory_.GetWeakPtr())),
&history_tracker_);
return QUIT_DOLOOP;
}
}
// If the danger level doesn't depend on having visited the refererrer URL or
// if original profile doesn't have a HistoryService or the referrer url is
// invalid, then assume the referrer has not been visited before.
if (danger_type_ == content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS)
danger_type_ = content::DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE;
return CONTINUE;
}
void DownloadTargetDeterminer::CheckVisitedReferrerBeforeDone(
bool visited_referrer_before) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(STATE_DETERMINE_INTERMEDIATE_PATH, next_state_);
danger_level_ = GetDangerLevel(
visited_referrer_before ? VISITED_REFERRER : NO_VISITS_TO_REFERRER);
if (danger_level_ != download_util::NOT_DANGEROUS &&
danger_type_ == content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS)
danger_type_ = content::DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE;
DoLoop();
}
DownloadTargetDeterminer::Result
DownloadTargetDeterminer::DoDetermineIntermediatePath() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!virtual_path_.empty());
DCHECK(!local_path_.empty());
DCHECK(intermediate_path_.empty());
DCHECK(!virtual_path_.MatchesExtension(kCrdownloadSuffix));
DCHECK(!local_path_.MatchesExtension(kCrdownloadSuffix));
next_state_ = STATE_NONE;
// Note that the intermediate filename is always uniquified (i.e. if a file by
// the same name exists, it is never overwritten). Therefore the code below
// does not attempt to find a name that doesn't conflict with an existing
// file.
// If the actual target of the download is a virtual path, then the local path
// is considered to point to a temporary path. A separate intermediate path is
// unnecessary since the local path already serves that purpose.
if (virtual_path_.BaseName() != local_path_.BaseName()) {
intermediate_path_ = local_path_;
return COMPLETE;
}
// If the download has a forced path and is safe, then just use the
// target path. In practice the temporary download file that was created prior
// to download filename determination is already named
// download_->GetForcedFilePath().
if (danger_type_ == content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS &&
!download_->GetForcedFilePath().empty()) {
DCHECK_EQ(download_->GetForcedFilePath().value(), local_path_.value());
intermediate_path_ = local_path_;
return COMPLETE;
}
// Other safe downloads get a .crdownload suffix for their intermediate name.
if (danger_type_ == content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS) {
intermediate_path_ = GetCrDownloadPath(local_path_);
return COMPLETE;
}
// If this is a resumed download, then re-use the existing intermediate path
// if one is available. A resumed download shouldn't cause a non-dangerous
// download to be considered dangerous upon resumption. Therefore the
// intermediate file should already be in the correct form.
if (is_resumption_ && !download_->GetFullPath().empty() &&
local_path_.DirName() == download_->GetFullPath().DirName()) {
DCHECK_NE(content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
download_->GetDangerType());
DCHECK_EQ(kCrdownloadSuffix, download_->GetFullPath().Extension());
intermediate_path_ = download_->GetFullPath();
return COMPLETE;
}
// Dangerous downloads receive a random intermediate name that looks like:
// 'Unconfirmed <random>.crdownload'.
const base::FilePath::CharType kUnconfirmedFormatSuffix[] =
FILE_PATH_LITERAL(" %d.crdownload");
// Range of the <random> uniquifier.
const int kUnconfirmedUniquifierRange = 1000000;
#if defined(OS_WIN)
base::string16 unconfirmed_format =
l10n_util::GetStringUTF16(IDS_DOWNLOAD_UNCONFIRMED_PREFIX);
#else
std::string unconfirmed_format =
l10n_util::GetStringUTF8(IDS_DOWNLOAD_UNCONFIRMED_PREFIX);
#endif
unconfirmed_format.append(kUnconfirmedFormatSuffix);
base::FilePath::StringType file_name = base::StringPrintf(
unconfirmed_format.c_str(),
base::RandInt(0, kUnconfirmedUniquifierRange));
intermediate_path_ = local_path_.DirName().Append(file_name);
return COMPLETE;
}
void DownloadTargetDeterminer::ScheduleCallbackAndDeleteSelf() {
DCHECK(download_);
DVLOG(20) << "Scheduling callback. Virtual:" << virtual_path_.AsUTF8Unsafe()
<< " Local:" << local_path_.AsUTF8Unsafe()
<< " Intermediate:" << intermediate_path_.AsUTF8Unsafe()
<< " Should prompt:" << should_prompt_
<< " Danger type:" << danger_type_
<< " Danger level:" << danger_level_;
scoped_ptr<DownloadTargetInfo> target_info(new DownloadTargetInfo);
target_info->target_path = local_path_;
target_info->target_disposition =
(HasPromptedForPath() || should_prompt_
? DownloadItem::TARGET_DISPOSITION_PROMPT
: DownloadItem::TARGET_DISPOSITION_OVERWRITE);
target_info->danger_type = danger_type_;
target_info->danger_level = danger_level_;
target_info->intermediate_path = intermediate_path_;
target_info->mime_type = mime_type_;
target_info->is_filetype_handled_safely = is_filetype_handled_safely_;
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(completion_callback_, base::Passed(&target_info)));
completion_callback_.Reset();
delete this;
}
void DownloadTargetDeterminer::CancelOnFailureAndDeleteSelf() {
// Path substitution failed.
virtual_path_.clear();
local_path_.clear();
intermediate_path_.clear();
ScheduleCallbackAndDeleteSelf();
}
Profile* DownloadTargetDeterminer::GetProfile() const {
DCHECK(download_->GetBrowserContext());
return Profile::FromBrowserContext(download_->GetBrowserContext());
}
bool DownloadTargetDeterminer::ShouldPromptForDownload(
const base::FilePath& filename) const {
if (is_resumption_) {
// For resumed downloads, if the target disposition or prefs require
// prompting, the user has already been prompted. Try to respect the user's
// selection, unless we've discovered that the target path cannot be used
// for some reason.
content::DownloadInterruptReason reason = download_->GetLastReason();
return (reason == content::DOWNLOAD_INTERRUPT_REASON_FILE_ACCESS_DENIED ||
reason == content::DOWNLOAD_INTERRUPT_REASON_FILE_NO_SPACE ||
reason == content::DOWNLOAD_INTERRUPT_REASON_FILE_TOO_LARGE);
}
// If the download path is forced, don't prompt.
if (!download_->GetForcedFilePath().empty()) {
// 'Save As' downloads shouldn't have a forced path.
DCHECK(DownloadItem::TARGET_DISPOSITION_PROMPT !=
download_->GetTargetDisposition());
return false;
}
// Don't ask where to save if the download path is managed. Even if the user
// wanted to be prompted for "all" downloads, or if this was a 'Save As'
// download.
if (download_prefs_->IsDownloadPathManaged())
return false;
// Prompt if this is a 'Save As' download.
if (download_->GetTargetDisposition() ==
DownloadItem::TARGET_DISPOSITION_PROMPT)
return true;
// Check if the user has the "Always prompt for download location" preference
// set. If so we prompt for most downloads except for the following scenarios:
// 1) Extension installation. Note that we only care here about the case where
// an extension is installed, not when one is downloaded with "save as...".
// 2) Filetypes marked "always open." If the user just wants this file opened,
// don't bother asking where to keep it.
if (download_prefs_->PromptForDownload() &&
!download_crx_util::IsExtensionDownload(*download_) &&
!filename.MatchesExtension(extensions::kExtensionFileExtension) &&
!download_prefs_->IsAutoOpenEnabledBasedOnExtension(filename))
return true;
// Otherwise, don't prompt. Note that the user might still be prompted if
// there are unresolved conflicts during path reservation (e.g. due to the
// target path being unwriteable or because there are too many conflicting
// files), or if an extension signals that the user be prompted on a filename
// conflict.
return false;
}
bool DownloadTargetDeterminer::HasPromptedForPath() const {
return (is_resumption_ && download_->GetTargetDisposition() ==
DownloadItem::TARGET_DISPOSITION_PROMPT);
}
download_util::DownloadDangerLevel DownloadTargetDeterminer::GetDangerLevel(
PriorVisitsToReferrer visits) const {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
// If the user has has been prompted or will be, assume that the user has
// approved the download. A programmatic download is considered safe unless it
// contains malware.
if (HasPromptedForPath() || should_prompt_ ||
!download_->GetForcedFilePath().empty())
return download_util::NOT_DANGEROUS;
const bool is_extension_download =
download_crx_util::IsExtensionDownload(*download_);
// User-initiated extension downloads from pref-whitelisted sources are not
// considered dangerous.
if (download_->HasUserGesture() &&
is_extension_download &&
download_crx_util::OffStoreInstallAllowedByPrefs(
GetProfile(), *download_)) {
return download_util::NOT_DANGEROUS;
}
#if defined(ENABLE_EXTENSIONS)
// Extensions that are not from the gallery are considered dangerous.
// When off-store install is disabled we skip this, since in this case, we
// will not offer to install the extension.
if (extensions::FeatureSwitch::easy_off_store_install()->IsEnabled() &&
is_extension_download &&
!extensions::WebstoreInstaller::GetAssociatedApproval(*download_)) {
return download_util::ALLOW_ON_USER_GESTURE;
}
#endif
// Anything the user has marked auto-open is OK if it's user-initiated.
if (download_prefs_->IsAutoOpenEnabledBasedOnExtension(virtual_path_) &&
download_->HasUserGesture())
return download_util::NOT_DANGEROUS;
download_util::DownloadDangerLevel danger_level =
download_util::GetFileDangerLevel(virtual_path_.BaseName());
// If the danger level is ALLOW_ON_USER_GESTURE and we have a user gesture AND
// there was a recorded visit to the referrer prior to today, then we are
// going to downgrade the danger_level to NOT_DANGEROUS. This prevents
// spurious prompting for moderately dangerous files that are downloaded from
// familiar sites.
if (danger_level == download_util::ALLOW_ON_USER_GESTURE &&
(download_->GetTransitionType() == ui::PAGE_TRANSITION_FROM_ADDRESS_BAR ||
(download_->HasUserGesture() && visits == VISITED_REFERRER)))
return download_util::NOT_DANGEROUS;
return danger_level;
}
void DownloadTargetDeterminer::OnDownloadDestroyed(
DownloadItem* download) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK_EQ(download_, download);
CancelOnFailureAndDeleteSelf();
}
// static
void DownloadTargetDeterminer::Start(content::DownloadItem* download,
const base::FilePath& initial_virtual_path,
DownloadPrefs* download_prefs,
DownloadTargetDeterminerDelegate* delegate,
const CompletionCallback& callback) {
// DownloadTargetDeterminer owns itself and will self destruct when the job is
// complete or the download item is destroyed. The callback is always invoked
// asynchronously.
new DownloadTargetDeterminer(download, initial_virtual_path, download_prefs,
delegate, callback);
}
// static
base::FilePath DownloadTargetDeterminer::GetCrDownloadPath(
const base::FilePath& suggested_path) {
return base::FilePath(suggested_path.value() + kCrdownloadSuffix);
}
#if defined(OS_WIN)
// static
bool DownloadTargetDeterminer::IsAdobeReaderUpToDate() {
return g_is_adobe_reader_up_to_date_;
}
#endif
| {
"content_hash": "37cd0aa812127e220fc0260e8b224409",
"timestamp": "",
"source": "github",
"line_count": 860,
"max_line_length": 80,
"avg_line_length": 37.717441860465115,
"alnum_prop": 0.6955637081111077,
"repo_name": "Bysmyyr/chromium-crosswalk",
"id": "a3016eae77b8f690820b40e40f33fdfdce5ca97d",
"size": "34135",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "chrome/browser/download/download_target_determiner.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
package org.apache.camel.impl;
import org.apache.camel.CamelContext;
import org.apache.camel.ContextTestSupport;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.spi.ThreadPoolProfile;
import org.apache.camel.util.concurrent.ThreadPoolRejectedPolicy;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class CamelCustomDefaultThreadPoolProfileTest extends ContextTestSupport {
@Override
protected CamelContext createCamelContext() throws Exception {
CamelContext camel = super.createCamelContext();
ThreadPoolProfile profile = new ThreadPoolProfile("custom");
profile.setPoolSize(5);
profile.setMaxPoolSize(15);
profile.setKeepAliveTime(25L);
profile.setMaxQueueSize(250);
profile.setAllowCoreThreadTimeOut(true);
profile.setRejectedPolicy(ThreadPoolRejectedPolicy.Abort);
DefaultExecutorServiceManager executorServiceManager = new DefaultExecutorServiceManager(camel);
executorServiceManager.setDefaultThreadPoolProfile(profile);
camel.setExecutorServiceManager(executorServiceManager);
return camel;
}
@Test
public void testCamelCustomDefaultThreadPoolProfile() throws Exception {
DefaultExecutorServiceManager manager = (DefaultExecutorServiceManager) context.getExecutorServiceManager();
ThreadPoolProfile profile = manager.getDefaultThreadPoolProfile();
assertEquals(5, profile.getPoolSize().intValue());
assertEquals(15, profile.getMaxPoolSize().intValue());
assertEquals(25, profile.getKeepAliveTime().longValue());
assertEquals(250, profile.getMaxQueueSize().intValue());
assertEquals(true, profile.getAllowCoreThreadTimeOut().booleanValue());
assertEquals(ThreadPoolRejectedPolicy.Abort, profile.getRejectedPolicy());
}
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
from("direct:start").threads(25, 45).to("mock:result");
}
};
}
}
| {
"content_hash": "07944e6c8d77838bad3093d781994400",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 116,
"avg_line_length": 39.90909090909091,
"alnum_prop": 0.7343963553530751,
"repo_name": "alvinkwekel/camel",
"id": "95437b1fb5c91b9b92d38f064e728fb09d9d3f4e",
"size": "2997",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "core/camel-core/src/test/java/org/apache/camel/impl/CamelCustomDefaultThreadPoolProfileTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Apex",
"bytes": "6521"
},
{
"name": "Batchfile",
"bytes": "2353"
},
{
"name": "CSS",
"bytes": "5472"
},
{
"name": "Elm",
"bytes": "10852"
},
{
"name": "FreeMarker",
"bytes": "8015"
},
{
"name": "Groovy",
"bytes": "20838"
},
{
"name": "HTML",
"bytes": "915675"
},
{
"name": "Java",
"bytes": "86780964"
},
{
"name": "JavaScript",
"bytes": "100326"
},
{
"name": "Makefile",
"bytes": "513"
},
{
"name": "RobotFramework",
"bytes": "8461"
},
{
"name": "Shell",
"bytes": "17295"
},
{
"name": "TSQL",
"bytes": "28835"
},
{
"name": "Tcl",
"bytes": "4974"
},
{
"name": "Thrift",
"bytes": "6979"
},
{
"name": "XQuery",
"bytes": "546"
},
{
"name": "XSLT",
"bytes": "280849"
}
],
"symlink_target": ""
} |
// This code contains NVIDIA Confidential Information and is disclosed to you
// under a form of NVIDIA software license agreement provided separately to you.
//
// Notice
// NVIDIA Corporation and its licensors retain all intellectual property and
// proprietary rights in and to this software and related documentation and
// any modifications thereto. Any use, reproduction, disclosure, or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA Corporation is strictly prohibited.
//
// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
//
// Information and code furnished is believed to be accurate and reliable.
// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
// information or for any infringement of patents or other rights of third parties that may
// result from its use. No license is granted by implication or otherwise under any patent
// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
// This code supersedes and replaces all information previously supplied.
// NVIDIA Corporation products are not authorized for use as critical
// components in life support devices or systems without express written approval of
// NVIDIA Corporation.
//
// Copyright (c) 2008-2018 NVIDIA Corporation. All rights reserved.
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
#ifndef PX_VEHICLE_TIREFRICTION_H
#define PX_VEHICLE_TIREFRICTION_H
/** \addtogroup vehicle
@{
*/
#include "foundation/PxSimpleTypes.h"
#if !PX_DOXYGEN
namespace physx
{
#endif
class PxMaterial;
/**
\brief Driving surface type. Each PxMaterial is associated with a corresponding PxVehicleDrivableSurfaceType.
@see PxMaterial, PxVehicleDrivableSurfaceToTireFrictionPairs
*/
struct PxVehicleDrivableSurfaceType
{
enum
{
eSURFACE_TYPE_UNKNOWN=0xffffffff
};
PxU32 mType;
};
/**
\brief Friction for each combination of driving surface type and tire type.
@see PxVehicleDrivableSurfaceType, PxVehicleTireData::mType
*/
class PxVehicleDrivableSurfaceToTireFrictionPairs
{
public:
friend class VehicleSurfaceTypeHashTable;
enum
{
eMAX_NB_SURFACE_TYPES=256
};
/**
\brief Allocate the memory for a PxVehicleDrivableSurfaceToTireFrictionPairs instance
that can hold data for combinations of tire type and surface type with up to maxNbTireTypes types of tire and maxNbSurfaceTypes types of surface.
\param[in] maxNbTireTypes is the maximum number of allowed tire types.
\param[in] maxNbSurfaceTypes is the maximum number of allowed surface types. Must be less than or equal to eMAX_NB_SURFACE_TYPES
\return a PxVehicleDrivableSurfaceToTireFrictionPairs instance that can be reused later with new type and friction data.
@see setup
*/
static PxVehicleDrivableSurfaceToTireFrictionPairs* allocate
(const PxU32 maxNbTireTypes, const PxU32 maxNbSurfaceTypes);
/**
\brief Set up a PxVehicleDrivableSurfaceToTireFrictionPairs instance for combinations of nbTireTypes tire types and nbSurfaceTypes surface types.
\param[in] nbTireTypes is the number of different types of tire. This value must be less than or equal to maxNbTireTypes specified in allocate().
\param[in] nbSurfaceTypes is the number of different types of surface. This value must be less than or equal to maxNbSurfaceTypes specified in allocate().
\param[in] drivableSurfaceMaterials is an array of PxMaterial pointers of length nbSurfaceTypes.
\param[in] drivableSurfaceTypes is an array of PxVehicleDrivableSurfaceType instances of length nbSurfaceTypes.
\note If the pointer to the PxMaterial that touches the tire is found in drivableSurfaceMaterials[x] then the surface type is drivableSurfaceTypes[x].mType
and the friction is the value that is set with setTypePairFriction(drivableSurfaceTypes[x].mType, PxVehicleTireData::mType, frictionValue).
\note A friction value of 1.0 will be assigned as default to each combination of tire and surface type. To override this use setTypePairFriction.
@see release, setTypePairFriction, getTypePairFriction, PxVehicleTireData.mType
*/
void setup
(const PxU32 nbTireTypes, const PxU32 nbSurfaceTypes,
const PxMaterial** drivableSurfaceMaterials, const PxVehicleDrivableSurfaceType* drivableSurfaceTypes);
/**
\brief Deallocate a PxVehicleDrivableSurfaceToTireFrictionPairs instance
*/
void release();
/**
\brief Set the friction for a specified pair of tire type and drivable surface type.
\param[in] surfaceType describes the surface type
\param[in] tireType describes the tire type.
\param[in] value describes the friction coefficient for the combination of surface type and tire type.
*/
void setTypePairFriction(const PxU32 surfaceType, const PxU32 tireType, const PxReal value);
/**
\brief Return the friction for a specified combination of surface type and tire type.
\return The friction for a specified combination of surface type and tire type.
\note The final friction value used by the tire model is the value returned by getTypePairFriction
multiplied by the value computed from PxVehicleTireData::mFrictionVsSlipGraph
@see PxVehicleTireData::mFrictionVsSlipGraph
*/
PxReal getTypePairFriction(const PxU32 surfaceType, const PxU32 tireType) const;
/**
\brief Return the maximum number of surface types
\return The maximum number of surface types
@see allocate
*/
PxU32 getMaxNbSurfaceTypes() const {return mMaxNbSurfaceTypes;}
/**
\brief Return the maximum number of tire types
\return The maximum number of tire types
@see allocate
*/
PxU32 getMaxNbTireTypes() const {return mMaxNbTireTypes;}
private:
/**
\brief Ptr to base address of a 2d PxReal array with dimensions [mNbSurfaceTypes][mNbTireTypes]
\note Each element of the array describes the maximum friction provided by a surface type-tire type combination.
eg the friction corresponding to a combination of surface type x and tire type y is mPairs[x][y]
*/
PxReal* mPairs;
/**
\brief Ptr to 1d array of material ptrs that is of length mNbSurfaceTypes.
\note If the PxMaterial that touches the tire corresponds to mDrivableSurfaceMaterials[x] then the drivable surface
type is mDrivableSurfaceTypes[x].mType and the friction for that contact is mPairs[mDrivableSurfaceTypes[x].mType][y],
assuming a tire type y.
\note If the PxMaterial that touches the tire is not found in mDrivableSurfaceMaterials then the friction is
mPairs[0][y], assuming a tire type y.
*/
const PxMaterial** mDrivableSurfaceMaterials;
/**
\brief Ptr to 1d array of PxVehicleDrivableSurfaceType that is of length mNbSurfaceTypes.
\note If the PxMaterial that touches the tire is found in mDrivableSurfaceMaterials[x] then the drivable surface
type is mDrivableSurfaceTypes[x].mType and the friction for that contact is mPairs[mDrivableSurfaceTypes[x].mType][y],
assuming a tire type y.
\note If the PxMaterial that touches the tire is not found in mDrivableSurfaceMaterials then the friction is
mPairs[0][y], assuming a tire type y.
*/
PxVehicleDrivableSurfaceType* mDrivableSurfaceTypes;
/**
\brief Number of different driving surface types.
\note mDrivableSurfaceMaterials and mDrivableSurfaceTypes are both 1d arrays of length mMaxNbSurfaceTypes.
\note mNbSurfaceTypes must be less than or equal to mMaxNbSurfaceTypes.
*/
PxU32 mNbSurfaceTypes;
/**
\brief Maximum number of different driving surface types.
\note mMaxNbSurfaceTypes must be less than or equal to eMAX_NB_SURFACE_TYPES.
*/
PxU32 mMaxNbSurfaceTypes;
/**
\brief Number of different tire types.
\note Tire types stored in PxVehicleTireData.mType
*/
PxU32 mNbTireTypes;
/**
\brief Maximum number of different tire types.
\note Tire types stored in PxVehicleTireData.mType
*/
PxU32 mMaxNbTireTypes;
#if !PX_P64_FAMILY
PxU32 mPad[1];
#else
PxU32 mPad[2];
#endif
PxVehicleDrivableSurfaceToTireFrictionPairs(){}
~PxVehicleDrivableSurfaceToTireFrictionPairs(){}
};
PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleDrivableSurfaceToTireFrictionPairs) & 15));
#if !PX_DOXYGEN
} // namespace physx
#endif
/** @} */
#endif //PX_VEHICLE_TIREFRICTION_H
| {
"content_hash": "a53e68be681ef86daef7496fe708c492",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 157,
"avg_line_length": 38.08071748878924,
"alnum_prop": 0.7880357983984927,
"repo_name": "Andrewcjp/GraphicsEngine",
"id": "6108f475e745967c10e2bca0a59ba8ca692c8c46",
"size": "8492",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "GraphicsEngine/Source/ThirdParty/physx/include/vehicle/PxVehicleTireFriction.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "728"
},
{
"name": "C",
"bytes": "2011895"
},
{
"name": "C#",
"bytes": "3177"
},
{
"name": "C++",
"bytes": "8261465"
},
{
"name": "CMake",
"bytes": "2703"
},
{
"name": "GLSL",
"bytes": "36269"
},
{
"name": "HLSL",
"bytes": "96975"
},
{
"name": "Lua",
"bytes": "26517"
},
{
"name": "Objective-C",
"bytes": "73452"
},
{
"name": "Python",
"bytes": "28165"
}
],
"symlink_target": ""
} |
---
layout: archive
lang: en
ref: csharp_multi_port_protocol_2_0
read_time: true
share: true
author_profile: false
permalink: /docs/en/software/dynamixel/dynamixel_sdk/sample_code/csharp_multi_port_protocol_2_0/
sidebar:
title: DYNAMIXEL SDK
nav: "dynamixel_sdk"
---
<div style="counter-reset: h1 5"></div>
<div style="counter-reset: h2 10"></div>
<div style="counter-reset: h3 1"></div>
<!--[dummy Header 1]>
<h1 id="sample-code"><a href="#sample-code">Sample Code</a></h1>
<h2 id="csharp-protocol-20"><a href="#csharp-protocol-20">CSharp Protocol 2.0</a></h2>
<![end dummy Header 1]-->
### [CSharp Multi Port Protocol 2.0](#csharp-multi-port-protocol-20)
- Description
This example writes goal position to DYNAMIXEL connected to two serial ports, and reads their present position until Dynamixel stops moving.
- Available Dynamixel
All series using protocol 2.0
#### Sample code
``` cs
/*
* MultiPort.cs
*
* Created on: 2016. 6. 20.
* Author: Ryu Woon Jung (Leon)
*/
//
// ********* MultiPort Example *********
//
//
// Available Dynamixel model on this example : All models using Protocol 2.0
// This example is designed for using two Dynamixel PRO 54-200, and two USB2DYNAMIXELs.
// To use another Dynamixel model, such as X series, see their details in E-Manual(support.robotis.com) and edit below variables yourself.
// Be sure that Dynamixel PRO properties are already set as %% ID : 1 / Baudnum : 3 (Baudrate : 1000000)
//
using System;
using dynamixel_sdk;
namespace read_write
{
class ReadWrite
{
// Control table address
public const int ADDR_PRO_TORQUE_ENABLE = 562; // Control table address is different in Dynamixel model
public const int ADDR_PRO_GOAL_POSITION = 596;
public const int ADDR_PRO_PRESENT_POSITION = 611;
// Protocol version
public const int PROTOCOL_VERSION = 2; // See which protocol version is used in the Dynamixel
// Default setting
public const int DXL1_ID = 1; // Dynamixel ID: 1
public const int DXL2_ID = 2; // Dynamixel ID: 2
public const int BAUDRATE = 1000000;
public const string DEVICENAME1 = "/dev/ttyUSB0"; // Check which port is being used on your controller
public const string DEVICENAME2 = "/dev/ttyUSB1"; // ex) "COM1" Linux: "/dev/ttyUSB0"
public const int TORQUE_ENABLE = 1; // Value for enabling the torque
public const int TORQUE_DISABLE = 0; // Value for disabling the torque
public const int DXL_MINIMUM_POSITION_VALUE = -150000; // Dynamixel will rotate between this value
public const int DXL_MAXIMUM_POSITION_VALUE = 150000; // and this value (note that the Dynamixel would not move when the position value is out of movable range. Check e-manual about the range of the Dynamixel you use.)
public const int DXL_MOVING_STATUS_THRESHOLD = 20; // Dynamixel moving status threshold
public const byte ESC_ASCII_VALUE = 0x1b;
public const int COMM_SUCCESS = 0; // Communication Success result value
public const int COMM_TX_FAIL = -1001; // Communication Tx Failed
static void Main(string[] args)
{
// Initialize PortHandler Structs
// Set the port path
// Get methods and members of PortHandlerLinux or PortHandlerWindows
int port_num1 = dynamixel.portHandler(DEVICENAME1);
int port_num2 = dynamixel.portHandler(DEVICENAME2);
// Initialize PacketHandler Structs
dynamixel.packetHandler();
int index = 0;
int dxl_comm_result = COMM_TX_FAIL; // Communication result
int[] dxl_goal_position = new int[2]{ DXL_MINIMUM_POSITION_VALUE, DXL_MAXIMUM_POSITION_VALUE }; // Goal position
byte dxl_error = 0; // Dynamixel error
Int32 dxl1_present_position = 0, dxl2_present_position = 0; // Present position
// Open port1
if (dynamixel.openPort(port_num1))
{
Console.WriteLine("Succeeded to open the port!");
}
else
{
Console.WriteLine("Failed to open the port!");
Console.WriteLine("Press any key to terminate...");
Console.ReadKey();
return;
}
// Open port2
if (dynamixel.openPort(port_num2))
{
Console.WriteLine("Succeeded to open the port!");
}
else
{
Console.WriteLine("Failed to open the port!");
Console.WriteLine("Press any key to terminate...");
Console.ReadKey();
return;
}
// Set port1 baudrate
if (dynamixel.setBaudRate(port_num1, BAUDRATE))
{
Console.WriteLine("Succeeded to change the baudrate!");
}
else
{
Console.WriteLine("Failed to change the baudrate!");
Console.WriteLine("Press any key to terminate...");
Console.ReadKey();
return;
}
// Set port2 baudrate
if (dynamixel.setBaudRate(port_num2, BAUDRATE))
{
Console.WriteLine("Succeeded to change the baudrate!");
}
else
{
Console.WriteLine("Failed to change the baudrate!");
Console.WriteLine("Press any key to terminate...");
Console.ReadKey();
return;
}
// Enable Dynamixel#1 Torque
dynamixel.write1ByteTxRx(port_num1, PROTOCOL_VERSION, DXL1_ID, ADDR_PRO_TORQUE_ENABLE, TORQUE_ENABLE);
if ((dxl_comm_result = dynamixel.getLastTxRxResult(port_num1, PROTOCOL_VERSION)) != COMM_SUCCESS)
{
dynamixel.printTxRxResult(PROTOCOL_VERSION, dxl_comm_result);
}
else if ((dxl_error = dynamixel.getLastRxPacketError(port_num1, PROTOCOL_VERSION)) != 0)
{
dynamixel.printRxPacketError(PROTOCOL_VERSION, dxl_error);
}
else
{
Console.WriteLine("Dynamixel#{0} has been successfully connected ", DXL1_ID);
}
// Enable Dynamixel#2 Torque
dynamixel.write1ByteTxRx(port_num2, PROTOCOL_VERSION, DXL2_ID, ADDR_PRO_TORQUE_ENABLE, TORQUE_ENABLE);
if ((dxl_comm_result = dynamixel.getLastTxRxResult(port_num2, PROTOCOL_VERSION)) != COMM_SUCCESS)
{
dynamixel.printTxRxResult(PROTOCOL_VERSION, dxl_comm_result);
}
else if ((dxl_error = dynamixel.getLastRxPacketError(port_num2, PROTOCOL_VERSION)) != 0)
{
dynamixel.printRxPacketError(PROTOCOL_VERSION, dxl_error);
}
else
{
Console.WriteLine("Dynamixel#{0} has been successfully connected ", DXL2_ID);
}
while (true)
{
Console.WriteLine("Press any key to continue! (or press ESC to quit!)");
if (Console.ReadKey().KeyChar == ESC_ASCII_VALUE)
break;
// Write Dynamixel#1 goal position
dynamixel.write4ByteTxRx(port_num1, PROTOCOL_VERSION, DXL1_ID, ADDR_PRO_GOAL_POSITION, (UInt32)dxl_goal_position[index]);
if ((dxl_comm_result = dynamixel.getLastTxRxResult(port_num1, PROTOCOL_VERSION)) != COMM_SUCCESS)
{
dynamixel.printTxRxResult(PROTOCOL_VERSION, dxl_comm_result);
}
else if ((dxl_error = dynamixel.getLastRxPacketError(port_num1, PROTOCOL_VERSION)) != 0)
{
dynamixel.printRxPacketError(PROTOCOL_VERSION, dxl_error);
}
// Write Dynamixel#2 goal position
dynamixel.write4ByteTxRx(port_num2, PROTOCOL_VERSION, DXL2_ID, ADDR_PRO_GOAL_POSITION, (UInt32)dxl_goal_position[index]);
if ((dxl_comm_result = dynamixel.getLastTxRxResult(port_num2, PROTOCOL_VERSION)) != COMM_SUCCESS)
{
dynamixel.printTxRxResult(PROTOCOL_VERSION, dxl_comm_result);
}
else if ((dxl_error = dynamixel.getLastRxPacketError(port_num2, PROTOCOL_VERSION)) != 0)
{
dynamixel.printRxPacketError(PROTOCOL_VERSION, dxl_error);
}
do
{
// Read Dynamixel#1 present position
dxl1_present_position = (Int32)dynamixel.read4ByteTxRx(port_num1, PROTOCOL_VERSION, DXL1_ID, ADDR_PRO_PRESENT_POSITION);
if ((dxl_comm_result = dynamixel.getLastTxRxResult(port_num1, PROTOCOL_VERSION)) != COMM_SUCCESS)
{
dynamixel.printTxRxResult(PROTOCOL_VERSION, dxl_comm_result);
}
else if ((dxl_error = dynamixel.getLastRxPacketError(port_num1, PROTOCOL_VERSION)) != 0)
{
dynamixel.printRxPacketError(PROTOCOL_VERSION, dxl_error);
}
// Read Dynamixel#2 present position
dxl2_present_position = (Int32)dynamixel.read4ByteTxRx(port_num2, PROTOCOL_VERSION, DXL2_ID, ADDR_PRO_PRESENT_POSITION);
if ((dxl_comm_result = dynamixel.getLastTxRxResult(port_num2, PROTOCOL_VERSION)) != COMM_SUCCESS)
{
dynamixel.printTxRxResult(PROTOCOL_VERSION, dxl_comm_result);
}
else if ((dxl_error = dynamixel.getLastRxPacketError(port_num2, PROTOCOL_VERSION)) != 0)
{
dynamixel.printRxPacketError(PROTOCOL_VERSION, dxl_error);
}
Console.WriteLine("[ID: {0}] GoalPos: {1} PresPos: {2} [ID: {3}] GoalPos: {4} PresPos: {5}", DXL1_ID, dxl_goal_position[index], dxl1_present_position, DXL2_ID, dxl_goal_position[index], dxl2_present_position);
} while ((Math.Abs(dxl_goal_position[index] - dxl1_present_position) > DXL_MOVING_STATUS_THRESHOLD) || (Math.Abs(dxl_goal_position[index] - dxl2_present_position) > DXL_MOVING_STATUS_THRESHOLD));
// Change goal position
if (index == 0)
{
index = 1;
}
else
{
index = 0;
}
}
// Disable Dynamixel#1 Torque
dynamixel.write1ByteTxRx(port_num1, PROTOCOL_VERSION, DXL1_ID, ADDR_PRO_TORQUE_ENABLE, TORQUE_DISABLE);
if ((dxl_comm_result = dynamixel.getLastTxRxResult(port_num1, PROTOCOL_VERSION)) != COMM_SUCCESS)
{
dynamixel.printTxRxResult(PROTOCOL_VERSION, dxl_comm_result);
}
else if ((dxl_error = dynamixel.getLastRxPacketError(port_num1, PROTOCOL_VERSION)) != 0)
{
dynamixel.printRxPacketError(PROTOCOL_VERSION, dxl_error);
}
// Disable Dynamixel#2 Torque
dynamixel.write1ByteTxRx(port_num2, PROTOCOL_VERSION, DXL2_ID, ADDR_PRO_TORQUE_ENABLE, TORQUE_DISABLE);
if ((dxl_comm_result = dynamixel.getLastTxRxResult(port_num2, PROTOCOL_VERSION)) != COMM_SUCCESS)
{
dynamixel.printTxRxResult(PROTOCOL_VERSION, dxl_comm_result);
}
else if ((dxl_error = dynamixel.getLastRxPacketError(port_num2, PROTOCOL_VERSION)) != 0)
{
dynamixel.printRxPacketError(PROTOCOL_VERSION, dxl_error);
}
// Close port1
dynamixel.closePort(port_num1);
// Close port2
dynamixel.closePort(port_num2);
return;
}
}
}
```
#### Details
``` cs
using System;
```
The functions `Math.Abs()`, `Console.*` for I/O, are in the example code, and it uses `System` namespace.
``` cs
using dynamixel_sdk;
```
All libraries of DYNAMIXEL SDK are wrapped into the `dynamixel_sdk` namespace.
``` cs
// Control table address
public const int ADDR_PRO_TORQUE_ENABLE = 562; // Control table address is different in Dynamixel model
public const int ADDR_PRO_GOAL_POSITION = 596;
public const int ADDR_PRO_PRESENT_POSITION = 611;
```
Dynamixel series have their own control tables: Addresses and Byte Length in each items. To control one of the items, its address (and length if necessary) is required. Find your requirements in http://emanual.robotis.com/.
``` cs
// Protocol version
public const int PROTOCOL_VERSION = 2; // See which protocol version is used in the Dynamixel
```
Dynamixel uses either or both protocols: Protocol 1.0 and Protocol 2.0. Choose one of the Protocol which is appropriate in the Dynamixel.
``` cs
// Default setting
public const int DXL1_ID = 1; // Dynamixel ID: 1
public const int DXL2_ID = 2; // Dynamixel ID: 2
public const int BAUDRATE = 1000000;
public const string DEVICENAME1 = "/dev/ttyUSB0"; // Check which port is being used on your controller
public const string DEVICENAME2 = "/dev/ttyUSB1"; // ex) "COM1" Linux: "/dev/ttyUSB0"
public const int TORQUE_ENABLE = 1; // Value for enabling the torque
public const int TORQUE_DISABLE = 0; // Value for disabling the torque
public const int DXL_MINIMUM_POSITION_VALUE = -150000; // Dynamixel will rotate between this value
public const int DXL_MAXIMUM_POSITION_VALUE = 150000; // and this value (note that the Dynamixel would not move when the position value is out of movable range. Check e-manual about the range of the Dynamixel you use.)
public const int DXL_MOVING_STATUS_THRESHOLD = 20; // Dynamixel moving status threshold
public const byte ESC_ASCII_VALUE = 0x1b;
```
Here we set some variables to let you freely change them and use them to run the example code.
As the document previously said in [previous chapter](/docs/en/software/dynamixel/dynamixel_sdk/device_setup/#dynamixel), customize Dynamixel control table items, such as `DXL_ID` number, communication `BAUDRATE`, and the `DEVICENAME`, on your own terms of needs. In particular, `BAUDRATE` and `DEVICENAME` have systematical dependencies on your controller, so make clear what kind of communication method you will use.
The example uses two DYNAMIXEL's `DXL1_ID`, `DXL2_ID` connected with each ports `DEVICENAME1`, `DEVICENAME2`
Dynamixel basically needs the `TORQUE_ENABLE` to be rotating or give you its internal information. On the other hand, it doesn't need torque enabled if you get your goal, so finally do `TORQUE_DISABLE` to prepare to the next sequence.
Since the Dynamixel has its own rotation range, it may shows malfunction if your request on your dynamixel is out of range. For example, Dynamixel MX-28 and Dynamixel PRO 54-200 has its rotatable range as 0 ~ 4028 and -250950 ~ 250950, each.
`DXL_MOVING_STATUS_THRESHOLD` acts as a criteria for verifying its rotation stopped.
``` cs
public const int COMM_SUCCESS = 0; // Communication Success result value
public const int COMM_TX_FAIL = -1001; // Communication Tx Failed
```
Each of the variables above show the meaning of the communication result value.
``` cs
static void Main(string[] args)
{
// Initialize PortHandler Structs
// Set the port path
// Get methods and members of PortHandlerLinux or PortHandlerWindows
int port_num1 = dynamixel.portHandler(DEVICENAME1);
int port_num2 = dynamixel.portHandler(DEVICENAME2);
// Initialize PacketHandler Structs
dynamixel.packetHandler();
int index = 0;
int dxl_comm_result = COMM_TX_FAIL; // Communication result
int[] dxl_goal_position = new int[2]{ DXL_MINIMUM_POSITION_VALUE, DXL_MAXIMUM_POSITION_VALUE }; // Goal position
byte dxl_error = 0; // Dynamixel error
Int32 dxl1_present_position = 0, dxl2_present_position = 0; // Present position
// Open port1
if (dynamixel.openPort(port_num1))
{
Console.WriteLine("Succeeded to open the port!");
}
else
{
Console.WriteLine("Failed to open the port!");
Console.WriteLine("Press any key to terminate...");
Console.ReadKey();
return;
}
// Open port2
if (dynamixel.openPort(port_num2))
{
Console.WriteLine("Succeeded to open the port!");
}
else
{
Console.WriteLine("Failed to open the port!");
Console.WriteLine("Press any key to terminate...");
Console.ReadKey();
return;
}
// Set port1 baudrate
if (dynamixel.setBaudRate(port_num1, BAUDRATE))
{
Console.WriteLine("Succeeded to change the baudrate!");
}
else
{
Console.WriteLine("Failed to change the baudrate!");
Console.WriteLine("Press any key to terminate...");
Console.ReadKey();
return;
}
// Set port2 baudrate
if (dynamixel.setBaudRate(port_num2, BAUDRATE))
{
Console.WriteLine("Succeeded to change the baudrate!");
}
else
{
Console.WriteLine("Failed to change the baudrate!");
Console.WriteLine("Press any key to terminate...");
Console.ReadKey();
return;
}
// Enable Dynamixel#1 Torque
dynamixel.write1ByteTxRx(port_num1, PROTOCOL_VERSION, DXL1_ID, ADDR_PRO_TORQUE_ENABLE, TORQUE_ENABLE);
if ((dxl_comm_result = dynamixel.getLastTxRxResult(port_num1, PROTOCOL_VERSION)) != COMM_SUCCESS)
{
dynamixel.printTxRxResult(PROTOCOL_VERSION, dxl_comm_result);
}
else if ((dxl_error = dynamixel.getLastRxPacketError(port_num1, PROTOCOL_VERSION)) != 0)
{
dynamixel.printRxPacketError(PROTOCOL_VERSION, dxl_error);
}
else
{
Console.WriteLine("Dynamixel#{0} has been successfully connected ", DXL1_ID);
}
// Enable Dynamixel#2 Torque
dynamixel.write1ByteTxRx(port_num2, PROTOCOL_VERSION, DXL2_ID, ADDR_PRO_TORQUE_ENABLE, TORQUE_ENABLE);
if ((dxl_comm_result = dynamixel.getLastTxRxResult(port_num2, PROTOCOL_VERSION)) != COMM_SUCCESS)
{
dynamixel.printTxRxResult(PROTOCOL_VERSION, dxl_comm_result);
}
else if ((dxl_error = dynamixel.getLastRxPacketError(port_num2, PROTOCOL_VERSION)) != 0)
{
dynamixel.printRxPacketError(PROTOCOL_VERSION, dxl_error);
}
else
{
Console.WriteLine("Dynamixel#{0} has been successfully connected ", DXL2_ID);
}
while (true)
{
Console.WriteLine("Press any key to continue! (or press ESC to quit!)");
if (Console.ReadKey().KeyChar == ESC_ASCII_VALUE)
break;
// Write Dynamixel#1 goal position
dynamixel.write4ByteTxRx(port_num1, PROTOCOL_VERSION, DXL1_ID, ADDR_PRO_GOAL_POSITION, (UInt32)dxl_goal_position[index]);
if ((dxl_comm_result = dynamixel.getLastTxRxResult(port_num1, PROTOCOL_VERSION)) != COMM_SUCCESS)
{
dynamixel.printTxRxResult(PROTOCOL_VERSION, dxl_comm_result);
}
else if ((dxl_error = dynamixel.getLastRxPacketError(port_num1, PROTOCOL_VERSION)) != 0)
{
dynamixel.printRxPacketError(PROTOCOL_VERSION, dxl_error);
}
// Write Dynamixel#2 goal position
dynamixel.write4ByteTxRx(port_num2, PROTOCOL_VERSION, DXL2_ID, ADDR_PRO_GOAL_POSITION, (UInt32)dxl_goal_position[index]);
if ((dxl_comm_result = dynamixel.getLastTxRxResult(port_num2, PROTOCOL_VERSION)) != COMM_SUCCESS)
{
dynamixel.printTxRxResult(PROTOCOL_VERSION, dxl_comm_result);
}
else if ((dxl_error = dynamixel.getLastRxPacketError(port_num2, PROTOCOL_VERSION)) != 0)
{
dynamixel.printRxPacketError(PROTOCOL_VERSION, dxl_error);
}
do
{
// Read Dynamixel#1 present position
dxl1_present_position = (Int32)dynamixel.read4ByteTxRx(port_num1, PROTOCOL_VERSION, DXL1_ID, ADDR_PRO_PRESENT_POSITION);
if ((dxl_comm_result = dynamixel.getLastTxRxResult(port_num1, PROTOCOL_VERSION)) != COMM_SUCCESS)
{
dynamixel.printTxRxResult(PROTOCOL_VERSION, dxl_comm_result);
}
else if ((dxl_error = dynamixel.getLastRxPacketError(port_num1, PROTOCOL_VERSION)) != 0)
{
dynamixel.printRxPacketError(PROTOCOL_VERSION, dxl_error);
}
// Read Dynamixel#2 present position
dxl2_present_position = (Int32)dynamixel.read4ByteTxRx(port_num2, PROTOCOL_VERSION, DXL2_ID, ADDR_PRO_PRESENT_POSITION);
if ((dxl_comm_result = dynamixel.getLastTxRxResult(port_num2, PROTOCOL_VERSION)) != COMM_SUCCESS)
{
dynamixel.printTxRxResult(PROTOCOL_VERSION, dxl_comm_result);
}
else if ((dxl_error = dynamixel.getLastRxPacketError(port_num2, PROTOCOL_VERSION)) != 0)
{
dynamixel.printRxPacketError(PROTOCOL_VERSION, dxl_error);
}
Console.WriteLine("[ID: {0}] GoalPos: {1} PresPos: {2} [ID: {3}] GoalPos: {4} PresPos: {5}", DXL1_ID, dxl_goal_position[index], dxl1_present_position, DXL2_ID, dxl_goal_position[index], dxl2_present_position);
} while ((Math.Abs(dxl_goal_position[index] - dxl1_present_position) > DXL_MOVING_STATUS_THRESHOLD) || (Math.Abs(dxl_goal_position[index] - dxl2_present_position) > DXL_MOVING_STATUS_THRESHOLD));
// Change goal position
if (index == 0)
{
index = 1;
}
else
{
index = 0;
}
}
// Disable Dynamixel#1 Torque
dynamixel.write1ByteTxRx(port_num1, PROTOCOL_VERSION, DXL1_ID, ADDR_PRO_TORQUE_ENABLE, TORQUE_DISABLE);
if ((dxl_comm_result = dynamixel.getLastTxRxResult(port_num1, PROTOCOL_VERSION)) != COMM_SUCCESS)
{
dynamixel.printTxRxResult(PROTOCOL_VERSION, dxl_comm_result);
}
else if ((dxl_error = dynamixel.getLastRxPacketError(port_num1, PROTOCOL_VERSION)) != 0)
{
dynamixel.printRxPacketError(PROTOCOL_VERSION, dxl_error);
}
// Disable Dynamixel#2 Torque
dynamixel.write1ByteTxRx(port_num2, PROTOCOL_VERSION, DXL2_ID, ADDR_PRO_TORQUE_ENABLE, TORQUE_DISABLE);
if ((dxl_comm_result = dynamixel.getLastTxRxResult(port_num2, PROTOCOL_VERSION)) != COMM_SUCCESS)
{
dynamixel.printTxRxResult(PROTOCOL_VERSION, dxl_comm_result);
}
else if ((dxl_error = dynamixel.getLastRxPacketError(port_num2, PROTOCOL_VERSION)) != 0)
{
dynamixel.printRxPacketError(PROTOCOL_VERSION, dxl_error);
}
// Close port1
dynamixel.closePort(port_num1);
// Close port2
dynamixel.closePort(port_num2);
return;
}
```
In `Main()` function, the codes call actual functions for Dynamixel control.
``` cs
// Initialize PortHandler Structs
// Set the port path
// Get methods and members of PortHandlerLinux or PortHandlerWindows
int port_num1 = dynamixel.portHandler(DEVICENAME1);
int port_num2 = dynamixel.portHandler(DEVICENAME2);
```
`portHandler()` function sets port path as `DEVICENAME1` and `DEVICENAME2` and get `port_num1` and `port_num2` each, and prepares an appropriate functions for port control in controller OS automatically. `port_num1` and `port_num2` would be used in many functions in the body of the code to specify the port for use.
``` cs
// Initialize PacketHandler Structs
dynamixel.packetHandler();
```
`packetHandler()` function initializes parameters used for packet construction and packet storing.
``` cs
int index = 0;
int dxl_comm_result = COMM_TX_FAIL; // Communication result
int[] dxl_goal_position = new int[2]{ DXL_MINIMUM_POSITION_VALUE, DXL_MAXIMUM_POSITION_VALUE }; // Goal position
byte dxl_error = 0; // Dynamixel error
Int32 dxl1_present_position = 0, dxl2_present_position = 0; // Present position
```
`index` variable points the direction to where the Dynamixel should be rotated.
`dxl_comm_result` indicates which error has been occurred during packet communication.
`dxl_goal_position` stores goal points of Dynamixel rotation.
`dxl_error` shows the internal error in Dynamixel.
`dxl1_present_position` and `dxl2_present_position` view where now each Dynamixel points out.
``` cs
// Open port1
if (dynamixel.openPort(port_num1))
{
Console.WriteLine("Succeeded to open the port!");
}
else
{
Console.WriteLine("Failed to open the port!");
Console.WriteLine("Press any key to terminate...");
Console.ReadKey();
return;
}
// Open port2
if (dynamixel.openPort(port_num2))
{
Console.WriteLine("Succeeded to open the port!");
}
else
{
Console.WriteLine("Failed to open the port!");
Console.WriteLine("Press any key to terminate...");
Console.ReadKey();
return;
}
```
First, controller opens #`port_num1` and #`port_num2` port to do serial communication with the Dynamixel. If it fails to open the port, the example will be terminated.
``` cs
// Set port1 baudrate
if (dynamixel.setBaudRate(port_num1, BAUDRATE))
{
Console.WriteLine("Succeeded to change the baudrate!");
}
else
{
Console.WriteLine("Failed to change the baudrate!");
Console.WriteLine("Press any key to terminate...");
Console.ReadKey();
return;
}
// Set port2 baudrate
if (dynamixel.setBaudRate(port_num2, BAUDRATE))
{
Console.WriteLine("Succeeded to change the baudrate!");
}
else
{
Console.WriteLine("Failed to change the baudrate!");
Console.WriteLine("Press any key to terminate...");
Console.ReadKey();
return;
}
```
Secondly, the controller sets the communication `BAUDRATE` at #`port_num1` and #`port_num2` port opened previously.
``` cs
// Enable Dynamixel#1 Torque
dynamixel.write1ByteTxRx(port_num1, PROTOCOL_VERSION, DXL1_ID, ADDR_PRO_TORQUE_ENABLE, TORQUE_ENABLE);
if ((dxl_comm_result = dynamixel.getLastTxRxResult(port_num1, PROTOCOL_VERSION)) != COMM_SUCCESS)
{
dynamixel.printTxRxResult(PROTOCOL_VERSION, dxl_comm_result);
}
else if ((dxl_error = dynamixel.getLastRxPacketError(port_num1, PROTOCOL_VERSION)) != 0)
{
dynamixel.printRxPacketError(PROTOCOL_VERSION, dxl_error);
}
else
{
Console.WriteLine("Dynamixel#{0} has been successfully connected ", DXL1_ID);
}
// Enable Dynamixel#2 Torque
dynamixel.write1ByteTxRx(port_num2, PROTOCOL_VERSION, DXL2_ID, ADDR_PRO_TORQUE_ENABLE, TORQUE_ENABLE);
if ((dxl_comm_result = dynamixel.getLastTxRxResult(port_num2, PROTOCOL_VERSION)) != COMM_SUCCESS)
{
dynamixel.printTxRxResult(PROTOCOL_VERSION, dxl_comm_result);
}
else if ((dxl_error = dynamixel.getLastRxPacketError(port_num2, PROTOCOL_VERSION)) != 0)
{
dynamixel.printRxPacketError(PROTOCOL_VERSION, dxl_error);
}
else
{
Console.WriteLine("Dynamixel#{0} has been successfully connected ", DXL2_ID);
}
```
As mentioned in the document, above code enables each Dynamixel`s torque to set their status as being ready to move.
`write1ByteTxRx()` function sends an instruction to the #`DXL1_ID` and #`DXL2_ID` DYNAMIXEL in `PROTOCOL_VERSION` communication protocol through #`port_num1` and #`port_num2` port, writing 1 byte of `TORQUE_ENABLE` value to `ADDR_PRO_TORQUE_ENABLE` address. The function checks Tx/Rx result and receives Hardware error.
`getLastTxRxResult()` function and `getLastRxPacketError()` function get either, and then `printTxRxResult()` function and `printRxPacketError()` function show results on the console window if any communication error or Hardware error has been occurred.
``` cs
while (true)
{
Console.WriteLine("Press any key to continue! (or press ESC to quit!)");
if (Console.ReadKey().KeyChar == ESC_ASCII_VALUE)
break;
// Write Dynamixel#1 goal position
dynamixel.write4ByteTxRx(port_num1, PROTOCOL_VERSION, DXL1_ID, ADDR_PRO_GOAL_POSITION, (UInt32)dxl_goal_position[index]);
if ((dxl_comm_result = dynamixel.getLastTxRxResult(port_num1, PROTOCOL_VERSION)) != COMM_SUCCESS)
{
dynamixel.printTxRxResult(PROTOCOL_VERSION, dxl_comm_result);
}
else if ((dxl_error = dynamixel.getLastRxPacketError(port_num1, PROTOCOL_VERSION)) != 0)
{
dynamixel.printRxPacketError(PROTOCOL_VERSION, dxl_error);
}
// Write Dynamixel#2 goal position
dynamixel.write4ByteTxRx(port_num2, PROTOCOL_VERSION, DXL2_ID, ADDR_PRO_GOAL_POSITION, (UInt32)dxl_goal_position[index]);
if ((dxl_comm_result = dynamixel.getLastTxRxResult(port_num2, PROTOCOL_VERSION)) != COMM_SUCCESS)
{
dynamixel.printTxRxResult(PROTOCOL_VERSION, dxl_comm_result);
}
else if ((dxl_error = dynamixel.getLastRxPacketError(port_num2, PROTOCOL_VERSION)) != 0)
{
dynamixel.printRxPacketError(PROTOCOL_VERSION, dxl_error);
}
do
{
// Read Dynamixel#1 present position
dxl1_present_position = (Int32)dynamixel.read4ByteTxRx(port_num1, PROTOCOL_VERSION, DXL1_ID, ADDR_PRO_PRESENT_POSITION);
if ((dxl_comm_result = dynamixel.getLastTxRxResult(port_num1, PROTOCOL_VERSION)) != COMM_SUCCESS)
{
dynamixel.printTxRxResult(PROTOCOL_VERSION, dxl_comm_result);
}
else if ((dxl_error = dynamixel.getLastRxPacketError(port_num1, PROTOCOL_VERSION)) != 0)
{
dynamixel.printRxPacketError(PROTOCOL_VERSION, dxl_error);
}
// Read Dynamixel#2 present position
dxl2_present_position = (Int32)dynamixel.read4ByteTxRx(port_num2, PROTOCOL_VERSION, DXL2_ID, ADDR_PRO_PRESENT_POSITION);
if ((dxl_comm_result = dynamixel.getLastTxRxResult(port_num2, PROTOCOL_VERSION)) != COMM_SUCCESS)
{
dynamixel.printTxRxResult(PROTOCOL_VERSION, dxl_comm_result);
}
else if ((dxl_error = dynamixel.getLastRxPacketError(port_num2, PROTOCOL_VERSION)) != 0)
{
dynamixel.printRxPacketError(PROTOCOL_VERSION, dxl_error);
}
Console.WriteLine("[ID: {0}] GoalPos: {1} PresPos: {2} [ID: {3}] GoalPos: {4} PresPos: {5}", DXL1_ID, dxl_goal_position[index], dxl1_present_position, DXL2_ID, dxl_goal_position[index], dxl2_present_position);
} while ((Math.Abs(dxl_goal_position[index] - dxl1_present_position) > DXL_MOVING_STATUS_THRESHOLD) || (Math.Abs(dxl_goal_position[index] - dxl2_present_position) > DXL_MOVING_STATUS_THRESHOLD));
// Change goal position
if (index == 0)
{
index = 1;
}
else
{
index = 0;
}
}
```
During `while()` loop, the controller writes and reads each Dynamixel position through packet transmission/reception(Tx/Rx).
To continue their rotation, press any key except ESC.
`write4ByteTxRx()` function sends an instruction to the #`DXL1_ID` and #`DXL2_ID` DYNAMIXEL in `PROTOCOL_VERSION` communication protocol through #`port_num1` and #`port_num2` ports, writing 4 byte of `dxl_goal_position[index]` value to `ADDR_PRO_GOAL_POSITION` address. The function checks Tx/Rx result and receives Hardware error.
`getLastTxRxResult()` function and `getLastRxPacketError()` function get either, and then `printTxRxResult()` function and `printRxPacketError()` function show results on the console window if any communication error or Hardware error has been occurred.
`read4ByteTxRx()` function sends an instruction to the #`DXL1_ID` and #`DXL2_ID` DYNAMIXEL in `PROTOCOL_VERSION` communication protocol through #`port_num1` and #`port_num2` ports, requesting 4 bytes of value in `ADDR_PRO_PRESENT_POSITION` address. The function checks Tx/Rx result and receives Hardware error.
`getLastTxRxResult()` function and `getLastRxPacketError()` function get either, and then `printTxRxResult()` function and `printRxPacketError()` function show results on the console window if any communication error or Hardware error has been occurred.
Reading their present position will be ended when absolute value of `(dxl1_goal_position[index] - dxl1_present_position)` or `(dxl2_goal_position[index] - dxl2_present_position)` becomes smaller then `DXL_MOVING_STATUS_THRESHOLD`.
At last, it changes their direction to the counter-wise and waits for extra key input.
``` cs
// Disable Dynamixel#1 Torque
dynamixel.write1ByteTxRx(port_num1, PROTOCOL_VERSION, DXL1_ID, ADDR_PRO_TORQUE_ENABLE, TORQUE_DISABLE);
if ((dxl_comm_result = dynamixel.getLastTxRxResult(port_num1, PROTOCOL_VERSION)) != COMM_SUCCESS)
{
dynamixel.printTxRxResult(PROTOCOL_VERSION, dxl_comm_result);
}
else if ((dxl_error = dynamixel.getLastRxPacketError(port_num1, PROTOCOL_VERSION)) != 0)
{
dynamixel.printRxPacketError(PROTOCOL_VERSION, dxl_error);
}
// Disable Dynamixel#2 Torque
dynamixel.write1ByteTxRx(port_num2, PROTOCOL_VERSION, DXL2_ID, ADDR_PRO_TORQUE_ENABLE, TORQUE_DISABLE);
if ((dxl_comm_result = dynamixel.getLastTxRxResult(port_num2, PROTOCOL_VERSION)) != COMM_SUCCESS)
{
dynamixel.printTxRxResult(PROTOCOL_VERSION, dxl_comm_result);
}
else if ((dxl_error = dynamixel.getLastRxPacketError(port_num2, PROTOCOL_VERSION)) != 0)
{
dynamixel.printRxPacketError(PROTOCOL_VERSION, dxl_error);
}
```
The controller frees the DYNAMIXEL to be idle.
`write1ByteTxRx()` function sends an instruction to the #`DXL1_ID` and #`DXL2_ID` DYNAMIXEL in `PROTOCOL_VERSION` communication protocol through #`port_num1` and #`port_num2` ports, writing 1 byte of `TORQUE_DISABLE` value to `ADDR_PRO_TORQUE_ENABLE` address. The function checks Tx/Rx result and receives Hardware error.
`getLastTxRxResult()` function and `getLastRxPacketError()` function get either, and then `printTxRxResult()` function and `printRxPacketError()` function show results on the console window if any communication error or Hardware error has been occurred.
``` cs
// Close port1
dynamixel.closePort(port_num1);
// Close port2
dynamixel.closePort(port_num2);
return;
```
Finally, ports become disposed.
| {
"content_hash": "9ac1d2ae9905e0b9c0566a739b369733",
"timestamp": "",
"source": "github",
"line_count": 815,
"max_line_length": 419,
"avg_line_length": 40.176687116564416,
"alnum_prop": 0.6786281456144637,
"repo_name": "ROBOTIS-GIT/emanual",
"id": "6e27ff7e564578a69affb3c3dae4d8709bc087ba",
"size": "32744",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "docs/en/software/dynamixel/dynamixel_sdk/sample_code/csharp/csharp_multi_port_protocol_2_0.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "93960"
},
{
"name": "JavaScript",
"bytes": "181722"
},
{
"name": "Ruby",
"bytes": "3978"
},
{
"name": "SCSS",
"bytes": "121022"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_162) on Sat Feb 02 18:57:41 CET 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>com.communote.common.validation Class Hierarchy (Communote 3.5 API)</title>
<meta name="date" content="2019-02-02">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="com.communote.common.validation Class Hierarchy (Communote 3.5 API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li>Class</li>
<li>Use</li>
<li class="navBarCell1Rev">Tree</li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/communote/common/util/package-tree.html">Prev</a></li>
<li><a href="../../../../com/communote/common/velocity/package-tree.html">Next</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/communote/common/validation/package-tree.html" target="_top">Frames</a></li>
<li><a href="package-tree.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 class="title">Hierarchy For Package com.communote.common.validation</h1>
<span class="packageHierarchyLabel">Package Hierarchies:</span>
<ul class="horizontal">
<li><a href="../../../../overview-tree.html">All Packages</a></li>
</ul>
</div>
<div class="contentContainer">
<h2 title="Class Hierarchy">Class Hierarchy</h2>
<ul>
<li type="circle">java.lang.<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang"><span class="typeNameLink">Object</span></a>
<ul>
<li type="circle">com.communote.common.validation.<a href="../../../../com/communote/common/validation/EmailValidator.html" title="class in com.communote.common.validation"><span class="typeNameLink">EmailValidator</span></a></li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li>Class</li>
<li>Use</li>
<li class="navBarCell1Rev">Tree</li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/communote/common/util/package-tree.html">Prev</a></li>
<li><a href="../../../../com/communote/common/velocity/package-tree.html">Next</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/communote/common/validation/package-tree.html" target="_top">Frames</a></li>
<li><a href="package-tree.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2019 <a href="https://communote.github.io/">Communote team</a>. All rights reserved.</small></p>
</body>
</html>
| {
"content_hash": "f8570a5a19ca0712bc85630465ef299d",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 230,
"avg_line_length": 36.74820143884892,
"alnum_prop": 0.6276429130775254,
"repo_name": "Communote/communote.github.io",
"id": "6d6ddffe3aca6ebbcf4ac3dee1373236f4a96f8d",
"size": "5108",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "generated/javadoc/com/communote/common/validation/package-tree.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "213611"
},
{
"name": "HTML",
"bytes": "526693"
},
{
"name": "JavaScript",
"bytes": "16683"
},
{
"name": "Ruby",
"bytes": "6917"
},
{
"name": "Shell",
"bytes": "513"
}
],
"symlink_target": ""
} |
define(function(require, exports, module) {
var Morris=require("morris");
require("jquery.bootstrap-datetimepicker");
var Validator = require('bootstrap.validator');
var autoSubmitCondition=require("./autoSubmitCondition.js");
require('common/validator-rules').inject(Validator);
var now = new Date();
exports.run = function() {
if($('#data').length > 0){
var data = eval ("(" + $('#data').attr("value") + ")");
Morris.Line({
element: 'line-data',
data: data,
xkey: 'date',
ykeys: ['count'],
labels: [Translator.trans('班级营收额')],
xLabels:"day"
});
}
$("[name=endTime]").datetimepicker({
autoclose: true,
format: 'yyyy-mm-dd',
minView: 'month'
});
$('[name=endTime]').datetimepicker('setEndDate', now);
$('[name=endTime]').datetimepicker('setStartDate', $('#classroomIncomeStartDate').attr("value"));
$("[name=startTime]").datetimepicker({
autoclose: true,
format: 'yyyy-mm-dd',
minView: 'month'
});
$('[name=startTime]').datetimepicker('setEndDate', now);
$('[name=startTime]').datetimepicker('setStartDate', $('#classroomIncomeStartDate').attr("value"));
var validator = new Validator({
element: '#operation-form'});
validator.addItem({
element: '[name=startTime]',
required: true,
rule:'date_check'
});
validator.addItem({
element: '[name=endTime]',
required: true,
rule:'date_check'
});
validator.addItem({
element: '[name=analysisDateType]',
required: true
});
autoSubmitCondition.autoSubmitCondition();
};
}); | {
"content_hash": "b3b64dd50906c2b889c0a1a6bff49795",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 107,
"avg_line_length": 33.13333333333333,
"alnum_prop": 0.49446680080482897,
"repo_name": "richtermark/SMEAGOnline",
"id": "c4d90cf30c7177db479d7eb9ed2d0008642c9a0c",
"size": "1998",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "web/bundles/topxiaadmin/js/controller/analysis/classroom-income.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "2648"
},
{
"name": "CSS",
"bytes": "23380163"
},
{
"name": "CoffeeScript",
"bytes": "83631"
},
{
"name": "HTML",
"bytes": "4844559"
},
{
"name": "JavaScript",
"bytes": "31547974"
},
{
"name": "PHP",
"bytes": "22662089"
},
{
"name": "PLSQL",
"bytes": "7483"
},
{
"name": "Shell",
"bytes": "8793"
},
{
"name": "Smarty",
"bytes": "12"
}
],
"symlink_target": ""
} |
<!--
#%L
A plugin for managing SciJava-based projects.
%%
Copyright (C) 2014 - 2021 SciJava developers.
%%
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
#L%
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.plugin.my.unit</groupId>
<artifactId>Example_PlugIn</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>An example ImageJ 1.x plugin to test scijava-maven-plugin's install-artifact goal</name>
<dependencies>
<dependency>
<groupId>net.imagej</groupId>
<artifactId>ij</artifactId>
<version>1.48s</version>
<optional>true</optional>
</dependency>
</dependencies>
<properties>
<scijava.app.directory>${project.basedir}/target/ImageJ.app/</scijava.app.directory>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.scijava</groupId>
<artifactId>scijava-maven-plugin</artifactId>
<version>${scijava-maven.version}</version>
<executions>
<execution>
<id>install-artifact</id>
<phase>install</phase>
<goals>
<goal>install-artifact</goal>
</goals>
<configuration>
<artifact>${project.groupId}:${project.artifactId}:${project.version}</artifact>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
| {
"content_hash": "22227eb66e283c08b920ff3543e62725",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 201,
"avg_line_length": 38.13513513513514,
"alnum_prop": 0.7296243798724309,
"repo_name": "scijava/scijava-maven-plugin",
"id": "f90cbf5699d16c981a1efad4f881864984630ec4",
"size": "2822",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/it/skip-optional/pom.xml",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Java",
"bytes": "204495"
}
],
"symlink_target": ""
} |
#include "rtp/FecReceiverHandler.h"
#include "./MediaDefinitions.h"
#include "./MediaStream.h"
namespace erizo {
DEFINE_LOGGER(FecReceiverHandler, "rtp.FecReceiverHandler");
FecReceiverHandler::FecReceiverHandler() :
enabled_{false} {
fec_receiver_.reset(webrtc::UlpfecReceiver::Create(this));
}
void FecReceiverHandler::setFecReceiver(std::unique_ptr<webrtc::UlpfecReceiver>&& fec_receiver) { // NOLINT
fec_receiver_ = std::move(fec_receiver);
}
void FecReceiverHandler::enable() {
enabled_ = true;
}
void FecReceiverHandler::disable() {
enabled_ = false;
}
void FecReceiverHandler::notifyUpdate() {
auto pipeline = getContext()->getPipelineShared();
if (!pipeline) {
return;
}
std::shared_ptr<MediaStream> stream = pipeline->getService<MediaStream>();
if (!stream) {
return;
}
bool is_slide_show_mode_active = stream->isSlideShowModeEnabled();
if (!stream->getRemoteSdpInfo()->supportPayloadType(RED_90000_PT) || is_slide_show_mode_active) {
enable();
} else {
disable();
}
}
void FecReceiverHandler::write(Context *ctx, std::shared_ptr<DataPacket> packet) {
if (enabled_ && packet->type == VIDEO_PACKET) {
RtpHeader *rtp_header = reinterpret_cast<RtpHeader*>(packet->data);
if (rtp_header->getPayloadType() == RED_90000_PT) {
// This is a RED/FEC payload, but our remote endpoint doesn't support that
// (most likely because it's firefox :/ )
// Let's go ahead and run this through our fec receiver to convert it to raw VP8
webrtc::RTPHeader hacky_header;
hacky_header.headerLength = rtp_header->getHeaderLength();
hacky_header.sequenceNumber = rtp_header->getSeqNumber();
// FEC copies memory, manages its own memory, including memory passed in callbacks (in the callback,
// be sure to memcpy out of webrtc's buffers
if (fec_receiver_->AddReceivedRedPacket(hacky_header,
(const uint8_t*) packet->data, packet->length, ULP_90000_PT) == 0) {
fec_receiver_->ProcessReceivedFec();
}
}
}
ctx->fireWrite(std::move(packet));
}
bool FecReceiverHandler::OnRecoveredPacket(const uint8_t* rtp_packet, size_t rtp_packet_length) {
getContext()->fireWrite(std::make_shared<DataPacket>(0, (char*)rtp_packet, rtp_packet_length, VIDEO_PACKET)); // NOLINT
return true;
}
int32_t FecReceiverHandler::OnReceivedPayloadData(const uint8_t* /*payload_data*/, size_t /*payload_size*/,
const webrtc::WebRtcRTPHeader* /*rtp_header*/) {
// Unused by WebRTC's FEC implementation; just something we have to implement.
return 0;
}
} // namespace erizo
| {
"content_hash": "d69f54e9f1cb99fdaaafad3fef040b6e",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 122,
"avg_line_length": 35.50666666666667,
"alnum_prop": 0.6785580172737514,
"repo_name": "yangjinecho/licode",
"id": "e951161fc95e1125a91c4bb6d765c822508ce0bc",
"size": "2663",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "erizo/src/erizo/rtp/FecReceiverHandler.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "6144"
},
{
"name": "C++",
"bytes": "1329472"
},
{
"name": "CMake",
"bytes": "7858"
},
{
"name": "Go",
"bytes": "6571"
},
{
"name": "HTML",
"bytes": "13314"
},
{
"name": "JavaScript",
"bytes": "800918"
},
{
"name": "Python",
"bytes": "7062"
},
{
"name": "Ruby",
"bytes": "4432"
},
{
"name": "Shell",
"bytes": "40338"
}
],
"symlink_target": ""
} |
const moment = require(`moment`)
const {
GraphQLString,
GraphQLBoolean,
GraphQLScalarType,
Kind,
} = require(`graphql`)
const _ = require(`lodash`)
const { oneLine } = require(`common-tags`)
const ISO_8601_FORMAT = [
`YYYY`,
`YYYY-MM`,
`YYYY-MM-DD`,
`YYYYMMDD`,
// Local Time
`YYYY-MM-DDTHH`,
`YYYY-MM-DDTHH:mm`,
`YYYY-MM-DDTHHmm`,
`YYYY-MM-DDTHH:mm:ss`,
`YYYY-MM-DDTHHmmss`,
`YYYY-MM-DDTHH:mm:ss.SSS`,
`YYYY-MM-DDTHHmmss.SSS`,
// Coordinated Universal Time (UTC)
`YYYY-MM-DDTHHZ`,
`YYYY-MM-DDTHH:mmZ`,
`YYYY-MM-DDTHHmmZ`,
`YYYY-MM-DDTHH:mm:ssZ`,
`YYYY-MM-DDTHHmmssZ`,
`YYYY-MM-DDTHH:mm:ss.SSSZ`,
`YYYY-MM-DDTHHmmss.SSSZ`,
`YYYY-[W]WW`,
`YYYY[W]WW`,
`YYYY-[W]WW-E`,
`YYYY[W]WWE`,
`YYYY-DDDD`,
`YYYYDDDD`,
]
// Check if this is a date.
// All the allowed ISO 8601 date-time formats used.
export function shouldInfer(value) {
const momentDate = moment.utc(value, ISO_8601_FORMAT, true)
return momentDate.isValid() && typeof value !== `number`
}
export const GraphQLDate = new GraphQLScalarType({
name: `Date`,
description: oneLine`
A date string, such as 2007-12-03, compliant with the ISO 8601 standard
for representation of dates and times using the Gregorian calendar.`,
serialize: String,
parseValue: String,
parseLiteral(ast) {
return ast.kind === Kind.STRING ? ast.value : undefined
},
})
const type = Object.freeze({
type: GraphQLDate,
args: {
formatString: {
type: GraphQLString,
description: oneLine`
Format the date using Moment.js' date tokens e.g.
"date(formatString: "YYYY MMMM DD)"
See https://momentjs.com/docs/#/displaying/format/
for documentation for different tokens`,
},
fromNow: {
type: GraphQLBoolean,
description: oneLine`
Returns a string generated with Moment.js' fromNow function`,
},
difference: {
type: GraphQLString,
description: oneLine`
Returns the difference between this date and the current time.
Defaults to miliseconds but you can also pass in as the
measurement years, months, weeks, days, hours, minutes,
and seconds.`,
},
locale: {
type: GraphQLString,
description: oneLine`
Configures the locale Moment.js will use to format the date.`,
},
},
resolve(source, args, context, { fieldName }) {
let date
if (source[fieldName]) {
date = JSON.parse(JSON.stringify(source[fieldName]))
} else {
return null
}
if (_.isPlainObject(args)) {
const { fromNow, difference, formatString, locale = `en` } = args
if (formatString) {
return moment
.utc(date, ISO_8601_FORMAT, true)
.locale(locale)
.format(formatString)
} else if (fromNow) {
return moment
.utc(date, ISO_8601_FORMAT, true)
.locale(locale)
.fromNow()
} else if (difference) {
return moment().diff(
moment.utc(date, ISO_8601_FORMAT, true).locale(locale),
difference
)
}
}
return date
},
})
export function getType() {
return type
}
| {
"content_hash": "27260580f49875c6cc1f1b3d310fa43b",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 76,
"avg_line_length": 25.158730158730158,
"alnum_prop": 0.6211356466876972,
"repo_name": "0x80/gatsby",
"id": "3f6b513e187c9b205003e4d0e6b2b7b1d025e8aa",
"size": "3170",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "packages/gatsby/src/schema/types/type-date.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "85335"
},
{
"name": "Dockerfile",
"bytes": "1212"
},
{
"name": "HTML",
"bytes": "179905"
},
{
"name": "JavaScript",
"bytes": "1865956"
},
{
"name": "Shell",
"bytes": "4788"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "24b1736b8c0ecefa6a824aeb382cbc0f",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "324e39e4c3769f75b1d105d21590cbed1bc0053d",
"size": "193",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Orchidaceae/Cephalantheropsis/Cephalantheropsis longipes/ Syn. Alismorkis longipes/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
goog.module('grrUi.hunt.huntClientsDirective');
goog.module.declareLegacyNamespace();
/**
* Controller for HuntClientsDirective.
* @unrestricted
*/
const HuntClientsController = class {
/**
* @param {!angular.Scope} $scope
* @ngInject
*/
constructor($scope) {
/** @private {!angular.Scope} */
this.scope_ = $scope;
/** @export {string} */
this.huntClientsUrl;
/** @export {string} */
this.clientType = 'completed';
this.scope_.$watchGroup(
['huntId', 'controller.clientType'],
this.onHuntIdOrClientTypeChange_.bind(this));
}
/**
* Handles huntId attribute changes.
*
* @private
*/
onHuntIdOrClientTypeChange_() {
var huntId = this.scope_['huntId'];
if (!angular.isString(huntId) || !angular.isString(this.clientType)) {
return;
}
this.huntClientsUrl = '/hunts/' + huntId + '/clients/' + this.clientType;
}
};
/**
* Directive for displaying clients of a hunt with a given ID.
*
* @return {angular.Directive} Directive definition object.
* @export
*/
exports.HuntClientsDirective = function() {
return {
scope: {huntId: '='},
restrict: 'E',
templateUrl: '/static/angular-components/hunt/hunt-clients.html',
controller: HuntClientsController,
controllerAs: 'controller'
};
};
/**
* Directive's name in Angular.
*
* @const
* @export
*/
exports.HuntClientsDirective.directive_name = 'grrHuntClients';
| {
"content_hash": "9ed24a1494f7b44d6d7c77f431c47754",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 77,
"avg_line_length": 20.366197183098592,
"alnum_prop": 0.6390041493775933,
"repo_name": "google/grr",
"id": "918f40f435c667e8432deb184e8663669194b2db",
"size": "1446",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "grr/server/grr_response_server/gui/static/angular-components/hunt/hunt-clients-directive.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "12697"
},
{
"name": "C++",
"bytes": "54814"
},
{
"name": "Dockerfile",
"bytes": "1822"
},
{
"name": "HCL",
"bytes": "8451"
},
{
"name": "HTML",
"bytes": "366783"
},
{
"name": "JavaScript",
"bytes": "13088"
},
{
"name": "Jupyter Notebook",
"bytes": "199216"
},
{
"name": "Makefile",
"bytes": "3244"
},
{
"name": "PowerShell",
"bytes": "531"
},
{
"name": "Python",
"bytes": "8844725"
},
{
"name": "Roff",
"bytes": "444"
},
{
"name": "SCSS",
"bytes": "105120"
},
{
"name": "Shell",
"bytes": "48663"
},
{
"name": "Standard ML",
"bytes": "8172"
},
{
"name": "TypeScript",
"bytes": "2139377"
}
],
"symlink_target": ""
} |
package main
import (
"fmt"
"strconv"
"strings"
"time"
)
func parseInt64(v string) int64 {
parsed, _ := strconv.ParseInt(v, 10, 64)
return parsed
}
func parseDuration(v string) time.Duration {
parts := strings.Split(v, " ")
if len(parts) < 1 {
return time.Duration(0)
}
dur, _ := time.ParseDuration(parts[0] + "ms")
return dur
}
type benchmarkResult struct {
Elapsed time.Duration
CPUElapsed time.Duration
OptimizerElapsed time.Duration
}
func (b benchmarkResult) String() string {
buf := &strings.Builder{}
fmt.Fprintf(buf, "%v %v %v", b.Elapsed, b.CPUElapsed, b.OptimizerElapsed)
return buf.String()
}
| {
"content_hash": "c061f5a05b894a189cbfd646776e5543",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 74,
"avg_line_length": 18.91176470588235,
"alnum_prop": 0.6734059097978227,
"repo_name": "cloudspannerecosystem/spanner-bench",
"id": "037359017e355562a9a05a4501c9c214c8a9535f",
"size": "1232",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "internal/tool/result.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "18961"
}
],
"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-beta2) on Mon Mar 19 19:25:38 CST 2007 -->
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<TITLE>
javax.annotation (Java Platform SE 6)
</TITLE><script>var _hmt = _hmt || [];(function() {var hm = document.createElement("script");hm.src = "//hm.baidu.com/hm.js?dd1361ca20a10cc161e72d4bc4fef6df";var s = document.getElementsByTagName("script")[0];s.parentNode.insertBefore(hm, s);})();</script>
<META NAME="date" CONTENT="2007-03-19">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="javax.annotation (Java Platform SE 6)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="跳过导航链接"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>概述</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>软件包</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">类</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>使用</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>树</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>已过时</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>索引</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>帮助</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<b>Java<sup><font size=-2>TM</font></sup> Platform<br>Standard Ed. 6</b></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../javax/activity/package-summary.html"><B>上一个软件包</B></A>
<A HREF="../../javax/annotation/processing/package-summary.html"><B>下一个软件包</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html?javax/annotation/package-summary.html" target="_top"><B>框架</B></A>
<A HREF="package-summary.html" target="_top"><B>无框架</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>所有类</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../allclasses-noframe.html"><B>所有类</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<H2>
软件包 javax.annotation
</H2>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>枚举摘要</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../javax/annotation/Resource.AuthenticationType.html" title="javax.annotation 中的枚举">Resource.AuthenticationType</A></B></TD>
<TD>资源的两种可能验证类型。</TD>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>注释类型摘要</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../javax/annotation/Generated.html" title="javax.annotation 中的注释">Generated</A></B></TD>
<TD>Generated 注释用于标记已生成的源代码。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../javax/annotation/PostConstruct.html" title="javax.annotation 中的注释">PostConstruct</A></B></TD>
<TD>PostConstruct 注释用于在依赖关系注入完成之后需要执行的方法上,以执行任何初始化。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../javax/annotation/PreDestroy.html" title="javax.annotation 中的注释">PreDestroy</A></B></TD>
<TD>PreDestroy 注释作为回调通知用于各方法,以表示该实例正处于被容器移除的过程中。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../javax/annotation/Resource.html" title="javax.annotation 中的注释">Resource</A></B></TD>
<TD>Resource 注释标记应用程序所需的资源。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../javax/annotation/Resources.html" title="javax.annotation 中的注释">Resources</A></B></TD>
<TD>此类用于允许多个资源声明。</TD>
</TR>
</TABLE>
<P>
<DL>
</DL>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="跳过导航链接"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>概述</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>软件包</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">类</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>使用</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>树</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>已过时</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>索引</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>帮助</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<b>Java<sup><font size=-2>TM</font></sup> Platform<br>Standard Ed. 6</b></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../javax/activity/package-summary.html"><B>上一个软件包</B></A>
<A HREF="../../javax/annotation/processing/package-summary.html"><B>下一个软件包</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html?javax/annotation/package-summary.html" target="_top"><B>框架</B></A>
<A HREF="package-summary.html" target="_top"><B>无框架</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>所有类</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../allclasses-noframe.html"><B>所有类</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
<font size="-1"><a href="http://bugs.sun.com/services/bugreport/index.jsp">提交错误或意见</a><br>有关更多的 API 参考资料和开发人员文档,请参阅 <a href="http://java.sun.com/javase/6/webnotes/devdocs-vs-specs.html">Java SE 开发人员文档</a>。该文档包含更详细的、面向开发人员的描述,以及总体概述、术语定义、使用技巧和工作代码示例。 <p>版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守<a href="http://java.sun.com/javase/6/docs/legal/license.html">许可证条款</a>。另请参阅<a href="http://java.sun.com/docs/redist.html">文档重新分发政策</a>。</font>
</BODY>
</HTML>
| {
"content_hash": "80a25dd9d7c3236a6affb630c52faf35",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 441,
"avg_line_length": 43.3936170212766,
"alnum_prop": 0.6432949252267712,
"repo_name": "piterlin/piterlin.github.io",
"id": "dd601c9b55bf12e18a3a2bd9cccd579f59b0e1c3",
"size": "8872",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "doc/jdk6_cn/javax/annotation/package-summary.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "479"
},
{
"name": "HTML",
"bytes": "9480869"
},
{
"name": "JavaScript",
"bytes": "246"
}
],
"symlink_target": ""
} |
/**
* This function is like `baseFor` except that it iterates over properties
* in the opposite order.
*
* @private
* @param {Object} object The object to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @param {Function} keysFunc The function to get the keys of `object`.
* @returns {Object} Returns `object`.
*/
function baseForRight(object, iteratee, keysFunc) {
const iterable = Object(object)
const props = keysFunc(object)
let { length } = props
while (length--) {
const key = props[length]
if (iteratee(iterable[key], key, iterable) === false) {
break
}
}
return object
}
export default baseForRight
| {
"content_hash": "9a4226c1264654f8287a9d7ec89be7d7",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 74,
"avg_line_length": 27.2,
"alnum_prop": 0.6852941176470588,
"repo_name": "HowardWong/lodash-source-code",
"id": "d10c6a15c1a93cb0517b4fec22cc0bb334279b41",
"size": "680",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "code/.internal/baseForRight.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "369560"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "d68b7993823a1e457c00065432f6e262",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "6390eab5cad41d73a8d0973f351934c87feb8553",
"size": "201",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Apiales/Apiaceae/Ligusticum/Ligusticum ajanense/ Syn. Tilingia ajanensis latisecta/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package br.com.vortice.JSegVortice.business;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit test for simple App.
*/
public class AppTest
extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public AppTest( String testName )
{
super( testName );
}
/**
* @return the suite of tests being tested
*/
public static Test suite()
{
return new TestSuite( AppTest.class );
}
/**
* Rigourous Test :-)
*/
public void testApp()
{
assertTrue( true );
}
}
| {
"content_hash": "c40e186b9a3e92546961d58fc81d2b59",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 46,
"avg_line_length": 17.44736842105263,
"alnum_prop": 0.5822021116138764,
"repo_name": "afamorim/Vortice",
"id": "f78dc1e2efb6db08154055536ebb07cf752de4d7",
"size": "663",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "JSegVortice/apps/jsegvortice-business/src/test/java/br/com/vortice/JSegVortice/business/AppTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "726192"
},
{
"name": "HTML",
"bytes": "37594"
},
{
"name": "Java",
"bytes": "250498"
},
{
"name": "JavaScript",
"bytes": "374728"
},
{
"name": "Roff",
"bytes": "300"
}
],
"symlink_target": ""
} |
/**
* SMTI06, M Haidar Hanif, 54411850
* Part of Employ
*/
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.AbstractButton;
import javax.swing.ButtonGroup;
import javax.swing.ButtonModel;
import javax.swing.event.EventListenerList;
@SuppressWarnings("serial")
public class ButtonGroupListener extends ButtonGroup {
private ActionListener btnGrpListener = new BtnGrpListener();
private EventListenerList listenerList = new EventListenerList();
@Override
public void add(AbstractButton b) {
b.addActionListener(btnGrpListener);
super.add(b);
}
public void addActionListener(ActionListener listener) {
listenerList.add(ActionListener.class, listener);
}
public void removeActionListener(ActionListener listener) {
listenerList.remove(ActionListener.class, listener);
}
protected void fireActionListeners() {
Object[] listeners = listenerList.getListenerList();
String actionCommand = "";
ButtonModel model = getSelection();
if (model != null) {
actionCommand = model.getActionCommand();
}
ActionEvent ae = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, actionCommand);
for (int i = listeners.length - 2; i >= 0; i -= 2) {
if (listeners[i] == ActionListener.class) {
((ActionListener) listeners[i + 1]).actionPerformed(ae);
}
}
}
private class BtnGrpListener implements ActionListener {
public void actionPerformed(ActionEvent ae) {
fireActionListeners();
}
}
}
| {
"content_hash": "36fb4493303ae4608c8a27d2350eb6fd",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 88,
"avg_line_length": 27.87272727272727,
"alnum_prop": 0.7221135029354208,
"repo_name": "mhaidarh/employ",
"id": "440a5282d379944a171de39b20801d7a2d2a0ec5",
"size": "1533",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "src/ButtonGroupListener.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "22449"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! -->
<link rel="shortcut icon" href="/static/images/favicon.ico"/>
<link rel="bookmark" href="/static/images/favicon.ico"/>
<title>{% block title%}{% endblock %}</title>
{% block styleLink %}{% endblock %}
<style>
body{
font-family: "Microsoft Yahei",tahoma,arial,"Hiragino Sans GB","helvetica neue",helvetica,arial,Sans-serif,"Hiragino Sans GB","Hiragino Sans GB W3","SimHei";
background-color: #f5f5f5;
position: relative;
}
html,body,section,h1,p,input,label,textarea,span,ul,li,dl,dt,dd,button,h2{
appearance: none;
-webkit-appearance: none;
margin:0; padding:0;
box-sizing: border-box;
/*height= +边框 */
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
}
h2{font-weight: normal;}
button,textarea{
outline:0px none;
border:0 none;
background: transparent;
}
ul li{
list-style: none;
}
</style>
</head>
<body>
{% block content %} {% endblock %}
<!-- 打包后,静态文件路径 -->
<script type="text/javascript">
(function(win) {
var doc = win.document;
var docEl = doc.documentElement;
var tid;
function refreshRem() {
var width = docEl.getBoundingClientRect().width;
var rem = width / 37.5; // 将屏幕宽度分成10份, 1份为1rem
docEl.style.fontSize = rem + 'px';
}
win.addEventListener('resize', function() {
clearTimeout(tid);
tid = setTimeout(refreshRem, 300);
}, false);
win.addEventListener('pageshow', function(e) {
if (e.persisted) {
clearTimeout(tid);
tid = setTimeout(refreshRem, 300);
}
}, false);
refreshRem();
})(window);
</script>
</body>
</html> | {
"content_hash": "cc73cc2562fc3a39f10b314cb8251c80",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 163,
"avg_line_length": 32.10769230769231,
"alnum_prop": 0.5649257307139435,
"repo_name": "FeifeiyuM/feifeiyu_web",
"id": "96ae539e2399ad1a7f33c947abcc36cfe66676c2",
"size": "2187",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/views/layout/base.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "22878"
},
{
"name": "HTML",
"bytes": "33389"
},
{
"name": "JavaScript",
"bytes": "47564"
},
{
"name": "Vue",
"bytes": "1646"
}
],
"symlink_target": ""
} |
<?php
namespace NetSuite\Classes;
class CustomerSearchAdvanced extends SearchRecord {
public $criteria;
public $columns;
public $savedSearchId;
public $savedSearchScriptId;
static $paramtypesmap = array(
"criteria" => "CustomerSearch",
"columns" => "CustomerSearchRow",
"savedSearchId" => "string",
"savedSearchScriptId" => "string",
);
}
| {
"content_hash": "4a51286334e3cb6197b0bae22b570384",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 51,
"avg_line_length": 23.41176470588235,
"alnum_prop": 0.6482412060301508,
"repo_name": "fungku/netsuite-php",
"id": "4a31b1c1c5a0e6055bdae83b4d69f06f67d4660b",
"size": "1118",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Classes/CustomerSearchAdvanced.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "PHP",
"bytes": "2828253"
}
],
"symlink_target": ""
} |
/* this file has been autogenerated by vtkNodeJsWrap */
/* editing this might proof futile */
#ifndef NATIVE_EXTENSION_VTK_VTKCOSMICTREELAYOUTSTRATEGYWRAP_H
#define NATIVE_EXTENSION_VTK_VTKCOSMICTREELAYOUTSTRATEGYWRAP_H
#include <nan.h>
#include <vtkSmartPointer.h>
#include <vtkCosmicTreeLayoutStrategy.h>
#include "vtkGraphLayoutStrategyWrap.h"
#include "../../plus/plus.h"
class VtkCosmicTreeLayoutStrategyWrap : public VtkGraphLayoutStrategyWrap
{
public:
using Nan::ObjectWrap::Wrap;
static void Init(v8::Local<v8::Object> exports);
static void InitPtpl();
static void ConstructorGetter(
v8::Local<v8::String> property,
const Nan::PropertyCallbackInfo<v8::Value>& info);
VtkCosmicTreeLayoutStrategyWrap(vtkSmartPointer<vtkCosmicTreeLayoutStrategy>);
VtkCosmicTreeLayoutStrategyWrap();
~VtkCosmicTreeLayoutStrategyWrap( );
static Nan::Persistent<v8::FunctionTemplate> ptpl;
private:
static void New(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void GetClassName(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void GetLayoutDepth(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void GetNodeSizeArrayName(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void GetSizeLeafNodesOnly(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void IsA(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void Layout(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void NewInstance(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void SafeDownCast(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void SetLayoutDepth(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void SetNodeSizeArrayName(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void SetSizeLeafNodesOnly(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void SizeLeafNodesOnlyOff(const Nan::FunctionCallbackInfo<v8::Value>& info);
static void SizeLeafNodesOnlyOn(const Nan::FunctionCallbackInfo<v8::Value>& info);
#ifdef VTK_NODE_PLUS_VTKCOSMICTREELAYOUTSTRATEGYWRAP_CLASSDEF
VTK_NODE_PLUS_VTKCOSMICTREELAYOUTSTRATEGYWRAP_CLASSDEF
#endif
};
#endif
| {
"content_hash": "20d65b49be06deba28a96a0792b0cbf0",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 85,
"avg_line_length": 41.82692307692308,
"alnum_prop": 0.7898850574712644,
"repo_name": "axkibe/node-vtk",
"id": "37535407ecfcd62176bd83ce06ea52abd173d5cc",
"size": "2175",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "wrappers/7.0.0/vtkCosmicTreeLayoutStrategyWrap.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C++",
"bytes": "75388342"
},
{
"name": "CMake",
"bytes": "915"
},
{
"name": "JavaScript",
"bytes": "70"
},
{
"name": "Roff",
"bytes": "145455"
}
],
"symlink_target": ""
} |
package org.kaaproject.kaa.server.common.dao.impl;
import java.util.List;
import org.kaaproject.kaa.common.dto.NotificationDto;
import org.kaaproject.kaa.common.dto.NotificationTypeDto;
import org.kaaproject.kaa.server.common.dao.model.Notification;
/**
* The Interface NotificationDao.
*
* @param <T> the generic type
*/
public interface NotificationDao<T extends Notification> extends Dao<T, String> {
T save(NotificationDto notification);
/**
* Find notifications by topic id.
*
* @param topicId the topic id
* @return the list of notifications
*/
List<T> findNotificationsByTopicId(String topicId);
/**
* Removes the notifications by topic id.
*
* @param topicId the topic id
*/
void removeNotificationsByTopicId(String topicId);
/**
* Find notifications by topic id,
* notification schema version and start sequence number.
*
* @param topicId the topic id
* @param seqNum the sequence number
* @param sysNfVersion the system notification version
* @param userNfVersion the user notification version
* @return the list of notifications
*/
List<T> findNotificationsByTopicIdAndVersionAndStartSecNum(String topicId, int seqNum, int sysNfVersion, int userNfVersion);
}
| {
"content_hash": "65b21ec8543fa1486d04ff149017c4ef",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 128,
"avg_line_length": 28.282608695652176,
"alnum_prop": 0.7094542659492697,
"repo_name": "liuhu/Kaa",
"id": "75b448dcc0145739ab301358252c74aae0332878",
"size": "1918",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "server/common/dao/src/main/java/org/kaaproject/kaa/server/common/dao/impl/NotificationDao.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "4762"
},
{
"name": "C",
"bytes": "1397470"
},
{
"name": "C++",
"bytes": "1227671"
},
{
"name": "CMake",
"bytes": "71884"
},
{
"name": "CSS",
"bytes": "10373"
},
{
"name": "HTML",
"bytes": "6884"
},
{
"name": "Java",
"bytes": "9328357"
},
{
"name": "Makefile",
"bytes": "5541"
},
{
"name": "Objective-C",
"bytes": "1172379"
},
{
"name": "Python",
"bytes": "128276"
},
{
"name": "Ruby",
"bytes": "247"
},
{
"name": "Shell",
"bytes": "90772"
},
{
"name": "Thrift",
"bytes": "10264"
},
{
"name": "XSLT",
"bytes": "4062"
}
],
"symlink_target": ""
} |
@implementation FPRMemoryGaugeData
- (instancetype)initWithCollectionTime:(NSDate *)collectionTime
heapUsed:(u_long)heapUsed
heapAvailable:(u_long)heapAvailable {
self = [super init];
if (self) {
_collectionTime = collectionTime;
_heapUsed = heapUsed;
_heapAvailable = heapAvailable;
}
return self;
}
@end
| {
"content_hash": "42fafa2cc95ad59e7e3d70c433e4fe0e",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 63,
"avg_line_length": 25.533333333333335,
"alnum_prop": 0.6266318537859008,
"repo_name": "firebase/firebase-ios-sdk",
"id": "2c3cd8475dc1b0e4aeb638df7437f4691187749f",
"size": "1046",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "FirebasePerformance/Sources/Gauges/Memory/FPRMemoryGaugeData.m",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "365959"
},
{
"name": "C++",
"bytes": "8345652"
},
{
"name": "CMake",
"bytes": "91856"
},
{
"name": "JavaScript",
"bytes": "3675"
},
{
"name": "Objective-C",
"bytes": "10276029"
},
{
"name": "Objective-C++",
"bytes": "837306"
},
{
"name": "Python",
"bytes": "117723"
},
{
"name": "Ruby",
"bytes": "179250"
},
{
"name": "Shell",
"bytes": "127192"
},
{
"name": "Swift",
"bytes": "2052268"
},
{
"name": "sed",
"bytes": "2015"
}
],
"symlink_target": ""
} |
#include "../../components/module/ModuleComponent.h"
#include "../../../engine/Engine.h"
namespace Capture3
{
class ExportModule final : public ModuleComponent
{
Q_OBJECT
public:
ExportModule(Engine &engine);
virtual ~ExportModule();
};
}
#endif // CAPTURE3_EXPORT_MODULE_H
| {
"content_hash": "b958c512f1c226307802205758bb7b4c",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 52,
"avg_line_length": 14.454545454545455,
"alnum_prop": 0.6320754716981132,
"repo_name": "ferdikoomen/capture3",
"id": "f9203c328bfa6f71c17d5dec851620b721101c3b",
"size": "386",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/application/modules/export/ExportModule.h",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "487511"
},
{
"name": "CMake",
"bytes": "7773"
},
{
"name": "CSS",
"bytes": "27757"
},
{
"name": "GLSL",
"bytes": "274"
},
{
"name": "Shell",
"bytes": "1018"
}
],
"symlink_target": ""
} |
#define USING_VMI
#include "instrument.h"
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <zipsup.h>
#include <jni.h>
#include <vmi.h>
/*
* This file implements a JVMTI agent to init Instrument instance, and handle class define/redefine events
*/
AgentList *tail = &list;
int gsupport_redefine = 0;
static JNIEnv *jnienv;
//call back function for ClassLoad event
void JNICALL callbackClassFileLoadHook(jvmtiEnv *jvmti_env,
JNIEnv* jni_env,
jclass class_being_redefined,
jobject loader,
const char* name,
jobject protection_domain,
jint class_data_len,
const unsigned char* class_data,
jint* new_class_data_len,
unsigned char** new_class_data){
jclass inst_class = *(gdata->inst_class);
jbyteArray jnew_bytes = NULL;
jbyteArray jold_bytes = (*jni_env)->NewByteArray(jni_env, class_data_len);
jmethodID transform_method = *(gdata->transform_method);
int name_len = strlen(name);
jbyteArray jname_bytes = (*jni_env)->NewByteArray(jni_env, name_len);
//construct java byteArray for old class data and class name
(*jni_env)->SetByteArrayRegion(jni_env, jold_bytes, 0, class_data_len, (unsigned char *)class_data);
(*jni_env)->SetByteArrayRegion(jni_env, jname_bytes, 0, name_len, (char *)name);
//invoke transform method
jnew_bytes = (jbyteArray)(*jni_env)->CallObjectMethod(jni_env, *(gdata->inst), transform_method, loader, jname_bytes, class_being_redefined, protection_domain, jold_bytes);
//get transform result to native char array
if(0 != jnew_bytes){
*new_class_data_len = (*jni_env)->GetArrayLength(jni_env, jnew_bytes);
(*jvmti_env)->Allocate(jvmti_env, *new_class_data_len, new_class_data);
*new_class_data = (*jni_env)->GetPrimitiveArrayCritical(jni_env, jnew_bytes, JNI_FALSE);
(*jni_env)->ReleasePrimitiveArrayCritical(jni_env, jnew_bytes, *new_class_data, 0);
}
return;
}
//call back function for VM init event
void JNICALL callbackVMInit(jvmtiEnv *jvmti, JNIEnv *env, jthread thread){
jmethodID constructor;
static jmethodID transform_method;
static jmethodID premain_method;
static jobject inst_obj;
static jclass inst_class;
jvmtiError err;
AgentList *elem;
PORT_ACCESS_FROM_ENV (env);
inst_class = (*env)->FindClass(env, "org/apache/harmony/instrument/internal/InstrumentationImpl");
if(NULL == inst_class){
(*env)->FatalError(env,"class cannot find: org/apache/harmony/instrument/internal/InstrumentationImpl");
return;
}
inst_class = (jclass)(*env)->NewGlobalRef(env, inst_class);
gdata->inst_class = &inst_class;
constructor = (*env)->GetMethodID(env, inst_class,"<init>", "(Z)V");
if(NULL == constructor){
(*env)->FatalError(env,"constructor cannot be found.");
return;
}
inst_obj = (*env)->NewObject(env, inst_class, constructor, gsupport_redefine?JNI_TRUE:JNI_FALSE);
if(NULL == inst_obj){
(*env)->FatalError(env,"object cannot be inited.");
return;
}
inst_obj = (*env)->NewGlobalRef(env, inst_obj);
gdata->inst = &inst_obj;
transform_method = (*env)->GetMethodID(env, inst_class, "transform", "(Ljava/lang/ClassLoader;[BLjava/lang/Class;Ljava/security/ProtectionDomain;[B)[B");
if(NULL == transform_method){
(*env)->FatalError(env,"transform method cannot find.");
return;
}
gdata->transform_method = &transform_method;
premain_method = (*env)->GetMethodID(env, inst_class, "executePremain", "([B[B)V");
if(NULL == premain_method){
(*env)->FatalError(env,"executePremain method cannot find.");
return;
}
gdata->premain_method = &premain_method;
err = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, NULL);
check_jvmti_error(env, err, "Cannot set JVMTI ClassFileLoadHook event notification mode.");
//parse command options and run premain class here
if(tail == &list){
return;
}
for(elem = list.next; elem != NULL; elem = list.next){
char *agent_options = elem->option;
char *class_name = elem->class_name;
jbyteArray joptions=NULL, jclass_name;
if(class_name){
jclass_name = (*env)->NewByteArray(env, strlen(class_name));
(*env)->SetByteArrayRegion(env, jclass_name, 0, strlen(class_name), class_name);
}else{
goto DEALLOCATE;
}
if(agent_options){
joptions = (*env)->NewByteArray(env, strlen(agent_options));
(*env)->SetByteArrayRegion(env, joptions, 0, strlen(agent_options), agent_options);
}
(*env)->CallObjectMethod(env, *(gdata->inst), *(gdata->premain_method), jclass_name, joptions);
DEALLOCATE:
list.next = elem->next;
hymem_free_memory(elem->class_name);
hymem_free_memory(elem->option);
hymem_free_memory(elem);
}
tail = &list;
}
char* Read_Manifest(JavaVM *vm, JNIEnv *env,const char *jar_name){
I_32 retval;
HyZipFile zipFile;
HyZipEntry zipEntry;
char *result;
int size = 0;
char errorMessage[1024];
/* Reach for the VM interface */
VMI_ACCESS_FROM_JAVAVM(vm);
PORT_ACCESS_FROM_JAVAVM(vm);
/* open zip file */
retval = zip_openZipFile(privatePortLibrary, (char *)jar_name, &zipFile, NULL);
if(retval){
sprintf(errorMessage,"failed to open file:%s, %d\n", jar_name, retval);
(*env)->FatalError(env, errorMessage);
return NULL;
}
/* get manifest entry */
zip_initZipEntry(privatePortLibrary, &zipEntry);
retval = zip_getZipEntry(privatePortLibrary, &zipFile, &zipEntry, "META-INF/MANIFEST.MF", TRUE);
if (retval) {
zip_freeZipEntry(PORTLIB, &zipEntry);
sprintf(errorMessage,"failed to get entry: %d\n", retval);
(*env)->FatalError(env, errorMessage);
return NULL;
}
/* read bytes */
size = zipEntry.uncompressedSize;
result = (char *)hymem_allocate_memory(size*sizeof(char));
retval = zip_getZipEntryData(privatePortLibrary, &zipFile, &zipEntry, result, size);
if(retval){
zip_freeZipEntry(PORTLIB, &zipEntry);
sprintf(errorMessage,"failed to get bytes from zip entry, %d\n", zipEntry.extraFieldLength);
(*env)->FatalError(env, errorMessage);
return NULL;
}
/* free resource */
zip_freeZipEntry(privatePortLibrary, &zipEntry);
retval = zip_closeZipFile(privatePortLibrary, &zipFile);
if (retval) {
sprintf(errorMessage,"failed to close zip file: %s, %d\n", jar_name, retval);
(*env)->FatalError(env, errorMessage);
return NULL;
}
return result;
}
char* read_attribute(JavaVM *vm, char *manifest,char *lwrmanifest, const char * target){
char *pos;
char *end;
char *value;
int length;
PORT_ACCESS_FROM_JAVAVM(vm);
if(NULL == strstr(lwrmanifest,target)){
return NULL;
}
pos = manifest+ (strstr(lwrmanifest,target) - lwrmanifest);
pos += strlen(target)+2;//": "
end = strchr(pos, '\n');
if(NULL == end){
end = manifest + strlen(manifest);
}
/* in windows, has '\r\n' in the end of line, omit '\r' */
if (*(end - 1) == '\r'){
end--;
}
length = end - pos;
value = (char *)hymem_allocate_memory(sizeof(char)*(length+1));
strncpy(value, pos, length);
*(value+length) = '\0';
return value;
}
char* strlower(char * str){
char *temp = str;
while(*temp = tolower(*temp))
temp++;
return str;
}
int str2bol(char *str){
return 0 == strcmp("true", strlower(str));
}
jint Parse_Options(JavaVM *vm, JNIEnv *env, jvmtiEnv *jvmti, const char *agent){
PORT_ACCESS_FROM_JAVAVM(vm);
VMI_ACCESS_FROM_JAVAVM(vm);
AgentList *new_elem = (AgentList *)hymem_allocate_memory(sizeof(AgentList));
char *agent_cpy = (char *)hymem_allocate_memory(sizeof(char)*(strlen(agent)+1));
char *jar_name, *manifest;
char *options = NULL;
char *class_name, *bootclasspath, *str_support_redefine;
char *bootclasspath_item;
char *classpath;
char *classpath_cpy;
int support_redefine = 0;
char *pos;
char *lwrmanifest;
strcpy(agent_cpy, agent);
//parse jar name and options
pos = strchr(agent_cpy, '=');
if(pos>0){
*pos++ = 0;
options = (char *)hymem_allocate_memory(sizeof(char) * (strlen(pos)+1));
strcpy(options, pos);
hymem_free_memory(pos);
}
jar_name =agent_cpy;
//read jar files, find manifest entry and read bytes
//read attributes(premain class, support redefine, bootclasspath)
manifest = Read_Manifest(vm,env, jar_name);
lwrmanifest = (char *)hymem_allocate_memory(sizeof(char) * (strlen(manifest)+1));
strcpy(lwrmanifest,manifest);
strlower(lwrmanifest);
//jar itself added to bootclasspath
check_jvmti_error(env, (*jvmti)->GetSystemProperty(jvmti,"java.class.path",&classpath),"Failed to get classpath.");
classpath_cpy = (char *)hymem_allocate_memory((sizeof(char)*(strlen(classpath)+strlen(jar_name)+2)));
strcpy(classpath_cpy,classpath);
strcat(classpath_cpy,";");
strcat(classpath_cpy,jar_name);
check_jvmti_error(env, (*jvmti)->SetSystemProperty(jvmti, "java.class.path",classpath_cpy),"Failed to set classpath.");
hymem_free_memory(classpath_cpy);
hymem_free_memory(jar_name);
//save options, save class name, add to agent list
class_name = read_attribute(vm, manifest, lwrmanifest,"premain-class");
if(NULL == class_name){
hymem_free_memory(lwrmanifest);
hymem_free_memory(manifest);
(*env)->FatalError(env,"Cannot find Premain-Class attribute.");
}
new_elem->option = options;
new_elem->class_name = class_name;
new_elem->next = NULL;
tail->next = new_elem;
tail = new_elem;
//calculate support redefine
str_support_redefine = read_attribute(vm, manifest, lwrmanifest,"can-redefine-classes");
if(NULL != str_support_redefine){
support_redefine = str2bol(str_support_redefine);
gsupport_redefine |= support_redefine;
hymem_free_memory(str_support_redefine);
}
//add bootclasspath
bootclasspath = read_attribute(vm, manifest, lwrmanifest,"boot-class-path");
if(NULL != bootclasspath){
bootclasspath_item = strtok(bootclasspath, " ");
while(NULL != bootclasspath_item){
check_jvmti_error(env, (*jvmti)->AddToBootstrapClassLoaderSearch(jvmti, bootclasspath_item),"Failed to add bootstrap classpath.");
bootclasspath_item = strtok(NULL, " ");
}
hymem_free_memory(bootclasspath);
}
hymem_free_memory(lwrmanifest);
hymem_free_memory(manifest);
return 0;
}
JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM *vm, char *options, void *reserved){
PORT_ACCESS_FROM_JAVAVM(vm);
VMI_ACCESS_FROM_JAVAVM(vm);
jint err = (*vm)->GetEnv(vm, (void **)&jnienv, JNI_VERSION_1_2);
if(JNI_OK != err){
return err;
}
if(!gdata){
jvmtiCapabilities capabilities;
jvmtiError err;
jvmtiEventCallbacks callbacks;
JNIEnv *env = NULL;
static jvmtiEnv *jvmti;
gdata = hymem_allocate_memory(sizeof(AgentData));
//get jvmti environment
err = (*vm)->GetEnv(vm, (void **)&jvmti, JVMTI_VERSION_1_0);
if(JNI_OK != err){
return err;
}
gdata->jvmti = jvmti;
//set prerequisite capabilities for classfileloadhook, redefine, and VMInit event
memset(&capabilities, 0, sizeof(capabilities));
capabilities.can_generate_all_class_hook_events=1;
capabilities.can_redefine_classes = 1;
//FIXME VM doesnot support the capbility right now.
//capabilities.can_redefine_any_class = 1;
err = (*jvmti)->AddCapabilities(jvmti, &capabilities);
check_jvmti_error(env, err, "Cannot add JVMTI capabilities.");
//set events callback function
(void)memset(&callbacks, 0, sizeof(callbacks));
callbacks.ClassFileLoadHook = &callbackClassFileLoadHook;
callbacks.VMInit = &callbackVMInit;
err = (*jvmti)->SetEventCallbacks(jvmti, &callbacks, sizeof(jvmtiEventCallbacks));
check_jvmti_error(env, err, "Cannot set JVMTI event callback functions.");
//enable classfileloadhook event
err = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, JVMTI_EVENT_VM_INIT, NULL);
check_jvmti_error(env, err, "Cannot set JVMTI VMInit event notification mode.");
}
return Parse_Options(vm,jnienv, gdata->jvmti,options);
}
JNIEXPORT void JNICALL Agent_OnUnload(JavaVM *vm){
PORT_ACCESS_FROM_JAVAVM(vm);
VMI_ACCESS_FROM_JAVAVM(vm);
//free the resource here
if(gdata){
jvmtiEnv *jvmti = gdata->jvmti;
jvmtiError err = (*jvmti)->DisposeEnvironment(jvmti);
if(err != JVMTI_ERROR_NONE) {
(*jnienv)->FatalError(jnienv,"Cannot dispose JVMTI environment.");
}
hymem_free_memory(gdata);
gdata = NULL;
}
return;
}
| {
"content_hash": "0e1cb8dad7b344f6de8b7efe78ddb02b",
"timestamp": "",
"source": "github",
"line_count": 371,
"max_line_length": 174,
"avg_line_length": 32.487870619946094,
"alnum_prop": 0.7007384053762549,
"repo_name": "freeVM/freeVM",
"id": "53d8c5aff3fb6575c609fa0f02485fe9f420d3c6",
"size": "12857",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "enhanced/archive/classlib/java6/modules/instrument/src/main/native/instrument/shared/inst_agt.c",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "116828"
},
{
"name": "C",
"bytes": "17860389"
},
{
"name": "C++",
"bytes": "19007206"
},
{
"name": "CSS",
"bytes": "217777"
},
{
"name": "Java",
"bytes": "152108632"
},
{
"name": "Objective-C",
"bytes": "106412"
},
{
"name": "Objective-J",
"bytes": "11029421"
},
{
"name": "Perl",
"bytes": "305690"
},
{
"name": "Scilab",
"bytes": "34"
},
{
"name": "Shell",
"bytes": "153821"
},
{
"name": "XSLT",
"bytes": "152859"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.